[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Pre-prologue and post-epilogue asm code insertion?

From: Mark Litwack
Subject: [avr-gcc-list] Pre-prologue and post-epilogue asm code insertion?
Date: Mon, 20 Oct 2008 21:55:22 -0400
User-agent: KMail/1.9.10

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

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.

Thanks for any ideas,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]