
CHAPTER 3 RX78K/IV BASIC OPERATIONS AND CONTROL BLOCKS
26
3.2.2
Control blocks
(1) Task control block (TCB)
This control block is used by RX78K/IV to manage tasks. One control block of this type is assigned to each task.
One TCB is 10 bytes long with the large model, and 8 bytes long with the small model.
(2) Event flag (EVT)
An event flag is a block that manages events that are used to synchronize tasks or make tasks wait.
One event flag is 4 bytes long with the large model, and 2 bytes long with the small model.
*
If two or more tasks are waiting when the event flag is set, all the WAIT tasks enter the READY state.
However, if a task exists that has issued “cwai
_
flg” and has entered the WAIT state, the flag is cleared after
that task has been released from the WAIT state. After that, task state transitions do not take place.
(3) Semaphore (SEM)
A semaphore is a resource management block that is used to synchronize or mutually exclude tasks.
One semaphore is 4 bytes long with the large model, and 2 bytes long with the small model.
(4) Mail box (MBOX)
A mail box is a control block that manages message communication between tasks.
One mail box is 4 bytes long with the large model, and 2 bytes long with the small model.
(5) Memory pool (MPL)
The memory pool manages free memory blocks. Normally, memory blocks are used as message areas. When
use it as a message area, be sure to set the size of one memory block to a multiple of 2. Even in cases other
than messages, it is possible to secure only the portion of the memory blocks required for the relevant purpose.
The size of the memory pool is the total of the free block management area and the memory blocks.
The size of the free block management area is 4 bytes long with the large model, and 2 bytes long with the small
model.
(6) Cyclic handler control block (HCB)
Cyclic handler control blocks are used by RX78K/IV to manage cyclic handlers. One cyclic handler is given one
control block. The size of each cyclic handler control block is 10 bytes long with the large model, and 8 bytes
long with the small model.