Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 May 2004 13:29:12 +0200 (CEST)
From:      marcov@stack.nl (Marco van de Voort)
To:        freebsd-hackers@freebsd.org
Subject:   x86-64 syscall ABI conventions
Message-ID:  <20040512112912.2559392@toad.stack.nl>

next in thread | raw e-mail | index | archive | help

To start with the FPC port for x86-64, I've objdumped an empty C prg on an
x86-64, and read the abi document on x86-64.org, but don't understand the
move rcx,r10 before each syscall.

Why is this done? What is exactly saved? If it is a save, where is it
restored from r10?

E.g. 
0000000000402094 <__sys_sigaction>:
  402094:       48 c7 c0 a0 01 00 00    mov    $0x1a0,%rax
  40209b:       49 89 ca                mov    %rcx,%r10	<- This one
  40209e:       0f 05                   syscall
  4020a0:       72 01                   jb     4020a3 <__sys_sigaction+0xf>
  4020a2:       c3                      retq


I did notice that the x86-64 linux abi mentions rcx as being destroyed by
the kernel.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040512112912.2559392>