
B–61863E–1/06
2. PMC SYSTEM CALLPMC LIBRARY
157
SC/SC3/SC4 NB/NB2 16i/18i/21i 15i–A
f f f f
[Name]
os_make_sem
[Description]
Creates the counter type semaphore.
[Format]
ret = os_make_sem(semaphore_id,initial_value) ;
unsigned short ret ;
unsigned char semaphore_id ;
char initial_value ;
[Input]
semaphore_id Semaphore ID (10 to 39)
initial_value (–128 to 127)
[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.
[Remarks]
The counter type semaphore has no ownership concept.
Up to initial_value tasks can acquire the same semaphore. (A single
task may acquire the same task several times.)
The semaphore value can be considered to be the number of resources
protected by the semaphore.
2.15
CREATING THE
COUNTER TYPE
SEMAPHORE