gtpm6m0kMain Supervisor Reference

Handling System Interrupts

An interrupt is a hardware-enforced transfer of control. There are five types of interrupts: external, input/output (I/O), machine check, program check, and supervisor call (SVC). Table 2 summarizes the different types of interrupts, which areas of the control program process them, and what causes them.

Table 2. System Interrupts

Type of Interrupt Processed By Caused By
External External interrupt handler (CTME)
  • Signal from the interrupt key on the system console
  • TOD clock comparator
  • CPU timer
  • Sysplex Timer (STR)
  • TOD clock synch checks
  • Service signals
  • Malfunction alerts
  • External calls.

I/O Common I/O handler (CCIO) Status from an I/O operation
Machine check Machine check handler (CMKH) Equipment malfunction (hardware error)
Program check System error processor (CPSE) Programming error
SVC SVC macro decoder (CEDM) Supervisor call instruction

SVC and Fast-Link Macros

SVC instructions are requests for control program services. When an SVC is executed, the macro decoder gets control and PSWs are swapped. The SVC new PSW allows the macro service routine to store into any area of memory, and issue supervisor state instructions.

For some requests for control program services the storage protection key does not need to be changed, privileged instructions are not needed, and protected storage is not updated. For these requests, TPF fast-link macros provide a faster processing path than SVC instructions. (This is because fast-link macros use a Branch and Save Register instruction, rather than swapping PSWs.)

Pointers to SVC routines are maintained in tables. There are 255 SVC entries in the primary SVC tables (for main and application I-streams). Of these 255 entries, 31 are reserved for customers or "users," and 2 are reserved to point to a second-level structure. This secondary or indexed table supports an additional 32,767 SVCs. To specify secondary SVCs, add a halfword index number to the SVC instruction.

You can define and maintain data in the primary and secondary SVC tables and the fast-link macro tables using the following macros:

CRESVC
Defines an SVC or fast-link macro to the system and adds the macro definition to the primary, secondary, or fast-link macro table.

CREGPC
Defines a macro group so that you can set debugger macro breakpoints to trap a group of SVCs instead of requesting the SVC names individually.

USRSVC
Contains user-defined CREGPC and CRESVC macro calls.

CFISVC
Returns the address of the macro table entry for a specified SVC.

SVC Macro Decoder

All SVC instructions that are requests for some control program service activate the SVC macro decoder (CEDM).

  1. CEDM saves the active program's registers in the entry's ECB.
  2. If keypoint record A (CTKA) specifies that macro trace is active, CEDM records the use of supervisor call (SVC) macros in the ECB.
  3. CEDM routes the request to the correct macro service routine.
  4. Once the macro request is completed, CEDM restores the active program's registers and returns to the next sequential instruction.

(See Checking System Internals for information on ECB-check and the internal trace table.)

Fast-Link Macro Decoder

The fast-link macro decoder is activated through a branch and save register (BASR) instruction. Therefore, the fast-link macro decoder operates in problem state. Control is passed directly to the requested macro service routine, which completes the request and activates the common fast-link exit routine. This routine is responsible for restoring registers and returning control to the program's next sequential instruction.

Adding New SVC or Fast-Link Macros to the System

To add new SVC or fast-link macros:

  1. Code the SVC service routine and the macro that invokes the service routine. The SVC service routine should be in a copy member that is called by CCUEXT.
  2. Code a CRESVC macro for each new SVC or fast-link macro, and optionally code the CREGPC macro for each new macro group and put these calls into USRSVC. (USRSVC will use these entries to generate the macro decoder table and your secondary SVC tables.)

You can call CFISVC from both E-type and CP programs, as well as from ICDF and STPP, to get the address of an entry in any SVC or fast-link table. Use data macro ISV0SV to reference fields in the table entries.

Displaying SVC Codes

You can display any SVC interrupt code in hexadecimal using the ZDSVC command. The display SVC code program returns the SVC code to the CRAS terminal that issued the ZDSVC command.