This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Referring to syscall numbers in .S files
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Wed, 25 Mar 2015 16:29:32 +0000
- Subject: Referring to syscall numbers in .S files
- Authentication-results: sourceware.org; auth=none
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