Commit Graph

54105 Commits

Author SHA1 Message Date
chao an aedef71070 sim/nsh: add nxevent into nsh demo
1. add nxevent into nsh demo
2. enable ostest

Signed-off-by: chao an <anchao@lixiang.com>
2024-08-23 17:00:35 +08:00
chao an 75fac7dbc6 sched/nxevent: add support of kernel event group
Events groups are synchronization primitives that allow tasks to wait
for multiple conditions to be met before proceeding. They are particularly
useful in scenarios where a task needs to wait for several events to occur
simultaneously.

Signed-off-by: chao an <anchao@lixiang.com>
2024-08-23 17:00:35 +08:00
Xu Xingliang cfdbc856ff sim/lcd: fix compile break
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-08-23 15:26:16 +08:00
jianglianfang a5afa11238 sim: Support to use of non-consecutive framebuffers
Some hardware devices use discontinuous framebuffers, which require SIM support for simulating discontinuous framebuffers.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-23 15:26:16 +08:00
wangchen 5fc016ef2d ipv6_frag.c:modify the type of the parameters to solve runtime error
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-08-23 15:23:19 +08:00
Yanfeng Liu 74080e8659 arm/qemu: use WFI to avoid busy loop
This adds WFI based up_idle() for arm/qemu to fix busy loop.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-08-23 15:09:44 +08:00
Matheus Catarino 93b520f7b0 swift6 embedded support 2024-08-23 09:02:20 +08:00
renjianguang 7ff17d0627 nuttx/audio: ap_buffer_s add nsamples Field for non-pcm formats
Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2024-08-23 08:57:00 +08:00
renjianguang e655d8f992 nuttx/audio: Add amr and opus format control switches
Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2024-08-23 08:57:00 +08:00
renjianguang 87e24d13b4 nuttx/audio: add opus format support
Signed-off-by: renjianguang <renjianguang@xiaomi.com>
2024-08-23 08:57:00 +08:00
yinshengkai 667de7be32 mutex: add nxrmutex_is_recursive api
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 08:56:00 +08:00
yinshengkai a2b8c83e0e mutex: align nxmutex_breaklock interface with nxrmutex_breaklock
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 08:56:00 +08:00
yinshengkai eee7cb6efa libc: nxmutex_clocklock abstime supports NULL pointer
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 08:56:00 +08:00
yinshengkai 01864d262c sched: add mutex_holder and mutex_clocklock API
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 08:56:00 +08:00
yinshengkai 4af6db7c80 mutex: remove mutex trylock holder check
The standard describes trylock as follows, trylock should never cause the system to stop running:

The pthread_mutex_trylock() function shall be equivalent to
pthread_mutex_lock(), except that if the mutex object referenced by
mutex is currently locked (by any thread, including the current thread),
the call shall return immediately.

https://linux.die.net/man/3/pthread_mutex_trylock

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 08:56:00 +08:00
yinshengkai 53ddc3ef7f arch/sim: suppress libasan checks
There is a false positive in asan of gcc-13, we need to mask it to ensure that other parts work properly

sanitizer_common/sanitizer_common_interceptors.inc:
   // FIXME: under ASan the call below may write to freed memory and corrupt
   // its metadata. See
   // https://github.com/google/sanitizers/issues/321.

==572161==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address 0xed3d3f00 at pc 0xef46af64 bp 0xed3d3de8 sp 0xed3d39bc
WRITE of size 128 at 0xed3d3f00 thread T0
     #0 0xef46af63 in __interceptor_pthread_sigmask ../../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4419
     #1 0x5486aa7d in up_irq_save sim/posix/sim_hostirq.c:97

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 08:53:52 +08:00
yinshengkai 0111cb73f1 sim: update sim_asan dependencies
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 08:53:52 +08:00
wangzhi16 bf957348ef [BugFix]Command "critmon" error
Command "critmon" has some format errors and information errors, such as:

PRE-EMPTION CALLER            CSECTION CALLER               RUN         TIME             PID   DESCRIPTION
1.679000000                   3.704000000
                         None None             0     CPU0 IDLE
0.002000000                   0.003000000
                         None None             1     CPU1 IDLE
0.000000000                   0.000000000
                         None None             2     CPU2 IDLE
