arm: cmsis: Convert _ScbIsInThreadMode to use direct CMSIS register access
Jira: ZEP-1568 Change-Id: Idc14817ce85042ec86bdf67b8939f783224329ff Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
5068e9657f
commit
772cbd1955
3 changed files with 2 additions and 17 deletions
|
@ -36,7 +36,7 @@ static void software_reboot(void)
|
|||
*/
|
||||
__asm__ volatile("cpsie i" :::);
|
||||
|
||||
if (_ScbIsInThreadMode()) {
|
||||
if ((SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) == 0) {
|
||||
_do_software_reboot();
|
||||
} else {
|
||||
__asm__ volatile(
|
||||
|
|
|
@ -35,7 +35,7 @@ void k_thread_abort(k_tid_t thread)
|
|||
_thread_monitor_exit(thread);
|
||||
|
||||
if (_current == thread) {
|
||||
if (_ScbIsInThreadMode()) {
|
||||
if ((SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) == 0) {
|
||||
_Swap(key);
|
||||
CODE_UNREACHABLE;
|
||||
} else {
|
||||
|
|
|
@ -51,21 +51,6 @@ extern "C" {
|
|||
#include <misc/util.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Find out if running in thread mode
|
||||
*
|
||||
* This routine determines if the current mode is thread mode.
|
||||
*
|
||||
* @return 1 if in thread mode, 0 otherwise
|
||||
*/
|
||||
|
||||
static inline int _ScbIsInThreadMode(void)
|
||||
{
|
||||
/* 0 == thread mode */
|
||||
return !__scs.scb.icsr.bit.vectactive;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Obtain the currently executing vector
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue