Commit graph

60363 commits

Author SHA1 Message Date
zhangyu117
c50dd1d952 include/nuttx/seqlock.h: remove warning about less header.h
remove warning about less headers.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2025-12-22 10:22:06 -03:00
hujun5
5df2072876 seqlock: Improve seqlock performance on SMP platforms.
The optimization reduces one judgment in read operations, improving write performance by 3% and read performance by 10%.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-22 10:22:06 -03:00
ouyangxiangzhen
d576363fc4 seqlock: Improve seqlock performance on non-SMP platforms.
This commit implemented seqlock for non-SMP platforms, which achieves
1.62x performance improvement.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 10:22:06 -03:00
ouyangxiangzhen
a8724387e7 seqlock: Improve seqlock performance.
This commit improved the seqlock performance on non-SMP and SMP
platforms by 31.7% on average (83Mops -> 106Mops, tested on qemu-intel64/KVM).

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 10:22:06 -03:00
ouyangxiangzhen
ef1fb35462 seqlock: Better implementation of the seqlock.
This commit provided a better implementation of the seqlock, which
ensure the functional correctness and provide better performance.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 10:22:06 -03:00
hujun5
46ad770b60 seqlock: add SMP_WMB to seqlock
This commit added SMP_WMB to seqlock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-22 10:22:06 -03:00
hujun5
65247f2603 seqlock: change UP_DMB to UP_RMB to improve performance
read_seq Loop 20,000,000 times
before
233333376
after
183333375

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-22 10:22:06 -03:00
hujun5
9e3b852d4b seqlock: add predict_xxx to increase performance
This commit added predict_xxx to increase performance.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-22 10:22:06 -03:00
ouyangxiangzhen
dbc6bedff9 seqlock: Remove memory barrier if Non-SMP.
This commit removed unnecessary memory barriers of the seqlock
implementation, since they may block the CPU pipeline and lead to
performance degradation.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 10:22:06 -03:00
hujun5
f1ef43c72e nuttx: add seqlock.h
This commit added seqlock.h.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-22 10:22:06 -03:00
wangzhi16
0268be1076 sched/arch: fix compile error.
03:17:57  /home/work/ssd1/workspace/Vela-Multi-Boards-dev-system-Build@2/nuttx/include/nuttx/seqlock.h: In function 'read_seqbegin':
03:17:57  /home/work/ssd1/workspace/Vela-Multi-Boards-dev-system-Build@2/nuttx/include/nuttx/seqlock.h:107:3: error: 'asm' undeclared (first use in this function)
03:17:57     SMP_RMB();
03:17:57     ^
03:17:57  /home/work/ssd1/workspace/Vela-Multi-Boards-dev-system-Build@2/nuttx/include/nuttx/seqlock.h:107:3: note: each undeclared identifier is reported only once for each function it appears in
03:17:57  /home/work/ssd1/workspace/Vela-Multi-Boards-dev-system-Build@2/nuttx/include/nuttx/seqlock.h:107:3: error: expected ';' before 'volatile'
03:17:57     SMP_RMB();
03:17:57     ^

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-12-22 10:22:06 -03:00
hujun5
c55954d56c barrier: add UP_RMB UP_WMB
This commit added linux-style UP_RMB() and UP_WMB().

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-22 10:22:06 -03:00
ouyangxiangzhen
7d01d8aab5 sched/wdog: Move the g_wdtimernested to sched_timerexpiration.
This commit moved the g_wdtimernested to sched_timerexpiration, since
wdog and hrtimer can share it.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 21:17:13 +08:00
ouyangxiangzhen
e5db83d7db sched/sched: Remove nxsched_alarm_expiration
This commit removed nxsched_alarm_expiration to simplify the timer
expiration.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 21:17:13 +08:00
ouyangxiangzhen
3aed2485f8 sched/sched: Remove nxsched_alarm_tick_expiration
This commit removed nxsched_alarm_tick_expiration to simplify the timer
expiration.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 21:17:13 +08:00
ouyangxiangzhen
b048984dd4 sched/sched: Simplify nxsched_process_scheduler.
This commit simplified nxsched_process_scheduler.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 21:17:13 +08:00
ouyangxiangzhen
5569755868 sched/sched: Change the return value semantics.
This commit changed the return value semantics.
In past designs, timers that were expected to fire immediately were delayed by at least one tick, resulting in a decrease in real-time performance.
This commit re-encoded the return value to allow the timers fire
immediately.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 21:17:13 +08:00
ouyangxiangzhen
c785ed7175 sched/sched: Change the uint32_t ticks to clock_t.
This commit changed the uint32_t ticks to clock_t.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 21:17:13 +08:00
ouyangxiangzhen
9848e5ecec sched: Simplify the timer expiration.
This commit simplified the timer expiration.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-22 21:17:13 +08:00
wangchen
6cf4c95517 tcp_input: Add condition to check sndseq and ackseq equality
When triggering TCP retransmission through a timer, conn->unacked_q will save more packets, which may result in sndseq being equal to ackseq. Previous implementations may cause conn->nrtx to not be cleared, leading to an increase in conn->rto errors and a longer timer time

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-22 21:14:53 +08:00
wangchen
eae67ef9a5 tcp: Reset wb_nack to zero when it hits TCP fast retransmit threshold
The modification is to solve the problem that the opposite end cannot receive the retransmission message, and the protocol stack no longer sends retransmission messages

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-22 21:14:53 +08:00
yezhonghui
8a91155a0a power/battery: support get battery cycle count
add ioctl cmd

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-22 09:15:56 -03:00
yezhonghui
2b1c108819 power/battery: set interval to reduce report via ioctl
set time interval to control report frequency

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-22 09:15:56 -03:00
yezhonghui
6df4c7c009 power/battery: add charge full event mask
new add a macro for charge full

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-22 09:15:56 -03:00
yezhonghui
db7f292709 power/battery: fake gauge support for rpmsg communication
realize a fake gauge to support powermanger

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-22 09:15:56 -03:00
yezhonghui
dba108ae5c power/battery: battery drivers props use unification unit
battery drivers used unification unit

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-22 09:15:56 -03:00
yezhonghui
443e0cf0db power/battery: gauge upper driver modify b16_t and b8_t to int
upper and lower drivers use int data type

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-22 09:15:56 -03:00
anjiahao
0e92053bd9 pynuttx:remove pthread_tcb_s cast
Just remove cast

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 17:55:45 +08:00
anjiahao
530a7aab0e arch:remove struct tcb_s cast
Just remove cast

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 17:55:45 +08:00
anjiahao
994c9d8929 sched:use tcb inside of pthread_tcb_s, remove all cast
Simplify the code and remove different tcb

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 17:55:45 +08:00
anjiahao
0a2b01950c sched:use tcb_s inside of task_tcb_s , remove all cast
Simplify the code and remove different tcb

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 17:55:45 +08:00
raiden00pl
cd8ba3377c include/nuttx/atomic.h: fix C++ definition conflicts
when C++ lib has an atomic implementation, we shouldn't include NuttX defined macros to avoid conflicts