0.000000000                   0.000000000
                         None None             3     CPU3 IDLE
0.001000000                   0.001000000
                         None None             4     hpwork
0.002000000                   0.006000000
                         None None             5     nsh_main
0.000000000                   0.000000000
                         None None             6     critmon

After bug fix:

PRE-EMPTION CALLER            CSECTION CALLER               RUN              TIME             PID   DESCRIPTION
None                          None                          ---------------- ---------------- ----  CPU 0
None                          None                          ---------------- ---------------- ----  CPU 1
None                          None                          ---------------- ---------------- ----  CPU 2
None                          None                          ---------------- ---------------- ----  CPU 3
None                          None                          0.238000000      6.982000000      0     CPU0 IDLE
None                          None                          0.461000000      13.089000000     1     CPU1 IDLE
None                          None                          0.000000000      0.000000000      2     CPU2 IDLE
None                          None                          0.000000000      0.000000000      3     CPU3 IDLE
None                          None                          0.000000000      0.001000000      4     hpwork
None                          None                          0.000000000      0.010000000      5     nsh_main
None                          None                          0.000000000      0.000000000      46    critmon

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2024-08-23 08:53:15 +08:00
yinshengkai 9694760eb8 input: fix touchevent race condition
In touch_event, circbuf is operated, and there is a lack of protection here.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 08:52:23 +08:00
yinshengkai 272248de37 libc: compile stackchk function by default
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-08-23 08:51:54 +08:00
yintao 279a676978 syslog_rpmsg: Ensure the syslog ept is ready when rpmsg_send
Signed-off-by: yintao <yintao@xiaomi.com>
2024-08-23 01:43:09 +08:00
zhanghongyu 355742bd9b Documentation/sim: add cdcmbim examples
We can send and receive data through device files
nuttx: /dev/cdc-wdm2
linux: /dev/cdc-wdm1
The number suffix depends on the actual situation.

And send and receive messages through network cards.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 09:51:20 -03:00
Yongrong Wang f55270f15b rpmsgfs: fix out of bounds access caused by data transmission farmat
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-08-22 20:25:49 +08:00
guohao15 94e9599e5c file_lock:fix memory alloc/free not match
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 20:25:30 +08:00
guohao15 76a1a5b2c4 inotify:fix memory alloc/free not match
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 20:25:30 +08:00
guohao15 c63adb5c14 hcreate: add alloc/free func hook for user to deallocate memory
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 20:25:30 +08:00
guohao15 43bcac952a tmpfs: old data was loaded when SEEK_SET beyond end of the file
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 20:25:03 +08:00
guohao15 7f16770b91 bch:alloc bch->buffer when offset not aligned
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 20:24:13 +08:00
guohao15 458bab9ae7 fix:uart_rpmsg_dmareceive data copy to nbuffer should start from data + length
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 09:23:12 -03:00
jinxiuxu b874d95beb drivers/audio: fix samp rate conversion issue
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-22 09:13:51 -03:00
jinxiuxu 618a51fa84 audio: add 12K support in sim_alsa driver
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-22 09:13:51 -03:00
jinxiuxu 7355629d19 audio: add 12K sample rate support
Signed-off-by: jinxiuxu <jinxiuxu@xiaomi.com>
2024-08-22 09:13:51 -03:00
Alin Jerpelea fe642f1cfd libc/time: remove lib_strptime
This code is licensed under BSD-4-Clause license which may render the OS unusable for some products.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-08-22 16:45:15 +08:00
Zhe Weng acbddd11d5 net/netdev: Add periodic log for netdev statistics
Work for every network device using `CONFIG_NETDEV_STATISTICS`.

