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.

pull/8332/head
Senthil Ramakrishnan 2018-10-04 16:26:47 -05:00
parent 0db896036c
commit e4525fbea1
5 changed files with 6 additions and 12 deletions

View File

@ -68,7 +68,6 @@ UsageFault_Handler\
Fault_Handler PROC
EXPORT Fault_Handler
#if (DOMAIN_NS == 1)
IMPORT osRtxInfo
IMPORT mbed_fault_handler
IMPORT mbed_fault_context
@ -152,7 +151,6 @@ Fault_Handler_Continue2
LDR R3,=mbed_fault_handler ; Load address of mbedFaultHandler
MOV R0,R12
LDR R1,=mbed_fault_context
LDR R2,=osRtxInfo
BLX R3
#endif
B . ; Just in case we come back here

View File

@ -184,7 +184,6 @@ Fault_Handler_Continue2:
LDR R3,=mbed_fault_handler // Load address of mbedFaultHandler
MOV R0,R12
LDR R1,=mbed_fault_context
LDR R2,=osRtxInfo
BLX R3
#endif
B . // Just in case we come back here

View File

@ -63,7 +63,6 @@ UsageFault_Handler
Fault_Handler
EXPORT Fault_Handler
#if (DOMAIN_NS == 1)
IMPORT osRtxInfo
IMPORT mbed_fault_context
IMPORT mbed_fault_handler
@ -147,7 +146,6 @@ Fault_Handler_Continue2
LDR R3,=mbed_fault_handler ; Load address of mbedFaultHandler
MOV R0,R12
LDR R1,=mbed_fault_context
LDR R2,=osRtxInfo
BLX R3
#endif
B . ; Just in case we come back here

View File

@ -14,13 +14,12 @@
* limitations under the License.
*/
#include "rtx_os.h"
#include "device.h"
#include "platform/mbed_error.h"
#include "platform/mbed_interface.h"
#ifndef MBED_FAULT_HANDLER_DISABLED
#include "mbed_rtx_fault_handler.h"
#include "mbed_fault_handler.h"
//Functions Prototypes
void print_context_info(void);
@ -30,7 +29,7 @@ mbed_fault_context_t mbed_fault_context;
//This is a handler function called from Fault handler to print the error information out.
//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.
void mbed_fault_handler (uint32_t fault_type, void *mbed_fault_context_in, void *osRtxInfoIn)
void mbed_fault_handler (uint32_t fault_type, void *mbed_fault_context_in)
{
mbed_error_status_t faultStatus = MBED_SUCCESS;

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MBED_RTX_FAULT_HANDLER_H
#define MBED_RTX_FAULT_HANDLER_H
#ifndef MBED_FAULT_HANDLER_H
#define MBED_FAULT_HANDLER_H
//Fault context struct
//WARNING: DO NOT CHANGE THIS STRUCT WITHOUT MAKING CORRESPONDING CHANGES in except.S files.
@ -52,7 +52,7 @@ typedef struct {
#define USAGE_FAULT_EXCEPTION (0x40)
//This is a handler function called from Fault handler to print the error information out.
//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.
void mbed_fault_handler (uint32_t fault_type, void *mbed_fault_context_in, void *osRtxInfoIn);
//This runs in fault context and uses special functions(defined in mbed_fault_handler.c) to print the information without using C-lib support.
void mbed_fault_handler (uint32_t fault_type, void *mbed_fault_context_in);
#endif