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>
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>
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>
implement the ulimit() based on getrlimit/setrlimit function.
the ulimit() function is requiredd by vsx testset
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
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>
avoid race conditions when the rpmsg thread and network card thread
access the rxqueue simultaneously.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
In addition to general-purpose registers, tricore also provides special trap registers to record exception scenarios.
Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
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>
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>
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>