Commit graph

57382 commits

Author SHA1 Message Date
Matteo Golin
1cbb7183ad wireless/ieee82011: Used definitions from existing NuttX includes where possible, and otherwise defined macros using built-ins to allow the 802.11 header to compile on Arch Linux where cpu_to_le16, le32_to_cpu and hweight8 definitions were missing. 2024-12-23 14:50:13 +08:00
hujun5
eb587d72e0 fix compile error
Configuration/Tool: esp32s2-kaluga-1/audio
Error: chip/esp32s2_lowputc.c:102:22: error: expected '}' before ';' token
  102 |   .lock = SP_UNLOCKED;
      |                      ^
chip/esp32s2_lowputc.c:62:1: note: to match this '{'
   62 | {

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-23 14:48:35 +08:00
wangchen
8ea31668ca tcp_recvfrom.c:malloc a new iob to handle psock_send_eventhandler when tcp_recvhandler calls tcp_newdata to clear dev->d_iob
Signed-off-by: wangchen <wangchen41@xiaomi.com>
2024-12-22 19:26:04 +08:00
hujun5
97eef351dc use small lock in following file
arch/or1k/src/mor1kx/mor1kx_serial.c
arch/risc-v/src/bl602/bl602_serial.c
arch/risc-v/src/common/espressif/esp_lowputc.c
arch/risc-v/src/common/espressif/esp_lowputc.h
arch/risc-v/src/common/espressif/esp_tickless.c
arch/risc-v/src/esp32c3-legacy/esp32c3_idle.c
arch/risc-v/src/esp32c3-legacy/esp32c3_lowputc.c
arch/risc-v/src/esp32c3-legacy/esp32c3_lowputc.h
arch/risc-v/src/esp32c3-legacy/esp32c3_rtc_lowerhalf.c
arch/risc-v/src/fe310/fe310_gpio.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-22 18:59:44 +08:00
Kyle Wilson
d59b8f25b8 Added hardware defines for stm32h5_qspi driver and octospi GPIOs (used by stm32h5_qspi driver).
Fixed comments and indent

Add commit log to OCTOSPI HW PR

Summary

hardware/stm32_qspi.h - Defines for the STM32H5 QSPI driver. The peripheral on the STM32H5 is actually an OCTOSPI peripheral, however it was decided to use it as a QSPI peripheral for the following reasons:

    There is currently support for QSPI within Nuttx.
    The STM32H7 QSPI register set is very similar to the STM32H5 OCTOSPI register set and the STM32H7 series has an existing QSPI driver.
    OCTOSPI devices are rare as of now and are not part of our use case.

hardware/stm32h56xxx_pinmap.h - Added pin mappings for OCTOSPI GPIOs.
Impact

This change will not impact any architectures outside of the STM32H5 series. Even for the STM32H5 series, these changes will only have an impact if they are utilized.
Testing

No testing yet for these files other than ensuring that we can still build Nuttx. Further testing will be documented in a future pull request when the STM32H5 QSPI driver is added.
2024-12-22 18:54:18 +08:00
hujun5
f25e3d2324 use small lock in following files
arch/risc-v/src/litex/litex_emac.c
arch/risc-v/src/mpfs/mpfs_coremmc.c
arch/risc-v/src/mpfs/mpfs_usb.c
arch/xtensa/src/esp32/esp32_idle.c
arch/xtensa/src/esp32/esp32_rtc_lowerhalf.c
arch/xtensa/src/esp32s2/esp32s2_idle.c
arch/xtensa/src/esp32s2/esp32s2_lowputc.c
arch/xtensa/src/esp32s2/esp32s2_lowputc.h
arch/xtensa/src/esp32s2/esp32s2_rtc_lowerhalf.c
arch/xtensa/src/esp32s3/esp32s3_idle.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-22 18:53:15 +08:00
Alan Carvalho de Assis
2d062a9529 drivers/sensors: Add support to Renesas FS3000 Air Velocity Flow
This driver add uORB sensor support to Renesas FS3000 sensor.

Thanks Xiang Xiao for review and suggestions.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-12-22 18:49:50 +08:00
hujun5
8411a97b85 use small lock in following files
arch/xtensa/src/esp32s3/esp32s3_rtc_lowerhalf.c
arch/z16/src/z16f/z16f_serial.c
arch/z80/src/z8/z8_serial.c
boards/arm/max326xx/max32660-evsys/src/max326_button.c
boards/arm/stm32/stm32f4discovery/src/stm32_gs2200m.c
drivers/i2c/i2c_bitbang.c
drivers/power/supply/act8945a.c
drivers/serial/uart_pci_16550.c
drivers/serial/uart_pl011.c
drivers/wireless/bluetooth/bt_uart_shim.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-22 18:43:26 +08:00
Jorge Guzman
e55966d3dc arm/stm32h753bi: Add support to lvgl
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2024-12-22 05:44:14 -03:00
wangmingrong1
e26e8bda0e gcov: gcov.py, gcov_convert.py scripts merged
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-21 20:49:37 +08:00
wangmingrong1
7d6b2e4804 gcov/script: gcov.sh is implemented using Python
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-21 20:49:37 +08:00
Tiago Medicci Serrano
7548db1980 arch/xtensa: Support __thread and thread_local keywords
Enable architecture-specific support for those keywords. This is a
"gcc-based" thread local storage implementation.
2024-12-21 20:49:07 +08:00
Masanari Iida
02828921db Documentation/guides: Fix typos in port_arm_cm4.rst
Some checks are pending
Build Documentation / build-html (push) Waiting to run
This patch fixes spelling typos in port_arm_cm4.rst
2024-12-20 23:09:40 -05:00
Kyle Wilson
e039fa039d Added comma to fix undefined bits struct member 2024-12-20 23:08:09 -05:00
yaojingwei
bbd6931d61 nuttx/audio: add fake audio driver.
Some checks are pending
Build Documentation / build-html (push) Waiting to run
The fake audio driver aims to easily simulate the functions of audio driver through reading and writing files.
With it, you can conveniently customize and define various capture or playback audio drivers for debugging or automated testing.

Signed-off-by: yaojingwei <yaojingwei@xiaomi.com>
2024-12-20 11:47:08 -03:00
guoshichao
a58d6552e6 fcntl: add sys/fcntl.h header file
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
1701ca1e11 sem: add sys/sem.h header file
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
0d4e36ce29 wait: add wait.h header file
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
0af01312fd sys/socket: add SOL_PACKET packet operation type definition
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
2badabfb67 signal: add include/sys/signal.h to the signal
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
8fcdae3544 sys/types.h: add loff_t data type definition
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
092f4a1b79 sys/mount: add mount flag definition
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
16789ed818 signal: add SA_NOMASK flag definition
according to linux kernel doc, "the SA_NOMASK is an obsolete,
nonstandard synonym for this SA_NODEFER" flag, and some ltp linux kernel
testcases need this flag, so we add this flag to make the testcases pass

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
a8cdd63d56 proctl: add PR_SET_DUMPABLE support
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
203fb15c2e limits: add LINE_MAX limits definition
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
23e0b70290 sys/resource: add RLIMIT_NICE consntant
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
guoshichao
2b34c61c6e signal: add sa_restorer to struct sigaction
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-20 11:46:14 -03:00
hujun5
67b95d0142 use small lock in following files
arch/arm/src/armv7-a/arm_gicv2.c
arch/arm/src/imx6/imx_serial.c
arch/arm/src/imxrt/imxrt_flexcan.c
arch/xtensa/src/esp32/esp32_himem.c
arch/xtensa/src/esp32s3/esp32s3_himem.c

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-20 20:58:43 +08:00
wangjianyu3
0fe3aebd6a nuttx/uorb.h: Add carrier frequency for GNSS Satellite
The `struct sensor_gnss_satellite.cf` may be parsed from `GSV.signal_id`(e.g. NMEA 0183 v4.11) and `struct sensor_gnss_satellite.constellation`

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-20 20:05:26 +08:00
Zhe Weng
035fdb4951 net: Refresh config dependency of NET_READAHEAD
ICMP(v6) uses IOB queue as readahead, but TCP/UDP don't now.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2024-12-20 20:01:19 +08:00
chao an
d36ddb5790 arm/modifyreg: Use common lock to protect the modify address to ensure consistency
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-20 19:54:07 +08:00
hujun5
59a849a7cc esp_rtc: use small lock in arch/risc-v/src/common/espressif/esp_rtc.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-20 14:10:56 +08:00
hujun5
48c439190d fix compile erorr
chip/stm32_gpio.c:44:11: note: '#pragma message: CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py'
   44 | #  pragma message "CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py"
      |           ^~~~~~~
CC:  pthread/pthread_mutexconsistent.c In file included from chip/stm32_flash.c:40:
chip/stm32f20xxf40xx_flash.c:53:4: warning: #warning "Default Flash Configuration Used - See Override Flash Size Designator" [-Wcpp]
   53 | #  warning "Default Flash Configuration Used - See Override Flash Size Designator"
      |    ^~~~~~~
board/stm32_ethernet.c:84:19: warning: 'g_phy_lock' defined but not used [-Wunused-variable]
   84 | static spinlock_t g_phy_lock = SP_UNLOCKED;
      |                   ^~~~~~~~~~
LD: nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-20 14:09:34 +08:00
hujun5
2b762267f3 imx9_flexcan: use small lock in arch/arm/src/imx9/imx9_flexcan.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-20 14:09:34 +08:00
hujun5
a8353eef51 imx9_lpuart: use small lock in arch/arm(64)/src/imx9/imx9_lpuart.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-20 11:53:02 +08:00
Alan Carvalho de Assis
0e162eeb7a drivers/sensors: Add Velocity sensor type to UORB
This patch adds support for velocity measurement sensors.
I plan to use it as a generic velocity type to be used for
Renesas FS3000 (Air Velocity Flow).

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2024-12-19 23:58:04 +01:00
George Poulios
884b4604c2 Map user memory passed to accept() in kernel build
Fixes an issue in kernel build where the user addresses passed
to accept() would be accessed when the wrong MMU mappings were
active. A crash would manifest when attempting to accept() on a
TCP server socket for instance under significant load. The accept
event handler would be called by the HP worker upon client
connection. At this point, accept_tcpsender() would attempt to
write to `addr` resulting in a page fault. Reproducibility would
depend on the current system load (num tasks or CPU stress) but
in loaded environments, it would crash almost 100% of the times.

It should be noted that Linux does this the other way around: it
operates on kernel stack allocated data and once done, it copies
them to user. This can also be a viable alternative, albeit with
one extra copy and a little extra memory.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2024-12-20 00:57:40 +02:00
Filipe Cavalcanti
97c0b43d86 arch/risc-v/espressif: add missing spinlock to wlan_recvframe 2024-12-19 18:16:50 -03:00
bazooka Joe
a7869bb28b stm32_i2c: fix sending large data over i2c
To trigger TC interrupt NBYTES needs to be set before RELOAD is disabled
similar to previous commitdone on stm32h7 510b6221ca
2024-12-19 22:06:04 +08:00
Tiago Medicci Serrano
919cb73913 rv-virt/citest: Test GCC's tls (__thread keyword)
Test the GCC's tls with the `__thread` keyword with ostest by
enabling `CONFIG_SCHED_THREAD_LOCAL`.
2024-12-19 22:04:00 +08:00
Antoine Juckler
1f2946b7ab include/threads.h: Replace thrd_ defines by actual function definitions 2024-12-19 21:56:02 +08:00
hujun5
ecdff659d1 modifyreg[8|32]: use small lock in modifyreg[8|32]
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-19 21:55:21 +08:00
guoshichao
ef6723af9e nuttx: add get_current_dir_name implementation
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-12-19 20:55:51 +08:00
Alin Jerpelea
d700641921 crypto/xform.c: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

NOTE
The code was reported as GPL by FOSS ID
and Xiaomi scanned the file xform.c with Black Duck Security and it showed
that the license was BSD-3-Clause and no risk was reported.

Since there is no clause on the license it was concluded as 0BSD

Refference
https://github.com/apache/nuttx/pull/15252

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-12-19 14:48:18 +08:00
anjiahao
20a0eb1064 procfs:add missing ',' to end of line
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-12-19 14:47:32 +08:00
YAMAMOTO Takashi
b4e5c74319 arch/sim/src/nuttx-names.in: Add pipe2
This breaks the libuv build without CONFIG_PIPES
as expected:

```
LD:  nuttx
/usr/bin/ld: nuttx.rel: in function `uv_pipe':
/src/apps/system/libuv/libuv/src/unix/pipe.c:516: undefined reference to `NXpipe2'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:427: nuttx] Error 1
make: *** [tools/Unix.mk:551: nuttx] Error 2
```

That is, this correctly exposes https://github.com/apache/nuttx/issues/14773
on linux.
2024-12-19 14:46:59 +08:00
hujun5
5d68ab635c remove big lock in arch_phy_irq
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-18 23:28:18 +08:00
hujun5
c1b665c5d5 at32_serial: use small lock in arch/arm/src/at32/at32_serial.c
reason:
We would like to replace the big lock with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-18 23:07:58 +08:00
wangmingrong1
b99ca3f27b gcov: Disable stack checking
When enable CONFIG_STACK_CANARIES, in general, the stack check in the __gcov_fork function is:
" return fork();
18: e59f3020 ldr r3, [pc, #32] @ 40 <__gcov_fork+0x40>
1c: e5932000 ldr r2, [r3]
20: e59d3004 ldr r3, [sp, #4]
24: e0332002 eors r2, r3, r2
28: e3a03000 mov r3, #0
2c: 1a000002 bne 3c <__gcov_fork+0x3c>"
r3 is obtained by taking the value of sp offset. But after opening thumb, the second comparison value in
"8c6: 4a06 ldr r2, [pc, #24] @ (8e0 <__gcov_fork+0x30>)
8c8: 6811 ldr r1, [r2, #0]
8ca: 687a ldr r2, [r7, #4]
8cc: 4051 eors r1, r2"
is obtained through r7. Since r7 stores the stack address at this time, which stores the address of the parent process, the stack out of bounds will occur in the child process

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-18 23:05:52 +08:00
wangmingrong1
3d99bae59a gcov: Prevent pile insertion recursion
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-18 23:05:52 +08:00