B.2 Register Conventions - Texas Instruments TMS320C55 Series Reference Manual

Dsp/bios 5.32 application programming interface api
Table of Contents

Advertisement

Overview
B.1
Overview
B.2
Register Conventions
Register
AC0-AC3
(X)AR0-(X)AR4
(X)AR5-(X)AR7
B-2
In a multi-threaded application using DSP/BIOS, it is necessary to know
which registers can or cannot be modified. Furthermore, users need to
understand which registers are preserved across task context switches
and interrupts.
The following definitions describe the various possible register handling
behaviors:
❏ H - HWI. These registers are saved/restored by the HWI dispatcher
and HWI_enter/HWI_exit. In general, the "child" function register set
(as defined by the C compiler) is not preserved by the HWI dispatcher
or the HWI_enter macro since it is assumed that the HWI function
called is written in C and will therefore preserve any "child" registers
it uses.
❏ T - TSK. These registers are saved/restored during a TSK context
switch. In general, only the "child" function register set is actively
preserved in the task's execution context during a synchronous
context switch. This is because it is assumed that the function that
invoked the task switch has already saved its "parent" register set.
Task context switches that result from preemption by an interrupt will
preserve the entire processor state so that execution can safely
resume at the instruction following the interrupted instruction.
❏ G - Global. These registers are shared across all threads in the
system. They are not saved and restored during interrupt handling
nor during task context switching. To make a temporary change,
save the register, make the change, and then restore it.
❏ I - Initialized register. These registers are set to a particular value
during HWI processing and are restored to their incoming value upon
return to the interrupted routine.
Table 2–12 Register Handling
Register Name
Accumulators
Auxiliary Registers
Auxiliary Registers
Type
Notes
H
H
T
These "child" registers are pre-
sumed to be saved by an HWI
that uses them.

Advertisement

Table of Contents
loading

Table of Contents