module ti.sdo.fc.utils.osal.noOS.SemProcessNull
C synopsis target-domain sourced in ti/sdo/fc/utils/osal/noOS/SemProcessNull.xdc
#include <ti/sdo/fc/utils/osal/noOS/SemProcessNull.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 SemProcessNull_FOREVER

Used as the timeout value to specify wait forever

C synopsis target-domain
#define SemProcessNull_FOREVER (UInt)~(0)
enum SemProcessNull_Mode

Types of semaphores

C synopsis target-domain
typedef enum SemProcessNull_Mode {
    SemProcessNull_Mode_COUNTING,
    // Counting semaphore
    SemProcessNull_Mode_BINARY
    // Binary Semaphore
} SemProcessNull_Mode;
enum SemProcessNull_PendStatus

Error codes returned by Semaphore_pend

C synopsis target-domain
typedef enum SemProcessNull_PendStatus {
    SemProcessNull_PendStatus_ERROR,
    SemProcessNull_PendStatus_TIMEOUT,
    SemProcessNull_PendStatus_SUCCESS
} SemProcessNull_PendStatus;
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId SemProcessNull_Module_id();
// Get this module's unique id
 
Bool SemProcessNull_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle SemProcessNull_Module_heap();
// The heap from which this module allocates memory
 
Bool SemProcessNull_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 SemProcessNull_Module_getMask();
// Returns the diagnostics mask for this module
 
Void SemProcessNull_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types

C synopsis target-domain
typedef struct SemProcessNull_Object SemProcessNull_Object;
// Opaque internal representation of an instance object
 
typedef SemProcessNull_Object *SemProcessNull_Handle;
// Client reference to an instance object
 
typedef struct SemProcessNull_Struct SemProcessNull_Struct;
// Opaque client structure large enough to hold an instance object
 
SemProcessNull_Handle SemProcessNull_handle(SemProcessNull_Struct *structP);
// Convert this instance structure pointer into an instance handle
 
SemProcessNull_Struct *SemProcessNull_struct(SemProcessNull_Handle handle);
// Convert this instance handle into an instance structure pointer
Instance Config Parameters

C synopsis target-domain
typedef struct SemProcessNull_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // Common per-instance configs
    ISemaphore_Mode mode;
    // Semaphore mode. Default is COUNTING
} SemProcessNull_Params;
 
Void SemProcessNull_Params_init(SemProcessNull_Params *params);
// Initialize this config-params structure with supplier-specified defaults before instance creation
config SemProcessNull_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
SemProcessNull_Handle SemProcessNull_create(Int count, Int key, const SemProcessNull_Params *params, Error_Block *eb);
// Allocate and initialize a new instance object and return its handle
 
Void SemProcessNull_construct(SemProcessNull_Struct *structP, Int count, Int key, const SemProcessNull_Params *params);
// Initialize a new instance object inside the provided structure
ARGUMENTS
count — initial semaphore count
key — globally unique key
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 SemProcess object which is initialized to count. All semaphores created with the same key reference the same underlying synchronization object and work between processes. The underlying synchronization object should be automatically deleted when all references to it have been deleted, and the reference count should be maintained consistently across process forks or similar operations. An implementation for a platform on which this is technically impossible (e.g. an operating system that does not support multiple processes) may provide a 'toy' implementation with behavior matching that of ISemProcessSupport.
Instance Deletion

C synopsis target-domain
Void SemProcessNull_delete(SemProcessNull_Handle *handleP);
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
 
Void SemProcessNull_destruct(SemProcessNull_Struct *structP);
// Finalize the instance object inside the provided structure
SemProcessNull_pend()  // instance

Wait for the semaphore to become available

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

Increment the semaphore count

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

C synopsis target-domain
ISemProcessSupport_Handle SemProcessNull_Handle_upCast(SemProcessNull_Handle handle);
// unconditionally move one level up the inheritance hierarchy
 
SemProcessNull_Handle SemProcessNull_Handle_downCast(ISemProcessSupport_Handle handle);
// conditionally move one level down the inheritance hierarchy; NULL upon failure
 
ISemaphore_Handle SemProcessNull_Handle_upCast2(SemProcessNull_Handle handle);
// unconditionally move 2 levels up the inheritance hierarchy
 
SemProcessNull_Handle SemProcessNull_Handle_downCast2(ISemaphore_Handle handle);
// conditionally move 2 levels down the inheritance hierarchy; NULL upon failure
Instance Built-Ins

C synopsis target-domain
Int SemProcessNull_Object_count();
// The number of statically-created instance objects
 
SemProcessNull_Handle SemProcessNull_Object_get(SemProcessNull_Object *array, Int i);
// The handle of the i-th statically-created instance object (array == NULL)
 
SemProcessNull_Handle SemProcessNull_Object_first();
// The handle of the first dynamically-created instance object, or NULL
 
SemProcessNull_Handle SemProcessNull_Object_next(SemProcessNull_Handle handle);
// The handle of the next dynamically-created instance object, or NULL
 
IHeap_Handle SemProcessNull_Object_heap();
// The heap used to allocate dynamically-created instance objects
 
Types_Label *SemProcessNull_Handle_label(SemProcessNull_Handle handle, Types_Label *buf);
// The label associated with this instance object
 
String SemProcessNull_Handle_name(SemProcessNull_Handle handle);
// The name of this instance object
 
XDCscript usage meta-domain sourced in ti/sdo/fc/utils/osal/noOS/SemProcessNull.xdc
var SemProcessNull = xdc.useModule('ti.sdo.fc.utils.osal.noOS.SemProcessNull');
module-wide constants & types
        const SemProcessNull.PendStatus_ERROR;
        const SemProcessNull.PendStatus_TIMEOUT;
        const SemProcessNull.PendStatus_SUCCESS;
module-wide config parameters
per-instance config parameters
    var params = new SemProcessNull.Params// Instance config-params object;
per-instance creation
    var inst = SemProcessNull.create// Create an instance-object(Int count, Int key, params);
 
const SemProcessNull.FOREVER

Used as the timeout value to specify wait forever

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

Types of semaphores

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

Error codes returned by Semaphore_pend

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

Common module configuration parameters

XDCscript usage meta-domain
SemProcessNull.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 SemProcessNull.Params;
// Instance config-params object
    params.mode = ISemaphore.Mode ISemaphore.Mode_COUNTING;
    // Semaphore mode. Default is COUNTING
config SemProcessNull.mode  // instance

Semaphore mode. Default is COUNTING

XDCscript usage meta-domain
var params = new SemProcessNull.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 SemProcessNull.Params;
// Allocate instance config-params
params.config =   ...
// Assign individual configs
 
var inst = SemProcessNull.create(Int count, Int key, params);
// Create an instance-object
ARGUMENTS
count — initial semaphore count
key — globally unique key
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 SemProcess object which is initialized to count. All semaphores created with the same key reference the same underlying synchronization object and work between processes. The underlying synchronization object should be automatically deleted when all references to it have been deleted, and the reference count should be maintained consistently across process forks or similar operations. An implementation for a platform on which this is technically impossible (e.g. an operating system that does not support multiple processes) may provide a 'toy' implementation with behavior matching that of ISemProcessSupport.
generated on Tue, 02 Nov 2010 01:38:02 GMT