x86_64 register constaints
Posted: Sun May 30, 2010 6:15 am
I'm trying to tell port my syscall functions to x86_64 using the native parameter passing of the processor. So far I've got something like this.
There is no register constraint for r8 hence the XXX. If I don't have the constraints, gcc thinks I'm not going to use the parameters and they get optimised away. What can I do ? Thanks in advance.
Code: Select all
static inline uint64_t _Syscall4(uint64_t __n, uint64_t __p1, uint64_t __p2, uint64_t __p3, uint64_t __p4) {
long ret;
__asm__ __volatile__ ( \
"int $0x20\n\t"
: "=a" (ret)
: "D" (__n), "S" (__p1), "d" (__p2), "c" (__p3), "XXX" (__p4)
);
return ret;
}