diff --git a/sys/sparc64/sparc64/swtch.S b/sys/sparc64/sparc64/swtch.S index dc82b641a698..60a8e475dfdf 100644 --- a/sys/sparc64/sparc64/swtch.S +++ b/sys/sparc64/sparc64/swtch.S @@ -110,6 +110,8 @@ ENTRY(cpu_switch) stx %o0, [PCPU(CURTHREAD)] stx %o1, [PCPU(CURPCB)] + wrpr %g0, PSTATE_NORMAL, %pstate + mov %o1, PCB_REG wrpr %g0, PSTATE_ALT, %pstate mov %o1, PCB_REG wrpr %g0, PSTATE_KERNEL, %pstate diff --git a/sys/sparc64/sparc64/swtch.s b/sys/sparc64/sparc64/swtch.s index dc82b641a698..60a8e475dfdf 100644 --- a/sys/sparc64/sparc64/swtch.s +++ b/sys/sparc64/sparc64/swtch.s @@ -110,6 +110,8 @@ ENTRY(cpu_switch) stx %o0, [PCPU(CURTHREAD)] stx %o1, [PCPU(CURPCB)] + wrpr %g0, PSTATE_NORMAL, %pstate + mov %o1, PCB_REG wrpr %g0, PSTATE_ALT, %pstate mov %o1, PCB_REG wrpr %g0, PSTATE_KERNEL, %pstate