Fix errors like:

build/include/libcxx/__atomic/atomic.h:445:1: error: expected identifier before numeric constant
  445 | atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
      | ^~~~~~~~~~~~~~~~

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-22 15:27:39 +08:00
anjiahao
667171fbd8 lib/backtrace:need init lock before use
Locks need to be initialized when they are declared.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 15:23:04 +08:00
anjiahao
ee052a4570 mempool:fix bug, Misjudged the condition of interrupt memory release
We don't need to subtract the block size; we only need to determine if it's within the interrupt memory range.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 15:14:26 +08:00
Alan Carvalho de Assis
29ee50aba8 doc/xtensa/esp32: Update documentation to include sx127x
This commit includes documentation to the sx127x board profile.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-22 10:22:36 +08:00
Alan Carvalho de Assis
e20d4912ff boards/esp32/heltec_wifi_lora32: Add support to SX1276
This commit adds support to SX1276 transceiver on Heltec WiFi LoRa32
board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-22 10:22:36 +08:00
simbit18
e5a0c3e7d7 arch/arm: Aligned Cmake with Make
- use chip specific vectors to allow smpcall update regs apache#14363

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-21 14:13:52 -05:00
raiden00pl
d14a5c8b30 boards/leds: remove dependency on leds example for some boards
Userled register path shouldn't depend on LED example.
This dependency is broken, kernel code should not depend on apps code.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-21 14:13:39 -05:00
Alan Carvalho de Assis
a6af0e94f9 Doc/xtensa/esp32: Fix QEMU documentation to use new config
QEMU needs CONFIG_ESP32_IGNORE_CHIP_REVISION_CHECK enabled to work

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-21 15:18:08 -03:00
Alan Carvalho de Assis
cb4b64b6e8 Doc/xtensa/esp32: Add documentation to Heltec WiFi LoRa32
This commit adds documentation to Heltec WiFi LoRa32

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-21 15:18:08 -03:00
Alan Carvalho de Assis
30a7420349 boards/esp32: Add initial support to heltec_wifi_lora32
This commit adds basic/initial support to Heltec WiFi LoRa32 board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-21 15:18:08 -03:00
Alan Carvalho de Assis
3bf8b55d64 arch/xtensa/esp32: Add CONFIG_ESP32_IGNORE_CHIP_REVISION_CHECK
This commit add the option that was missing in the esp32_start.c
to ignore the chip version for boards with old ESP32 silicon tape out.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-21 15:18:08 -03:00
raiden00pl
a3ada5ce30 boards/nucleo-c0xxx: fix leds handling
Fix LED handling for nucleo-c092rc and nucleo-c071rb.
These boards have two LEDs but one is activated with HIGH the other is activated
with LOW.

