Referring to syscall numbers in .S files
Joseph Myers
joseph@codesourcery.com
Wed Mar 25 16:29:00 GMT 2015
The x86_64 and x86 lowlevellock.h files have:
/* XXX Remove when no assembler code uses futexes anymore. */
#define SYS_futex __NR_futex
There are (at least) three ways in which .S files refer to syscall
numbers:
* Using SYS_* names. This is *only* for SYS_futex references for x86_64
and x86, apart from a few stray references:
./sysdeps/unix/syscall.S:#ifndef SYS_syscall
./sysdeps/unix/syscall.S:#define SYS_syscall 0
./sysdeps/unix/sysv/linux/i386/clone.S:#define SYS_clone 120
* Using __NR_* names (the Linux kernel convention) directly.
* Using the SYS_ify macro. All such uses are in fact in
sysdeps/unix/sysv/linux files, with individual architecture redefining the
macro in their sysdep.h files to __NR_##syscall_name (there is no shared
sysdeps/unix/sysv/linux/sysdep.h for such things).
What approach should be preferred? Given that only SYS_futex directly
uses SYS_* names in Linux-specific code, maybe those ought to change to
another approach anyway, independent of any removal of the remaining
architecture-specific futex-using .S files?
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list