
B–61863E–1/06
2. PMC SYSTEM CALLPMC LIBRARY
161
SC/SC3/SC4 NB/NB2 16i/18i/21i 15i–A
f f f f
[Name]
os_mak2_sem
[Description]
Creates the exclusive control semaphore.
[Format]
ret = os_mak2_sem(semaphore_id,owner_priority,multi_signal) ;
unsigned short ret ;
unsigned char semaphore_id ;
unsigned char owner_priority ;
unsigned short multi_signal ;
[Input]
semaphore_id Semaphore ID (10 to 39)
owner_priority (0 or 10 to 99)
multi_signal DISABLE 0, ENABLE 1
[Output]
______
[Returns]
ret Completion code
0 ; The semaphore has been created normally.
0106H ; The semaphore ID is out of range (other than 10 to 39).
010FH ; The semaphore of the specified ID has already been
created.
0980H ; owner_priority is out of range (other than 0 and 10 to 99).
[Remarks]
The exclusive control semaphore has the concept of ownership.
A task having no ownership cannot signal the semaphore.
owner_priority:
If the priority of the task that acquired the semaphore is lower than
this value, it is set to this value.
When the semaphore is returned, the priority is set to the previous
priority.
Value 0 is set if this function is not used.
This function prevents system performance from being reduced when
a task having low priority acquires the semaphore.
multi_signal:
When DISABLE is specified, an error occurs if the task that acquired
the semaphore waits for the same semaphore again.
When ENABLE is specified, no error occurs and waiting is counted.
After signaling is performed by the waiting count, the semaphore is
released.
2.19
CREATING THE
EXCLUSIVE
CONTROL
SEMAPHORE