5355 Commits
Author SHA1 Message Date
蒙蒙plus 05badce954 [drivers][ipc] 移除 SConscript 中冗余的 __RT_IPC_SOURCE__ 宏定义 2026-09-27 12:18:44 +08:00
Onlyou_tzZ 0edbc15ea9 [cherryusb][fsdev] add N32H4x USBFS device support #11764 2026-09-21 15:43:37 +08:00
wyf-777 3eff2d5c7e [net][at] Reject overlong numeric hostnames
Numeric hostnames were copied into a fixed stack buffer without a length bound.

Cache the length, reject values that cannot fit, and terminate the copy explicitly.

Fixes #11332

Assisted-by: OpenAI Codex:GPT-5
2026-09-21 10:18:56 +08:00
zhangyuyang 5d1aee9b32 [components][sdio] Fix CIS tuple memory leak 2026-09-21 10:12:51 +08:00
zhangyuyang c2f5a28321 [components][sdio] fix possible memory leak of sdio driver unregistration 2026-09-21 09:34:06 +08:00
kingingwang 678473c3ba [rust][tools] Fix Cortex-M33 hard-float target selection
detect_rust_target() 的 Cortex-M33 分支固定返回 thumbv8m.main-none-eabi,
没有使用同函数已计算的 hard_float,而 M4/M7 分支是判断的。

硬浮点 M33 板卡因此拿到软浮点 ABI 的 Rust 库,链接时报
"uses VFP register arguments" 并终止构建。

按 hard_float 选择 eabihf/eabi,与 M4/M7 分支保持一致。
2026-09-21 09:29:19 +08:00
wdfk-prog f6e74cee17 feat[drivers][block]: fix printf format type mismatches
Fix format specifier mismatches in blk_partition.c by using the
appropriate integer formats and explicit casts.

This removes -Wformat warnings on platforms where rt_uint32_t and
rt_size_t are represented as unsigned long.
2026-09-21 09:28:56 +08:00
CYFS 5899db2a52 [rust][build] Avoid toml dependency during clean 2026-09-09 13:31:44 +08:00
zhangyuyang 7fa651bd29 [components][sal] Fix SIOCGIFCONF buffer overflow 2026-09-07 14:53:09 +08:00
CYFS 280bcfeec3 [device][mmcsd] Fix Arm Compiler 5 build compatibility #11690 2026-09-07 11:18:41 +08:00
hanzhijian 2c98902543 [mprotect][kconfig] Add safe defaults for MPU region count options
NUM_MEM_REGIONS / NUM_CONFIGURABLE_REGIONS / NUM_EXCLUSIVE_REGIONS had no
Kconfig defaults. Enabling RT_USING_HW_STACK_GUARD without explicitly
setting them generated empty macros in rtconfig.h (e.g.
'#define NUM_CONFIGURABLE_REGIONS'), which expanded into invalid C
expressions like '(2 + )' and 'for (i = 0U; i < ; i++)', breaking
compilation for cortex-m4/m7/m33 MPU code.

Add safe defaults: NUM_MEM_REGIONS=8, NUM_CONFIGURABLE_REGIONS=0,
NUM_EXCLUSIVE_REGIONS=0. Also document the MemManage_Handler strong-symbol
conflict with CubeMX-generated stm32f4xx_it.c and how to resolve it.

Reported-by: wdfk-prog
2026-09-07 10:31:49 +08:00
TTLLDD 54e5164064 [components][lwp] Remove terminal/ from global CPPPATH
The terminal subsystem's own headers (terminal.h, tty_config.h, ...) are
resolved by the compiler's quoted-include directory lookup for sources
inside components/lwp/terminal; nothing else depends on the path.
Stop polluting the global CPPPATH with this internal directory,
following the convention discussed in #10980.
2026-09-03 09:20:30 +08:00
CYFS b1e8365a6a [utest][rtc] Add RTC time and alarm tests 2026-09-01 13:36:58 +08:00
CYFS 5a9d4d77e3 [utest][pwm] Fix matrix test cleanup and timeout 2026-09-01 09:33:32 +08:00
CYFS f62b0ad85d [utest][pwm] Add configurable PWM matrix test 2026-09-01 09:33:32 +08:00
wyf-777 f4da5cf14c style: format code with clang-format [skip ci] 2026-09-01 09:05:36 +08:00
wyf-777 cfba23f4d1 [net][sal] Free DFS v2 vnode when socket creation fails
When sal_socket() rejects a request, DFS v2 descriptor cleanup destroys the dfs_file but leaves its separately allocated vnode behind.

