module ti.sdo.ipc.notifyDrivers.NotifyDriverShm

A shared memory driver for the Notify Module

This is a ti.sdo.ipc.Notify driver that utilizes shared memory and inter-processor hardware interrupts for notification between cores. This driver supports caching and currently expects a cache line size of 128 Bytes. Event priorities are supported and correspond to event numbers used to register the events. [ more ... ]
C synopsis target-domain sourced in ti/sdo/ipc/notifyDrivers/NotifyDriverShm.xdc
#include <ti/sdo/ipc/notifyDrivers/NotifyDriverShm.h>
Functions
Void
SizeT 
Functions common to all INotifyDriver modules
Void 
Void 
Void 
Void 
Void 
Int 
NotifyDriverShm_sendEvent// Send a signal to an event(NotifyDriverShm_Handle handle, UInt32 eventId, UInt32 payload, Bool waitClear);
Void 
Functions common to all target instances
Functions common to all target modules
Typedefs
typedef struct
typedef struct
typedef struct
 
DETAILS
This is a ti.sdo.ipc.Notify driver that utilizes shared memory and inter-processor hardware interrupts for notification between cores. This driver supports caching and currently expects a cache line size of 128 Bytes. Event priorities are supported and correspond to event numbers used to register the events.
This driver is designed to work with a variety of devices, each with distinct interrupt mechanisms. Therefore, this module needs to be plugged with an appropriate module that implements the IInterrupt interface for a given device.
The driver utilizes shared memory in the manner indicated by the following diagram.
  NOTE: Processors '0' and '1' correspond to the processors with lower and
        higher MultiProc ids, respectively

 sharedAddr -> --------------------------- bytes
               |  recvInitStatus (0)     | 4  -\
               |  sendInitStatus (0)     | 4   |= sizeof(ProcCtrl)
               |  eventRegMask (0)       | 4   |
               |  eventEnableMask (0)    | 4  -/
               |  [PADDING] (if needed)  |
               |-------------------------|
               |  recvInitStatus (1)     | 4
               |  sendInitStatus (1)     | 4
               |  eventRegMask (1)       | 4
               |  eventEnableMask (1)    | 4
               |  [PADDING] (if needed)  |
               |-------------------------|
               |  eventEntry_0 (0)       | 12 -> sizeof(EventEntry)
               |  [PADDING] (if needed)  |
               |-------------------------|
               |  eventEntry_1 (0)       | 12
               |  [PADDING] (if needed)  |
               |-------------------------|
                       ... ...
               |-------------------------|
               |  eventEntry_N (0)       | 12
               |  [PADDING] (if needed)  |
               |-------------------------|
               |  eventEntry_0 (1)       | 12
               |  [PADDING] (if needed)  |
               |-------------------------|
               |  eventEntry_1 (1)       | 12
               |  [PADDING] (if needed)  |
               |-------------------------|
                       ... ...
               |-------------------------|
               |  eventEntry_N (1)       | 12
               |  [PADDING] (if needed)  |
               |-------------------------|


  Legend:
  (0), (1) : Memory that belongs to the proc with lower and higher
             MultiProc.id, respectively
   |----|  : Cache line boundary
   N       : Notify_numEvents - 1

 
NotifyDriverShm_sharedMemReq()  // module-wide

Amount of shared memory required for creation of each instance

C synopsis target-domain
SizeT NotifyDriverShm_sharedMemReq(NotifyDriverShm_Params *params);
 
ARGUMENTS
params — Pointer to parameters that will be used in the create
RETURNS
Number of MAUs in shared memory needed to create the instance.
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId NotifyDriverShm_Module_id();
// Get this module's unique id
 
Bool NotifyDriverShm_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle NotifyDriverShm_Module_heap();
// The heap from which this module allocates memory
 
Bool NotifyDriverShm_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 NotifyDriverShm_Module_getMask();
// Returns the diagnostics mask for this module
 
Void NotifyDriverShm_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types

C synopsis target-domain
typedef struct NotifyDriverShm_Object NotifyDriverShm_Object;
// Opaque internal representation of an instance object
 
typedef NotifyDriverShm_Object *NotifyDriverShm_Handle;
// Client reference to an instance object
 
typedef struct NotifyDriverShm_Struct NotifyDriverShm_Struct;
// Opaque client structure large enough to hold an instance object
 
