TAL Reference Manual

TAL Reference Manual526371-001
15-1
15 Privileged Procedures
This section gives information on privileged mode and operations and accessing the
global data area of the system data segment. Primarily, this section describes the
syntax for:
System global pointer declarations
'SG'-equivalenced simple variable declarations
'SG'-equivalenced structure declarations
'SG'-equivalenced simple pointer declarations
'SG'-equivalenced structure pointer declarations
Privileged standard functions—$AXADR, $BOUNDS, $SWITCH
Privileged directive—TARGET
Privileged Mode
The following kinds of procedures execute in privileged mode:
A CALLABLE or PRIV procedure
A nonprivileged procedure that is called by a CALLABLE or PRIV procedure
Normally, only the operating system executes in privileged mode. The operating
system performs privileged operations on behalf of applications programs.
CALLABLE Procedures
A CALLABLE procedure is one that you declare with the CALLABLE attribute.
Nonprivileged procedures can call CALLABLE procedures, but only CALLABLE
procedures can call PRIV procedures.
In the following example, a CALLABLE procedure calls the PRIV procedure declared in
the next example:
PROC callable_proc CALLABLE;
BEGIN
!Lots of code
CALL priv_proc;
END;
PRIV Procedures
A PRIV procedure is one that you declare with the PRIV attribute. A PRIV procedure
can execute privileged instructions. Only PRIV or CALLABLE procedures can call a
PRIV procedure. PRIV protects the operating system from unauthorized
(nonprivileged) calls to its internal procedures.