Commit Graph

60372 Commits

Author SHA1 Message Date
liwenxiang1 fceba08e0e arch/x64:Fix the abnormal backtrace display issue
Need to wait until nuttx and allsymbols linking is completed before generating nuttx.mb1.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-16 09:38:09 +08:00
liwenxiang1 addc6b165a arch/x64:Fix the issue where RFLAGS is not restored after a syscall return
When a syscall is invoked, the RFLAGS register is saved into R11. It must be restored before returning

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-16 09:37:20 +08:00
liwenxiang1 794c325947 arch/x64:Syscall support is enabled by default
Syscall enablement is controlled by CONFIG_ARCH_HAVE_SYSCALL

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-16 09:37:20 +08:00
liqinhui 0e4d291156 sim: Pass through unknown sockopt to system.
Remove the interception of unknown levels and option names in sim usrsock.
This allows the system socket interface to handle them and return the correct error codes or behavior, rather than returning a generic error locally.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-15 13:29:56 -08:00
p-szafonimateusz ee06211e05 arch/x86_64/intel64: fix build break for timerisr
fix these errors when build with CONFIG_SCHED_TICKLESS=n:

1. intel64_tsc_timerisr.c:56: multiple definition of `g_x86_64_timer_freq';
2. intel64_cpustart.c:196: undefined reference to `get_tsc_adjust'

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-01-15 11:43:33 -08:00
zhanghongyu da35465d43 tcp_input.c: standardize the processing of urgent data
urgent data needs to be treated as normal data when
CONFIG_NET_TCPURGDATA disable. some test sets will verify this
behavior, correct the processing logic.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 16:26:19 -03:00
guoshichao d78d94e1fa pthread: reorganized the locations of pthread-related functions and constants
1. According to the POSIX specification, the functions `pthread_kill`
and `pthread_sigmask` have been moved from `pthread.h` to `signal.h`.
2. As required by the POSIX standard, the pthread-related constants
have been relocated from `pthread.h` to `sys/types.h`.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-15 16:23:04 -03:00
daichuan c7386775a7 libc/netdb: avoid unnecessary DNS notify if nameserver exists
If the nameserver already exists, return directly without calling dns_notify_nameserver to prevent cyclic notifications and high CPU usage.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-15 16:20:44 -03:00
Carlos Sanchez 23a9ff1196 libm: prevent atanf() yielding NaN for high inputs values.
Without this fix, values of x where x * x + 1 are rounded
down could make asin() argument to be out of range.

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2026-01-15 16:19:52 -03:00
guoshichao 9503d57634 posix_test: fix the ltp project link error
Add CONFIG_NET, CONFIG_NET_SOCKOPTS, and CONFIG_SYSTEM_SYSTEM to
posix_test configuration to provide the network socket options and
NXsystem() API required by LTP testcases, resolving undefined
reference errors during linking.

the following are the detailed link error:
```
/home/testing/apps/testing/ltp/ltp/testcases/kernel/device-drivers/zram/zram03.c:175: undefined reference to `NXsystem'
/usr/bin/ld: nuttx.rel: in function `setup':
/home/testing/apps/testing/ltp/ltp/testcases/kernel/device-drivers/zram/zram03.c:158: undefined reference to `NXsystem'
/usr/bin/ld: nuttx.rel: in function `setup':
/home/testing/apps/testing/ltp/ltp/testcases/kernel/syscalls/sendmsg/sendmsg01.c:554: undefined reference to `NXsystem'
/usr/bin/ld: /home/testing/apps/testing/ltp/ltp/testcases/kernel/syscalls/sendmsg/sendmsg01.c:556: undefined reference to `NXsystem'
/usr/bin/ld: nuttx.rel: in function `ltp_fs_inode_inode01_main':