NotifyDriverShm_Handle NotifyDriverShm_handle(NotifyDriverShm_Struct *structP);
// Convert this instance structure pointer into an instance handle
 
NotifyDriverShm_Struct *NotifyDriverShm_struct(NotifyDriverShm_Handle handle);
// Convert this instance handle into an instance structure pointer
Instance Config Parameters

C synopsis target-domain
typedef struct NotifyDriverShm_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // Common per-instance configs
    Bool cacheEnabled;
    // Whether cache operations will be performed
    SizeT cacheLineSize;
    // The cache line size of the shared memory
    UInt intVectorId;
    // Interrupt vector ID to be used by the driver
    UInt localIntId;
    // Local interrupt ID for interrupt line
    UInt remoteIntId;
    // Remote interrupt ID for interrupt line
    UInt16 remoteProcId;
    // The MultiProc ID corresponding to the remote processor
    Ptr sharedAddr;
    // Address in shared memory where this instance will be placed
} NotifyDriverShm_Params;
 
Void NotifyDriverShm_Params_init(NotifyDriverShm_Params *params);
// Initialize this config-params structure with supplier-specified defaults before instance creation
 
config NotifyDriverShm_Params.cacheEnabled  // instance

Whether cache operations will be performed

C synopsis target-domain
      ...
    Bool cacheEnabled;
 
DETAILS
If it is known that no cache operations are needed for this instance set this flag to FALSE. If sharedAddr lies within a shared region and the cache enabled setting for the region is FALSE, then the value specified here will be overriden to FALSE.
 
config NotifyDriverShm_Params.cacheLineSize  // instance

The cache line size of the shared memory

C synopsis target-domain
      ...
    SizeT cacheLineSize;
 
DETAILS
This value should be configured
 
config NotifyDriverShm_Params.intVectorId  // instance

Interrupt vector ID to be used by the driver

C synopsis target-domain
      ...
    UInt intVectorId;
 
DETAILS
This parameter is only used by C64x+ targets
 
config NotifyDriverShm_Params.localIntId  // instance

Local interrupt ID for interrupt line

C synopsis target-domain
      ...
    UInt localIntId;
 
DETAILS
For devices that support multiple inter-processor interrupt lines, this configuration parameter allows selecting a specific line to use for receiving an interrupt. The value specified here corresponds to the incoming interrupt line on the local processor.
If this configuration is not set, a default interrupt id is typically chosen.
 
config NotifyDriverShm_Params.remoteIntId  // instance

Remote interrupt ID for interrupt line

C synopsis target-domain
      ...
    UInt remoteIntId;
 
DETAILS
For devices that support multiple inter-processor interrupt lines, this configuration parameter allows selecting a specific line to use for receiving an interrupt. The value specified here corresponds to the incoming interrupt line on the remote processor.
If this configuration is not set, a default interrupt id is typically chosen.
 
config NotifyDriverShm_Params.remoteProcId  // instance

The MultiProc ID corresponding to the remote processor

C synopsis target-domain
      ...
    UInt16 remoteProcId;
 
DETAILS
This parameter must be set for every device. The ti.sdo.utils.MultiProc.getId call can be used to obtain a MultiProc id given the remote processor's name.
 
config NotifyDriverShm_Params.sharedAddr  // instance

Address in shared memory where this instance will be placed

C synopsis target-domain
      ...
    Ptr sharedAddr;
 
DETAILS
Use sharedMemReq to determine the amount of shared memory required.
 
NotifyDriverShm_disable()  // instance

Disable a NotifyDriver instance

C synopsis target-domain
Void NotifyDriverShm_disable(NotifyDriverShm_Handle handle);
 
ARGUMENTS
handle — handle of a previously-created NotifyDriverShm instance object
DETAILS
Disables the ability of a Notify driver to receive events for a given processor. This interface function is called by the Notify_disable function. Refer to its documentation for more details.
 
NotifyDriverShm_disableEvent()  // instance

Disable an event

C synopsis target-domain
Void NotifyDriverShm_disableEvent(NotifyDriverShm_Handle handle, UInt32 eventId);
 
ARGUMENTS
handle — handle of a previously-created NotifyDriverShm instance object
eventId — Number of event to disable
DETAILS
This interface function is called by the Notify_disableEvent function. Refer to its documentation for more details.
The Notify module does validation of the eventId. The Notify module enters calls this function within the Notify module gate.
 
