hujun5
b964eeee18
Reapply "sched/spinlock: remove nesting spinlock support"
...
This reverts commit 9e81f5efac
.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-13 18:31:35 +08:00
wangjianyu3
223088d847
misc/rpmsgdev: The private data should be freed only when endpoint is released
...
A use-after-free problem occurs when there are multiple remotes in the list `g_rpmsg` and the matching remote is not the last item in the list.
Log
# Export the device "/dev/LOCAL_DEV" to remote "REMOTE_CPU"
ap> testdev -d 2 -c "REMOTE_CPU" -l "/dev/LOCAL_DEV"
[ap] kasan_report: kasan detected a read access error, address at 0x3c3d4740,size is 4, return address: 0x2c33620f
[ap] kasan_show_memory: Shadow bytes around the buggy address:
[ap] kasan_show_memory: 0x3c3d46f0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
[ap] kasan_show_memory: 0x3c3d4700: aa aa aa aa cc cc cc cc cc cc cc cc cc cc cc cc
[ap] kasan_show_memory: 0x3c3d4710: 40 47 3d 3c ed 61 33 2c 00 00 00 00 00 00 00 00
[ap] kasan_show_memory: 0x3c3d4720: 00 00 00 00 00 00 00 00 00 00 00 00 cc cc cc cc
[ap] kasan_show_memory: 0x3c3d4730: 55 55 55 55 38 00 00 00 02 2c 00 00 cc cc cc cc
[ap] kasan_show_memory: 0x3c3d4740:[00 00 00 00]66 e0 42 3c cc cc cc cc cc cc cc cc
[ap] kasan_show_memory: 0x3c3d4750: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
[ap] kasan_show_memory: 0x3c3d4760: aa aa aa aa 38 00 00 00 01 2c 00 00 cc cc cc cc
[ap] kasan_show_memory: 0x3c3d4770: 50 57 44 3d 2f 00 cc cc cc cc cc cc cc cc cc cc
[ap] kasan_show_memory: 0x3c3d4780: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
[ap] dump_assert_info: Current Version: NuttX ****** ***** *** 12.3.0 **********-***** *** ** 2024 **:**:** arm
[ap] dump_assert_info: Assertion failed panic: at file: kasan/hook.c:187 task: testdev process: testdev 0x2ca20495
$ addr2line -fe nuttx/nuttx 0x2c33620f
rpmsgdev_server_created
/workspace/nuttx/drivers/misc/rpmsgdev_server.c:529
# Line 529 => strcmp()
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-10-13 14:42:30 +08:00
Bowen Wang
a953f14e78
openamp/libmetal: use config OPENAMP_CACHE to control lib metal cache too
...
metal cache is a new config to control weather to use the cache API.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 14:11:35 +08:00
zhangwenjian
8b0e5ee8bd
drivers/note:add the poll function for noteram
...
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-13 14:05:50 +08:00
zhangwenjian
7a3c50b3db
noteram:support binary read mode
...
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-13 14:05:50 +08:00
likun17
1fde78ddc6
noteram_driver.c:noteram_dump_printf function replaced with lib_bsprintf.
...
open CONFIG_DRIVERS_NOTE_STRIP_FORMAT:
OUT:
NuttShell (NSH) NuttX-12.3.0
nsh> hello
nsh> trace dump
loop_task-1 [0] 0.001728177: sched_wakeup_new: comm=loop_task pid=1 target_cpu=0
Idle_Task-0 [0] 0.001745633: sched_wakeup_new: comm=Idle_Task pid=0 target_cpu=0
hpwork-2 [0] 0.001791495: sched_wakeup_new: comm=hpwork pid=2 target_cpu=0
nsh_main-3 [0] 0.001814164: sched_wakeup_new: comm=nsh_main pid=3 target_cpu=0
hello-4 [0] 2.583795447: sched_wakeup_new: comm=hello pid=4 target_cpu=0
hello-4 [0] 2.583843399: tracing_mark_write:
###### start long args test!!!
hello-4 [0] 2.583844088: tracing_mark_write: 0x48ebe0 97 19299 22155 4294967217 4294957304 4294945141 92.999900 9299.929993 92999299929992 18446743074409621624 61 254 429495799 hello-4 [0] 2.583845991: tracing_mark_write: 0x48ec20 qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvb>�/�L�p�J hello-4 [0] 2.583847105: tracing_mark_write:
###### start long args test!!!
trace-5 [0] 2.928625413: sched_wakeup_new: comm=trace pid=5 target_cpu=0
nsh>
close CONFIG_DRIVERS_NOTE_STRIP_FORMAT:
NuttShell (NSH) NuttX-12.3.0
nsh> hello
nsh> trace dump
loop_task-1 [0] 0.001607506: sched_wakeup_new: comm=loop_task pid=1 target_cpu=0
Idle_Task-0 [0] 0.001624549: sched_wakeup_new: comm=Idle_Task pid=0 target_cpu=0
hpwork-2 [0] 0.001666256: sched_wakeup_new: comm=hpwork pid=2 target_cpu=0
nsh_main-3 [0] 0.001688556: sched_wakeup_new: comm=nsh_main pid=3 target_cpu=0
hello-4 [0] 3.812630763: sched_wakeup_new: comm=hello pid=4 target_cpu=0
hello-4 [0] 0.370899272: tracing_mark_write:
###### start NOTE_STRIP_FORMAT test!!!
hello-4 [0] 0.370900260: tracing_mark_write: uint8_t[97]:[97]
hello-4 [0] 0.370900735: tracing_mark_write: uint16_t[19299]:[19299]
hello-4 [0] 0.370901155: tracing_mark_write: uint32_t[22155]:[22155]
hello-4 [0] 0.370901715: tracing_mark_write: float[92.9999]:[92.999900]
hello-4 [0] 0.370902196: tracing_mark_write: double[9299.929992999299]:[9299.929993]
hello-4 [0] 0.370902978: tracing_mark_write: char[][qweretyuiopasdfghjklzxcvbnm]:[qweretyuiopasdfghjklzxcvbnm]
hello-4 [0] 0.370904061: tracing_mark_write: uint64_t[92999299929992]:[92999299929992]
hello-4 [0] 0.370904554: tracing_mark_write: unsigned char[254]:[254]
hello-4 [0] 0.370904999: tracing_mark_write: unsigned short int[9299]:[9299]
hello-4 [0] 0.370905435: tracing_mark_write: unsigned int[9299992]:[9299992]
hello-4 [0] 0.370905876: tracing_mark_write: unsigned long[929992992]:[929992992]
hello-4 [0] 0.370906402: tracing_mark_write: unsigned long long[9299929924]:[9299929924]
hello-4 [0] 0.370906822: tracing_mark_write:
###### end test!!!
hello-4 [0] 0.370908999: tracing_mark_write:
###### start long args test!!!
hello-4 [0] 0.370909770: tracing_mark_write: 97 19299 22155 97 19299 22155 92.999900 9299.929993 92999299929992 92999299929992 254 254 9299 9299
hello-4 [0] 0.370927340: tracing_mark_write: qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweretyuiopasdfghjklzxcvbnm qweret>��+�c� hello-4 [0] 0.370928037: tracing_mark_write:
###### start long args test!!!
trace-5 [0] 4.173395106: sched_wakeup_new: comm=trace pid=5 target_cpu=0
nsh>
test SRC:
\#include <nuttx/config.h>
\#include <nuttx/streams.h>
\#include <stdio.h>
\#include <syslog.h>
\#define TOSTR(str) #str
\#define TONNAME(name) TOSTR(name)
\#define v_uint8_t 97
\#define v_uint16_t 19299
\#define v_uint32_t 22155
\#define v_int8_t -79
\#define v_int16_t -9992
\#define v_int32_t -22155
\#define v_float 92.9999
\#define v_double 9299.929992999299
\#define v_char_arr qweretyuiopasdfghjklzxcvbnm
\#define v_uint64_t 92999299929992
\#define v_int64_t -999299929992
\#define v_char 61
\#define v_u_char 254
\#define v_s_int -9299
\#define v_u_s_int 9299
\#define v_int -9299991
\#define v_u_int 9299992
\#define v_long -929992991
\#define v_u_long 929992992
\#define v_l_l -929992993
\#define v_u_l_l 9299929924
\#define v_size_t 29299
\#define v_l_double -9299.9299929912122464755474
int main(int argc, FAR char *argv[])
{
\#ifdef CONFIG_DRIVERS_NOTE_STRIP_FORMAT
sched_note_printf(0, "\n ###### start long args test!!! \n");
sched_note_printf(0, "%u %u %u %d %d %d %f %f %lu %ld %d %u %d %u",
v_uint8_t, v_uint16_t, v_uint32_t, v_int8_t, v_int16_t,
v_int32_t, v_float, v_double, v_uint64_t, v_int64_t,
v_char, v_u_char, v_s_int, v_u_s_int);
sched_note_printf(0, "%s %s %s %s %s %s %s %s %s %s %s %s %s %s",
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr));
sched_note_printf(0, "\n ###### start long args test!!! \n");
\#else
sched_note_printf(0, "\n ###### start NOTE_STRIP_FORMAT test!!! \n");
sched_note_printf(0, " uint8_t["TONNAME(v_uint8_t)"]:[%u]", v_uint8_t);
sched_note_printf(0, " uint16_t["TONNAME(v_uint16_t)"]:[%u]", v_uint16_t);
sched_note_printf(0, " uint32_t["TONNAME(v_uint32_t)"]:[%u]", v_uint32_t);
sched_note_printf(0, " float["TONNAME(v_float)"]:[%f]", v_float);
sched_note_printf(0, " double["TONNAME(v_double)"]:[%f]", v_double);
sched_note_printf(0, " char[]["TONNAME(v_char_arr)"]:[%.32s]", TONNAME(v_char_arr));
sched_note_printf(0, " uint64_t["TONNAME(v_uint64_t)"]:[%lu]", v_uint64_t);
sched_note_printf(0, " unsigned char["TONNAME(v_u_char)"]:[%u]", v_u_char);
sched_note_printf(0, "unsigned short int["TONNAME(v_u_s_int)"]:[%u]", v_u_s_int);
sched_note_printf(0, " unsigned int["TONNAME(v_u_int)"]:[%u]", v_u_int);
sched_note_printf(0, " unsigned long["TONNAME(v_u_long)"]:[%lu]", (unsigned long)v_u_long);
sched_note_printf(0, "unsigned long long["TONNAME(v_u_l_l)"]:[%llu]", (unsigned long long)v_u_l_l);
sched_note_printf(0, "\n ###### end test!!! \n");
sched_note_printf(0, "\n ###### start long args test!!! \n");
sched_note_printf(0, "%u %u %u %d %d %d %f %f %lu %ld %d %u %d %u",
v_uint8_t, v_uint16_t, v_uint32_t, v_uint8_t, v_uint16_t,
v_uint32_t, v_float, v_double, v_uint64_t, v_uint64_t,
v_u_char, v_u_char, v_u_s_int, v_u_s_int);
sched_note_printf(0, "%s %s %s %s %s %s %s %s %s %s %s %s %s %s",
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr),
TONNAME(v_char_arr), TONNAME(v_char_arr));
sched_note_printf(0, "\n ###### start long args test!!! \n");
\#endif // !CONFIG_DRIVERS_NOTE_STRIP_FORMAT
return 0;
}
drivers/note/noteram_driver.c
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-13 14:05:50 +08:00
wangmingrong
1b3f3d19e9
noteram: fix variable type
...
Signed-off-by: wangmingrong <wangmingrong@xiaomi.com>
2024-10-13 14:05:50 +08:00
yinshengkai
cf0e644a88
note: supports specifying the section where the noteram buffer is located
...
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 14:05:50 +08:00
cuiziwei
4b318cb2cb
fix build warning to [-Wstringop-overread].
...
note/note_driver.c:639:21: warning: 'strlen' reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
639 | namelen = strlen(tcb->name);
| ^~~~~~~~~~~~~~~~~
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-13 14:05:50 +08:00
cuiziwei
04f3ff5942
nuttx/note:fix runtime error.
...
note/note_driver.c:1405:11: runtime error: null pointer passed as argument 2, which is declared to never be null
#0 0x33bf5cc in sched_note_event_ip note/note_driver.c:1405
#1 0x33bfb57 in note_driver_instrument_enter note/note_initialize.c:55
#2 0x347b084 in __cyg_profile_func_enter misc/lib_instrument.c:68
#3 0x34179de in binder_initialize binder/binder.c:669
#4 0x339a936 in drivers_initialize /home/cuiziwei/vela/happy/nuttx/drivers/drivers_initialize.c:242
#5 0x335a179 in nx_start init/nx_start.c:632
#6 0x32f755c in main sim/sim_head.c:180
#7 0xf6821518 (/lib/i386-linux-gnu/libc.so.6+0x21518) (BuildId: 7f64b917aaa97b9680d8e44931bf7611c5a1f036)
#8 0xf68215f2 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x215f2) (BuildId: 7f64b917aaa97b9680d8e44931bf7611c5a1f036)
#9 0x32b401a in _start (/home/cuiziwei/vela/happy/nuttx/nuttx+0x32b401a) (BuildId: 33f8f7b361d44a008de87fea1bc970b22b48b700)
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-13 14:05:50 +08:00
zhangwenjian
d469216653
note:fix syscall note compile error
...
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-13 14:05:50 +08:00
zhangwenjian
149b1f186e
drivers/note:add the api of sched_note_add
...
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-13 14:05:50 +08:00
zhangwenjian
7aa1871664
note:support filter for each note channel
...
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-13 14:05:50 +08:00
yinshengkai
c018be66bd
note: merge nc_systime_nsec and sec
...
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 14:05:50 +08:00
zhaoxingyu1
0be1196046
note_driver: time_t outputs in 64-bit format
...
Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2024-10-13 14:05:50 +08:00
cuiziwei
19851c0979
note: Move the instrument register to note_initialize
...
avoid the instrument doesn't get registered in some case
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-13 14:05:50 +08:00
cuiziwei
7246533aeb
Unify the definition of GCCVER and remove duplicate code.
...
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-13 11:41:22 +08:00
yintao
d2fc3f21de
net/rpmsg: use hash to handle rp_name
...
expand the user's rpname size
hash when exceed RPMSG_SOCKET_NAME_LEN due to the limitation of eptname
Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-13 11:33:04 +08:00
Xiang Xiao
cb2a6a3480
net/rpmsg: Minor cleanups
...
1.Simplify the message process in rpmsg_socket_send_single
2.Add more lock protection in rpmsg socket
3.Fix the style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-13 11:33:04 +08:00
Xiang Xiao
3a32531a05
net/rpmsg: Remove all the special handle of "backlog == -1"
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-13 11:33:04 +08:00
Xiang Xiao
034215ab9c
net/rpmsg: sendsize should be protected by sendlock not recvlock
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-13 11:33:04 +08:00
yintao
5b372a4706
rpmsg_sockif: add rpmsg_socket_ept_release for free conn
...
Signed-off-by: yintao <yintao@xiaomi.com>
2024-10-13 11:33:04 +08:00
Xiang Xiao
8ea51b3efc
net/can: Save simple options to socket_conn_s
...
like other protocols(e.g. ip, tcp, udp)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-13 11:24:31 +08:00
Marco Casaroli
83455a3fa1
ci: skip config
...
since this config requires bootloader, we skip it
2024-10-13 11:19:51 +08:00
Marco Casaroli
22800d6ea2
fix(esp32-devkit): rename defconfig to use _
2024-10-13 11:19:51 +08:00
Marco Casaroli
757c312ea3
doc(esp32-qemu): update chip revision and bootloader
2024-10-13 11:19:51 +08:00
Marco Casaroli
027e5ab763
fix(esp32-qemu): enable legacy esp-idf build
...
The current simple boot method is not working with qemu.
We enable this option for now until we can make the simple-boot
image boot with QEMU.
2024-10-13 11:19:51 +08:00
Marco Casaroli
b1a6618929
doc(esp32s3): qemu and openeth
2024-10-13 11:19:51 +08:00
Marco Casaroli
4741f6f561
feat(esp32s3-devkit): add qemu defconfig
2024-10-13 11:19:51 +08:00
Marco Casaroli
d2d653aebf
feat(esp32s3-devkit): initialize opencores eth mac
2024-10-13 11:19:51 +08:00
Marco Casaroli
c17ab3beb5
feat(esp32s3): add openeth ethernet driver for qemu
...
We add the config for esp32s3, then move the esp32 specifics to
esp32/chip.h, then add the esp32s3 specifics to esp32s3/chip.h.
2024-10-13 11:19:51 +08:00
Marco Casaroli
890bdcd3d3
feat(esp32s3-devkit): add qemu image option
2024-10-13 11:19:51 +08:00
Marco Casaroli
d5b32f0335
feat(esp32_openeth): move to common/espressif
...
Since this will be used for esp32s3 also, we can have this in
common/espressif.
2024-10-13 11:19:51 +08:00
xuxin19
57bfd02cef
build ci:add msvc windows native ci workflow
...
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 10:25:19 +08:00
YanXiaowei
356ddee5b8
support trace_beginex and trace_endex
...
Signed-off-by: YanXiaowei <yanxiaowei@xiaomi.com>
2024-10-13 10:23:44 +08:00
hujun5
fa8ccc0e85
sched: fix nxsched_suspend_scheduler regression
...
This commit fixes the regression from https://github.com/apache/nuttx/pull/13877
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-13 10:16:22 +08:00
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
chenrun1
9e81f5efac
Revert "sched/spinlock: remove nesting spinlock support"
...
This reverts commit 5aa13bc490
.
2024-10-13 09:41:59 +08:00
chenzhijia
505adfa277
nuttx:move "#define STRINGIFY(x)" to nuttx/macro.h
...
Franklin requirement, "#define STRINGIFY(x)" conflicts with https://github.com/mborgerding/kissfft define
Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-13 03:16:25 +08:00
Xiang Xiao
08829bd388
mtd/nvs: Trigger recovery process in nvs_startup
...
when mtd driver return -EBADMSG
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-13 03:10:19 +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
yangshuyong
c1eee1cc29
Changed the i3c_priv_xfer's member to flags from rnw
...
Signed-off-by: yangshuyong <yangshuyong@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-13 02:49:05 +08:00
Xiang Xiao
7b2dbcf50a
drivers/optee: Return error if optee_recv return prematurely
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-13 02:48:29 +08:00
Xiang Xiao
a074a572af
sched/pthread: Remove unused pthread_sem_xxx functions
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-13 02:47:44 +08:00
liwenxiang1
015a45517e
mempool: add the minimum size configuration of mempool
...
The minimum size of mempool can be configured through CONFIG_MM_MPOOL_MINISIZE
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-13 02:46:57 +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