- 45 -
4.1.6
Synchronization and Communication Function (Eventflag)
The eventflag is an internal facility of MR100 that is used to synchronize the execution of multiple tasks. The eventflag
uses a flag wait pattern and a 32-bit pattern to control task execution. A task is kept waiting until the flag wait conditions
set are met.
It is possible to determine whether multiple waiting tasks can be enqueued in one eventflag waiting queue by specifying the
eventflag attribute TA_WSGL or TA_WMUL.
Furthermore, it is possible to clear the eventflag bit pattern to 0 when the eventflag meets wait conditions by specifying
TA_CLR for the eventflag attribute.
There are following eventflag service calls that are provided by the MR100 kernel.
•
Set Eventflag (set_flg, iset_flg)
Sets the eventflag so that a task waiting the eventflag is released from the WAITING state.
•
Clear Eventflag (clr_flg, iclr_flg)
Clears the Eventflag.
•
Wait for Eventflag (wai_flg, twai_flg)
Waits until the eventflag is set to a certain pattern. There are two modes as listed below in which the eventflag is
waited for.
♦
AND
wait
Waits until all specified bits are set.
♦
OR
wait
Waits until any one of the specified bits is set
•
Wait for Eventflag (polling)(pol_flg, ipol_flg)
Examines whether the eventflag is in a certain pattern. In this service call, tasks are not placed in WAITING state.
•
Reference Eventflag Status (ref_flg, iref_flg)
Checks the existence of the bit pattern and wait task for the target eventflag.