module ti.sdo.fc.utils.osal.noOS.SemThreadNull
C synopsis target-domain sourced in ti/sdo/fc/utils/osal/noOS/SemThreadNull.xdc
#include <ti/sdo/fc/utils/osal/noOS/SemThreadNull.h>
Functions
Void
Void
Void
Void
Functions common to all ISemaphore modules
Int 
Bool 
Functions common to all target instances
Functions common to all target modules
Defines
#define
Typedefs
typedef enum
typedef struct
typedef struct
typedef enum
typedef struct
 
 
const SemThreadNull_FOREVER

Used as the timeout value to specify wait forever

C synopsis target-domain
#define SemThreadNull_FOREVER (UInt)~(0)
 
 
enum SemThreadNull_Mode

Types of semaphores

C synopsis target-domain
typedef enum SemThreadNull_Mode {
    SemThreadNull_Mode_COUNTING,
    // Counting semaphore
    SemThreadNull_Mode_BINARY
    // Binary Semaphore
} SemThreadNull_Mode;
 
 
enum SemThreadNull_PendStatus

Error codes returned by Semaphore_pend

C synopsis target-domain
typedef enum SemThreadNull_PendStatus {
    SemThreadNull_PendStatus_ERROR,
    SemThreadNull_PendStatus_TIMEOUT,
    SemThreadNull_PendStatus_SUCCESS
} SemThreadNull_PendStatus;
 
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId SemThreadNull_Module_id();
// Get this module's unique id
 
Bool SemThreadNull_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle SemThreadNull_Module_heap();
// The heap from which this module allocates memory
 
Bool SemThreadNull_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 SemThreadNull_Module_getMask();
// Returns the diagnostics mask for this module
 
Void SemThreadNull_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types

C synopsis target-domain
typedef struct SemThreadNull_Object SemThreadNull_Object;
// Opaque internal representation of an instance object
 
typedef SemThreadNull_Object *SemThreadNull_Handle;
// Client reference to an instance object
 
typedef struct SemThreadNull_Struct SemThreadNull_Struct;
// Opaque client structure large enough to hold an instance object
 
SemThreadNull_Handle SemThreadNull_handle(SemThreadNull_Struct *structP);
// Convert this instance structure pointer into an instance handle
 
SemThreadNull_Struct *SemThreadNull_struct(SemThreadNull_Handle handle);
// Convert this instance handle into an instance structure pointer
Instance Config Parameters

C synopsis target-domain
typedef struct SemThreadNull_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // Common per-instance configs
    ISemaphore_Mode mode;
    // Semaphore mode. Default is COUNTING
} SemThreadNull_Params;
 
Void SemThreadNull_Params_init(SemThreadNull_Params *params);
// Initialize this config-params structure with supplier-specified defaults before instance creation
 
config SemThreadNull_mode  // instance

Semaphore mode. Default is COUNTING

C synopsis target-domain
      ...
    ISemaphore_Mode mode;
 
DETAILS
When mode is BINARY , the semaphore has only two states, available and unavailable. When mode is COUNTING, the semaphore keeps track of number of times a semaphore is posted.
Instance Creation

C synopsis target-domain
SemThreadNull_Handle SemThreadNull_create(Int count, const SemThreadNull_Params *params, Error_Block *eb);
// Allocate and initialize a new instance object and return its handle
 
Void SemThreadNull_construct(SemThreadNull_Struct *structP, Int count, const SemThreadNull_Params *params);
// Initialize a new instance object inside the provided structure
ARGUMENTS
count — initial semaphore count
params — per-instance config params, or NULL to select default values (target-domain only)
eb — active error-handling block, or NULL to select default policy (target-domain only)
DETAILS
This function creates a new Semaphore object which is initialized to count.
Instance Deletion

C synopsis target-domain
Void SemThreadNull_delete(SemThreadNull_Handle *handleP);
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
 
Void SemThreadNull_destruct(SemThreadNull_Struct *structP);
// Finalize the instance object inside the provided structure
 
SemThreadNull_pend()  // instance

Wait for the semaphore to become available

