2006-02-28 09:34:41 +00:00
|
|
|
/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
2005-12-20 07:21:59 +00:00
|
|
|
Free Software Foundation, Inc.
|
2000-08-02 15:15:00 +00:00
|
|
|
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
|
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
2000-08-02 15:15:00 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with the GNU C Library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
02111-1307 USA. */
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
#ifndef _LINUX_S390_SYSDEP_H
|
2001-03-12 09:41:17 +00:00
|
|
|
#define _LINUX_S390_SYSDEP_H
|
2000-08-02 15:15:00 +00:00
|
|
|
|
2001-03-16 09:57:45 +00:00
|
|
|
#include <sysdeps/s390/s390-32/sysdep.h>
|
2000-08-02 15:15:00 +00:00
|
|
|
#include <sysdeps/unix/sysdep.h>
|
2004-10-05 16:11:51 +00:00
|
|
|
#include <dl-sysdep.h> /* For RTLD_PRIVATE_ERRNO. */
|
2005-12-20 07:21:59 +00:00
|
|
|
#include <tls.h>
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
/* For Linux we can use the system call table in the header file
|
|
|
|
/usr/include/asm/unistd.h
|
|
|
|
of the kernel. But these symbols do not follow the SYS_* syntax
|
|
|
|
so we have to redefine the `SYS_ify' macro here. */
|
|
|
|
/* in newer 2.1 kernels __NR_syscall is missing so we define it here */
|
|
|
|
#define __NR_syscall 0
|
|
|
|
|
|
|
|
#undef SYS_ify
|
|
|
|
#define SYS_ify(syscall_name) __NR_##syscall_name
|
|
|
|
|
|
|
|
#ifdef __ASSEMBLER__
|
|
|
|
|
|
|
|
/* Linux uses a negative return value to indicate syscall errors, unlike
|
|
|
|
most Unices, which use the condition codes' carry flag.
|
|
|
|
|
|
|
|
Since version 2.1 the return value of a system call might be negative
|
|
|
|
even if the call succeeded. E.g., the `lseek' system call might return
|
|
|
|
a large offset. Therefore we must not anymore test for < 0, but test
|
|
|
|
for a real error by making sure the value in gpr2 is a real error
|
|
|
|
number. Linus said he will make sure the no syscall returns a value
|
|
|
|
in -1 .. -4095 as a valid result so we can savely test with -4095. */
|
|
|
|
|
|
|
|
#undef PSEUDO
|
|
|
|
#define PSEUDO(name, syscall_name, args) \
|
|
|
|
.text; \
|
|
|
|
ENTRY (name) \
|
* locale/programs/ld-ctype.c (ctype_read): When given a repertoire
name of "", store a null pointer instead.
* configure.in (elf): Set to yes for freebsd*, netbsd*.
* configure: Regenerated.
* locale/xlocale.c [! (USE_TLS && HAVE___THREAD)] (__libc_tsd_LOCALE):
Initialize this instead of __libc_tsd_LOCALE_data.
* sysdeps/unix/grantpt.c (pts_name): Convert ENOTTY return from
ptsname_r to EINVAL.
* sysdeps/generic/ptsname.c (__ptsname_r): Return ENOSYS instead of 0.
* rt/Makefile: Revert last change, it was inappropriate to presume aio
implementations depend on pthreads.
* rt/tst-aio.c (do_test): Exit happy if first failure is ENOSYS.
* rt/tst-aio64.c (do_test): Likewise.
* rt/tst-aio2.c (do_test): Likewise.
* rt/tst-aio3.c (do_test): Likewise.
* rt/tst-aio4.c (do_test): Likewise.
* rt/tst-aio5.c (do_test): Likewise.
* rt/tst-aio6.c (do_test): Likewise.
* rt/tst-aio7.c (do_test): Likewise.
* sysdeps/generic/bits/libc-lock.h (__libc_setspecific): Use a cast to
void so as to avoid compiler warnings.
* libio/oldstdfiles.c [! _IO_MTSAFE_IO] (DEF_STDFILE): Don't define
_IO_wide_data_FD, which is never used here.
* libio/iofread.c
[! _IO_MTSAFE_IO] (fread_unlocked): Add libc_hidden_ver defn.
* libio/iofputs.c [! _IO_MTSAFE_IO] (fputs_unlocked): Likewise.
* libio/iofgets.c [! _IO_MTSAFE_IO] (fgets_unlocked): Likewise.
* include/resolv.h [! _LIBC_REENTRANT] (_res): #undef it before decl.
* include/netdb.h [! _LIBC_REENTRANT] (h_errno): Declare normal extern.
* misc/syslog.c (openlog): Conditionalize locking on [_LIBC_REENTRANT].
(closelog): Likewise.
2002-07-06 Bruno Haible <bruno@clisp.org>
* sysdeps/alpha/fpu/fpu_control.h: Comment fix.
* sysdeps/unix/sysv/linux/alpha/pipe.S: Moved to ...
* sysdeps/unix/alpha/pipe.S: ... here.
* sysdeps/unix/bsd/osf/alpha/pipe.S: File removed.
* sysdeps/unix/i386/brk.S: Rename local label to '.Lhere' in ELF.
* sysdeps/unix/i386/brk.S: Add PSEUDO_END invocation.
* sysdeps/unix/i386/fork.S: Likewise.
* sysdeps/unix/i386/pipe.S: Likewise.
* sysdeps/unix/i386/wait.S: Likewise.
* sysdeps/unix/fork.S: Fix PSEUDO_END argument.
* sysdeps/unix/arm/fork.S: Likewise.
* sysdeps/unix/sysv/linux/arm/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/hppa/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/i386/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/sh/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/i386/sysdep.h (PSEUDO): Fix syntax error.
(L): Define right for ELF.
* sysdeps/unix/sysv/linux/i386/sysdep.h (L): Remove definition.
Now defined in sysdeps/i386/sysdep.h.
* sysdeps/posix/readv.c: Ansify function definition.
* sysdeps/posix/writev.c: Likewise.
* stdio-common/tst-fseek.c (main): Don't assume that off_t and size_t
have the same size. Avoid direct cast from size_t to off_t.
* login/tst-utmp.c (simulate_login): Don't leave garbage after the
nul byte in entry[n].ut_user.
(simulate_logout): Likewise.
* login/programs/utmpdump.c (print_entry): Test _HAVE_UT_TYPE,
_HAVE_UT_PID, _HAVE_UT_ID, _HAVE_UT_HOST, instead of assuming the
existence of corresponding members of 'struct utmp'.
* login/tst-utmp.c: Trivialize the test if testing 'struct utmp' and
!_HAVE_UT_TYPE.
* sysdeps/unix/opendir.c (__opendir): If st_blksize is 0 or too small,
allocate a buffer of at least BUFSIZ bytes, not just of
sizeof (struct dirent).
* sysdeps/generic/glob.c: Include <limits.h>.
(NAME_MAX): Define a fallback.
(glob_in_dir): Allocate enough room for a 'struct dirent64' on the
stack.
* posix/tst-dir.c: Include <stddef.h>, for offsetof.
(main): Allocate enough room for a 'struct dirent64' on the stack.
* posix/tst-gnuglob.c (my_DIR): Allocate enough room for a
'struct dirent'.
* sysdeps/unix/sysv/linux/init-first.c: Don't include
kernel-features.h.
* inet/htontest.c: Include <sys/types.h>.
* sysdeps/generic/sys/sysinfo.h: Surround with __{BEGIN,END}_DECLS.
* include/sys/sysctl.h: Comment fix.
* elf/rtld.c (_rtld_global) [! _LIBC_REENTRANT]: Don't initialize
_dl_load_lock.
* libio/fileno.c (fileno_unlocked): Define regardless of _IO_MTSAFE_IO.
* sysdeps/unix/bsd/bsd4.4/syscalls.list (__sigaltstack): New alias.
* sysdeps/unix/inet/syscalls.list (__connect_internal): New alias.
(__getpeername): New alias.
(__getsockname): New alias.
(__socket): New alias.
* sysdeps/unix/common/syscalls.list (getpgid): Remove.
* sysdeps/unix/syscalls.list (__chown_internal): New alias.
(__fcntl_internal): New alias.
(__profil): New alias.
2002-08-26 11:39:12 +00:00
|
|
|
DO_CALL (syscall_name, args); \
|
2000-08-02 15:15:00 +00:00
|
|
|
lhi %r4,-4095 ; \
|
|
|
|
clr %r2,%r4 ; \
|
2003-01-28 10:42:28 +00:00
|
|
|
jnl SYSCALL_ERROR_LABEL
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
#undef PSEUDO_END
|
|
|
|
#define PSEUDO_END(name) \
|
|
|
|
SYSCALL_ERROR_HANDLER; \
|
|
|
|
END (name)
|
|
|
|
|
2003-03-26 18:04:22 +00:00
|
|
|
#undef PSEUDO_NOERRNO
|
2003-03-23 19:44:31 +00:00
|
|
|
#define PSEUDO_NOERRNO(name, syscall_name, args) \
|
|
|
|
.text; \
|
|
|
|
ENTRY (name) \
|
|
|
|
DO_CALL (syscall_name, args)
|
|
|
|
|
|
|
|
#undef PSEUDO_END_NOERRNO
|
|
|
|
#define PSEUDO_END_NOERRNO(name) \
|
|
|
|
END (name)
|
|
|
|
|
Update.
2003-08-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/alpha/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/mips/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sparc/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (PSEUDO_ERRVAL):
Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysdep.h (PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sysv/linux/syscalls.list (posix_fadvise64,
posix_fadvise64_64): Remove.
* sysdeps/unix/sysv/linux/alpha/syscalls.list (posix_fadvise64): Add
V flag.
* sysdeps/unix/sysv/linux/ia64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/x86_64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/i386/posix_fadvise64_64.S: Moved to...
* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: ...here.
(__posix_fadvise64_l64): Fix a typo in fadvise64 syscall invocation.
(__posix_fadvise64_l32): New function.
* sysdeps/unix/sysv/linux/i386/Makefile: Revert last change.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions (libc): Export
posix_fadvise64@@GLIBC_2.3.3.
* sysdeps/unix/sysv/linux/s390/s390-32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/posix_fadvise.c (posix_fadvise): Return
error value.
* sysdeps/unix/sysv/linux/posix_fadvise64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
(SYSCALL_ERROR_HANDLER): Use TLS errno/__libc_errno if USE___THREAD.
2003-08-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/sparc32/dl-machine.h (WEAKADDR): Remove.
(elf_machine_matches_host): Remove weak extern stuff.
Use GL(dl_hwcap) unconditionally and GL(dl_hwcap_mask) if SHARED.
(elf_machine_runtime_setup, sparc_fixup_plt): Remove weak extern
stuff. Use GL(dl_hwcap) unconditionally.
2003-08-17 00:37:19 +00:00
|
|
|
#undef PSEUDO_ERRVAL
|
|
|
|
#define PSEUDO_ERRVAL(name, syscall_name, args) \
|
|
|
|
.text; \
|
|
|
|
ENTRY (name) \
|
|
|
|
DO_CALL (syscall_name, args); \
|
|
|
|
lcr %r2,%r2
|
|
|
|
|
|
|
|
#undef PSEUDO_END_ERRVAL
|
|
|
|
#define PSEUDO_END_ERRVAL(name) \
|
|
|
|
END (name)
|
|
|
|
|
2000-08-02 15:15:00 +00:00
|
|
|
#ifndef PIC
|
2003-01-28 10:42:28 +00:00
|
|
|
# define SYSCALL_ERROR_LABEL 0f
|
|
|
|
# define SYSCALL_ERROR_HANDLER \
|
|
|
|
0: basr %r1,0; \
|
|
|
|
1: l %r1,2f-1b(%r1); \
|
|
|
|
br %r1; \
|
|
|
|
2: .long syscall_error
|
2000-08-02 15:15:00 +00:00
|
|
|
#else
|
2003-01-28 10:42:28 +00:00
|
|
|
# if RTLD_PRIVATE_ERRNO
|
|
|
|
# define SYSCALL_ERROR_LABEL 0f
|
|
|
|
# define SYSCALL_ERROR_HANDLER \
|
|
|
|
0: basr %r1,0; \
|
|
|
|
1: al %r1,2f-1b(%r1); \
|
|
|
|
lcr %r2,%r2; \
|
|
|
|
st %r2,0(%r1); \
|
|
|
|
lhi %r2,-1; \
|
|
|
|
br %r14; \
|
2004-10-04 20:59:38 +00:00
|
|
|
2: .long rtld_errno-1b
|
2003-01-28 10:42:28 +00:00
|
|
|
# elif defined _LIBC_REENTRANT
|
|
|
|
# if USE___THREAD
|
|
|
|
# ifndef NOT_IN_libc
|
|
|
|
# define SYSCALL_ERROR_ERRNO __libc_errno
|
|
|
|
# else
|
|
|
|
# define SYSCALL_ERROR_ERRNO errno
|
|
|
|
# endif
|
|
|
|
# define SYSCALL_ERROR_LABEL 0f
|
|
|
|
# define SYSCALL_ERROR_HANDLER \
|
|
|
|
0: lcr %r0,%r2; \
|
|
|
|
basr %r1,0; \
|
|
|
|
1: al %r1,2f-1b(%r1); \
|
2005-12-20 07:21:59 +00:00
|
|
|
l %r1,SYSCALL_ERROR_ERRNO@gotntpoff(%r1); \
|
|
|
|
ear %r2,%a0; \
|
2003-01-28 10:42:28 +00:00
|
|
|
st %r0,0(%r1,%r2); \
|
|
|
|
lhi %r2,-1; \
|
|
|
|
br %r14; \
|
|
|
|
2: .long _GLOBAL_OFFSET_TABLE_-1b
|
|
|
|
# else
|
|
|
|
# define SYSCALL_ERROR_LABEL 0f
|
|
|
|
# define SYSCALL_ERROR_HANDLER \
|
|
|
|
0: basr %r1,0; \
|
|
|
|
1: al %r1,2f-1b(%r1); \
|
|
|
|
br %r1; \
|
|
|
|
2: .long syscall_error@plt-1b
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define SYSCALL_ERROR_LABEL 0f
|
|
|
|
# define SYSCALL_ERROR_HANDLER \
|
|
|
|
0: basr %r1,0; \
|
|
|
|
1: al %r1,2f-1b(%r1); \
|
|
|
|
l %r1,errno@GOT(%r1); \
|
|
|
|
lcr %r2,%r2; \
|
|
|
|
st %r2,0(%r1); \
|
|
|
|
lhi %r2,-1; \
|
|
|
|
br %r14; \
|
|
|
|
2: .long _GLOBAL_OFFSET_TABLE_-1b
|
|
|
|
# endif /* _LIBC_REENTRANT */
|
2000-08-02 15:15:00 +00:00
|
|
|
#endif /* PIC */
|
|
|
|
|
|
|
|
/* Linux takes system call arguments in registers:
|
|
|
|
|
|
|
|
syscall number 1 call-clobbered
|
|
|
|
arg 1 2 call-clobbered
|
|
|
|
arg 2 3 call-clobbered
|
|
|
|
arg 3 4 call-clobbered
|
|
|
|
arg 4 5 call-clobbered
|
|
|
|
arg 5 6 call-saved
|
2006-02-28 09:34:41 +00:00
|
|
|
arg 6 7 call-saved
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
(Of course a function with say 3 arguments does not have entries for
|
|
|
|
arguments 4 and 5.)
|
2006-02-28 09:34:41 +00:00
|
|
|
For system calls with 6 parameters a stack operation is required
|
|
|
|
to load the 6th parameter to register 7. Call saved register 7 is
|
|
|
|
moved to register 0 and back to avoid an additional stack frame.
|
2000-08-02 15:15:00 +00:00
|
|
|
*/
|
|
|
|
|
* locale/programs/ld-ctype.c (ctype_read): When given a repertoire
name of "", store a null pointer instead.
* configure.in (elf): Set to yes for freebsd*, netbsd*.
* configure: Regenerated.
* locale/xlocale.c [! (USE_TLS && HAVE___THREAD)] (__libc_tsd_LOCALE):
Initialize this instead of __libc_tsd_LOCALE_data.
* sysdeps/unix/grantpt.c (pts_name): Convert ENOTTY return from
ptsname_r to EINVAL.
* sysdeps/generic/ptsname.c (__ptsname_r): Return ENOSYS instead of 0.
* rt/Makefile: Revert last change, it was inappropriate to presume aio
implementations depend on pthreads.
* rt/tst-aio.c (do_test): Exit happy if first failure is ENOSYS.
* rt/tst-aio64.c (do_test): Likewise.
* rt/tst-aio2.c (do_test): Likewise.
* rt/tst-aio3.c (do_test): Likewise.
* rt/tst-aio4.c (do_test): Likewise.
* rt/tst-aio5.c (do_test): Likewise.
* rt/tst-aio6.c (do_test): Likewise.
* rt/tst-aio7.c (do_test): Likewise.
* sysdeps/generic/bits/libc-lock.h (__libc_setspecific): Use a cast to
void so as to avoid compiler warnings.
* libio/oldstdfiles.c [! _IO_MTSAFE_IO] (DEF_STDFILE): Don't define
_IO_wide_data_FD, which is never used here.
* libio/iofread.c
[! _IO_MTSAFE_IO] (fread_unlocked): Add libc_hidden_ver defn.
* libio/iofputs.c [! _IO_MTSAFE_IO] (fputs_unlocked): Likewise.
* libio/iofgets.c [! _IO_MTSAFE_IO] (fgets_unlocked): Likewise.
* include/resolv.h [! _LIBC_REENTRANT] (_res): #undef it before decl.
* include/netdb.h [! _LIBC_REENTRANT] (h_errno): Declare normal extern.
* misc/syslog.c (openlog): Conditionalize locking on [_LIBC_REENTRANT].
(closelog): Likewise.
2002-07-06 Bruno Haible <bruno@clisp.org>
* sysdeps/alpha/fpu/fpu_control.h: Comment fix.
* sysdeps/unix/sysv/linux/alpha/pipe.S: Moved to ...
* sysdeps/unix/alpha/pipe.S: ... here.
* sysdeps/unix/bsd/osf/alpha/pipe.S: File removed.
* sysdeps/unix/i386/brk.S: Rename local label to '.Lhere' in ELF.
* sysdeps/unix/i386/brk.S: Add PSEUDO_END invocation.
* sysdeps/unix/i386/fork.S: Likewise.
* sysdeps/unix/i386/pipe.S: Likewise.
* sysdeps/unix/i386/wait.S: Likewise.
* sysdeps/unix/fork.S: Fix PSEUDO_END argument.
* sysdeps/unix/arm/fork.S: Likewise.
* sysdeps/unix/sysv/linux/arm/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/hppa/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/i386/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/sh/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (PSEUDO): Swap DO_CALL
arguments.
(DO_CALL): Swap argument order.
* sysdeps/i386/sysdep.h (PSEUDO): Fix syntax error.
(L): Define right for ELF.
* sysdeps/unix/sysv/linux/i386/sysdep.h (L): Remove definition.
Now defined in sysdeps/i386/sysdep.h.
* sysdeps/posix/readv.c: Ansify function definition.
* sysdeps/posix/writev.c: Likewise.
* stdio-common/tst-fseek.c (main): Don't assume that off_t and size_t
have the same size. Avoid direct cast from size_t to off_t.
* login/tst-utmp.c (simulate_login): Don't leave garbage after the
nul byte in entry[n].ut_user.
(simulate_logout): Likewise.
* login/programs/utmpdump.c (print_entry): Test _HAVE_UT_TYPE,
_HAVE_UT_PID, _HAVE_UT_ID, _HAVE_UT_HOST, instead of assuming the
existence of corresponding members of 'struct utmp'.
* login/tst-utmp.c: Trivialize the test if testing 'struct utmp' and
!_HAVE_UT_TYPE.
* sysdeps/unix/opendir.c (__opendir): If st_blksize is 0 or too small,
allocate a buffer of at least BUFSIZ bytes, not just of
sizeof (struct dirent).
* sysdeps/generic/glob.c: Include <limits.h>.
(NAME_MAX): Define a fallback.
(glob_in_dir): Allocate enough room for a 'struct dirent64' on the
stack.
* posix/tst-dir.c: Include <stddef.h>, for offsetof.
(main): Allocate enough room for a 'struct dirent64' on the stack.
* posix/tst-gnuglob.c (my_DIR): Allocate enough room for a
'struct dirent'.
* sysdeps/unix/sysv/linux/init-first.c: Don't include
kernel-features.h.
* inet/htontest.c: Include <sys/types.h>.
* sysdeps/generic/sys/sysinfo.h: Surround with __{BEGIN,END}_DECLS.
* include/sys/sysctl.h: Comment fix.
* elf/rtld.c (_rtld_global) [! _LIBC_REENTRANT]: Don't initialize
_dl_load_lock.
* libio/fileno.c (fileno_unlocked): Define regardless of _IO_MTSAFE_IO.
* sysdeps/unix/bsd/bsd4.4/syscalls.list (__sigaltstack): New alias.
* sysdeps/unix/inet/syscalls.list (__connect_internal): New alias.
(__getpeername): New alias.
(__getsockname): New alias.
(__socket): New alias.
* sysdeps/unix/common/syscalls.list (getpgid): Remove.
* sysdeps/unix/syscalls.list (__chown_internal): New alias.
(__fcntl_internal): New alias.
(__profil): New alias.
2002-08-26 11:39:12 +00:00
|
|
|
#define DO_CALL(syscall, args) \
|
2006-02-28 09:34:41 +00:00
|
|
|
.if args > 5; \
|
|
|
|
lr %r0,%r7; \
|
|
|
|
l %r7,96(%r15); \
|
|
|
|
.endif; \
|
2003-03-03 18:36:14 +00:00
|
|
|
.if SYS_ify (syscall) < 256; \
|
|
|
|
svc SYS_ify (syscall); \
|
|
|
|
.else; \
|
|
|
|
lhi %r1,SYS_ify (syscall); \
|
|
|
|
svc 0; \
|
2006-02-28 09:34:41 +00:00
|
|
|
.endif; \
|
|
|
|
.if args > 5; \
|
|
|
|
lr %r7,%r0; \
|
2003-03-03 18:36:14 +00:00
|
|
|
.endif
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
#define ret \
|
|
|
|
br 14
|
|
|
|
|
2003-03-23 19:44:31 +00:00
|
|
|
#define ret_NOERRNO \
|
|
|
|
br 14
|
|
|
|
|
Update.
2003-08-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/alpha/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/mips/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sparc/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (PSEUDO_ERRVAL):
Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysdep.h (PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sysv/linux/syscalls.list (posix_fadvise64,
posix_fadvise64_64): Remove.
* sysdeps/unix/sysv/linux/alpha/syscalls.list (posix_fadvise64): Add
V flag.
* sysdeps/unix/sysv/linux/ia64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/x86_64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/i386/posix_fadvise64_64.S: Moved to...
* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: ...here.
(__posix_fadvise64_l64): Fix a typo in fadvise64 syscall invocation.
(__posix_fadvise64_l32): New function.
* sysdeps/unix/sysv/linux/i386/Makefile: Revert last change.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions (libc): Export
posix_fadvise64@@GLIBC_2.3.3.
* sysdeps/unix/sysv/linux/s390/s390-32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/posix_fadvise.c (posix_fadvise): Return
error value.
* sysdeps/unix/sysv/linux/posix_fadvise64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
(SYSCALL_ERROR_HANDLER): Use TLS errno/__libc_errno if USE___THREAD.
2003-08-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/sparc32/dl-machine.h (WEAKADDR): Remove.
(elf_machine_matches_host): Remove weak extern stuff.
Use GL(dl_hwcap) unconditionally and GL(dl_hwcap_mask) if SHARED.
(elf_machine_runtime_setup, sparc_fixup_plt): Remove weak extern
stuff. Use GL(dl_hwcap) unconditionally.
2003-08-17 00:37:19 +00:00
|
|
|
#define ret_ERRVAL \
|
|
|
|
br 14
|
|
|
|
|
2000-08-02 15:15:00 +00:00
|
|
|
#endif /* __ASSEMBLER__ */
|
|
|
|
|
|
|
|
#undef INLINE_SYSCALL
|
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass
__SYSCALL_STRING to inline_syscall*.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO):
New macros.
(inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3,
inline_syscall4, inline_syscall5, inline_syscall6): Add string
argument.
2002-10-24 Roland McGrath <roland@redhat.com>
* libio/bug-wfflush.c: New file.
* libio/Makefile (tests): Add bug-wfflush.
2002-10-24 18:49:00 +00:00
|
|
|
#define INLINE_SYSCALL(name, nr, args...) \
|
|
|
|
({ \
|
2003-01-09 04:19:03 +00:00
|
|
|
unsigned int _ret = INTERNAL_SYSCALL (name, , nr, args); \
|
|
|
|
if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_ret, ), 0)) \
|
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass
__SYSCALL_STRING to inline_syscall*.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO):
New macros.
(inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3,
inline_syscall4, inline_syscall5, inline_syscall6): Add string
argument.
2002-10-24 Roland McGrath <roland@redhat.com>
* libio/bug-wfflush.c: New file.
* libio/Makefile (tests): Add bug-wfflush.
2002-10-24 18:49:00 +00:00
|
|
|
{ \
|
2003-01-09 04:19:03 +00:00
|
|
|
__set_errno (INTERNAL_SYSCALL_ERRNO (_ret, )); \
|
|
|
|
_ret = 0xffffffff; \
|
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass
__SYSCALL_STRING to inline_syscall*.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO):
New macros.
(inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3,
inline_syscall4, inline_syscall5, inline_syscall6): Add string
argument.
2002-10-24 Roland McGrath <roland@redhat.com>
* libio/bug-wfflush.c: New file.
* libio/Makefile (tests): Add bug-wfflush.
2002-10-24 18:49:00 +00:00
|
|
|
} \
|
2003-01-09 04:19:03 +00:00
|
|
|
(int) _ret; })
|
|
|
|
|
|
|
|
#undef INTERNAL_SYSCALL_DECL
|
|
|
|
#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
|
2000-08-02 15:15:00 +00:00
|
|
|
|
2003-03-03 18:36:14 +00:00
|
|
|
#undef INTERNAL_SYSCALL_DIRECT
|
|
|
|
#define INTERNAL_SYSCALL_DIRECT(name, err, nr, args...) \
|
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass
__SYSCALL_STRING to inline_syscall*.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO):
New macros.
(inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3,
inline_syscall4, inline_syscall5, inline_syscall6): Add string
argument.
2002-10-24 Roland McGrath <roland@redhat.com>
* libio/bug-wfflush.c: New file.
* libio/Makefile (tests): Add bug-wfflush.
2002-10-24 18:49:00 +00:00
|
|
|
({ \
|
|
|
|
DECLARGS_##nr(args) \
|
2003-01-20 18:59:08 +00:00
|
|
|
register int _ret asm("2"); \
|
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass
__SYSCALL_STRING to inline_syscall*.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO):
New macros.
(inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3,
inline_syscall4, inline_syscall5, inline_syscall6): Add string
argument.
2002-10-24 Roland McGrath <roland@redhat.com>
* libio/bug-wfflush.c: New file.
* libio/Makefile (tests): Add bug-wfflush.
2002-10-24 18:49:00 +00:00
|
|
|
asm volatile ( \
|
|
|
|
"svc %b1\n\t" \
|
2003-01-09 04:19:03 +00:00
|
|
|
: "=d" (_ret) \
|
2003-01-20 18:59:08 +00:00
|
|
|
: "i" (__NR_##name) ASMFMT_##nr \
|
|
|
|
: "memory" ); \
|
|
|
|
_ret; })
|
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass
__SYSCALL_STRING to inline_syscall*.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO):
New macros.
(inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3,
inline_syscall4, inline_syscall5, inline_syscall6): Add string
argument.
2002-10-24 Roland McGrath <roland@redhat.com>
* libio/bug-wfflush.c: New file.
* libio/Makefile (tests): Add bug-wfflush.
2002-10-24 18:49:00 +00:00
|
|
|
|
2003-03-03 18:36:14 +00:00
|
|
|
#undef INTERNAL_SYSCALL_SVC0
|
|
|
|
#define INTERNAL_SYSCALL_SVC0(name, err, nr, args...) \
|
|
|
|
({ \
|
|
|
|
DECLARGS_##nr(args) \
|
|
|
|
register unsigned long _nr asm("1") = (unsigned long)(__NR_##name); \
|
|
|
|
register int _ret asm("2"); \
|
|
|
|
asm volatile ( \
|
|
|
|
"svc 0\n\t" \
|
|
|
|
: "=d" (_ret) \
|
2004-09-23 05:17:06 +00:00
|
|
|
: "d" (_nr) ASMFMT_##nr \
|
|
|
|
: "memory" ); \
|
|
|
|
_ret; })
|
|
|
|
|
|
|
|
#undef INTERNAL_SYSCALL_NCS
|
|
|
|
#define INTERNAL_SYSCALL_NCS(no, err, nr, args...) \
|
|
|
|
({ \
|
|
|
|
DECLARGS_##nr(args) \
|
|
|
|
register unsigned long _nr asm("1") = (unsigned long)(no); \
|
|
|
|
register int _ret asm("2"); \
|
|
|
|
asm volatile ( \
|
|
|
|
"svc 0\n\t" \
|
|
|
|
: "=d" (_ret) \
|
|
|
|
: "d" (_nr) ASMFMT_##nr \
|
2003-03-03 18:36:14 +00:00
|
|
|
: "memory" ); \
|
|
|
|
_ret; })
|
|
|
|
|
|
|
|
#undef INTERNAL_SYSCALL
|
|
|
|
#define INTERNAL_SYSCALL(name, err, nr, args...) \
|
|
|
|
(((__NR_##name) < 256) ? \
|
|
|
|
INTERNAL_SYSCALL_DIRECT(name, err, nr, args) : \
|
|
|
|
INTERNAL_SYSCALL_SVC0(name, err,nr, args))
|
|
|
|
|
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass
__SYSCALL_STRING to inline_syscall*.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO):
New macros.
(inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3,
inline_syscall4, inline_syscall5, inline_syscall6): Add string
argument.
2002-10-24 Roland McGrath <roland@redhat.com>
* libio/bug-wfflush.c: New file.
* libio/Makefile (tests): Add bug-wfflush.
2002-10-24 18:49:00 +00:00
|
|
|
#undef INTERNAL_SYSCALL_ERROR_P
|
2003-01-09 04:19:03 +00:00
|
|
|
#define INTERNAL_SYSCALL_ERROR_P(val, err) \
|
|
|
|
((unsigned int) (val) >= 0xfffff001u)
|
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass
__SYSCALL_STRING to inline_syscall*.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO):
New macros.
(inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3,
inline_syscall4, inline_syscall5, inline_syscall6): Add string
argument.
2002-10-24 Roland McGrath <roland@redhat.com>
* libio/bug-wfflush.c: New file.
* libio/Makefile (tests): Add bug-wfflush.
2002-10-24 18:49:00 +00:00
|
|
|
|
|
|
|
#undef INTERNAL_SYSCALL_ERRNO
|
2003-01-09 04:19:03 +00:00
|
|
|
#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
|
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL,
INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): New macros.
(INLINE_SYSCALL): Use that.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
dl-sysdep.h.
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
(__INTERNAL_SYSCALL_STRING): Define.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL): Pass
__SYSCALL_STRING to inline_syscall*.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO):
New macros.
(inline_syscall0, inline_syscall1, inline_syscall2, inline_syscall3,
inline_syscall4, inline_syscall5, inline_syscall6): Add string
argument.
2002-10-24 Roland McGrath <roland@redhat.com>
* libio/bug-wfflush.c: New file.
* libio/Makefile (tests): Add bug-wfflush.
2002-10-24 18:49:00 +00:00
|
|
|
|
2000-08-02 15:15:00 +00:00
|
|
|
#define DECLARGS_0()
|
|
|
|
#define DECLARGS_1(arg1) \
|
2003-01-20 18:59:08 +00:00
|
|
|
register unsigned long gpr2 asm ("2") = (unsigned long)(arg1);
|
2000-08-02 15:15:00 +00:00
|
|
|
#define DECLARGS_2(arg1, arg2) \
|
|
|
|
DECLARGS_1(arg1) \
|
2003-01-20 18:59:08 +00:00
|
|
|
register unsigned long gpr3 asm ("3") = (unsigned long)(arg2);
|
2000-08-02 15:15:00 +00:00
|
|
|
#define DECLARGS_3(arg1, arg2, arg3) \
|
|
|
|
DECLARGS_2(arg1, arg2) \
|
2003-01-20 18:59:08 +00:00
|
|
|
register unsigned long gpr4 asm ("4") = (unsigned long)(arg3);
|
2000-08-02 15:15:00 +00:00
|
|
|
#define DECLARGS_4(arg1, arg2, arg3, arg4) \
|
|
|
|
DECLARGS_3(arg1, arg2, arg3) \
|
2003-01-20 18:59:08 +00:00
|
|
|
register unsigned long gpr5 asm ("5") = (unsigned long)(arg4);
|
2000-08-02 15:15:00 +00:00
|
|
|
#define DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
|
|
|
|
DECLARGS_4(arg1, arg2, arg3, arg4) \
|
2003-01-20 18:59:08 +00:00
|
|
|
register unsigned long gpr6 asm ("6") = (unsigned long)(arg5);
|
2006-02-28 09:34:41 +00:00
|
|
|
#define DECLARGS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
|
|
|
|
DECLARGS_5(arg1, arg2, arg3, arg4, arg5) \
|
|
|
|
register unsigned long gpr7 asm ("7") = (unsigned long)(arg6);
|
2000-08-02 15:15:00 +00:00
|
|
|
|
|
|
|
#define ASMFMT_0
|
2003-01-20 18:59:08 +00:00
|
|
|
#define ASMFMT_1 , "0" (gpr2)
|
|
|
|
#define ASMFMT_2 , "0" (gpr2), "d" (gpr3)
|
|
|
|
#define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4)
|
|
|
|
#define ASMFMT_4 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5)
|
|
|
|
#define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
|
2006-02-28 09:34:41 +00:00
|
|
|
#define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
|
2000-08-02 15:15:00 +00:00
|
|
|
|
2005-12-20 07:21:59 +00:00
|
|
|
|
|
|
|
/* Pointer mangling support. */
|
|
|
|
#if defined NOT_IN_libc && defined IS_IN_rtld
|
|
|
|
/* We cannot use the thread descriptor because in ld.so we use setjmp
|
|
|
|
earlier than the descriptor is initialized. */
|
|
|
|
#else
|
|
|
|
/* For the time being just use stack_guard rather than a separate
|
|
|
|
pointer_guard. */
|
|
|
|
# ifdef __ASSEMBLER__
|
|
|
|
# define PTR_MANGLE(reg, tmpreg) \
|
|
|
|
ear tmpreg,%a0; \
|
|
|
|
x reg,STACK_GUARD(tmpreg)
|
2006-01-02 20:57:43 +00:00
|
|
|
# define PTR_MANGLE2(reg, tmpreg) \
|
|
|
|
x reg,STACK_GUARD(tmpreg)
|
2005-12-20 07:21:59 +00:00
|
|
|
# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
|
|
|
|
# else
|
|
|
|
# define PTR_MANGLE(var) \
|
|
|
|
(var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
|
|
|
|
# define PTR_DEMANGLE(var) PTR_MANGLE (var)
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2000-08-02 15:15:00 +00:00
|
|
|
#endif /* _LINUX_S390_SYSDEP_H */
|