EasyManuals Logo

Texas Instruments TMS320 User Manual

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #123 background imageLoading...
Page #123 background image
Hardware Interrupts
Thread Scheduling 4-19
4.2.4 Context and Interrupt Management Within Interrupts
When a hardware interrupt preempts the function that is currently executing,
the HWI function must save and restore any registers it uses or modifies.
DSP/BIOS provides the HWI_enter assembly macro to save registers and the
HWI_exit assembly macro to restore registers. Using these macros gives the
function that was preempted the same context when it resumes running. In
addition to the register context saving/restoring functionality, the
HWI_enter/HWI_exit macros perform the following system level operations:
ensure the SWI and TSK schedulers are called at the appropriate times
disable/restore individual interrupts while the ISR executes
The HWI_enter assembly macro must be called prior to any DSP/BIOS API
calls that could post or affect a software interrupt or semaphore. The
HWI_exit assembly macro must be called at the very end of the function’s
code.
In order to support interrupt routines written completely in C, DSP/BIOS
provides an HWI dispatcher that performs these enter and exit macros for an
interrupt routine. An HWI can handle context saving and interrupt disabling
using this HWI dispatcher or by explicitly calling HWI_enter and HWI_exit.
The HWI configuration properties allow you to choose whether the HWI
dispatcher is used for individual HWI objects. The HWI dispatcher is the
preferred method for handling interrupts.
The HWI dispatcher, in effect, calls the configured HWI function from within
an HWI_enter/HWI_exit macro pair. This allows the HWI function to be written
completely in C. It would, in fact, cause a system crash were the dispatcher
to call a function that contains the HWI_enter/HWI_exit macro pair. Using the
dispatcher therefore allows for only one instance of the HWI_enter and
HWI_exit code.
Note:
The interrupt keyword or INTERRUPT pragma must not be used when
HWI objects are used in conjunction with C functions.The
HWI_enter/HWI_exit macros and the HWI dispatcher contain this
functionality, and the use of the C modifier can cause program failure.

Table of Contents

Other manuals for Texas Instruments TMS320

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 and is the answer not in the manual?

Texas Instruments TMS320 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320
CategoryComputer Hardware
LanguageEnglish

Related product manuals