NotifyDriverShm_enable()  // instance

Enable a NotifyDriver instance

C synopsis target-domain
Void NotifyDriverShm_enable(NotifyDriverShm_Handle handle);
 
ARGUMENTS
handle — handle of a previously-created NotifyDriverShm instance object
DETAILS
Enables the ability of a Notify driver to receive events for a given processor. This interface function is called by the Notify_restore function. Refer to its documentation for more details.
 
NotifyDriverShm_enableEvent()  // instance

Enable an event

C synopsis target-domain
Void NotifyDriverShm_enableEvent(NotifyDriverShm_Handle handle, UInt32 eventId);
 
ARGUMENTS
handle — handle of a previously-created NotifyDriverShm instance object
eventId — Number of event to enable
DETAILS
This interface function is called by the Notify_disableEvent function. Refer to its documentation for more details.
The Notify module does validation of the eventId. The Notify module enters calls this function within the Notify module gate.
 
NotifyDriverShm_registerEvent()  // instance

Register a callback to an event

C synopsis target-domain
Void NotifyDriverShm_registerEvent(NotifyDriverShm_Handle handle, UInt32 eventId);
 
ARGUMENTS
handle — handle of a previously-created NotifyDriverShm instance object
eventId — Number of event that is being registered
DETAILS
This driver function is called by the Notify_registerEvent function within the Notify module gate. Refer to its documentation for more details.
 
NotifyDriverShm_sendEvent()  // instance

Send a signal to an event

C synopsis target-domain
Int NotifyDriverShm_sendEvent(NotifyDriverShm_Handle handle, UInt32 eventId, UInt32 payload, Bool waitClear);
 
ARGUMENTS
handle — handle of a previously-created NotifyDriverShm instance object
eventId — Number of event to signal
payload — Payload (optional) to pass to callback function
waitClear — If TRUE, have the NotifyDriver wait for acknowledgement back from the destination processor.
RETURNS
Notify status
DETAILS
This interface function is called by the Notify_sendEvent function. Notify_sendEvent does not provide any context protection for INotifyDriver_sendEvent, so appropriate measures must be taken within the driver itself.
 
NotifyDriverShm_unregisterEvent()  // instance

Remove an event listener from an event

C synopsis target-domain
Void NotifyDriverShm_unregisterEvent(NotifyDriverShm_Handle handle, UInt32 eventId);
 
ARGUMENTS
handle — handle of a previously-created NotifyDriverShm instance object
eventId — Number of event that is being unregistered
DETAILS
This driver function is called by the Notify_unregisterEvent function within the Notify module gate. Refer to it for more details.
Instance Convertors

C synopsis target-domain
INotifyDriver_Handle NotifyDriverShm_Handle_upCast(NotifyDriverShm_Handle handle);
// unconditionally move one level up the inheritance hierarchy
 
NotifyDriverShm_Handle NotifyDriverShm_Handle_downCast(INotifyDriver_Handle handle);
// conditionally move one level down the inheritance hierarchy; NULL upon failure
Instance Built-Ins

C synopsis target-domain
Int NotifyDriverShm_Object_count();
// The number of statically-created instance objects
 
NotifyDriverShm_Handle NotifyDriverShm_Object_get(NotifyDriverShm_Object *array, Int i);
// The handle of the i-th statically-created instance object (array == NULL)
 
NotifyDriverShm_Handle NotifyDriverShm_Object_first();
// The handle of the first dynamically-created instance object, or NULL
 
NotifyDriverShm_Handle NotifyDriverShm_Object_next(NotifyDriverShm_Handle handle);
// The handle of the next dynamically-created instance object, or NULL
 
IHeap_Handle NotifyDriverShm_Object_heap();
// The heap used to allocate dynamically-created instance objects
 
Types_Label *NotifyDriverShm_Handle_label(NotifyDriverShm_Handle handle, Types_Label *buf);
// The label associated with this instance object
 
String NotifyDriverShm_Handle_name(NotifyDriverShm_Handle handle);
// The name of this instance object
 
