Is there a way to make GCC save all used registers before a system-call assembly instruction and restore them after the system-call assembly instruction ? The idea is that, since the compiler knows what registers it is using, it could save and restore those registers, so that the kernel would only need to save the stack-pointer register and program-counter.