Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel/os: Add default irq callback #3100

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions kernel/os/include/os/os_fault.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ void __assert_func(const char *file, int line, const char *func, const char *e)
typedef void (*coredump_cb_t)(void *tf);
#endif

#if MYNEWT_VAL(OS_DEFAULT_IRQ_CB)
void os_default_irq_cb(void);
#endif

#if MYNEWT_VAL(OS_CRASH_FILE_LINE)
#define OS_CRASH() (HAL_DEBUG_BREAK(), __assert_func(__FILE__, __LINE__, NULL, NULL))
#else
Expand Down
4 changes: 4 additions & 0 deletions kernel/os/src/arch/cortex_m33/os_fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ os_default_irq(struct trap_frame *tf)
uint32_t orig_sp;
#endif

#if MYNEWT_VAL(OS_DEFAULT_IRQ_CB)
os_default_irq_cb();
#endif

/* Stop MTB if implemented so interrupt handler execution is not recorded */
mtb_stop();

Expand Down
6 changes: 6 additions & 0 deletions kernel/os/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ syscfg.defs:
value: 0
restriction:
- 'OS_COREDUMP if 1'
OS_DEFAULT_IRQ_CB:
description: >
Calls a custom default irq callback function inside
os_default_irq. If enabled it is the first function
executed in os_default_irq.
value: 0
OS_CRASH_STACKTRACE:
description: 'Attempt to print stack trace when system crashes.'
value: 0
Expand Down