C synopsis target-domain
Int SemThreadNull_pend(SemThreadNull_Handle handle, UInt timeout, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created SemThreadNull instance object
timeout — timeout in microseconds
eb — error block
DETAILS
RETURNS
refer to description above
 
SemThreadNull_post()  // instance

Increment the semaphore count

C synopsis target-domain
Bool SemThreadNull_post(SemThreadNull_Handle handle, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created SemThreadNull instance object
eb — error block
RETURNS
true for success, false for error in error block
Instance Convertors

C synopsis target-domain
ISemThreadSupport_Handle SemThreadNull_Handle_upCast(SemThreadNull_Handle handle);
// unconditionally move one level up the inheritance hierarchy
 
SemThreadNull_Handle SemThreadNull_Handle_downCast(ISemThreadSupport_Handle handle);
// conditionally move one level down the inheritance hierarchy; NULL upon failure
 
ISemaphore_Handle SemThreadNull_Handle_upCast2(SemThreadNull_Handle handle);
// unconditionally move 2 levels up the inheritance hierarchy
 
SemThreadNull_Handle SemThreadNull_Handle_downCast2(ISemaphore_Handle handle);
// conditionally move 2 levels down the inheritance hierarchy; NULL upon failure
Instance Built-Ins

C synopsis target-domain
Int SemThreadNull_Object_count();
// The number of statically-created instance objects
 
SemThreadNull_Handle SemThreadNull_Object_get(SemThreadNull_Object *array, Int i);
// The handle of the i-th statically-created instance object (array == NULL)
 
SemThreadNull_Handle SemThreadNull_Object_first();
// The handle of the first dynamically-created instance object, or NULL
 
SemThreadNull_Handle SemThreadNull_Object_next(SemThreadNull_Handle handle);
// The handle of the next dynamically-created instance object, or NULL
 
IHeap_Handle SemThreadNull_Object_heap();
// The heap used to allocate dynamically-created instance objects
 
Types_Label *SemThreadNull_Handle_label(SemThreadNull_Handle handle, Types_Label *buf);
// The label associated with this instance object
 
String SemThreadNull_Handle_name(SemThreadNull_Handle handle);
// The name of this instance object
 
XDCscript usage meta-domain sourced in ti/sdo/fc/utils/osal/noOS/SemThreadNull.xdc
var SemThreadNull = xdc.useModule('ti.sdo.fc.utils.osal.noOS.SemThreadNull');
module-wide constants & types
 
 
        const SemThreadNull.PendStatus_ERROR;
        const SemThreadNull.PendStatus_TIMEOUT;
        const SemThreadNull.PendStatus_SUCCESS;
module-wide config parameters
per-instance config parameters
    var params = new SemThreadNull.Params// Instance config-params object;
per-instance creation
    var inst = SemThreadNull.create// Create an instance-object(Int count, params);
 
 
const SemThreadNull.FOREVER

Used as the timeout value to specify wait forever

XDCscript usage meta-domain
const SemThreadNull.FOREVER = ~(0);
 
C SYNOPSIS
 
enum SemThreadNull.Mode

Types of semaphores

XDCscript usage meta-domain
values of type SemThreadNull.Mode
    const SemThreadNull.Mode_COUNTING;
    // Counting semaphore
    const SemThreadNull.Mode_BINARY;
    // Binary Semaphore
 
C SYNOPSIS
 
enum SemThreadNull.PendStatus

Error codes returned by Semaphore_pend

XDCscript usage meta-domain
values of type SemThreadNull.PendStatus
    const SemThreadNull.PendStatus_ERROR;
    const SemThreadNull.PendStatus_TIMEOUT;
    const SemThreadNull.PendStatus_SUCCESS;
 
C SYNOPSIS
 
metaonly config SemThreadNull.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
SemThreadNull.common$ = Types.Common$ undefined;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
Instance Config Parameters

XDCscript usage meta-domain
var params = new SemThreadNull.Params;
// Instance config-params object
    params.mode = ISemaphore.Mode ISemaphore.Mode_COUNTING;
    // Semaphore mode. Default is COUNTING
 
config SemThreadNull.mode  // instance

Semaphore mode. Default is COUNTING

XDCscript usage meta-domain
var params = new SemThreadNull.Params;
  ...
 
DETAILS
When mode is BINARY , the semaphore has only two states, available and unavailable. When mode is COUNTING, the semaphore keeps track of number of times a semaphore is posted.
C SYNOPSIS
Instance Creation

XDCscript usage meta-domain
var params = new SemThreadNull.Params;
// Allocate instance config-params
params.config =   ...
// Assign individual configs
 
var inst = SemThreadNull.create(Int count, params);
// Create an instance-object
ARGUMENTS
count — initial semaphore count
params — per-instance config params, or NULL to select default values (target-domain only)
eb — active error-handling block, or NULL to select default policy (target-domain only)
DETAILS
This function creates a new Semaphore object which is initialized to count.
generated on Tue, 17 Jan 2012 07:27:49 GMT