summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-08-05 19:33:01 +0000
committermarcel <marcel@FreeBSD.org>2003-08-05 19:33:01 +0000
commit2de934f7e314f21c804b19402325f4accf509d85 (patch)
treeab6951c7165658ed0c7e6a8ec79eb4aca2cdb5be /lib
parentd63e3e36c0421ab538a9c9c0fd2ac6bad9f5bcee (diff)
downloadFreeBSD-src-2de934f7e314f21c804b19402325f4accf509d85.zip
FreeBSD-src-2de934f7e314f21c804b19402325f4accf509d85.tar.gz
o In _ia64_save_context() clear the return registers except for r8.
We write 1 for r8 in the context so that _ia64_restore_context() will return with a non-zero value. _ia64_save_context() always return 0. o In _ia64_restore_context(), don't restore the thread pointer. It is not normally part of the context. Also, restore the return registers. We get called for contexts created by getcontext(), which means we have to restore all the syscall return values.
Diffstat (limited to 'lib')
-rw-r--r--lib/libkse/arch/ia64/ia64/context.S38
-rw-r--r--lib/libpthread/arch/ia64/ia64/context.S38
2 files changed, 50 insertions, 26 deletions
diff --git a/lib/libkse/arch/ia64/ia64/context.S b/lib/libkse/arch/ia64/ia64/context.S
index 8b739c6..6c0c082 100644
--- a/lib/libkse/arch/ia64/ia64/context.S
+++ b/lib/libkse/arch/ia64/ia64/context.S
@@ -59,19 +59,19 @@ ENTRY(_ia64_restore_context, 3)
}
{ .mmi
ld8 r19=[r30],16 // pfs
- ld8 r20=[r31],24 // bspstore
+ ld8 r20=[r31],32 // bspstore
mov rp=r17
;;
}
{ .mmi
- ld8 r21=[r30],24 // rnat
- ld8 r13=[r31],16 // tp
+ ld8 r21=[r30],32 // rnat
+ ld8 r22=[r31],16 // rsc
mov pr=r18,0x1fffe
;;
}
{ .mmi
- ld8 r22=[r30],16 // rsc
- ld8 r23=[r31],16 // fpsr
+ ld8 r23=[r30] // fpsr
+ ld8 r24=[r31] // psr -- not used
mov r3=r34
;;
}
@@ -161,12 +161,15 @@ ENTRY(_ia64_restore_context, 3)
ldf.fill f28=[r14],32
ldf.fill f29=[r15],32
;;
-{ .mmi
- ldf.fill f30=[r14]
- ldf.fill f31=[r15]
- add r8=1,r0
+ ldf.fill f30=[r14],32+24
+ ldf.fill f31=[r15],24+24
+ ;;
+ ld8 r8=[r14],16
+ ld8 r9=[r15],16
+ ;;
+ ld8 r10=[r14]
+ ld8 r11=[r15]
;;
-}
{ .mmb
(p15) st8 [r3]=r2
mov ar.fpsr=r23
@@ -234,7 +237,7 @@ ENTRY(_ia64_save_context, 1)
;;
}
{ .mmi
- st8 [r32]=r13,16 // tp
+ st8 [r32]=r13,16 // tp -- not used
st8 [r31]=r14,16 // rsc
mov r16=b1
;;
@@ -312,12 +315,21 @@ ENTRY(_ia64_save_context, 1)
;;
{ .mmi
stf.spill [r31]=f29,32
- stf.spill [r32]=f30
+ stf.spill [r32]=f30,32+24
+ add r14=1,r0
+ ;;
+}
+{ .mmi
+ stf.spill [r31]=f31,24+24
+ st8 [r32]=r14,16 // r8
add r8=0,r0
;;
}
+ st8 [r31]=r0,16 // r9
+ st8 [r32]=r0 // r10
+ ;;
{ .mmb
- stf.spill [r31]=f31
+ st8 [r31]=r0 // r11
mf
br.ret.sptk rp
;;
diff --git a/lib/libpthread/arch/ia64/ia64/context.S b/lib/libpthread/arch/ia64/ia64/context.S
index 8b739c6..6c0c082 100644
--- a/lib/libpthread/arch/ia64/ia64/context.S
+++ b/lib/libpthread/arch/ia64/ia64/context.S
@@ -59,19 +59,19 @@ ENTRY(_ia64_restore_context, 3)
}
{ .mmi
ld8 r19=[r30],16 // pfs
- ld8 r20=[r31],24 // bspstore
+ ld8 r20=[r31],32 // bspstore
mov rp=r17
;;
}
{ .mmi
- ld8 r21=[r30],24 // rnat
- ld8 r13=[r31],16 // tp
+ ld8 r21=[r30],32 // rnat
+ ld8 r22=[r31],16 // rsc
mov pr=r18,0x1fffe
;;
}
{ .mmi
- ld8 r22=[r30],16 // rsc
- ld8 r23=[r31],16 // fpsr
+ ld8 r23=[r30] // fpsr
+ ld8 r24=[r31] // psr -- not used
mov r3=r34
;;
}
@@ -161,12 +161,15 @@ ENTRY(_ia64_restore_context, 3)
ldf.fill f28=[r14],32
ldf.fill f29=[r15],32
;;
-{ .mmi
- ldf.fill f30=[r14]
- ldf.fill f31=[r15]
- add r8=1,r0
+ ldf.fill f30=[r14],32+24
+ ldf.fill f31=[r15],24+24
+ ;;
+ ld8 r8=[r14],16
+ ld8 r9=[r15],16
+ ;;
+ ld8 r10=[r14]
+ ld8 r11=[r15]
;;
-}
{ .mmb
(p15) st8 [r3]=r2
mov ar.fpsr=r23
@@ -234,7 +237,7 @@ ENTRY(_ia64_save_context, 1)
;;
}
{ .mmi
- st8 [r32]=r13,16 // tp
+ st8 [r32]=r13,16 // tp -- not used
st8 [r31]=r14,16 // rsc
mov r16=b1
;;
@@ -312,12 +315,21 @@ ENTRY(_ia64_save_context, 1)
;;
{ .mmi
stf.spill [r31]=f29,32
- stf.spill [r32]=f30
+ stf.spill [r32]=f30,32+24
+ add r14=1,r0
+ ;;
+}
+{ .mmi
+ stf.spill [r31]=f31,24+24
+ st8 [r32]=r14,16 // r8
add r8=0,r0
;;
}
+ st8 [r31]=r0,16 // r9
+ st8 [r32]=r0 // r10
+ ;;
{ .mmb
- stf.spill [r31]=f31
+ st8 [r31]=r0 // r11
mf
br.ret.sptk rp
;;
OpenPOWER on IntegriCloud