Configuration settings sourced in ti/sdo/ipc/notifyDrivers/NotifyDriverShm.xdc
var NotifyDriverShm = xdc.useModule('ti.sdo.ipc.notifyDrivers.NotifyDriverShm');
module-wide config parameters
per-instance config parameters
    var params = new NotifyDriverShm.Params// Instance config-params object;
        params.cacheLineSize// The cache line size of the shared memory = SizeT 128;
        params.localIntId// Local interrupt ID for interrupt line = UInt -1u;
        params.remoteIntId// Remote interrupt ID for interrupt line = UInt -1u;
 
 
metaonly config NotifyDriverShm.common$  // module-wide

Common module configuration parameters

Configuration settings
NotifyDriverShm.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.
 
metaonly config NotifyDriverShm.rovViewInfo  // module-wide
Configuration settings
NotifyDriverShm.rovViewInfo = ViewInfo.Instance ViewInfo.create;
 
Instance Config Parameters

Configuration settings
var params = new NotifyDriverShm.Params;
// Instance config-params object
    params.cacheEnabled = Bool true;
    // Whether cache operations will be performed
    params.cacheLineSize = SizeT 128;
    // The cache line size of the shared memory
    params.intVectorId = UInt ~1u;
    // Interrupt vector ID to be used by the driver
    params.localIntId = UInt -1u;
    // Local interrupt ID for interrupt line
    params.remoteIntId = UInt -1u;
    // Remote interrupt ID for interrupt line
    params.remoteProcId = UInt16 MultiProc.INVALIDID;
    // The MultiProc ID corresponding to the remote processor
    params.sharedAddr = Ptr null;
    // Address in shared memory where this instance will be placed
 
config NotifyDriverShm.Params.cacheEnabled  // instance

Whether cache operations will be performed

Configuration settings
var params = new NotifyDriverShm.Params;
  ...
params.cacheEnabled = Bool true;
 
DETAILS
If it is known that no cache operations are needed for this instance set this flag to FALSE. If sharedAddr lies within a shared region and the cache enabled setting for the region is FALSE, then the value specified here will be overriden to FALSE.
C SYNOPSIS
 
config NotifyDriverShm.Params.cacheLineSize  // instance

The cache line size of the shared memory

Configuration settings
var params = new NotifyDriverShm.Params;
  ...
params.cacheLineSize = SizeT 128;
 
DETAILS
This value should be configured
C SYNOPSIS
 
config NotifyDriverShm.Params.intVectorId  // instance

Interrupt vector ID to be used by the driver

Configuration settings
var params = new NotifyDriverShm.Params;
  ...
params.intVectorId = UInt ~1u;
 
DETAILS
This parameter is only used by C64x+ targets
C SYNOPSIS
 
config NotifyDriverShm.Params.localIntId  // instance

Local interrupt ID for interrupt line

Configuration settings
var params = new NotifyDriverShm.Params;
  ...
params.localIntId = UInt -1u;
 
DETAILS
For devices that support multiple inter-processor interrupt lines, this configuration parameter allows selecting a specific line to use for receiving an interrupt. The value specified here corresponds to the incoming interrupt line on the local processor.
If this configuration is not set, a default interrupt id is typically chosen.
C SYNOPSIS
 
config NotifyDriverShm.Params.remoteIntId  // instance

Remote interrupt ID for interrupt line

Configuration settings
var params = new NotifyDriverShm.Params;
  ...
params.remoteIntId = UInt -1u;
 
DETAILS
For devices that support multiple inter-processor interrupt lines, this configuration parameter allows selecting a specific line to use for receiving an interrupt. The value specified here corresponds to the incoming interrupt line on the remote processor.
If this configuration is not set, a default interrupt id is typically chosen.
C SYNOPSIS
 
config NotifyDriverShm.Params.remoteProcId  // instance

The MultiProc ID corresponding to the remote processor

Configuration settings
var params = new NotifyDriverShm.Params;
  ...
params.remoteProcId = UInt16 MultiProc.INVALIDID;
 
DETAILS
This parameter must be set for every device. The ti.sdo.utils.MultiProc.getId call can be used to obtain a MultiProc id given the remote processor's name.
C SYNOPSIS
 
config NotifyDriverShm.Params.sharedAddr  // instance

Address in shared memory where this instance will be placed

Configuration settings
var params = new NotifyDriverShm.Params;
  ...
params.sharedAddr = Ptr null;
 
DETAILS
Use sharedMemReq to determine the amount of shared memory required.
C SYNOPSIS
generated on Fri, 21 Aug 2015 19:35:43 GMT