-
cre_sem
acre_sem
-
ER cre_sem (ID semid, T_CSEM *pk_csem );
ER_ID acre_sem ( T_CSEM *pk_csem );
|
|
|
|
ID semid;
|
ID number of the semaphore.
|
|
T_CSEM *pk_csem;
|
Pointer to the packet containing the semaphore creation information.
|
[Semaphore creation information packet : T_CSEM]
typedef struct t_csem {
ATR sematr; /*Semaphore attribute*/
UINT isemcnt; /*Initial semaphore count*/
UINT maxsem; /*Maximum semaphore count*/
} T_CSEM;
|
This service call can be called from tasks that belong to
Trusted Domain.
The cre_sem creates a semaphore with semaphore ID indicated by
semid according to the content of
pk_csem. The acre_sem creates a semaphore according to the content of
pk_csem, and returns the created semaphore ID.
1 ) Semaphore attribute (
sematr)
The following are specified for
sematr.
sematr := ( TA_TFIFO | TA_TPRI )
-
TA_TFIFO ( = 0x0000)
Task wait queue is managed in FIFO order.
-
TA_TPRI ( = 0x0001)
Task wait queue is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order.
2 ) Initial semaphore count (
isemcnt)
Specify initial semaphore count within the range from 0 to
maxsem.
3 ) Maximum semaphore count (
maxsem)
Specify maximum semaphore count within the range from 1 to
TMAX_MAXSEM ( = 65535).
|
|
|
|
|
Normal completion of acre_sem. (Created semaphore ID)
|
|
|
Normal completion of cre_sem.
|
|
|
- Either of bits in sematr except bit0 is 1.
|
|
|
|
|
|
Invalid ID number. (only for cre_sem)
|
|
|
- This service call was issued in the CPU locked state.
- This service call was issued from non-task.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
|
|
|
- Stack pointer points out of user stack for invoking task.
- The operand-read access to the area indicated by pk_csem has not been permitted to the invoking task.
|
|
|
- The invoking task does not belong to trusted domain.
|
|
|
No ID number available.(only for acre_sem)
|
|
|
Object state error. (only for cre_sem)
- The semaphore specified by semid exists.
|