SWI_setattrs
Application Program Interface
2-449
C Interface
Syntax
SWI_setattrs(swi, attrs);
Parameters
SWI_Handle swi;
/* handle of the swi */
SWI_Attrs
*attrs;
/* pointer to swi attributes */
Return Value
Void
Description
SWI_setattrs sets attributes of an existing SWI object.
The swi parameter specifies the address of the SWI object whose
attributes are to be set.
The attrs parameter, which can be either NULL or a pointer to a structure
that contains attributes for the SWI object, facilitates setting the attributes
of the SWI object. If attrs is NULL, the new SWI object is assigned a
default set of attributes. Otherwise, the SWI object’s attributes are
specified through a structure of type SWI_attrs defined as follows:
struct SWI_Attrs {
SWI_Fxn fxn;
Arg arg0;
Arg arg1;
Int priority;
Uns mailbox;
};
The fxn attribute, which is the address of the swi function, serves as the
entry point of the software interrupt service routine.
The arg0 and arg1 attributes specify the arguments passed to the swi
function, fxn.
The priority attribute specifies the SWI object’s execution priority and
must range from 1 to 14. Priority 14 is the highest priority. You cannot use
a priority of 0; that priority is reserved for the system SWI that runs the
TSK scheduler.
The mailbox attribute is used either to determine whether to post the SWI
or as a value that can be evaluated within the SWI function.
All default attribute values are contained in the constant SWI_ATTRS,
which can be assigned to a variable of type SWI_Attrs prior to calling
SWI_setattrs.
SWI_setattrs
Set attributes of a software interrupt