AM263Px MCU+ SDK: sdl_interrupt.h Source File

| AM263Px MCU+ SDK 26.00.00 |

sdl_interrupt.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2013-2025 Texas Instruments Incorporated - http://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
100 /* ========================================================================== */
101 /* Structures and Enums */
102 /* ========================================================================== */
110 typedef struct
111 {
112 exptnHandlerPtr udefExptnHandler;
114 void *udefExptnHandlerArgs;
116 exptnHandlerPtr swiExptnHandler;
118 void *swiExptnHandlerArgs;
120 exptnHandlerPtr pabtExptnHandler;
122 void *pabtExptnHandlerArgs;
124 exptnHandlerPtr dabtExptnHandler;
126 void *dabtExptnHandlerArgs;
128 exptnHandlerPtr irqExptnHandler;
132 void *irqExptnHandlerArgs;
136 exptnHandlerPtr fiqExptnHandler;
140 void *fiqExptnHandlerArgs;
144 }SDL_R5ExptnHandlers;
145
146 /* ========================================================================== */
147 /* Function Declarations */
148 /* ========================================================================== */
149 #if defined (SOC_AM263X) || defined (SOC_AM263PX) || defined (SOC_AM261X)
150 __attribute__((interrupt("UNDEF"), section(".text.hwi"), aligned(32))) void SDL_undefInstructionExptnHandler(void);
151 __attribute__((interrupt("SWI"), section(".text.hwi"), aligned(32))) void SDL_swIntrExptnHandler(void);
152 __attribute__((interrupt("ABORT"), section(".text.hwi"), aligned(32))) void SDL_prefetchAbortExptnHandler(void);
153 __attribute__((interrupt("ABORT"), section(".text.hwi"), aligned(32))) void SDL_dataAbortExptnHandler(void);
154 __attribute__((interrupt("IRQ"), section(".text.hwi"), aligned(32))) void SDL_irqExptnHandler(void);
155 __attribute__((interrupt("FIQ"), section(".text.hwi"), aligned(32))) void SDL_fiqExptnHandler(void);
156 #else
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 #endif
164
167 void Intc_SystemEnable(void);
168
175 uintptr_t Intc_SystemDisable(void);
176
186 void Intc_SystemRestore(uintptr_t cookie);
187
196 void Intc_InitExptnHandlers(SDL_R5ExptnHandlers *handlers);
197
205 void Intc_RegisterExptnHandlers(const SDL_R5ExptnHandlers *handlers);
206
207 #ifdef __cplusplus
208 }
209 #endif
210 #endif
211 /********************************* End of file ******************************/
SDL_R5ExptnHandlers::swiExptnHandlerArgs
void * swiExptnHandlerArgs
Definition: sdl_interrupt.h:118
SDL_R5ExptnHandlers::pabtExptnHandlerArgs
void * pabtExptnHandlerArgs
Definition: sdl_interrupt.h:122
SDL_R5ExptnHandlers
Structure containing the Exception Handlers. If application does not want register an exception handl...
Definition: sdl_interrupt.h:111
__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:116
SDL_R5ExptnHandlers::pabtExptnHandler
exptnHandlerPtr pabtExptnHandler
Definition: sdl_interrupt.h:120
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:126
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:136
SDL_R5ExptnHandlers::udefExptnHandlerArgs
void * udefExptnHandlerArgs
Definition: sdl_interrupt.h:114
SDL_R5ExptnHandlers::irqExptnHandlerArgs
void * irqExptnHandlerArgs
Definition: sdl_interrupt.h:132
exptnHandlerPtr
void(* exptnHandlerPtr)(void *ptr)
Definition: sdl_interrupt.h:77
SDL_R5ExptnHandlers::irqExptnHandler
exptnHandlerPtr irqExptnHandler
Definition: sdl_interrupt.h:128
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:112
__attribute__
EDMA Parameter RAM Set in User Configurable format This is a mapping of the EDMA PaRAM set provided t...
Definition: edma/v0/edma.h:392
SDL_R5ExptnHandlers::dabtExptnHandler
exptnHandlerPtr dabtExptnHandler
Definition: sdl_interrupt.h:124
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:140