]> sourceware.org Git - glibc.git/commit
Add SYSCALL_ULONG_ARG_[12] to pass long to syscall [BZ #25810]
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 29 Apr 2020 12:35:34 +0000 (05:35 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 29 Apr 2020 12:35:34 +0000 (05:35 -0700)
commit2ad5d0845d80589d0adf86593bd36a7c71a521f8
tree81bc0b7de7e0b93604944ed70e4125866547eb39
parent9207e30d3f070712df6c4175547094be112454d2
Add SYSCALL_ULONG_ARG_[12] to pass long to syscall [BZ #25810]

X32 has 32-bit long and pointer with 64-bit off_t.  Since x32 psABI
requires that pointers passed in registers must be zero-extended to
64bit, x32 can share many syscall interfaces with LP64.  When a LP64
syscall with long and unsigned long int arguments is used for x32, these
arguments must be properly extended to 64-bit.  Otherwise if the upper
32 bits of the register have undefined value, such a syscall will be
rejected by kernel.

For syscalls implemented in assembly codes, 'U' is added to syscall
signature key letters for unsigned long, which is zero-extended to
64-bit types.  SYSCALL_ULONG_ARG_1 and SYSCALL_ULONG_ARG_2 are passed
to syscall-template.S for the first and the second unsigned long int
arguments if PSEUDOS_HAVE_ULONG_INDICES is defined.  They are used by
x32 to zero-extend 32-bit arguments to 64 bits.

Tested on i386, x86-64 and x32 as well as with build-many-glibcs.py.
sysdeps/unix/make-syscalls.sh
sysdeps/unix/syscall-template.S
sysdeps/unix/syscalls.list
sysdeps/unix/sysv/linux/syscalls.list
sysdeps/unix/sysv/linux/x86_64/sysdep.h
sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h
This page took 0.042269 seconds and 5 git commands to generate.