AM243x MCU+ SDK  10.00.00
sdl_interrupt.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2017 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 
100 /* ========================================================================== */
101 /* Structures and Enums */
102 /* ========================================================================== */
110 typedef struct
111 {
145 
146 /* ========================================================================== */
147 /* Function Declarations */
148 /* ========================================================================== */
149 __attribute__((interrupt("UNDEF"), section(".text.hwi"), aligned(32))) void undefInstructionExptnHandler(void);
150 __attribute__((interrupt("SWI"), section(".text.hwi"), aligned(32))) void swIntrExptnHandler(void);
151 __attribute__((interrupt("ABORT"), section(".text.hwi"), aligned(32))) void prefetchAbortExptnHandler(void);
152 __attribute__((interrupt("ABORT"), section(".text.hwi"), aligned(32))) void dataAbortExptnHandler(void);
153 __attribute__((interrupt("IRQ"), section(".text.hwi"), aligned(32))) void irqExptnHandler(void);
154 __attribute__((interrupt("FIQ"), section(".text.hwi"), aligned(32))) void fiqExptnHandler(void);
155 
159 void Intc_SystemEnable(void);
160 
167 uintptr_t Intc_SystemDisable(void);
168 
178 void Intc_SystemRestore(uintptr_t cookie);
179 
189 
198 
199 #ifdef __cplusplus
200 }
201 #endif
202 #endif
203 /********************************* 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
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