Log style:
<interface>:T{done}/{total},R({v4}+{v6})/{total} {Protocol}:T{tx},R{rx},D{drop}
Example:
wlan0:T10/10,R(10+20)/31 TCP:T0,R0,D0 UDP:T0,R10,D0 ICMP:T0,R0,D0 ICMP6:T0,R0,D0

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-08-22 16:17:56 +08:00
jianglianfang f5fe7646ed sim: read the second buffer
It can only read the contents of the first buffer, so fblen should be changed to ensure that it can read the second buffer as well.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-22 16:17:43 +08:00
jianglianfang 4d42fdf195 video/fb: changed circbuf_write assert to warning
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2024-08-22 15:33:56 +08:00
Yanfeng Liu 01219b415c board/qemu-armv7a: add Cmake support
This adds Cmake support for `qemu-armv7a` device.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-08-22 15:25:02 +08:00
guohao15 52e5d69236 api:add lib_realpath function
FAR char *lib_realpath(FAR const char *path, FAR char *resolved, bool notfollow);

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2024-08-22 15:24:48 +08:00
makejian 947b24c8c1 crypto/poly1305: export poly1305 mac algorithm via /dev/crypto
Signed-off-by: makejian <makejian@xiaomi.com>
2024-08-22 13:40:24 +08:00
makejian 8628cc9c0e crypto/ripemd160: export ripemd160 algorithm via /dev/crypto
Signed-off-by: makejian <makejian@xiaomi.com>
2024-08-22 13:40:24 +08:00
simbit18 419a8ab050 CMakeLists.txt: warning D9002 on windows + msvc
Resolve compile warning

cl : command line  warning D9002: ignoring unknown option '-fmacro-prefix-map=
2024-08-22 08:28:34 +08:00
fangxinyong 9b3fe17743 arch/arm/arm_mpu.c: fix build warning
armv7-m/arm_mpu.c: In function 'mpu_dump_region':
armv7-m/arm_mpu.c:621:13: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
armv7-m/arm_mpu.c:621:13: warning: format '%X' expects argument of type 'unsigned int', but argument 6 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
armv7-m/arm_mpu.c:621:13: warning: format '%X' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
armv7-m/arm_mpu.c:621:13: warning: format '%u' expects argument of type 'unsigned int', but argument 8 has type 'long unsigned int' [-Wformat=]
  621 |       _info("MPU-%d, alignedbase=0%08X l2size=%"PRIu32" SRD=%X"

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-08-22 01:58:46 +08:00
chenrun1 3a6a23d157 xtensa_mpu:Modify the specified Region attributes
Due to the xtensa mpu feature, the size of the Region depends on the Base of the next Region. e.g.
Region[1] = 0x20000000
Region[0] = 0x30000000
Then Region[1] length = Region[0] - Region[1]
So this approach is not suitable to implement the behavior of cleaning
up the Region and such a configuration will result in affecting the very beginning (the higher) Region
Therefore, to address this feature, in this change we return the Region
value and implement the ability to modify the target Region's attributes

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:58:46 +08:00
chenrun1 054c564a2d arm_mpu:Fix mpu_initialize not taking effect
Modified the input parameters of mpu_initialize to require the caller to provide the number of entries in the table

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:58:46 +08:00
chenrun1 62f598e547 arm_mpu:Reentrant allocation Region
Changes have been completed:
1.armv7m
2.armv8m
3.armv7r
4.arm64

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:58:46 +08:00
zhanghongyu 3a25286862 usbdev/cdcncm: fix notify overwrite issue
we need to wait until the previous notify message is done to
send a new notify message

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 01:56:26 +08:00
zhanghongyu 9f9075c48c usbdev/cdcncm: fix ndpsign mismatch after NCM_SET_NTB_FORMAT
Otherwise, the NCM_SET_NTB_FORMAT message from the host may cause
subsequent parsing exceptions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 01:56:26 +08:00
zhanghongyu 418b692e21 usbdev/cdcmbim: add response notify
when the host is needed to read the data, RESPONSE_AVAILABLE must first
be sent.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 01:56:26 +08:00
zhanghongyu 5b24917bb9 usb_cdcmbim: add mbim device driver
./build.sh sim:usbdev -j12
sudo gdb nuttx/nuttx -ex "source nuttx/tools/gdb/__init__.py"

below command to create mbim NIC on host
nsh> conn 3

NuttX's MBIM device implementation adds an additional MBIM network
card to the NuttX system, which can debug the data communication with
the host, but this network card is unnecessary and needs to be removed
when the business actually uses this driver, And the cdcncm_receive
method needs to be re-implemented.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-08-22 01:56:26 +08:00
chenrun1 271f76590f fs_lock/pathbuffer:Optimize code structure
Summary:
  Adjust code logic

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-08-22 01:54:22 +08:00