Commit graph

60489 commits

Author SHA1 Message Date
Bowen Wang
1d66a0bc4a openamp: support include the openamp headers in nuttx
copy all the openamp headers to nuttx, make nuttx code can include
all the openamp headers to fix the compile error

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
4c06a2768d openamp: add mm_priv to struct virtio_device
now the virtio device can set it's own memory private data, and
can use this private data to store the memory manager handler

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
0a26f09c6b openamp: make the remoteproc virtio fit more virtio devices
1. add cpuname config for the rpmsg virtio devices, so the rpmsg virtio
driver can get the local and remote cpuname from the virtio config
space, and we can distinguish the differnt channel when there are
two rpmsg virtio devices in the same resource table;
2. optimize the remoteproc virtio transport layer to make it can
work with all the virtio devices instead only work with rpmsg virtio
devices;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
Bowen Wang
a98dc94f93 rpmsg/rpmsg_virtio: add rpmsg virtio common implementation
This is the virtio-rpmsg and vhost-rpmsg common implementation for
VirtIO-Rpmsg: drivers/virtio/virtio-rpmsg.c
Vhost-Rpmsg: drivers/vhost/vhost-rpmsg.c

Later we will seperate the rpmsg virtio from the rptun framework to
make the rpmsg virtio can work with all the virtio transport layer.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00
makejian
d15081838b crypto/cryptodev: support private data in driver
Add support for storing driver-specific private data in the crypto
driver structure. This allows crypto drivers to maintain session
state and other driver-specific information.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 14:17:38 +08:00
makejian
3ce3d4cb20 crypto/blake2s.h: fix tasking compile warning
Fix unexpected text after preprocessing directive compilation warning
in blake2s.h header file.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 14:16:25 +08:00
makejian
043ef0dd3a crypto/cryptosoft: replace macro howmany with common macro div_round_up
Replace the non-standard howmany macro with the common div_round_up macro
for consistency and better code maintainability.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 14:16:00 +08:00
makejian
38ba0abc49 arch/tricore: support cache function
Add cache operation support for TriCore architecture including:
- Instruction cache (I-Cache) enable/disable functionality
- Data cache (D-Cache) enable/disable functionality
- Cache configuration and management interfaces
- Performance events integration with cache operations

Signed-off-by: makejian <makejian@xiaomi.com>
Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-01-19 14:13:27 +08:00
ouyangxiangzhen
1502e6da15 arch/intel64: Fix coverity.
This commit fixed mulitply-overflow in frequency calculation.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-19 14:12:09 +08:00
ouyangxiangzhen
efa0ae5275 list: Fix the list conflicts.
This commit is workaround for the list conflicts introduced by the wqueue and wdog. By spliting the list type definition and the list implementation, we can avoid the list conflicts with user-defined lists.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-19 14:12:09 +08:00
ouyangxiangzhen
57a12556d2 list: Optimize the list structure.
Since lists are traversed sequentially in most cases, moving the next pointer before the prev pointer can optimize memory access on some architectures.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-19 14:12:09 +08:00
makejian
35886c18ab nuttx/mutex: correct documentation for nxmutex_destroy
Correct and clarify the documentation note for nxmutex_destroy function
to properly document behavior and safety considerations in OS context.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 14:10:42 +08:00
liwenxiang1
e074c865bc arch/x86_64: add poweroff functionality
add poweroff feature

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-19 14:10:12 +08:00
liwenxiang1
c774939c9e arch/x64: add acpi procfs
add acpi procfs function

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>

arch/x64:Fix the issue of dereferencing before null check

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-19 14:10:12 +08:00
likun17
28661273a3 drivers/sensors: Added virtual sensor flag to prioritize reading
of driver information.

When the local core is a virtual sensor, attempt to retrieve
information from a remote core.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:46 +08:00
likun17
96647f0ed7 drivers/sensors: Fixed O_DIRECT flag triggering rpmsg cross-core.
Fixes the issue of cross-core IPC being triggered when using
O_DIRECT in non-cross-core scenarios.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:46 +08:00
dongjiuzhu1
8afca79359 drivers/sensors: add sensor_device_info when sensor_regsiter by usensor.
The logic for obtaining the info and configuring the user buffer
have been optimized.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-19 12:22:46 +08:00
v-zhangxiaomeng5
cc1c033df2 libs/libxx: change libcxxmini to libminiabi
libcxxmini shall not stay the same layer of LIBCXX, move it down to ABI library layer.

