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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

2.3 Branch Processor Instructions<br />

2.4 System Linkage Instructions<br />

These instructions provide the means by which a program<br />

can call upon the system to perform a service,<br />

and by which the system can return from performing a<br />

service or from processing an interrupt.<br />

The System Call instruction is described in Book I, but<br />

only at the level required by an application programmer.<br />

A complete description of this instruction appears<br />

below.<br />

System Call<br />

SC-form<br />

Return From Interrupt<br />

XL-form<br />

sc<br />

rfi<br />

17 /// /// /// /// // 1 /<br />

0 6 11 16 20 27 30 31<br />

SRR0 iea CIA + 4<br />

SRR1 MSR<br />

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

MSR new_value (see below)<br />

The effective address of the instruction following the<br />

System Call instruction is placed into SRR0. The contents<br />

of the MSR are copied into SRR1.<br />

Then a System Call interrupt is generated. The interrupt<br />

causes the MSR to be set as described in Section<br />

5.6 on page 552.<br />

The interrupt causes the next instruction to be fetched<br />

from effective address<br />

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

This instruction is context synchronizing.<br />

Special Registers Altered:<br />

SRR0 SRR1 MSR<br />

19 /// /// /// 50 /<br />

0 6 11 16 21 31<br />

MSR SRR1<br />

NIA iea SRR0 0:61 || 0b00<br />

The rfi instruction is used to return from a base class<br />

interrupt, or as a means of simultaneously establishing<br />

a new context and synchronizing on that new context.<br />

The contents of SRR1 are placed into the MSR. If the<br />

new MSR value does not enable any pending exceptions,<br />

then the next instruction is fetched, under control<br />

of the new MSR value, from the address<br />

SRR0 0:61 ||0b00. (Note: VLE behavior may be different;<br />

see Book VLE.) If the new MSR value enables one or<br />

more pending exceptions, the interrupt associated with<br />

the highest priority pending exception is generated; in<br />

this case the value placed into the applicable save/<br />

restore register 0 by the interrupt processing mechanism<br />

(see Section 5.6 on page 552) is the address of<br />

the instruction that would have been executed next had<br />

the interrupt not occurred (i.e. the address in SRR0 at<br />

the time of the execution of the rfi).<br />

This instruction is privileged and context synchronizing.<br />

Special Registers Altered:<br />

MSR<br />

Chapter 2. Branch Processor<br />

493

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

Saved successfully!

Ooh no, something went wrong!