Read-Write Mirror of Apache NuttX RTOS
Find a file
hujun5 16b63ed837 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 21:20:06 +08:00
.github build(deps): bump codelytv/pr-size-labeler from 1.10.1 to 1.10.2 2024-11-25 13:37:09 +08:00
arch armv7/8m: fix regresion from https://github.com/apache/nuttx/pull/14881 2024-12-09 21:20:06 +08:00
audio Fix some minor style issues 2024-11-20 10:51:07 +01:00
binfmt binfmt: migrate to SPDX identifier 2024-11-05 20:44:29 +08:00
boards armv7/8m: fix regresion from https://github.com/apache/nuttx/pull/14881 2024-12-09 21:20:06 +08:00
cmake cmake(enhance):Enhance romfs so that RAWS files can be added in any location 2024-12-02 19:59:02 +08:00
crypto crypto: migrate to SPDX identifier 2024-11-06 20:10:37 +08:00
Documentation Remove FAR from 32/64bit arch 2024-12-05 22:55:39 +08:00
drivers pci: fix pci dev alloc bridge mem error 2024-12-06 21:12:24 +08:00
dummy build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs arch_atomic: only support atomic_xx and atomic64_xx function 2024-12-04 14:03:14 +01:00
graphics move readv/writev to the kernel 2024-10-30 17:07:54 +08:00
include pci: fix pci dev alloc bridge mem error 2024-12-06 21:12:24 +08:00
libs Remove FAR from 32/64bit arch 2024-12-05 22:55:39 +08:00
mm kasan/lto: Turn off lto by default anyway 2024-12-05 20:36:37 +08:00
net net: Move NET_TCP/UDP_HAVE_STACK to netconfig.h 2024-11-21 23:07:30 +08:00
openamp Remove all jira and changeid information from the kernel 2024-11-06 02:04:03 +08:00
pass1 Revert "build depend:Revert Make.dep intermediate ddc file" 2024-09-15 19:29:47 +08:00
sched addrenv: Ensure that the transmission parameter of addrenv_switch is not NULL 2024-12-04 14:20:12 +08:00
syscall Revert "system: pthread_barrierwait should be moved to kernel space" 2024-11-15 22:07:25 +08:00
tools kasan/globals: fix compile error 2024-12-05 20:37:47 +08:00
video Revert "build depend:Revert Make.dep intermediate ddc file" 2024-09-15 19:29:47 +08:00
wireless drivers/net: change netdev_lower_quota_load to macro. 2024-12-05 13:26:22 +08:00
.asf.yaml feat: add a GitHub action to lint the YAML files 2020-12-15 09:52:04 -06:00
.gitignore tools/imx9: Add norimage support to bootloader 2024-11-22 18:53:21 +08:00
.pre-commit-config.yaml Created pre-commit config file 2024-08-19 21:40:56 +02:00
.yamllint feat: add a GitHub action to lint the YAML files 2020-12-15 09:52:04 -06:00
AUTHORS AUTHORS: add Yamamoto Takashi 2024-11-04 22:29:22 +08:00
CMakeLists.txt cmake(enhance):Enhance romfs so that RAWS files can be added in any location 2024-12-02 19:59:02 +08:00
CONTRIBUTING.md Contributing and PR template fix. 2024-10-12 08:12:05 +08:00
INVIOLABLES.md INVIOLABLES.md: Fix a simple alignment and change occurrences of Nuttx 2020-09-03 01:33:05 +08:00
Kconfig debug symbol level: Use config instead 2024-12-04 22:36:45 +08:00
LICENSE libc string:Separate code. 2024-10-23 09:49:19 +08:00
Makefile tools: migrate to SPDX identifier 2024-09-10 23:11:11 +08:00
NOTICE Remove the double blank line from source files 2022-02-20 20:10:14 +01:00
README.md Gathering community recommendations 2023-10-28 13:55:56 +08:00
ReleaseNotes Documentation: move ReleaseNotes 2023-09-26 20:41:00 +08:00

POSIX Badge License Issues Tracking Badge Contributors GitHub Build Badge Documentation Badge

Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).

For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.

Getting Started

First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.

Documentation

You can find the current NuttX documentation on the Documentation Page.

Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.

The old NuttX documentation is still available in the Apache wiki.

Supported Boards

NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.

Contributing

If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.

License

The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.