Commit Graph

527 Commits

Author SHA1 Message Date
YAMAMOTO Takashi 3a2d42ba24 uio api tweaks
VELAPLATFO-60135:VELAPLATFO-60136

* Make readv/writev implementations update struct uio
  This can simplify partial result handling.

* change the error number on the overflow from EOVERFLOW to EINVAL
  to match NetBSD

* add a commented out uio_offset field. I used "#if 0" here as
  C comments can't nest.

* add a few helper functions

Note on uio_copyfrom/uio_copyto:
although i'm not quite happy with the "offset" functionality,
it's necessary to simplify the adaptation of some drivers like
drivers/serial/serial.c, which (ab)uses the user-supplied buffer
as a line-buffer.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-04-21 01:17:29 +08:00
Alin Jerpelea 75a2b5a5f7 drivers: 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.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-04-21 01:13:35 +08:00
YAMAMOTO Takashi 295a69730d move readv/writev to the kernel
currently, nuttx implements readv/writev on the top of read/write.
while it might work for the simplest cases, it's broken by design.
for example, it's impossible to make it work correctly for files
which need to preserve data boundaries without allocating a single
contiguous buffer. (udp socket, some character devices, etc)

this change is a start of the migration to a better design.
that is, implement read/write on the top of readv/writev.

to avoid a single huge change, following things will NOT be done in
this commit:

