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 />

Check interrupts) will occur as a result of those<br />

instructions.<br />

5.5 Interrupt Processing<br />

Associated with each kind of interrupt is an interrupt<br />

vector, that is the address of the initial instruction that is<br />

executed when the corresponding interrupt occurs.<br />

Interrupt processing consists of saving a small part of<br />

the processor’s state in certain registers, identifying the<br />

cause of the interrupt in another register, and continuing<br />

execution at the corresponding interrupt vector<br />

location. When an exception exists that will cause an<br />

interrupt to be generated and it has been determined<br />

that the interrupt can be taken, the following actions are<br />

performed, in order:<br />

1. SRR0, DSRR0 [Category: Embedded.Enhanced<br />

Debug], MCSRR0, or CSRR0 is loaded with an<br />

instruction address that depends on the interrupt;<br />

see the specific interrupt description for details.<br />

2. The ESR is loaded with information specific to the<br />

exception. Note that many interrupts can only be<br />

caused by a single kind of exception event, and<br />

thus do not need nor use an ESR setting to indicate<br />

to the cause of the interrupt was.<br />

3. SRR1, DSRR1 [Category: Embedded.Enhanced<br />

Debug], or MCSRR1, or CSRR1 is loaded with a<br />

copy of the contents of the MSR.<br />

4. The MSR is updated as described below. The new<br />

values take effect beginning with the first instruction<br />

following the interrupt. MSR bits of particular<br />

interest are the following.<br />

MSR WE,EE,PR,FP,FE0,FE1,IS,DS are set to 0 by<br />

all interrupts.<br />

MSR ME is set to 0 by Machine Check interrupts<br />

and left unchanged by all other interrupts.<br />

MSR CE is set to 0 by critical class interrupts,<br />

Debug interrupts, and Machine Check interrupts,<br />

and is left unchanged by all other interrupts.<br />

MSR DE is set to 0 by critical class interrupts<br />

unless Category E.ED is supported, by Debug<br />

interrupts, and by Machine Check interrupts,<br />

and is left unchanged by all other interrupts.<br />

MSR CM is set to MSR ICM .<br />

Other supported MSR bits are left unchanged<br />

by all interrupts.<br />

See Section 2.2.1 for more detail on the definition<br />

of the MSR.<br />

5. Instruction fetching and execution resumes, using<br />

the new MSR value, at a location specific to the<br />

interrupt. The location is<br />

IVPR 0:47 || IVORi 48:59 || 0b0000<br />

where IVPR is the Interrupt Vector Prefix Register<br />

and IVORi is the Interrupt Vector Offset Register<br />

for that interrupt (see Figure 13 on page 546). The<br />

contents of the Interrupt Vector Prefix Register and<br />

Interrupt Vector Offset Registers are indeterminate<br />

upon power-on reset, and must be initialized by<br />

system software using the mtspr instruction.<br />

Interrupts may not clear reservations obtained with<br />

Load and Reserve instructions. The operating system<br />

should do so at appropriate points, such as at process<br />

switch.<br />

At the end of an interrupt handling routine, execution of<br />

an rfi, rfdi [Category: Embedded.Enhanced Debug],<br />

rfmci, or rfci causes the MSR to be restored from the<br />

contents of SRR1, DSRR1 [Category: Embedded.Enhanced<br />

Debug], MCSRR1, or CSRR1, and<br />

instruction execution to resume at the address contained<br />

in SRR0, DSRR0 [Category: Embedded.Enhanced<br />

Debug], MCSRR0, or CSRR0,<br />

respectively.<br />

Programming Note<br />

In general, at process switch, due to possible process<br />

interlocks and possible data availability<br />

requirements, the operating system needs to consider<br />

executing the following.<br />

<br />

<br />

stwcx. or stdcx., to clear the reservation if<br />

one is outstanding, to ensure that a lwarx or<br />

ldarx in the “old” process is not paired with a<br />

stwcx. or stdcx. in the “new” process.<br />

msync, to ensure that all storage operations of<br />

an interrupted process are complete with<br />

respect to other processors before that process<br />

begins executing on another processor.<br />

isync, rfi, rfdi [Category: Embedded.Enhanced<br />

Debug], rfmci, or rfci to ensure<br />

that the instructions in the “new” process execute<br />

in the “new” context.<br />

550<br />

<strong>Power</strong> ISA -- Book III-E

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

Saved successfully!

Ooh no, something went wrong!