Destroy the vnode before releasing the failed descriptor and add a regression test that verifies repeated failures do not consume heap.

Fixes #11710

Assisted-by: OpenAI Codex:GPT-5
2026-09-01 09:05:36 +08:00
bernard 21e6f363a4 [components][serial] Format termios staging declaration 2026-08-30 20:55:20 +08:00
bernard 272292f3bc [components][serial] Address review findings for ioctl hardening 2026-08-30 20:55:20 +08:00
bernard c5ead8254e [components][serial] Harden RT-Smart serial ioctl arguments
在 v1/v2 串口文件边界复制已知用户参数,补齐 v2 unread count 和 termios 缓冲区保护。

在 imx6ull UART 编程前校验波特率,并在硬件配置成功后提交串口状态。
2026-08-30 20:55:20 +08:00
bernard 9019e5b594 [style] Align clang-format for procfs and tmpfs
Fix clang-format 22 alignment in loadavg macros, tmpfs setattr
mask wrap, and record-lock utest defines so the format CI passes.
2026-08-30 20:49:24 +08:00
bernard 3ac2b39d25 [dfs][utest] Add POSIX record-lock coverage
Cover positive/negative l_len, overlapping GETLK conflicts,
interrupted F_SETLKW, split/merge, and close/dup2 lock release on
tmpfs.
2026-08-30 20:49:24 +08:00
bernard 5dcbc0dec9 [dfs][procfs] Fix Linux-compatible procfs fields
Grow maps without a 256 VMA cap, skip RSS walks for maps, report
matching status text, real RSS/statm, MemAvailable after page-pool
free pages, load averages plus last PID, cumulative processes, RV32
cpuinfo, and per-character mount escaping.
2026-08-30 20:49:24 +08:00
bernard 04b19b35e3 [libc][posix] Wake epoll waiters on OOM
If waiter allocation fails, mark the fd with POLLERR and wake
epoll_wait() instead of silently dropping the watch.
2026-08-30 20:49:24 +08:00
bernard 06e45356f8 [dfs][posix] Fix EFAULT, tmpfs setattr, and chmod bits
NULL read/write buffers now return -EFAULT. tmpfs setattr uses the
vnode-backed object after unlink, keeps S_ISUID/S_ISGID/S_ISVTX, and
the tmpfs utest checks ENAMETOOLONG plus post-unlink fchmod.
2026-08-30 20:49:24 +08:00
bernard ebe4be9a50 [drivers][virtio] Depend VirtIO net on LWIP
将 VirtIO Net 的依赖从 RT_USING_ETHERNET 调整为 RT_USING_LWIP。
避免 SMART QEMU 在未启用以太网抽象时无法选择网卡。
2026-08-30 20:49:24 +08:00
bernard 3152ab617b [libc][posix] Fix epoll waiters and LWP syscall copies
修复 epoll waiter 生命周期,避免等待队列节点在回调后失效。
整理 LWP POSIX syscall 的用户空间拷贝和错误返回路径。
2026-08-30 20:49:24 +08:00
bernard 25cbe4abae [dfs][procfs] Add Linux-compatible process and system files
补齐 procfs 中 cpuinfo、stat、uptime、loadavg、meminfo、mounts 和进程目录文件。
按架构和 SMP 配置隔离仅在对应平台有效的字段,避免非 AArch64/非 SMP 构建告警。
2026-08-30 20:49:24 +08:00
bernard f02a869318 [dfs][posix] Add record locks, fchmod, and tmpfs metadata
为 DFS v2 增加 POSIX 记录锁、fchmod,以及 tmpfs 的权限和时间元数据。
进程退出时通过 dfs_fdtable_drop_fd 释放文件描述符和记录锁。
2026-08-30 20:49:24 +08:00
zhangyuyang 14ef29af91 fix(netdev): 修复无网卡时 ping 命令空指针崩溃
netdev_cmd_ping 中 netdev 回退到 netdev_default 后未判空,
QEMU 无网卡环境下执行 ping 直接解引用 NULL 崩溃(data abort)。
回退后增加空指针检查,提示无可用网卡并返回错误。
2026-08-27 09:04:47 +08:00
Bernard Xiong 0305faf806 [finsh] Remove deprecated FINSH_FUNCTION_EXPORT_ALIAS#11734 2026-08-26 10:53:23 +08:00
ari.liu ba79f69477 [kernel][ipc] Fix timeout wakeup ownership race
Keep thread timer ownership when timer stop races with an in-flight timeout callback, and consume IPC resources only after a waiter is resumed successfully.

