Kernel utils Semaphore interface definitions.
This abstracts the Semaphore interface in Kernel code and is implemented using the wait queues. It has interfaces for creating, destroying, waiting and triggering the Semaphores.
Go to the source code of this file.
Defines | |
#define | OSALSEMAPHORE_MODULEID (UInt16) 0xF6D6 |
Module ID for OsalSemaphore OSAL module. | |
#define | OSALSEMAPHORE_STATUSCODEBASE (OSALSEMAPHORE_MODULEID << 12u) |
Stauts code base for MEMORY module. | |
#define | OSALSEMAPHORE_MAKE_FAILURE(x) |
Convert to failure code. | |
#define | OSALSEMAPHORE_MAKE_SUCCESS(x) (OSALSEMAPHORE_STATUSCODEBASE + (x)) |
Convert to success code. | |
#define | OSALSEMAPHORE_E_MEMORY OSALSEMAPHORE_MAKE_FAILURE(1) |
Indicates OsalSemaphore alloc/free failure. | |
#define | OSALSEMAPHORE_E_INVALIDARG OSALSEMAPHORE_MAKE_FAILURE(2) |
Invalid argument provided. | |
#define | OSALSEMAPHORE_E_FAIL OSALSEMAPHORE_MAKE_FAILURE(3) |
Generic failure. | |
#define | OSALSEMAPHORE_E_TIMEOUT OSALSEMAPHORE_MAKE_FAILURE(4) |
A timeout occurred. | |
#define | OSALSEMAPHORE_E_HANDLE OSALSEMAPHORE_MAKE_FAILURE(5) |
Invalid handle provided. | |
#define | OSALSEMAPHORE_E_WAITNONE OSALSEMAPHORE_MAKE_FAILURE(6) |
WAIT_NONE timeout value was provided, but semaphore was not available. | |
#define | OSALSEMAPHORE_SUCCESS OSALSEMAPHORE_MAKE_SUCCESS(0) |
Operation successfully completed. | |
#define | OSALSEMAPHORE_WAIT_FOREVER (~((UInt32) 0u)) |
Indicates forever wait for APIs that can wait. | |
#define | OSALSEMAPHORE_WAIT_NONE ((UInt32) 0u) |
Indicates zero wait for APIs that can wait. | |
#define | OSALSEMAPHORE_TYPE_VALUE(type) (type & 0x0000FFFF) |
Returns the value of semaphore type (binary/counting) | |
#define | OSALSEMAPHORE_INTTYPE_VALUE(type) (type & 0xFFFF0000) |
Returns the value of semaphore interruptability type. | |
Typedefs | |
typedef struct OsalSemaphore_Object * | OsalSemaphore_Handle |
Declaration for the OsalSemaphore object handle. Definition of OsalSemaphore_Object is not exposed. | |
Enumerations | |
enum | OsalSemaphore_Type { OsalSemaphore_Type_Binary = 0x00000000, OsalSemaphore_Type_Counting = 0x00000001, OsalSemaphore_Type_EndValue = 0x00000002 } |
Enumerates the types of semaphores. More... | |
enum | OsalSemaphore_IntType { OsalSemaphore_IntType_Interruptible = 0x00000000, OsalSemaphore_IntType_Noninterruptible = 0x00010000, OsalSemaphore_IntType_EndValue = 0x00020000 } |
Enumerates the interruptible/non-interruptible types. More... | |
Functions | |
OsalSemaphore_Handle | OsalSemaphore_create (UInt32 semType) |
Int | OsalSemaphore_delete (OsalSemaphore_Handle *semHandle) |
Int | OsalSemaphore_pend (OsalSemaphore_Handle semHandle, UInt32 timeout) |
Int | OsalSemaphore_post (OsalSemaphore_Handle semHandle) |
#define OSALSEMAPHORE_MODULEID (UInt16) 0xF6D6 |
Module ID for OsalSemaphore OSAL module.
#define OSALSEMAPHORE_STATUSCODEBASE (OSALSEMAPHORE_MODULEID << 12u) |
Stauts code base for MEMORY module.
#define OSALSEMAPHORE_MAKE_FAILURE | ( | x ) |
((Int) (0x80000000 \ + (OSALSEMAPHORE_STATUSCODEBASE +(x))))
Convert to failure code.
#define OSALSEMAPHORE_MAKE_SUCCESS | ( | x ) | (OSALSEMAPHORE_STATUSCODEBASE + (x)) |
Convert to success code.
#define OSALSEMAPHORE_E_MEMORY OSALSEMAPHORE_MAKE_FAILURE(1) |
Indicates OsalSemaphore alloc/free failure.
#define OSALSEMAPHORE_E_INVALIDARG OSALSEMAPHORE_MAKE_FAILURE(2) |
Invalid argument provided.
#define OSALSEMAPHORE_E_FAIL OSALSEMAPHORE_MAKE_FAILURE(3) |
Generic failure.
#define OSALSEMAPHORE_E_TIMEOUT OSALSEMAPHORE_MAKE_FAILURE(4) |
A timeout occurred.
#define OSALSEMAPHORE_E_HANDLE OSALSEMAPHORE_MAKE_FAILURE(5) |
Invalid handle provided.
#define OSALSEMAPHORE_E_WAITNONE OSALSEMAPHORE_MAKE_FAILURE(6) |
WAIT_NONE timeout value was provided, but semaphore was not available.
#define OSALSEMAPHORE_SUCCESS OSALSEMAPHORE_MAKE_SUCCESS(0) |
Operation successfully completed.
#define OSALSEMAPHORE_WAIT_FOREVER (~((UInt32) 0u)) |
Indicates forever wait for APIs that can wait.
#define OSALSEMAPHORE_WAIT_NONE ((UInt32) 0u) |
Indicates zero wait for APIs that can wait.
#define OSALSEMAPHORE_TYPE_VALUE | ( | type ) | (type & 0x0000FFFF) |
Returns the value of semaphore type (binary/counting)
#define OSALSEMAPHORE_INTTYPE_VALUE | ( | type ) | (type & 0xFFFF0000) |
Returns the value of semaphore interruptability type.
typedef struct OsalSemaphore_Object* OsalSemaphore_Handle |
Declaration for the OsalSemaphore object handle. Definition of OsalSemaphore_Object is not exposed.
enum OsalSemaphore_Type |
Enumerates the interruptible/non-interruptible types.
OsalSemaphore_Handle OsalSemaphore_create | ( | UInt32 | semType ) |
Int OsalSemaphore_delete | ( | OsalSemaphore_Handle * | semHandle ) |
Int OsalSemaphore_pend | ( | OsalSemaphore_Handle | semHandle, |
UInt32 | timeout | ||
) |
Int OsalSemaphore_post | ( | OsalSemaphore_Handle | semHandle ) |