Commit Graph
60574 Commits
Author SHA1 Message Date
hujun5 0f7c992cea sched/task: fix gettid by moving tls_dup_info after child pid initialization
Move tls_dup_info() call to after child process priority is set, ensuring
the child's pid is properly initialized before duplicating TLS information.
This fixes incorrect thread ID assignment during task fork operations.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-20 22:33:45 +08:00
v-zhangxiaomeng5 c95b6b1bb6 libxx: fix __config_site for libcxx compile errors
The errors are 'No thread API' and '__ULong undefined'

Signed-off-by: v-zhangxiaomeng5 <v-zhangxiaomeng5@xiaomi.com>
2026-01-20 17:45:48 +08:00
liwenxiang1 bd2cce7f1a arch/x64: fix revoke_low_memory
the virtual address of the page table (PT) is saved into the page directory (PD) entry, but the PD entry should store the physical address instead

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-20 17:15:50 +08:00
makejian 8309aadd69 Documentation: Add Whetstone FPU benchmark documentation
Add documentation for the Whetstone floating-point benchmark
application which is being added to nuttx-apps.

The documentation includes:
- Overview of the benchmark
- Configuration options
- Usage examples
- Output interpretation
- Test modules description

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-20 17:15:31 +08:00
hujun5 2c1e3d6ed0 sched/addrenv: replace critical section with spinlock for refs protection
Build Documentation / build-html (push) Has been cancelled
Replace global enter_critical_section() calls with lightweight spinlock in
addrenv_switch() to reduce interrupt latency, and convert refs counter to
atomic_t for thread-safe reference counting without blocking operations.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-20 11:29:22 +08:00
daichuan d19ee93c60 net: Support no-lto option for the network build.
Add CONFIG_NET_NO_LTO to allow compiling the network stack with -fno-lto.
This is useful for avoiding LTO-related issues in the network layer.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-20 10:12:45 +08:00
daichuan 32ffc69bdd net/icmp: Fix devif_loopback dead loop when unrecognized ICMP packet received
When an unrecognized ICMP (type=3, code=2) packet is received, the ICMP flow does not set dev->d_len to 0, causing a devif_loopback dead loop.

Therefore, in ICMP input processing, when an ICMP_DEST_UNREACHABLE message is received, if it is not ICMP_FRAG_NEEDED code, jump to typeerr for error handling.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-20 06:56:27 +08:00
wangchengdong 303bc7411f sched/sched: add hrtimer support to drive the scheduler
Add hrtimer support to drive the scheduler.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-20 06:55:15 +08:00
wangchengdong 9d8f0ace40 sched/sched: consolidate nxsched_process_timer into sched_timer.c
Consolidate nxsched_process_timer into sched_timer.c, and introduce
nxsched_process_tick() to improve readability and maintainability of
the scheduler timer processing logic.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-20 06:55:15 +08:00
liwenxiang1 46c319d948 arch/x64: Solve the sig_nest hang issue
When an interrupt occurs, the hardware automatically pushes the current RIP/RSP onto the interrupt stack. During the interrupt return, the iretq instruction pops them back. The problem is that the RIP/RSP modified by the signal is stored in the XCP context, whereas iretq operates on the interrupt stack. As a result, the RIP/RSP modified by the signal does not take effect in the iretq instruction, causing the task receiving the signal to fail to jump correctly to the signal handler. This behavior appears as if the signal is lost

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-20 06:53:04 +08:00
liwenxiang1 41da7121bd arch/x64: interrupt add CFI info
interrupt add CFI info

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-20 06:52:00 +08:00
zhangshuai39 49ffd94d84 net/pkt: Fix coverity issue
The value ret is overwritten after being assigned a value.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-19 15:33:03 -05:00
makejian 60b1cef84b Kconfig: Add ALLOW_CUSTOM_PERMISSIVE_COMPONENTS option
Add a new license configuration option for components that have
custom permissive licenses which are not covered by the standard
license options (BSD, MIT, GPL, etc.).

This option allows projects to explicitly opt-in to using components
with custom permissive licenses that allow free use, modification,
and distribution but may have specific attribution or notice
requirements.

Also update the License Setup documentation section to include
this new option.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-20 02:15:19 +08:00
hujun5 63e59e26c0 arch: move some macros to public code.
Move stack alignment and kernel stack macros from architecture-specific internal
headers to public include/nuttx/irq.h. Consolidates duplicate definitions across
17 architecture families, reducing code duplication while enabling common code
to access these core alignment utilities without architecture dependencies.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-20 01:53:08 +08:00
cuiziwei 6a51857e90 libs/libxx: Add _LIBCPP_HAS_NO_CONTENTION_TABLE to reduce RAM usage
When _LIBCPP_HAS_NO_CONTENTION_TABLE is defined, libcxx will not
allocate the contention table used for semaphore implementation,
which can save significant RAM on memory-constrained embedded systems.

