[LLVMdev] LLVM and Interrupt Service Routines.
clattner at apple.com
Fri Jul 24 11:01:29 CDT 2009
On Jul 24, 2009, at 8:47 AM, Jakob Stoklund Olesen wrote:
> Duncan Sands <baldrick at free.fr> writes:
>> the interrupt handler itself is a parameterless procedure that does
>> return a value. As such, I guess calling conventions and so forth
>> not very relevant for it :) In any case llvm-gcc and gcc mainline
>> to output the interrupt handler as an ordinary function on
> There can be significant differences between an interrupt handler
> and a
> void f(void) function. An interrupt handler may have to:
> - Save /all/ registers, including those that are normally caller
> - Use a special return instruction (RETI).
> - Step over the "red zone" on the stack.
> - Set up a safe stack frame before calling normal functions.
> I usually write the first level interrupt handler in assembler, and
> call normal C function from there.
Wouldn't a custom calling convention work for all of these requirements?
More information about the LLVMdev