Anatomy of a system call, part 1
Anatomy of a system call, part 1
Posted Jul 14, 2014 9:45 UTC (Mon) by drysdale (guest, #95971)In reply to: Anatomy of a system call, part 1 by gb
Parent article: Anatomy of a system call, part 1
Having the arguments in registers for the ring transition means that there's no need for fancy footwork to get at the userspace stack memory (compare the innards of copy_from_user()).
Storing the registers on the kernel stack allows the state of the registers to be restored on the return to userspace. But once the parameters are available on the stack, there's no need to preserve them in the registers too – the syscall can get its arguments from the stack (i.e. be asmlinkage) and can immediately use (and clobber) the registers.