Also fix userled registration.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-21 14:08:38 +01:00
wangzhi16
31e562b10f Revert "sched/group: move task group into task_tcb_s to improve performance"
This reverts commit 29e50ffa73.

reason:
Placing the main thread and the gourd in the same memory block, and allocating and freeing memory simultaneously, presents the following two problems:

When the main thread creates a child thread and performs a detach operation, there is a possibility that the main thread may have exited, but the main thread's TCB (Transaction Control Block) may not have been released.

This could potentially cause the main thread's TCB to be double-freed. The core contradiction in this problem lies in binding the main thread's TCB (Trust Container Registry) and the group together. When releasing the main thread's TCB, an additional check is needed to ensure the main thread was the last to leave the group. If this check and the free operation are atomically guaranteed, the logic is sound, and double freeing won't occur. However, this atomicity cannot be completely guaranteed. If other free operations cause a block, problems still arise.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-12-21 08:53:46 -03:00
yezhonghui
1fe3de379a sim/spi: delete invaild cs change with ioctl transfer
delete invaild cs

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-21 06:37:39 +08:00
yezhonghui
b64b63b748 driver/bmi160: bmi160 support exchange mode rw
sim-spi support exchange mode

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-21 06:37:39 +08:00
yezhonghui
96db23e7df sim/spi: ioctl stytemcall use host_uninterruptible
syscall use macro host_uninterruptible

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-21 06:37:39 +08:00
Huang Qi
beb0a47568 boards/esp32s3/lckfb-szpi: Add QMI8658 6-axis IMU sensor support
Add support for the QMI8658 6-axis IMU sensor (accelerometer + gyroscope)
on the lckfb-szpi-esp32s3 board.

Changes:
- New esp32s3_qmi8658.c driver initializes sensor on I2C0 at address 0x6A
- Registers uORB devices: /dev/uorb/sensor_accel0 and /dev/uorb/sensor_gyro0
- Adds esp32s3_qmi8658_initialize() function declaration to header
- Integrates with board bringup when CONFIG_SENSORS_QMI8658=y

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-12-21 00:58:58 +08:00
anjiahao
92f26a98dd mm:use Kconfig to control sequence number to save memory
One memory block can save sizeof(size_t) size.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-20 09:47:22 -03:00
chenzihan1
c21405d2d5 drivers/sensors/goldfish: goldfish support more sensors
add sensors type to align android

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-12-20 09:31:23 -03:00