Linux-MIPS syscall-saved registers?

Which registers are saved across syscalls (not function calls, the actual round-trip to kernelspace via the syscall instruction) on Linux/MIPS?

Judging from the RESTORE_SOME macro in the arch/mips/include/asm/stackframe.h header, it looks like r2-r7, r25, r28, and r31 are restored, and of course callee-saved registers are automatically preserved by the calling convention even in kernelspace (any kernelspace function that's going to use them will save them itself before clobbering them). Is this correct?

Of course at least a couple (r2 and r7) will have their values clobbered with the result of the syscall.


See this link for a description (the only one I'm aware of other than the kernel source itself) of register usage in Linux/MIPS system calls.

I guess that the MIPS ABI Convention should define precisely what registers are containing the syscall number and arguments before the syscall, and what registers are containing the result (including error code) after the syscall. Often syscalls dont use the stack, only registers.

"In keeping with the calling conventions, the syscall preserves the values of those registers that o32 defines as surviving function calls." (See MIPS Run, page 379)

Need Your Help

Move to start of storyboard from button on last screen

ios storyboard

I'm trying to get a storyboard to bring the user back to the first screen of a storyboard when a button is pressed.

jQuery get animation steps before animating, possible?

javascript jquery animation

I need to get a list of steps which jquery will be cycling through BEFORE animating.