> -----Original Message----- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > org] On Behalf Of Mark Litwack > Sent: Monday, October 20, 2008 7:55 PM > To: avr-gcc-list@nongnu.org > Subject: [avr-gcc-list] Pre-prologue and post-epilogue asm > code insertion? > > Hi all, > > Is there an easy way to insert a few lines of asm code in an > ISR before the prologue starts (at the ISR entry) and then > some additional code after the epilogue (right before the > RETI)? > > There are a couple of reasons why I'm trying to do this: > > 1) To insert some pin toggling instructions so I can more > accurately track time spent in various ISRs (including > the register save/restores). > > 2) To switch to a different stack for some stack-hungry ISRs > so that I don't have to reserve as much memory in each > task's stack area when running a preemptive RTOS. > > I've been doing it for a few test scenarios by compiling to > assembler and then manually inserting code in the generated > asm, but it's pretty cumbersome. And I don't want to > declare the ISRs as naked since I still want to the compiler > to automatically generate the register save/restore code. >
About the only way to do this that I know of, is to declare the ISRs as naked, but then you have to write the pro/epi-logue yourself. But you already know this. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list