Given that you're probably writing an x86 kernel, I'd suggest looking into the SYSCALL/SYSENTER instructions.
I could be wrong about this but if my memory serves me correctly, linux syscalls put the first argument in AX, second argument in BX, third argument in CX, and fourth argument in DX. BSD syscalls do the saner thing and just put everything on the stack.
>BSD syscalls do the saner thing and just put everything on the stack.
Is that not slower (requiring a memory store and a SUB, then a load and an ADD to pop) than just MOVing a register?