Signed-off-by: v-zhangxiaomeng5 <v-zhangxiaomeng5@xiaomi.com>
2026-01-19 10:48:50 +08:00
liwenxiang1
89eddf6396 arch/x64: create qemu chip
Create QEMU chip and rename intel64 directory to qemu

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-19 10:46:09 +08:00
hujun5
e143acfc46 sched/irq: handle NULL ISR handler in irq_default_handler
Add null-check for ISR handler before invoking in irq_default_handler.
Fix comment documentation and initialize return value to IRQ_WAKE_THREAD.
Ensures safe handler invocation when isr parameter is NULL in threaded IRQ mode.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-19 02:02:48 +08:00
Alan Carvalho de Assis
0e5323370f drivers/usbhost_hidkbd: Fix small typo in usbhost_hidkbd.c
There were missing quotes for key "backspace" for scancodes.
This issue was found by github user @StagiaireAbritek

He opened an PR in github to fix it:
https://github.com/apache/nuttx/pull/15917

However he decided to abandon and close the PR, but because it is
an important fix I decided submit it upstream.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-01-18 11:57:58 -05:00
hujun5
a640dd49d2 armv7-a/arm_addrenv_pgmap.c: add up_addrenv_find_page and up_addrenv_user_vaddr
Add two new address environment utility functions in arm_addrenv_pgmap.c:
- up_addrenv_find_page(): Find physical page mapped to user virtual address
  from address environment page directory (stub implementation for future use)
- up_addrenv_user_vaddr(): Check if virtual address is in user space by calling
  arm_uservaddr(). Enables common code to query user address space boundaries
  on ARMv7-A architecture.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-18 23:06:13 +08:00
hujun5
7e02f08a83 arm64: fix stack pointer initialization when CONFIG_STACK_COLORATION disabled
Add else clause to advance stack pointer (x24) by SMP_STACK_SIZE when
CONFIG_STACK_COLORATION is not defined in ARM64 boot code. Ensures each
CPU's stack is properly skipped in multi-core initialization even when
stack coloration/validation is disabled, preventing stack corruption from
overlapping CPU stacks.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-18 23:05:37 +08:00
hujun5
6f4cb9f457 sched/task: move kernel stack allocation to task initialization
Move kernel stack allocation from exec_module() (binary format execution) to
nxtask_init() (task initialization) with proper type checking. Add conditional
check to allocate kernel stack only for non-kernel tasks (ttype != TCB_FLAG_TTYPE_KERNEL).
Enables kernel stack allocation for both exec'd tasks and regular task_create()
calls in protected builds, allowing userspace to create tasks with proper kernel
stack isolation.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-18 23:05:11 +08:00
hujun5
a9d9dd2120 arch: enable ARCH_KERNEL_STACK support in protected builds
Expand ARCH_KERNEL_STACK configuration to support both BUILD_KERNEL and
BUILD_PROTECTED modes. Change Kconfig dependency from "depends on BUILD_KERNEL"
to "depends on BUILD_KERNEL || BUILD_PROTECTED". Update pthread_create.c to
remove redundant BUILD_KERNEL check when allocating kernel stacks with
CONFIG_ARCH_KERNEL_STACK enabled. Enables protected builds to use separate
kernel and user stacks for processes.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-18 23:05:11 +08:00
hujun5
835c9c0f77 binfmt: refactor loadable module cleanup mechanism
Remove deprecated group_exitinfo() function and related critical section locking
from binfmt_exec.c, moving module unload setup directly into exec_module() where
it integrates naturally with task activation, simplifying code flow and reducing
unnecessary synchronization overhead.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-18 08:30:15 -03:00
makejian
35537cb1a7 tricore/csrm: bringup cpucs in tricore
Add CPUCS bring-up support for TriCore secure core (CSRM) module.
Enables core6 initialization for secure core operations.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-18 08:27:38 -03:00
wangchengdong
e4ea0a59ea boards: enable CONFIG_ENABLE_ALL_SIGNAL
Enable CONFIG_ENABLE_ALL_SIGNAL to fix build errors

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
8919950326 arch/sparc: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
2a0990bd31 arch/sim: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
00c1946e35 arch/renesas: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
ec2684c885 arch/or1k: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
8df791b057 arch/misoc: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
23fa9b16b3 arch/mips: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
dfd3426aa5 arch/avr: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
9670b17ffd arch/z80: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
d04ca30169 arch/z16: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
1b8d8f7565 arch/xtensa: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
7dbd568477 arch/x86_64: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
2d6eef74b5 arch/x86: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
92f097e354 arch/tricore: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
d3f89c2661 arch/arm64: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
0813357308 arch/risc-v: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
09b99e5b90 arch/arm: Add support to disable signals actions related data struct
Add support to disable signals actions related struct

Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-18 08:24:13 -03:00
wangchengdong
faf864b04f sched/signal: Add support for disabling all signal functions
Signals in NuttX serve two primary purposes:

      1. Synchronization and wake-up:
        Signals can be used to block threads on specific signal sets and later
        wake them up by delivering the corresponding signals to those threads.

      2. Asynchronous notification:
        Signals can also be used to install callback handlers for specific signals, allowing threads to
        asynchronously invoke those handlers when the signals are delivered.

    This change introduces the ability to  disable all signal functionality to reduce footprint for NuttX.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2026-01-18 08:24:13 -03:00
