Commit graph

60462 commits

Author SHA1 Message Date
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
hujun5
657ac8317e arch: fix addrenv_switch changing this_task causing exceptions
After addrenv_switch(), the current running task (this_task) may change due to
deferred work execution. Update all architecture interrupt, syscall, and exit
handlers to re-fetch tcb = this_task() after addrenv_switch(). Ensures scheduler
and context operations use the correct TCB, preventing context corruption and
exceptions across SMP and memory-protected builds.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-17 18:23:06 -03:00
ligd
113bb02568 checkstack: fix access overflow when checkstack
We should check length first, and then check the value

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-17 18:04:28 -03:00
ligd
3c6cb0b76e sched: add dump_stack() for dumponexit
Add stack dump functionality when tasks exit, which helps with
debugging and understanding task termination conditions.


Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-17 18:04:28 -03:00
Filipe Cavalcanti
0bd1dc58a8 sched/sched_roundrobin.c: fix round-robin scheduling in SMP mode
In SMP mode, running tasks are in g_assignedtasks[cpu], not the
ready-to-run list, so tcb->flink is NULL. When a round-robin timeslice
expires, checking tcb->flink fails to find the next task.

Fix by calling nxsched_switch_running() directly in SMP mode when the
timeslice expires, which properly finds the next eligible task from the
ready-to-run list.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-01-17 18:03:45 -03:00
hujun5
ae47d6a101 sched/task: fix null pointer dereference in fork address environment setup
Move addrenv_join() call after group_initialize() in nxtask_setup_fork() to fix
null pointer dereference. addrenv_join() accesses child->group which is
initialized by group_initialize(), so the operations must be sequenced
correctly. Reorder initialization to ensure child task group is set up before
address environment join operations.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-17 17:35:36 -03:00
xucheng5
724ad008ab ctucanfd: increase rwcnt bitfield width and fix structure alignment
The rwcnt (read word count) field in ctucanfd_frame_fmt_s was previously
limited to 4 bits, allowing a maximum value of 15. This is insufficient
to correctly represent the frame size (excluding the FRAME_FORMAT word)
for larger CAN FD frames as required by the CTU CAN FD hardware.

Increase the rwcnt bitfield width to support a larger range and adjust
the structure layout so that ctucanfd_frame_fmt_s has a size that is a
multiple of 4 bytes, as required by the hardware interface.

This change improves correctness and robustness when handling larger
CAN FD frames without affecting existing users.

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2026-01-17 12:43:48 +01:00
xucheng5
2f3eb6d677 caros_x86_64: add support for generating linker map
This patch introduces support for generating a linker map file during
the build process for the x86_64 configuration.

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2026-01-17 14:14:13 +08:00
hujun5
13d1092939 arm64: add missing REG_SCTLR_EL1 initialization in signal processing
Add REG_SCTLR_EL1 system register initialization in arm64_init_signal_process
when setting up register context for signal handlers. Initialize with current
sctlr_el1 value and apply CONFIG_ARM64_MTE settings if enabled. Fixes regression
where signal handler context was missing critical system control register setup.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-17 14:13:55 +08:00
hujun5
acc833b07d libs/libc: replace critical section with spinlock in hostname operations
Replace global enter_critical_section() with lightweight spinlock in
gethostname() and sethostname() to reduce interrupt latency while protecting
access to the shared hostname string.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-17 14:13:07 +08:00
hujun5
4a160e7778 sched/environ: rm cestion_in evn
Replace global critical section with mutex in environment
variable operations. Use nxrmutex_lock/unlock(&group->tg_mutex)
instead of enter/leave_critical_section() to protect
environment access, reducing interrupt latency and
improving SMP responsiveness. Clean up unused
irqstate_t flags variables in env_dup,
env_getenv, env_setenv, and env_unsetenv.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-17 14:12:42 +08:00
Ari Kimari
fb7e5c5618 arch/imx9: Modify default ddr config handling
Remove default ddr config
Add imx9_ddr_config() function  to return default config

Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
2026-01-17 11:41:57 +08:00
makejian
213c1b4957 docs: enhance crypto documentation with key management and asymmetric crypto
Add detailed descriptions of key management operations including:
- Key allocation and validation (CRK_ALLOCATE_KEY, CRK_VALIDATE_KEYID)
- Key import and export (CRK_IMPORT_KEY, CRK_EXPORT_KEY, CRK_EXPORT_PUBLIC_KEY)
- Key generation (CRK_GENERATE_AES_KEY, CRK_GENERATE_RSA_KEY, CRK_GENERATE_SECP256R1_KEY)
- Key lifecycle management (CRK_DELETE_KEY, CRK_SAVE_KEY, CRK_LOAD_KEY)
- Usage of keys in cryptographic operations

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-17 11:41:23 +08:00
makejian
b11901ffaf crypto: add key management and RSA/ECDSA keypair generation
Add key management interfaces and support for generating key pairs in RSA and ECDSA cryptographic processes to the cryptodev module.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-17 11:41:23 +08:00
hujun5
f4cbc1455f arm: use global variables for CPU startup addresses
Replace direct labels for CPU startup routines with indirection through global
variables. Export cpu1_start, cpu2_start, cpu3_start as global objects containing
addresses to __cpu1_start, __cpu2_start, __cpu3_start respectively. Use load-then-
branch-exchange (ldr r1, =cpu*_start; ldr r1, [r1]; bxeq r1) instead of direct beq
jumps. Enables flexible control of CPU startup positions and supports future AMP/
dynamic loading scenarios.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 14:05:24 -03:00
hujun5
c1884b8a4f arm: add CONFIG_NCPUS for AMP mode support
Add new CONFIG_NCPUS configuration option to support both SMP and AMP modes.
Replace SMP-specific CONFIG_SMP_NCPUS checks with generic CONFIG_NCPUS in ARM
boot code (ARMv7-A, ARMv7-R, ARMv8-R). CONFIG_NCPUS defaults to SMP_NCPUS when
SMP is enabled, or 1 otherwise, enabling multi-CPU support regardless of SMP mode.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 14:05:24 -03:00
hujun5
6f87c092a1 arm: support AMP mode with GIC SGI inter-core interrupts
Enable SGI (Software Generated Interrupts) usage in AMP mode for inter-core
communication. Modify arm_cpu_sgi() to use SGI_TGTFILTER_LIST for both SMP and
AMP modes instead of requiring CONFIG_SMP. Add CPU0-only guard checks using
sched_getcpu() to ensure arm_gic0_initialize() executes only once on CPU0 during
initialization in both SMP and AMP configurations.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 14:05:24 -03:00
Jiri Vlasak
f49e61bf76 kinetis/enet: Set carrier on/off on ifup/ifdown
We need IFF_IS_RUNNING(dev->d_flags) to be true for ethernet device to
work properly. However, dev->d_flags are not set anywhere in the
Kinetis' ethernet code.

