µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
exception-handlers.h
Go to the documentation of this file.
1/*
2 * This file is part of the µOS++ distribution.
3 * (https://github.com/micro-os-plus)
4 * Copyright (c) 2015 Liviu Ionescu.
5 *
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use,
10 * copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom
12 * the Software is furnished to do so, subject to the following
13 * conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */
27
28#ifndef CMSIS_PLUS_CORTEXM_EXCEPTION_HANDLERS_H_
29#define CMSIS_PLUS_CORTEXM_EXCEPTION_HANDLERS_H_
30
31#include <stdint.h>
32
33#if defined(DEBUG)
34#define __DEBUG_BKPT() asm volatile ("bkpt 0")
35#endif
36
37// ----------------------------------------------------------------------------
38
39#if defined(__cplusplus)
40extern "C"
41{
42#endif
43
44 extern void
45 Reset_Handler (void);
46
47 extern void
48 NMI_Handler (void);
49
50 extern void
52
53#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
54
55 extern void
56 MemManage_Handler (void);
57
58 extern void
59 BusFault_Handler (void);
60
61 extern void
62 UsageFault_Handler (void);
63
64 extern void
65 DebugMon_Handler (void);
66
67#endif
68
69 extern void
70 SVC_Handler (void);
71
72 extern void
73 PendSV_Handler (void);
74
75 extern void
76 SysTick_Handler (void);
77
78 // Exception Stack Frame for the Cortex-M3 and Cortex-M4 processor.
80 {
81 uint32_t r0;
82 uint32_t r1;
83 uint32_t r2;
84 uint32_t r3;
85 uint32_t r12;
86 uint32_t lr;
87 uint32_t pc;
88 uint32_t psr;
89#if defined(__ARM_ARCH_7EM__)
90 uint32_t s[16];
91#endif
93
94#if defined(TRACE)
95#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
96 void
97 dump_exception_stack (exception_stack_frame_t* frame, uint32_t cfsr,
98 uint32_t mmfar, uint32_t bfar, uint32_t lr);
99#endif // defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
100#if defined(__ARM_ARCH_6M__)
101 void
102 dump_exception_stack (exception_stack_frame_t* frame, uint32_t lr);
103#endif // defined(__ARM_ARCH_6M__)
104#endif // defined(TRACE)
105
106 void
108
109#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
110
111 void
112 UsageFault_Handler_C (exception_stack_frame_t* frame, uint32_t lr);
113
114 void
115 BusFault_Handler_C (exception_stack_frame_t* frame, uint32_t lr);
116
117#endif // defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
118
119#if defined(__cplusplus)
120}
121#endif
122
123// ----------------------------------------------------------------------------
124
125#endif /* CMSIS_PLUS_CORTEXM_EXCEPTION_HANDLERS_H_ */
void HardFault_Handler(void)
void SVC_Handler(void)
void HardFault_Handler_C(exception_stack_frame_t *frame, uint32_t lr)
void PendSV_Handler(void)
void NMI_Handler(void)
void SysTick_Handler(void)
void Reset_Handler(void)
struct exception_stack_frame_s exception_stack_frame_t