SWI_andnHook
2-430
C Interface
Syntax
SWI_andnHook(swi, mask);
Parameters
Arg
swi;
/* SWI object handle*/
Arg
mask
/* value to be ANDed */
Return Value
Void
Reentrant
yes
Description
SWI_andnHook is a specialized version of SWI_andn for use as hook
function for configured DSP/BIOS objects. SWI_andnHook clears the bits
specified by a mask from SWI’s internal mailbox and also moves the
arguments to the correct registers for proper interface with low level
DSP/BIOS assembly code. If SWI’s mailbox becomes 0, SWI_andnHook
posts the SWI. The bitwise logical operation performed is:
mailbox = mailbox AND (NOT MASK)
For example, if there are multiple conditions that must all be met before
a SWI can run, you should use a different bit in the mailbox for each
condition. When a condition is met, clear the bit for that condition.
SWI_andnHook results in a context switch if the SWI's mailbox becomes
zero and the SWI has higher priority than the currently executing thread.
You specify a SWI’s initial mailbox value in the configuration. The mailbox
value is automatically reset when the SWI executes.
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_andnHook must be either wrapped within an
HWI_enter/HWI_exit pair or invoked by the HWI dispatcher.
Example
/* ======== ioReady ======== */
Void ioReady(unsigned int mask)
{
/* clear bits of "ready mask" */
SWI_andnHook(©SWI, mask);
}
See Also
SWI_andnHook
Clear bits from SWI’s mailbox and post if mailbox becomes 0