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>
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>
X86_64:nit bar in bios, so in nuttx, the bar is setuped
kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
d_len needs to include NET_LL_HDRLEN(dev) to avoid errors in
the verification of message length in ipv4_in/ipv6_in.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
Removes CXX initialization from the 'ble' configuration, preventing it
from crashing at boot time.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
[checkkconfig.py] is a tool that simulates the effects of modifying a CONFIG item,
Can be used to check whether my config changes are what I expected.
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
- fix chip/imxrt_clockconfig_ver1.h:23: error: header guard '__ARCH_ARM_SRC_IMXRT_IMXRT_CLOCKCONFIG_VER1_H' followed by '#define' of a different macro [-Werror=header-guard]
Signed-off-by: simbit18 <simbit18@gmail.com>
the MTD ERASE interface has inconsistent return values.
Some implementations return the number of erased sectors,
while others return OK (0). It is currently recommended
to uniformly treat ERASE success as OK. Therefore, the
logic for judging the return value of MTD_ERASE in the
FTL erase interface should be changed to check if it is
greater than 0.
Signed-off-by: jingfei <jingfei@xiaomi.com>
Since there is a storage device like RRAM that doesn't
require erasing, the MTD erase function may not exist.
Here, we should first check whether the erase interface
exists before performing the erasing operation.
Signed-off-by: jingfei <jingfei@xiaomi.com>
Accessing RRAM/MRAM from the FTL interface can
cause errors because RRAM lacks an erase interface.
To make RRAM/MRAM compatible with FTL, the FTL layer
erase interface needs to be modified.
Signed-off-by: jingfei <jingfei@xiaomi.com>
When there's no erase function for mtd, we decide if we
need erase_buffer based on this:
1. If we've got bad block marking, we still need the erase buffer.
If a write fails, it's used to read back the entire bad block's
contents before writing to a new block.
2. If we don't have bad block marking, the erase buffer isn't
needed and can be skipped.
Signed-off-by: jingfei <jingfei@xiaomi.com>
the -ffunction-sections and -fdata-sections are also supported by
greenhills, and these two compile options can benefit with section
layout optimization, and thus reduce the final image size
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
According to the Greenhills documentation, the "-Wall" option is
deprecated for use. Instead, the "-ghstd=last" option is recommended.
Compared with "-Wall", the "-ghstd=last" option can capture more
warnings and has stricter rules.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>