wangchengdong
0ea686bc5b sched/signal: Add support for partially disabling signals
Signals in NuttX serve two primary purposes:

    1. Synchronization and wake-up:
    Signals can be used to block threads on specific signal sets and later
    wake them up by delivering the corresponding signals to those threads.

    2. Asynchronous notification:
    Signals can also be used to install callback handlers for specific signals, allowing threads to
    asynchronously invoke those handlers when the signals are delivered.

This change introduces the ability to partially disable signal functionality: to disable only signal functions for
Asynchronous notification, keeping functions for Synchronization and wake-up.
This enables finer-grained control over signal usage while preserving existing behavior for supported use cases.

Co-authored-by: Guo Shichao guoshichao@xiaomi.com
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2026-01-18 08:24:13 -03:00
aviralgarg05
ac3d964973 Doc: Correct XIAO ESP32C3 board configuration name
Documentation mentioned xiao-esp32c3 which is incorrect. The actual board name in the codebase is esp32c3-xiao. This commit fixes the board name in the documentation to match the directory structure.
2026-01-18 11:49:20 +08:00
Alexey Matveev
1b993875b5 arch/stm32: Fix stm32-capture if timer don't support GTIM_CCER_CC1NP
Fix: Some STM32 chips don't support GTIM_CCER_CC1NP; use HAVE_GTIM_CCXNP guards to exclude it. Adds/updates #ifdef HAVE_GTIM_CCXNP guards so GTIM_CCER_CC1NP is only included when supported, preventing register writes on chips without it.

Signed-off-by: Alexey Matveev <tippet@yandex.ru>
2026-01-18 11:40:32 +08:00
hujun5
3129c06390 arch/arm64: disable fork support in protected build mode
Modify ARM64 architecture configuration to disable fork support in protected
build mode (BUILD_PROTECTED). Update ARCH_HAVE_FORK condition from
"!BUILD_KERNEL" to "!BUILD_KERNEL && !BUILD_PROTECTED", ensuring fork is
only available in flat/monolithic builds, not in protected kernel builds.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-18 11:17:13 +08:00
hujun5
29bc8c7b15 sched/signal: use spinlock to protect signal queues
Replace global critical section with fine-grained spinlock protection for
signal action queue (tg_sigactionq) and signal pending queue (tg_sigpendingq).
Use spin_lock_irqsave/spin_unlock_irqrestore with group->tg_lock for proper
synchronization, reducing interrupt latency and improving SMP scalability.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-17 18:29:17 -03:00