Re: Is it safe to save just part of registers in interrupt/exception handler?

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

 



"PRC" <panruochen@xxxxxxxxx> writes:

> The MIPS ABI document says:
> For non-leaf function,$31 must be saved.  If any of
> $16..$23 or$29..$31 is changed within the called function, it must be saved
> in the stack frame before use and restored from the stack frame before re-
> turn from the function. 
>
> My interrupt/exception handler contains two parts: one written in assembly
> and the other written in C. The ASM handler does some simple work like
> saving status, epc and gerneral registers and then jumps/calls to the C handler
> to do more complex work. Since MIPS ABI guarantees $16~$23 and $29~$31 are saved
> in C functions if they are used, is it safe to save only those registers except $16~$23 and $29~$31 in ASM handler?

In general, yes.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux