01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Top of list<br />

Index page<br />

<strong>RTOS</strong> Semaphore Services<br />

Interrupt 0xAD service 0x18: RTX_RELEASE_SEM, Release a resource semaphore<br />

Parameters<br />

AH<br />

BX<br />

Down count (unwind) a resource semaphore's "use count".<br />

0x18 (= RTX_RELEASE_SEM)<br />

ID of the resource semaphore acquired from RTX_CREATE_SEM<br />

Return Value<br />

Comments<br />

DX =0 success AX: 0<br />

DX!=0 failure AX: contains error code<br />

The resource's use count is decremented by one if the calling task presently owns this resource<br />

semaphore (otherwise error code -12, "not owner"). The resource is not freed until the use count<br />

reaches zero, at which point the caller no longer "owns" this semaphore.<br />

Once freed, the resource will immediately be given to the task (if any) which is waiting at the head of this<br />

resource semaphore's wait queue. An immediate task switch occurs if this waiting task is higher priority<br />

than the calling task that just gave up ownership of this semaphore.<br />

Note: Attempting to use this function on a counting semaphore will fail with error code -12.<br />

Related Topics<br />

Top of list<br />

Index page<br />

RTX_FREE_RES Free resource semaphore<br />

RTX_RESERVE_RES Reserve resource semaphore<br />

<strong>RTOS</strong> Semaphore Services<br />

Interrupt 0xAD service 0x19: RTX_RESERVE_RES, Get use of a resource semaphore<br />

Parameters<br />

AH<br />

Reserves a resource semaphore.<br />

Page 194 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!