aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S218
1 files changed, 109 insertions, 109 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
index 490eb27578..1ff9448764 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S
@@ -59,41 +59,41 @@ ENTRY(__novec_setcontext)
bne L(nv_error_exit)
lfd fp0,(SIGCONTEXT_FP_REGS+(32*8))(r31)
- lfd fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
+ lfd fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
lfd fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
mtfsf 0xff,fp0
- lfd fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
+ lfd fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
lfd fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
- lfd fp27,(SIGCONTEXT_FP_REGS+(PT_R27*8))(r31)
+ lfd fp27,(SIGCONTEXT_FP_REGS+(PT_R27*8))(r31)
lfd fp26,(SIGCONTEXT_FP_REGS+(PT_R26*8))(r31)
- lfd fp25,(SIGCONTEXT_FP_REGS+(PT_R25*8))(r31)
+ lfd fp25,(SIGCONTEXT_FP_REGS+(PT_R25*8))(r31)
lfd fp24,(SIGCONTEXT_FP_REGS+(PT_R24*8))(r31)
- lfd fp23,(SIGCONTEXT_FP_REGS+(PT_R23*8))(r31)
+ lfd fp23,(SIGCONTEXT_FP_REGS+(PT_R23*8))(r31)
lfd fp22,(SIGCONTEXT_FP_REGS+(PT_R22*8))(r31)
- lfd fp21,(SIGCONTEXT_FP_REGS+(PT_R21*8))(r31)
+ lfd fp21,(SIGCONTEXT_FP_REGS+(PT_R21*8))(r31)
lfd fp20,(SIGCONTEXT_FP_REGS+(PT_R20*8))(r31)
- lfd fp19,(SIGCONTEXT_FP_REGS+(PT_R19*8))(r31)
+ lfd fp19,(SIGCONTEXT_FP_REGS+(PT_R19*8))(r31)
lfd fp18,(SIGCONTEXT_FP_REGS+(PT_R18*8))(r31)
- lfd fp17,(SIGCONTEXT_FP_REGS+(PT_R17*8))(r31)
+ lfd fp17,(SIGCONTEXT_FP_REGS+(PT_R17*8))(r31)
lfd fp16,(SIGCONTEXT_FP_REGS+(PT_R16*8))(r31)
- lfd fp15,(SIGCONTEXT_FP_REGS+(PT_R15*8))(r31)
+ lfd fp15,(SIGCONTEXT_FP_REGS+(PT_R15*8))(r31)
lfd fp14,(SIGCONTEXT_FP_REGS+(PT_R14*8))(r31)
- lfd fp13,(SIGCONTEXT_FP_REGS+(PT_R13*8))(r31)
+ lfd fp13,(SIGCONTEXT_FP_REGS+(PT_R13*8))(r31)
lfd fp12,(SIGCONTEXT_FP_REGS+(PT_R12*8))(r31)
- lfd fp11,(SIGCONTEXT_FP_REGS+(PT_R11*8))(r31)
+ lfd fp11,(SIGCONTEXT_FP_REGS+(PT_R11*8))(r31)
lfd fp10,(SIGCONTEXT_FP_REGS+(PT_R10*8))(r31)
- lfd fp9,(SIGCONTEXT_FP_REGS+(PT_R9*8))(r31)
+ lfd fp9,(SIGCONTEXT_FP_REGS+(PT_R9*8))(r31)
lfd fp8,(SIGCONTEXT_FP_REGS+(PT_R8*8))(r31)
- lfd fp7,(SIGCONTEXT_FP_REGS+(PT_R7*8))(r31)
+ lfd fp7,(SIGCONTEXT_FP_REGS+(PT_R7*8))(r31)
lfd fp6,(SIGCONTEXT_FP_REGS+(PT_R6*8))(r31)
- lfd fp5,(SIGCONTEXT_FP_REGS+(PT_R5*8))(r31)
+ lfd fp5,(SIGCONTEXT_FP_REGS+(PT_R5*8))(r31)
lfd fp4,(SIGCONTEXT_FP_REGS+(PT_R4*8))(r31)
- lfd fp3,(SIGCONTEXT_FP_REGS+(PT_R3*8))(r31)
+ lfd fp3,(SIGCONTEXT_FP_REGS+(PT_R3*8))(r31)
lfd fp2,(SIGCONTEXT_FP_REGS+(PT_R2*8))(r31)
- lfd fp1,(SIGCONTEXT_FP_REGS+(PT_R1*8))(r31)
+ lfd fp1,(SIGCONTEXT_FP_REGS+(PT_R1*8))(r31)
lfd fp0,(SIGCONTEXT_FP_REGS+(PT_R0*8))(r31)
-
- ld r0,(SIGCONTEXT_GP_REGS+(PT_LNK*8))(r31)
+
+ ld r0,(SIGCONTEXT_GP_REGS+(PT_LNK*8))(r31)
ld r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r31)
mtlr r0
ld r2,(SIGCONTEXT_GP_REGS+(PT_R2*8))(r31)
@@ -129,33 +129,33 @@ ENTRY(__novec_setcontext)
ld r28,(SIGCONTEXT_GP_REGS+(PT_R28*8))(r31)
ld r29,(SIGCONTEXT_GP_REGS+(PT_R29*8))(r31)
ld r30,(SIGCONTEXT_GP_REGS+(PT_R30*8))(r31)
-
+
/* Now we branch to the "Next Instruction Pointer" from the saved
- context. With the powerpc64 instruction set there is no good way to
+ context. With the powerpc64 instruction set there is no good way to
do this (from user state) without clobbering either the LR or CTR.
- The makecontext and swapcontext functions depend on the callers
+ The makecontext and swapcontext functions depend on the callers
LR being preserved so we use the CTR. */
ld r0,(SIGCONTEXT_GP_REGS+(PT_NIP*8))(r31)
mtctr r0
ld r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r31)
ld r31,(SIGCONTEXT_GP_REGS+(PT_R31*8))(r31)
bctr
-
+
L(nv_error_exit):
- ld r0,128+FRAME_LR_SAVE(r1)
+ ld r0,128+FRAME_LR_SAVE(r1)
addi r1,r1,128
mtlr r0
ld r31,-8(r1)
blr
- /* At this point we assume that the ucontext was created by a
- rt_signal and we should use rt_sigreturn to restore the original
- state. As of the 2.4.21 kernel the ucontext is the first thing
- (offset 0) in the rt_signal frame and rt_sigreturn expects the
- ucontext address in R1. Normally the rt-signal trampoline handles
- this by popping dummy frame before the rt_signal syscall. In our
- case the stack may not be in its original (signal handler return with
- R1 pointing at the dummy frame) state. We do have the ucontext
+ /* At this point we assume that the ucontext was created by a
+ rt_signal and we should use rt_sigreturn to restore the original
+ state. As of the 2.4.21 kernel the ucontext is the first thing
+ (offset 0) in the rt_signal frame and rt_sigreturn expects the
+ ucontext address in R1. Normally the rt-signal trampoline handles
+ this by popping dummy frame before the rt_signal syscall. In our
+ case the stack may not be in its original (signal handler return with
+ R1 pointing at the dummy frame) state. We do have the ucontext
address in R3, so simply copy R3 to R1 before the syscall. */
L(nv_do_sigret):
mr r1,r3,
@@ -171,7 +171,7 @@ L(nv_do_sigret):
bl JUMPTARGET(__syscall_error)
nop
li r3,-1
- ld r0,128+FRAME_LR_SAVE(r1)
+ ld r0,128+FRAME_LR_SAVE(r1)
addi r1,r1,128
mtlr r0
blr
@@ -186,7 +186,7 @@ compat_symbol (libc, __novec_setcontext, setcontext, GLIBC_2_3)
.section ".toc","aw"
.LC__dl_hwcap:
#ifdef SHARED
- .tc _rtld_global[TC],_rtld_global
+ .tc _rtld_global_ro[TC],_rtld_global_ro
#else
.tc _dl_hwcap[TC],_dl_hwcap
#endif
@@ -221,153 +221,153 @@ ENTRY(__setcontext)
nop
cmpdi r3,0
bne L(error_exit)
-
+
ld r5,.LC__dl_hwcap@toc(r2)
ld r10,(SIGCONTEXT_V_REGS_PTR)(r31)
-#ifdef SHARED
+# ifdef SHARED
/* Load _rtld-global._dl_hwcap. */
- ld r5,RTLD_GLOBAL_DL_HWCAP_OFFSET(r5)
-#else
+ ld r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
+# else
ld r5,0(r5) /* Load extern _dl_hwcap. */
-#endif
+# endif
andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
beq L(has_no_vec)
-
+
cmpdi r10,0
beq L(has_no_vec)
lwz r0,(33*16)(r10)
-
+
li r9,(16*32)
mtspr VRSAVE,r0
cmpwi r0,0
- beq L(has_no_vec)
-
+ beq L(has_no_vec)
+
lvx v19,r9,r10
la r9,(16)(r10)
-
- lvx v0,0,r10
+
+ lvx v0,0,r10
lvx v1,0,r9
addi r10,r10,32
addi r9,r9,32
-
+
mtvscr v19
- lvx v2,0,r10
+ lvx v2,0,r10
lvx v3,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v4,0,r10
+
+ lvx v4,0,r10
lvx v5,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v6,0,r10
+
+ lvx v6,0,r10
lvx v7,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v8,0,r10
+
+ lvx v8,0,r10
lvx v9,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v10,0,r10
+
+ lvx v10,0,r10
lvx v11,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v12,0,r10
+
+ lvx v12,0,r10
lvx v13,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v14,0,r10
+
+ lvx v14,0,r10
lvx v15,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v16,0,r10
+
+ lvx v16,0,r10
lvx v17,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v18,0,r10
+
+ lvx v18,0,r10
lvx v11,0,r9
addi r19,r10,32
addi r9,r9,32
-
- lvx v20,0,r10
+
+ lvx v20,0,r10
lvx v21,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v22,0,r10
+
+ lvx v22,0,r10
lvx v23,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v24,0,r10
+
+ lvx v24,0,r10
lvx v25,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v26,0,r10
+
+ lvx v26,0,r10
lvx v27,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v28,0,r10
+
+ lvx v28,0,r10
lvx v29,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v30,0,r10
+
+ lvx v30,0,r10
lvx v31,0,r9
addi r10,r10,32
addi r9,r9,32
-
- lvx v10,0,r10
+
+ lvx v10,0,r10
lvx v11,0,r9
addi r10,r10,32
addi r9,r9,32
-
+
L(has_no_vec):
lfd fp0,(SIGCONTEXT_FP_REGS+(32*8))(r31)
- lfd fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
+ lfd fp31,(SIGCONTEXT_FP_REGS+(PT_R31*8))(r31)
lfd fp30,(SIGCONTEXT_FP_REGS+(PT_R30*8))(r31)
mtfsf 0xff,fp0
- lfd fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
+ lfd fp29,(SIGCONTEXT_FP_REGS+(PT_R29*8))(r31)
lfd fp28,(SIGCONTEXT_FP_REGS+(PT_R28*8))(r31)
- lfd fp27,(SIGCONTEXT_FP_REGS+(PT_R27*8))(r31)
+ lfd fp27,(SIGCONTEXT_FP_REGS+(PT_R27*8))(r31)
lfd fp26,(SIGCONTEXT_FP_REGS+(PT_R26*8))(r31)
- lfd fp25,(SIGCONTEXT_FP_REGS+(PT_R25*8))(r31)
+ lfd fp25,(SIGCONTEXT_FP_REGS+(PT_R25*8))(r31)
lfd fp24,(SIGCONTEXT_FP_REGS+(PT_R24*8))(r31)
- lfd fp23,(SIGCONTEXT_FP_REGS+(PT_R23*8))(r31)
+ lfd fp23,(SIGCONTEXT_FP_REGS+(PT_R23*8))(r31)
lfd fp22,(SIGCONTEXT_FP_REGS+(PT_R22*8))(r31)
- lfd fp21,(SIGCONTEXT_FP_REGS+(PT_R21*8))(r31)
+ lfd fp21,(SIGCONTEXT_FP_REGS+(PT_R21*8))(r31)
lfd fp20,(SIGCONTEXT_FP_REGS+(PT_R20*8))(r31)
- lfd fp19,(SIGCONTEXT_FP_REGS+(PT_R19*8))(r31)
+ lfd fp19,(SIGCONTEXT_FP_REGS+(PT_R19*8))(r31)
lfd fp18,(SIGCONTEXT_FP_REGS+(PT_R18*8))(r31)
- lfd fp17,(SIGCONTEXT_FP_REGS+(PT_R17*8))(r31)
+ lfd fp17,(SIGCONTEXT_FP_REGS+(PT_R17*8))(r31)
lfd fp16,(SIGCONTEXT_FP_REGS+(PT_R16*8))(r31)
- lfd fp15,(SIGCONTEXT_FP_REGS+(PT_R15*8))(r31)
+ lfd fp15,(SIGCONTEXT_FP_REGS+(PT_R15*8))(r31)
lfd fp14,(SIGCONTEXT_FP_REGS+(PT_R14*8))(r31)
- lfd fp13,(SIGCONTEXT_FP_REGS+(PT_R13*8))(r31)
+ lfd fp13,(SIGCONTEXT_FP_REGS+(PT_R13*8))(r31)
lfd fp12,(SIGCONTEXT_FP_REGS+(PT_R12*8))(r31)
- lfd fp11,(SIGCONTEXT_FP_REGS+(PT_R11*8))(r31)
+ lfd fp11,(SIGCONTEXT_FP_REGS+(PT_R11*8))(r31)
lfd fp10,(SIGCONTEXT_FP_REGS+(PT_R10*8))(r31)
- lfd fp9,(SIGCONTEXT_FP_REGS+(PT_R9*8))(r31)
+ lfd fp9,(SIGCONTEXT_FP_REGS+(PT_R9*8))(r31)
lfd fp8,(SIGCONTEXT_FP_REGS+(PT_R8*8))(r31)
- lfd fp7,(SIGCONTEXT_FP_REGS+(PT_R7*8))(r31)
+ lfd fp7,(SIGCONTEXT_FP_REGS+(PT_R7*8))(r31)
lfd fp6,(SIGCONTEXT_FP_REGS+(PT_R6*8))(r31)
- lfd fp5,(SIGCONTEXT_FP_REGS+(PT_R5*8))(r31)
+ lfd fp5,(SIGCONTEXT_FP_REGS+(PT_R5*8))(r31)
lfd fp4,(SIGCONTEXT_FP_REGS+(PT_R4*8))(r31)
- lfd fp3,(SIGCONTEXT_FP_REGS+(PT_R3*8))(r31)
+ lfd fp3,(SIGCONTEXT_FP_REGS+(PT_R3*8))(r31)
lfd fp2,(SIGCONTEXT_FP_REGS+(PT_R2*8))(r31)
- lfd fp1,(SIGCONTEXT_FP_REGS+(PT_R1*8))(r31)
+ lfd fp1,(SIGCONTEXT_FP_REGS+(PT_R1*8))(r31)
lfd fp0,(SIGCONTEXT_FP_REGS+(PT_R0*8))(r31)
-
- ld r0,(SIGCONTEXT_GP_REGS+(PT_LNK*8))(r31)
+
+ ld r0,(SIGCONTEXT_GP_REGS+(PT_LNK*8))(r31)
ld r1,(SIGCONTEXT_GP_REGS+(PT_R1*8))(r31)
mtlr r0
ld r2,(SIGCONTEXT_GP_REGS+(PT_R2*8))(r31)
@@ -403,33 +403,33 @@ L(has_no_vec):
ld r28,(SIGCONTEXT_GP_REGS+(PT_R28*8))(r31)
ld r29,(SIGCONTEXT_GP_REGS+(PT_R29*8))(r31)
ld r30,(SIGCONTEXT_GP_REGS+(PT_R30*8))(r31)
-
+
/* Now we branch to the "Next Instruction Pointer" from the saved
- context. With the powerpc64 instruction set there is no good way to
+ context. With the powerpc64 instruction set there is no good way to
do this (from user state) without clobbering either the LR or CTR.
- The makecontext and swapcontext functions depend on the callers
+ The makecontext and swapcontext functions depend on the callers
LR being preserved so we use the CTR. */
ld r0,(SIGCONTEXT_GP_REGS+(PT_NIP*8))(r31)
mtctr r0
ld r0,(SIGCONTEXT_GP_REGS+(PT_R0*8))(r31)
ld r31,(SIGCONTEXT_GP_REGS+(PT_R31*8))(r31)
bctr
-
+
L(error_exit):
- ld r0,128+FRAME_LR_SAVE(r1)
+ ld r0,128+FRAME_LR_SAVE(r1)
addi r1,r1,128
mtlr r0
ld r31,-8(r1)
blr
- /* At this point we assume that the ucontext was created by a
- rt_signal and we should use rt_sigreturn to restore the original
- state. As of the 2.4.21 kernel the ucontext is the first thing
- (offset 0) in the rt_signal frame and rt_sigreturn expects the
- ucontext address in R1. Normally the rt-signal trampoline handles
- this by popping dummy frame before the rt_signal syscall. In our
- case the stack may not be in its original (signal handler return with
- R1 pointing at the dummy frame) state. We do have the ucontext
+ /* At this point we assume that the ucontext was created by a
+ rt_signal and we should use rt_sigreturn to restore the original
+ state. As of the 2.4.21 kernel the ucontext is the first thing
+ (offset 0) in the rt_signal frame and rt_sigreturn expects the
+ ucontext address in R1. Normally the rt-signal trampoline handles
+ this by popping dummy frame before the rt_signal syscall. In our
+ case the stack may not be in its original (signal handler return with
+ R1 pointing at the dummy frame) state. We do have the ucontext
address in R3, so simply copy R3 to R1 before the syscall. */
L(do_sigret):
mr r1,r3,
@@ -445,7 +445,7 @@ L(do_sigret):
bl JUMPTARGET(__syscall_error)
nop
li r3,-1
- ld r0,128+FRAME_LR_SAVE(r1)
+ ld r0,128+FRAME_LR_SAVE(r1)
addi r1,r1,128
mtlr r0
blr