update from main archive 961016

This commit is contained in:
Ulrich Drepper 1996-10-17 01:51:33 +00:00
parent 85e960f706
commit 5415516c87
10 changed files with 49 additions and 51 deletions

View File

@ -46,3 +46,4 @@ ENTRY (_setjmp)
#else
jmp C_SYMBOL_NAME (__sigsetjmp)
#endif
PSEUDO_END (_setjmp)

View File

@ -44,3 +44,4 @@ ENTRY (setjmp)
#else
jmp C_SYMBOL_NAME (__sigsetjmp)
#endif
PSEUDO_END (setjmp)

View File

@ -27,6 +27,8 @@ Cambridge, MA 02139, USA. */
.text
ENTRY (__clone)
CALL_MCOUNT
/* Sanity check arguments. */
movel #-EINVAL, %d0
movel 4(%sp), %a0 /* no NULL function pointers */
@ -72,5 +74,6 @@ thread_start:
#else
jbsr _exit
#endif
PSEUDO_END (__clone)
weak_alias (__clone, clone)

View File

@ -22,6 +22,7 @@ Cambridge, MA 02139, USA. */
SYSCALL_ERROR_HANDLER
ENTRY (__mmap)
CALL_MCOUNT
move.l #SYS_ify (mmap), %d0 /* System call number in %d0. */
@ -40,5 +41,6 @@ ENTRY (__mmap)
mmap is declared to return a pointer. */
move.l %d0, %a0
rts
PSEUDO_END (__mmap)
weak_alias (__mmap, mmap)

View File

@ -1,31 +0,0 @@
/* Structure describing state saved while handling a signal. Linux/m68k version.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
/* State of this thread when the signal was taken. */
struct sigcontext
{
__sigset_t sc_mask;
unsigned long sc_usp;
unsigned long sc_d0;
unsigned long sc_d1;
unsigned long sc_a0;
unsigned long sc_a1;
unsigned short sc_sr;
unsigned long sc_pc;
};

View File

@ -20,9 +20,12 @@ Cambridge, MA 02139, USA. */
.text
ENTRY (__sigreturn)
CALL_MCOUNT
addq.l #4, %sp /* Pop the return PC. */
DO_CALL (#SYS_ify (sigreturn), 0)
/* Do the system call; it never returns. */
/* NOTREACHED */
PSEUDO_END (__sigreturn)
weak_alias (__sigreturn, sigreturn)

View File

@ -35,6 +35,7 @@ Cambridge, MA 02139, USA. */
.globl P(__,socket)
ENTRY (P(__,socket))
CALL_MCOUNT
/* Save registers. */
move.l %d2, %a0
@ -58,5 +59,6 @@ ENTRY (P(__,socket))
/* Successful; return the syscall's value. */
rts
PSEUDO_END (P(__,socket))
weak_alias (P(__,socket), socket)

View File

@ -18,14 +18,20 @@ Cambridge, MA 02139, USA. */
#include <sysdep.h>
/* Please consult the file sysdeps/unix/sysv/linux/m68k/sysdep.h for
more information about the value -128 used below.*/
.text
SYSCALL_ERROR_HANDLER
ENTRY (syscall)
move.l (%sp)+, %a0 /* Pop return address. */
DO_CALL ((%sp), 5) /* Frob the args and do the system call. */
tst.l %d0 /* Check %d0 for error. */
jmi error /* Jump to error handler if negative. */
jmp (%a0) /* Return to caller. */
CALL_MCOUNT
error: pea (%a0)
jra syscall_error
move.l 4(%sp), %d0 /* Load syscall number. */
_DOARGS_5 (24) /* Frob arguments. */
trap &0 /* Do the system call. */
UNDOARGS_5 /* Unfrob arguments. */
moveq.l &-128, %d1
cmp.l %d1, %d0 /* Check %d0 for error. */
jcc syscall_error /* Jump to error handler if negative. */
rts /* Return to caller. */
PSEUDO_END (syscall)

View File

@ -46,7 +46,7 @@ __errno = errno /* This name is expected by the MT code. */
/* The syscall stubs jump here when they detect an error. */
ENTRY(__syscall_error)
ENTRY (__syscall_error)
neg.l %d0
move.l %d0, errno
#ifdef _LIBC_REENTRANT
@ -59,14 +59,15 @@ ENTRY(__syscall_error)
return a pointer. */
move.l %d0, %a0
rts
.size __syscall_error, . - __syscall_error
PSEUDO_END (__syscall_error)
#endif /* PIC */
ERRNO(__errno_location)
ENTRY (__errno_location)
CALL_MCOUNT
#ifdef PIC
move.l (%pc, errno@GOTPC), %a0
#else
lea errno, %a0
#endif
rts
.size __errno_location, . - __errno_location
PSEUDO_END (__errno_location)

View File

@ -33,8 +33,6 @@ Cambridge, MA 02139, USA. */
#ifdef ASSEMBLER
#define POUND #
/* Define an entry point visible from C. */
#define ENTRY(name) \
.globl name; \
@ -67,14 +65,26 @@ Cambridge, MA 02139, USA. */
#define syscall_error __syscall_error
/* Linux uses a negative return value to indicate syscall errors, unlike
most Unices, which use the condition codes' carry flag. */
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 %d0 is a real error
number. For now (as of 2.1.1) 122 is the largest defined error number.
We allow for a bit of room for development and treat -128 to -1 as
error values. */
#define PSEUDO(name, syscall_name, args) \
.text; \
SYSCALL_ERROR_HANDLER \
ENTRY (name) \
DO_CALL (POUND SYS_ify (syscall_name), args); \
tst.l %d0; \
jmi syscall_error;
DO_CALL (&SYS_ify (syscall_name), args); \
moveq.l &-128, %d1; \
cmp.l %d1, %d0; \
jcc syscall_error
#undef PSEUDO_END
#define PSEUDO_END(name) .size name, . - name
#ifdef PIC
/* Store (- %d0) into errno through the GOT. */
@ -88,7 +98,7 @@ syscall_error: \
move.l %d0, -(%sp); \
jbsr __errno_location@PLTPC; \
move.l (%sp)+, (%a0); \
move.l POUND -1, %d0; \
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; \
@ -100,7 +110,7 @@ syscall_error: \
move.l (errno@GOTPC, %pc), %a0; \
neg.l %d0; \
move.l %d0, (%a0); \
move.l POUND -1, %d0; \
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; \
@ -138,7 +148,7 @@ syscall_error: \
#define DO_CALL(syscall, args) \
move.l syscall, %d0; \
DOARGS_##args \
trap POUND 0; \
trap &0; \
UNDOARGS_##args
#define DOARGS_0 /* No arguments to frob. */