Texas Instruments TMS320 User Manual page 133

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

Advertisement

Software Interrupts
You can have up to 15 software interrupt priority levels, but each level
requires a larger system stack. If you see a pop-up message that says "the
system stack size is too small to support a new software interrupt priority
level," increase the Application Stack Size property of the Memory Section
Manager.
Creating the first PRD object creates a new SWI object called PRD_swi (see
Section 4.10, Periodic Function Manager (PRD) and the System Clock, page
4-76, for more information on PRD). If no SWI objects have been created
before the first PRD object is added, adding PRD_swi uses the first priority
level, producing a corresponding increase in the required system stack.
If the TSK Manager has been enabled, the TSK scheduler (run by an SWI
object named KNL_swi) reserves the lowest SWI priority level. No other SWI
objects can have that priority.
4.3.4
Execution of Software Interrupts
Software interrupts can be scheduled for execution with a call to SWI_andn,
SWI_dec, SWI_inc, SWI_or, and SWI_post. These calls can be used virtually
anywhere in the program—interrupt service routines, periodic functions, idle
functions, or other software interrupt functions.
When an SWI object is posted, the SWI Manager adds it to a list of posted
software interrupts that are pending execution. Then the SWI Manager
checks whether software interrupts are currently enabled. If they are not, as
is the case inside an HWI function, the SWI Manager returns control to the
current thread.
If software interrupts are enabled, the SWI Manager checks the priority of the
posted SWI object against the priority of the thread that is currently running.
If the thread currently running is the background idle loop or a lower priority
SWI, the SWI Manager removes the SWI from the list of posted SWI objects
and switches the CPU control from the current thread to start execution of the
posted SWI function.
If the thread currently running is an SWI of the same or higher priority, the
SWI Manager returns control to the current thread, and the posted SWI
function runs after all other SWIs of higher priority or the same priority that
were previously posted finish execution.
Thread Scheduling
4-29

Advertisement

Table of Contents
loading

Table of Contents