PDK API Guide for AM65xx
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 
182 typedef void (*Ipc_PrintFxn)(const char *str);
183 
189 typedef uintptr_t (*Ipc_OsalDisableAllIntrFxn)(void);
190 
196 typedef void (*Ipc_OsalRestoreAllIntrFxn)(uintptr_t cookie);
197 
206 
215 
224 
234  int32_t key);
235 
241 typedef void * (*Ipc_OsalMutexCreateFxn)(void);
242 
248 typedef void (*Ipc_OsalMutexDeleteFxn)(void *mutexHandle);
249 
255 typedef int32_t (*Ipc_OsalMutexLockFxn)(void *mutexHandle, uint32_t timeout);
256 
262 typedef void (*Ipc_OsalMutexUnlockFxn)(void *mutexHandle);
263 
271 typedef int32_t (*Ipc_OsalHIsrCreateFxn)(Ipc_OsalHIsrHandle *handle,
272  Ipc_OsalHIsrFxn fxn, void *arg);
273 
281 typedef void (*Ipc_OsalHIsrDeleteFxn)(Ipc_OsalHIsrHandle *handle);
282 
290 typedef int32_t (*Ipc_OsalHIsrPostFxn)(Ipc_OsalHIsrHandle *handle);
291 
297 typedef void (*Ipc_OsalIsrFxn)(uintptr_t arg);
298 
308 typedef void *(*Ipc_OsalRegisterIntrFxn)(Ipc_MbConfig *cfg,
309  Ipc_OsalIsrFxn isrFxn,
310  uintptr_t arg);
311 
317 typedef void (*Ipc_OsalUnRegisterIntrFxn)(void *hwiHandle);
318 
325 typedef void (*Ipc_NewMsgReceivedFxn)(uint32_t srcEndPt, uint32_t procId);
326 
330 typedef struct Ipc_OsalPrms_s
331 {
367 } Ipc_OsalPrms;
368 
369 #ifdef __cplusplus
370 }
371 #endif
372 
373 #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:308
Mailbox interrupt router configuration.
Definition: ipc_types.h:113
Ipc_OsalHIsrPostFxn postHIsr
Definition: ipc_types.h:341
Ipc_OsalHIsrDeleteFxn deleteHIsr
Definition: ipc_types.h:339
void(* Ipc_OsalDeleteHIsrMutexFxn)(Ipc_OsalHIsrGateHandle *handle)
IPC OSAL delete high level interrupt lock.
Definition: ipc_types.h:214
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:271
Ipc_OsalEnterHIsrMutexFxn lockHIsrGate
Definition: ipc_types.h:348
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:255
uint32_t eventId
Definition: ipc_types.h:116
Ipc_OsalRegisterIntrFxn registerIntr
Definition: ipc_types.h:363
Ipc_OsalCreateHIsrMutexFxn createHIsrGate
Definition: ipc_types.h:344
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:189
Ipc_OsalMutexCreateFxn createMutex
Definition: ipc_types.h:354
void(* Ipc_OsalMutexDeleteFxn)(void *mutexHandle)
IPC OSAL mutex delete function prototype.
Definition: ipc_types.h:248
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:317
uintptr_t arg1
Definition: ipc_types.h:138
Ipc_OsalDisableAllIntrFxn disableAllIntr
Definition: ipc_types.h:332
void(* Ipc_OsalHIsrDeleteFxn)(Ipc_OsalHIsrHandle *handle)
IPC OSAL delete high level interrupt handler.
Definition: ipc_types.h:281
Ipc_OsalDeleteHIsrMutexFxn deleteHIsrGate
Definition: ipc_types.h:346
void(* Ipc_NewMsgReceivedFxn)(uint32_t srcEndPt, uint32_t procId)
IPC New message notification.
Definition: ipc_types.h:325
Ipc_OsalExitHIsrMutexFxn unLockHIsrGate
Definition: ipc_types.h:350
void *(* Ipc_OsalMutexCreateFxn)(void)
IPC OSAL mutex create function prototype to protect critical section.
Definition: ipc_types.h:241
int32_t(* Ipc_OsalHIsrPostFxn)(Ipc_OsalHIsrHandle *handle)
IPC OSAL Lock High level ISR's.
Definition: ipc_types.h:290
Ipc_OsalRestoreAllIntrFxn restoreAllIntr
Definition: ipc_types.h:334
void(* Ipc_OsalExitHIsrMutexFxn)(Ipc_OsalHIsrGateHandle handle, int32_t key)
IPC OSAL Un Lock High level ISR's.
Definition: ipc_types.h:233
void(* Ipc_OsalMutexUnlockFxn)(void *mutexHandle)
IPC OSAL mutex lock function prototype.
Definition: ipc_types.h:262
Ipc_OsalMutexLockFxn lockMutex
Definition: ipc_types.h:358
Ipc_OsalHIsrGateHandle(* Ipc_OsalCreateHIsrMutexFxn)(void)
IPC OSAL create high level interrupt lock.
Definition: ipc_types.h:205
Ipc_OsalHIsrCreateFxn createHIsr
Definition: ipc_types.h:337
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:223
uintptr_t arg0
Definition: ipc_types.h:136
void(* Ipc_PrintFxn)(const char *str)
IPC info/debug print function prototype.
Definition: ipc_types.h:182
Ipc_OsalMutexUnlockFxn unlockMutex
Definition: ipc_types.h:360
uint32_t inputIntrNum
Definition: ipc_types.h:117
char str[32]
Definition: tisci_core.h:439
Ipc_OsalMutexDeleteFxn deleteMutex
Definition: ipc_types.h:356
IPC driver OSAL function pointers.
Definition: ipc_types.h:330
void(* Ipc_OsalIsrFxn)(uintptr_t arg)
IPC OSAL ISR callback function prototype.
Definition: ipc_types.h:297
void(* Ipc_OsalRestoreAllIntrFxn)(uintptr_t cookie)
IPC OSAL interrupt restore function prototype.
Definition: ipc_types.h:196
Ipc_OsalUnRegisterIntrFxn unRegisterIntr
Definition: ipc_types.h:365
uint32_t outputIntrNum
Definition: ipc_types.h:118