Commit Graph

240 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
Xiang Xiao 526de919a6 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:27:37 +08:00
openvela-robot f26d07fc93 Change FIOC_MMAP into file operation call
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2026-04-20 22:27:36 +08:00
openvela-robot 4c66726191 fs/timerfd: Reverse truncate and mmap field
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:27:33 +08:00
openvela-robot 1a5e8cad6c rptun/pm: add check to rptun_pm_callback() incase of start early
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-20 22:27:26 +08:00
openvela-robot f5110d8788 drivers/note: remove choice in Kconfig
To support multiple note drivers to be used at the same time

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 22:27:22 +08:00
openvela-robot a546913c08 libc/syslog: improve streamsyslog, add puts funtions
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 22:27:19 +08:00
openvela-robot cf85f824c5 arm64/a64: Fix PIO Interrupt
The current implementation of PIO Interrupt for Allwinner A64 is incomplete. This PR fixes the implementation of PIO Interrupt for all supported PIO Ports (PB, PG and PH).

### Modified Files

`arch/arm64/src/a64/a64_pio.c`, `a64_pio.h`: Add implementation of PIO Interrupt

`arch/arm64/include/a64/irq.h`: Add IRQ for PIO Port PH

`arch/arm64/src/a64/hardware/a64_pio.h`: Fix addresses of PIO Interrupt Registers
2026-04-20 22:27:16 +08:00
openvela-robot 55ab88459e net: downgrade iob priority of input/udp/icmp to avoid blocking devif
When trying to use iperf2, we found it comsumes all the IOB when sending UDP packets, then devif_poll has no IOB to send the packet out, so speed drops to 0 and never recovers.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-04-20 22:27:13 +08:00
openvela-robot 41ce861dfc arch:add faultmask register operation to armv7-m & armv8-m
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-04-20 22:27:09 +08:00
openvela-robot 3aa6f66c67 Fix fatfs/fatfs_vfs.c:170:3: error: initialization of 'int (*)(struct file *, off_t)' {aka 'int (*)(struct file *, long long int)'} from incompatible pointer type 'int (*)(struct file *)' [-Werror=incompatible-pointer-types]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:27:07 +08:00
openvela-robot 14df64aeaa assert:add a last type to call notifier
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-04-20 22:27:03 +08:00
openvela-robot c5911a6e79 fs_zipfs: move truncate position
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-20 22:27:01 +08:00
openvela-robot d44d492d49 Revert "Sysview add prefix kconfig to add an option to decouple sched_note calls"
This reverts commit f72f7ebee08215bce2443a84c2173c4031297e0a.
2026-04-20 22:26:57 +08:00
openvela-robot c2317e6c72 Add ftruncate into file operation calls
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2026-04-20 22:26:54 +08:00
openvela-robot c86e895654 fs: Move mmap callback before truncate in [file|mountpt]_operations
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:26:49 +08:00
openvela-robot 1c9b1fc37a drivers/note: Fix the mismatch of va_end call
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:26:46 +08:00
Xiang Xiao 2d0ff7bbb6 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:26:43 +08:00
openvela-robot 429c0c0eec arch/armv7-a: unify switch context from software interrupt
Signed-off-by: chao.an <anchao@xiaomi.com>
2026-04-20 21:38:16 +08:00
openvela-robot 67d9073d3a Revert "mm_initialize.c: make sure the heapsize aligned with MM_MIN_CHUNK."
This reverts commit 0e226b3ecd6d8f9ef7daf9c7b1edff026cb28502.
2026-04-20 21:38:13 +08:00
openvela-robot f496aa9c53 ci: harmonize rust installation paths. 2026-04-20 21:38:10 +08:00
openvela-robot ad2068685f libc/machine: Implement ARM aeabi_xxx API called by clang
specified here:
https://developer.arm.com/documentation/ihi0043/latest

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 21:38:07 +08:00
openvela-robot d0e1329063 arch:xtensa: modify svcall to swint
Reason: xtensa svcall only have level-1 interrupt level.
Sush do not generate interrupt when up_irq_save.
Software int can generate interrupt when up_irq_save.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2026-04-20 21:38:03 +08:00
openvela-robot a774f3c1ff fs/fatfs: support O_APPEND mode
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2026-04-20 21:37:57 +08:00
openvela-robot f361469a9d nuttx/pty:pty FIONBIO pass to pipe control
1. pass FIONBIO ioctl to pipe
2. resolve the return value error

Signed-off-by: fangzhenwei <fangzhenwei@xiaomi.com>
2026-04-20 21:37:54 +08:00
openvela-robot 157b51666a driver/uinput: add fix uinput Spelling mistakes
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 21:37:50 +08:00
openvela-robot c903eff772 arch/ceva: Replace OUTDIR with TOPDIR
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 21:37:45 +08:00
openvela-robot 93f45fe834 serial/pty: Remove the unused code related to CONFIG_PSEUDOTERM_FULLBLOCKS
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 21:37:42 +08:00
openvela-robot c62f0e4458 Remove the double blank line from source files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 21:37:39 +08:00
openvela-robot e446cd6b4c boards/sim: Rename ARCHCPUFLAGS[XX] to ARCHC[XX]FLAGS
follow other board files usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 21:37:36 +08:00
openvela-robot 6c35bd7bb7 ci: add Rust compiler suite 2026-04-20 21:37:31 +08:00
openvela-robot 3b652139a8 Add CONFIG_NDEBUG Kconfig to control NDEBUG definition
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 21:37:27 +08:00
openvela-robot b7dd67bb75 LICENSE: document code found in arch: arm: am335x
Document the licenses for non Apache code found in the mentioned folder

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-04-20 21:37:23 +08:00
openvela-robot aa9ab7614b driver/uinput: Add cross core control function
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 21:37:17 +08:00
openvela-robot 95f815b97c risc-v: Rename up_fault to riscv_fault
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-04-20 21:37:06 +08:00
openvela-robot 048adf8784 board/sim: update uinput init & Kconfig
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 21:37:02 +08:00
openvela-robot 73ec3b6109 drivers/pipe: Don't use sched_[lock|unlock] to do protection
since the sched lock can't work in SMP context

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 21:36:58 +08:00
openvela-robot 82a0c0c7fb add cs35l41b power hibernate mode
update cs35l41b power hibernate and wake up

