This reverts commit 8f96e59aee9cd0c5bbb82e01044d109f8588fec2.
The implementation of __dso_handle is independent of the HOST OS but dependent on the specific compiler.
Therefore, this patch will cause compilation failures for other cross-compilers on the Windows platform, such as arm-none-eabi-gcc and aarch64-none-elf-gcc.
Constraints should be applied to compiler target rather than compiler host.
Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
Commit 1a8bac11a5a moved negative sign handling from strtox() into
decfloat()/hexfloat() so that y carries the sign directly. However,
the range check at the end of decfloat() was not updated accordingly:
if (y < FLT_MIN || y > FLT_MAX)
FLT_MIN/DBL_MIN/LDBL_MIN are the smallest positive normalized values
(e.g. FLT_MIN ~ 1.17e-38). Any negative float (e.g. -9.87) is less
than FLT_MIN, so the check incorrectly sets errno to ERANGE. This
causes sscanf/fscanf to treat the conversion as failed, returning 0
instead of 1 for all negative floating-point inputs.
Fix by using fabsl(y) in the range comparisons, consistent with how
hexfloat() already uses fabsl() after the same commit.
Failing tests before fix (scanftest):
Test #56: sscanf("-9.87654321", "%f") -> returned 0 instead of 1
Test #59: sscanf("-9.87654321e8", "%f") -> returned 0 instead of 1
Test #61: sscanf("-9.87654321e-8", "%f") -> returned 0 instead of 1
Test #64: sscanf("-9.87654321", "%lf") -> returned 0 instead of 1
Test #67: sscanf("-9.87654321e8", "%lf") -> returned 0 instead of 1
Test #69: sscanf("-9.87654321e-8", "%lf") -> returned 0 instead of 1
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
change the environ implementation from sched/environ to
libc/environ, thus we can access the environ related API can vai libc
directl, which could improve the access speed in kernel build.
And in order to support this modification, we change the
struct task_info_s's ta_lock from nxmutex_t to nxrmutex_t,
this is because the env_*-related APIs require the ta_lock
to be reentrant.
If recursive locks are not supported, it may lead to deadlocks
in certain scenarios. For example, during initialization on the
qemu-miwear platform, it is necessary to call getenv while already
holding the ta_lock. To support such cases, we need to change
the ta_lock from nxmutex_t to nxrmutex_t.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
https://pubs.opengroup.org/onlinepubs/9799919799/functions/abort.html?utm_source=chatgpt.com
Per POSIX.1-2024, abort() must:
- Override blocking or ignoring of SIGABRT
- Raise SIGABRT to calling thread
- If the signal is caught by a handler that returns,
reset disposition to SIG_DFL and raise SIGABRT again
- Ensure abnormal termination occurs and never return
NuttX's prior implementation directly called _exit(EXIT_FAILURE),
which bypassed signal semantics and failed PSE52 abort test.
This patch restores correct POSIX behavior by unblocking SIGABRT,
raising it (with handler support), and enforcing default termination
if needed.
Signed-off-by: pengyinjie <pengyinjie@xiaomi.com>
If the subject sequence does not have the expected form, no conversion is performed; when endptr is not a null pointer, the value of nptr shall be stored in the object pointed to by endptr.
For example, after calling strtol(" ABC", &endptr, 10);, endptr should point to the first space ' ', not to 'A'.
Refer to: https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtol.html
Signed-off-by: anpeiyun <anpeiyun@xiaomi.com>
misc/lib_idr.c:46:3: error: unknown type name 'mutex_t'
46 | mutex_t lock;
| ^~~~~~~
misc/lib_idr.c: In function 'idr_alloc_u32':
misc/lib_idr.c:254:11: error: 'ENOSPC' undeclared (first use in this function)
254 | return -ENOSPC;
| ^~~~~~
stdio/lib_printf.c: In function 'printf':
stdio/lib_printf.c:46:18: error: 'STDOUT_FILENO' undeclared (first use in this function)
46 | ret = vdprintf(STDOUT_FILENO, fmt, ap);
| ^~~~~~~~~~~~~
stdlib/lib_rand48.c: In function 'seed48':
stdlib/lib_rand48.c:97:3: error: implicit declaration of function 'memcpy' [-Werror=implicit-function-declaration]
97 | memcpy(p, g_seed48, sizeof(p));
| ^~~~~~
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
for example:
When:
path_template:/data/quickapp/cache/ncm_XXXXXX
xlen is equal to BIG_XS
retries will be set to UINT32_MAX
then:
The stat operation fails due to issues with drivers, memory problems,
or file system operations and continuously returns an error other than ENOENT,
it will keep retrying, which may cause the watchdog timer to time out.
Signed-off-by: guohao15 <guohao15@xiaomi.com>
1. The -c parameter should not be added during the link phase, otherwise the link will fail.
2. If it is the clang compiler, its toolchain library should use --print-file-name to find it, otherwise an error will occur
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
Change syslog API naming more reasonable:
1. rename syslog_channel() to syslog_channel_register()
2. rename syslog_channel_remove() to syslog_channel_unregister()
Signed-off-by: chao an <anchao@lixiang.com>
Comminity has upgrade the openamp to the last commit (near 2024.05 Release),
sync back to vela.
Only modify the makefile and upgrade the patch, should be no impact in any
features.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
The segment of the Xen PVH boot protocol was not specified during linking and was placed before .loader.text, causing the boot to fail
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
since bootloader may call modlib functions directly
to load elf firmware without binfmt, dlfcn or module.
BTW, this patch also remove the duplicated selecttion
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This reverts commit 4e9f8176a08aa25c7173bc4c748e721b0841ddac.
Reason for revert:
This patch are using to fix the following build warning when build with greenhills compiler:
CC: syslog/vsyslog.c "pthread/pthread_create.c", line 443: warning #1931-D: operand of sizeof is
not a type, variable, or dereferenced pointer expression
ptcb->cmn.timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
CC: dirent/lib_closedir.c "sched/sched_profil.c", line 81: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
wd_start(&prof->timer, PROFTICK, profil_timer_handler, arg);
^
"sched/sched_profil.c", line 142: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
wd_start(&prof->timer, PROFTICK, profil_timer_handler, (wdparm_t)prof);
^
CC: common/arm_modifyreg8.c "sched/sched_setscheduler.c", line 165: warning #1931-D: operand of sizeof is
not a type, variable, or dereferenced pointer expression
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
CC: misc/lib_utsname.c "sched/sched_unlock.c", line 275: warning #1931-D: operand of sizeof is not a
type, variable, or dereferenced pointer expression
rtcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
"sched/sched_roundrobin.c", line 119: warning #1931-D: operand of sizeof is
not a type, variable, or dereferenced pointer expression
tcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);
^
we need to keep the modification
/usr/bin/ld: nuttx.rel: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
stdio/lib_libvsprintf.c:1018:17: runtime error: negation of -9223372036854775808 cannot be
represented in type 'long long int'; cast to an unsigned type to negate this value to itself
#0 0x3326a86 in vsprintf_internal stdio/lib_libvsprintf.c:1018
#1 0x332926b in lib_vsprintf stdio/lib_libvsprintf.c:1363
#2 0x3777978 in vfprintf stdio/lib_vfprintf.c:52
#3 0x671b3a0 in printf stdio/lib_printf.c:44
#4 0x37abc0c in hello_main /data/project/code/vela-pt/apps/examples/hello/hello_main.c:38
#5 0x33201d3 in nxtask_startup sched/task_startup.c:70
#6 0x3208ecb in nxtask_start task/task_start.c:134
#7 0x3357a49 in pre_start sim/sim_initialstate.c:52
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>