Commit Graph

148 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
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
Xiang Xiao d113e8efce fs: Add g_ prefix for all global file_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:42:39 +08:00
Xiang Xiao b1d0d8583c 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:27:37 +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 d64d0e1b10 drivers/note: Add const to g_notelog_ops
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:26:43 +08:00
openvela-robot 9593f71eaa libc/machine: Remove the unnecessary MACHINE_OPTS_ARMVxx Kconfig
and refine the relatd Makefile

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 22:26:40 +08:00
openvela-robot ba6b7ef1ee fix: sensor: new member into ECG sensor type
ECG sensors usually output some status info besides ECG data, such as lead and fast-recovery status. Thus a new member "status" is added into sensor_ecg struct.

Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
2026-04-20 22:26:37 +08:00
openvela-robot 4c9d4712b1 net_local: Optimized logic of local_inout_poll_cb
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-20 22:26:33 +08:00
Jukka Laitinen 73afe38610 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:26:30 +08:00