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 implementation is from glibc, and the license is LGPL
This reverts commit 862244586976b9388f87dc639225d714dd70e4af.
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
reason:
We can utilize percpu storage to hold information about the
current running task. If we intend to implement this feature, we would
need to define two macros that help us manage this percpu information
effectively.
up_this_task: This macro is designed to read the contents of the percpu
register to retrieve information about the current
running task.This allows us to quickly access
task-specific data without having to disable interrupts,
access global variables and obtain the current cpu index.
up_update_task: This macro is responsible for updating the contents of
the percpu register.It is typically called during
initialization or when a context switch occurs to ensure
that the percpu register reflects the information of the
newly running task.
Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-net none -chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel ./nuttx
Signed-off-by: hujun5 <hujun5@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>
LD: nuttx
arm-none-eabi-ld: warning: net_sendfile.o: missing .note.GNU-stack section implies executable stack
arm-none-eabi-ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
arm-none-eabi-ld: warning: nuttx/nuttx has a LOAD segment with RWX permissions
arm-none-eabi-ld: apps/staging/libfeature.a(feature_framework.cpp.frameworks.base.feature_1.o): in function `std::__1::__throw_length_error[abi:un170006](char const*)':
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
Add _dl_find_object() function, because when cxx_exception configuration is enabled, a link error occurs and that function cannot be found.
ld: /usr/lib/gcc/x86_64-linux-gnu/13/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
(.text+0x250c): undefined reference to `_dl_find_object'
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
Follow the elf format, correct the memory region flag description:
Executable 0x1, Writable 0x2, Readable 0x4
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
In order to directly read the version information of the current file from elf or bin files, memory files, etc., for easy debugging and one-to-one correspondence.
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
Dynamically apply for memory based on numargs
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
libs/libc: Resolve the issue of undefined behavior when UBSAN is enabled on SIM
If numargs equals 0, it is set to 1 by default
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
struct sockaddr_in
{
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
uint8_t sin_zero[8];
};
sin_zero is probably a random number.
struct sockaddr_in6
{
sa_family_t sin6_family;
in_port_t sin6_port;
uint32_t sin6_flowinfo;
struct in6_addr sin6_addr;
uint32_t sin6_scope_id;
};
sin6_flowinfo and sin6_scope_id is probably a random number.
Random numbers cause the same server configuration check failed,
so let's initialize it.
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>