Commit Graph

1977 Commits

Author SHA1 Message Date
zhanghu5 f8f6bfff29 use r1-r3 as tmp register
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-10-13 10:12:27 +08:00
chao an c37b0de28c libc/atomic: decoupling atomic and spinlock to avoid recursion
1. use irq save in AMP mode
2. use critical section in SMP mode

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-13 10:00:22 +08:00
yinshengkai 38e474b0c5 libc: add CRC-8-ROHC support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 03:09:26 +08:00
Bowen Wang 821196eb22 lib_uuid_create: try use hardware random number generators first
Try the hardware random number generators is better for uuid generator

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 02:44:25 +08:00
liwenxiang1 8d09eaaee0 libs/libc:Openlibm adds exp10 and exp10f function implementations
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-13 02:31:44 +08:00
liwenxiang1 1c65fbf15a libc/newlib:Declaration of adding depth
Resolve the issue of inability to compile when opening newlib

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-13 02:30:51 +08:00
Bowen Wang 101b147a24 lib_memoryregion: fix the comments about the memory flags
Follow the elf format, correct the memory region flag description:
Executable 0x1, Writable 0x2, Readable 0x4

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 02:28:55 +08:00
xuxin19 351781d601 cmake:refine nuttx cmake build system fix CMake build missing part
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 02:25:06 +08:00
Bowen Wang b5b0430c39 net/vsock: add AF_VSOCK address family
Add AF_VSOCK address family support, This is the vsock framework
preparation patch.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 02:02:03 +08:00
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