Luca Dariz, le mar. 28 févr. 2023 14:25:59 +0100, a ecrit: > Il 27/02/23 23:02, Samuel Thibault ha scritto: > > > +#if defined(__x86_64__) && ! defined(USER32) > > > +#define kernel_trap(trap_name,trap_number,number_args) \ > > > +ENTRY(trap_name) \ > > > + movq $ trap_number,%rax; \ > > > > > + movq %rcx,%r10; \ > > > > What is that for? > > The syscall instruction automatically stores RIP in RCX, but RCX is also the > place for the 4th arg passed to a function, so we need another register to > store it. In this case R10 is the only non-callee-preserved register > remaining.
Ah, right, I noticed that later in the patch, and didn't think it was explaining this instruction :) Thanks, Samuel