When you write to Xscratchcswl you check (Ypil == zeros()) != (Yil == zeros()), but does Y = X or does Y = cur_privilege?
Unfortunately the example pseudocode is for accessing mscratchcswl where X and Y must both be machine mode. That isn't true when accessing sscratchcswl from machine mode though.
When you write to
Xscratchcswl
you check(Ypil == zeros()) != (Yil == zeros())
, but doesY = X
or doesY = cur_privilege
?Unfortunately the example pseudocode is for accessing
mscratchcswl
whereX
andY
must both be machine mode. That isn't true when accessingsscratchcswl
from machine mode though.