kernel: fatal: Avoid thread api access when no multithreading
Remove access to thread API when multithreading is off. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
c482a572d4
commit
1ba23ca92b
1 changed files with 6 additions and 2 deletions
|
@ -98,7 +98,8 @@ void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
|
||||||
* appropriate.
|
* appropriate.
|
||||||
*/
|
*/
|
||||||
unsigned int key = arch_irq_lock();
|
unsigned int key = arch_irq_lock();
|
||||||
struct k_thread *thread = k_current_get();
|
struct k_thread *thread = IS_ENABLED(CONFIG_MULTITHREADING) ?
|
||||||
|
k_current_get() : NULL;
|
||||||
|
|
||||||
/* twister looks for the "ZEPHYR FATAL ERROR" string, don't
|
/* twister looks for the "ZEPHYR FATAL ERROR" string, don't
|
||||||
* change it without also updating twister
|
* change it without also updating twister
|
||||||
|
@ -179,5 +180,8 @@ void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
|
||||||
}
|
}
|
||||||
|
|
||||||
arch_irq_unlock(key);
|
arch_irq_unlock(key);
|
||||||
k_thread_abort(thread);
|
|
||||||
|
if (IS_ENABLED(CONFIG_MULTITHREADING)) {
|
||||||
|
k_thread_abort(thread);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue