Method (GPRW, 2, NotSerialized)
{
Store (Arg0, Index (PRWP, Zero))
Store (ShiftLeft (SS1, One), Local0)
Or (Local0, ShiftLeft (SS2, 0x02), Local0)
Or (Local0, ShiftLeft (SS3, 0x03), Local0)
Or (Local0, ShiftLeft (SS4, 0x04), Local0)
If (And (ShiftLeft (One, Arg1), Local0))
{
Store (Arg1, Index (PRWP, One))
}
Else
{
ShiftRight (Local0, One, Local0)
If (LOr (LEqual (OSFL (), One), LEqual (OSFL (), 0x02)))
{
FindSetLeftBit (Local0, Index (PRWP, One))
}
Else
{
FindSetRightBit (Local0, Index (PRWP, One))
}
}
Return (PRWP)
}