Data Structures |
struct | Server_AlgDesc |
struct | Server_MemStat |
| Information for a memory heap of a remote DSP server. More...
|
Defines |
#define | Server_MODNAME "ti.sdo.ce.Server" |
| Name to pass to Diags_setMask() to enable logging for Server functions. For example, Diags_setMask(Server_MODNAME"+EX1234567"); turns on all Log statements in this module. Diags_setMask() must be called after initialization to take effect.
|
#define | Server_MAXSEGNAMELENGTH 32 |
| Maximum number of characters used in memory segment names.
|
Typedefs |
typedef enum Server_Status | Server_Status |
| Server error code.
|
typedef struct Server_AlgDesc | Server_AlgDesc |
typedef struct Server_MemStat | Server_MemStat |
| Information for a memory heap of a remote DSP server.
|
Enumerations |
enum | Server_Status {
Server_EOK = 0,
Server_ENOSERVER = 1,
Server_ENOMEM = 2,
Server_ERUNTIME = 3,
Server_EINVAL = 4,
Server_EWRONGSTATE = 5,
Server_EINUSE = 6,
Server_ENOTFOUND = 7,
Server_EFAIL = 8,
Server_ENOTSUPPORTED = 9
} |
| Server error code.
More...
|
Functions |
Server_Status | Server_addAlg (Server_Handle server, String location, Server_AlgDesc *pAlgDesc) |
| Dynamically add an algorithm to a Server.
|
Server_Status | Server_connectTrace (Server_Handle server, Int *token) |
| Connect to server for purposes of collecting trace and/or LOG data.
|
Server_Status | Server_disconnectTrace (Server_Handle server, Int token) |
| Disconnect from server when finished collecting trace and/or LOG data.
|
Int | Server_fwriteTrace (Server_Handle server, String prefix, FILE *out) |
| Write Server's trace buffer to specifed file stream.
|
Int | Server_getCpuLoad (Server_Handle server) |
| Get Server's CPU usage in percent.
|
Server_Status | Server_getMemStat (Server_Handle server, Int segNum, Server_MemStat *memStat) |
| Get information on a memory heap segment of a remote DSP server.
|
Server_Status | Server_getNumMemSegs (Server_Handle server, Int *numSegs) |
| Get the number of memory heap segments of a remote DSP server.
|
Void | Server_initAlgDesc (Server_AlgDesc *pAlgDesc) |
| Initialize an Server_AlgDesc structure with default values.
|
Server_Status | Server_redefineHeap (Server_Handle server, String name, Uint32 base, Uint32 size) |
| Set the base address and size of a remote DSP server heap.
|
Server_Status | Server_restoreHeap (Server_Handle server, String name) |
| Set the base address and size of a remote DSP server heap back to their original values.
|
Int | Server_setTrace (Server_Handle server, String mask) |
| Set Server's trace mask.
|
Dynamically add an algorithm to a Server.
- Parameters:
-
[in] | server | The handle of a server returned by Engine_getServer(). Set to NULL when adding a local algorithm to the server. In the future, this handle will be used to dynamically add algorithms to a remote server. |
[in] | location | String identifying the location of the algorithm. Often this is a file name, but for systems without a file system, it may be a system-specific string identifier. This may be NULL if the algorithm is built into the executable. Currently not supported - set to NULL. |
[in] | pAlgDesc | Parameters describing the algorithm being added. Before setting the fields of this structure, it should first be initialized with Server_initAlgDesc() , to set all fields to default values. |
The user must set the following fields of pAlgDesc: pAlgDesc->name pAlgDesc->fxns pAlgDesc->idmaFxns, if applicable pAlgDesc->iresFxns, if applicable
pAlgDesc->groupId pAlgDesc->priority pAlgDesc->stackSize
pAlgDesc->types pAlgDesc->stubFxnsName pAlgDesc->skelFxns
Currently, adding only local algorithms is supported, so the default value of TRUE can be used for: pAlgDesc->isLocal
- Precondition:
- As with all Codec Server API's, CERuntime_init() must have previously been called.
- Return values:
-
Server_EOK | Success. |
Server_EINVAL | pAlgDesc or pAlgDesc->name is NULL. |
Server_EINUSE | The name of the alg in pAlgDesc->name is already in use. |
Server_ENOTSUPPORTED | pAlgDesc->isLocal = FALSE is currently not supported. |
- Example Usage:
- See also:
- Server_AlgDesc
-
Server_initAlgDesc()
-
Engine_getServer()
Server_Status Server_redefineHeap |
( |
Server_Handle |
server, |
|
|
String |
name, |
|
|
Uint32 |
base, |
|
|
Uint32 |
size |
|
) |
| |
Set the base address and size of a remote DSP server heap.
For example, in the case of DM644x, suppose that an application wants to allocate a block of memory on the GPP to be used by the DSP server for the memory segment named "DDRALGHEAP". A block of physically contiguous memory could be obtained by Memory_alloc() and the corresponding DSP address obtained with Memory_getBufferPhysicalAddress(). This DSP address and the size of the block could then be passed to Server_redefineHeap(). For example:
This function can only be called when there is no memory currently allocated in the heap (since the heap cannot be changed if it is being used).
- Parameters:
-
[in] | server | Server handle obtained from Engine_getServer(). |
[in] | name | Name of heap to be redefined. |
[in] | base | Base address for algorithm heap. |
[in] | size | Size (DSP MADUs) of new heap. |
- Return values:
-
Server_EOK | Success. |
Server_ERUNTIME | Internal runtime error occurred. |
Server_ENOTFOUND | No heap with the specified name was found. |
Server_EINVAL | Changing to the new base and size would cause an overlap with another heap. |
Server_EINUSE | Memory is currently allocated in the heap. |
- Precondition:
server
is non-NULL.
-
base
is a DSP address of a physically contiguous block of memory.
-
base
is aligned on an 8-byte boundary.
- Postcondition:
- On success, the server's algorithm heap base will have been set to
base
, and the size will have been set to size
.
- See also:
- Server_restoreHeap().
Server_Status Server_restoreHeap |
( |
Server_Handle |
server, |
|
|
String |
name |
|
) |
| |
Set the base address and size of a remote DSP server heap back to their original values.
This function resets the base address and size of a named heap of the remote server, back to their values before the first call to Server_redefineHeap() was made. The name of the heap can be at most Server_MAXSEGNAMELENGTH characters long, otherwise this function will return Server_ENOTFOUND.
As with Server_redefineHeap(), this function can only be called when no memory is currently allocated from the heap (as the heap cannot be changed if it is being used).
- Parameters:
-
[in] | server | Server handle obtained through Engine_getServer(). |
[in] | name | Name of the heap to be restored. |
- Return values:
-
Server_EOK | Success. |
Server_ERUNTIME | Internal runtime error occurred. |
Server_ENOTFOUND | No heap with the specified name was found. |
Server_EINVAL | Changing back to the original base and size would cause an overlap with another heap. |
Server_EINUSE | Memory is currently allocated in the heap. |
- Precondition:
server
is non-NULL.
- Postcondition:
- On success, the server's algorithm heap base and size will have been reset to their original value.
- See also:
- Server_redefineHeap().