summaryrefslogtreecommitdiff
path: root/sys/arch/hppa64
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2011-04-13 15:22:49 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2011-04-13 15:22:49 +0000
commitc055286d0edd127f1fe49de8cf2bc48d0d471532 (patch)
treed9c45079a25cddf0bc1395603bae9a78ce3a337a /sys/arch/hppa64
parentd1f2ce0cf643586ccb4c4beb69d88aaf67b6259d (diff)
Do not use a virtual address whilst in physical mode. Instead save the sp
and iir in the physical trap save area and copy into the trap frame once back in virtual. ok kettenis@
Diffstat (limited to 'sys/arch/hppa64')
-rw-r--r--sys/arch/hppa64/hppa64/locore.S19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/arch/hppa64/hppa64/locore.S b/sys/arch/hppa64/hppa64/locore.S
index a3c3da2f210..1fbbb379c78 100644
--- a/sys/arch/hppa64/hppa64/locore.S
+++ b/sys/arch/hppa64/hppa64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.18 2011/04/07 18:36:26 kettenis Exp $ */
+/* $OpenBSD: locore.S,v 1.19 2011/04/13 15:22:48 jsing Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -812,13 +812,14 @@ TLABEL(all_kern)
ldo 127(%sp), %sp
depdi 0, 63, 7, %sp
- ldo TF_SP(%sp), %r8
- std %r17, 0(%r8)
+ mfctl %cr24, %r8
+ ldo CI_TRAP_SAVE(%r8), %r8
+ std %r17, 0(%r8) /* sp */
fdc %r0(%r8)
+ ldo 8(%r8), %r8
mfctl %iir, %r16
- ldo TF_IIR(%sp), %r8
- std %r16, 0(%r8)
+ std %r16, 0(%r8) /* iir */
fdc %r0(%r8)
mtctl %r1, %cr26
@@ -934,6 +935,14 @@ TLABEL(all_virt)
mtsp %r0, %sr6
mtsp %r0, %sr7
+ /* Copy sp and iir from physical trap save area. */
+ mfctl %cr24, %r1
+ ldo CI_TRAP_SAVE(%r1), %r1
+ ldd 0*8(%r1), %arg2
+ ldd 1*8(%r1), %arg3
+ std %arg2, TF_SP(%arg1)
+ std %arg3, TF_IIR(%arg1)
+
ldo TRAPFRAME_SIZEOF(%arg1), %sp
copy %sp, %r3
std,ma %r0, HPPA_FRAME_SIZE(%sp)