Texas Instruments TMS320 User Manual page 125

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

Advertisement

❏ The fourth parameter on the C6000 platform, CCMASK, specifies the
value to place in the cache control field of the CSR. This cache state
remains in effect for the duration of code executed between the
HWI_enter and HWI_exit calls. Some typical values for this mask are
defined in c62.h62 (for example, C62_PCC_ENABLE). You can OR the
PCC code and DCC code together to generate CCMASK. If you use 0 as
CCMASK, a default value is used. You set this value using GBL
properties in the .tcf configuration file.
CLK_F_isr, which handles one of the on-device timer interrupts when the
Clock Manager is enabled, also uses the cache value set in the
configuration. HWI_enter saves the current CSR status before it sets the
cache bits as defined by CCMASK. HWI_exit restores CSR to its value at
the interrupted context.
The predefined masks C62_ABTEMPS and C62_CTEMPS (C62x) or
C64_ABTEMPS and C64_CTEMPS (C64x) specify all of the C language
temporary A/B registers and all of the temporary control registers,
respectively. These masks can be used to save the registers that can be
freely used by a C function. When using the HWI dispatcher on the C6000
platform, there is no ability to specify a register set, so the registers specified
by these masks are all saved and restored.
For example, if your HWI function calls a C function you would use:
HWI_enter C62_ABTEMPS, C62_CTEMPS, IEMASK, CCMASK
`isr code`
HWI_exit C62_ABTEMPS, C62_CTEMPS, IEMASK, CCMASK
HWI_enter should be used to save all of the C run-time environment registers
before calling any C or DSP/BIOS functions. HWI_exit should be used to
restore these registers.
In addition to saving and restoring the C run-time environment registers,
HWI_enter and HWI_exit make sure the DSP/BIOS scheduler is called only
by the outermost interrupt routine if nested interrupts occur. If the HWI or
another nested HWI triggers an SWI handler with SWI_post, or readies a
higher priority task (for example, by calling SEM_ipost or TSK_itick), the
outermost HWI_exit invokes the SWI and TSK schedulers. The SWI
scheduler services all pending SWI handlers before performing a context
switch to a higher priority task (if necessary).
HWI_enter and HWI_exit both take four parameters on the C2800 platform:
❏ The first parameter, AR_MASK, specifies which CPU registers (xar0-
xar7) are to be saved and restored by the ISR.
Hardware Interrupts
Thread Scheduling
4-21

Advertisement

Table of Contents
loading

Table of Contents