mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 19:00:07 +00:00
Update.
2003-01-05 Kaz Kojima <kkojima@rr.iij4u.or.jp> * sysdeps/unix/sysv/linux/sh/clone.S (__clone): Use SYSCALL_ERROR_HANDLER. * sysdeps/unix/sysv/linux/sh/pipe.S (__libc_pipe): Likewise. * sysdeps/unix/sysv/linux/sh/socket.S (__socket): Likewise. Add support for cancellation handling. * sysdeps/unix/sysv/linux/sh/syscall.S (__syscall): Use SYSCALL_ERROR_HANDLER. * sysdeps/unix/sysv/linux/sh/vfork.S (__vfork): Likewise. * sysdeps/unix/sysv/linux/sh/sysdep.h (PSEUDO): Likewise. Add support for cancellation handling. (SYSCALL_ERROR_HANDLER): Define PIC variants.
This commit is contained in:
parent
bdee30cfe4
commit
bbd1745596
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
2003-01-05 Kaz Kojima <kkojima@rr.iij4u.or.jp>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/sh/clone.S (__clone): Use
|
||||||
|
SYSCALL_ERROR_HANDLER.
|
||||||
|
* sysdeps/unix/sysv/linux/sh/pipe.S (__libc_pipe): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/sh/socket.S (__socket): Likewise.
|
||||||
|
Add support for cancellation handling.
|
||||||
|
* sysdeps/unix/sysv/linux/sh/syscall.S (__syscall): Use
|
||||||
|
SYSCALL_ERROR_HANDLER.
|
||||||
|
* sysdeps/unix/sysv/linux/sh/vfork.S (__vfork): Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/sh/sysdep.h (PSEUDO): Likewise.
|
||||||
|
Add support for cancellation handling.
|
||||||
|
(SYSCALL_ERROR_HANDLER): Define PIC variants.
|
||||||
|
|
||||||
2003-01-04 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
|
2003-01-04 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Mark
|
* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Mark
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2003-01-05 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* Makefile (libc.so-no-z-defs): Define to yes.
|
||||||
|
|
||||||
2003-01-05 Kaz Kojima <kkojima@rr.iij4u.or.jp>
|
2003-01-05 Kaz Kojima <kkojima@rr.iij4u.or.jp>
|
||||||
|
|
||||||
* sysdeps/sh/tls.h: Include dl-sysdep.h and stdint.h.
|
* sysdeps/sh/tls.h: Include dl-sysdep.h and stdint.h.
|
||||||
|
@ -171,6 +171,9 @@ $(objpfx)libc_pic_lite.os: $(objpfx)libc_pic_lite.a $(objpfx)libc-tsd.os
|
|||||||
$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
|
$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
|
||||||
$(LDFLAGS-c_pic.os) -Wl,-d -Wl,--whole-archive $^
|
$(LDFLAGS-c_pic.os) -Wl,-d -Wl,--whole-archive $^
|
||||||
|
|
||||||
|
# This trick leaves errno and h_errno undefined.
|
||||||
|
libc.so-no-z-defs = yes
|
||||||
|
|
||||||
$(objpfx)libc.so: $(elfobjdir)/soinit.os \
|
$(objpfx)libc.so: $(elfobjdir)/soinit.os \
|
||||||
$(objpfx)libc_pic_lite.os \
|
$(objpfx)libc_pic_lite.os \
|
||||||
$(elfobjdir)/sofini.os \
|
$(elfobjdir)/sofini.os \
|
||||||
|
@ -1,7 +1,50 @@
|
|||||||
|
2003-01-05 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/jmp-unwind.c: Include <pthread-functions.h>.
|
||||||
|
Use __libc_pthread_functions array if SHARED.
|
||||||
|
|
||||||
|
* pthreadP.h: Move pthread_cond_2_0_t definition to...
|
||||||
|
* sysdeps/unix/sysv/linux/internaltypes.h: ...here.
|
||||||
|
|
||||||
|
* sysdeps/pthread/bits/libc-lock.h (__libc_ptf_call): New #define.
|
||||||
|
(__libc_rwlock_rdlock, __libc_rwlock_wrlock, __libc_rwlock_unlock,
|
||||||
|
__libc_key_create, __libc_getspecific, __libc_setspecific): Use
|
||||||
|
__libc_ptf_call instead of __libc_maybe_call.
|
||||||
|
(PTF): New #define.
|
||||||
|
(__libc_cleanup_region_start): Wrap function name with PTF call.
|
||||||
|
(__libc_cleanup_region_end): Likewise.
|
||||||
|
(__libc_cleanup_end): Likewise.
|
||||||
|
|
||||||
|
* pthread_getspecific.c: Add __pthread_getspecific_internal alias.
|
||||||
|
* pthread_setspecific.c: Add __pthread_setspecific_internal alias.
|
||||||
|
* pthread_key_create.c: Add __pthread_key_create_internal alias.
|
||||||
|
* pthreadP.h: Add prototypes.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/lowlevelrwlock.S: Add
|
||||||
|
__pthread_rwlock_rdlock, __pthread_rwlock_wrlock, and
|
||||||
|
__pthread_rwlock_unlock aliases.
|
||||||
|
* pthreadP.h: Add prototypes for new aliases.
|
||||||
|
|
||||||
|
* pthreadP.h (struct pthead_functions): Moved to...
|
||||||
|
* sysdeps/pthread/pthread-functions.h: ...here. New file.
|
||||||
|
* init.c (pthread_functions): Add initializers for new elements.
|
||||||
|
|
||||||
|
* cleanup_defer.c: Add __pthread_cleanup_push_defer and
|
||||||
|
__pthread_cleanup_pop_restore aliases.
|
||||||
|
* pthreadP.h: Add prototypes.
|
||||||
|
|
||||||
|
* cleanup.c: Rename _GI_pthread_cleanup_push to __pthread_cleanup_push
|
||||||
|
and _GI_pthread_cleanup_pop to __pthread_cleanup_pop.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/i486/lowlevelcond.S: Adjust caller.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/pthread_once.S: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Likewise.
|
||||||
|
* pthreadP.h: Adjust prototypes and callers.
|
||||||
|
|
||||||
2003-01-04 Ulrich Drepper <drepper@redhat.com>
|
2003-01-04 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* Makefile (tests): Add tst-cancel7.
|
* Makefile (tests): Add tst-cancel7.
|
||||||
(tst-cancel7-ARGS): New variable.
|
(tst-cancel7-ARGS): New variable.
|
||||||
|
* tst-cancel7.c: New file.
|
||||||
|
|
||||||
* old_pthread_cond_broadcast.c: Optimize initialization a bit to work
|
* old_pthread_cond_broadcast.c: Optimize initialization a bit to work
|
||||||
around gcc defficiencies.
|
around gcc defficiencies.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
/* Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -32,27 +32,9 @@ ENTRY(__clone)
|
|||||||
bf/s 1f
|
bf/s 1f
|
||||||
tst r5, r5
|
tst r5, r5
|
||||||
bf/s 1f
|
bf/s 1f
|
||||||
mov.l .L1, r1
|
mov #-EINVAL,r0
|
||||||
#ifdef SHARED
|
bra .Lsyscall_error
|
||||||
mov.l r12, @-r15
|
nop
|
||||||
sts.l pr, @-r15
|
|
||||||
mov.l .LG, r12
|
|
||||||
mova .LG, r0
|
|
||||||
add r0, r12
|
|
||||||
mova .L1, r0
|
|
||||||
add r0, r1
|
|
||||||
jsr @r1
|
|
||||||
mov #-EINVAL, r4
|
|
||||||
lds.l @r15+, pr
|
|
||||||
rts
|
|
||||||
mov.l @r15+, r12
|
|
||||||
#else
|
|
||||||
jmp @r1
|
|
||||||
mov #-EINVAL, r4
|
|
||||||
#endif
|
|
||||||
.align 2
|
|
||||||
.L1:
|
|
||||||
.long PLTJMP(C_SYMBOL_NAME(__syscall_error))
|
|
||||||
1:
|
1:
|
||||||
/* insert the args onto the new stack */
|
/* insert the args onto the new stack */
|
||||||
mov.l r7, @-r5
|
mov.l r7, @-r5
|
||||||
@ -68,36 +50,16 @@ ENTRY(__clone)
|
|||||||
shad r2, r1
|
shad r2, r1
|
||||||
not r1, r1 // r1=0 means r0 = -1 to -4095
|
not r1, r1 // r1=0 means r0 = -1 to -4095
|
||||||
tst r1, r1 // i.e. error in linux
|
tst r1, r1 // i.e. error in linux
|
||||||
bf 2f
|
bf .Lclone_end
|
||||||
mov.l .L2, r1
|
.Lsyscall_error:
|
||||||
#ifdef SHARED
|
SYSCALL_ERROR_HANDLER
|
||||||
mov r0, r4
|
.Lclone_end:
|
||||||
mov.l r12, @-r15
|
|
||||||
sts.l pr, @-r15
|
|
||||||
mov.l .LG, r12
|
|
||||||
mova .LG, r0
|
|
||||||
add r0, r12
|
|
||||||
mova .L2, r0
|
|
||||||
add r0, r1
|
|
||||||
jsr @r1
|
|
||||||
nop
|
|
||||||
lds.l @r15+, pr
|
|
||||||
rts
|
|
||||||
mov.l @r15+, r12
|
|
||||||
#else
|
|
||||||
jmp @r1
|
|
||||||
mov r0, r4
|
|
||||||
#endif
|
|
||||||
.align 2
|
|
||||||
.L2:
|
|
||||||
.long PLTJMP(C_SYMBOL_NAME(__syscall_error))
|
|
||||||
|
|
||||||
2:
|
|
||||||
tst r0, r0
|
tst r0, r0
|
||||||
bt 3f
|
bt 2f
|
||||||
|
.Lpseudo_end:
|
||||||
rts
|
rts
|
||||||
nop
|
nop
|
||||||
3:
|
2:
|
||||||
/* thread starts */
|
/* thread starts */
|
||||||
mov.l @r15, r1
|
mov.l @r15, r1
|
||||||
jsr @r1
|
jsr @r1
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -26,37 +26,16 @@ ENTRY (__libc_pipe)
|
|||||||
shad r2, r3
|
shad r2, r3
|
||||||
not r3, r3 // r1=0 means r0 = -1 to -4095
|
not r3, r3 // r1=0 means r0 = -1 to -4095
|
||||||
tst r3, r3 // i.e. error in linux
|
tst r3, r3 // i.e. error in linux
|
||||||
bf 1f
|
bt 1f
|
||||||
mov.l .L2, r1
|
|
||||||
#ifdef SHARED
|
|
||||||
mov r0, r4
|
|
||||||
mov.l r12, @-r15
|
|
||||||
sts.l pr, @-r15
|
|
||||||
mov.l 0f, r12
|
|
||||||
mova 0f, r0
|
|
||||||
add r0, r12
|
|
||||||
mova .L2, r0
|
|
||||||
add r0, r1
|
|
||||||
jsr @r1
|
|
||||||
nop
|
|
||||||
lds.l @r15+, pr
|
|
||||||
rts
|
|
||||||
mov.l @r15+, r12
|
|
||||||
.align 2
|
|
||||||
0:
|
|
||||||
.long _GLOBAL_OFFSET_TABLE_
|
|
||||||
#else
|
|
||||||
jmp @r1
|
|
||||||
mov r0, r4
|
|
||||||
#endif
|
|
||||||
1:
|
|
||||||
mov.l r0, @r4
|
mov.l r0, @r4
|
||||||
mov.l r1, @(4, r4)
|
mov.l r1, @(4, r4)
|
||||||
rts
|
rts
|
||||||
mov #0, r0
|
mov #0, r0
|
||||||
.align 2
|
1:
|
||||||
.L2:
|
SYSCALL_ERROR_HANDLER
|
||||||
.long PLTJMP(C_SYMBOL_NAME(__syscall_error))
|
.Lpseudo_end:
|
||||||
|
rts
|
||||||
|
nop
|
||||||
PSEUDO_END (__libc_pipe)
|
PSEUDO_END (__libc_pipe)
|
||||||
|
|
||||||
weak_alias (__libc_pipe, __pipe)
|
weak_alias (__libc_pipe, __pipe)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
/* Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -16,8 +16,9 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep-cancel.h>
|
||||||
#include <socketcall.h>
|
#include <socketcall.h>
|
||||||
|
#include <tls.h>
|
||||||
|
|
||||||
#define P(a, b) P2(a, b)
|
#define P(a, b) P2(a, b)
|
||||||
#define P2(a, b) a##b
|
#define P2(a, b) a##b
|
||||||
@ -63,7 +64,12 @@ ENTRY (__socket)
|
|||||||
/* Push args onto the stack. */
|
/* Push args onto the stack. */
|
||||||
P(PUSHARGS_,NARGS)
|
P(PUSHARGS_,NARGS)
|
||||||
|
|
||||||
/* Do the system call trap. */
|
#if defined NEED_CANCELLATION && defined CENABLE
|
||||||
|
SINGLE_THREAD_P
|
||||||
|
bf .Lsocket_cancel
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Do the system call trap. */
|
||||||
mov #+P(SOCKOP_,socket), r4
|
mov #+P(SOCKOP_,socket), r4
|
||||||
mov r15, r5
|
mov r15, r5
|
||||||
mov.l .L1,r3
|
mov.l .L1,r3
|
||||||
@ -77,39 +83,44 @@ ENTRY (__socket)
|
|||||||
shad r2, r1
|
shad r2, r1
|
||||||
not r1, r1 // r1=0 means r0 = -1 to -4095
|
not r1, r1 // r1=0 means r0 = -1 to -4095
|
||||||
tst r1, r1 // i.e. error in linux
|
tst r1, r1 // i.e. error in linux
|
||||||
bf 1f
|
bf .Lpseudo_end
|
||||||
|
.Lsyscall_error:
|
||||||
mov.l .L2, r1
|
SYSCALL_ERROR_HANDLER
|
||||||
#ifdef SHARED
|
.Lpseudo_end:
|
||||||
mov r0, r4
|
|
||||||
mov.l r12, @-r15
|
|
||||||
sts.l pr, @-r15
|
|
||||||
mov.l 0f, r12
|
|
||||||
mova 0f, r0
|
|
||||||
add r0, r12
|
|
||||||
mova .L2, r0
|
|
||||||
add r0, r1
|
|
||||||
jsr @r1
|
|
||||||
nop
|
|
||||||
lds.l @r15+, pr
|
|
||||||
rts
|
|
||||||
mov.l @r15+, r12
|
|
||||||
.align 2
|
|
||||||
0:
|
|
||||||
.long _GLOBAL_OFFSET_TABLE_
|
|
||||||
#else
|
|
||||||
jmp @r1
|
|
||||||
mov r0, r4
|
|
||||||
#endif
|
|
||||||
1:
|
|
||||||
/* Successful; return the syscall's value. */
|
/* Successful; return the syscall's value. */
|
||||||
rts
|
rts
|
||||||
nop
|
nop
|
||||||
|
|
||||||
|
#if defined NEED_CANCELLATION && defined CENABLE
|
||||||
|
.Lsocket_cancel:
|
||||||
|
/* Enable asynchronous cancellation. */
|
||||||
|
CENABLE
|
||||||
|
|
||||||
|
/* Do the system call trap. */
|
||||||
|
mov #+P(SOCKOP_,socket), r4
|
||||||
|
mov r15, r5
|
||||||
|
mov.l .L1,r3
|
||||||
|
trapa #0x12
|
||||||
|
|
||||||
|
mov.l r0,@-r15
|
||||||
|
CDISABLE
|
||||||
|
mov.l @r15+,r0
|
||||||
|
|
||||||
|
/* Pop args off the stack */
|
||||||
|
P(POPARGS_,NARGS)
|
||||||
|
|
||||||
|
mov r0, r1
|
||||||
|
mov #-12, r2
|
||||||
|
shad r2, r1
|
||||||
|
not r1, r1 // r1=0 means r0 = -1 to -4095
|
||||||
|
tst r1, r1 // i.e. error in linux
|
||||||
|
bf .Lpseudo_end
|
||||||
|
bra .Lsyscall_error
|
||||||
|
nop
|
||||||
|
#endif
|
||||||
.align 2
|
.align 2
|
||||||
.L1:
|
.L1:
|
||||||
.long SYS_ify(socketcall)
|
.long SYS_ify(socketcall)
|
||||||
.L2:
|
|
||||||
.long PLTJMP(C_SYMBOL_NAME(__syscall_error))
|
|
||||||
|
|
||||||
PSEUDO_END (__socket)
|
PSEUDO_END (__socket)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2000 Free Software Foundation, Inc.
|
/* Copyright (C) 2000, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -33,36 +33,12 @@ ENTRY (__syscall)
|
|||||||
shad r2, r1
|
shad r2, r1
|
||||||
not r1, r1 // r1=0 means r0 = -1 to -4095
|
not r1, r1 // r1=0 means r0 = -1 to -4095
|
||||||
tst r1, r1 // i.e. error in linux
|
tst r1, r1 // i.e. error in linux
|
||||||
bf 1f
|
bf .Lpseudo_end
|
||||||
mov.l .L2, r1
|
SYSCALL_ERROR_HANDLER
|
||||||
#ifdef SHARED
|
.Lpseudo_end:
|
||||||
mov r0, r4
|
|
||||||
mov.l r12, @-r15
|
|
||||||
sts.l pr, @-r15
|
|
||||||
mov.l 0f, r12
|
|
||||||
mova 0f, r0
|
|
||||||
add r0, r12
|
|
||||||
mova .L2, r0
|
|
||||||
add r0, r1
|
|
||||||
jsr @r1
|
|
||||||
nop
|
|
||||||
lds.l @r15+, pr
|
|
||||||
rts
|
|
||||||
mov.l @r15+, r12
|
|
||||||
.align 2
|
|
||||||
0:
|
|
||||||
.long _GLOBAL_OFFSET_TABLE_
|
|
||||||
#else
|
|
||||||
jmp @r1
|
|
||||||
mov r0, r4
|
|
||||||
#endif
|
|
||||||
1:
|
|
||||||
rts
|
rts
|
||||||
nop
|
nop
|
||||||
|
|
||||||
.align 2
|
|
||||||
.L2:
|
|
||||||
.long PLTJMP(C_SYMBOL_NAME(__syscall_error))
|
|
||||||
PSEUDO_END (__syscall)
|
PSEUDO_END (__syscall)
|
||||||
|
|
||||||
weak_alias (__syscall, syscall)
|
weak_alias (__syscall, syscall)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1992,93,95-99,2000,02 Free Software Foundation, Inc.
|
/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
|
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
|
||||||
Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
|
Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
|
||||||
@ -45,9 +45,9 @@
|
|||||||
returns a value in -1 .. -4095 as a valid result so we can savely
|
returns a value in -1 .. -4095 as a valid result so we can savely
|
||||||
test with -4095. */
|
test with -4095. */
|
||||||
|
|
||||||
|
#define _IMM1 #-1
|
||||||
#define _IMM12 #-12
|
#define _IMM12 #-12
|
||||||
#undef PSEUDO
|
#undef PSEUDO
|
||||||
#ifdef SHARED
|
|
||||||
#define PSEUDO(name, syscall_name, args) \
|
#define PSEUDO(name, syscall_name, args) \
|
||||||
.text; \
|
.text; \
|
||||||
ENTRY (name); \
|
ENTRY (name); \
|
||||||
@ -57,50 +57,99 @@
|
|||||||
shad r2,r1; \
|
shad r2,r1; \
|
||||||
not r1,r1; \
|
not r1,r1; \
|
||||||
tst r1,r1; \
|
tst r1,r1; \
|
||||||
bf 1f; \
|
bf .Lpseudo_end; \
|
||||||
mov r0,r4; \
|
SYSCALL_ERROR_HANDLER; \
|
||||||
mov.l r12,@-r15; \
|
.Lpseudo_end:
|
||||||
sts.l pr,@-r15; \
|
|
||||||
mov.l 0f,r12; \
|
|
||||||
mova 0f,r0; \
|
|
||||||
add r0,r12; \
|
|
||||||
mov.l 2f,r1; \
|
|
||||||
mova 2f,r0; \
|
|
||||||
add r0,r1; \
|
|
||||||
jsr @r1; \
|
|
||||||
nop; \
|
|
||||||
lds.l @r15+,pr; \
|
|
||||||
rts; \
|
|
||||||
mov.l @r15+,r12; \
|
|
||||||
.align 2; \
|
|
||||||
2: .long PLTJMP(C_SYMBOL_NAME(__syscall_error)); \
|
|
||||||
0: .long _GLOBAL_OFFSET_TABLE_; \
|
|
||||||
1:
|
|
||||||
#else
|
|
||||||
#define PSEUDO(name, syscall_name, args) \
|
|
||||||
.text; \
|
|
||||||
ENTRY (name); \
|
|
||||||
DO_CALL (syscall_name, args); \
|
|
||||||
mov r0,r1; \
|
|
||||||
mov _IMM12,r2; \
|
|
||||||
shad r2,r1; \
|
|
||||||
not r1,r1; \
|
|
||||||
tst r1,r1; \
|
|
||||||
bf 1f; \
|
|
||||||
mov.l 2f,r1; \
|
|
||||||
jmp @r1; \
|
|
||||||
mov r0, r4; \
|
|
||||||
.align 2; \
|
|
||||||
2: .long PLTJMP(C_SYMBOL_NAME(__syscall_error)); \
|
|
||||||
1:
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef PSEUDO_END
|
#undef PSEUDO_END
|
||||||
#define PSEUDO_END(name) \
|
#define PSEUDO_END(name) \
|
||||||
SYSCALL_ERROR_HANDLER \
|
|
||||||
END (name)
|
END (name)
|
||||||
|
|
||||||
#define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
|
#ifndef PIC
|
||||||
|
# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
|
||||||
|
#else
|
||||||
|
# if RTLD_PRIVATE_ERRNO
|
||||||
|
# define SYSCALL_ERROR_HANDLER \
|
||||||
|
neg r0,r1; \
|
||||||
|
mov.l 0f,r12; \
|
||||||
|
mova 0f,r0; \
|
||||||
|
add r0,r12; \
|
||||||
|
mov.l 1f,r0; \
|
||||||
|
mov.l r1,@(r0,r12)
|
||||||
|
bra .Lpseudo_end; \
|
||||||
|
mov _IMM1,r0; \
|
||||||
|
.align 2; \
|
||||||
|
0: .long _GLOBAL_OFFSET_TABLE_; \
|
||||||
|
1: .long errno@GOTOFF
|
||||||
|
|
||||||
|
# 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_HANDLER \
|
||||||
|
neg r0,r1; \
|
||||||
|
mov r12,r2; \
|
||||||
|
mov.l 0f,r12; \
|
||||||
|
mova 0f,r0; \
|
||||||
|
add r0,r12; \
|
||||||
|
mov.l 1f,r0; \
|
||||||
|
stc gbr, r4; \
|
||||||
|
mov.l @(r0,r12),r0; \
|
||||||
|
mov r2,r12; \
|
||||||
|
add r4,r0; \
|
||||||
|
mov.l r1,@r0; \
|
||||||
|
bra .Lpseudo_end; \
|
||||||
|
mov _IMM1,r0; \
|
||||||
|
.align 2; \
|
||||||
|
0: .long _GLOBAL_OFFSET_TABLE_; \
|
||||||
|
1: .long SYSCALL_ERROR_ERRNO@GOTTPOFF
|
||||||
|
# else
|
||||||
|
# define SYSCALL_ERROR_HANDLER \
|
||||||
|
neg r0,r1; \
|
||||||
|
mov.l r12,@-r15; \
|
||||||
|
mov.l r1,@-r15; \
|
||||||
|
mov.l 0f,r12; \
|
||||||
|
mova 0f,r0; \
|
||||||
|
add r0,r12; \
|
||||||
|
sts.l pr,@-r15; \
|
||||||
|
mov.l 1f,r1; \
|
||||||
|
bsrf r1; \
|
||||||
|
nop; \
|
||||||
|
2: lds.l @r15+,pr; \
|
||||||
|
mov.l @r15+,r1; \
|
||||||
|
mov.l r1,@r0; \
|
||||||
|
mov.l @r15+,r12; \
|
||||||
|
bra .Lpseudo_end; \
|
||||||
|
mov _IMM1,r0; \
|
||||||
|
.align 2; \
|
||||||
|
0: .long _GLOBAL_OFFSET_TABLE_; \
|
||||||
|
1: .long PLTJMP(C_SYMBOL_NAME(__errno_location))-(2b+2-.)
|
||||||
|
/* A quick note: it is assumed that the call to `__errno_location' does
|
||||||
|
not modify the stack! */
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
/* Store (-r0) into errno through the GOT. */
|
||||||
|
# define SYSCALL_ERROR_HANDLER \
|
||||||
|
neg r0,r1; \
|
||||||
|
mov r12,r2; \
|
||||||
|
mov.l 0f,r12; \
|
||||||
|
mova 0f,r0; \
|
||||||
|
add r0,r12; \
|
||||||
|
mov.l 1f,r0; \
|
||||||
|
mov.l @(r0,r12),r0; \
|
||||||
|
mov r2,r12; \
|
||||||
|
mov.l r1,@r0; \
|
||||||
|
bra .Lpseudo_end; \
|
||||||
|
mov _IMM1,r0; \
|
||||||
|
.align 2; \
|
||||||
|
0: .long _GLOBAL_OFFSET_TABLE_; \
|
||||||
|
1: .long errno@GOT
|
||||||
|
# endif /* _LIBC_REENTRANT */
|
||||||
|
#endif /* PIC */
|
||||||
|
|
||||||
#define SYSCALL_INST0 trapa #0x10
|
#define SYSCALL_INST0 trapa #0x10
|
||||||
#define SYSCALL_INST1 trapa #0x11
|
#define SYSCALL_INST1 trapa #0x11
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
|
/* Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -39,28 +39,8 @@ ENTRY (__vfork)
|
|||||||
mov.w .L1, r1
|
mov.w .L1, r1
|
||||||
cmp/eq r1, r0
|
cmp/eq r1, r0
|
||||||
bt 2f
|
bt 2f
|
||||||
mov.l .L2, r1
|
bra .Lsyscall_error
|
||||||
#ifdef SHARED
|
|
||||||
mov r0, r4
|
|
||||||
mov.l r12, @-r15
|
|
||||||
sts.l pr, @-r15
|
|
||||||
mov.l 0f, r12
|
|
||||||
mova 0f, r0
|
|
||||||
add r0, r12
|
|
||||||
mova .L2, r0
|
|
||||||
add r0, r1
|
|
||||||
jsr @r1
|
|
||||||
nop
|
nop
|
||||||
lds.l @r15+, pr
|
|
||||||
rts
|
|
||||||
mov.l @r15+, r12
|
|
||||||
.align 2
|
|
||||||
0:
|
|
||||||
.long _GLOBAL_OFFSET_TABLE_
|
|
||||||
#else
|
|
||||||
jmp @r1
|
|
||||||
mov r0, r4
|
|
||||||
#endif
|
|
||||||
.L1:
|
.L1:
|
||||||
.word -ENOSYS
|
.word -ENOSYS
|
||||||
.L3: .word __NR_vfork
|
.L3: .word __NR_vfork
|
||||||
@ -78,33 +58,10 @@ ENTRY (__vfork)
|
|||||||
shad r2, r1
|
shad r2, r1
|
||||||
not r1, r1 // r1=0 means r0 = -1 to -4095
|
not r1, r1 // r1=0 means r0 = -1 to -4095
|
||||||
tst r1, r1 // i.e. error in linux
|
tst r1, r1 // i.e. error in linux
|
||||||
bf 1f
|
bf .Lpseudo_end
|
||||||
mov.l .L2, r1
|
.Lsyscall_error:
|
||||||
#ifdef SHARED
|
SYSCALL_ERROR_HANDLER
|
||||||
mov r0, r4
|
.Lpseudo_end:
|
||||||
mov.l r12, @-r15
|
|
||||||
sts.l pr, @-r15
|
|
||||||
mov.l 0f, r12
|
|
||||||
mova 0f, r0
|
|
||||||
add r0, r12
|
|
||||||
mova .L2, r0
|
|
||||||
add r0, r1
|
|
||||||
jsr @r1
|
|
||||||
nop
|
|
||||||
lds.l @r15+, pr
|
|
||||||
rts
|
|
||||||
mov.l @r15+, r12
|
|
||||||
.align 2
|
|
||||||
0:
|
|
||||||
.long _GLOBAL_OFFSET_TABLE_
|
|
||||||
#else
|
|
||||||
jmp @r1
|
|
||||||
mov r0, r4
|
|
||||||
#endif
|
|
||||||
.align 2
|
|
||||||
.L2:
|
|
||||||
.long PLTJMP(C_SYMBOL_NAME(__syscall_error))
|
|
||||||
1:
|
|
||||||
rts
|
rts
|
||||||
nop
|
nop
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user