nuttx-update/arch
hujun5 0e1b432dd0 armv7/8m: fix regresion from https://github.com/apache/nuttx/pull/14881
reason:
svc call may trigger hardfault

Background
    The origin of this issue is our desire to eliminate the function of storing
"regs" in g_current_regs and instead utilize (*running_task)->xcp.regs for storage.
The benefits of this approach include faster storage speed and
avoiding multiple accesses to g_current_regs during context switching,
thus ensuring that whether returning from an interrupt or an exception,
we consistently use this_task()->xcp.regs

Issue Encountered
    However, when storing registers, we must ensure that (running_task)->xcp.regs is invalid
so that it can be safely overwritten.
According to the existing logic, the only scenario where (running_task)->xcp.regs
is valid is during restore_context. We must accurately identify this scenario.
Initially, we used the condition (running_task)==NULL for this purpose, but we deemed
this approach unsatisfactory as it did not align well with the actual logic.
(running_task) should not be NULL. Consequently, we adopted other arch-specific methods for judgment,
but due to special logic in some arch, the judgment was not accurate, leading to this issue.

Solution:
    For armv6-m, we haven't found a more suitable solution, so we are sticking with (*running_task)==NULL.
    For armv7-m/armv8-m, by removing support for primask, we can achieve accurate judgment.

    PRIMASK is a design in armv6-m, that's why arm introduce BASEPRI from armv7-m.
It's wrong to provide this option for armv7-m/armv8-m arch.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-09 12:20:13 +08:00
..
arm armv7/8m: fix regresion from https://github.com/apache/nuttx/pull/14881 2024-12-09 12:20:13 +08:00
arm64 Remove FAR from 32/64bit arch 2024-12-05 22:55:39 +08:00
avr remove redundant judgments *running_task != NULL 2024-12-04 22:50:08 +08:00
ceva arch/ceva: migrate to SPDX identifier 2024-12-02 22:43:23 +08:00
dummy arch: Add custom arch chip build support 2020-10-20 14:48:16 +08:00
hc remove redundant judgments *running_task != NULL 2024-12-04 22:50:08 +08:00
mips addrenv: Ensure that the transmission parameter of addrenv_switch is not NULL 2024-12-04 14:20:12 +08:00
misoc addrenv: Ensure that the transmission parameter of addrenv_switch is not NULL 2024-12-04 14:20:12 +08:00
or1k remove redundant judgments *running_task != NULL 2024-12-04 22:50:08 +08:00
renesas remove redundant judgments *running_task != NULL 2024-12-04 22:50:08 +08:00
risc-v esp32[c3|c6|h2]: Add nxdiag without esptool wrapper 2024-12-07 11:45:59 +08:00
sim cmake(bugfix):fix CMake build break on MacOS 2024-12-05 23:36:16 +08:00
sparc addrenv: Ensure that the transmission parameter of addrenv_switch is not NULL 2024-12-04 14:20:12 +08:00
tricore debug symbol level: Use config instead 2024-12-04 22:36:45 +08:00
x86 remove redundant judgments *running_task != NULL 2024-12-04 22:50:08 +08:00
x86_64 remove redundant judgments *running_task != NULL 2024-12-04 22:50:08 +08:00
xtensa esp32[s2|s3]: Add nxdiag without esptool wrapper 2024-12-07 11:45:59 +08:00
z16 remove redundant judgments *running_task != NULL 2024-12-04 22:50:08 +08:00
z80 remove redundant judgments *running_task != NULL 2024-12-04 22:50:08 +08:00
CMakeLists.txt arch/z80: migrate to SPDX identifier 2024-12-02 17:23:25 +08:00
Kconfig armv7/8m: fix regresion from https://github.com/apache/nuttx/pull/14881 2024-12-09 12:20:13 +08:00