ABI question, porting ports to amd64
Marco van de Voort
marcov at stack.nl
Sun May 16 05:31:41 PDT 2004
> I read the ABI info on x86-64.org, and objdumped some linux and freebsd
> code, and I ran into a linux<->freebsd difference something I can't figure
> out:
Answering my own question:
FreeBSD uses the gcc mechanism to build the same parameterlist for a syscall
like for a normal procedure. (to avoid having to shift params)
The register for the 4th parameter for gcc is %rcx, for the kernel it is
%r10. So gcc puts the 4th param in %rcx, and the move moves it to %r10 for
the kernel.
More information about the freebsd-amd64
mailing list