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.

An out of range priority value (CX) will be limited to range 3..127 inside this function.<br />

Note:<br />

Related Topics<br />

Top of list<br />

Index page<br />

Internally all tasks have a unique priority. When a task is createdor its priority is changed, that<br />

task is given a lower internal task priority than any other task in the system with the same user<br />

task priority.<br />

<strong>RTOS</strong> Task Control Services<br />

Interrupt 0xAD service 0x14: RTX_CREATE_SEM, Create a semaphore<br />

Parameters<br />

AH<br />

BX:SI<br />

CX<br />

ES:DI<br />

Create a resource or counting semaphore.<br />

0x14 (= RTX_CREATE_SEM)<br />

Pointer to 16 bit storage allocated by caller where this API will output a semaphoreID<br />

Initial value:<br />

Set to -1 for resource semaphore<br />

Set in range [0 .. 32767] (inclusive) for counting semaphore<br />

Pointer to 4 character unique name tag for the new semaphore, which need not be null terminated but<br />

must contain four bytes.<br />

Return Value<br />

Comments<br />

DX =0 success AX: 0, Location referenced by [BX:SI] contains the unique semaphoreID<br />

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

A resource semaphore is created by setting CX = -1. A non-negative value in CX creates a counting<br />

semaphore.<br />

A resource semaphore is created in the free state, ready for use.<br />

A counting semaphore is initially available the number of times specified in CX. The<br />

RTX_SIGNAL_SEM API increments this count and semaphore access via RTX_GET_SEM or<br />

RTX_WAIT_SEM decrements the count. A counting semaphore is not available when its count reaches<br />

zero.<br />

Related Topics<br />

Page 191 / 400

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

Saved successfully!

Ooh no, something went wrong!