Signed-off-by: genghuihui <genghuihui@xiaomi.com>
2026-04-20 21:36:55 +08:00
openvela-robot f7367906c0 Remove duplicate linker script definitions
## Summary
A lot of linker scripts were listed twice, once for unix, once for windows.

This PR cleans up the logic so they're only listed once.

 ## Impact
Any opportunity to use a single source of truth and reduce lines of code is a win!

 ## Testing
CI will test all build
2026-04-20 21:36:50 +08:00
openvela-robot b4e07c389e libc/sim: Rename arch_setjmp[64].S to arch_setjmp_x86[_64].S
to follow other arch/x86 arch/x86_64 convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 21:36:46 +08:00
openvela-robot b4a69b8bd6 libdsp/lib_observer.c: separate angle observer from speed observer
They can be used completely independently, so they should'n be coupled.
For example, a sensored motor controller in speed control mode doesn't need an angle estimator.
2026-04-20 21:36:41 +08:00
openvela-robot 85bc97cec5 rpmsg_socket: fix kasan report error
==1598322==ERROR: AddressSanitizer: heap-use-after-free on address 0xf514f8a8 at pc 0x58ac3898 bp 0xd0b4d488 sp 0xd0b4d478
READ of size 4 at 0xf514f8a8 thread T0
    #0 0x58ac3897 in rpmsg_socket_pollnotify rpmsg/rpmsg_sockif.c:211
    #1 0x58ac512f in rpmsg_socket_ept_cb rpmsg/rpmsg_sockif.c:312
    #2 0x5787881c in rpmsg_virtio_rx_callback open-amp/lib/rpmsg/rpmsg_virtio.c:331
    #3 0x57886a67 in virtqueue_notification open-amp/lib/virtio/virtqueue.c:623
    #4 0x5786fb89 in rproc_virtio_notified open-amp/lib/remoteproc/remoteproc_virtio.c:340
    #5 0x5786bde3 in remoteproc_get_notification open-amp/lib/remoteproc/remoteproc.c:985
    #6 0x57755a50 in rptun_worker rptun/rptun.c:303
    #7 0x57755e51 in rptun_thread rptun/rptun.c:352
    #8 0x57730d4a in nxtask_start task/task_start.c:128
    #9 0xdeadbeee  (/memfd:pulseaudio (deleted)+0x15dbeee)

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-20 21:36:38 +08:00
openvela-robot 127912c674 Fix jlink-nuttx build with GCC 10.2
The packed-attribute on the tcb_info_s type was misplaced, which caused
incompatible memory layout between host and target.  According to
current GCC documentation:

> You may specify type attributes in an enum, struct or union type
> declaration or definition by placing them immediately after the struct,
> union or enum keyword.  You can also place them just past the closing
> curly brace of the definition, but this is less preferred because
> logically the type should be fully defined at the closing brace.

I also added jlink-nuttx.so to the .gitignore list and updated nxstyle
to ignore the camel case function names required by JLinkGDBServer.

Signed-off-by: Michael Jung <mijung@gmx.net>
2026-04-20 21:36:34 +08:00
openvela-robot 2a63566b24 power:governor: move governor declaration to include/nuttx/power
And add static const to g_pmgovernor

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2026-04-20 21:36:30 +08:00
openvela-robot cfa09ec134 arm/backtrace: fix the compile warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2026-04-20 21:36:25 +08:00
openvela-robot 3ff5489e83 fatfs: fix hang becauseof errout without release lock
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2026-04-20 21:36:22 +08:00
openvela-robot 52498ed58d boards/k210: Add -mstrict-align to arch level flags since it don't support unaligned memory access
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-04-20 21:36:18 +08:00
openvela-robot 7ae5df6513 mm_memdump: fix messy code beacuse of backtrace is null
ap> memdump
[49631.086445] [ 9] [  INFO] [ap] Dump all used memory node info:
[49631.087043] [ 9] [  INFO] [ap]    PID        Size    Address Backtrace
[49631.087913] [ 9] [  INFO] [ap]      0          44 0x3c58db2c�he,TRU<w�g,Ԕ�[<$RU<0RU<�ĩ[<s'<'�f,J
[49631.089055] [ 9] [  INFO] [ap]      3          64 0x3c58db58 0x2c683ea6 0x2c67cb00 0x2c655ef4 0x2c65aa9c 0x2c65a9f8 0x2c669a22 0x2c67f7dc 0x000514a8
[49631.090686] [ 9] [  INFO] [ap]      0         448 0x3c58db98 0x2c683ea6
[49631.091502] [ 9] [  INFO] [ap]      0         256 0x3c58dd58 0x2c683ea6
[49631.092372] [ 9] [  INFO] [ap]      0          64 0x3c58de58 0x2c683ea6 0x2c67cb00 0x2c655ef4 0x000512a8 0x2c927062 0x2c300056

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2026-04-20 21:36:15 +08:00