HP Pascal/iX Reference Manual (31502-90022)

12- 16
CALL_PRIVILEGE and EXEC_PRIVILEGE
CALL_PRIVILEGE and EXEC_PRIVILEGE are System-Dependent MPE/iX Options.
The CALL_PRIVILEGE and EXEC_PRIVILEGE compiler options allow routines to
call and execute privileged mode routines. To use these compiler
options, the option STANDARD_LEVEL 'EXT_MODCAL' is required.
The CALL_PRIVILEGE option specifies, for a given routine, the minimum
privilege level that other routines must have to call the specified
routine. The EXEC_PRIVILEGE option specifies the privilege level at
which a routine will execute.
CAUTION Routines not specified by the CALL_PRIVILEGE or EXEC_PRIVILEGE
compiler options are given the lowest privilege level by
default. If you specify a routine to have a higher calling or
executing privilege level, the routine is allowed to override
safety features in the MPE/iX operating system. Therefore,
exercise caution when using CALL_PRIVILEGE and EXEC_PRIVILEGE
because misuse can destroy your operating system.
Syntax
$CALL_PRIVILEGE
integer
$
$EXEC_PRIVILEGE
integer
$
Parameter
integer
An integer in the range 0 . . 3, with 0 being the most
privileged level and 3 the least.
Default Privilege level 3.
Location Before the body of the routine, but after the reserved
words PROCEDURE or FUNCTION.
Example
$STANDARD_LEVEL 'EXT_MODCAL'$
PROGRAM p;
PROCEDURE proc1 $CALL_PRIVILEGE 1$ (
VAR i : integer);
BEGIN
END;
PROCEDURE proc2 $EXEC_PRIVILEGE 2$ (
VAR i : integer);
BEGIN
END;
PROCEDURE proc3 $CALL_PRIVILEGE 1$
$EXEC_PRIVILEGE 0$ (
VAR i: integer);
BEGIN
END;
BEGIN
END.
Any routine calling procedure proc1 must execute at privilege level 1 or
level 0. By default, proc1 executes at privilege level 3. Procedure
proc2 executes at level 2; a routine calling proc2 may be executing at