Commit Graph

172 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 113c0f6e2a arch/sim: sim support 16bbp
Signed-off-by: qinshijing <qinshijing@xiaomi.com>
2026-04-20 23:30:07 +08:00
openvela-robot f616fae195 coresight/etm: correct params of etm_write_reg in etm_modify_reg32
Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-04-20 23:30:03 +08:00
openvela-robot e596558731 fs/tmpfs: fix an integer overflow
newsize = newsize + CONFIG_FS_TMPFS_FILE_ALLOCGUARD;

When newsize is a large value,
adding a relatively small value can cause the result to become very small,
resulting in program logic errors.
For example:
0xffffffff + 0x2 = 1

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-20 23:30:00 +08:00
openvela-robot fc5a9c6046 binder:Change the handle from a global variable to process dependent.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-20 23:29:56 +08:00
openvela-robot d8a484acbb clock.h: use CONFIG_DEBUG_SCHED to test init ticks
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2026-04-20 23:29:51 +08:00
openvela-robot ed303dd471 coresight:add tmc device support
Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-04-20 23:29:48 +08:00
Xiang Xiao 02316727ee poll: pollsetup should notify only one fd passd by caller
since it's redundant to iterate the whole fds array in setup

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 23:29:45 +08:00
yinshengkai 5c2cdcab21 Revert "drivers: return sequential characters for /dev/zero device"
This reverts commit 47a37fa06b49925d1fbd6ff400a2276c580e3811.

Reason for revert: <replace with /dev/ascii>

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 23:00:31 +08:00
openvela-robot 1f4db9902e drivers/goldfish_pipe: notify poll event in interrupt task
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2026-04-20 23:00:30 +08:00
openvela-robot 5a91b8520e arch/arm64: Enable FPU for qemu-armv8a:netnsh_smp and netnsh_smp_hv
When reading https://github.com/apache/nuttx-apps/pull/1793, I found a previous problem https://github.com/apache/nuttx-apps/pull/1454#discussion_r1045718067 now still exists on current master (inf in iperf bandwidth).

By step-by-step debugging, I found a value of 1000000.0 stored in register d8 is overwritten as 0 after context switch, then fdiv results in inf because of divided by 0. Finally I found that ARCH_FPU is not enabled while compiler is using FPU, and may lose values in floating-point registers.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-04-20 23:00:25 +08:00
openvela-robot 6317da53a6 drivers/net: Add wireless ops in upper-half driver
Take the idea from Linux's iw_handler array and esp32c3_wlan's wlan_ops_s, and make it a common logic of upper-half driver.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-04-20 23:00:17 +08:00
openvela-robot e88b4fc3cc drivers/rtt: check whether Jlink is connected
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 23:00:13 +08:00
openvela-robot 1c5e909269 nuttx/tls: Remove the max key limiatation in task_tls_alloc and pthread_key_create
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-20 23:00:10 +08:00
openvela-robot 0baf1d85fc time: add up_perf_init weak_function
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 23:00:05 +08:00
openvela-robot 03cd2a090e driver/segger: Simplify serial driver configuation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 23:00:01 +08:00
openvela-robot 35f5ed4543 libc/pthread: remove unsed compare code in pthread_rwlock_init()
In nuttx function pthread_rwlock_init param attr is useless, so remove it to make rwlock_init pass rwlock_init/1-1.c and rwlock_init/3-1.c testcases.

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2026-04-20 22:59:57 +08:00
openvela-robot cc1f1e6193 drivers/rtt: add rtt syslog channel configuration
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 22:59:54 +08:00
openvela-robot 71250ba402 openamp/libmetal: Check CONFIG_HAVE_ATOMICS instead of HAVE_STDATOMIC_H in atomic.h
When we use libmetal with other headers using stdatomic.h, we'll get
symbol conflict if we don't enable HAVE_STDATOMIC_H in libmetal.  The
best solution might be using cmake to detect headers automatically, but
we can't.  Fortunately we have CONFIG_HAVE_ATOMICS macro now, which can
replace HAVE_STDATOMIC_H when we're not using cmake.

Note: 2-Steps to use CONFIG_HAVE_ATOMICS
1. Include compiler.h for CONFIG_HAVE_ATOMICS definition
2. Check CONFIG_HAVE_ATOMICS instead of HAVE_STDATOMIC_H

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-04-20 22:59:47 +08:00
openvela-robot 308984b9dc Revert "driver/crypto: add config dependon for dev_urandom"
This reverts commit ac89cb5904bc5cf61b534d378e0d9c1510769148.
Reason for revert: need to add dev_uranmregister to arch

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-20 22:59:44 +08:00
openvela-robot 15c47cfcfb documentation: Add release notes for 12.2.1 release
This is a local copy taken from the confluence notes
https://cwiki.apache.org/confluence/display/NUTTX/NuttX+12.2.1

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-04-20 22:59:40 +08:00
openvela-robot 485f1b5de2 arm64: GoldFish add miss arm64_netinitialize
Summary
    add miss arm64_netinitialize function for goldfish
