Commit Graph

49788 Commits

Author SHA1 Message Date
Xiang Xiao
14e5bcaf6e fs/fdcheck: Let FDCHECK depend on SCHED_HAVE_PARENT
since the implementation of fdcheck call getppid

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-16 18:08:05 +03:00
Xiang Xiao
275db394bc boards/sim: Enable fdcheck and fdsan in kasan config
to improve the ci build coverage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-16 08:31:16 +03:00
Xiang Xiao
c49bf046bd libc/fdcheck: Fix undefined reference to `getppid'
and change get[p]pid to  _SCHED_GET[P]PID

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-16 08:31:16 +03:00
Tiago Medicci Serrano
17c65d2067 risc-v/espressif: use the unquoted CHIP_SERIES variable
Instead of using `CONFIG_ESPRESSIF_CHIP_SERIES`, use the unquoted
version `CHIP_SERIES`.
2023-06-16 11:14:36 +08:00
Tiago Medicci Serrano
368b6cb489 esp32s3/wifi: update Wi-Fi driver to the newest esp-hal-3rdparty 2023-06-16 11:14:36 +08:00
Tiago Medicci Serrano
6559ac4034 risc-v/espressif: update to the newest esp-hal-3rdparty version
Also, get esp-hal-3rdparty by git cloning (instead of downloaded)
to enable getting its git submodules.
2023-06-16 11:14:36 +08:00
zhanghongyu
7b5af12158 statfs: add f_fsid field for third-party code compile
because NuttX doesn't have the device number, so we're not assigning a
valid value here. just memset to zero.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-16 11:10:25 +08:00
zhanghongyu
b723e90356 fs: move memset to upper lever for statfs
if struct statfs add new members, such as f_fsid, no additional code
changes are required.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-16 11:10:25 +08:00
Zhe Weng
f80539b6a8 netdev/upper: Use atomic when we have atomic support from compiler
Ref: How to test atomic support https://beej.us/guide/bgc/html/split/chapter-atomics.html

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-06-15 19:31:59 -03:00
Zhe Weng
483eb10f37 netdev/upper: Make quota_load public
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-06-15 19:31:59 -03:00
zhangyuan21
6ede91c5e7 sched/group: Ensure that the setting of tg_members if safe in SMP
Fixed ltp_stress_mqueues_multi_send_rev_1 test issue:

In SMP mode, tg_members will operate on different cores.
Adding interrupt locking operations ensures that the operation
of tg_members will not be interrupted by other cores.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-15 22:24:00 +08:00
Simon Filgis
04f8bab063 Dynamic adjustment of the orientation, switch orientation on the fly:
1. orientation is a parameter of initialize
2. y and x offset need to be adjusted with the orientaiton
3. bpp must be changed no matter what
2023-06-15 10:15:11 -03:00
zhangyuan21
fc9f87824c sched/pthread: Return ESRCH when the task is in the process of exit.
Resolving the issue with the ltp_interfaces_pthread_join_6_2 test case.

In SMP mode, the pthread may still be in the process of exiting when
pthread_join returns, and calling pthread_join again at this time will
result in an error. The error code returned should be ESRCH.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-15 10:12:25 -03:00
zhangyuan21
c71007323e fs/vfs: Proper use of sigisemptyset
Use sigandset function instead of & operation,
because the sigset_t structure has been changed.

This PR is to adapt to the changes made in #8885.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-15 10:11:36 -03:00
Dong Heng
d492823128 xtensa/esp32s3: Add USB OTG device driver 2023-06-14 18:04:27 -03:00
Lucas Saavedra Vaz
4bcf454ae5 arch/xtensa/esp32s2: Fix SPI DMA implementation 2023-06-15 03:29:30 +08:00
hujun5
b2ff151282 libc/fdcheck: if pid_expect is 0, fdcheck does not take effect
there are some user code like this:
  /* close all inherited fds */
  for (i = 3; i < maxfds; i++)
    func (i);

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-06-15 03:29:17 +08:00
hujun5
04db52612e libc/fdcheck: child process that uses the parent process'fd will crash
In many cases, it is legal for the child process to use the fd
created by the parent process,
so to improve compatibility, we allow the child process
to use the fd of the Parent process.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-06-15 03:29:17 +08:00
raiden00pl
387944b837 usbdev/cdcacm.c: register console only for device with minor number 0
With this change, we can register several CDCACM devices where one is used as a console
2023-06-14 16:24:20 -03:00
raiden00pl
2f58b55b4d arch/{nrf52|nrf53}/usbd: various fixes to improve USB stability
USBD has many limitation that make it hard to work properly:
- only one EasyDMA channel which must be shared for all EPs
- only one DMA transfer can take place at a time
- some registers are unavailable during DMA transfer
- in case of any problems, the peripheral silently blocks,
  or lose the transmitted bytes without information for the user

This commit is trying to fix these problem and makes the USBS stack more reliable.

Tested with high-speed CDCACM data transfers and that's the best I've been able to get in terms of stability.
2023-06-14 16:23:25 -03:00
wangchen
693898d566 netdb/dns: fix dns wrong response ID error
In every dns query, we use the new socket to avoid receiving last response ID

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-06-15 03:20:46 +08:00
Ville Juven
9b5746cb5f riscv/barrier: Define more granular memory barriers
Separate barriers for full (memory + I/O) and local memory (cache) flushing.
2023-06-14 16:14:57 -03:00
Zhe Weng
f2690837e7 arch/sim: Support more sockopts on native socket
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-06-14 15:50:31 +03:00
SPRESENSE
1e7f5e8aa8 boards: spresense: Add Power domain definitions
Add power domain definitions for using PM System.
2023-06-14 08:49:19 +02:00
SPRESENSE
b1f3d5e573 arm/cxd56xx: Fix build error in CONFIG_PM=y 2023-06-14 08:49:19 +02:00
yanghuatao
29a336d6a8 sched/tls: remove PTHREAD_CLEANUP from Kconfig
use PTHREAD_CLEANUP_STACKSIZE to enable or disable interfaces pthread_cleanup_push() and pthread_cleanup_pop().
reasons:(1)same as TLS_TASK_NELEM (2)it is no need to use two variables

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2023-06-14 12:00:48 +08:00
Sebastien Lorquet
43fec5dd53 pca9555: fix const correctness of pin set parameters 2023-06-13 16:10:52 -03:00
zhanghongyu
59c01ea05d netfilter: add NF_IP_xxx definition
we will integrate network management tools in future projects.  In the
process of porting the tools, we encounter some situations where the
structure is not defined, refer to the common implementation of other
systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-14 02:01:45 +08:00
Huang Qi
84f4cf9b9d riscv/vfork: Replace jal with call for long jump
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-06-14 02:01:04 +08:00
zhanghongyu
272e62018a sim/posix/sim_hostusrsock: process host network syscall with critical section
if config_walltime_signal is enabled, NuttX_sim will receive a lot of
signals, the socket api will break and errno will be EINTR, masking irq
before calling the host socket api will avoid this problem.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-13 22:10:16 +08:00
zhangyuan21
4033a4a2a4 boards: remove unnecessary FAR
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-13 09:37:45 -03:00
zhanghongyu
aa43f6ff1a usrsock_rpmsg_server: fix poll recursive when revent POLLHUP or POLLERR
the previous patch can not handle the revent is POLLHUP or POLLERR,
poll_setup needs to be executed only when the POLLIN or POLLOUT event
changes.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-13 15:33:05 +08:00
zhanghongyu
76fde07d1c netdev: remove ASSERT when ifindex is invalid
There is no control over whether a valid index is input when user use
ioctl to get netdev information, so removing this assertion will allow
ENODEV to be returned.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-13 13:32:03 +08:00
zhanghongyu
d59a9ea189 inet_addr: return INADDR_NONE(-1) when input string is invalid
now:
inet_network("300.10.10.10"); return 0
inet_addr("300.10.10.10"); return 0

glibc and muscle both return INADDR_NONE or -1.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-13 13:31:37 +08:00
zhangyuan21
6f8cb7edd3 arch/arm64: Save FPU context when a context switch occurs in SMP mode
In SMP mode, the fpu owner may switch from core0 to core1,
so it is necessary to force saving the FPU context when a
context switch occurs.

This PR fixed the crash issue mentioned in #8799.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-13 13:23:28 +09:00
zhangyuan21
6c38c44af2 assert: add regs parameter to board_crashdump function
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-13 09:42:27 +08:00
zhangyuan21
acddda812c assert: print last task stack when assert in irq context
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-13 09:42:27 +08:00
zhangyuan21
ba8854184d sched/assert: Ensure that g_last_regs is aligned to 16 bytes.
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-06-13 09:42:27 +08:00
Dong Heng
b24f931aca xtensa/esp32s3: Support 32MB SPI flash 2023-06-12 21:05:33 +08:00
Alan Carvalho de Assis
69081a72d7 libdsp: Add average filter
This commit add average filter to DSP library
2023-06-12 08:39:38 +02:00
Masayuki Ishikawa
a85c87436e boards: rv-virt: Add netnsh64_smp to test virtio
Summary:
- This commit adds netnsh64_smp to test virtio

Impact:
- None

Testing:
- Tested with qemu-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-06-12 08:17:38 +02:00
chao an
3ce2796175 assert: disable function/line print if DEBUG_ASSERTIONS_FILENAME disabled
Test on sim/nsh:
(CONFIG_DEBUG_ASSERTIONS=y CONFIG_DEFAULT_SMALL=y)
   text	   data	    bss	    dec	    hex	filename
 423626	  27152	   4128	 454906	  6f0fa	nuttx     /* before */
 417010	  27152	   4128	 448290	  6d722	nuttx     /* after */
  -6616

Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-12 13:36:08 +08:00
chao an
2369e3cbc8 arm/dataabort: fix compile warning
Error: arm/arm_dataabort.c:146:10: error: format '%x' expects argument of type 'unsigned int',
                                          but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
  146 |   _alert("Data abort. PC: %08x FAR: %08x FSR: %08x\n",
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  147 |          regs[REG_PC], far, fsr);

Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-12 13:36:08 +08:00
Xiang Xiao
da5e978341 mm: Correct the callsite of mm_mallinfo
forget to update in https://github.com/apache/nuttx/pull/9488

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-11 19:37:04 +03:00
Xiang Xiao
9f4da58c67 mm: Remove mempoolinfo_task macro and use mallinfo_task directly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-11 19:37:04 +03:00
Xiang Xiao
d920bfba10 mm: include malloc.h in mm/mm.h
to remove the forward declaration of mallinfo and mallinfo_task

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-11 19:37:04 +03:00
Masayuki Ishikawa
08da38b535 boards: Enable md5 to test virtio
Summary:
- This commit enables md5 to test virtio

Impact:
- None

Testing:
- Tested with qemu-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-06-11 22:54:06 +08:00
Petro Karashchenko
8d1a25f725 libs/libc/regex: add newline at the end of Make.defs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 12:55:29 +08:00
Petro Karashchenko
509a808e84 arch/arm/stm32f7: fix typo
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 12:55:29 +08:00
Petro Karashchenko
dcd26ac6b2 sdcard: update sdcard detection to avoid 0xff assignment to bool type
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 12:55:29 +08:00