E-54
DINK32 PowerPC ISA Debugger User’s Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
MPC8240 EPIC Interrupt Driver
Pass-Through mode. External interrupts are also left untouched and left in the default state
of disabled. The following list shows the necessary routine calls needed to utilize the EPIC
unit:
Initialize the EPIC unit
— epicInit()
For each interrupt vector to be used:
— epicSourceConfig()
— epicISRConnect()
— epicIntEnable()
Set the Processor Current Tast Priority
— epicCurTaskPrioSet()
Enable External Interrupts
— CoreExtIntEnable()
E.4.8
External Interrupt Exception Path in DINK32
The path of an external interrupt exception in DINK32 begins at the 0x500 interrupt
exception vector. All DINK32 exception vector locations are set up in the same manner
which is to save the exception type and pass the exception handling to a catch all exception
handler. This handler is called handle_ex and is located in the except2.s DINK32 source
file.
In the handle_ex
handler a check is performed to see if the exception was a 0x500 and if
DINK32 is running on an MPC8240, MPC8245 or MPC107. If the two conditions are true,
the exception handling is passed to the EPIC low level interrupt handler, epic_exception()
located in the epic2.s source file. Epic_exception() handles any necessary context
switching and saving of state before calling the EPIC high level interrupt handler, epicISR()
located in the epic1.c source file.
Note: Currently, epic_exception() first checks the mode of the EPIC unit. If in pass-through
mode, an error message is printed stating that the EPIC unit is in pass-through mode and
must be initialized.
EpicISR() acknowledges the interrupt by calling the epicIACK() which returns the vector
number of the interrupting vector source. This vector number is then compared to the
spurious vector value located in the EPIC Spurious Vector Register. If the interrupting
vector is a spurious vector the interrupt is ignored and state is restored to the interrupted
process. If the interrupting vector is a valid interrupt, then the vector number is used to
reference the vector ISR from the cross-reference table. The vector ISR is then called to
service the particular interrupt. Once the ISR completes and returns, an end-of-interrupt is
issued by calling epicEOI(). Control then returns to epic_exception.
F
n
.