From 71d36e61184b2ce24ce6ec699c16a2d770612f62 Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Fri, 19 Jul 2013 19:20:16 -0700 Subject: [arch][arm-m] properly bump the critical section count before fatal exceptions --- arch/arm/arm-m/exceptions.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/arm-m/exceptions.c b/arch/arm/arm-m/exceptions.c index b8a8d44b..b8c19644 100644 --- a/arch/arm/arm-m/exceptions.c +++ b/arch/arm/arm-m/exceptions.c @@ -23,6 +23,7 @@ #include #include #include +#include #include static void dump_frame(const struct arm_cm_exception_frame *frame) @@ -40,6 +41,7 @@ static void dump_frame(const struct arm_cm_exception_frame *frame) static void hardfault(struct arm_cm_exception_frame *frame) { + inc_critical_section(); printf("hardfault: "); dump_frame(frame); @@ -50,6 +52,7 @@ static void hardfault(struct arm_cm_exception_frame *frame) static void usagefault(struct arm_cm_exception_frame *frame) { + inc_critical_section(); printf("usagefault: "); dump_frame(frame); @@ -58,6 +61,7 @@ static void usagefault(struct arm_cm_exception_frame *frame) static void busfault(struct arm_cm_exception_frame *frame) { + inc_critical_section(); printf("busfault: "); dump_frame(frame); @@ -68,6 +72,7 @@ static void busfault(struct arm_cm_exception_frame *frame) void _nmi(void) { + inc_critical_section(); printf("nmi\n"); halt(); } @@ -85,6 +90,7 @@ __NAKED void _hardfault(void) void _memmanage(void) { + inc_critical_section(); printf("memmanage\n"); halt(); } @@ -114,6 +120,7 @@ void _usagefault(void) /* systick handler */ void __WEAK _systick(void) { + inc_critical_section(); printf("systick\n"); halt(); } -- cgit v1.2.3