The SparcV8 standard states, page 134 : "If any of the three instructions after a write state register instruction reads any field that was changed by the original write state register instruction, the contents of that field read by that instruction are undefined." The restore instruction depends on the %WIM register, three NOPs must be inserted.
diff a/openbios-devel/arch/sparc32/wuf.S b/openbios-devel/arch/sparc32/wuf.S --- a/openbios-devel/arch/sparc32/wuf.S +++ b/openbios-devel/arch/sparc32/wuf.S @@ -121,7 +121,7 @@ fnwin_patch1: srl %t_wim, 7, %twin_tmp2 fnwin_patch2: and %twin_tmp1, 0xff, %twin_tmp1
wr %twin_tmp1, 0x0, %wim /* Make window 'I' invalid */ - + WRITE_PAUSE restore %g0, %g0, %g0 /* Restore to window 'O' */
/* Trapped from kernel, we trust that the kernel does not
Signed-off-by: Olivier DANET odanet@caramail.com