NonStop S-Series Server Description Manual (G06.24+)
Native Execution Mode
HP NonStop S-Series Server Description Manual—520331-003
7-10
Invoking Privilege Requires Taking an Exception
Invoking Privilege Requires Taking an 
Exception
Unlike TNS processors (CISC-based), which invoke privilege in the microcode of the 
calling instruction, RISC-based processors, such as the NonStop S-series processors, 
always go through a sequence of events involving an exception to set the privileged 
state. Figure 7-5 illustrates the sequences for the three execution modes; the first two 
are discussed in Section 6, TNS Execution Modes, and the third in this topic. In all 
three cases, a program shown on the left side of the figure is calling the CALLABLE 
procedure shown at the right side of the figure.
The native mode case is similar to the accelerated mode case. That is, the calling 
code first invokes a gateway that loads a byte from Kseg2. However, the address of 
the target byte is different, indicating a native Enter_Priv transition. The byte is loaded 
to register v0, not discarded (its negative value indicates to the called procedure that it 
was called from a privileged procedure). If the test is successful, the exception handler 
moves the stack pointer to a fixed address on the privileged stack; it puts the original 
stack pointer into v0 so that the called procedure can find its original parameters. Then 
it allows the process to proceed in privileged state.
To-RISC shells for CALLABLE native procedures are themselves CALLABLE and use 
the same gateways that native procedures use. Yet another Kseg2 address identifies 
these gateways, which are entered in accelerated mode and do not switch stacks (the 
forthcoming Enter_RISC mode transition does that).
(Gateway tables are like CALLABLE PEP entries: the operating system will not run a 
program containing one unless the program is licensed or initiated by the super ID, 
255,255.)










