1
0
31
1
Figure 10-8. UIC Vector Register (UICO_ VR)
I
0:31
I Interrupt Vector
The following example illustrates the generation of a UICO_ VR vector for external interrupt request
IRQ2.
For the example, assume that UICO_ VCR[PRO] = 1, so that
UICO~SR[EIR6S]
(UICO_SR
31
)has the
highest interrupt priority, and that
UICO_SR[EIR2S] (UICO_SR
27
) is the current highest priority,
enabled, active, critical interrupt.
To
generate the vector for the interrupt associated with
UICO_SR[EIR2S], internal logic multiplies the difference between the highest priority interrupt bit and
the active
enabled priority interrupt bit by 512. The interrupt vector offset is therefore
(31
-
27) x 512
= 4 x 512. This offset is added to the base address in UICO_ VCR[VBA], and the UICO_ VR
returns UICO_VCR[VBA] +
(4
x 512).
10.5.8.1 Using
the
Value in
UICO_VR
as a Vector
Address
or
Entry
Table
Lookup
If an interrupt handler is 512 bytes or smaller, system software can interpret the value returned in the
UICO_ VR as an address. In this case, when the interrupt is received, the UICO_ VR is read and
software
simply jumps to the address represented by the UICO_ VR value. Alternatively, the routine
can be at a different address, and system software can treat the
value
of
the UICO_ VR as a pointer,
storing the interrupt
handler address in the UICO_ VR during system initialization. In this case, when
the interrupt is
handled, software must read the UICO_ VR, read the entry at the UICO_ VR value, and
jump
to the entry. Hardware has no knowledge of the method is used, which is determined by system
software.
10.5.8.2 Vector Generation Scenarios
For the following sequence, assume that the interrupts are enabled and critical (vectors are not
generated for
disabled
or
non-critical interrupts). The sequence illustrates several scenarios for vector
generation.
1. An intermediate priority interrupt goes active; its vector is stored in
UICO_ VR.
2. A low priority interrupt goes active; UICO_ VR is unchanged.
3. Software reads the vector;
UICO_
VR
is unchanged.
4. Software resets the intermediate priority interrupt; UICO_ VR contains the vector for the low priority
interrupt.
5. A high priority interrupt goes active;
UICO_ VR contains the vector for the high priority interrupt.
6. Software resets the high priority interrupt;
UICO_ VR contains the vector for the low priority
interrupt.
10-20 PPC405GP User's Manual
Preliminary