SDL API Guide for J7200
sdl_osal.h
Go to the documentation of this file.
1 /* Copyright (C) 2021 Texas Instruments Incorporated.
2  *
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions
5  * are met:
6  *
7  * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  *
10  * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the
13  * distribution.
14  *
15  * Neither the name of Texas Instruments Incorporated nor the names of
16  * its contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
43 #ifndef SDL_OSAL_H_
44 #define SDL_OSAL_H_
45 
46 #include <stdint.h>
47 #include "sdl_types.h"
48 
65 // Data Structures and Types
66 
71 typedef void (*pSDL_OSAL_interruptCallbackFunction)(uintptr_t arg);
72 
78 typedef struct SDL_OSAL_hwipParams_s
79 {
80  int32_t intNum;
84  uintptr_t callbackArg;
87 
88 typedef void* pSDL_OSAL_hwipHandle;
89 
94 typedef int32_t (*pSDL_OSAL_interruptFunction)(int32_t intNum);
95 
101 
107 
112 typedef int32_t (*pSDL_OSAL_globalDisableInterruptsFunction)(uintptr_t *key);
113 
118 typedef int32_t (*pSDL_OSAL_globalRestoreInterruptsFunction)(uintptr_t key);
119 
124 typedef void (*pSDL_OSAL_printFunction)(const char *traceBuf);
125 
130 typedef int32_t (*pSDL_OSAL_delayFunction)(int32_t ndelay);
131 
135 typedef void* (*pSDL_OSAL_addrTranslateFunction)(uint64_t addr, uint32_t size);
136 
142 typedef struct SDL_OSAL_Interface_s
143 {
163 
166 // Functions
167 
188 int32_t SDL_OSAL_init(SDL_OSAL_Interface *osalInterface);
189 
202 int32_t SDL_OSAL_enableInterrupt(int32_t intNum);
203 
216 int32_t SDL_OSAL_disableInterrupt(int32_t intNum);
217 
232 
246 
264 int32_t SDL_OSAL_globalDisableInterrupts(uintptr_t *key);
265 
281 int32_t SDL_OSAL_globalRestoreInterrupts(uintptr_t key);
282 
292 void SDL_OSAL_printf(const char *traceBuf);
293 
307 int32_t SDL_OSAL_delay(int32_t ndelay);
308 
321 void *SDL_OSAL_addrTranslate(uint64_t addr, uint32_t size);
322 
325 #endif /* SDL_OSAL_H_ */
pSDL_OSAL_printFunction printFxn
Definition: sdl_osal.h:157
int32_t SDL_OSAL_globalDisableInterrupts(uintptr_t *key)
OSAL globally disable interrupts.
void(* pSDL_OSAL_interruptCallbackFunction)(uintptr_t arg)
Prototype for the interrupt callback function
Definition: sdl_osal.h:71
int32_t SDL_OSAL_init(SDL_OSAL_Interface *osalInterface)
OSAL init.
int32_t SDL_OSAL_enableInterrupt(int32_t intNum)
OSAL enable interrupt.
void * SDL_OSAL_addrTranslate(uint64_t addr, uint32_t size)
OSAL Address translation function.
pSDL_OSAL_deregisterFunction deregisterInterrupt
Definition: sdl_osal.h:151
pSDL_OSAL_delayFunction delay
Definition: sdl_osal.h:159
pSDL_OSAL_interruptFunction disableInterrupt
Definition: sdl_osal.h:147
pSDL_OSAL_hwipHandle(* pSDL_OSAL_registerFunction)(SDL_OSAL_hwipParams *pParams)
Prototype for the interrupt registration function
Definition: sdl_osal.h:100
int32_t SDL_OSAL_disableInterrupt(int32_t intNum)
OSAL disable interrupt.
pSDL_OSAL_addrTranslateFunction addrTranslate
Definition: sdl_osal.h:161
pSDL_OSAL_registerFunction registerInterrupt
Definition: sdl_osal.h:149
int32_t(* pSDL_OSAL_globalDisableInterruptsFunction)(uintptr_t *key)
Prototype for the interrupt global disable function
Definition: sdl_osal.h:112
uintptr_t callbackArg
Definition: sdl_osal.h:84
int32_t(* pSDL_OSAL_delayFunction)(int32_t ndelay)
Prototype for the delay function
Definition: sdl_osal.h:130
This structure contains the parameters for interrupt registration through the SDL OSAL interface...
Definition: sdl_osal.h:78
pSDL_OSAL_globalRestoreInterruptsFunction globalRestoreInterrupts
Definition: sdl_osal.h:155
void *(* pSDL_OSAL_addrTranslateFunction)(uint64_t addr, uint32_t size)
Prototype for address translation function.
Definition: sdl_osal.h:135
pSDL_OSAL_interruptFunction enableInterrupt
Definition: sdl_osal.h:145
int32_t intNum
Definition: sdl_osal.h:80
This structure contains the pointers for the OSAL interfaces provided by the application to SDL_OSAL_...
Definition: sdl_osal.h:142
int32_t SDL_OSAL_deregisterInterrupt(pSDL_OSAL_hwipHandle handle)
OSAL deregister interrupt.
int32_t SDL_OSAL_globalRestoreInterrupts(uintptr_t key)
OSAL globally enable interrupts.
int32_t(* pSDL_OSAL_globalRestoreInterruptsFunction)(uintptr_t key)
Prototype for the interrupt global restore function
Definition: sdl_osal.h:118
void(* pSDL_OSAL_printFunction)(const char *traceBuf)
Prototype for the print function
Definition: sdl_osal.h:124
int32_t SDL_OSAL_registerInterrupt(SDL_OSAL_hwipParams *pParams, pSDL_OSAL_hwipHandle *handle)
OSAL register interrupt.
void SDL_OSAL_printf(const char *traceBuf)
OSAL print function.
pSDL_OSAL_interruptCallbackFunction callback
Definition: sdl_osal.h:82
void * pSDL_OSAL_hwipHandle
Definition: sdl_osal.h:88
pSDL_OSAL_globalDisableInterruptsFunction globalDisableInterrupts
Definition: sdl_osal.h:153
int32_t SDL_OSAL_delay(int32_t ndelay)
OSAL delay.
int32_t(* pSDL_OSAL_interruptFunction)(int32_t intNum)
Prototype for the interrupt enable/disable functions
Definition: sdl_osal.h:94
int32_t(* pSDL_OSAL_deregisterFunction)(pSDL_OSAL_hwipHandle handle)
Prototype for the interrupt de-register function
Definition: sdl_osal.h:106