Commit Graph

1968 Commits

Author SHA1 Message Date
wangmingrong1 6e12b3d74b libc/utsname: Only store version in RAM, use rodata for all others
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-12 15:36:28 +08:00
wangmingrong1 f233c5860c libc/lib_utsname: Store version number for debugging and preventing optimization
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>
2024-10-12 15:36:28 +08:00
liwenxiang1 056aa3c816 libs/libc: Optimize the stack space of lib_vsprintf by splitting arglist into type and value
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>
2024-10-12 14:35:49 +08:00
zhanghongyu 3c3865bce0 netdb: fix may add duplicate DNS servers
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>
2024-10-12 14:20:08 +08:00
hujun5 b96a753747 libs/libc: There is no need to use sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-12 13:28:23 +08:00
anjiahao 0dd5228259 modlib:if use LMA, not set bss
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 4f92d7aafd modlib:Allow loading elf from block devices
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 434442d707 modlib:move modlib_findsection to common headfile
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
dongjiuzhu1 a3f3918198 binfmt/modlib: move modlib_sectname to public
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 2be58054bb modlib_bind:add new args export and nexport to modlib_bind
if modp is NULL, we can use export and nexport load externl symbol

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 1fc2cd7816 binfmt:use modlib api inside of elf api [1/2]
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 2931d1e85f modlib:support modlib can load exec
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 9c191e93b7 modilib:add new args to modp record init arry
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao e9550783d3 modlib:add new api to uninitialize modp
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 91c7e8e44b modlib:move Exception section logic to modlib
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao dfc5e4dd55 modlib:Move addrenv logic to modlib
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 4ec4c5e1b4 modlib:fix bug when read modlib sections name
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 489223f0d5 modlib:move get file info logic to modlib
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao 18d113e06e modlib:move elf LMA logic to modlib
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
anjiahao ae4538646b modlib:Modify modlib loading DYN elf file conditions
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
makejian b27272936b nuttx/libc: mutex support to set default mode even configured with priority protect
Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-12 09:50:54 +08:00
makejian e8a890ef42 nuttx/syscall: export nxsem_getprioceiling and nxsem_setprioceiling via syscall
Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-12 09:50:54 +08:00
xuxingliang b9adff0e90 libm/newlib: remove -Wno-maybe-uninitialized
Since there's no warning presents now.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-11 19:52:52 +08:00
yinshengkai 211a56910a syslog: support syslog redirection to sched_note
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 01:30:11 +08:00
ligd e608d5522d syslogmask: add default value Kconfig to syslogmask
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 01:30:11 +08:00
wangmingrong1 300ce45365 libc/machine: Fix the error caused by tag kasan
Use address addition and subtraction, no longer as the return value of the address. Tags must be removed before calculation

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-11 01:29:56 +08:00
yinshengkai ba2865f20a sched: support backtrace record
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 00:37:27 +08:00
yinshengkai 1a00ca3cd7 libc: rename lib_execinfo.c to lib_backtrace.c
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 00:37:27 +08:00
yinshengkai d375a09c0a libs: add gprof arm64 support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 18:46:51 +08:00
yinshengkai eb8449cb0c sched/gprof: add gprof support
gprof can analyze code hot spots based on scheduled sampling.
After adding the "-pg" parameter when compiling, you can view the code call graph.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 18:46:51 +08:00
liwenxiang1 2f26323388 arch/libc: Integrate vfork into fork, and vfork directly call up_fork
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 08:45:03 +08:00
zhangwenjian 18497e5bc6 long double need use the format of 'Lf'
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-09 23:00:59 +08:00
liwenxiang1 4c19e75ff5 libs/x86_64:Add the setjmp/longjmp function
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 22:24:03 +08:00
Windrow14 90836e5db1 libs/libc/fdt/Make.defs: cannot move due to directory not empty bugfix
Remove old directory so that "mv" can succeed instead of triggering "Directory not empty" error.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-10-09 15:42:17 +08:00
anjiahao fa59adde40 Simplify BOARD_MEMORY_RANGE initialization logic
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-09 15:41:48 +08:00
xuxingliang 89f3ef4480 gdbstub: add RLE compression
Refer to
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Overview.html

w/o compression, nxgcore command took 41seconds.
w compression, 28second.

If we enable `set trust-readonly-sections on` to read from elf whenever
possible, it furture reduces to 14.9seconds.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-09 15:41:48 +08:00
anjiahao 5817f6153d gdbstub:expand buffer size to increase transfer speed
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-09 15:41:48 +08:00
anjiahao e0bcad3a1d gdbstub:support gdbstub memory access control
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-09 15:41:48 +08:00
Xiang Xiao b068e2357a circbuf: Move from mm/circbuf to libs/libc/misc
so that it can be used by userspace program.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-09 08:41:49 +08:00
fangpeina b5145c528e misc/assert: add backtrace dump support for mutex hold task
Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2024-10-09 08:37:01 +08:00
cuiziwei 39576af753 libcxxabi: Optimize cxx code size
enable LIBSUPCXX:
text data bss dec hex filename
93080 592 5472 99144 18348 nuttx/nuttx

enable LIBCXXABI:
before:
text data bss dec hex filename
126468 352 5960 132780 206ac nuttx/nuttx

after:
text data bss dec hex filename
68048 352 5960 74360 12278 nuttx/nuttx

Summary:
Optimize text segment code size by about 46%.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-09 01:35:13 +08:00
Xu Xingliang b75412d96a libc/base64: check buffer overflow for last char
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-10-08 22:33:19 +08:00
Xu Xingliang 64e3a1fa0b libc/stream: add base64 encoded stream output
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-10-08 22:33:19 +08:00
Xu Xingliang 127527acf6 libc/stream: increase nput in hexdumpstream
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-10-08 22:33:19 +08:00
anjiahao e9e01506d3 dlcn:need select MODULES when compile
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-08 19:56:33 +08:00
Philippe Leduc 80e578c9aa Fix ctypes.h locale macro 2024-10-08 08:13:42 +08:00
cuiziwei 97359a7f76 nuttx/libxx: Simplify compilation warnings for passing CXXFLAGS.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-07 00:46:45 +08:00
anjiahao a613bcb7cb modlib:add new dump api to modlib
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-05 15:22:02 +08:00
anjiahao a9cb28cd23 modlib:Standardized module loading method
1. use '__attribute__((constructor))' mark initialize function
2. use '__attribute__((destructor))' mark uninitialize function
3. compile module with -fvisibility=hidden. use `__attribute__((visibility("default")))`
mark is need export symbol.so not need module_initialize to initialize export symbol.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-05 15:22:02 +08:00
chenxiaoyi b39807fae0 sim: add windows64 setjmp/longjmp support
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2024-10-04 08:21:35 +08:00