platform

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
2026-04-20 22:59:37 +08:00
openvela-robot 7af664ae76 ESP32S2: Add support to SPI Flash 2026-04-20 22:59:33 +08:00
openvela-robot 887469bfcf sched/clock: move clock_getcpuclockid() and clock_getres() to libc
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2026-04-20 22:59:29 +08:00
openvela-robot 9dd4ed2381 cmake/sched: fix build break based on mainline
Signed-off-by: chao an <anchao@xiaomi.com>
2026-04-20 22:59:22 +08:00
openvela-robot ba69e163b7 audio: add AUDIOIOC_FLUSH ioctl
Signed-off-by: qiaohaijiao1 <qiaohaijiao1@xiaomi.com>
2026-04-20 22:59:14 +08:00
openvela-robot 0b1f53e4c4 nRF91: add mcuboot support 2026-04-20 22:59:09 +08:00
openvela-robot 12036b0178 net/ioctl: add some bridge calls command
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-20 22:59:05 +08:00
openvela-robot ddeb0fff05 netlink: add statistics-related struct definitions
In order to support the compilation of third-party library, we encounter
some situations where the macro is not defined, refer to the common
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-20 22:59:01 +08:00
openvela-robot fbcbf18227 sched/task/fork: add fork implementation
1. as we can use fork to implement vfork, so we rename the vfork to
fork, and use the fork method as the base to implement vfork method
2. create the vfork function based on fork function

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-04-20 22:58:56 +08:00
openvela-robot d7ae6c8aae libs/libc/modlib: fix dynamic loader issues
* build-globals.sh
    - Macros for defining symbols etc. based on assembler in use
    - Use the System.map to get all the nuttx symbols

  * libs/libc/modlib/modlib_globals.S
    - Provide an empty skeleton. If the dynamic loading functions
      are required then run build-global.sh after a clean build
      using the skeleton. This will fill out the skeleton with the
      symbols to be available to dynamically loaded modules.

  * libs/libc/modlib/modlib_loadhdrs.c
    - Fix case where there are no program headers are avaiable
2026-04-20 22:58:52 +08:00
yinshengkai e5c3184af1 drivers: return sequential characters for /dev/zero device
It will return all characters between ' '(0x20)-'~'(0x7e).

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 22:58:48 +08:00
Xiang Xiao 275a12504c fs: Add g_ prefix for all global file_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:43:43 +08:00
openvela-robot 088c1ae57c Revert "arch/armv7ar: use robust code sequences for cache maintenance"
This reverts commit 37104bf185dbf1665fc57f4ad039672e5c97c1dd.

Reason for revert: <This patch will cause specific product's a7 to fail to execute up_clean_dcache_all()>
2026-04-20 22:43:41 +08:00
openvela-robot 62554b14c6 arch: Return directly when arch not support interrupt context save
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2026-04-20 22:43:38 +08:00
openvela-robot d2364f6228 syslog: remove unsed check
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-20 22:43:35 +08:00
openvela-robot 5f59220877 arm/unwind: EABI unwind needs frame pointer support
Signed-off-by: chao an <anchao@xiaomi.com>
2026-04-20 22:43:32 +08:00
openvela-robot 2a4cfb9401 procfs:add armv7-m cpuinfo
Influence: add /proc/cpuinfo:

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-04-20 22:43:24 +08:00
openvela-robot 2e8503aca9 video/fb: fix pollnotify calling crash in advance
When executing up_fbinitialize, the driver may turn on the vsync interrupt. If the vsync interrupt calls fb_pollnotify before executing fb->vtable->priv = fb it will cause null pointer access and crash.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2026-04-20 22:43:20 +08:00
openvela-robot aba489ecb4 video/fb: add vsync offset support
Android Documentation: https://source.android.com/docs/core/graphics/implement-vsync#vsync_offset

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2026-04-20 22:43:17 +08:00
openvela-robot 0f53e5dd6d Add eMMC driver support
- Fix DMA addressing issues within litex_sendsetup/litex_recvsetup
- Extend with handling specific to eMMC commands during init & use.
- Cleanup of 4-bit BUS handling for SD and eMMC
- For eMMC, Send CMD0 during init as per JEDEC v4.41 for pre-idle
2026-04-20 22:43:13 +08:00
openvela-robot 15cdfb62f7 arch/sim: Implement host_freeheap for windows
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-04-20 22:43:04 +08:00
openvela-robot 5ea04db747 arch/armv7-r: add armv7-r smp support
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2026-04-20 22:43:00 +08:00
openvela-robot 7891f4524d system: pthread_barrierwait should be moved to kernel space
The current implementation requires the use of enter_critical_section, so the source code needs to be moved to kernel space

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-20 22:42:57 +08:00
openvela-robot b112464dd1 libc/locale: support iconv_open,iconv,iconv_close
Refs to:https://github.com/bminor/musl

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-20 22:42:54 +08:00
openvela-robot b2eaf6699f arch/arm64: get_cpu_id according to the correct affinity level
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2026-04-20 22:42:51 +08:00
openvela-robot 9ac4ad4c3b system: pthread_barrierwait can not be preemption
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-20 22:42:47 +08:00
openvela-robot ab4474d383 zipfs:fix fseek failed when call fread first
fs/zipfs: zipfs_seek should call unzOpenCurrentFile after unzLocateFile like zipfs_open

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2026-04-20 22:42:43 +08:00