HP3000-L Archives

September 1997, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Gavin Scott <[log in to unmask]>
Reply To:
Gavin Scott <[log in to unmask]>
Date:
Sat, 6 Sep 1997 10:41:02 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (20 lines)
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.

ATOM RSS1 RSS2