]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/unix/sysv/linux/ia64/getcontext.S
Add space inf weak_alias use.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / ia64 / getcontext.S
index 1a0ca915abab33dc095e01c90bbc9c161b9d3734..4e18bace2d12a32c9b5ae5b694bea92c2bd61ddc 100644 (file)
@@ -1,20 +1,21 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
    Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
 
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <sysdep.h>
 #include <features.h>
   other than the PRESERVED state.  */
 
 ENTRY(__getcontext)
-       alloc r16 = ar.pfs, 1, 0, 3, 0
+       .prologue
+       .body
+       alloc r11 = ar.pfs, 1, 0, 4, 0
 
        // sigprocmask (SIG_BLOCK, NULL, &sc->sc_mask):
 
-       mov r2 = SC_MASK
-       mov r15 = __NR_rt_sigprocmask
-       ;;
+       mov r3 = SC_MASK
        mov out0 = SIG_BLOCK
-       mov out1 = 0
-       add out2 = r2, in0
 
-       break __BREAK_SYSCALL
        flushrs                                 // save dirty partition on rbs
+       mov out1 = 0
+       add out2 = r3, in0
+
+       mov out3 = 8    // sizeof kernel sigset_t
+       DO_CALL(__NR_rt_sigprocmask)
 
        mov.m rFPSR = ar.fpsr
        mov.m rRSC = ar.rsc
        add r2 = SC_GR+1*8, r32
        ;;
        mov.m rBSP = ar.bsp
+       .prologue
+       .save ar.unat, rUNAT
        mov.m rUNAT = ar.unat
+       .body
        add r3 = SC_GR+4*8, r32
        ;;
 
 .mem.offset 0,0; st8.spill [r2] = r1, (5*8 - 1*8)
 .mem.offset 8,0; st8.spill [r3] = r4, 16
-       mov.i rPFS = ar.pfs
+       mov rPFS = r11
        ;;
 .mem.offset 0,0; st8.spill [r2] = r5, 16
 .mem.offset 8,0; st8.spill [r3] = r6, 48
        and rTMP = ~0x3, rRSC
        ;;
-       st8.spill [r2] = r7, (SC_FR+2*16-(SC_GR+7*8))
-       st8.spill [r3] = sp, (SC_FR+3*16-(SC_GR+12*8))
+.mem.offset 0,0; st8.spill [r2] = r7, (SC_FR+2*16-(SC_GR+7*8))
+.mem.offset 8,0; st8.spill [r3] = sp, (SC_FR+3*16-(SC_GR+12*8))
        ;;
        mov.m ar.rsc = rTMP             // put RSE into enforced lazy mode
        mov.m rNAT = ar.unat
@@ -118,8 +124,8 @@ ENTRY(__getcontext)
        stf.spill [r3] = f31, 32
        mov rB1 = b1
        ;;
+       mov ar.unat = rUNAT     // we're done spilling integer regs; restore caller's UNaT
        add r2 = SC_NAT, r32
-       nop 0
        add r3 = SC_BSP, r32
        ;;
        st8 [r2] = rNAT, (SC_RNAT-SC_NAT)
@@ -137,11 +143,11 @@ ENTRY(__getcontext)
        st8 [r2] = rLC, (SC_BR+0*8-SC_LC)
        st8 [r3] = rPR, (SC_BR+1*8-SC_PR)
        mov rB5 = b5
-
+       ;;
        st8 [r2] = rB0, 16
        st8 [r3] = rB1, 16
        ;;
-       st8 [r3] = rB2, 16
+       st8 [r2] = rB2, 16
        st8 [r3] = rB3, 16
        ;;
        st8 [r2] = rB4
@@ -149,4 +155,4 @@ ENTRY(__getcontext)
        ret
 END(__getcontext)
 
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)