vectors_cortexm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef VECTORS_CORTEXM_H
20 #define VECTORS_CORTEXM_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include "cpu_conf.h"
27 
32 #define WEAK_DEFAULT __attribute__((weak,alias("dummy_handler")))
33 
41 #define ISR_VECTOR(x) __attribute__((used,section(".vectors." # x )))
42 
49 #define CPU_NONISR_EXCEPTIONS (15)
50 
54 typedef void (*isr_t)(void);
55 
59 typedef struct {
60  void* _estack;
63 
64 /* get the start of the ISR stack as defined in the linkerscript */
65 extern uint32_t _estack;
76 void reset_handler_default(void);
77 
85 void nmi_default(void);
86 
94 void hard_fault_default(void);
95 
96 /* The following four exceptions are only present for Cortex-M3 and -M4 CPUs */
97 #if defined(CPU_ARCH_CORTEX_M3) || defined(CPU_ARCH_CORTEX_M4) || \
98  defined(CPU_ARCH_CORTEX_M4F) || defined(CPU_ARCH_CORTEX_M7)
99 
105 void mem_manage_default(void);
106 
112 void bus_fault_default(void);
113 
121 void usage_fault_default(void);
122 
129 void debug_mon_default(void);
130 #endif
131 
140 void dummy_handler_default(void);
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif /* VECTORS_CORTEXM_H */
147 
void * _estack
exception stack pointer
void reset_handler_default(void)
This function is the default entry point after a system reset.
uint32_t _estack
memory markers as defined in the linker script
Structure of Cortex-M basic vector table.
void(* isr_t)(void)
All ISR functions have this type.
void hard_fault_default(void)
Hard fault exception handler.
void nmi_default(void)
Non-maskable interrupt handler.
void dummy_handler_default(void)
Default handler used as weak alias for not implemented ISR vectors.
#define CPU_NONISR_EXCEPTIONS
Number of Cortex-M non-ISR exceptions.