]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
update from 961105, second try
authorUlrich Drepper <drepper@redhat.com>
Thu, 7 Nov 1996 01:34:35 +0000 (01:34 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 7 Nov 1996 01:34:35 +0000 (01:34 +0000)
sysdeps/unix/alpha/sysdep.h
sysdeps/unix/sysv/linux/alpha/brk.S
sysdeps/unix/sysv/linux/alpha/clone.S
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
sysdeps/unix/sysv/linux/alpha/llseek.S
sysdeps/unix/sysv/linux/alpha/sigsuspend.S
sysdeps/unix/sysv/linux/alpha/syscall.S
sysdeps/unix/sysv/linux/m68k/syscall.S
sysdeps/unix/sysv/linux/m68k/sysdep.S
sysdeps/unix/sysv/linux/m68k/sysdep.h

index 72d84047c21b8cb1677f3b7f41c5462230d774d9..e27909ad9b4399337d2c5a2b55bf30eaba6a85a3 100644 (file)
@@ -1,20 +1,21 @@
 /* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
    Contributed by Brendan Kehoe (brendan@zen.org).
 
-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 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.
+   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.  */
+   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., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <sysdeps/unix/sysdep.h>
 
@@ -27,36 +28,24 @@ Cambridge, MA 02139, USA.  */
 #endif
 
 #ifdef __STDC__
-#define LEAF(name, framesize)                  \
-  .globl name;                                 \
-  .align 3;                                    \
-  .ent name, 0;                                        \
-  name##:                                      \
-  .frame sp, framesize, ra
+#define __LABEL(x)     x##:
 #else
+#define __LABEL(x)     x/**/:
+#endif
+
 #define LEAF(name, framesize)                  \
   .globl name;                                 \
   .align 3;                                    \
   .ent name, 0;                                        \
-  name/**/:                                    \
+  __LABEL(name)                                        \
   .frame sp, framesize, ra
-#endif
 
-#ifdef __STDC__
-#define ENTRY(name)                            \
-  .globl name;                                 \
-  .align 3;                                    \
-  .ent name, 0;                                        \
-  name##:                                      \
-  .frame sp, 0, ra
-#else
 #define ENTRY(name)                            \
   .globl name;                                 \
   .align 3;                                    \
   .ent name, 0;                                        \
-  name/**/:                                    \
+  __LABEL(name)                                        \
   .frame sp, 0, ra
-#endif
 
 /* Mark the end of function SYM.  */
 #undef END
@@ -64,16 +53,20 @@ Cambridge, MA 02139, USA.  */
 
 /* Note that PSEUDO/PSEUDO_END use label number 1996---do not use a
    label of that number between those two macros!  */
-#ifdef __STDC__
+
+#ifdef PROF
 #define PSEUDO(name, syscall_name, args)       \
     .globl name;                               \
     .align 3;                                  \
     .ent name,0;                               \
-                                               \
-name##:                                                \
-    .frame sp, 0, ra                           \
-    .prologue 1; /* yes, we do use gp */       \
+__LABEL(name)                                  \
+    .frame sp, 0, ra;                          \
+    ldgp gp,0(pv);                             \
+    .set noat;                                 \
+    lda AT,_mcount;                            \
+    jsr AT,(AT),_mcount;                       \
+    .set at;                                   \
+    .prologue 1;                               \
     ldiq       v0, SYS_ify(syscall_name);      \
     .set noat;                                 \
     call_pal   PAL_callsys;                    \
@@ -85,10 +78,9 @@ name##:                                              \
     .globl name;                               \
     .align 3;                                  \
     .ent name,0;                               \
-                                               \
-name/**/:                                      \
+__LABEL(name)                                  \
     .frame sp, 0, ra                           \
-    .prologue 1; /* yes, we do use gp */       \
+    .prologue 0;                               \
     ldiq       v0, SYS_ify(syscall_name);      \
     .set noat;                                 \
     call_pal   PAL_callsys;                    \
@@ -98,13 +90,19 @@ name/**/:                                   \
 #endif
 
 #undef PSEUDO_END
-
+#ifdef PROF
+#define PSEUDO_END(sym)                                \
+1996:                                          \
+    jmp                zero, __syscall_error;          \
+    END(sym)
+#else
 #define PSEUDO_END(sym)                                \
 1996:                                          \
     br         gp, 2f;                         \
 2:  ldgp       gp, 0(gp);                      \
     jmp                zero, __syscall_error;          \
     END(sym)
+#endif
 
 #define r0     v0
 #define r1     a4
index 75be949affd092e5907b525fe229ce2ac45b45da..d31d9e9b4dc5c9c6146c74b5a2a4d8cee63be24a 100644 (file)
@@ -38,6 +38,10 @@ __curbrk: .skip 8
        .text
 LEAF(__brk, 0)
        ldgp    gp, 0(t12)
+#ifdef PROF
+       lda     AT, _mcount
+       jsr     AT, (AT), _mcount
+#endif
        .prologue 1
 
        ldiq    v0, __NR_brk
index 71d8053b12e936a8c80c3dc39d06e4ef7e94006b..9dbf3034c92c9fa0667ed99d55fbe4a798065797 100644 (file)
@@ -32,6 +32,10 @@ ENTRY(__clone)
        /* Save rest of argument registers for varargs-type work.  */
        stq     a4,0(sp)
        stq     a5,8(sp)
+#ifdef PROF
+       lda     AT, _mcount
+       jsr     AT, (AT), _mcount
+#endif
        .prologue 1
 
        /* Sanity check arguments.  */
index e09fa738e218ce1320d53679db1d3cc932a1c4e1..1176a2730f8d150f152363b491d65859d57f57bc 100644 (file)
@@ -22,9 +22,17 @@ Cambridge, MA 02139, USA.  */
 
        .text
 
-LEAF(__ieee_get_fp_control, 8)
-       lda     sp, -8(sp)
+LEAF(__ieee_get_fp_control, 16)
+#ifdef PROF
+       ldgp    gp, 0(pv)
+       lda     sp, -16(sp)
+       lda     AT, _mcount
+       jsr     AT, (AT), _mcount
        .prologue 1
+#else
+       lda     sp, -16(sp)
+       .prologue 0
+#endif
 
        mov     sp, a1
        ldi     a0, GSI_IEEE_FP_CONTROL
@@ -33,12 +41,14 @@ LEAF(__ieee_get_fp_control, 8)
        bne     a3, error
 
        ldq     v0, 0(sp)
-       lda     sp, 8(sp)
+       lda     sp, 16(sp)
        ret
 
-error: lda     sp, 8(sp)
+error: lda     sp, 16(sp)
+#ifndef PROF
        br      gp, 1f
 1:     ldgp    gp, 0(gp)
+#endif
        jmp     zero, __syscall_error
 
        END(__ieee_get_fp_control)
index d748c81142014467d408029b494fddc6eb0a9d7f..aa761ecaca011db1b5cb6b37e30e166955a44bca 100644 (file)
@@ -20,9 +20,17 @@ Cambridge, MA 02139, USA.  */
 
 #define SSI_IEEE_FP_CONTROL    14
 
-LEAF(__ieee_set_fp_control, 8)
-       lda     sp, -8(sp)
+LEAF(__ieee_set_fp_control, 16)
+#ifdef PROF
+       ldgp    gp, 0(sp)
+       lda     sp, -16(sp)
+       lda     AT, _mcount
+       jsr     AT, (AT), _mcount
        .prologue 1
+#else
+       lda     sp, -16(sp)
+       .prologue 0
+#endif
 
        stq     a0, 0(sp)
        mov     sp, a1
@@ -30,13 +38,16 @@ LEAF(__ieee_set_fp_control, 8)
        ldi     v0, __NR_osf_setsysinfo
        call_pal PAL_callsys
 
-       lda     sp, 8(sp)
+       lda     sp, 16(sp)
 
        bne     a3, error
        ret
 
-error: br      gp, 1f
+error:
+#ifndef PROF
+       br      gp, 1f
 1:     ldgp    gp, 0(gp)
+#endif
        jmp     zero, __syscall_error
 
        END(__ieee_set_fp_control)
index 6020f263cdadfb46c213be7622deabac16afe93d..45fb349236644a906f68ca3b626e8ed07c7da414 100644 (file)
@@ -24,7 +24,14 @@ Cambridge, MA 02139, USA.  */
 
        .text
 ENTRY(llseek)
+#ifdef PROF
+       ldgp    gp, 0(pv)
+       lda     AT, _mcount
+       jsr     AT, (AT), _mcount
        .prologue 1
+#else
+       .prologue 0
+#endif
 
        sll     a1, 32, a1      /* build a 64 bit ofs out of 32 bit operands */
        zap     a2, 0xf0, a2
@@ -40,8 +47,11 @@ ENTRY(llseek)
        stq     v0, 0(t0)
        ret
 
-error: br      gp, 1f
+error:
+#ifndef PROF
+       br      gp, 1f
 1:     ldgp    gp, 0(gp)
+#endif
        jmp     zero, __syscall_error
 
        END(llseek)
index aaae9a308a405d9ec529f078590a6eea5bb03f20..83d331fef0117d5a8ebf4dd7326bea97c433903c 100644 (file)
@@ -24,7 +24,14 @@ Cambridge, MA 02139, USA.  */
        .text
 
 LEAF(sigsuspend, 0)
+#ifdef PROF
+       ldgp    gp, 0(pv)
+       lda     AT, _mcount
+       jsr     AT, (AT), _mcount
        .prologue 1
+#else
+       .prologue 0
+#endif
 
        ldq     a0, 0(a0)
        ldi     v0, __NR_sigsuspend
@@ -32,8 +39,11 @@ LEAF(sigsuspend, 0)
        bne     a3, error
        ret
 
-error: br      gp, 1f
+error:
+#ifndef PROF
+       br      gp, 1f
 1:     ldgp    gp, 0(gp)
+#endif
        jmp     zero, __syscall_error
 
        END(sigsuspend)
index f1b36e93123fb3271f75263b58d9618b2745ee37..81043c2cdb551c71213f10b06cf731b27db34505 100644 (file)
@@ -42,6 +42,15 @@ Cambridge, MA 02139, USA.  */
 
 
 LEAF(__syscall, 0)
+#ifdef PROF
+       ldgp    gp, 0(pv)
+       lda     AT, _mcount
+       jsr     AT, (AT), _mcount
+       .prologue 1
+#else
+       .prologue 0
+#endif
+
        mov     a0, v0          /* Syscall number -> v0 */
        mov     a1, a0          /* arg1-arg5 -> a0-a4 */
        mov     a2, a1
@@ -53,8 +62,11 @@ LEAF(__syscall, 0)
        bne     a3, error
        ret
 
-error: br      gp, 2f
+error:
+#ifndef PROF
+       br      gp, 2f
 2:     ldgp    gp, 0(gp)
+#endif
        jmp     zero, __syscall_error
 
 weak_alias(__syscall, syscall)
index b7417aa911f9bda4c57779c6abd6530af16811d2..d2328dc545e78a397faf521f01b786f20c300907 100644 (file)
@@ -1,25 +1,25 @@
 /* Copyright (C) 1996 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
-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 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.
+   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.  */
+   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., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <sysdep.h>
 
 /* Please consult the file sysdeps/unix/sysv/linux/m68k/sysdep.h for
-   more information about the value -128 used below.*/
+   more information about the value -4096 used below.*/
 
        .text
 ENTRY (syscall)
@@ -27,7 +27,7 @@ ENTRY (syscall)
        _DOARGS_5 (24)          /* Frob arguments.  */
        trap &0                 /* Do the system call.  */
        UNDOARGS_5              /* Unfrob arguments.  */
-       moveq.l &-128, %d1
+       moveq.l &-4096, %d1
        cmp.l %d1, %d0          /* Check %d0 for error.  */
        jcc syscall_error       /* Jump to error handler if negative.  */
        rts                     /* Return to caller.  */
index 7016a26a6025edfd27381d534ca06ab1a58e5449..95e63542ee53fde7d485ab9274278d24f94aa99b 100644 (file)
@@ -1,20 +1,20 @@
 /* Copyright (C) 1996 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
-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 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.
+   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.  */
+   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., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <sysdep.h>
 
@@ -62,7 +62,11 @@ __syscall_error:
 END (__syscall_error)
 #endif /* PIC */
 
-ENTRY (__errno_location)
+       .weak __errno_location
+       .type __errno_location,@function
+       .align 4
+__errno_location:
+       CALL_MCOUNT
 #ifdef PIC
        move.l  (%pc, errno@GOTPC), %a0
 #else
index 3366caab456f2b91c8f08ecb276bbb11a7fe20a5..46d5a7e48fccf74f1c26453dc0e974689a1c0cac 100644 (file)
@@ -74,14 +74,13 @@ Cambridge, MA 02139, USA.  */
    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.  */
+   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 -4096.  */
 #define        PSEUDO(name, syscall_name, args)                                      \
   .text;                                                                     \
   ENTRY (name)                                                               \
     DO_CALL (&SYS_ify (syscall_name), args);                                 \
-    moveq.l &-128, %d1;                                                              \
+    moveq.l &-4096, %d1;                                                     \
     cmp.l %d1, %d0;                                                          \
     jcc syscall_error