Complete ownership cleanup in the generic and RT-Smart channel timeout callbacks. Add deterministic scheduler and LWP regressions for Event, Semaphore, Mailbox, Message Queue, sender, and receiver paths.
2026-08-21 16:52:01 +08:00
yan hu 30af7388a4 [rust][tools] Fix Rust build example configuration handling
Improve the Rust build integration across core, applications, components, and module examples. Fix build failure propagation, target and feature handling, linker flags, example configuration semantics, and add STM32 CI attach coverage.
2026-08-21 11:17:57 +08:00
Hui Su 339bffb702 [fix][libc] fix timegm month overflow calculation
The original overflow logic used __spm[tm_mon] as the current month's
length when normalizing tm_mday. This produced incorrect dates after
crossing month boundaries and left zero or negative days unnormalized.

Use the difference between adjacent cumulative day offsets with
leap-year handling. Normalize overflow in tm_sec, tm_min, tm_hour,
tm_mday, and tm_mon to keep the affected broken-down fields normalized.

Add regression tests for month boundaries, leap years, large offsets,
zero and negative days, negative time fields, combined overflow, and
boundary carry cases.

Close #11686

Signed-off-by: Hui Su <3164683437@qq.com>
2026-08-21 09:44:42 +08:00
hanzhijian 7d1e551549 [dfs] Fix path buffer leaks in utimensat 2026-08-20 18:30:47 +08:00
Bernard Xiong 991f0ffca6 Add AF_UNIX sockets implementation (#11681)
* components/dfs: support unix socket nodes

AF_UNIX pathname binding and descriptor passing require DFSv2 socket
nodes and retained open file descriptions across fd tables.

Add socket-node creation for tmpfs and devtmpfs, fd reference helpers,
and socket F_SETFL forwarding.

Impact: DFSv2 socket nodes and descriptor reference handling.
Validation: git diff --cached --check.

* components/net/sal: support local protocol providers

Local IPC protocol families do not have a backing network device.
Store the selected provider in each SAL socket and add a local provider
registry while preserving netdev checks for Internet sockets.

Handle DFSv2 close semantics, socketpair flags, and MSG_CTRUNC for
AF_UNIX integration.

Impact: SAL protocol dispatch for all socket families.
Validation: git diff --cached --check.

* components/lwp: support unix socket messages

Musl AF_UNIX addresses and ancillary data require explicit ABI and
user-memory conversion at the LWP syscall boundary.

Add the musl msghdr layout, bounded address and message copying,
control-message level conversion, and MSG_CTRUNC translation. Correct
receive buffer allocation and copy lengths while handling messages.

Impact: LWP socket syscalls when SAL is enabled.
Validation: git diff --cached --check.

* components/net/af_unix: add local sockets

Add an opt-in AF_UNIX provider for pathname-based local IPC without
a synthetic network device.

Support datagram and stream sockets, blocking and nonblocking I/O,
timeouts, poll, socketpair, and SCM_RIGHTS descriptor passing. Include
bounded Kconfig settings, component documentation, and utest coverage.

Impact: enabled only by RT_USING_AF_UNIX and requires SAL POSIX with
DFSv2.
Validation: git diff --cached --check.

* Fix AF_UNIX CI checks

Apply the repository clang-format rules to the affected source lines.
Suppress the cppcheck false positive for the devtmpfs list iterator.

No functional behavior is changed.

* components/lwp: preserve NULL optional msghdr buffers

When msg_name or msg_control is NULL, keep the kernel pointer NULL
instead of substituting an uninitialized buffer. Reject a NULL control
buffer with a nonzero length as EFAULT.

Impact: LWP sendmsg/recvmsg conversion on MMU targets.
Validation: git diff --cached --check.

* components/net/af_unix: fix poll UAF, namespace leak, and SCM_RIGHTS cycles

Poll only the local wait queue and wake writers from the receiver.
Free namespace entries on detach, and reject AF_UNIX descriptors in
SCM_RIGHTS until cycle collection exists.

Impact: AF_UNIX poll, bind lifetime, and descriptor passing.
Validation: git diff --cached --check.

* components/dfs: add DFSv2 AF_UNIX utest suite

Add opt-in tests under dfs/utest/v2/af_unix for socket nodes, IPC,
poll peer-close, namespace cleanup, and SCM_RIGHTS rejection.

Sources are built only when RT_UTEST_TC_USING_DFS_V2_AF_UNIX and the
selected test groups are enabled.

Impact: DFS utest menu and build; no production AF_UNIX behavior change.
Validation: git diff --cached --check.
2026-08-17 17:15:34 +08:00
Kai d2acd7587e wlan: fix silent failure of wifi cmd when device mode not bound#11696 2026-08-17 14:34:57 +08:00
Kai 0823a4b80c wlan: add WPA3/enterprise/WAPI/OWE/DPP security modes 2026-08-17 11:00:04 +08:00
GuEe-GUI f7258a6bb8 [bsp/raspberry-pi] update DM support
- reorganize common Raspberry Pi drivers under the device framework
- add the Raspberry Pi 5 BSP, configuration and documentation
- add BCM2712 and DesignWare AXI DMA controller support
- distinguish BCM2712 DMA32 and DMA40 channels by channel mask
- restore DesignWare AXI DMA enable bits after controller reset
- support a shared AXI maximum burst length across DMA channels

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-16 19:56:03 +08:00
GUI 7bf01ae18d [DM/OFW][PCI] Fix address translation and PCI resource enumeration (#11677)
* [DM/OFW][PCI] Fix address translation and PCI resource enumeration

Rework OFW address translation to walk nested bus ranges in the correct
direction and cache "ranges" and "dma-ranges" independently. Handle PCI
three-cell addresses without treating the PCI flags cell as part of the
address, and fix CPU-to-DMA and DMA-to-CPU translation across nested
buses.

Fix PCI BAR sizing and assignment by disabling address decoding during
probing, preserving BAR attribute bits, and programming 64-bit BARs
correctly. Add device enable and disable helpers so resources and bus
mastering are enabled before driver probe.

Program bridge memory and prefetch windows while scanning downstream
buses, correctly link child buses into the PCI bus hierarchy, and avoid
unnecessary PCIe link retraining when the link is already active.

Allow host bridges without a device-tree pci-domain property by
allocating unique domains dynamically, while preserving explicit domain
assignments.

Fix MSI and MSI-X IRQ setup, rollback, vector addressing, and affinity
selection.

Add the Raspberry Pi PCI vendor ID for RP1 and other downstream devices.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* style: format code with clang-format

* style: format complete changed files with clang-format

* drivers: pci: address OFW review feedback

* style: format PCI and OFW changes for current master

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-14 12:42:32 +08:00
GUI f2c05253d1 [dm][dma] Update DMA (#11678)
* [dm][dma] update DMA interface

Extend DMA mapping to honor OFW dma-ranges even
when no reserved memory pool is present,
and add PCI host-bridge DMA-region translation for PCI devices.
Prefer 32-bit-addressable allocations for translated devices,
improve pool allocation fallbacks and synchronization,
and establish a linear mapping for installed DMA pools when possible.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* [dm][dma] fixup PL330 work flow

Fix PL330 channel allocation so device-tree cells
select peripheral request lines rather than execution channels.
Generate proper peripheral DMA microcode using DMAWFP, DMALDP, DMASTP, and DMAFLUSHP,
encode burst lengths correctly,
honor transfer direction and non-secure attributes,
and allocate microcode from DMA-coherent memory.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* style: format code with clang-format

* style: format complete changed files with clang-format

* drivers: dma: fix diagnostic format types

* style: format DMA changes for current master

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-14 12:42:01 +08:00
GUI c1418dbd2e [DM/Input] Add ADC joystick, keyboard, and touchscreen drivers (#11679)
* [DM/Input] Add ADC joystick, keyboard, and touchscreen drivers

Add polling input drivers for ADC-connected joysticks and resistor-
ladder keys. Parse Linux-compatible device-tree bindings, acquire ADC
channels through the IIO framework, and report absolute-axis and key
events.

Add an SPI touchscreen driver for ADS7843, ADS7845, ADS7846, ADS7873,
TSC2046, and XPT2046-compatible controllers. Support pen interrupts,
coordinate and pressure reporting, sample filtering, regulator control,
power management, and common touchscreen properties.

Add an I2C touchscreen driver for Goodix GT9xx controllers with
multi-touch reporting, GPIO-based reset and address selection, interrupt
handling with polling fallback, regulator control, panel configuration,
and alternate-address recovery.

Adapt the drivers to the RT-Thread device model and input framework,
following the corresponding Linux input drivers and device-tree
bindings.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* style: format code with clang-format

* drivers: input: address review feedback

* style: format input changes for current master

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-14 12:41:00 +08:00
GUI 4cf70e176c [dm][sdio] Update for SDHCI- #11684 #11684 2026-08-14 12:39:11 +08:00
Rbb666 46fdeefb32 refactor(pic): dispatch NVIC IRQs through traps 2026-08-12 12:54:50 +08:00
Rbb666 1f23e3f270 fix(dm): route Cortex-M resets through power core 2026-08-12 12:54:50 +08:00
Rbb666 f05fb1c076 fix(mm): exclude no-MMU ioremap from MMU builds 2026-08-12 12:54:50 +08:00
Rbb666 6b4f34204e feat(dm): support OFW on Cortex-M targets
Add the ARM NVIC PIC driver, no-MMU I/O mapping, built-in FDT support, and Cortex-M CPU hooks required by the native RT-Thread device model.
2026-08-12 12:54:50 +08:00
hanzhijian c00f13005b [lwip-dhcpd] Fix pbuf leak for oversized requests 2026-08-12 10:55:20 +08:00
GUI 9d04b6baab [dm][clk] fixup the work flow of CLK (#11673)
* [dm][clk] fixup the work flow of CLK

Add RT_CLK_F_SET_RATE_NO_REPARENT so clock providers can preserv
the currently selected parent during rate changes.
Round and re-read the effective clock rate after parent handling,
skip redundant gate toggles and hardware programming when
the target is already active, and fix error handling for parent-clock allocation failures.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* style: format code with clang-format

* style: format complete changed files with clang-format

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-08 18:25:02 +08:00
GUI a2c196d643 [dm][phye] Add Mode/State and MIPI D-PHY timing helper (#11675)
* [dm][phye] Add Mode/State and MIPI D-PHY timing helper

Extend the generic PHY framework with cached mode and submode state,
avoiding redundant hardware mode changes.
Add MIPI D-PHY default timing calculation helpers based on
pixel clock or lane high-speed clock, and expose the new API through rtdevice.h.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* style: format code with clang-format

* style: format complete changed files with clang-format

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-08-07 21:31:43 +08:00