* fix actual bugs caused by the original readv-based-on-read design.
  (cf. https://github.com/apache/nuttx/pull/12674)

* adapt filesystems/drivers to actually benefit from the new interface.
  (except a few trivial examples)

* eventually retire the old interface.

* retire read/write syscalls. implement them in libc instead.

* pread/pwrite/preadv/pwritev (except the introduction of struct uio,
  which is a preparation to back these variations with the new
  interface.)
2026-04-21 01:13:26 +08:00
openvela-robot a56015f507 libs/libc/libc.csv: fix the wcsspn declaration error
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-04-20 23:20:57 +08:00
openvela-robot 66b3c1de6a Fix nuttx coding style
Remove TABs
Remove spaces
Fix indentation
2026-04-20 23:20:50 +08:00
openvela-robot 21e1fc44d5 pthread_cleanup: rm sched_[un]lock
Since TLS is only used within a single thread and requires no additional protection.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-20 23:20:47 +08:00
openvela-robot ad75fbcda6 drivers/modem/alt1250: Fix bug that modem version could not be taken
Fix bug that modem version could not be taken.
2026-04-20 23:20:42 +08:00
openvela-robot 92d696ed3d video/fb: add vsync queue
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2026-04-20 23:20:38 +08:00
openvela-robot f8ad39780a libs/libc/wchar: add wcscpy implementation
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-04-20 23:20:33 +08:00
openvela-robot 59e75b7129 tools/minudumpserver: support auto start GDB and execute some commands
like
```bash
./nuttx/tools/minidumpserver.py -l log.log -e vela_ap.elf -a arm --gdb prebuilts/gcc/linux/arm/bin/arm-none-eabi-gdb
```

Signed-off-by: xinbingnan <xinbingnan@xiaomi.com>
2026-04-20 23:20:29 +08:00
openvela-robot f95bdccaf9 arch/arm64: select ARCH_HAVE_IRQTRIGGER for all arm64 chip
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2026-04-20 23:20:23 +08:00
openvela-robot c199997b15 mmcsd: support dump cid and csd with mmc-utils
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2026-04-20 23:20:18 +08:00
openvela-robot 70cb2188db Exec: Support run exec in current task
There is a problem when vfork() calls execv() (or execl()) to start a new application:
When the parent thread calls vfork() it receives and gets the pid of the vforked task,
and not the pid of the desired execv'ed application.
see issue #3334

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2026-04-20 23:20:13 +08:00
openvela-robot c4d62a9eb5 Revert "bcmf_thread: wait until need load blm"
sync with mainline

This reverts commit 38c2adc14d32d0dc51e0963cbfcb7152f87a5038.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-20 23:20:08 +08:00
openvela-robot 250c273fd0 wifi: parse channel from IE when ctl_ch is 0
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-20 23:20:04 +08:00
openvela-robot d1953ba43a tools/testbuild: restore the original toolchain configuration before refresh
Signed-off-by: chao an <anchao@xiaomi.com>
2026-04-20 23:20:00 +08:00
openvela-robot a5e648c435 wifi: Add handle type for disconnecting event
Some disconnected events will be missed

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-20 23:19:55 +08:00
openvela-robot 8e63c4d2bc specific product: emmc: add get emmc cid register interface.
add get emmc cid register interface.

Signed-off-by: luoguangfu <luoguangfu@xiaomi.com>
2026-04-20 23:19:52 +08:00
openvela-robot cad65a60dd add Artery at32
check nxstyle

check nxstyle
2026-04-20 23:19:48 +08:00
openvela-robot 4d6a9e2794 libs/libc/wchar: add putwc implementation
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-04-20 23:19:45 +08:00
openvela-robot 3d87e34027 drivers/video: Fix crash caused by priv->capture_cb = null
When the upper layer calls goldfish_camera_data_uninit, priv->capture_cb=NULL, but when there is data transmission in goldfish_camera_thread, priv->capture_cb will be called, which will cause a crash.

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2026-04-20 23:19:40 +08:00
wanggang26 5bd638115b vela: enable O_CLOEXEC explicit
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2026-04-20 23:19:37 +08:00
chao an a3e9ea1c83 inode/i_private: remove all unnecessary cast for i_private
Signed-off-by: chao an <anchao@xiaomi.com>
2026-04-20 23:18:40 +08:00
openvela-robot 3e7bbe9f21 arm/psci: Fixed arm psci related compilation errors
Summary
include/arch/syscall.h: Assembler messages:
include/arch/syscall.h:133: Error: bad instruction `struct arm_smccc_res'
include/arch/syscall.h:134: Error: junk at end of line, first unrecognized character is `{'
include/arch/syscall.h:135: Error: bad instruction `unsigned long a0'
include/arch/syscall.h:136: Error: bad instruction `unsigned long a1'
include/arch/syscall.h:137: Error: bad instruction `unsigned long a2'
include/arch/syscall.h:138: Error: bad instruction `unsigned long a3'
include/arch/syscall.h:139: Error: bad instruction `unsigned long a4'
include/arch/syscall.h:140: Error: bad instruction `unsigned long a5'
include/arch/syscall.h:141: Error: bad instruction `unsigned long a6'
include/arch/syscall.h:142: Error: bad instruction `unsigned long a7'
include/arch/syscall.h:143: Error: junk at end of line, first unrecognized character is `}'
include/arch/syscall.h:145: Error: bad instruction `typedef struct arm_smccc_res

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2026-04-20 23:18:38 +08:00
openvela-robot 4e9637fa17 arch/arm64: Add support for FriendlyElec NanoPi M4
Refs: https://github.com/apache/nuttx/pull/10193
      https://github.com/u-boot/u-boot/tree/v2022.04
      https://wiki.friendlyelec.com/wiki/index.php/NanoPi_M4

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-20 23:18:34 +08:00
openvela-robot 055f952a13 arch: Remove up_netinitialize
since this api change to xxx_netinitialize

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 23:18:29 +08:00
openvela-robot 236b97c860 xtensa/esp32s3: Fix octal lines mode SPIRAM blocking issue
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2026-04-20 23:18:21 +08:00
openvela-robot b90fd5fb86 net/tcp: Stop monitor in `tcp_free`
We may just free some TCP connections before monitor stopped, e.g.
sacrificie a TCP conn in `tcp_alloc` will just call `tcp_free` and reuse
the connection.  But we noticed that the TCP monitor is not released in
`tcp_free` because it is mounted on `conn->connevents` instead of
`conn->sconn.list` while `tcp_free` only release the latter.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-04-20 23:18:15 +08:00
openvela-robot 3a4545a246 audio:add 24K sample rate support
Signed-off-by: shipei <shipei@xiaomi.com>
2026-04-20 23:18:03 +08:00
openvela-robot c18193a1f4 devif_callback: modify the code logic to conform to the comment
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-20 23:17:55 +08:00
openvela-robot d86ca563dd nuttx/sensors/sensor.h: remove non-standard message from bream private data
These values are only provided by bream private message, should not include in
NMEA 0183 standard struct.

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 23:17:50 +08:00
openvela-robot b09375782c qemu:fix ci build error when CONFIG_LIBC_FDT is not defined
when dtc code is set to be download from github, if CONFIG_LIBC_FDT is not
set, it will cause such error:
./qemu_bringup.c:33:10: fatal error: libfdt.h: No such file or directory
580   33 | #include <libfdt.h>

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-04-20 23:17:46 +08:00
openvela-robot 28d2818457 Fix Kconfig style
Remove spaces from Kconfig
Add comments
2026-04-20 23:17:39 +08:00
openvela-robot b66f64952b tools: checkpach supports python files
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 23:17:35 +08:00
openvela-robot 192ad17528 sched: do not crash for priority multi-boost
aio client will queue asynchronous io requests to the worker threads.
if PRIORITY_INHERITANCE is enabled, client thread's priority will be
set to worker threads. There will be multi-boost/restore of worker
threads' priority and assert the system.

No need priority multi-boot/restore to worker thread because client
thread's priority is alway the same.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2026-04-20 23:17:30 +08:00
openvela-robot f06cb20443 xtensa/esp32s3: Fix code style of esp32s3_psram_octal.c
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-20 23:17:26 +08:00
openvela-robot b601c45bb8 nuttx/build: Restore ARLOCK to improve compile speed in incremental case
To solve the issue of carrying object files from previous builds,
Matias changed the archiving process to re-archive libapps.a on every compilation,
if libapps.a carries more object files, incremental compilation will waste too
many time in re-archiving, compared with the previous implement, this is a degradation
of the build system.  Referring to mature engineering projects such as cmake, if there
is configuration or source file changed, the best solution should be to reconfigure
the environment.

Revert this PR to ensure the compilation speed during incremental compilation.

|  commit 34b34e2d4519956f9a61f5985aca29947c4b8b23 (tag: nuttx-20200914-172150)
|  Author: Matias N <matias@protobits.dev>
|  Date:   Fri Sep 11 22:31:38 2020 -0300
|
|      Fix: ensure archive files do not carry object files from prior builds
|
|      In some cases, when NuttX configuration changes and this makes the
|      object list used to build one of the .a libraries change as well,
|      since the command used to build it is "ar crs" and this simply appends
|      the list of object files, the library could still include object
|      files from prior builds. This commit modifies the ARCHIVE macro to
|      erase the .a file if it already exists.
|
|      Since in some cases this behavior was actually expected (object
|      files from a subdirectory were appended to a library created one
|      level above) I added a ARCHIVE_ADD which works as ARCHIVE did.
|
|      This change should greatly improve behavior of building after
|      configuration changes.

Testing:

sim:nsh
-------------------------------
|   Patched    |  Current
-------------------------------
|$ time make   |  $ time make
|real 0m1.270s |  real 0m1.728s
|user 0m0.971s |  user 0m1.276s
|sys  0m0.363s |  sys  0m0.530s
-------------------------------

Private project (20+ 3rd library needs archive to libapps.a)
-------------------------------
|   Patched     |  Current
-------------------------------
|$ time make    |  $ time make
|real 0m21.181s |  real 0m39.721s
|user 0m14.638s |  user 0m24.837s
|sys  0m6.919s  |  sys  0m14.394s
-------------------------------

Signed-off-by: chao an <anchao@xiaomi.com>
2026-04-20 23:17:20 +08:00
openvela-robot 3015e9c893 xtensa/esp32s3: Support octal lines mode SPIRAM
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-20 23:17:16 +08:00
openvela-robot 49e7e3d754 boards/esp32-devkitc: Renamed wifi_smp_rmt to rmt
Removed wifi_smp_rmt config for ESP32

Replaced RMT defconfig with generated file
2026-04-20 23:17:06 +08:00
openvela-robot 886b2e01ac pm: fix a memleak in open and refine code
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2026-04-20 23:17:02 +08:00
openvela-robot 1603e15b86 sim/crypto: support MBEDTLS_MD5_ALT config
Signed-off-by: makejian <makejian@xiaomi.com>
2026-04-20 23:16:55 +08:00
openvela-robot 6af84731d0 arch/arm64: Remove the dummy arm64_netinitialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 23:16:51 +08:00
openvela-robot 89beffca64 socketcan/recv : fixed recv filter not work in special case
can recv filter doesn't work when there is any CAN data already
buffered in a read-ahead buffer

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2026-04-20 23:16:45 +08:00
openvela-robot cdf02050c0 cxd56xx: rm sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-20 23:16:39 +08:00
openvela-robot 83aacfccbd usbdev: add usbdev fs device for usb char device
Add usb_fs driver so that userspace can directly transfer USB packets
through the EP node. ADB, Fastboot, MTP will use usb_fs, these class
driver only need to provide the descriptors and register the usb_fs device.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2026-04-20 23:16:32 +08:00
openvela-robot ec35a7b865 Revert "tools/config: remove archive print to support macro call"
This reverts commit ea87764b28b2fdf31e271d006867f99f629bdd17.

Reason for revert: <regression>
2026-04-20 23:16:29 +08:00
openvela-robot cb8accfd56 audio:add media session support for sim_alsa audio_ops_s interface
fix Compiler Warning:initialization of ‘int (*)(struct audio_lowerhalf_s *, void *)’
from incompatible pointer type ‘int (*)(struct audio_lowerhalf_s *)’ [-Wincompatible-pointer-types]

Signed-off-by: shipei <shipei@xiaomi.com>
2026-04-20 23:16:23 +08:00
openvela-robot 71295c9215 drivers/binder:Add flag to distinguish non-blocking mode.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-20 23:16:19 +08:00
openvela-robot a32c3a2128 tools/prasetrace: remvoe function name filter
Some function names in C++ may fail to parse, and no filtering is required here.
(anonymous namespace)::pool::free(void*) [clone .constprop.0]

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 23:16:14 +08:00
openvela-robot 68df5fa803 binder: remove thread from waiting_threads list after poll
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2026-04-20 23:16:09 +08:00