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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>