Commit Graph

60831 Commits

Author SHA1 Message Date
xuxin19 e3fcb025cb cmake(bugfix):fix common/etc confilt with src/etc in CMake genromfs
We use the rules added later to overwrite the previous rules

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-27 20:54:26 +08:00
xuxin19 4f80953ecd cmake(bugfix):do not set nuttx_add_app NAME as required
Instead, use direct return, because in non-build targets,
such as savedefconfig, menuconfig, this check is unnecessary

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-01-27 20:54:26 +08:00
pangzhen1 a665cd795a sched/irq: functions should have exactly one exit point
According to MISRA C-2004 Rule 14.7, Every function must have exactly one entry point and one exit point.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2026-01-27 19:35:48 +08:00
wangchengdong 165f1cc063 sched/sched: enable OS tickless mode support using hrtimer
Add support for running the OS in tickless mode with hrtimer, allowing
the scheduler to operate without periodic ticks while maintaining
high-resolution timer functionality.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-27 19:35:31 +08:00
wangchengdong 2ae62d71a6 sched/hrtimer: fix hrtimer regression introduced by recent update
The hrtimer subsystem is independent of the OS tick mechanism and tickless
mode. It must always be able to reprogram the hardware timer to achieve
nanosecond-level resolution.

A recent update restricted hardware timer reprogramming to tickless mode
only. As a result, hrtimer no longer functions correctly when the scheduler
is running in tick-based mode.

This change removes the incorrect dependency on tickless mode and restores
proper hrtimer operation.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-27 19:35:31 +08:00
wangchengdong d9a0cf46ac arch/risc-v: fix timer initialization for SMP using mtimer
Correct timer initialization issue in SMP mode using mtimer to ensure
  per-hart timers are properly set up during boot.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-27 19:34:45 +08:00
likun17 c52d54d500 drivers/sensors: Remove the uncalibrated member of the sensor
lowerhalf layer.

The uncalibrated type is passed in with type. The driver defaults
to the calibrated type.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-27 19:34:33 +08:00
likun17 4f0e71dca1 drivers/sensors: Add new features.
add nine-axis(Accerometer Magnetic Field and Gyroscope) uncalibrated type.

Signed-off-by: likun17 <likun17@xiaomi.com>
2026-01-27 19:34:33 +08:00
wangzhi16 c7e7711db5 sched/spinlock: Call spinlock nopreempt when need disable context switch.
Using spin_lock_irqsave_nopreempt and spin_unlock_irqrestore_nopreempt to replace the following case.
flags = spin_lock_irqsave(lock);
sched_lock();
.....
spin_unlock_irqrestore(lock, flags);
sched_unlock();

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2026-01-27 19:33:58 +08:00
pangzhen1 927cccb278 sched/irq: Avoid negative array index in irqchain_dispatch
IRQ_TO_NDX() may return a negative value when the IRQ number is invalid
or not mapped. Using this negative value directly as an array index for
g_irqvector causes undefined behavior and potential memory corruption.

This patch adds a bounds check to ensure ndx is non-negative before
accessing the g_irqvector array, returning the error code if invalid.

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2026-01-27 19:33:29 +08:00
makejian 5331d5a905 docs: enhance crypto documentation with RSA signature schemes
Add comprehensive documentation for RSA digital signature operations supported by the cryptodev/cryptokey interface.

Includes:
- RSA-PKCS1.5: Traditional PKCS#1 v1.5 padding scheme
  - CRK_RSA_PKCS15_SIGN: Generate RSA signature with PKCS#1 v1.5 padding
  - CRK_RSA_PKCS15_VERIFY: Verify RSA signature with PKCS#1 v1.5 padding

- RSA-PSS: Probabilistic Signature Scheme for enhanced security
  - CRK_RSA_PSS_SIGN: Generate RSA signature with PSS padding
  - CRK_RSA_PSS_VERIFY: Verify RSA signature with PSS padding

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-27 19:30:14 +08:00
makejian eea0f45e04 crypto: remove release process in close
The callback parameters are currently passed in by the upper layer, so the release process in close should not be performed here.

This prevents double-free issues and ensures proper resource management.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-27 19:30:14 +08:00
makejian 3b151ae44b crypto/cryptodev: fix async callback
Fix incorrect memory management for asynchronous process callbacks.

Ensure callback memory is self-managed to prevent leaks or use-after-free issues.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-27 19:30:14 +08:00
makejian 791e223001 crypto/cryptosoft: fix buffer pointer
Fix issue where input buffer pointer was modified during crypto operations.

Ensures original buffer pointer remains valid for the caller.

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-27 19:30:14 +08:00
makejian 2878fa3c38 crypto: export rsa with pkcs1.5 and pss mode
Add support for exporting RSA operations with PKCS#1 v1.5 and PSS padding schemes through the cryptodev interface.

This enables both traditional and modern RSA signature schemes:
- CRK_RSA_PKCS15_SIGN/VERIFY for PKCS#1 v1.5 padding
- CRK_RSA_PSS_SIGN/VERIFY for PSS padding

Signed-off-by: makejian <makejian@xiaomi.com>
2026-01-27 19:30:14 +08:00
chao an f3e2a7029d sched: Remove legacy sched_resumescheduler.c
The sched_resumescheduler support was already removed in prior commits.
This change cleans up the now unused legacy source file.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2026-01-27 18:21:12 +08:00
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