Commit graph

60401 commits

Author SHA1 Message Date
lipengfei28
efedf48cde arch/arm64: use up_prioritize_irq and up_set_type_irq instead
arm64_gic_irq_set_priority

use use up_prioritize_irq and up_set_type_irq as std api

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-01-16 20:26:14 +08:00
lipengfei28
e70c31162a arch/arm: add api to config irq type
arm add api to config irq type

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-01-16 20:26:14 +08:00
lipengfei28
ddb797b0ab arch/arm64: add api to config irq type
arm64 add api to config irq type

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-01-16 20:26:14 +08:00
lipengfei28
54e6c0c1d9 irq: add api to config irq type
add api to config irq type

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-01-16 20:26:14 +08:00
hujun5
5e03a56c8f drivers/misc/optee: add missing addrenv header include
Fix compilation error in optee_va_to_pa() caused by undefined 'struct addrenv_s'
type when CONFIG_ARCH_ADDRENV is enabled. Add the missing nuttx/addrenv.h header
to provide the required type definition.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 09:04:12 -03:00
Alexey Matveev
1a00d1b5c7 boards/stm32f103-minimum: Add GPIO in/out/int define
Added conditional compilation guards (#if/#endif) around GPIO function prototypes, operation structures, and interrupt handler to ensure proper compilation when GPIO input, output, or interrupt features are disabled.

Signed-off-by: Alexey Matveev <tippet@yandex.ru>
2026-01-16 08:57:09 -03:00
hujun5
2a08860a08 arch/arm64: fix backtrace register access and gdbstub config guard
Fix arm64_backtrace to access TCB register context directly instead of using
running_regs(), which may not reflect the actual context being backtraced.
Add CONFIG_ARCH_HAVE_DEBUG guard to prevent undefined references in non-debug builds.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 08:55:47 -03:00
hujun5
f3f9b7ecae libs/libc/gdbstub: fix smpcall called in irq context
Replace synchronous nxsched_smp_call with asynchronous nxsched_smp_call_async
in gdb debugpoint operations to prevent deadlocks when called from IRQ handlers.
Use static smp_call_data_s for async communication between SMP cores safely.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 08:55:47 -03:00
hujun5
ac8a61d70b arm64: add the interrupt status in the syscall
Set interrupt status flag in tpidr_el1 register (bit 0 set to 1) when entering
syscall handler to indicate IRQ-in-progress state, and clear it when exiting
to properly track kernel execution context across all code paths.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-16 08:55:07 -03:00
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
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