Mark after Stan after Mark:
>> GETPRIVMODE (); /* unless caller was already in priv mode */
>>
>>> return get_control_reg(10) & 0xff;
>
>Stan is, of course, correct about the need for GETPRIVMODE () if these
>routines don't exist already exist in a privileged XL.
Control registers (other than SAR, CR26, CR27, and the Interval Timer if
the S bit in the PWS is off) can only be read at the "most privileged level",
i.e. ring zero, so the GETPRIVMODE() call here isn't going to do you any
good, as get_control_reg is not a not a function but a compiler construct
that expands inline to an MFCTL instruction which will trap due to the
code not executing at a sufficient privilege level (GETPRIVMODE() promotes
a process from ring 3 to ring 2).
Nyeah. :-)
G.