I am running a few threads under a simple scheduler. Since I have interrups as well I have to allocate the interrupt stack size to every thread stack which I would like to avoid by allocating a dedicated stack space for just the interrupt function.
Is there a way of tweaking the stack pointer before the prologue and after the epilogue with GNU AVR? I would like to avoid the __naked__ attribute; otherwise I'd have to deal with the registers myself (which I do not know before compiling). A stub function would do the trick but at the expense of another call / return.
I am sure this problem has been discussed before but the search function here and reading GNU documentation did not yield the desired results; maybe I was using the wrong keywords. Could anybody point me in the right direction?