diff options
author | Andreas Jaeger <aj@suse.de> | 2003-03-04 12:33:28 +0000 |
---|---|---|
committer | Andreas Jaeger <aj@suse.de> | 2003-03-04 12:33:28 +0000 |
commit | 092fd00d56bf0d76e2ffa9b6dd183b1f44f4d940 (patch) | |
tree | d20c028d8a9d1f847c03731be4260590aad3f921 /sysdeps | |
parent | 330a187b8fc3b961602bea71ac3bb09d4ae4edee (diff) | |
download | glibc-092fd00d56bf0d76e2ffa9b6dd183b1f44f4d940.zip glibc-092fd00d56bf0d76e2ffa9b6dd183b1f44f4d940.tar.gz glibc-092fd00d56bf0d76e2ffa9b6dd183b1f44f4d940.tar.bz2 |
Clarify comment.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/sysdep.h | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h index 7c0ea9e..c85c063 100644 --- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -134,37 +134,42 @@ jmp L(pseudo_end); #endif /* PIC */ -/* Linux/x86-64 takes system call arguments in registers: +/* The Linux/x86-64 kernel expects the system call parameters in + registers according to the following table: - Register setup: - system call number rax + syscall number rax arg 1 rdi arg 2 rsi arg 3 rdx - arg 4 rcx + arg 4 r10 arg 5 r8 arg 6 r9 + The Linux kernel uses and destroys internally these registers: return address from syscall rcx additionally clobered: r12-r15,rbx,rbp eflags from syscall r11 - The compiler is going to form a call by coming here, through PSEUDO, with arguments: - - syscall number in the DO_CALL macro - arg 1 rdi - arg 2 rsi - arg 3 rdx - arg 4 r10 - arg 5 r8 - arg 6 r9 - - We have to take care that the stack is alignedto 16 bytes. When - called the stack is not aligned since the return address has just - been pushed. - - Syscalls of more than 6 arguments are not supported. */ + Normal function call, including calls to the system call stub + functions in the libc, get the first six parameters passed in + registers and the seventh parameter and later on the stack. The + register use is as follows: + + system call number in the DO_CALL macro + arg 1 rdi + arg 2 rsi + arg 3 rdx + arg 4 rcx + arg 5 r8 + arg 6 r9 + + We have to take care that the stack is aligned to 16 bytes. When + called the stack is not aligned since the return address has just + been pushed. + + + Syscalls of more than 6 arguments are not supported. */ #undef DO_CALL #define DO_CALL(syscall_name, args) \ |