| Previous | Table of Contents | Next |
A couple of examples may be helpful. Suppose we have a program that attempts to divide a number by zero, an obvious error condition. This error will be reported as an exception when it is detected during the execution of the divide instruction. It is synchronous because the same error will occur at the same place in the program whenever the program is run (assuming the data values are always the same). Lets further suppose an I/O operation, such as reading a record from a disk, is executing while we are running our program. At some point, the I/O operation completes and this fact is reported. The mechanism used to report the I/O completion is an event, because it is caused by an action outside of the currently executing instruction. The event is asynchronous, meaning it is not tied to the execution of the running program and it can occur at any time.
Just as there are two types of exceptions at the MI, errors and user-defined conditions, there are two types of events. The two types of MI events are object-related events, such as a message limit being reached on a queue, and machine-related events, such as a specific time interval elapsing. An MI process can monitor the occurrence of a set of events and take action based on some or all of the events.
With the introduction of the ILE program and process models, some changes were made to the exception model. An exception at the MI is a formally architected process message. All process messages are retained in the process queue space, which is a part of the ILE process structure described in a previous section. Because the exception is reported as a message, a delay is possible between the signaling and the processing of the exception. So far, the characteristics of exception structure just described are the same for the original models and for the ILE models.
New for ILE is that the exception monitoring and handling now are explicitly controlled by the MI user. Exception monitors are used to detect the occurrence of particular exceptions. Instructions placed in the MI instruction stream enable and disable these exception monitors. Multiple monitors can be enabled at the same time. Each monitor has a priority, so exception searching and handling is based on priority when more than one monitor is enabled. Associated with each monitor is an exception handler routine. An exception handler is always an external ILE procedure.
SLIC supports both event and exception monitoring and handling. In Chapter 5, we saw that access to system objects was monitored by the machine. This capability, plus some special system-linkage instructions inserted into the PowerPC instruction stream, can accomplish most of the event-monitoring function. Much of the exception-monitoring function is accomplished by the hardware and is reported to the SLIC exception-handling routines through the PowerPC interrupt mechanism. In the next section, we look at the exception management component of SLIC.
Exception management in SLIC is primarily a routing function. The PowerPC interrupt mechanism starts the routing function whenever the hardware detects an interrupt. Once an exception occurs, all applicable SLIC exception handlers are given a chance to handle the exception. If the exception is handled, the process continues as if nothing happened. If the exception is not handled in the SLIC, the process is terminated and the exception is passed to the appropriate ILE exception handler.
Interrupts are classified by whether they are caused specifically by the execution of an instruction or by some other system event. The PowerPC architecture defines a total of 15 types of interrupts. Five of these interrupts are system-caused. They are
The instruction-caused interrupts are
| Previous | Table of Contents | Next |