Commit Graph

60815 Commits

Author SHA1 Message Date
wangzhi16 6fc2d010a6 graphics/nxterm: Use small lock to protect resource in graphics.
Use small lock to protect resource in graphics.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-27 17:59:07 +08:00
wangzhi16 4fa66a6850 drivers/pwm : remove critical section and mutex.
Use spinlock to replace critical section and mutex.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-27 17:59:07 +08:00
wangzhi16 4a68e55277 drivers/timer : remove critical section.
Use spinlock to replace critical section

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-27 17:59:07 +08:00
wangzhi16 85b09ca07b sched/wdog : remove critical section.
replace critical section with irq in wdog.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-27 17:59:07 +08:00
wangzhi16 4f33a32e36 mm/kasan: Remove unnecessary critical sections in mm/kasan.
Remove unnecessary critical sections in mm/kasan.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-27 17:59:07 +08:00
Bowen Wang aa7ec1083b nuttx/spinlock.h: add rspin_trylock/_irqsave/_nopreempt support
Build Documentation / build-html (push) Has been cancelled
Add try-lock variants for rspinlock_t to support non-blocking spinlock
acquisition with optional IRQ save/restore and preemption control.
These variants enable fine-grained synchronization patterns in nested
contexts with maximum nesting depth support (UINT16_MAX).

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-27 12:22:24 +08:00
yinshengkai b777b0acbe boards/sam3u-ek: Increase kflash size from 65K to 80K.
Adjusted memory layout to allocate more space for kernel flash:

Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
2026-01-27 10:37:37 +08:00
yinshengkai 450e760d16 fs/fat: add support for FIOC_FILEPATH ioctl
This patch adds support for the FIOC_FILEPATH ioctl command in the
FAT filesystem, allowing applications to retrieve the full path of
an open file descriptor.

Key features:
- Implements fat_getfilepath() to construct file paths by traversing
  parent directories using ".." entries
- Adds fat_findlfnstart() helper to locate the start of LFN sequences
- Supports both FAT12/16 and FAT32 filesystem types
- Handles both regular directories and root directory traversal

This functionality is useful for debugging, logging, and applications
that need to track file paths at runtime.

Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
2026-01-27 10:37:37 +08:00
cuiziwei 94ac6b620b libstdc++: Relocate c++config.h from include/ to libstdc++ to preserve upstream integrity
- Add c++config.h to improve libstdc++ configuration support
- Update CMakeLists.txt and libsupc++.defs to integrate the new config header
- Remove the obsolete 0001-libsupc-Add-missing-header-files.patch to clean up the codebase

These changes enhance the maintainability and portability of the C++ standard library and simplify the build process.
2026-01-27 10:35:58 +08:00
liwenxiang1 6d9ed4217a shced/irq: Add up_irq_to_ndx interface
Use architecture-specific up_irq_to_ndx() interface to map IRQ numbers to vector table indices

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2026-01-27 10:34:13 +08:00
pangzhen1 d483364481 sched/wqueue: add configuring the stack of an hpwork/lpwork as static
Allows configuring a static stack for hpwork/lpwork.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2026-01-27 10:18:24 +08:00
Tomasz 'CeDeROM' CEDRO ec41f30f9a doc: Update Host Tools section.
* Remove `tools/` from the section name.
* Generate local TOC that lists described tools.
* Update new parsetrace.py toctree location to fix indexing and display.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2026-01-27 09:52:01 +08:00
Tomasz 'CeDeROM' CEDRO 1d06fe5905 doc: Improve sphinx build time + add autobuild help info.
* Update previous `-j 1` and `-j 8` switch to `-j auto` to use all CPUs.
* This improves doc build time 62s -> 25s on 24 core CPU.
* Add information about `make autobuild` to `make help`.
* Auotbuild is very handy for quick edits preview and was not in help before.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2026-01-27 09:50:55 +08:00
yukangzhi 9bda244be8 tools/parsetrace.py: Fix get_typesize bug in parsetrace.py
Build Documentation / build-html (push) Has been cancelled
For the following code, we need to check 'type_attr.form'.
type_attr = DIE.attributes["DW_AT_type"]
base_type_die = dwarfinfo.get_DIE_from_refaddr(xxx)

When type_attr.form==DW_FORM_ref_addr, 'type_attr.value' means
global reference (across compilation units).

