Texas Instruments TMS320 User Manual page 124

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Hardware Interrupts
4-20
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 C6000platforms, 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.
The C55x platform can have seven parameters in all, the first five specify
which CPU registers to save as context, and the last two can specify two
interrupt mask bitmaps.
HWI_enter and HWI_exit both take four parameters on the C6000 platform:
❏ The first two, ABMASK and CMASK, specify which A, B, and control
registers are to be saved and restored by the ISR.
❏ The third parameter on the C6000 platform, IEMASK, 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 clearing the GIE bit in the control status register (CSR)) and then
jumps to the ISR set up in the interrupt service table. The HWI_enter
macro reenables interrupts by setting the GIE in the CSR. Before doing
so, HWI_enter selectively disables bits in the interrupt enable register
(IER) determined by the IEMASK parameter. Hence, HWI_enter gives
you control to select what interrupts can and cannot preempt the current
HWI function.
When HWI_exit is called, the bit pattern in the IEMASK determines what
interrupts are restored by HWI_exit by setting the corresponding bits in
the IER. Of the interrupts in IEMASK, HWI_exit restores only those that
were disabled with HWI_enter. If upon exiting the ISR you do not want to
restore one of the interrupts that was disabled with HWI_enter, do not set
that interrupt bit in IEMASK in HWI_exit. HWI_exit does not affect the
status of interrupt bits that are not in IEMASK.

Advertisement

Table of Contents
loading

Table of Contents