Data Structures |
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 struct Server_Obj * | Server_Handle |
| Opaque handle to the server for an engine.
|
typedef enum Server_Status | Server_Status |
| Server error code.
|
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 error code.
More...
|
Functions |
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.
|
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.
|
Set the base address and size of a remote DSP server heap.
This API is used to move and/or resize a named heap of the remote DSP server. The address passed to this API is a DSP address and the memory from base
to base
+ size
must be contiguous in physical memory. The size of the heap should be given in DSP MADUs (minimum addressable data units). The name of the heap can be at most Server_MAXSEGNAMELENGTH characters long.
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().
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().