SWI_orHook
2-444
C Interface
Syntax
SWI_orHook(swi, mask);
Parameters
Arg
swi;
/* SWI object handle*/
Arg
mask;
/* value to be ORed */
Return Value
Void
Reentrant
no
Description
SWI_orHook is used to post a software interrupt, and should be used
when hook functionality is required for DSP/BIOS hook objects.
SWI_orHook sets the bits specified by a mask in SWI’s mailbox and also
moves the arguments to the correct registers for interfacing with low level
DSP/BIOS assembly code. SWI_orHook 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_orHook 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_orHook 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_orHook
must be either wrapped within an HWI_enter/HWI_exit pair or
invoked by the HWI dispatcher.
See Also
SWI_orHook
OR mask with the value contained in SWI’s mailbox field