-
ref_sem
iref_sem
-
Reference semaphore state.
ER ref_sem (ID semid, T_RSEM *pk_rsem);
ER iref_sem (ID semid, T_RSEM *pk_rsem);
|
|
|
|
ID semid;
|
ID number of the semaphore.
|
|
T_RSEM *pk_rsem;
|
Pointer to the packet returning the semaphore state.
|
[Semaphore state packet: T_RSEM]
typedef struct t_rsem {
ID wtskid; /*Existence of waiting task*/
UINT semcnt; /*Current resource count*/
} T_RSEM;
|
Stores semaphore state packet (ID number of the task at the head of the wait queue, current resource count, etc.) of the semaphore specified by parameter
semid in the area specified by parameter
pk_rsem.
-
wtskid
Stores whether a task is queued to the semaphore wait queue.
Value: ID number of the task at the head of the wait queue
-
semcnt
Stores the current resource count.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- This service call was issued in the CPU locked state.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
Note When the iref_sem is issued from task or the ref_sem is issued from non-task, the context error is not detected and normal operation of the system is not guaranteed.
|
|
|
Memory access violation. (only for ref_sem)
- The operand-write access to the area indicated by pk_rsem has not been permitted to the invoking task.
|
|
|
- The semaphore specified by semid does not exist.
|