User`s guide

Software Interrupts
Thread Scheduling 4-27
4.3.1 Creating SWI Objects
As with many other DSP/BIOS objects, you can create SWI objects either
dynamically (with a call to SWI_create) or statically (with the Configuration
Tool). Software interrupts you create dynamically can also be deleted during
program execution.
To add a new software interrupt with the Configuration Tool, create a new SWI
object for the SWI Manager in the Configuration Tool. In the Property Page of
each SWI object, you can set the function each software interrupt is to run
when the object is triggered by the application. The Configuration Tool also
allows you to enter two arguments for each SWI function.
In the Property Page of the SWI Manager, you can determine from which
memory segment SWI objects are allocated. SWI objects are accessed by
the SWI Manager when software interrupts are posted and scheduled for
execution.
The online help in the Configuration Tool describes SWI objects and their
parameters. See SWI Module in the TMS320 DSP/BIOS API Reference
Guide for your platform for reference information on the SWI module API
calls.
To create a software interrupt dynamically, use a call with this syntax:
swi = SWI_create(attrs);
Here, swi is the interrupt handle and the variable attrs points to the SWI
attributes. The SWI attribute structure (of type SWI_Attrs) contains all those
elements that can be configured for an SWI using the Configuration Tool. attrs
can be NULL, in which case, a default set of attributes is used. Typically, attrs
contains at least a function for the handler.
Note:
SWI_create can only be called from the task level, not from an HWI or
another SWI.
SWI_getattrs can be used to retrieve all the SWI_Attrs attributes. Some of
these attributes can change during program execution, but typically they
contain the values assigned when the object was created.
SWI_getattrs(swi, attrs);