This optimization is particularly useful for NuttX targets where
every byte of RAM matters.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-01-20 01:51:12 +08:00
buxiasen f0cb80d297 libm: fix warning maybe-uninitialized
nuttx/libs/libm/openlibm/openlibm/src/k_rem_pio2.c:421:24: error: 'fq' may be used uninitialized [-Werror=maybe-uninitialized]

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-19 23:26:14 +08:00
fangxinyong 507056e870 cmake(bugfix):fix arch x86_64 cmake build openlibm warning
Building C object libs/libm/openlibm/CMakeFiles/m.dir/openlibm/src/s_clog.c.obj
In file included from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/math_private.h:22,
                 from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/s_clog.c:61:
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/s_clog.c:78:33: warning: ‘clogl’ alias between functions of incompatible types ‘_Complex long double(_Complex long double)’ and ‘_Complex double(_Complex double)’ [-Wattribute-alias=]
   78 | openlibm_strong_reference(clog, clogl);
      |                                 ^~~~~
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/cdefs-compat.h:24:50: note: in definition of macro ‘openlibm_strong_reference’
   24 |         OLM_DLLEXPORT extern __typeof (aliassym) aliassym __attribute__ ((__alias__ (#sym)));
      |                                                  ^~~~~~~~
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/s_clog.c:64:1: note: aliased declaration here
   64 | clog(double complex z)

Building C object libs/libm/openlibm/CMakeFiles/m.dir/openlibm/amd64/fenv.c.obj
In file included from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/include/openlibm_fenv.h:8,
                 from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/amd64/fenv.c:35:
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/include/openlibm_fenv_amd64.h:99:1: warning: declaration of ‘feclearexcept’ shadows a built-in function [-Wshadow]
   99 | feclearexcept(int __excepts)
      | ^~~~~~~~~~~~~
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/include/openlibm_fenv_amd64.h:117:1: warning: declaration of ‘fegetexceptflag’ shadows a built-in function [-Wshadow]
  117 | fegetexceptflag(fexcept_t *__flagp, int __excepts)

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2026-01-19 23:26:14 +08:00
makejian cdfe81ff4c crypto/siphash: avoid redefine name issue
Rename siphash related symbols to avoid conflicts with compiler-generated
section names. Tricore-gcc produces function sections with '_end' suffix,
which conflicts with siphash_end symbol.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-19 23:25:37 +08:00
daichuan b01f8b04e9 netdev: delete macro CONFIG_NETDEV_CHECKSUM with nuttx
not need CONFIG_NETDEV_CHECKSUM with nuttx

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-19 23:22:46 +08:00
daichuan 99bf7c3c5f net: skip TCP/UDP pseudo-header checksum with hardware offload
When supporting hardware checksum offloading, the network protocol stack
does not perform TCP/UDP pseudo-header checksum calculation.

Skip TCP/UDP pseudo header checksum calculation in network protocol stack

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-19 23:22:46 +08:00
daichuan 42da4e322a net/netdev: fix compile error and add cmake/makefile
Fix compilation errors and add build files

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-19 23:22:46 +08:00
daichuan d2dde8a29a net/netdev: modify for hardware checksum offload
Implementation of main hardware verification and uninstallation functions

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-19 23:22:46 +08:00
yangao1 9903b11656 drivers/rpmsg: remove unnecessary header files, revise make.def and cmake
Already copy the rpmsg_internal.h from openamp to the nuttx/include,
so do not need add the include patch for .c files.

Signed-off-by: yangao1 <yangao1@xiaomi.com>
Signed-off-by: wangshaoxin <wangshaoxin@xiaomi.com>
2026-01-19 23:14:53 +08:00
hujun5 ee39e7a4a2 sched/group: add spinlock in group_childstatus.c
Add spinlock protection to child task pool allocation and deallocation in
group_childstatus.c. Protects g_child_pool freelist and group child list
traversal/modification operations against concurrent access in SMP systems.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-19 23:14:25 +08:00
zhangshuai39 1c2d1c579f simwifi: Fix compilation warning
Added the `<nuttx/kmalloc.h>` header file and fixed the implicit conversion issue.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-19 12:14:18 -03:00
raiden00pl 1f8bb966c3 drivers/serial/Kconfig-16550: fix non-existent option
there is no SERIAL_DMA option, it was removed long time ago in:
0d203fd535

It should be SERIAL_TXDMA and SERIAL_RXDMA

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-01-19 16:12:25 +01:00
raiden00pl 8a5f646029 boards/qemu-intel64/jumbo: enable procfs ACPI
enable export of ACPI tables with procfs:

nsh> ls proc/acpi
/proc/acpi:
 FACP
 DSDT
 APIC
 MCFG

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-01-19 14:46:34 +01:00
raiden00pl f19b28d3d2 arch/x86_64/x86_64_acpi_procfs.c: fix build warnings
fix warnings:

CC:  intel64/intel64_schedulesigaction.c common/x86_64_acpi_procfs.c:121:3: warning: excess elements in struct initializer
  121 |   0444
      |   ^~~~
common/x86_64_acpi_procfs.c:121:3: note: (near initialization for ‘g_acpi_procfs’)
common/x86_64_acpi_procfs.c:129:3: warning: excess elements in struct initializer
  129 |   0
      |   ^
common/x86_64_acpi_procfs.c:129:3: note: (near initialization for ‘g_acpi_file_procfs’)

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-01-19 14:46:34 +01:00
liwenxiang1 681bfa6b54 arch/x64:add up_set_irq_type
Build Documentation / build-html (push) Has been cancelled
add up_set_irq_type interface

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-19 19:09:52 +08:00
zhangyu117 9685403038 arch/tricore: modify gpsr init process
for some chips like tc4xx there also corecs, so need init it too.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-01-19 17:51:48 +08:00
zhangyuan29 4775d6dceb arch/tricore: support up_trigger_irq
Enable gpsr and use gpsr to support multicore irq trigger.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-01-19 17:51:48 +08:00
zhangyuan29 f44060ca9f arch/tricore: support minimal vectortalbe in tricore
The SRN number in TriCore far exceeds the PN number.
Using IRQ as the PN number would result in an overflow.
Therefore, MINIMAL_VECTORTABLE is used to ensure that
the PN number does not overflow.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-01-19 17:51:48 +08:00
zhaoxingyu1 f40dfc7234 fs: add fs dump in ROMFS/LITTLEFS
add read/write double check in ROMFS/LITTLEFS file system

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-19 16:40:57 +08:00
wangjinjing1 18820ef07d net/can: allow errmask to be set to CAN_ERR_FLAG;
For the LIN protocol, the error frame ID can be 0. This change is to ensure that all LIN error frames can pass the filter.

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2026-01-19 15:13:14 +08:00
xuxin19 d39ed19213 cmake(bugfix):elf link should depends on starupobjs crt0.o
fix the correct dependency sequence to prevent
startupobjs from not being generated before ELF linking.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 df6505567c elf(bugfix):fix elf compile link error when enable LTO
fix compilation errors when enabling the LTO linker

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 b34a221121 cmake(bugfix):unify cmake application elf link rule
separate three elf link modes:
kernel elf: kernel build link all user libs and startup obj
loadable elf: `m` build dont link user libs minimize size but link
startup obj
dynlib elf:do not link user libs and startup obj

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 00e79122af cmake(enhance):cmake support DYNLIB build
add `DYNLIB` option for nuttx_add_application for dynamic loadable lib

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 a7c6f589f9 cmake(bugfix):fix sim loadable elf build support
1.add sanity check for START_OBJS
2.make laodable -e entry setting in each arch elf.cmake
3.add sim elf.cmake

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 f589a02e3e cmake(bugfix):add x86_64 arch cmake loadable mod support
supplementing the implementation of loadable construction for x86

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 63dc48e713 cmake kernel build(bugfix): remove unused section in elf link
this will reduce the size of elf

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 d676716e7a cmake(feat):separate ELF output bin and bin_debug
bin for striped elf

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 6fa3031d9b cmake(feat):define elf option and enable apps module build
1.define elf option setting function ext;
2.unify loadable elf and kernel elf build config

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 885ff780c5 cmake(bugfix):fix KERNEL mod elf target dup with lib target
Using the same name as elf may lead to duplicate errors.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 197149a297 cmake(bugfix):use apps_post to identify the stage of app completion
nuttx_post for all target done
apps_post for all apps lib done

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 70bddf61c3 cmake(bugfix):rename host tools binary dir to host_bin
we will use CMAKE_BINARY_DIR/bin for apps elf
so we need to change host tools to bin_host

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
xuxin19 b7582b8da1 cmake(feat):implements KERNEL mode in CMake build
1.add application link dependencies for all elf
2.add a global custom target to hold proptry in the toolchain file
3.add startup obj target
4.fix cpp lds error with kernel mod link elf lds

usage:
./build.sh qemu-armv7a:knsh --cmake
elf install in ${CMAKE_BINARY_DIR}/bin

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-19 14:45:37 +08:00
hujun5 a2d2a49ba9 sched/irq: align irq work queue stack buffer
Add aligned_data(STACK_ALIGNMENT) attribute to g_irq_work_stack buffer declaration
in irq_attach_wqueue.c. Ensures stack memory is properly aligned to architecture
requirements, preventing unaligned stack addresses that could cause data access
faults or performance degradation on strict alignment architectures.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-19 14:43:43 +08:00
hujun5 8bb250a4c0 arch: move STACK_ALIGNMENT to irq.h
Move STACK_ALIGNMENT macro definitions from architecture-specific internal
headers to public irq.h headers. This enables common code to directly access
STACK_ALIGNMENT without requiring internal header inclusion, improving code
organization and reducing header dependencies. Applies to all architectures:
ARM, ARM64, AVR, HC, MIPS, or1k, Renesas, RISC-V, SIM, SPARC, TriCore, x86,
x86_64, Xtensa, Z16, and Z80.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-19 14:43:43 +08:00
hujun5 79c349b779 sched/task: fix task_exit regression with critical section state
Move nxsched_switch_context() call after setting TSTATE_TASK_INACTIVE to ensure
proper IRQ count state before context switching, preventing assertion failures
in enter_critical_section() when rtcb->irqcount is incorrectly zero during termination.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-19 14:39:45 +08:00