This change updates kinetis_ifup and kinetis_ifdown procedures to call
netdev_carrier_on and netdev_carrier_off to set dev->d_flags.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-16 13:55:13 -03:00
Peter van der Perk
8c77fccaef imx95-m7: Fix Kconfig for flexcan typo
Fixes typo in flexcan2, which renders it unusable

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2026-01-16 13:49:25 -03:00
ligd
c000974700 arm64: fix compile failed
CC:  mm_heap/mm_mallinfo.c chip/bcm2711_serial.c: In function 'bcm2711_miniuart_attach':
chip/bcm2711_serial.c:571:3: error: implicit declaration of function 'up_prioritize_irq' [-Werror=implicit-function-declaration]
  571 |   up_prioritize_irq(BCM_IRQ_VC_AUX, 0);
      |   ^~~~~~~~~~~~~~~~~
CC:  mm_heap/mm_memalign.c chip/bcm2711_gpio.c: In function 'bcm2711_gpio_irqs_init':
chip/bcm2711_gpio.c:275:7: error: implicit declaration of function 'up_prioritize_irq' [-Werror=implicit-function-declaration]
  275 |       up_prioritize_irq(g_gpio_irqs[i], 0);
      |       ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-16 10:26:58 -05:00
guoshichao
5a9f6efddb ghs: update the compile option to recommended options
add new build option config that recommended from other mass-produced
products

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 21:57:00 +08:00
hujun5
79b6d27018 arm64: fix SP_EL0 register handling in syscall return path
Use regs[REG_SP_EL0] from register context instead of direct sp_el0 system
register read/write operations in arm64_syscall(). Replace read_sysreg(sp_el0)
with regs[REG_SP_EL0] and write_sysreg(usp, sp_el0) with direct assignment to
regs[REG_SP_EL0]. Ensures userspace stack pointer is correctly maintained from
register context during signal delivery, preventing userspace SP corruption on
syscall return.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 21:34:41 +08:00
guoshichao
3d45550da9 can_sendmsg_buffered: fix can_sendmsg param type mismatch error
Update the can_sendmsg() signature from "struct msghdr *msg" to
"const struct msghdr *msg" to match the updated sendmsg() prototype
and resolve compilation errors due to parameter type inconsistency.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 21:11:39 +08:00
guoshichao
57637e5927 net: make the sendmsg param type consistent with posix specification
To ensure consistency, in all places where the "sendmsg" function is used
either directly or indirectly, the type of the "struct msghdr *msg" parameter
needs to be modified to "const struct msghdr *msg".

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 21:11:39 +08:00
guoshichao
9de3b79e2c nucleo-h743zi/elf: modify the romfs img file path
Since the directory structure of the examples/elf project
has been reorganized, the corresponding ROMFS_IMAGEFILE path
also needs to be adjusted.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 21:07:33 +08:00
jingfei
9483df3571 driver/cfi-flash: Add a config option for the page size of CFI flash.
We have added a defconfig configuration to set the page size of the flash.
According to the CFI protocol, the flash supports a single write operation
with a data volume ranging from byte size up to the maximum number of bytes.
However, the MTD device structure requires defining a page size, which serves
as the minimum write unit of the flash. Hence, this configuration is introduced.
Any page size within the range of 1 to the maximum number of bytes is considered
valid.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-01-16 20:38:26 +08:00
hujun5
ad3abcd277 arm64: g_mpu_region need support SMP
Convert g_mpu_region from single-CPU global variable to per-CPU array indexed
by this_cpu(). Change declaration from "unsigned int g_mpu_region" to
"unsigned int g_mpu_region[CONFIG_SMP_NCPUS]". Update all accesses in
mpu_allocregion(), mpu_freeregion(), and mpu_modify_region() to use
g_mpu_region[this_cpu()] for proper per-CPU MPU region tracking in multi-core
configurations.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 20:37:25 +08:00
hujun5
ffb4c101d8 arm64: fix FIQ mask initialization in task state
Add FIQ bit (DAIF_FIQ_BIT) initialization to SPSR register when creating new
ARM64 tasks. By default, FIQ interrupts are masked unless CONFIG_ARM64_DECODEFIQ
is enabled. Ensures consistent FIQ masking behavior across all task contexts.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 20:37:17 +08:00