summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/m68k/sysdep.h
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>1998-03-06 01:48:50 +0000
committerAndreas Schwab <schwab@suse.de>1998-03-06 01:48:50 +0000
commit9f2990dbbf39786d7396caf65006093fc4f52b2e (patch)
tree9e37069038c0fbda2529658a564bf67c7fa26cdb /sysdeps/unix/sysv/linux/m68k/sysdep.h
parentb5efde2fd3c061e546b0012e7cf6d6f8e74c6960 (diff)
downloadglibc-9f2990dbbf39786d7396caf65006093fc4f52b2e.tar.gz
* sysdeps/m68k/add_n.S: Use ENTRY and END macros.
* sysdeps/m68k/lshift.S: Likewise. * sysdeps/m68k/rshift.S: Likewise. * sysdeps/m68k/sub_n.S: Likewise. * sysdeps/m68k/m68020/addmul_1.S: Likewise. * sysdeps/m68k/m68020/mul_1.S: Likewise. * sysdeps/m68k/m68020/submul_1.S: Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep.S: Use ENTRY macro. [_LIBC_REENTRANT]: Don't store into global errno. * sysdeps/m68k/sysdep.h: New file. * sysdeps/unix/sysv/linux/m68k/sysdep.h: Use it. Use the macros ENTRY, CALL_MCOUNT, JUMPTARGET and syscall_error from there. (DO_CALL): Change to expect syscall name as argument. (PSEUDO): Pass syscall_name to DO_CALL. (SYSCALL_ERROR_HANDLER) [_LIBC_REENTRANT]: Don't store into global errno. Fri Mar 6 10:40:30 1998 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/add_n.S: Use ENTRY and END macros. * sysdeps/m68k/lshift.S: Likewise. * sysdeps/m68k/rshift.S: Likewise. * sysdeps/m68k/sub_n.S: Likewise. * sysdeps/m68k/m68020/addmul_1.S: Likewise. * sysdeps/m68k/m68020/mul_1.S: Likewise. * sysdeps/m68k/m68020/submul_1.S: Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep.S: Use ENTRY macro. [_LIBC_REENTRANT]: Don't store into global errno. * sysdeps/m68k/sysdep.h: New file. * sysdeps/unix/sysv/linux/m68k/sysdep.h: Use it. Use the macros ENTRY, CALL_MCOUNT, JUMPTARGET and syscall_error from there. (DO_CALL): Change to expect syscall name as argument. (PSEUDO): Pass syscall_name to DO_CALL. (SYSCALL_ERROR_HANDLER) [_LIBC_REENTRANT]: Don't store into global errno.
Diffstat (limited to 'sysdeps/unix/sysv/linux/m68k/sysdep.h')
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.h47
1 files changed, 6 insertions, 41 deletions
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h
index 5263c71ecf..03360b84f9 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep.h
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>,
December 1995.
@@ -19,6 +19,7 @@
Boston, MA 02111-1307, USA. */
#include <sysdeps/unix/sysdep.h>
+#include <sysdeps/m68k/sysdep.h>
/* For Linux we can use the system call table in the header file
/usr/include/asm/unistd.h
@@ -33,40 +34,6 @@
#ifdef ASSEMBLER
-/* Define an entry point visible from C. */
-#define ENTRY(name) \
- .globl name; \
- .type name, @function; \
- .align 4; \
- C_LABEL(name) \
- CALL_MCOUNT
-
-#undef END
-#define END(name) .size name, . - name
-
-/* If compiled for profiling, call `_mcount' at the start of each function. */
-#ifdef PROF
-/* The mcount code relies on a normal frame pointer being on the stack
- to locate our caller, so push one just for its benefit. */
-#define CALL_MCOUNT \
- move.l %fp, -(%sp); move.l %sp, %fp; \
- jbsr JUMPTARGET (_mcount); \
- move.l (%sp)+, %fp;
-#else
-#define CALL_MCOUNT /* Do nothing. */
-#endif
-
-#ifdef PIC
-#define JUMPTARGET(name) name##@PLTPC
-#else
-#define JUMPTARGET(name) name
-#endif
-
-/* Since C identifiers are not normally prefixed with an underscore
- on this system, the asm identifier `syscall_error' intrudes on the
- C name space. Make sure we use an innocuous name. */
-#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.
@@ -76,10 +43,11 @@
for a real error by making sure the value in %d0 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) \
- DO_CALL (&SYS_ify (syscall_name), args); \
+ DO_CALL (syscall_name, args); \
cmp.l &-4095, %d0; \
jcc syscall_error
@@ -93,9 +61,6 @@
#ifdef _LIBC_REENTRANT
#define SYSCALL_ERROR_HANDLER \
syscall_error: \
- move.l (errno@GOTPC, %pc), %a0; \
- neg.l %d0; \
- move.l %d0, (%a0); \
move.l %d0, -(%sp); \
jbsr __errno_location@PLTPC; \
move.l (%sp)+, (%a0); \
@@ -145,8 +110,8 @@ syscall_error: \
speed is more important, we don't use movem. Since %a0 and %a1 are
scratch registers, we can use them for saving as well. */
-#define DO_CALL(syscall, args) \
- move.l syscall, %d0; \
+#define DO_CALL(syscall_name, args) \
+ move.l &SYS_ify(syscall_name), %d0; \
DOARGS_##args \
trap &0; \
UNDOARGS_##args