PDK API Guide for AM64x
ipc_types.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2018
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the
15  * distribution.
16  *
17  * Neither the name of Texas Instruments Incorporated nor the names of
18  * its contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
40 #ifndef IPC_TYPES_H_
41 #define IPC_TYPES_H_
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /* ========================================================================== */
48 /* Include Files */
49 /* ========================================================================== */
50 
51 /* ========================================================================== */
52 /* Macros & Typedefs */
53 /* ========================================================================== */
54 
64 #define IPC_SOK (CSL_PASS)
65 
68 #define IPC_EFAIL (CSL_EFAIL)
69 
72 #define IPC_EBADARGS (CSL_EBADARGS)
73 
76 #define IPC_EINVALID_PARAMS (CSL_EINVALID_PARAMS)
77 
81 #define IPC_ETIMEOUT (CSL_ETIMEOUT)
82 
84 #define IPC_EALLOC (CSL_EALLOC)
85 
87 #define IPC_EUNSUPPORTED (CSL_EUNSUPPORTED_CMD)
88 
90 #define IPC_E_UNBLOCKED (-50)
91 
93 #define IPC_INTR_INVALID (0xFFFF0000U)
94 
98 #define IPC_RPMESSAGE_TIMEOUT_FOREVER ~(0)
99 
103 #define RPMESSAGE_ANY (0xFFFFFFFFU)
104 
108 #define RPMESSAGE_ALL (0xFFFFFFFFU)
109 
113 typedef struct Ipc_MbConfig_s
114 {
115  uint32_t priority;
116  uint32_t eventId;
117  uint32_t inputIntrNum;
118  uint32_t outputIntrNum;
119 }Ipc_MbConfig;
120 
129 typedef void (*Ipc_OsalHIsrFxn)(uintptr_t arg0, uintptr_t arg1);
130 
134 typedef struct Ipc_OsalHIsrHandle_s
135 {
136  uintptr_t arg0;
138  uintptr_t arg1;
145 
149 typedef void (* Ipc_OsalHIsrGateHandle);
150 
161 typedef uint32_t (*Ipc_VirtToPhyFxn)(const void *virtAddr);
162 
173 typedef void *(*Ipc_PhyToVirtFxn)(uint32_t phyAddr);
174 
180 typedef uintptr_t (*Ipc_OsalDisableAllIntrFxn)(void);
181 
187 typedef void (*Ipc_OsalRestoreAllIntrFxn)(uintptr_t cookie);
188 
197 
206 
215 
225  int32_t key);
226 
232 typedef void * (*Ipc_OsalMutexCreateFxn)(void);
233 
239 typedef void (*Ipc_OsalMutexDeleteFxn)(void *mutexHandle);
240 
246 typedef int32_t (*Ipc_OsalMutexLockFxn)(void *mutexHandle, uint32_t timeout);
247 
253 typedef void (*Ipc_OsalMutexUnlockFxn)(void *mutexHandle);
254 
262 typedef int32_t (*Ipc_OsalHIsrCreateFxn)(Ipc_OsalHIsrHandle *handle,
263  Ipc_OsalHIsrFxn fxn, void *arg);
264 
272 typedef void (*Ipc_OsalHIsrDeleteFxn)(Ipc_OsalHIsrHandle *handle);
273 
281 typedef int32_t (*Ipc_OsalHIsrPostFxn)(Ipc_OsalHIsrHandle *handle);
282 
288 typedef void (*Ipc_OsalIsrFxn)(uintptr_t arg);
289 
299 typedef void *(*Ipc_OsalRegisterIntrFxn)(Ipc_MbConfig *cfg,
300  Ipc_OsalIsrFxn isrFxn,
301  uintptr_t arg);
302 
308 typedef void (*Ipc_OsalUnRegisterIntrFxn)(void *hwiHandle);
309 
316 typedef void (*Ipc_NewMsgReceivedFxn)(uint32_t srcEndPt, uint32_t procId);
317 
321 typedef struct Ipc_OsalPrms_s
322 {
358 } Ipc_OsalPrms;
359 
360 #ifdef __cplusplus
361 }
362 #endif
363 
364 #endif /* #ifndef IPC_TYPES_H_ */
void *(* Ipc_OsalRegisterIntrFxn)(Ipc_MbConfig *cfg, Ipc_OsalIsrFxn isrFxn, uintptr_t arg)
IPC OSAL ISR register function prototype.
Definition: ipc_types.h:299
Mailbox interrupt router configuration.
Definition: ipc_types.h:113
Ipc_OsalHIsrPostFxn postHIsr
Definition: ipc_types.h:332
Ipc_OsalHIsrDeleteFxn deleteHIsr
Definition: ipc_types.h:330
void(* Ipc_OsalDeleteHIsrMutexFxn)(Ipc_OsalHIsrGateHandle *handle)
IPC OSAL delete high level interrupt lock.
Definition: ipc_types.h:205
uint32_t priority
Definition: ipc_types.h:115
int32_t(* Ipc_OsalHIsrCreateFxn)(Ipc_OsalHIsrHandle *handle, Ipc_OsalHIsrFxn fxn, void *arg)
IPC OSAL create high level interrupt handler.
Definition: ipc_types.h:262
Ipc_OsalEnterHIsrMutexFxn lockHIsrGate
Definition: ipc_types.h:339
uint32_t(* Ipc_VirtToPhyFxn)(const void *virtAddr)
IPC Virtual to Physical address translation callback function.
Definition: ipc_types.h:161
int32_t(* Ipc_OsalMutexLockFxn)(void *mutexHandle, uint32_t timeout)
IPC OSAL mutex lock function prototype.
Definition: ipc_types.h:246
uint32_t eventId
Definition: ipc_types.h:116
Ipc_OsalRegisterIntrFxn registerIntr
Definition: ipc_types.h:354
Ipc_OsalCreateHIsrMutexFxn createHIsrGate
Definition: ipc_types.h:335
Ipc_OsalHIsrFxn hIsrFxn
Definition: ipc_types.h:140
void(* Ipc_OsalHIsrFxn)(uintptr_t arg0, uintptr_t arg1)
IPC OSAL High Level ISR type.
Definition: ipc_types.h:129
uintptr_t(* Ipc_OsalDisableAllIntrFxn)(void)
IPC OSAL interrupt disable function prototype.
Definition: ipc_types.h:180
Ipc_OsalMutexCreateFxn createMutex
Definition: ipc_types.h:345
void(* Ipc_OsalMutexDeleteFxn)(void *mutexHandle)
IPC OSAL mutex delete function prototype.
Definition: ipc_types.h:239
Second level ISR (HISR), used to complete ISR functions.
Definition: ipc_types.h:134
void * Ipc_OsalHIsrGateHandle
High Level ISR handle.
Definition: ipc_types.h:149
void(* Ipc_OsalUnRegisterIntrFxn)(void *hwiHandle)
IPC OSAL ISR unregister function prototype.
Definition: ipc_types.h:308
uintptr_t arg1
Definition: ipc_types.h:138
Ipc_OsalDisableAllIntrFxn disableAllIntr
Definition: ipc_types.h:323
void(* Ipc_OsalHIsrDeleteFxn)(Ipc_OsalHIsrHandle *handle)
IPC OSAL delete high level interrupt handler.
Definition: ipc_types.h:272
Ipc_OsalDeleteHIsrMutexFxn deleteHIsrGate
Definition: ipc_types.h:337
void(* Ipc_NewMsgReceivedFxn)(uint32_t srcEndPt, uint32_t procId)
IPC New message notification.
Definition: ipc_types.h:316
Ipc_OsalExitHIsrMutexFxn unLockHIsrGate
Definition: ipc_types.h:341
void *(* Ipc_OsalMutexCreateFxn)(void)
IPC OSAL mutex create function prototype to protect critical section.
Definition: ipc_types.h:232
int32_t(* Ipc_OsalHIsrPostFxn)(Ipc_OsalHIsrHandle *handle)
IPC OSAL Lock High level ISR's.
Definition: ipc_types.h:281
Ipc_OsalRestoreAllIntrFxn restoreAllIntr
Definition: ipc_types.h:325
void(* Ipc_OsalExitHIsrMutexFxn)(Ipc_OsalHIsrGateHandle handle, int32_t key)
IPC OSAL Un Lock High level ISR's.
Definition: ipc_types.h:224
void(* Ipc_OsalMutexUnlockFxn)(void *mutexHandle)
IPC OSAL mutex lock function prototype.
Definition: ipc_types.h:253
Ipc_OsalMutexLockFxn lockMutex
Definition: ipc_types.h:349
Ipc_OsalHIsrGateHandle(* Ipc_OsalCreateHIsrMutexFxn)(void)
IPC OSAL create high level interrupt lock.
Definition: ipc_types.h:196
Ipc_OsalHIsrCreateFxn createHIsr
Definition: ipc_types.h:328
void * hLosHisrHandle
Definition: ipc_types.h:142
int32_t(* Ipc_OsalEnterHIsrMutexFxn)(Ipc_OsalHIsrGateHandle handle)
IPC OSAL Lock High level ISR's.
Definition: ipc_types.h:214
uintptr_t arg0
Definition: ipc_types.h:136
Ipc_OsalMutexUnlockFxn unlockMutex
Definition: ipc_types.h:351
uint32_t inputIntrNum
Definition: ipc_types.h:117
Ipc_OsalMutexDeleteFxn deleteMutex
Definition: ipc_types.h:347
IPC driver OSAL function pointers.
Definition: ipc_types.h:321
void(* Ipc_OsalIsrFxn)(uintptr_t arg)
IPC OSAL ISR callback function prototype.
Definition: ipc_types.h:288
void(* Ipc_OsalRestoreAllIntrFxn)(uintptr_t cookie)
IPC OSAL interrupt restore function prototype.
Definition: ipc_types.h:187
Ipc_OsalUnRegisterIntrFxn unRegisterIntr
Definition: ipc_types.h:356
uint32_t outputIntrNum
Definition: ipc_types.h:118