Add key management interfaces and support for generating key pairs in RSA and ECDSA cryptographic processes to the cryptodev module.
Signed-off-by: makejian <makejian@xiaomi.com>
To ensure consistency, in all places where the "sendmsg" function is used
either directly or indirectly, the type of the "struct msghdr *msg" parameter
needs to be modified to "const struct msghdr *msg".
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
The notifier doesn't need to hold the critical section for the entire
operation, allowing for better performance and reduced lock contention
on multi-core systems.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fix the /tset/rt.os/files/open/T.open{2}:
O_RSYNC flag not set
According to the POSIX standard, when we set the oflags
for a file descriptor via open, retrieving these oflags
later via fcntl should yield the same values as those
passed during the open call.
Given this, if the value of O_RSYNC were zero, then even
if O_RSYNC were passed during the open call, it would not
be detectable in the oflags retrieved by fcntl.
Therefore, we need to define O_RSYNC as a non-zero value.
For this reason, we have chosen to set the value of
O_RSYNC to be the same as O_SYNC.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
Add the generic _IO() macro and aliases for FS_IOC_GETFLAGS and FS_IOC_SETFLAGS,
aligning the ioctl.h definitions with the Linux kernel API to improve source
compatibility when porting LTP linux kernel testcase code to NuttX
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
The hrtimer is designed to replace the wdog timer in future, so it
should have the callback function in its API. The evaluation results showed there is no any
performance degradation since the CPU pipeline can hide the latency.
This commit also decoupled the rb-tree implementation with the pending
state checking.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
rename nxsched_timer_expiration to nxsched_tick_expiration
to align with nxsched_process_tick()
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Implement gnss_get_info callback function to support device information query for GNSS sensor devices through the sensor framework.
Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
According to the test results, the restart interface offers no
performance improvement and requires additional state to encode the
non-pending state. This commit removed the wd_restart API to simplify
the wdog module.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
issue description:
task A: NSH:
1.open-> reboot->sync->task_fsfsync
2.nx_vopen-> context switch
3.fdlist_allocate: ----> 4.fsync->file_sync->assert(inode or priv is empty)
(new fd with empty filep)
5.file_vopen:
(init empty filep)
6.return fd
Task A allocates a new fd with an empty filep in fdlist_allocate. Before
it can fully initialize the filep in file_vopen, the NSH task triggers a
file - system sync operation. The sync operation encounters the empty
filep associated with the newly allocated fd, causing the assertion to
fail and the system to crash.
To resolve this race condition, we should modify the fd allocation
process. Instead of allocating a new fd with an empty filep first and
then initializing it later, we should use the file_allocate_from_inode
function. This function allows us to initialize the file structure first
and then bind it to the new filep when allocating the fd. By doing so,
we ensure that the filep is always properly initialized before it is
used in any file - system operations, thus preventing the assertion
failure and the subsequent system crash.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
Add basic timer operations to the kernel, including registration,
start/stop, and callback handling. This provides a consistent timer
interface for use by kernel components and drivers.
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
Fix incorrect and non-existent flag usage in LIN handling:
- Replace undefined CANFD_FLAGS_BITS usage with valid bit definitions.
- Reassign CAN_TCF_FLAG to an available flag bit, as it is not defined in can.h.
- Add an identifier for LIN noise error frames.
Signed-off-by: wangxiaoxin <wangxiaoxin@xiaomi.com>
rpmsg_test is a rpmsg api test service inside the kernel, and user
can use ioctl to start this test.
Signed-off-by: mazhuang <mazhuang@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: wangshaoxin <wangshaoxin@xiaomi.com>
This commit renamed the callback type to `hrtimer_entry_t`, aligning with
the `wdentry_t` in wdog..
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
Replace enter_critical_section() with spinlock-based protection to
avoid sleeping in atomic or interrupt contexts.
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
Fix the misspelling of the tick timeout API name
(tick_settimeouot -> tick_settimeout) for clarity and correctness.
This corrects a typographical error in the function/config name that
could lead to confusion and incorrect usage. No functional logic is
changed by this rename.
Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
Allow running/armed hrtimer to be restarted to
fix hrtimer bug: #17567
Co-authored-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>