Skip to content

Commit e4525fb

Browse files
committed
Mbed Fault Handler was originally placed under rtos folder because of its dependency on some of the RTX data structures for capturing the thread info. But with the new error handling in place thread info collection on hardfaults has been moved to Mbed_error handler. There is no point for fault handler implementation to exist under rtos and can be used for RTOS-less builds as well. So moving under platform folder. Also removing some references to RTX data structs like osRtxInfo from fault handler implementation.
1 parent 0db8960 commit e4525fb

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

rtos/TARGET_CORTEX/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.S renamed to platform/TARGET_CORTEX/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ UsageFault_Handler\
6868
Fault_Handler PROC
6969
EXPORT Fault_Handler
7070
#if (DOMAIN_NS == 1)
71-
IMPORT osRtxInfo
7271
IMPORT mbed_fault_handler
7372
IMPORT mbed_fault_context
7473
@@ -152,7 +151,6 @@ Fault_Handler_Continue2
152151
LDR R3,=mbed_fault_handler ; Load address of mbedFaultHandler
153152
MOV R0,R12
154153
LDR R1,=mbed_fault_context
155-
LDR R2,=osRtxInfo
156154
BLX R3
157155
#endif
158156
B . ; Just in case we come back here

rtos/TARGET_CORTEX/TARGET_CORTEX_M/TOOLCHAIN_GCC/except.S renamed to platform/TARGET_CORTEX/TARGET_CORTEX_M/TOOLCHAIN_GCC/except.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ Fault_Handler_Continue2:
184184
LDR R3,=mbed_fault_handler // Load address of mbedFaultHandler
185185
MOV R0,R12
186186
LDR R1,=mbed_fault_context
187-
LDR R2,=osRtxInfo
188187
BLX R3
189188
#endif
190189
B . // Just in case we come back here

rtos/TARGET_CORTEX/TARGET_CORTEX_M/TOOLCHAIN_IAR/except.S renamed to platform/TARGET_CORTEX/TARGET_CORTEX_M/TOOLCHAIN_IAR/except.S

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ UsageFault_Handler
6363
Fault_Handler
6464
EXPORT Fault_Handler
6565
#if (DOMAIN_NS == 1)
66-
IMPORT osRtxInfo
6766
IMPORT mbed_fault_context
6867
IMPORT mbed_fault_handler
6968
@@ -147,7 +146,6 @@ Fault_Handler_Continue2
147146
LDR R3,=mbed_fault_handler ; Load address of mbedFaultHandler
148147
MOV R0,R12
149148
LDR R1,=mbed_fault_context
150-
LDR R2,=osRtxInfo
151149
BLX R3
152150
#endif
153151
B . ; Just in case we come back here

rtos/TARGET_CORTEX/TARGET_CORTEX_M/mbed_rtx_fault_handler.c renamed to platform/TARGET_CORTEX/TARGET_CORTEX_M/mbed_fault_handler.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "rtx_os.h"
1817
#include "device.h"
1918
#include "platform/mbed_error.h"
2019
#include "platform/mbed_interface.h"
2120

2221
#ifndef MBED_FAULT_HANDLER_DISABLED
23-
#include "mbed_rtx_fault_handler.h"
22+
#include "mbed_fault_handler.h"
2423

2524
//Functions Prototypes
2625
void print_context_info(void);
@@ -30,7 +29,7 @@ mbed_fault_context_t mbed_fault_context;
3029

3130
//This is a handler function called from Fault handler to print the error information out.
3231
//This runs in fault context and uses special functions(defined in mbed_rtx_fault_handler.c) to print the information without using C-lib support.
33-
void mbed_fault_handler (uint32_t fault_type, void *mbed_fault_context_in, void *osRtxInfoIn)
32+
void mbed_fault_handler (uint32_t fault_type, void *mbed_fault_context_in)
3433
{
3534
mbed_error_status_t faultStatus = MBED_SUCCESS;
3635

rtos/TARGET_CORTEX/TARGET_CORTEX_M/mbed_rtx_fault_handler.h renamed to platform/TARGET_CORTEX/TARGET_CORTEX_M/mbed_fault_handler.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifndef MBED_RTX_FAULT_HANDLER_H
18-
#define MBED_RTX_FAULT_HANDLER_H
17+
#ifndef MBED_FAULT_HANDLER_H
18+
#define MBED_FAULT_HANDLER_H
1919

2020
//Fault context struct
2121
//WARNING: DO NOT CHANGE THIS STRUCT WITHOUT MAKING CORRESPONDING CHANGES in except.S files.
@@ -52,7 +52,7 @@ typedef struct {
5252
#define USAGE_FAULT_EXCEPTION (0x40)
5353

5454
//This is a handler function called from Fault handler to print the error information out.
55-
//This runs in fault context and uses special functions(defined in mbed_rtx_fault_handler.c) to print the information without using C-lib support.
56-
void mbed_fault_handler (uint32_t fault_type, void *mbed_fault_context_in, void *osRtxInfoIn);
55+
//This runs in fault context and uses special functions(defined in mbed_fault_handler.c) to print the information without using C-lib support.
56+
void mbed_fault_handler (uint32_t fault_type, void *mbed_fault_context_in);
5757

5858
#endif

0 commit comments

Comments
 (0)