diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-05-05 15:10:10 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-05-05 15:10:10 +0000 |
commit | 1b94f4cd23fe81f753edb47704179f6b30a1146e (patch) | |
tree | 9fe5f49cd94fcc18e31c7ac34970031c2692549e /sys/arch/hppa64 | |
parent | 9ed3a34171b4c8cb2c183644c7fc2ec2467a9f8a (diff) |
Make sure we restore sr4 at the very end (just before we go physical) otherwise
further loads from the trapframe will be done from the wrong address space.
Diffstat (limited to 'sys/arch/hppa64')
-rw-r--r-- | sys/arch/hppa64/hppa64/locore.S | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/arch/hppa64/hppa64/locore.S b/sys/arch/hppa64/hppa64/locore.S index e6b0323287c..58309ac0fb1 100644 --- a/sys/arch/hppa64/hppa64/locore.S +++ b/sys/arch/hppa64/hppa64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.25 2011/05/03 20:59:22 kettenis Exp $ */ +/* $OpenBSD: locore.S,v 1.26 2011/05/05 15:10:09 kettenis Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -464,21 +464,6 @@ $syscall_return ldd TF_SP(%arg0), %arg2 /* sp */ std %arg2, 14*8(%r1) - ldd TF_SR2(%arg0), %arg2 - ldd TF_SR3(%arg0), %arg3 - mtsp %arg2, %sr2 - mtsp %arg3, %sr3 - - ldd TF_SR4(%arg0), %arg2 - ldd TF_SR5(%arg0), %arg3 - mtsp %arg2, %sr4 - mtsp %arg3, %sr5 - - ldd TF_SR6(%arg0), %arg2 - ldd TF_SR7(%arg0), %arg3 - mtsp %arg2, %sr6 - mtsp %arg3, %sr7 - /* * Restore general registers. */ @@ -532,6 +517,21 @@ $syscall_return mtctl %arg2, %cr30 mtctl %arg3, %cr27 + ldd TF_SR2(%arg0), %arg2 + ldd TF_SR3(%arg0), %arg3 + mtsp %arg2, %sr2 + mtsp %arg3, %sr3 + + ldd TF_SR6(%arg0), %arg2 + ldd TF_SR7(%arg0), %arg3 + mtsp %arg2, %sr6 + mtsp %arg3, %sr7 + + ldd TF_SR4(%arg0), %arg2 + ldd TF_SR5(%arg0), %arg3 + mtsp %arg2, %sr4 + mtsp %arg3, %sr5 + /* Clear system masks before restoring queues and space registers. */ rsm (PSL_R|PSL_Q|PSL_P|PSL_I|PSL_D), %r0 nop ! nop ! nop ! nop |