/home/testing/apps/testing/ltp/ltp/ltp/lib/safe_net.c:511: undefined reference to `NXsetsocket'
/usr/bin/ld: nuttx.rel: in function `safe_getsockopt':
```

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-15 16:19:06 -03:00
liwenxiang1 f730a86d22 arch/x64: Fix crash issue after enabling KASAN
After up_fork calls the x86_64_fork function, the rsp must be 16-byte aligned; otherwise, the movaps %xmm0, (%rsp) instruction may cause a crash.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-15 16:15:25 -03:00
zhanghongyu 0dc0b94380 net/ipv4: check whether the length of the ipv4 option is correct
This patch adds validation for IPv4 option lengths during packet processing
to prevent malformed packets from causing undefined behavior. The new
ipv4_check_opt() function verifies that option lengths are within valid
bounds before processing them.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 16:14:19 -03:00
yintao f671ec648e drivers/rpmsg: add signals router for rpmsg router
Now the rpmsg router transport also support get the signals, and
this signals value is modified by other physical rpmsg transport
(port, virtio) other routed by the rpmsg router.

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-15 16:13:24 -03:00
yintao 492abaa052 drivers/rpmsg: unitfy the rpmsg signals from transport to struct rpmsg_s
Now all the rpmsg transport use the signals in struct rpmsg_s instead
add element in its own private struct.

Signed-off-by: yintao <yintao@xiaomi.com>
2026-01-15 16:13:24 -03:00
zhanghongyu 49f94e5e95 lpcxpresso-lpc54628/netnsh: enable CONFIG_NET_SOCKOPTS to adapt icmpv6 changes
The new icmpv6 uses setsockopt to set the filter.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 16:12:10 -03:00
makejian 5fb5e2ff4f docs: update crypto API documentation with supported algorithms
Document all supported cryptographic algorithms and their variants in the NuttX Crypto API subsystem, including:
- AES-CBC with 128/192/256-bit key sizes
- HMAC and hash functions
- AES GMAC and CMAC
- ChaCha20-Poly1305
- And other supported algorithms

This documentation provides a comprehensive reference for developers using the cryptographic services.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-15 16:11:19 -03:00
makejian 539c8f4ab2 crypto: add support for AES-CBC with 192/256-bit key sizes
Extend AES-CBC algorithm support to include 192-bit and 256-bit key sizes in addition to the existing 128-bit support. This enables broader compatibility with cryptographic standards and provides applications with additional key length options for enhanced security requirements.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-15 16:11:19 -03:00
guoshichao 117c28990a fpathconf: add _POSIX_PRIO_IO defintion
fix the /tset/rt.os/files/fpathconf/T.fpathconf{1}:
_POSIX_ASYNC_IO is not defined

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-15 16:10:51 -03:00
tengshuangshuang 9335f7f7e6 fpathcof: _PC_PRIO_IO value of -1 means that unsupported
pse52 test error:fpathconf failed, errno = 38 (ENOSYS)

Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
2026-01-15 16:10:51 -03:00
hujun5 92bbe4f6ac sched/tls: fix uninitialized argv pointer in task info
The TCB initializes the pid early, but the argvstack is not initialized
at that time. This may cause invalid addresses to be obtained when
nxsched_get_stackargs is called during task enumeration.
Initialize the argv pointer to NULL to enable safe validity checks.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-15 16:10:11 -03:00
zhangyu117 4e40393cc4 arch/tricore: record trapinfo for coredump
use global var record trap type and reason info for coredump

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-01-15 16:09:13 -03:00
zhangyuan29 31adcde41b arch/tricore: use PRId32 to fixed the correct int type
remove some compilation warnings.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-01-15 16:09:13 -03:00
zhangyu117 2a76bc9d5b arch/tricore: dump special registers about trap
In addition to general-purpose registers, tricore also provides special trap registers to record exception scenarios.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-01-15 16:09:13 -03:00
zhangyu117 909e63b63b arch/tricore: upcsa/lowcsa process && dumpinfo
tricore csa is not continuous. when assert prints information, we need to handle the regs specially in order to dump all the registers.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-01-15 16:09:13 -03:00
liwenxiang1 641d52fefa arch/tricore: Adapt to Trap Exception Display
When an exception occurs, print the exception type and reason.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-15 16:09:13 -03:00
guoshichao 2662473b83 sys/resouce: add RLIM_NLIMITS definition
Add the RLIM_NLIMITS macro with value 16 to sys/resource.h, indicating
the total number of supported resource limit types. This improves
POSIX header completeness and aids resource enumeration in applications.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-15 16:08:23 -03:00
xuxin19 e9e9c76a76 cmake(enhance):include-style defconfig can modified via menuconfig
1. enhanced process_config.py script: supports both preprocess and postprocess modes

2. in preprocess mode: handles include formats and recursively records the include config tree structure to prepare for postprocess

3. In postprocess mode: compares the original file with menuconfig to identify non-#include items that should be written back

4. olddefconfig stores the original compressed include defconfig file at the very beginning

5. savedefconfig saves both the original file and the written back include defconfig

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-15 15:42:17 -03:00
shichunma 476b7684b7 drivers/mmcsd: fix typo, it should be "Byte" by spec
As subject, it's confusing if with "b".

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-01-16 01:38:29 +08:00
guoshichao efa6c6823b libc: add creat function implementation
accoring to the PSE52 requirements, the creat() need to implementation
as a function.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 01:38:20 +08:00
wangjinjing1 d7ea114fb8 drivers/can: repair compiler error
Add function definition of "container_of" to fix compiler error.

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
2026-01-16 01:37:50 +08:00
guoshichao 4ce802900f pthead: change the pthread_equal implementation from macro to function
During the build of PSE52 VSX testcases, the pthread_equal() is accessed
in the form of a function pointer. Therefore, we have changed the
implementation of pthread_equal() from a macro to an actual function.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 01:37:38 +08:00
cuiziwei e9bbf2928b libcxx: porting libcxx test.
porting libcxx test case to nuttx.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-01-15 13:40:42 -03:00
Michal Lenc d53cd33bf5 arch/arm/src/samv7/Kconfig: fix incorrect SAMV7_EMAC0_RMII dependency
SAMV7_EMAC0_RMII should not depend on ARCH_CHIP_SAM4E as this is
a completely different chip. This is likely a relict from copying
the code base.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-01-15 16:39:14 +01:00
guoshichao ebd4173a95 sys/wait: add WCOREDUMP defintion
Add the WCOREDUMP() macro to sys/wait.h to indicate whether a terminated
process produced a core dump. This resolves implicit declaration warnings
in LTP kernel testcases and improves POSIX compliance.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-15 23:16:27 +08:00
guoshichao d8717aab78 sys/wait: add WTERMSIG implementation
Update the WTERMSIG() macro to extract the signal number from the wait
status, changing from constant 'false' to '(((s) >> 8) & 0x7f)' to match
POSIX semantics for processes terminated by signals.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-15 23:16:27 +08:00
zhanghongyu 6296aeecdb net/route/ramroute: replace prealloc with netpool
reuse the netpool module to optimize the code implementation.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 23:15:03 +08:00
ligd 8c95e9e05c freopen: fix fdsan report error
[<0x60ddce>] __assert+0x1d/0x5c
[<0x60f2be>] android_fdsan_exchange_owner_tag+0x71/0xc0
[<0x60a14e>] close+0x19/0x64
[<0xb77b1c>] freopen+0x47/0xd8
[<0x86fe54>] test_nuttx_fs_stream01+0x4f/0x1a4
[<0xcef54e>] cmocka_run_one_test_or_fixture+0xe5/0x3cc
[<0xcefd26>] _cmocka_run_group_tests+0x41d/0xbd8
[<0x86cff2>] cmocka_fs_test_main+0x35/0x58
[<0x6a9d1a>] nxtask_startup+0x15/0x30
[<0x641e92>] nxtask_start+0x75/0x94

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 22:58:17 +08:00
pengyinjie a8280b0eee freopen: close old file descriptor before reopening
Updated freopen function in libc stdio to close the old file descriptor before reopening the file.

Signed-off-by: pengyinjie <pengyinjie@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-01-15 22:58:17 +08:00
Xiang Xiao acb9a1a296 drivers/timers: check CONFIG_BOARD_LOOPSPERMSEC != 0 at runtime
this config is optional for arch timer/alarm
since it is used only in very early boot stage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-15 22:57:19 +08:00
zhanghongyu 5ce2955e62 net/netdev: correct the ioctl command validation logic
This patch fixes the validation order in netdev ioctl handlers for
Bluetooth, IEEE 802.15.4, and packet radio devices. The command type
should be validated before checking the argument pointer to return
the correct error code (-ENOTTY vs -EINVAL).

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-15 19:59:40 +08:00
wangchengdong 3e9190396e sched/hrtimer: fix Kconfig typo
Remove the duplicated dependency on SYSTEM_TIME64.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-15 12:25:54 +01:00
zhangyu117 8786c814f0 arch/tricore: syscall SYS_switch_context and SYS_restore_context use 0 para
after task switch optimization, we can just use g_running_tasks and this_task() without pass params

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-01-15 11:37:12 +08:00
zhangyu117 b8fd06cf0e arch/tricore: Inline up_switch_context
inline up_switch_context, avoid function call burden.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-01-15 11:37:12 +08:00
zhangyu117 69ed5f54f3 tricore: remove up_set_current_regs/up_current_regs
add g_interrupt_context to to identify interruption context

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-01-15 11:37:12 +08:00
zhangyu117 6b755dea45 arch/tricore: optimize task switching process
g_current_regs is only used to determine if we are in irq, with other functionalities removed.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-01-15 11:37:12 +08:00
liwenxiang1 8a15aebfea arch/tricore: Resolving gcc compilation warning
fix type error and add up_getusrpc()

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-15 11:37:12 +08:00
liwenxiang1 8da6b45939 arch/tricore: Regs for context switching save the memory address of the CSA.
In the exception panic process, regs needs to use a memory address, which defaults to PCXI. Here, it is uniformly saved as the actual memory address.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-01-15 11:37:12 +08:00
daichuan 68a5732d9a stdio.h: Update TMP_MAX definition to match Linux.
Update TMP_MAX from 56800235584ull to 308915776 to align with the value used in Linux.
This ensures better compatibility for applications relying on this standard macro.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-14 17:28:30 -08:00
wangchengdong c025cd96b4 sched/sched: Improve sched make and cmake scripts
Improve sched make and cmake scripts to select sched_processtimer.c
  and sched_timerexpiration.c separatly for tickless and non-tickless mode

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-14 16:59:39 -08:00
guoshichao 80fcbf7aa8 fsetpos: makes the fsetpos function comply with POSIX standard
Build Documentation / build-html (push) Has been cancelled
Change the 'pos' parameter of fsetpos() from 'fpos_t *' to 'const fpos_t *'
in both the prototype and implementation, aligning with POSIX specification
which requires the position parameter to be const-qualified.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-15 02:22:46 +08:00