]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/sparc/sparc32/__longjmp.S
Update copyright notices with scripts/update-copyrights
[thirdparty/glibc.git] / sysdeps / sparc / sparc32 / __longjmp.S
index 7e05c9524b342d93ad3144c2bc8121aed5796594..c8d6328063a1bc7cc618a3d7b884c079a17c939e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996, 1997, 1998, 1999, 2000, 2006
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991-2014 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
@@ -21,7 +20,6 @@
 #include <jmpbuf-offsets.h>
 #define ENV(base,reg) [%base + (reg * 4)]
 #define ST_FLUSH_WINDOWS 3
-#define RW_FP [%fp + 0x48]
 
 ENTRY(__longjmp)
        /* Store our arguments in global registers so we can still
@@ -32,8 +30,8 @@ ENTRY(__longjmp)
        PTR_DEMANGLE (%g3, %g3, %g4)
 #endif
        mov %o0, %g1            /* ENV in %g1 */
-       orcc %o1, %g0, %g2      /* VAL in %g2 */
-       be,a 0f                 /* Branch if zero; else skip delay slot.  */
+       orcc %o1, %g0, %g2      /* VAL in %g2 */
+       be,a 0f                 /* Branch if zero; else skip delay slot.  */
         mov 1, %g2             /* Delay slot only hit if zero: VAL = 1.  */
 0:
        xor %fp, %g3, %o0
@@ -54,6 +52,7 @@ LOC(loop):
         ld ENV(g1,JB_SP), %o0  /* Delay slot: extract target SP.  */
 
 LOC(thread):
+       save    %sp, -96, %sp
        /*
         * Do a "flush register windows trap".  The trap handler in the
         * kernel writes all the register windows to their stack slots, and
@@ -66,15 +65,13 @@ LOC(thread):
 #ifdef PTR_DEMANGLE
        ld      ENV(g1,JB_PC), %g5 /* Set return PC. */
        ld      ENV(g1,JB_SP), %g1 /* Set saved SP on restore below. */
-       PTR_DEMANGLE2 (%o7, %g5, %g4)
+       PTR_DEMANGLE2 (%i7, %g5, %g4)
        PTR_DEMANGLE2 (%fp, %g1, %g4)
 #else
-       ld      ENV(g1,JB_PC), %o7 /* Set return PC. */
+       ld      ENV(g1,JB_PC), %i7 /* Set return PC. */
        ld      ENV(g1,JB_SP), %fp /* Set saved SP on restore below. */
 #endif
-       sub     %fp, 64, %sp    /* Allocate a register frame. */
-       st      %g3, RW_FP      /* Set saved FP on restore below. */
-       retl
+       jmp     %i7 + 8
         restore %g2, 0, %o0    /* Restore values from above register frame. */
 
 LOC(found):