bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/5] x86_64: add 64-bit syscall entry point


From: Samuel Thibault
Subject: Re: [PATCH 5/5] x86_64: add 64-bit syscall entry point
Date: Tue, 28 Feb 2023 14:34:54 +0100
User-agent: NeoMutt/20170609 (1.8.3)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]