This section contains APIs for Inter-processor communication (IPC)
◆ APP_IPC_HW_LOCK_MAX
#define APP_IPC_HW_LOCK_MAX (256u) |
Max lock ID for HW locks.
◆ APP_IPC_WAIT_FOREVER
#define APP_IPC_WAIT_FOREVER (0xFFFFFFFFu) |
Timeout value to use to wait forever.
◆ APP_IPC_TIOVX_RPMSG_PORT_ID
#define APP_IPC_TIOVX_RPMSG_PORT_ID (13u) |
RPMsg Port used for TIOVX IPC.
◆ APP_IPC_REMOTE_SERVICE_RPMSG_PORT_ID
#define APP_IPC_REMOTE_SERVICE_RPMSG_PORT_ID (21u) |
RPMsg Port used for Remote service.
◆ APP_IPC_ECHO_TEST_RPMSG_PORT_ID
#define APP_IPC_ECHO_TEST_RPMSG_PORT_ID (14u) |
RPMsg Port used for echo test.
◆ APP_IPC_RPMSG_PROTO_ECHO_TEST_RPMSG_PORT_ID
#define APP_IPC_RPMSG_PROTO_ECHO_TEST_RPMSG_PORT_ID (12u) |
RPMsg Port used for RPMsg proto echo test.
◆ app_ipc_notify_handler_f
typedef void(* app_ipc_notify_handler_f) (uint32_t src_cpu_id, uint32_t payload) |
Callback that is invoke when current CPU receives a IPC notify.
- Parameters
-
src_cpu_id | [in] source CPU which generated this callback, see APP_IPC_CPU_* |
payload | [in] payload or message received from source CPU to current CPU |
◆ appIpcInitPrmSetDefault()
Set IPC init parameters to default state.
Recommend to call this API before callnig appIpcInit.
- Parameters
-
prm | [out] Parameters set to default |
◆ appIpcInit()
Initialize IPC module.
- Parameters
-
prm | [in] Initialization parameters |
- Returns
- 0 on success, else failure
◆ appIpcDeInit()
De-Initialize IPC module.
- Returns
- 0 on success, else failure
◆ appIpcRegisterNotifyHandler()
Register callback to invoke on receiving a notify message.
- Parameters
-
handler | [in] Notify handler |
- Returns
- 0 on success, else failure
◆ appIpcSendNotify()
int32_t appIpcSendNotify |
( |
uint32_t |
dest_cpu_id, |
|
|
uint32_t |
payload |
|
) |
| |
Send a notify message to a given CPU.
- Parameters
-
dest_cpu_id | [in] Destinatin CPU ID, see APP_IPC_CPU_* |
payload | [in] payload to send as part of notify |
- Returns
- 0 on success, else failure
◆ appIpcSendNotifyPort()
int32_t appIpcSendNotifyPort |
( |
uint32_t |
dest_cpu_id, |
|
|
uint32_t |
payload, |
|
|
uint32_t |
port_id |
|
) |
| |
Send a notify message to a given CPU.
- Parameters
-
dest_cpu_id | [in] Destinatin CPU ID, see APP_IPC_CPU_* |
payload | [in] payload to send as part of notify |
port_id | [in] port used for IPC |
- Returns
- 0 on success, else failure
◆ appIpcGetSelfCpuId()
uint32_t appIpcGetSelfCpuId |
( |
| ) |
|
Get current CPU ID.
- Returns
- current CPU ID, see APP_IPC_CPU_*
◆ appIpcGetHostPortId()
uint32_t appIpcGetHostPortId |
( |
uint16_t |
cpu_id | ) |
|
Get current CPU Port ID.
- Returns
- current CPU Port ID
◆ appIpcIsCpuEnabled()
uint32_t appIpcIsCpuEnabled |
( |
uint32_t |
cpu_id | ) |
|
Check if a CPU is enabled in current system for IPC.
- Parameters
-
cpu_id | [in] CPU ID, see APP_IPC_CPU_* |
- Returns
- 1 if CPU is enabled, 0 if CPU is disabled
◆ appIpcHwLockAcquire()
int32_t appIpcHwLockAcquire |
( |
uint32_t |
lock_id, |
|
|
uint32_t |
timeout |
|
) |
| |
Acquire a system wide HW lock.
This API will spin until the lock is acquired or timeout is hit. It is recoemended to take a CPU level lock like a semaphore or mutex before calling this API.
- Parameters
-
lock_id | [in] HW lock ID to use |
timeout | [in] Timeout in units of usecs. |
- Returns
- 0 if lock is acquire, -2 if timeout is hit, else failure
◆ appIpcHwLockRelease()
int32_t appIpcHwLockRelease |
( |
uint32_t |
lock_id | ) |
|
Release a system wide HW lock.
- Parameters
-
lock_id | [in] HW lock ID to use |
◆ appIpcGetTiovxObjDescSharedMemInfo()
int32_t appIpcGetTiovxObjDescSharedMemInfo |
( |
void ** |
addr, |
|
|
uint32_t * |
size |
|
) |
| |
Get base address and size of memory region assigned for TIOVX obj_desc's.
This is used by TIOVX as shared region and is typically non-cached at all CPUs. It can be cache at a CPU if the CPU support cache coherency.
- Parameters
-
addr | [out] Base address of shared region |
size | [out] Size of shared region |
◆ appIpcGetTiovxLogRtSharedMemInfo()
void appIpcGetTiovxLogRtSharedMemInfo |
( |
void ** |
shm_base, |
|
|
uint32_t * |
shm_size |
|
) |
| |
Get base address and size of memory region assigned for TIOVX run-time logging.
This is used by TIOVX as shared region and is typically non-cached at all CPUs. It can be cache at a CPU if the CPU support cache coherency.
- Parameters
-
shm_base | [out] Base address of shared region |
shm_size | [out] Size of shared region |
◆ appIpcGetIpcCpuId()
uint32_t appIpcGetIpcCpuId |
( |
uint32_t |
app_cpu_id | ) |
|
Convert from APP_CPU_xxx to IPC LLD CPU ID.
◆ appIpcGetAppCpuId()
uint32_t appIpcGetAppCpuId |
( |
char * |
name | ) |
|
Get APP_CPU_xxx from CPU name.
◆ appIpcGetCpuName()
char* appIpcGetCpuName |
( |
uint32_t |
app_cpu_id | ) |
|
Get CPU name from CPU ID.