Commit graph

56669 commits

Author SHA1 Message Date
xuxingliang
ad1be85be7 tools/gdb: catch exception when there's no selected frame
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
bbf51ba071 tools/gdb: no need to read the whole memory firstly
Read the whole memory costs additional time. When the number memory nodes is
small, test on qemu shows that read memory directly is faster.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
12783c031c tools/gdb: only define c and s when thread comands enabled
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
yinshengkai
b81212e96f tools/gdb: Add memory fragmentation rate calculation
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
9dbf58f1be tools/gdb: optimize memleak speed
1. Avoid to_bytes by using memoryview directly.
2. No need to call gdb to cast to char *.
3. Cache the memory data without invoke gdb in every iteration.
4. Do code cleanup.

memleak speed improved from 261.93 seconds to 29.9 seconds for x4b
usecase.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
4e067fd762 tool/gdb: use second inferior to get symbol
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
yinshengkai
614e07c8f0 tools/gdb: supports generating memory map images
Display all memory nodes in a picture, which can be used to help analyze memory fragmentation

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-21 23:08:55 +08:00
xuxingliang
2f8c9070c5 tools/gdb: use native thread command
For coredump, gdb-stub, the thread command is natively supported.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-21 23:08:55 +08:00
anjiahao
089877c693 memleak:support use gdb to catching absolute memory leaks
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-11-21 23:08:55 +08:00
Zhe Weng
752245aca4 net: Move NET_TCP/UDP_HAVE_STACK to netconfig.h
Now the HAVE_PFINET(6)_SOCKETS depends on NET_TCP/UDP_HAVE_STACK, which
is previously defined in net/ folder and cannot be included.
Considering many places use this check, maybe moving them to netconfig.h
could be better.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-11-21 23:07:30 +08:00
Jouni Ukkonen
085830612c arch/arm64/imx9: Fix cntfrq_el0 to correct value
Read base frequency from system counter0 and write it
to arm core register. This corrects timers to work properly
Then enable counting.

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-21 11:26:45 -03:00
wangmingrong1
1d04884812 gcov: Add toolchain gcov dependency option
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-21 21:32:06 +08:00
wangchen
b58eaf7bc8 lib_getifaddrs.c:set the last multi ipv6addr next pointer to be NULL
If the pointer is not set to zero, it will erroneously point to itself, resulting in an erroneous loop pointing

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-11-21 21:31:28 +08:00
meijian
4e7f323633 net/getifaddrs: fix coverity bug
Signed-off-by: meijian <meijian@xiaomi.com>
2024-11-21 21:31:28 +08:00
meijian
884a6803d6 net/getifaddrs: Support multiple IPv6 addresses for getifaddrs
Signed-off-by: meijian <meijian@xiaomi.com>
2024-11-21 21:31:28 +08:00
guoshichao
f6cfcfa39f armv6-m: fix the incorrect stub-function entry address of svc call
the stub-function entry address is stored in r4, we should branch to the
stub-function with blx r4, not r5

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-11-21 20:08:42 +08:00
cuiziwei
58f226d2b5 libcxxmini: Add missing runtime related classes.
reference:https://github.com/libcxxrt/libcxxrt/tree/master/src

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-21 20:03:15 +08:00
Peter Bee
3e6913775d fix(rp2350): should copy data before init clock
Signed-off-by: Peter Bee <peter@PeterdeMac-mini.local>
2024-11-21 20:00:17 +08:00
cuiziwei
42ea6fd7a0 Revert "sim/make: fix macos sim:nsh make break, no -mcmodel in clang"
This reverts commit 56c920ce5d.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-21 18:16:30 +08:00
hujun5
12cd59b3e6 arch_atomic: use small lock in libs/libc/machine/arch_atomic.c
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-21 16:35:29 +08:00
cuiziwei
f0e03f6c3c Unify the linking options for 32-bit and 64-bit to text-segment=0x30000000.
In order to be compatible with 32-bit and 64-bit compilation, set the text-segment to 0x30000000.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-21 16:13:52 +08:00
cuiziwei
feb38c43f2 sim/m64: Fix ld error.
/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>
2024-11-21 12:13:14 +08:00
stbenn
9cd0ea32ea arch/stm32h5: Add timer register hardware file
This commit adds register definitions for advanced, basic, and general purpose timers. Formatting convention was taken from the H7 hardware timer header.
2024-11-21 10:54:10 +08:00
simbit18
7df0e945ad Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Replace help => ---help---
Remove extra TABs
Add comments
2024-11-20 16:45:40 -03:00
Peter Bee
c0f776dbc3 follow upstream change & fix minor things
Signed-off-by: Peter Bee <pbjd97@gmail.com>
2024-11-20 16:32:05 -03:00
Peter Bee
48ded21e30 refine driver
Signed-off-by: Peter Bee <pbjd97@gmail.com>
2024-11-20 16:32:05 -03:00
Marco Casaroli
dac3f315a1 uf2 2024-11-20 16:32:05 -03:00
Marco Casaroli
18ee2d9130 board(rp23xx): add Pimoroni Pico 2 Plus 2024-11-20 16:32:05 -03:00
Marco Casaroli
8d0fce0e30 fixup! board(rp23xx): add Raspberry Pi Pico 2 2024-11-20 16:32:05 -03:00
Marco Casaroli
c5b81401d8 arch(rp23xx): add files 2024-11-20 16:32:05 -03:00
Marco Casaroli
566f31f14c board(rp23xx): add Raspberry Pi Pico 2 2024-11-20 16:32:05 -03:00
Marco Casaroli
7c55890247 doc(rp23xx): add arch and board documentation 2024-11-20 16:32:05 -03:00
Marco Casaroli
047b832f24 rp23xx: add pico-sdk files
These files were copied from a config of pico-sdk 2.0.0.

