14.06.2015 Views

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Version</strong> <strong>2.03</strong><br />

5.8 Interrupt Ordering and Masking<br />

It is possible for multiple exceptions to exist simultaneously,<br />

each of which could cause the generation of<br />

an interrupt. Furthermore, for interrupts classes other<br />

than the Machine Check interrupt and critical interrupts,<br />

the architecture does not provide for reporting more<br />

than one interrupt of the same class (unless the<br />

Embedded.Enhanced Debug category is supported).<br />

Therefore, the architecture defines that interrupts are<br />

ordered with respect to each other, and provides a<br />

masking mechanism for certain persistent interrupt<br />

types.<br />

When an interrupt is masked (disabled), and an event<br />

causes an exception that would normally generate the<br />

interrupt, the exception persists as a status bit in a register<br />

(which register depends upon the exception type).<br />

However, no interrupt is generated. Later, if the interrupt<br />

is enabled (unmasked), and the exception status<br />

has not been cleared by software, the interrupt due to<br />

the original exception event will then finally be generated.<br />

All asynchronous interrupts can be masked. In addition,<br />

certain synchronous interrupts can be masked. An<br />

example of such an interrupt is the Floating-Point<br />

Enabled exception type Program interrupt. The execution<br />

of a floating-point instruction that causes the<br />

FPSCR FEX bit to be set to 1 is considered an exception<br />

event, regardless of the setting of MSR FE0,FE1 . If<br />

MSR FE0,FE1 are both 0, then the Floating-Point<br />

Enabled exception type of Program interrupt is<br />

masked, but the exception persists in the FPSCR FEX<br />

bit. Later, if the MSR FE0,FE1 bits are enabled, the interrupt<br />

will finally be generated.<br />

The architecture enables implementations to avoid situations<br />

in which an interrupt would cause the state information<br />

(saved in Save/Restore Registers) from a<br />

previous interrupt to be overwritten and lost. In order to<br />

do this, the architecture defines interrupt classes in a<br />

hierarchical manner. At each interrupt class, hardware<br />

automatically disables any further interrupts associated<br />

with the interrupt class by masking the interrupt enable<br />

in the MSR when the interrupt is taken. In addition,<br />

each interrupt class masks the interrupt enable in the<br />

MSR for each lower class in the hierarchy. The hierarchy<br />

of interrupt classes is as follows from highest to<br />

lowest:<br />

Interrupt Class<br />

MSR Enables<br />

Cleared<br />

Save/Restore<br />

Registers<br />

Machine Check ME,DE, CE, EE MSRR0/1<br />

Debug 1 DE,CE,EE DSRR0/1<br />

Critical CE,EE CSRR0/1<br />

Base EE SRR0/1<br />

1 The Debug interrupt class is Category: E.ED.<br />

Note: MSR DE may be cleared when a critical interrupt<br />

occurs if Category: E.ED is not supported.<br />

Figure 16. Interrupt Hierarchy<br />

If the Embedded.Enhanced Debug category is not supported<br />

(or is supported and is not enabled), then the<br />

Debug interrupt becomes a Critical class interrupt and<br />

all critical class interrupts will clear DE, CE, and EE in<br />

the MSR.<br />

Base Class interrupts that occur as a result of precise<br />

exceptions are not masked by the EE bit in the MSR<br />

and any such exception that occurs prior to software<br />

saving the state of SRR0/1 in a base class exception<br />

handler will result in a situation that could result in the<br />

loss of state information.<br />

This first step of the hardware clearing the MSR enable<br />

bits lower in the hierarchy shown in Figure 16 prevents<br />

any subsequent asynchronous interrupts from overwriting<br />

the Save/Restore Registers (SRR0/SRR1, CSRR0/<br />

CSRR1, MCSRR0/MCSRR1, or DSRR0/DSRR1 [Category:<br />

Embedded.Enhanced Debug]), prior to software<br />

being able to save their contents. Hardware also automatically<br />

clears, on any interrupt,<br />

MSR WE,PR,FP,FE0,FE1,IS,DS . The clearing of these bits<br />

assists in the avoidance of subsequent interrupts of<br />

certain other types. However, guaranteeing that interrupt<br />

classes lower in the hierarchy do not occur and<br />

thus do not overwrite the Save/Restore Registers<br />

(SRR0/SRR1, CSRR0/CSRR1, DSRR0/DSRR1 [Category:<br />

Embedded.Enhanced Debug], or MCSRR0/<br />

MCSRR1) also requires the cooperation of system software.<br />

Specifically, system software must avoid the execution<br />

of instructions that could cause (or enable) a<br />

subsequent interrupt, if the contents of the Save/<br />

Restore Registers (SRR0/SRR1, CSRR0/CSRR1,<br />

DSRR0/DSRR1 [Category: Embedded.Enhanced<br />

Debug]), or MCSRR0/MCSRR1) have not yet been<br />

saved.<br />

Chapter 5. Interrupts and Exceptions<br />

567

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!