When type_attr.form==DW_FORM_ref4, 'type_attr.value' means
local reference (within the same compilation unit).

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-26 23:22:41 +01:00
nuttxs fa2d2b8898 boards/xtensa: fixes for compilation and start-up issues when legacy
boot mode is configured

1. Explicitly define the .rtc_reserved section to ensure RTC data
that requires fixed address is correctly placed and does not
conflict with other sections
2. When legacy boot is configured, vecbase must also be set and
clear the BSS section
3. Cache must be disabled during Flash operations, so all
Flash-operation-related functions must be placed in IRAM
(internal RAM). Update the linker script for legacy boot mode

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2026-01-26 19:22:14 -03:00
Alexey Matveev d57899847a arch/stm32: Add counter reset function
Added stm32_cap_rstcounter() function to reset the capture counter
by generating an update event. The function is integrated into the
capture operations structure and exposed via STM32_CAP_RSTCOUNTER
macro. Also added TI3 and TI4 input mappings for extended capture
channel support.

Signed-off-by: Alexey Matveev <tippet@yandex.ru>
2026-01-26 19:13:22 -03:00
Yongrong Wang f56ea30479 drivers/rpmsg: refactor internal APIs to private header
Move rpmsg internal APIs from public header include/nuttx/rpmsg/rpmsg.h
to private header drivers/rpmsg/rpmsg.h. These APIs are only used within
the rpmsg driver implementation and should not be exposed to external
modules.

Moved APIs:
- rpmsg_modify_signals()
- rpmsg_ns_bind() / rpmsg_ns_unbind()
- rpmsg_device_created() / rpmsg_device_destory()
- rpmsg_register() / rpmsg_unregister()

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-26 17:23:31 -03:00
yukangzhi 8226e8e8fe driver/noteram: Support poll threshold
The noteram driver supports setting the poll threshold.

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-27 03:18:38 +08:00
yukangzhi 890f2e4625 sched: add trace points during system startup and board initialization
Add trace points to record transitions of g_nx_initstate and to mark
board early/late initialization boundaries. Also add trace marks for
RESET and PANIC to improve boot-time diagnostics and failure analysis.

Add OSINIT_RESET to indicate system is in reset process.

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-27 03:18:11 +08:00
yukangzhi 6ccc2fc7c8 driver/ramlog: Implement the rate limiting function for ramlog driver.
Limit the maximum number of log entries allowed within
the specified time interval in seconds.

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-01-27 03:17:05 +08:00
jklincn 6538477fa5 drivers/sensors/dhtxx: Fix read return values to be POSIX compliant
The dhtxx driver previously returned 0 on success, which violates standard
character device behavior where the number of bytes read should be returned.
It also used non-standard error codes like -1 or -ENOSYS for operational
errors.

This commit fixes the following behavior to comply with POSIX standards:
* Return sizeof(struct dhtxx_sensor_data_s) on success instead of 0.
* Return -EINVAL instead of -ENOSYS/-1 for invalid buffer arguments.
* Return -ETIMEDOUT instead of -1 for sensor timeouts.
* Return -EIO instead of -1 for checksum or parsing errors.

Signed-off-by: jklincn <jklincn@foxmail.com>
2026-01-27 03:11:25 +08:00
Eren Terzioglu e0401ae18b Docs/platforms/espressif: Add SPI docs for esp32s2
Add SPI defconfig docs for esp32s2-saola-1

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-01-27 03:09:34 +08:00
Eren Terzioglu 9f83dda366 boards/xtensa/esp32s2: Add SPI defconfig
Add spi defconfig and SPI3 initializer for esp32s2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-01-27 03:09:34 +08:00
Eren Terzioglu 2dbdcd603f arch/xtensa: Fix esp32s2 SPI errors
Fix esp32s2 SPI DMA and SPI3 errors

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-01-27 03:09:34 +08:00
hujun5 226443fb81 tricore: support SYSCALL_HOOKS
Build Documentation / build-html (push) Has been cancelled
Enable SYSCALL_HOOKS architecture capability for TriCore platform.
This allows runtime interception and hooking of system calls on
TriCore architecture, enabling profiling, tracing, and debugging features.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 21:22:34 +08:00
liaoao ae6ad9c193 drivers/rpmsg_port_spi_slave: add getrecvbuf callback for zero-copy receive
Add a new getrecvbuf callback to the SPI slave device operations
that allows the slave device to provide a pre-allocated receive
buffer directly to the controller. This enables zero-copy data
transfer by allowing the controller to receive data directly into
the device's buffer instead of copying.