They provide struct address mapped access to peripherals, along
with register definitions. It also provides some compiler helpers
that are partially used by the port.
2024-11-20 16:32:05 -03:00
meijian
6944a16306 tcp/tls: fix tcp tls bugs
assert: tcp conn and didn't recv ack, tcp_free will assert in L909
and no need to tcp free because tcp close will free by lpwork.

Signed-off-by: meijian <meijian@xiaomi.com>
2024-11-21 00:23:01 +08:00
meijian
3b50bf1782 net/tcp_conn: fix thread_cancel() caused recv/connect/send event used after free
Problem Description:
Problem occurrence when Thread1 creat connect/recv socket and Thread2 cancel Thread1.
1. Thread2 cancel when Thread1 connect event, will cause DEBUGASSERT in devif_callback_free.Because cb in g_cbfreelist.
2. Thread2 cancel when Thread1 recvfrom sem-wait, when the FIN packet input and will trigger tcp_recvhandler and will crash.Becuase some thread stack data was freed.

Signed-off-by: meijian <meijian@xiaomi.com>
2024-11-21 00:23:01 +08:00
Jouni Ukkonen
9aa9ee28cd arch/arm64/imx9/lspi: improve spi initialization
Hardware initialization is based refcount, not
spi enable bit and add interface to unitialize bus

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-20 12:49:12 -03:00
hujun5
d226170292 assert: in assert we use small spinlock replace enter_critical_section
reason:
Since assert may synchronously wait to stop another CPU, potentially
leading to a deadlock, we replace enter_critical_section with a
small spinlock to avoid such a situation.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-20 12:22:58 -03:00
meijian
d86d902392 netinet/in.h: add IN6_IS_ADDR_GLOBAL macro
Signed-off-by: meijian <meijian@xiaomi.com>
2024-11-20 20:42:21 +08:00
meijian
5ff98f65a8 netinet/in.h: fix LINKLOCAL macro bug
Signed-off-by: meijian <meijian@xiaomi.com>
2024-11-20 20:42:21 +08:00
YAMAMOTO Takashi
b4d8ac862e sched_unlock: remove redundant/stale logic and comment 2024-11-20 20:41:27 +08:00
Huang Qi
fb92b60000 arch/risc-v: Minor document improvement
Add function description for function prototype of `riscv_jump_to_user`
to make it easier to read, and fix some inconsistent comment style in
`riscv_internal.h`.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-20 20:40:09 +08:00
YAMAMOTO Takashi
4c3ae2ed4f Revert "sem: change sem wait to atomic operation"
This reverts commit befe29801f.

Because a few regressions have been reported and
it likely will take some time to fix them:

* for some configurations, semaphore can be used on the special
  memory region, where atomic access is not available.
  cf. https://github.com/apache/nuttx/pull/14625

* include/nuttx/lib/stdatomic.h is not compatible with
  the C11 semantics, which the change in question relies on.
  cf. https://github.com/apache/nuttx/pull/14755
2024-11-20 17:52:00 +08:00
Huang Qi
fd1b52579b Fix some minor style issues
Fix typo and comment style in:
* audio/audio_comp.c
* drivers/drivers_initialize.c
* drivers/pipes/fifo.c

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-20 10:51:07 +01:00
Huang Qi
3a6de58904 riscv/syscall.h: Update comment for syscall
Change RV64GC to RISC-V since this file is for all RISC-V based platform.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-20 10:50:50 +01:00
YAMAMOTO Takashi
788f8fc495 esp32s3_partition.c: Appease a compiler warning (-Wdiscarded-qualifiers) 2024-11-20 17:43:12 +08:00
YAMAMOTO Takashi
032b2bcd4b syslog.rst: mention the correct kconfig option 2024-11-20 17:41:38 +08:00
Jukka Laitinen
b088369014 arch/arm64/src/imx9/imx9_lpi2c.c: Clear NACK properly on last RX byte
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-20 17:36:00 +08:00
Jukka Laitinen
02a3437289 arch/arm64/src/imx9/imx9_lpi2c.c: Add error recovery on timeout
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-20 17:36:00 +08:00
Jukka Laitinen
3afa58cdda arch/arm64/src/imx9/imx9_lpi2c.c: Clean up the irq handling logic
Both RX and TX interrupts can be enabled after the setup of the transfer; the TX interrupt
must be enabled after queuing the first byte as done before. It is not possible to miss the
RX interrupts, as it pends as long as the byte gets read from the FIFO

When starting the TX, the first byte can be queued instantly, it won't be sent out to the
bus if there is NACK to the address. This also prevents spurious TX interrupts in error
cases, since the TX queue is not empty after initiating a transfer.

In some error cases controller sends STOP by itself even if AUTOSTOP is disabled.
It is better to tell the controller to ABORT, which will also generate STOP only when needed.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-20 17:36:00 +08:00
Ville Juven
244a560be9 sched/addrenv.c: Fix usage of atomic_fetch_sub
addrenv_give should return the new reference counter (after subtraction)
instead of the old one.
2024-11-20 18:28:26 +09:00