Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

OsalSemaphore.h File Reference


Detailed Description

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.

02.00.00.68_beta1

============================================================================

Copyright (c) 2008-2009, Texas Instruments Incorporated

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Contact information for paper mail: Texas Instruments Post Office Box 655303 Dallas, Texas 75265 Contact information: http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm? DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact ============================================================================

Definition in file OsalSemaphore.h.

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 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 Documentation

#define OSALSEMAPHORE_E_FAIL   OSALSEMAPHORE_MAKE_FAILURE(3)
 

Generic failure.

Definition at line 111 of file OsalSemaphore.h.

#define OSALSEMAPHORE_E_HANDLE   OSALSEMAPHORE_MAKE_FAILURE(5)
 

Invalid handle provided.

Definition at line 123 of file OsalSemaphore.h.

#define OSALSEMAPHORE_E_INVALIDARG   OSALSEMAPHORE_MAKE_FAILURE(2)
 

Invalid argument provided.

Definition at line 105 of file OsalSemaphore.h.

#define OSALSEMAPHORE_E_MEMORY   OSALSEMAPHORE_MAKE_FAILURE(1)
 

Indicates OsalSemaphore alloc/free failure.

Definition at line 99 of file OsalSemaphore.h.

#define OSALSEMAPHORE_E_TIMEOUT   OSALSEMAPHORE_MAKE_FAILURE(4)
 

A timeout occurred.

Definition at line 117 of file OsalSemaphore.h.

#define OSALSEMAPHORE_E_WAITNONE   OSALSEMAPHORE_MAKE_FAILURE(6)
 

WAIT_NONE timeout value was provided, but semaphore was not available.

Definition at line 130 of file OsalSemaphore.h.

#define OSALSEMAPHORE_INTTYPE_VALUE type   )     (type & 0xFFFF0000)
 

Returns the value of semaphore interruptability type.

Definition at line 165 of file OsalSemaphore.h.

#define OSALSEMAPHORE_MAKE_FAILURE  ) 
 

Value:

((Int) (0x80000000  \
                                        + (OSALSEMAPHORE_STATUSCODEBASE +(x))))
Convert to failure code.

Definition at line 87 of file OsalSemaphore.h.

#define OSALSEMAPHORE_MAKE_SUCCESS  )     (OSALSEMAPHORE_STATUSCODEBASE + (x))
 

Convert to success code.

Definition at line 93 of file OsalSemaphore.h.

#define OSALSEMAPHORE_MODULEID   (UInt16) 0xF6D6
 

Module ID for OsalSemaphore OSAL module.

Definition at line 71 of file OsalSemaphore.h.

#define OSALSEMAPHORE_STATUSCODEBASE   (OSALSEMAPHORE_MODULEID << 12u)
 

Stauts code base for MEMORY module.

Definition at line 81 of file OsalSemaphore.h.

#define OSALSEMAPHORE_SUCCESS   OSALSEMAPHORE_MAKE_SUCCESS(0)
 

Operation successfully completed.

Definition at line 136 of file OsalSemaphore.h.

#define OSALSEMAPHORE_TYPE_VALUE type   )     (type & 0x0000FFFF)
 

Returns the value of semaphore type (binary/counting).

Definition at line 159 of file OsalSemaphore.h.

#define OSALSEMAPHORE_WAIT_FOREVER   (~((UInt32) 0u))
 

Indicates forever wait for APIs that can wait.

Definition at line 147 of file OsalSemaphore.h.

#define OSALSEMAPHORE_WAIT_NONE   ((UInt32) 0u)
 

Indicates zero wait for APIs that can wait.

Definition at line 153 of file OsalSemaphore.h.


Typedef Documentation

typedef struct OsalSemaphore_Object* OsalSemaphore_Handle
 

Declaration for the OsalSemaphore object handle. Definition of OsalSemaphore_Object is not exposed.

Definition at line 171 of file OsalSemaphore.h.


Enumeration Type Documentation

enum OsalSemaphore_IntType
 

Enumerates the interruptible/non-interruptible types.

Enumerator:
OsalSemaphore_IntType_Interruptible  Waits on this mutex are interruptible
OsalSemaphore_IntType_Noninterruptible  Waits on this mutex are non-interruptible
OsalSemaphore_IntType_EndValue  End delimiter indicating start of invalid values for this enum

Definition at line 188 of file OsalSemaphore.h.

00188              {
00189     OsalSemaphore_IntType_Interruptible    = 0x00000000,
00190     /*!< Waits on this mutex are interruptible */
00191     OsalSemaphore_IntType_Noninterruptible = 0x00010000,
00192     /*!< Waits on this mutex are non-interruptible */
00193     OsalSemaphore_IntType_EndValue         = 0x00020000
00194     /*!< End delimiter indicating start of invalid values for this enum */
00195 } OsalSemaphore_IntType;

enum OsalSemaphore_Type
 

Enumerates the types of semaphores.

Enumerator:
OsalSemaphore_Type_Binary  Binary semaphore
OsalSemaphore_Type_Counting  Counting semaphore
OsalSemaphore_Type_EndValue  End delimiter indicating start of invalid values for this enum

Definition at line 176 of file OsalSemaphore.h.

00176              {
00177     OsalSemaphore_Type_Binary          = 0x00000000,
00178     /*!< Binary semaphore */
00179     OsalSemaphore_Type_Counting        = 0x00000001,
00180     /*!< Counting semaphore */
00181     OsalSemaphore_Type_EndValue        = 0x00000002
00182     /*!< End delimiter indicating start of invalid values for this enum */
00183 } OsalSemaphore_Type;


Function Documentation

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  ) 
 


Generated on Mon Mar 14 11:59:47 2011 for Syslink by  doxygen 1.4.4