SWI_or
Application Program Interface
2-443
C Interface
Syntax
SWI_or(swi, mask);
Parameters
SWI_Handle swi;
/* SWI object handle*/
Uns
mask;
/* value to be ORed */
Return Value
Void
Reentrant
no
Description
SWI_or is used to post a software interrupt. SWI_or sets the bits specified
by a mask in SWI’s mailbox. SWI_or posts the SWI regardless of the
resulting mailbox value. The bitwise logical operation performed on the
mailbox value is:
mailbox = mailbox OR mask
You specify a SWI’s initial mailbox value in the configuration. The mailbox
value is automatically reset when the SWI executes. To get the mailbox
value, use SWI_getmbox.
For example, you might use SWI_or to post a SWI if any of three events
should cause a SWI to be executed, but you want the SWI’s function to
be able to tell which event occurred. Each event would correspond to a
different bit in the mailbox.
SWI_or results in a context switch if the SWI is higher priority than the
currently executing thread.
Note:
Use the specialized version, SWI_orHook, when SWI_or functionality
is required for a DSP/BIOS object hook function.
Constraints and
Calling Context
❏
If this macro (API) is invoked outside the context of an HWI, interrupts
must be enabled.
❏
When called within an HWI, the code sequence calling SWI_or must
be either wrapped within an HWI_enter/HWI_exit pair or invoked by
the HWI dispatcher.
See Also
SWI_or
OR mask with the value contained in SWI’s mailbox field