Changes:
- Add SPIS_DEV_GETRECVBUF macro and getrecvbuf callback to
  spi_slave_devops_s structure in include/nuttx/spi/slave.h
- Implement getrecvbuf in rpmsg_port_spi_slave driver
- Update getdata to return 0 as it's no longer used for this path

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao fd6ab20362 drivers/rpmsg_port_spi: fix SPI exchange length calculation
The cmdhdr->len was uninitialized before being used in SPI exchange
operations. This caused incorrect transfer lengths.

Changes:
- Initialize cmdhdr->len to sizeof(struct rpmsg_port_header_s) during
  initialization for both SPI master and slave drivers
- Use port.txq.len instead of cmdhdr->len for TX exchange length
- Use port.rxq.len instead of cmdhdr->len for RX getdata length

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao ba81948741 drivers/rpmsg_port_spi/slave: update type of pin number to pinset_t
Correct the gpio pin number type

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 9f4708f643 drivers/rpmsg_port_spi: fix build error
CC:  vfs/fs_unlink.c rpmsg/rpmsg_port_spi.c: In function ‘rpmsg_port_spi_complete_handler’:
rpmsg/rpmsg_port_spi.c:415:11: warning: implicit declaration of function ‘rpmsg_port_spi_drop_packets’; did you mean ‘rpmsg_port_drop_packets’? [-Wimplicit-function-declaration]
  415 |           rpmsg_port_spi_drop_packets(rpspi, RPMSG_PORT_SPI_DROP_ALL);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |           rpmsg_port_drop_packets
rpmsg/rpmsg_port_spi.c:415:46: error: ‘RPMSG_PORT_SPI_DROP_ALL’ undeclared (first use in this function); did you mean ‘RPMSG_PORT_DROP_ALL’?
  415 |           rpmsg_port_spi_drop_packets(rpspi, RPMSG_PORT_SPI_DROP_ALL);
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~
      |                                              RPMSG_PORT_DROP_ALL

rpmsg/rpmsg_port_spi_slave.c:292:5: warning: implicit declaration of function ‘container_of’; did you mean ‘list_container_of’? [-Wimplicit-function-declaration]
  292 |     container_of(port, struct rpmsg_port_spi_s, port);
      |     ^~~~~~~~~~~~
      |     list_container_of

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 986a1f38a6 drivers/rpmsg_port_spi/slave: increase rx thread default stack size
The default stack size should be large enough to avoid the stack
overflow:

0x18551ad8      1968      1968   100.0%!    24.2%   rpmsg-spi

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 49d95aa0d1 drivers/rpmsg_port_spi/slave: remove the pm prepare ops
Use pm wakelock is enough to make sure system will not suspend
when there is a transfer in process, and it can actually sleep when
there is buffer to send but peer side not response in 1ms which is
the timeout we set.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao a52dc0e785 drivers/rpmsg_port_spi_slave: unbind spictrl when peer shutdown
Unbind the spictrl to close the spi controller, and bind it again
when peer boots.
This can help to reduce the leak current caused by the spi gpio.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
Xiang Xiao fa947f95ee drivers/rpmsg_port_spi/slave: add RPMSG_PORT_SPI_ prefix to BYTES2WORDS
Code format optimization

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:17:27 +08:00
Xiang Xiao 8981810e96 drivers/rpmsg_port_spi: call rpmsg_port_spi_pm_action(false) in inactive path
Only call rpmsg_port_spi_pm_action(false) when no more data to
transfer to avoid unnecessary pm unlock/lock operations.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao 6ca67e4061 drivers/rpmsg_port_spi: check crc value only when crc is enabled
Allow one side enables crc check while the other side not enabled.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao de5ec3be6c drivers/rpmsg_port_spi/slave: notify remote core when reboot
Now rpmsg_port_spi/slave support send shutdown command to remote
core to notify then local core will reboot, so remote core can
notify all the rpmsg services to do the unregister.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-26 21:17:27 +08:00
liaoao abe28e1bcf drivers/rpmsg_port_spi/slave: add pm ops support for rpmsg port spi
Add low power support for the rpmsg port spi/slave transport, now
the rpmsg port spi/slave transport will not allow enter into the
low power state when there are still tx data to sent or rx data
to processed.

