mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
*** empty log message ***
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
* sysdeps/unix/sysv/linux/m68k/sysdep.h (INTERNAL_SYSCALL): Define.
|
* sysdeps/unix/sysv/linux/m68k/sysdep.h (INTERNAL_SYSCALL): Define.
|
||||||
(INLINE_SYSCALL): Use it.
|
(INLINE_SYSCALL): Use it.
|
||||||
(INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): Define.
|
(INTERNAL_SYSCALL_ERROR_P, INTERNAL_SYSCALL_ERRNO): Define.
|
||||||
|
(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/m68k/getpagesize.c: Use INTERNAL_SYSCALL.
|
* sysdeps/unix/sysv/linux/m68k/getpagesize.c: Use INTERNAL_SYSCALL.
|
||||||
* sysdeps/unix/sysv/linux/m68k/brk.c: Likewise.
|
* sysdeps/unix/sysv/linux/m68k/brk.c: Likewise.
|
||||||
|
@ -33,7 +33,7 @@ __brk (void *addr)
|
|||||||
{
|
{
|
||||||
void *newbrk;
|
void *newbrk;
|
||||||
|
|
||||||
newbrk = INTERNAL_SYSCALL (brk, 1, addr);
|
newbrk = (void *) INTERNAL_SYSCALL (brk, 1, addr);
|
||||||
__curbrk = newbrk;
|
__curbrk = newbrk;
|
||||||
|
|
||||||
if (newbrk < addr)
|
if (newbrk < addr)
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
#include <sysdeps/unix/sysdep.h>
|
#include <sysdeps/unix/sysdep.h>
|
||||||
#include <sysdeps/m68k/sysdep.h>
|
#include <sysdeps/m68k/sysdep.h>
|
||||||
|
|
||||||
|
/* Defines RTLD_PRIVATE_ERRNO. */
|
||||||
|
#include <dl-sysdep.h>
|
||||||
|
|
||||||
/* For Linux we can use the system call table in the header file
|
/* For Linux we can use the system call table in the header file
|
||||||
/usr/include/asm/unistd.h
|
/usr/include/asm/unistd.h
|
||||||
of the kernel. But these symbols do not follow the SYS_* syntax
|
of the kernel. But these symbols do not follow the SYS_* syntax
|
||||||
@ -66,9 +69,21 @@
|
|||||||
END (name)
|
END (name)
|
||||||
|
|
||||||
#ifdef PIC
|
#ifdef PIC
|
||||||
|
# ifdef RTLD_PRIVATE_ERRNO
|
||||||
|
# define SYSCALL_ERROR_HANDLER \
|
||||||
|
SYSCALL_ERROR_LABEL: \
|
||||||
|
lea (errno, %pc), %a0; \
|
||||||
|
neg.l %d0; \
|
||||||
|
move.l %d0, (%a0); \
|
||||||
|
move.l &-1, %d0; \
|
||||||
|
/* Copy return value to %a0 for syscalls that are declared to return \
|
||||||
|
a pointer (e.g., mmap). */ \
|
||||||
|
move.l %d0, %a0; \
|
||||||
|
rts;
|
||||||
|
# else /* !RTLD_PRIVATE_ERRNO */
|
||||||
/* Store (- %d0) into errno through the GOT. */
|
/* Store (- %d0) into errno through the GOT. */
|
||||||
#ifdef _LIBC_REENTRANT
|
# if defined _LIBC_REENTRANT
|
||||||
#define SYSCALL_ERROR_HANDLER \
|
# define SYSCALL_ERROR_HANDLER \
|
||||||
SYSCALL_ERROR_LABEL: \
|
SYSCALL_ERROR_LABEL: \
|
||||||
neg.l %d0; \
|
neg.l %d0; \
|
||||||
move.l %d0, -(%sp); \
|
move.l %d0, -(%sp); \
|
||||||
@ -79,8 +94,8 @@ SYSCALL_ERROR_LABEL: \
|
|||||||
a pointer (e.g., mmap). */ \
|
a pointer (e.g., mmap). */ \
|
||||||
move.l %d0, %a0; \
|
move.l %d0, %a0; \
|
||||||
rts;
|
rts;
|
||||||
#else /* !_LIBC_REENTRANT */
|
# else /* !_LIBC_REENTRANT */
|
||||||
#define SYSCALL_ERROR_HANDLER \
|
# define SYSCALL_ERROR_HANDLER \
|
||||||
SYSCALL_ERROR_LABEL: \
|
SYSCALL_ERROR_LABEL: \
|
||||||
move.l (errno@GOTPC, %pc), %a0; \
|
move.l (errno@GOTPC, %pc), %a0; \
|
||||||
neg.l %d0; \
|
neg.l %d0; \
|
||||||
@ -90,9 +105,10 @@ SYSCALL_ERROR_LABEL: \
|
|||||||
a pointer (e.g., mmap). */ \
|
a pointer (e.g., mmap). */ \
|
||||||
move.l %d0, %a0; \
|
move.l %d0, %a0; \
|
||||||
rts;
|
rts;
|
||||||
#endif /* _LIBC_REENTRANT */
|
# endif /* _LIBC_REENTRANT */
|
||||||
|
# endif /* RTLD_PRIVATE_ERRNO */
|
||||||
#else
|
#else
|
||||||
#define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
|
# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
|
||||||
#endif /* PIC */
|
#endif /* PIC */
|
||||||
|
|
||||||
/* Linux takes system call arguments in registers:
|
/* Linux takes system call arguments in registers:
|
||||||
|
Reference in New Issue
Block a user