Interrupts and Interrupt Controller (INTC)
Freescale Semiconductor
10-39
PXR40 Microcontroller Reference Manual, Rev. 1
10.5.5
Priority Ceiling Protocol
10.5.5.1
Elevating Priority
The PRI field in INTC current priority register (INTC_CPR) is elevated in the OSEK PCP to the ceiling
of all of the priorities of the ISRs that share a resource. This protocol therefore allows coherent accesses
of the ISRs to that shared resource.
For example, ISR1 has a priority of 1, ISR2 has a priority of 2, and ISR3 has a priority of 3. They all share
the same resource. Before ISR1 or ISR2 can access that resource, they must raise the PRI value in
INTC_CPR to 3, the ceiling of all of the ISR priorities. After they release the resource, the PRI value in
INTC_CPR can be lowered. If they do not raise their priority, then ISR2 can preempt ISR1, and ISR3 can
preempt ISR1 or ISR2, possibly corrupting the shared resource. Another possible failure mechanism is
deadlock if the higher priority ISR needs the lower priority ISR to release the resource before it can
continue, but the lower priority ISR can not release the resource until the higher priority ISR completes
and execution returns to the lower priority ISR.
Using the PCP instead of disabling processor recognition of all interrupts eliminates the time when
accessing a shared resource that all higher priority interrupts are blocked. For example, while ISR3 cannot
preempt ISR1 while it is accessing the shared resource, all of the ISRs with a priority higher than 3 can
preempt ISR1.
10.5.5.2
Ensuring Coherency
10.5.5.2.1
Interrupt with Blocked Priority
Non-coherent accesses to a shared resource can occur. As an example, ISR1 and ISR2 both share a
resource. ISR1 has a lower priority, therefore it executes and then writes the new PRI value in the current
priority register (INTC_CPR). The next instruction writes a value to a shared coherent data block.
If INTC asserts the ISR2 interrupt request to the processor just before or at the same time as the first ISR1
write, it is possible for both the ISR1 and ISR2 writes to execute while the processor responds to the INTC
10
ISR308 completes. Interrupt exception
handler writes to INTC_EOIR.
X
1
11
ISR108 completes. Interrupt exception
handler writes to INTC_EOIR.
X
0
12
RTOS continues execution.
X
0
1
ISR108 executes for peripheral interrupt request 100 because the first eight ISRs are for software configurable interrupt
requests.
Table 10-9. Order of ISR Execution Example (continued)
Step
Step Description
Code Executing At End of Step
PRI in
INTC_CPR
at End of
Step
RTOS
ISR108
1
ISR208
ISR308 ISR408
Interrupt
Exception
Handler
Summary of Contents for PXR4030
Page 1: ...PXR40 Microcontroller Reference Manual Devices Supported PXR4030 PXR4040 PXR40RM Rev 1 06 2011...
Page 30: ...PXR40 Microcontroller Reference Manual Rev 1 Freescale Semiconductor xxx...
Page 40: ...PXR40 Microcontroller Reference Manual Rev 1 xl Freescale Semiconductor...
Page 66: ...Memory Map PXR40 Microcontroller Reference Manual Rev 1 2 4 Freescale Semiconductor...
Page 120: ...Signal Descriptions 3 54 Freescale Semiconductor PXR40 Microcontroller Reference Manual Rev 1...
Page 860: ...FlexCAN Module 24 50 Freescale Semiconductor PXR40 Microcontroller Reference Manual Rev 1...
Page 1167: ...Decimation Filter Freescale Semiconductor 28 53 PXR40 Microcontroller Reference Manual Rev 1...
Page 1168: ...Decimation Filter 28 54 Freescale Semiconductor PXR40 Microcontroller Reference Manual Rev 1...