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.