No description
Find a file
ligd 2241969e5a SMP: fix crash when switch to new task which is still running
cpu0 thread0:                        cpu1:
sched_yield()
nxsched_set_priority()
nxsched_running_setpriority()
nxsched_reprioritize_rtr()
nxsched_add_readytorun()
up_cpu_pause()
                                     IRQ enter
                                     arm64_pause_handler()
                                     enter_critical_section() begin
                                     up_cpu_paused() pick thread0
                                     arm64_restorestate() set thread0 tcb->xcp.regs to CURRENT_REGS
up_switch_context()
  thread0 -> thread1
arm64_syscall()
    case SYS_switch_context
     change thread0 tcb->xcp.regs
    restore_critical_section()
                                     enter_critical_section() done
                                     leave_critical_section()
                                     IRQ leave with restore CURRENT_REGS
                                     ERROR !!!

Reason:
As descript above, cpu0 swith task: thread0 -> thread1, and the
syscall() execute slowly, this time cpu1 pick thread0 to run at
up_cpu_paused(). Then cpu0 syscall execute, cpu1 IRQ leave error.

Resolve:
Move arm64_restorestate() after enter_critical_section() done

This is a continued fix with:
https://github.com/apache/nuttx/pull/6833

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-01 21:05:00 +09:00
.github ci: Remove the codecheck from build.yml 2024-02-29 18:54:41 -03:00
arch SMP: fix crash when switch to new task which is still running 2024-03-01 21:05:00 +09:00
audio Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
binfmt log messages of binfmt are very much. 2023-12-29 17:36:47 +08:00
boards arm64/defconfig: improve the arm64 defconfig 2024-03-01 21:05:00 +09:00
cmake build/cmake: fix empty BASE_DEFCONFIG string 2024-02-28 10:58:52 +01:00
crypto sched: explicitly select the cpuload clock source configuration 2023-11-01 09:27:56 +08:00
Documentation drivers/analog/hx711.c: Add driver for hx711 adc 2024-02-26 19:16:51 -03:00
drivers nuttx/list: rename container_of to list_container_of from public header 2024-02-29 19:44:54 +08:00
dummy build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs nuttx/list: rename container_of to list_container_of from public header 2024-02-29 19:44:54 +08:00
graphics poll: pollsetup should notify only one fd passd by caller 2023-11-21 09:07:17 +01:00
include SMP: fix crash when switch to new task which is still running 2024-03-01 21:05:00 +09:00
libs sched/tls: inline group info in flat mode to improve performance 2024-03-01 17:27:26 +08:00
mm Revert "fix variable set but not used" 2024-02-21 21:29:48 -08:00
net net/local: Add local_freectl to avoid the code duplicaton 2024-02-29 16:28:01 -03:00
openamp openamp: Fix void pointer arithmetic in openamp to remove compilation warnings 2024-02-12 17:06:33 +01:00
pass1 passl: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched SMP: fix crash when switch to new task which is still running 2024-03-01 21:05:00 +09:00
syscall sched/semaphore: Move named semaphores to user space 2023-11-27 04:52:54 -08:00
tools tools/nxstyle: add infineon prefix into ignore list 2024-02-21 21:39:19 -08:00
video build: add initial cmake build system 2023-07-08 13:50:48 +08:00
wireless Remove the back slash from long literal string 2024-02-19 16:43:15 +01:00
.asf.yaml feat: add a GitHub action to lint the YAML files 2020-12-15 09:52:04 -06:00
.gitignore fs/vfat: Fix typo in the macro DIRSEC_BYTENDX 2024-02-03 12:46:08 -03:00
.yamllint feat: add a GitHub action to lint the YAML files 2020-12-15 09:52:04 -06:00
AUTHORS AUTHORS: add Tomek CEDRO to the list 2023-03-07 14:15:55 +01:00
CMakeLists.txt cmake:adapt BOARD_CONFIG absolute paths and relative paths when reconfig 2024-02-23 18:15:56 -08:00
CONTRIBUTING.md Remove the tail spaces from all files except Documentation 2023-02-26 13:24:24 -08:00
INVIOLABLES.md INVIOLABLES.md: Fix a simple alignment and change occurrences of Nuttx 2020-09-03 01:33:05 +08:00
Kconfig rpmsg/debug: add debug configs and macros 2024-02-15 19:53:55 -08:00
LICENSE api: add simple hashtable api 2024-02-21 13:29:36 -03:00
Makefile tools:fix some error use of shell command in Windows native build 2022-11-06 16:41:49 +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.