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 
74 void reset_handler_default(void);
75 
83 void nmi_default(void);
84 
92 void hard_fault_default(void);
93 
94 /* The following four exceptions are only present for Cortex-M3 and -M4 CPUs */
95 #if defined(CPU_CORE_CORTEX_M3) || defined(CPU_CORE_CORTEX_M4) || \
96  defined(CPU_CORE_CORTEX_M4F) || defined(CPU_CORE_CORTEX_M7)
97 
103 void mem_manage_default(void);
104 
110 void bus_fault_default(void);
111 
119 void usage_fault_default(void);
120 
127 void debug_mon_default(void);
128 #endif
129 
138 void dummy_handler_default(void);
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif /* VECTORS_CORTEXM_H */
145 
dummy_handler_default
void dummy_handler_default(void)
Default handler used as weak alias for not implemented ISR vectors.
hard_fault_default
void hard_fault_default(void)
Hard fault exception handler.
cortexm_base_t
Structure of Cortex-M basic vector table.
Definition: vectors_cortexm.h:59
CPU_NONISR_EXCEPTIONS
#define CPU_NONISR_EXCEPTIONS
Number of Cortex-M non-ISR exceptions.
Definition: vectors_cortexm.h:49
reset_handler_default
void reset_handler_default(void)
This function is the default entry point after a system reset.
isr_t
void(* isr_t)(void)
All ISR functions have this type.
Definition: vectors_cortexm.h:54
nmi_default
void nmi_default(void)
Non-maskable interrupt handler.
cortexm_base_t::_estack
void * _estack
exception stack pointer
Definition: vectors_cortexm.h:60