SWI_andn
Application Program Interface
2-429
The following figure shows an example of how a mailbox with an initial
value of 3 can be cleared by two calls to SWI_andn with values of 2 and
1. The entire mailbox could also be cleared with a single call to SWI_andn
with a value of 3.
Constraints and
Calling Context
❏
If this function is invoked outside the context of an HWI, interrupts
must be enabled.
❏
When called within an HWI, the code sequence calling SWI_andn
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_andn(©SWI, mask);
}
See Also
SWI_andnHook
SWI_dec
SWI_getmbox
SWI_inc
SWI_or
SWI_orHook
SWI_post
SWI_self
Mailbox value = 3
SWI object
Mailbox value = 1
Mailbox value = 0
SWI_andn with
mask=1
Software
interrupt is
posted
SWI object
SWI object
SWI_andn with
mask=2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1