PDK API Guide for AM64x
mailbox_osal.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2020
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
49 #ifndef MAILBOX_OSAL_H_
50 #define MAILBOX_OSAL_H_
51 
52 /* ========================================================================== */
53 /* Include Files */
54 /* ========================================================================== */
55 
56 #include <stdint.h>
57 #include "ti/osal/osal.h"
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 /* ========================================================================== */
64 /* Macros & Typedefs */
65 /* ========================================================================== */
66 
72 typedef uintptr_t (*Mbox_OsalDisableAllIntrFxn)(void);
73 
79 typedef void (*Mbox_OsalRestoreAllIntrFxn)(uintptr_t cookie);
80 
86 typedef void (*Mbox_OsalEnableIntrFxn)(uint32_t coreIntrNum);
87 
93 typedef void (*Mbox_OsalDisableIntrFxn)(uint32_t coreIntrNum);
94 
100 typedef void * (*Mbox_OsalMutexCreateFxn)(void);
101 
107 typedef void (*Mbox_OsalMutexDeleteFxn)(void *mutexHandle);
108 
114 typedef int32_t (*Mbox_OsalMutexLockFxn)(void *mutexHandle, uint32_t timeout);
115 
121 typedef void (*Mbox_OsalMutexUnlockFxn)(void *mutexHandle, bool isISRContext);
122 
128 typedef void (*Mbox_OsalIsrFxn)(uintptr_t arg);
129 
133 typedef void (*Mbox_OsalDirectIsrFxn)(void);
134 
146 typedef void *(*Mbox_OsalRegisterIntrFxn)(Mbox_OsalIsrFxn isrFxn,
147  uint32_t coreIntrNum,
148  uint32_t intrPriority,
149  void *arg,
150  char *name);
151 
162 typedef void *(*Mbox_OsalRegisterDirectIntrFxn)(Mbox_OsalDirectIsrFxn isrFxn,
163  uint32_t coreIntrNum,
164  uint32_t intrPriority);
165 
171 typedef void (*Mbox_OsalUnRegisterIntrFxn)(void *hwiHandle,
172  uint32_t coreIntrNum);
173 
174 
175 /* ========================================================================== */
176 /* Structure Declarations */
177 /* ========================================================================== */
178 
182 typedef struct Mbox_OsalPrms_s
183 {
208 } Mbox_OsalPrms;
209 
210 /* ========================================================================== */
211 /* Function Declarations */
212 /* ========================================================================== */
213 
214 /*
215  * Structure Init functions
216  */
223 void MboxOsalPrms_init (Mbox_OsalPrms *osalPrms);
224 
225 /* ========================================================================== */
226 /* Static Function Definition */
227 /* ========================================================================== */
228 
229 /* None */
230 
231 #ifdef __cplusplus
232 }
233 #endif
234 
235 #endif /* MAILBOX_OSAL_H_ */
236 
237 /* @} */
OS Abstraction Layer header.
Mbox_OsalRegisterIntrFxn registerIntr
Definition: mailbox_osal.h:202
Mbox_OsalRegisterDirectIntrFxn registerDirectIntr
Definition: mailbox_osal.h:204
Mbox_OsalMutexDeleteFxn deleteMutex
Definition: mailbox_osal.h:195
void(* Mbox_OsalMutexUnlockFxn)(void *mutexHandle, bool isISRContext)
Mailbox OSAL mutex lock function prototype.
Definition: mailbox_osal.h:121
void(* Mbox_OsalUnRegisterIntrFxn)(void *hwiHandle, uint32_t coreIntrNum)
Mailbox OSAL ISR unregister function prototype.
Definition: mailbox_osal.h:171
void *(* Mbox_OsalRegisterDirectIntrFxn)(Mbox_OsalDirectIsrFxn isrFxn, uint32_t coreIntrNum, uint32_t intrPriority)
Mailbox OASL Direct ISR register function prototype for R5F direct VIM registration.
Definition: mailbox_osal.h:162
Mbox_OsalDisableIntrFxn disableIntr
Definition: mailbox_osal.h:190
void(* Mbox_OsalEnableIntrFxn)(uint32_t coreIntrNum)
Mailbox OSAL intr disable function prototype.
Definition: mailbox_osal.h:86
Mailbox driver OSAL function pointers.
Definition: mailbox_osal.h:182
Mbox_OsalMutexUnlockFxn unlockMutex
Definition: mailbox_osal.h:199
void(* Mbox_OsalMutexDeleteFxn)(void *mutexHandle)
Mailbox OSAL mutex delete function prototype.
Definition: mailbox_osal.h:107
Mbox_OsalRestoreAllIntrFxn restoreAllIntr
Definition: mailbox_osal.h:186
Mbox_OsalDisableAllIntrFxn disableAllIntr
Definition: mailbox_osal.h:184
Mbox_OsalMutexCreateFxn createMutex
Definition: mailbox_osal.h:193
Mbox_OsalEnableIntrFxn enableIntr
Definition: mailbox_osal.h:188
int32_t(* Mbox_OsalMutexLockFxn)(void *mutexHandle, uint32_t timeout)
Mailbox OSAL mutex lock function prototype.
Definition: mailbox_osal.h:114
void MboxOsalPrms_init(Mbox_OsalPrms *osalPrms)
Mbox_OsalPrms structure init function.
void(* Mbox_OsalIsrFxn)(uintptr_t arg)
Mailbox OSAL ISR callback function prototype.
Definition: mailbox_osal.h:128
Mbox_OsalUnRegisterIntrFxn unRegisterIntr
Definition: mailbox_osal.h:206
void *(* Mbox_OsalRegisterIntrFxn)(Mbox_OsalIsrFxn isrFxn, uint32_t coreIntrNum, uint32_t intrPriority, void *arg, char *name)
Mailbox OSAL ISR register function prototype.
Definition: mailbox_osal.h:146
void *(* Mbox_OsalMutexCreateFxn)(void)
Mailbox OSAL mutex create function prototype to protect critical section.
Definition: mailbox_osal.h:100
uintptr_t(* Mbox_OsalDisableAllIntrFxn)(void)
Mailbox OSAL interrupt disable function prototype.
Definition: mailbox_osal.h:72
void(* Mbox_OsalDisableIntrFxn)(uint32_t coreIntrNum)
Mailbox OSAL intr disable function prototype.
Definition: mailbox_osal.h:93
void(* Mbox_OsalRestoreAllIntrFxn)(uintptr_t cookie)
Mailbox OSAL interrupt restore function prototype.
Definition: mailbox_osal.h:79
void(* Mbox_OsalDirectIsrFxn)(void)
Mailbox OSAL Direct ISR callback function prototype.
Definition: mailbox_osal.h:133
Mbox_OsalMutexLockFxn lockMutex
Definition: mailbox_osal.h:197