AM62D FreeRTOS SDK  11.01.00
sdl_interrupt.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2025 Texas Instruments Incorporated - https://www.ti.com/
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  */
33 
61 /* ========================================================================== */
62 /* Include Files */
63 /* ========================================================================== */
64 #ifndef INTERRUPT_H
65 #define INTERRUPT_H
66 
67 #include <stdint.h>
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
73 /* ========================================================================== */
74 /* Macros */
75 /* ========================================================================== */
76 typedef void (*IntrFuncPtr)(void *ptr);
77 typedef void (*exptnHandlerPtr)(void *ptr);
78 
86 #define EXCEPTION_R5_RESET (0U)
87 
88 #define EXCEPTION_R5_UNDEF_INSTR (1U)
89 
90 #define EXCEPTION_R5_SW_INTR (2U)
91 
92 #define EXCEPTION_R5_ABORT_PREFETCH (3U)
93 
94 #define EXCEPTION_R5_ABORT_DATA (4U)
95 
96 #define EXCEPTION_R5_IRQ (5U)
97 
98 #define EXCEPTION_R5_FIQ (6U)
99 
101 #define R5_VIM_INTR_NUM (256U)
102 
104 #define SDL_MCU_DOMAIN_VIM_BASE_ADDR (0x0007FF0000u)
105 #define SDL_MCU_DOMAIN_VIM_BASE_ADDR0 SDL_MCU_DOMAIN_VIM_BASE_ADDR
106 #define SDL_MCU_DOMAIN_VIM_BASE_ADDR1 SDL_MCU_DOMAIN_VIM_BASE_ADDR
107 
108 /* ========================================================================== */
109 /* Structures and Enums */
110 /* ========================================================================== */
118 typedef struct
119 {
153 
154 /* ========================================================================== */
155 /* Function Declarations */
156 /* ========================================================================== */
157 __attribute__((interrupt("UNDEF"), section(".text.hwi"), aligned(32))) void undefInstructionExptnHandler(void);
158 __attribute__((interrupt("SWI"), section(".text.hwi"), aligned(32))) void swIntrExptnHandler(void);
159 __attribute__((interrupt("ABORT"), section(".text.hwi"), aligned(32))) void prefetchAbortExptnHandler(void);
160 __attribute__((interrupt("ABORT"), section(".text.hwi"), aligned(32))) void dataAbortExptnHandler(void);
161 __attribute__((interrupt("IRQ"), section(".text.hwi"), aligned(32))) void irqExptnHandler(void);
162 __attribute__((interrupt("FIQ"), section(".text.hwi"), aligned(32))) void fiqExptnHandler(void);
163 
167 void Intc_SystemEnable(void);
168 
175 uintptr_t Intc_SystemDisable(void);
176 
186 void Intc_SystemRestore(uintptr_t cookie);
187 
197 
206 
207 #ifdef __cplusplus
208 }
209 #endif
210 #endif
211 /********************************* End of file ******************************/
SDL_R5ExptnHandlers::swiExptnHandlerArgs
void * swiExptnHandlerArgs
Definition: sdl_interrupt.h:126
SDL_R5ExptnHandlers::pabtExptnHandlerArgs
void * pabtExptnHandlerArgs
Definition: sdl_interrupt.h:130
SDL_R5ExptnHandlers
Structure containing the Exception Handlers. If application does not want register an exception handl...
Definition: sdl_interrupt.h:119
__attribute__
__attribute__((interrupt("UNDEF"), section(".text.hwi"), aligned(32))) void undefInstructionExptnHandler(void)
IntrFuncPtr
void(* IntrFuncPtr)(void *ptr)
Definition: sdl_interrupt.h:76
SDL_R5ExptnHandlers::swiExptnHandler
exptnHandlerPtr swiExptnHandler
Definition: sdl_interrupt.h:124
SDL_R5ExptnHandlers::pabtExptnHandler
exptnHandlerPtr pabtExptnHandler
Definition: sdl_interrupt.h:128
Intc_SystemRestore
void Intc_SystemRestore(uintptr_t cookie)
This function enables the Cortex-R5's IRQ and FIQ interrupts This can be called after Intc_SystemDisa...
SDL_R5ExptnHandlers::dabtExptnHandlerArgs
void * dabtExptnHandlerArgs
Definition: sdl_interrupt.h:134
Intc_RegisterExptnHandlers
void Intc_RegisterExptnHandlers(const SDL_R5ExptnHandlers *handlers)
This function registers handlers for various exceptions.
SDL_R5ExptnHandlers::fiqExptnHandler
exptnHandlerPtr fiqExptnHandler
Definition: sdl_interrupt.h:144
SDL_R5ExptnHandlers::udefExptnHandlerArgs
void * udefExptnHandlerArgs
Definition: sdl_interrupt.h:122
SDL_R5ExptnHandlers::irqExptnHandlerArgs
void * irqExptnHandlerArgs
Definition: sdl_interrupt.h:140
exptnHandlerPtr
void(* exptnHandlerPtr)(void *ptr)
Definition: sdl_interrupt.h:77
SDL_R5ExptnHandlers::irqExptnHandler
exptnHandlerPtr irqExptnHandler
Definition: sdl_interrupt.h:136
Intc_InitExptnHandlers
void Intc_InitExptnHandlers(SDL_R5ExptnHandlers *handlers)
This function initializes exception handlers for various exceptions.
Intc_SystemEnable
void Intc_SystemEnable(void)
This function enables the Cortex-R5's IRQ and FIQ interrupts.
SDL_R5ExptnHandlers::udefExptnHandler
exptnHandlerPtr udefExptnHandler
Definition: sdl_interrupt.h:120
SDL_R5ExptnHandlers::dabtExptnHandler
exptnHandlerPtr dabtExptnHandler
Definition: sdl_interrupt.h:132
Intc_SystemDisable
uintptr_t Intc_SystemDisable(void)
This function disables the Cortex-R5's IRQ and FIQ interrupts.
SDL_R5ExptnHandlers::fiqExptnHandlerArgs
void * fiqExptnHandlerArgs
Definition: sdl_interrupt.h:148