SysLink API Reference  2.21.03.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Functions
IpcHost.h File Reference

Detailed Description

This file contains APIs and defines that are used by applications only on the host-side of the device.

Remarks:
The typical flow for an IPC-using application is to first load the processor (typically via slaveloader or the ProcMgr APIs), and then use the Ipc_control() API to attach/detach from the running slave.
Example:
// invoke the SysLink load callback
remoteProcId = MultiProc_getId("DSP");
status = Ipc_control(remoteProcId, Ipc_CONTROLCMD_LOADCALLBACK, NULL);
// invoke the SysLink start callback
status = Ipc_control(remoteProcId, Ipc_CONTROLCMD_STARTCALLBACK, NULL);
// IPC is established, app-specific code is here
// invoke the SysLink stop callback
status = Ipc_control(remoteProcId, Ipc_CONTROLCMD_STOPCALLBACK, NULL);

Go to the source code of this file.

Data Structures

struct  Ipc_Terminate
 Argument for the Ipc_CONTROLCMD_SETTERMINATEPOLICY command. More...

Macros

#define Ipc_TERMINATEPOLICY_STOP   1
 Use the stop terminate policy.
#define Ipc_TERMINATEPOLICY_NOTIFY   2
 Use the notify terminate policy.
#define Ipc_CONTROLCMD_LOADCALLBACK   (0xBABE0000)
 Control command ID for load callback.
#define Ipc_CONTROLCMD_STARTCALLBACK   (0xBABE0001)
 Control command ID for start callback.
#define Ipc_CONTROLCMD_STOPCALLBACK   (0xBABE0002)
 Control command ID for stop callback.
#define Ipc_CONTROLCMD_SETTERMINATEPOLICY   (0xBABE0003)
 Control command ID for specifying the terminate handling policy.

Functions

Int Ipc_control (UInt16 procId, Int32 cmdId, Ptr arg)
 Perform IPC-related control operations with a specific slave.
Int Ipc_runtimeId (UInt8 *rtid)
 Return a runtime id for the given application key.

Macro Definition Documentation

#define Ipc_TERMINATEPOLICY_STOP   1

Use the stop terminate policy.

When the host process termiantes (e.g. CTRL-C, SIGKILL), this terminate policy will stop the remote processor and place it into reset. The terminate action is carried out by the SysLink driver on behalf of the terminated process.

#define Ipc_TERMINATEPOLICY_NOTIFY   2

Use the notify terminate policy.

When the host process termiantes (e.g. CTRL-C, SIGKILL), this terminate policy will send a notify event to the remote processor. The lineId and eventId are determined by the remote executable through configuration parameters (See ti/syslink/ipc/rtos/SysLink.xdc).

#define Ipc_CONTROLCMD_LOADCALLBACK   (0xBABE0000)

Control command ID for load callback.

This command must be sent (via Ipc_control()) before using IPC with the slave, and after loading the slave.

This call ensures resources (e.g. Shared Region 0) are visible to the slave (for example, by enabling the slave-side MMU). This call then typically enables the slave-side call to Ipc_start() to succeed.

When ProcMgr is used to load the slave (the typical case), the arg passed to Ipc_control() should be NULL.

When ProcMgr is not used to load the slave (supported, but not the typical case), the arg passed to Ipc_control() must be a pointer to the slave-side address of the _Ipc_ResetVector symbol. This is often obtained by inspecting the slave-side executable's .map file.

See also:
Ipc_control()
#define Ipc_CONTROLCMD_STARTCALLBACK   (0xBABE0001)

Control command ID for start callback.

This command must be sent (via Ipc_control()) before using IPC with the slave, and after sending the Ipc_CONTROLCMD_LOADCALLBACK command.

This call performs a handshake with the slave processor, typically enabling the slave-side call to Ipc_attach() to succeed.

When sending this command, the arg passed to Ipc_control() should be NULL.

See also:
Ipc_control()
#define Ipc_CONTROLCMD_STOPCALLBACK   (0xBABE0002)

Control command ID for stop callback.

This command must be sent (via Ipc_control()) to detach from an attached slave.

This call first performs a handshake with the slave processor, typically enabling the slave-side calls to Ipc_detach() and Ipc_stop() to succeed. It then may make resources (e.g. Shared Region 0) inaccessible to the slave (for example by disabling the slave's MMU).

When ProcMgr is used to load the slave (the typical case), the arg passed to Ipc_control() should be NULL.

When ProcMgr is not used to load the slave (supported, but not the typical case), the arg passed to Ipc_control() must be a pointer to the slave-side address of the _Ipc_ResetVector symbol. This is often obtained by inspecting the slave-side executable's .map file.

See also:
Ipc_control()
#define Ipc_CONTROLCMD_SETTERMINATEPOLICY   (0xBABE0003)

Control command ID for specifying the terminate handling policy.

Specify the terminate policy to be used by SysLink in the event that the application terminates. The SysLink driver will perform the requested terminate actions on behalf of the terminated application. This is typically used to handle cleanup of resources.

The arg passed to Ipc_control() must be pointer to an Ipc_Terminate structure.

See also:
Ipc_control()

Function Documentation

Int Ipc_control ( UInt16  procId,
Int32  cmdId,
Ptr  arg 
)

Perform IPC-related control operations with a specific slave.

Parameters:
[in]procIdRemote processor ID
[in]cmdIdCommand ID
[in]argArgument. The value of arg depends on the command being sent in cmdId.
Remarks:
Each specific cmdId describes its usage of the arg param.
See also:
Ipc_CONTROLCMD_LOADCALLBACK
Ipc_CONTROLCMD_STARTCALLBACK
Ipc_CONTROLCMD_STOPCALLBACK
Ipc_CONTROLCMD_SETTERMINATEPOLICY
Int Ipc_runtimeId ( UInt8 rtid)

Return a runtime id for the given application key.

When the application calls SysLink_setup(), there is an internal runtime id assigned to the application's process id. Use this API to retrieve the assigned runtime id. This API may be called multiple times but will always return the same runtime id for the current process id. This ensures that all levels of the software stack will be assigned the same runtime id.

There are 255 available runtime ids: 1 - 255. Runtime ids are allocated by looking for the next larger unused runtime id. The search will wrap around as needed.

Parameters:
[out]rtidRemote processor ID
Return values:
Ipc_S_SUCCESSOperation succeeded
Ipc_E_FAILNo more runtime ids available
Copyright 2014, Texas Instruments Incorporated