SWI_getmbox
Application Program Interface
2-439
C Interface
Syntax
num = Uns SWI_getmbox();
Parameters
Void
Return Value
Uns
num
/* mailbox value */
Reentrant
yes
Description
SWI_getmbox returns the value that SWI’s mailbox had when the SWI
started running. DSP/BIOS saves the mailbox value internally so that
SWI_getmbox can access it at any point within a SWI object’s function.
DSP/BIOS then automatically resets the mailbox to its initial value
(defined with Tconf) so that other threads can continue to use the SWI’s
mailbox.
SWI_getmbox should only be called within a function run by a SWI object.
When called from with the context of a SWI, the value returned by
SWI_getmbox is zero if the SWI was posted by a call to SWI_andn,
SWI_andnHook, or SWI_dec. Therefore, SWI_getmbox provides
relevant information only if the SWI was posted by a call to SWI_inc,
SWI_or, SWI_orHook, or SWI_post.
Constraints and
Calling Context
❏
SWI_getmbox cannot be called from the context of an HWI or TSK.
❏
SWI_getmbox cannot be called from a program’s main() function.
Example
This call could be used within a SWI object’s function to use the mailbox
value within the function. For example, if you use SWI_or or SWI_inc to
post a SWI, different mailbox values can require different processing.
swicount = SWI_getmbox();
See Also
SWI_andn
SWI_andnHook
SWI_dec
SWI_inc
SWI_or
SWI_orHook
SWI_post
SWI_self
SWI_getmbox
Return a SWI’s mailbox value