Commit Graph

60392 Commits

Author SHA1 Message Date
guoshichao 54ff28a47f sys/types.h: Fixed the conflict issue with the "OK" constant definition
When cross-compiling PSE52 VSX testcases based on Vela, VSX defines its
own "OK" constant as a macro, which conflicts with the "OK" constant
defined as an enum in <sys/types.h>. To ensure compatibility, we
have undef'd the macro version of "OK" in advance.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 16:16:21 +08:00
guoshichao b945c7b505 limits: add _POSIX_PTHREAD_ constant for pthread management
Add three POSIX‑required pthread‑related constants to limits.h:
- _POSIX_THREAD_DESTRUCTOR_ITERATIONS
- _POSIX_THREAD_KEYS_MAX
- _POSIX_THREAD_THREADS_MAX

These constants are needed for full POSIX pthread compatibility and are
required by certain PSE52 test suites and applications.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 16:15:35 +08:00
guoshichao ab572fe1cf lib_ulimit: fix the variable uninit coverity issue
Build Documentation / build-html (push) Has been cancelled
Initialize the rlim_max field in the rlp structure when handling
UL_SETFSIZE command in ulimit(), resolving an uninitialized variable
warning from Coverity static analysis.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 10:03:53 +08:00
guoshichao 71889ff22e ulimit: add ulimit implementation
implement the ulimit() based on getrlimit/setrlimit function.
the ulimit() function is requiredd by vsx testset

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 10:03:53 +08:00
daichuan cf8dacde9c netinet/in.h: Rename imr_interface to imr_address in struct ip_mreqn.
Rename imr_interface to imr_address in struct ip_mreqn to match the Linux definition.
This ensures compatibility with standard socket APIs and existing Linux applications.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-16 09:42:12 +08:00
zhanghongyu be74eec727 rpmsgdrv.c: add spinlock to protect rxqueue
avoid race conditions when the rpmsg thread and network card thread
access the rxqueue simultaneously.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu ba4361ccd8 drivers/net/rpmsgdrv.c: rename priv to drv and priv_ to priv
optimize variable naming to improve code readability

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu be3ad13260 drivers/net/rpmsgdrv.c: add bidirectional data netdev support, server side
Server side: when ns_bind, create the netdev.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu 34b350e66e drivers/net/rpmsgdrv.c: add bidirectional data netdev support, clien side
It's the first simple version of rpmsg-net, include:
- Transfer command with data copy (maybe optimize later), no need to ack
- Control command with ack, but only ifup/ifdown no need to ack
- Client side: Another module can call `net_rpmsg_drv_alloc` to
  create netdev and register it.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu f914bb8f03 drivers/net/rpmsgdrv.c: add response flag to distinguish message direction
control messages add a confirmation mechanism.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu 4ce3dac146 net: move the tool interface functions to the public directory
expose the query interface of the network card to the network card
driver so that the network card driver can support more features.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
zhanghongyu 1f48d4d940 drivers/net/rpmsgdrv.c: adaptation netdev_upperhalf
simplify the code logic of rpmsgdrv.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:42:01 +08:00
v-zhangxiaomeng5 6ce6af9004 libcxx: supports CXX_MINI_LOCALIZATION
This commit contains changes:
1) define new C++ locale macros CXX_MINI_LOCALIZATION & CXX_NO_LOCALIZATION
2) define a new C++ macro _LIBCPP_HAS_MINI_LOCALIZATION for CXX_MINI_LOCALIZATION
3) update libxx/libcxx/CMakeLists.txt & Make.defs

Signed-off-by: v-zhangxiaomeng5 <v-zhangxiaomeng5@xiaomi.com>
2026-01-16 09:41:40 +08:00
guoshichao ba63a4d234 ghs: fix the UsageFault:INVSTATE error triggered by exception_common
when we build with greenhills compiler, if the exception_common function
is put into a separate section: ".text.exception_common", then the
address of exception_common function is an even number, for example "0x16a6c",
in this case, it will trigger the UsageFaults:INVSTATE error.
The reason for this error is that in the GHS compiler, a section declared
through the ".section" directive must specify at least the "a" attribute.
Otherwise, this section will not be linked into the final file, and this
is why the address of exception_common function is invalid.
The following is the official explanation in the GHS compiler documentation:
"The reason for this error is that in the GHS compiler, a section
declared through the .section directive must specify at least the "a"
attribute. Otherwise, this section will not be linked into the final
file. The following is the official explanation in the documentation:
"Sections that are intended be part of the final linked output should
have at least the `a` attribute"
and for GHS compiler, the .text section is recommended specify the
attribute of `ax`.

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-16 09:41:13 +08:00
zhanghongyu da43a2e53b tcp_timer.c: send TCP_RST when keepalive timeout
The RFC requires sending an TCP_RST packet in this scenario, so to better
comply with the standard definition, the sending of TCP_RST is added.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-16 09:39:45 +08:00
guanyi3 f99dd20c4e sim/usrsock: move g_work_queue init before net_initialize
usrsock register work in net_initialize before g_work_queue is created, so move g_work_queue in irq_initialize.

Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
2026-01-16 09:39:02 +08:00
guanyi3 7dde767155 sim: add global work queue to replace HPWORK
rpmsg work in hpwork are waiting for remote buffer, remote get buffer and callback, but callback also in hpwork, deadlock occurs here.
now we move periodic work to global work queue instead of hpwork to fix deadlock.

Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
2026-01-16 09:39:02 +08:00
guanyi3 27c9d388d9 sim: replace wdog to work queue to avoid deadlock
The wdog callbacks are executed in the host's signal handler context, which has strict limitations on what operations can be safely performed. Specifically, signal handlers should not call non-async-signal-safe functions (e.g., sim_alsa use mutex_lock in wdog and cause deadlock).

This change only replaces uses of wdog for periodic tasks. Other interrupt callbacks that are still invoked from the host signal handler are not replace to work queue.

Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
2026-01-16 09:39:02 +08:00
daichuan 1817484bcd arch/sim: support SOCK_RAW in host_usrsock_socket
Convert NUTTX_SOCK_RAW to native SOCK_RAW in the simulator usrsock implementation.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-16 09:38:46 +08:00
daichuan df7a58dab8 net/neighbor: fix compilation with CONFIG_NET_ICMPv6_NO_STACK
When CONFIG_NET_ICMPv6_NO_STACK is enabled, icmpv6_solicit should not be called.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-01-16 09:38:27 +08:00
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