There is one code path using it in %g2 and another using it in %g7.
There is no reason for them to use different registers, and fixing
this allows the check to be performed a bit earlier.
ok claudio@ kettenis@
-/* $OpenBSD: locore.s,v 1.212 2024/03/29 21:23:17 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.213 2024/03/29 21:25:55 miod Exp $ */
/* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */
/*
andn %g1, CWP, %g1
wrpr %g1, %g7, %tstate
+ rdpr %otherwin, %g7
+ brnz %g7, 1f
+ nop
+
/* XXX Rewrite sun4u code to handle faults like sun4v. */
sethi %hi(cputyp), %g2
ld [%g2 + %lo(cputyp)], %g2
bne,pt %icc, 1f
nop
- rdpr %otherwin, %g2
- brnz %g2, 1f
- nop
-
wr %g0, ASI_AIUS, %asi
rdpr %cwp, %g1
dec %g1
rdpr %canrestore, %g7
wrpr %g7, 0, %otherwin
wrpr %g0, 0, %canrestore
+ rdpr %otherwin, %g7
1:
- rdpr %otherwin, %g7 ! restore register window controls
wrpr %g7, 0, %canrestore
wrpr %g0, 0, %otherwin
wrpr WSTATE_USER, %wstate ! Need to know where our sp points