Download Coma FW-C2800 User`s guide

Transcript
Hardware Interrupts
Whether called explicitly, C55 or by the HWI dispatcher, the HWI_enter and
HWI_exit macros prepare an ISR to call any C function. In particular, the ISR
is prepared to call any DSP/BIOS API function that is allowed to be called
from the context of an HWI. (See Functions Callable by Tasks, SWI Handlers,
or Hardware ISRs in the TMS320 DSP/BIOS API Reference Guide for your
platform for a complete list of these functions.)
Note:
When using the system HWI dispatcher on the C6000 and C54x platforms,
the HWI function must not call HWI_enter and HWI_exit.
Regardless of which HWI dispatching method is used, DSP/BIOS uses the
system stack during the execution of both SWIs and HWIs. If there are no
TSK tasks in the system, this system stack is used by all threads. If there are
TSK tasks, each task uses its own private stack. Whenever a task is
preempted by an SWI or HWI, DSP/BIOS uses the system stack for the
duration of the interrupt thread.
HWI_enter and HWI_exit both take two parameters on the C54x platform:
❏
The first, MASK, specifies which CPU registers are to be saved and
restored by the ISR.
❏
The second parameter of HWI_enter and HWI_exit on the C54x platform,
IMRDISABLEMASK, is a mask of those interrupts that are to be disabled
between the HWI_enter and HWI_exit macro calls.
When an interrupt is triggered, the processor disables interrupts globally
(by setting the INTM bit in the status register ST1) and then jumps to the
ISR set up in the interrupt vector table. The HWI_enter macro reenables
interrupts by clearing the INTM bit in the ST1 register. Before doing so,
HWI_enter selectively disables some interrupts by clearing the
appropriate bits in the interrupt mask register (IMR). The bits that are
cleared in the IMR are determined by the IMRDISABLEMASK input
parameter passed to the HWI_enter macro. Hence, HWI_enter gives you
control to select what interrupts can and cannot preempt the current HWI
function.
4-20