Signed-off-by: liaoao <liaoao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-26 21:17:27 +08:00
hujun5 a89b7f7add clock: remove 64-bit perf support for 32-bit systems
Remove atomic64-based 64-bit perf counter support for 32-bit systems
where atomic64 operations are unavailable, simplifying userspace perf
implementation to avoid unsupported atomic operations.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 21:14:38 +08:00
Yanfeng Liu 8f0e30b07c libc/perf: userspace PMU access
Add ARCH_HAVE_PERF_EVENTS_USER_ACCESS capability to allow applications
to directly access hardware perf counters via perf_gettime() from
userspace, enabling performance monitoring and profiling without syscalls.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2026-01-26 21:14:38 +08:00
Xiang Xiao b76a8408c1 sched/clock: Refine the code structure for userspace access
Reorganize perf_gettime implementation to eliminate duplicate functions
and improve code structure for userspace library integration,
consolidating logic flow for better maintainability.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:14:38 +08:00
Xiang Xiao 277626870d sched/clock: Remove perf_init to simplify the code
Remove perf_init() function and automatic initialization call, relying
on static initialization instead to reduce code complexity and avoid
global variable access in perf_update callback.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-26 21:14:38 +08:00
zhangyuan29 197ed9fc94 sched/clock: add perf overflow offset for clock perf
dd ARCH_PERF_COUNT_BITWIDTH configuration to support architectures
with different perf counter bit widths (TriCore 31-bit, others 32-bit),
enabling proper overflow correction across diverse platforms.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-01-26 21:14:38 +08:00
yinshengkai 633014b6b1 clock: fix perf_gettime race condition
Move hardware perf counter read after spinlock acquisition to prevent
reading stale values due to concurrent overflow updates.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-01-26 21:14:38 +08:00
wangzhi16 03ca455066 sched/sched: Modify the critical section interface name.
replace _wo_note to _notrace.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-26 21:13:05 +08:00
Yongrong Wang aa567d43f6 drivers/rpmsg: fix struct alignment issue by removing zero array member
This commit fixes a memory alignment issue in the rpmsg subsystem.
The previous implementation used a flexible array member (rdev[0])
in struct rpmsg_s, but due to automatic 8-byte padding, rpmsg->rdev
could differ from the transport layer's rdev address (e.g.,
rpmsg_virtio->rvdev.rdev), causing potential memory corruption.

Changes:
- Remove rdev[0] flexible array member from struct rpmsg_s
- Add rpmsg_get_rdev_by_rpmsg() inline helper to calculate rdev
  address as (rpmsg + 1), ensuring correct pointer arithmetic
- Update all rpmsg->rdev references to use the new helper function
- Fix rpmsg_virtio_notify_wait() to use correct container_of macro

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-01-26 21:12:34 +08:00
anjiahao fea492cf6f libc/spawn:support get/set priority
support get/set priority

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-01-26 21:01:01 +08:00
hujun5 6c18cfd472 fvp: change memory map and Optimize MPU configuration
Extract fixed MPU region configuration into arm64_mpu_init_regiions() function to
allow board-specific initialization. Refactor memory layout to minimize fixed region
requirements and improve dynamic MPU configuration flexibility for FVP platform.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:59:04 +08:00
hujun5 4d956952c1 arch/arm64/src/common/arm64_mpu.h: simplified macro definition
Reduce macro definition duplication by consolidating REGION_*_ATTR macros into a unified
SHAREABLE_MSK definition. This improves code maintainability and reduces configuration
complexity while preserving all attribute functionality.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:59:04 +08:00
hujun5 41847b7445 arm64_mpu: Make the MPU interface of cortex-r82 consistent with other archs.
Refactor mpu_modify_region() and mpu_configure_region() functions to use direct parameters
(base, size, flags) instead of struct pointers. This ensures consistent interface across
all ARM64 MPU implementations including Cortex-R82, improving code uniformity.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:59:04 +08:00
hujun5 386457440a arm64_mpu.h: rename some MPU ATTR
Rename MPU region attribute macros (REGION_RAM_ATTR → REGION_RW_NA_ATTR,
REGION_URAM_ATTR → REGION_RW_RW_ATTR) to explicitly indicate access permissions.
Add new REGION_RO_RO_ATTR and REGION_RO_NA_ATTR macros for read-only region definitions.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-26 20:59:04 +08:00