µ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-2023 Liviu Ionescu. All rights reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software
7 * for any purpose is hereby granted, under the terms of the MIT license.
8 *
9 * If a copy of the license was not distributed with this file, it can
10 * be obtained from https://opensource.org/licenses/mit/.
11 */
12
13#ifndef CMSIS_PLUS_CORTEXM_EXCEPTION_HANDLERS_H_
14#define CMSIS_PLUS_CORTEXM_EXCEPTION_HANDLERS_H_
15
16#include <stdint.h>
17
18#if defined(DEBUG)
19#define __DEBUG_BKPT() __asm__ volatile ("bkpt 0")
20#endif
21
22// ----------------------------------------------------------------------------
23
24#if defined(__cplusplus)
25extern "C"
26{
27#endif
28
29 extern void
30 Reset_Handler (void);
31
32 extern void
33 NMI_Handler (void);
34
35 extern void
37
38#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
39
40 extern void
41 MemManage_Handler (void);
42
43 extern void
44 BusFault_Handler (void);
45
46 extern void
47 UsageFault_Handler (void);
48
49 extern void
50 DebugMon_Handler (void);
51
52#endif
53
54 extern void
55 SVC_Handler (void);
56
57 extern void
58 PendSV_Handler (void);
59
60 extern void
61 SysTick_Handler (void);
62
63 // Exception Stack Frame for the Cortex-M3 and Cortex-M4 processor.
65 {
66 uint32_t r0;
67 uint32_t r1;
68 uint32_t r2;
69 uint32_t r3;
70 uint32_t r12;
71 uint32_t lr;
72 uint32_t pc;
73 uint32_t psr;
74#if defined(__ARM_ARCH_7EM__)
75 uint32_t s[16];
76#endif
78
79#if defined(TRACE)
80#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
81 void
82 dump_exception_stack (exception_stack_frame_t* frame, uint32_t cfsr,
83 uint32_t mmfar, uint32_t bfar, uint32_t lr);
84#endif // defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
85#if defined(__ARM_ARCH_6M__)
86 void
87 dump_exception_stack (exception_stack_frame_t* frame, uint32_t lr);
88#endif // defined(__ARM_ARCH_6M__)
89#endif // defined(TRACE)
90
91 void
93
94#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
95
96 void
97 UsageFault_Handler_C (exception_stack_frame_t* frame, uint32_t lr);
98
99 void
100 BusFault_Handler_C (exception_stack_frame_t* frame, uint32_t lr);
101
102#endif // defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
103
104#if defined(__cplusplus)
105}
106#endif
107
108// ----------------------------------------------------------------------------
109
110#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