Skip to content

Commit

Permalink
hal: Add reboot on exception when NDEBUG to ia32, armv7a and sparcv9
Browse files Browse the repository at this point in the history
JIRA: RTOS-489
  • Loading branch information
agkaminski committed Jul 13, 2023
1 parent f3541ec commit 9747ffa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hal/armv7a/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ void exceptions_dispatch(unsigned int n, exc_context_t *ctx)
hal_exceptionsDumpContext(buff, ctx, n);
hal_consolePrint(buff);

#ifdef NDEBUG
hal_cpuReboot();
#endif

for (;;)
hal_cpuHalt();
}
5 changes: 5 additions & 0 deletions hal/ia32/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ static void exceptions_defaultHandler(unsigned int n, exc_context_t *ctx)
hal_consolePrint(buff);
hal_consolePrint("\033[0m");
hal_interruptsDisableAll();

#ifdef NDEBUG
hal_cpuReboot();
#endif

hal_cpuHalt();
}

Expand Down
4 changes: 4 additions & 0 deletions hal/sparcv8leon3/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ void exceptions_dispatch(unsigned int n, exc_context_t *ctx)
hal_exceptionsDumpContext(buff, ctx, n);
hal_consolePrint(buff);

#ifdef NDEBUG
hal_cpuReboot();
#endif

for (;;) {
hal_cpuHalt();
}
Expand Down

0 comments on commit 9747ffa

Please sign in to comment.