Commit Graph

57463 Commits

Author SHA1 Message Date
chenrun1 cf66a1d5ce hostfs_open:return errno from host
Summary:
  Returns the error code returned directly by the host to avoid conversion to EBADF

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-14 23:03:20 +08:00
wangmingrong1 450b47fbb0 gcov.py: Add copy skip path, prevent recursion
When the copy path is a subdirectory of the source path, the copy will occur recursively

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-14 23:02:16 +08:00
Huang Qi b1d97688b7 arch/risc-v: Remove riscv_mhartid
Summary:
This commit removes the riscv_mhartid function and replaces all its
usages with up_cpu_index. The functionality is consolidated into
up_cpu_index which provides a more consistent API for getting the
current CPU/hart ID across different execution modes (machine/supervisor).

Impact:
- Removes riscv_mhartid.S and its references from build systems
- Updates all arch-specific code to use up_cpu_index instead
- Adds more detailed documentation for up_cpu_index behavior
- Changes the implementation of up_cpu_index to use percpu scratch
register in supervisor mode

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-14 11:48:40 -03:00
Huang Qi 6e82ca3013 arch/risc-v: Decouple ARCH_RV_CPUID_MAP and up_cpu_index()
Summary:
- Separated CPU index functionality from CPU ID mapping configuration
- Moved CPU ID mapping functions to new riscv_cpuidmap.c file
- Made up_cpu_index() implementation dependent on ARCH_USE_S_MODE
- Updated build system to handle new file organization

Impact:
- Improves code organization by separating concerns between basic CPU index
functionality and advanced CPU ID mapping features
- Makes CPU index functionality available independently of CPU ID mapping
- Reduces conditional compilation complexity in header files
- Better aligns with RISC-V architecture modes (M-mode vs S-mode)

Testing:
GitHub CI and local testing

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-01-14 20:19:37 +08:00
YAMAMOTO Takashi 00010089b8 drivers/serial/serial.c: adapt to the iovec-based api
This would fix readv/writev issues mentioned in
https://github.com/apache/nuttx/pull/12674.
(only for this specific driver though. with this approach,
we basically have to fix every single drivers and
filesystems.)

Lightly tested on the serial console, using micropython REPL
on toywasm with esp32s3-devkit:toywasm, which used to be
suffered by the readv issue.
2025-01-14 20:18:21 +08:00
YAMAMOTO Takashi 30ad31e9d7 uio api tweaks
* 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.
2025-01-14 20:18:21 +08:00
YAMAMOTO Takashi 2749510413 Update a few comments after the recent readv/writev changes 2025-01-14 20:18:21 +08:00
anjiahao cbb5e8fee2 modlib:gen-elf.ld.in DATA section need add CONFIG_MM_PGSIZE
arch/risc-v/src/common/riscv_addrenv.c:418:

{
...
  database = resvbase + MM_PGALIGNUP(resvsize);
...
}

need use MM_PGALIGNUP(resvsize) inside of ARCH_DATA_RESERVE_SIZE
if not add MM_PGALIGNUP(resvsize), will mismatch address load .data
section

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-01-14 20:13:28 +08:00
Yanfeng Liu d385d9f7d2 arm/common: fix KERNEL build vfork
This fixes vfork test for kernel build, checked with qemu-armv7a:nsh
and qemu-armv7a:knsh

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-01-14 20:12:31 +08:00
chenrun1 b973bf3191 fs_procfs:Fix closedir should handle the release dir handle on a case-by-case basis
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-14 19:37:08 +08:00
YAMAMOTO Takashi b88aba5ddc esp32s2: apply wifi deadlock fix from esp32s3
cf. https://github.com/apache/nuttx/pull/15445
2025-01-14 19:29:28 +08:00
YAMAMOTO Takashi c954af0de1 esp32: apply wifi deadlock fix from esp32s3
cf. https://github.com/apache/nuttx/pull/15445
2025-01-14 19:29:28 +08:00
YAMAMOTO Takashi 7a54488dbb esp32c6: apply wifi deadlock fix from esp32s3
cf. https://github.com/apache/nuttx/pull/15445
2025-01-14 19:29:28 +08:00
YAMAMOTO Takashi 93dbdd4a62 esp32c3: apply wifi deadlock fix from esp32s3
cf. https://github.com/apache/nuttx/pull/15445
2025-01-14 19:29:28 +08:00
YAMAMOTO Takashi 847c1a6151 esp32c3-legacy: apply wifi deadlock fix from esp32s3
cf. https://github.com/apache/nuttx/pull/15445
2025-01-14 19:29:28 +08:00
chenrun1 a87c194b40 goldfish_memorymap:Resize VIRT_FLASH_PSECTION
Sumamry:
  Adjust VIRT_FLASH_PSECTION from 0x00000000-0x08000000 -> 0x00600000-0x08000000
  The above changes avoid the problem of directly restarting when the process accesses/executes at address 0x0 without causing assert

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-01-14 19:28:54 +08:00
chenzihan0416 2db0b69335 Update goldfish_sensor_uorb.c 2025-01-14 16:44:13 +08:00
chenzihan1 c41c726161 goldfish sensor add get_info interface
Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2025-01-14 16:44:13 +08:00
wangjianyu3 71fe717459 esp32s3-devkit/adb: Enable used size of heap and stack for command ps
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-01-14 14:52:18 +08:00
wangmingrong1 df7d062713 kasan/kconfig: Add config CONFIG_MM_KASAN_INSTRUMENT
Build Documentation / build-html (push) Has been cancelled
It will be used to distinguish between hardware KASan and software KASan. Hardware KASan does not need to use plug-in

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-14 14:01:48 +08:00
wangmingrong1 9b4cd4e0a4 kasan: Extract kasan's kconfig separately
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-14 14:01:48 +08:00
hujun5 299136bdc7 rptun_bmp: add remote_cpu to rptun_secure_init
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 13:34:35 +08:00
hujun5 1600a44d69 rptun_secure:change rptun_secure to rptun_bmp
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 13:34:35 +08:00
hujun5 9dad781d07 sched/wdog: use small lock to protect g_wdactivelist
reason:
We would like to replace the critical section with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 12:29:29 +08:00
hujun5 eb2608209a sched_note_wdog: add c_section
reason:
the external critical section protection has been removed.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 12:29:29 +08:00
hujun5 684ddc6ada irq: enter_critical_section_wo_note/leave_critical_section_wo_note
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 12:29:29 +08:00
jerryslhao f1b7d7d641 drivers/sensors/bmi088: add driver for Bosch BMI088 IMU
This adds a driver for the Bosch BMI088 IMU sensor.
The driver supports spi.

Signed-off-by: jerryslhao <jerryslhao@gmail.com>
2025-01-14 10:29:48 +08:00
chao an c94a99326e arch/arm: read STM32L4_GTIM_CNT_OFFSET should use same lock
Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-14 08:38:06 +08:00
chao an c6126bcdc4 arch/arm: fix regression by spinlock change
| commit c96b8cdfdd
| Author: hujun5 <hujun5@xiaomi.com>
| Date:   Mon Dec 23 16:59:20 2024 +0800
|
|     use small lock in following files:

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-14 08:38:06 +08:00
chao an 849081d348 drivers/note: fix typo falgs and align local name to irq_mask
Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-14 08:37:45 +08:00
chao an 3d3db4a375 arm/imx9: sched_unlock should called after spin_unlock()
fix deadlock if sched_unlock switch out to other task

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-14 08:36:53 +08:00
chao an b7003e55b9 Revert "kconfiglib/mark: It should use pip instead of apt install"
pip source is deprecated from ubuntu 24.04

This reverts commit 7c7a64c84c.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-13 19:12:25 -03:00
chao an 5dedc0119f sched/clock: remove unlock logic to avoid relock
get time spec before protect g_basetime

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-13 19:11:49 -03:00
chao an a9ec6e9b3a arch/arm64: fix typo spin_lock_irqsave -> spin_unlock_irqrestore
should be spin_unlock_irqrestore

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-01-14 01:11:44 +08:00
hujun5 daebf4c8b7 Revert "sched: misc: Remove sched_lock in _assert()"
reason:
This reverts commit d0820acbbb
assert will call syslog

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 00:52:10 +08:00
hujun5 bac838b888 armv7a: Amp mode support
reason:
In AMP mode, we can also use SGI as an inter-core interrupt,
and ensure that arm_gic0_initialize is called only once.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 00:50:59 +08:00
hujun5 699b23fa19 sched_processtimer: use atomic to protect g_timer_interval and g_timer_tick
reason:
We would like to replace the critical section with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-14 00:27:13 +08:00
wangmingrong1 22d8a50a7b defconfig: Delete the redundant Kasan configuration on CI
arm/qemu-v7a:
            1. Keep arm/smp configuration, use kasan in generic mode
arm64/qemu-v8a:
            1. Keep arm/citest configuration, use kasan in generic mode
            2. Keep arm/swtags configuration, use kasan in software tag mode
sim:
            1. Keep sim/ostest, use asan
	    2. Keep sim/ostest_oneholder, use kasan in generic mode

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-14 00:05:39 +08:00
Eren Terzioglu 2bc36544d9 esp32[c3]: Fix build errors when using mcuboot 2025-01-13 23:59:14 +08:00
wangmingrong1 0fda25fc96 arm64: assert support dump sctlr_el1 register
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-13 17:25:41 +08:00
liwenxiang1 2454c2b76d arch/x86_64:Resolve the issue of abnormal interrupt numbers triggered when KASAN is enabled
When assembly code calls a C function, it needs to save the context. After enabling KASAN, the inserted __asan_load8_noabort function uses the rsi register, causing the value of rsi in the interrupt handler to be modified, which results in an incorrect interrupt number.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2025-01-13 09:08:37 +01:00
Ian Douglas Scott 351db57e35 arch/arm/rp23xx: Set priority for svcall exception
Fixes https://github.com/apache/nuttx/issues/15503.

Signed-off-by: Ian Douglas Scott <ian@iandouglasscott.com>
2025-01-13 12:38:43 +08:00
hujun5 5f4a15b690 pthread: remove enter_critical_section in pthread_mutex
reason:
We would like to replace the critical section with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-12 22:30:35 +08:00
hujun5 19bca74c7c clock_adjtime: use small lock to protect g_adjtime_ppb g_adjtime_wdog
reason:
We would like to replace the critical section with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-12 22:07:15 +08:00
hujun5 a2d4d74af7 clock_timekeeping: remove enter_critical_section in sched/clock/clock_timekeeping.c
reason:
We would like to replace the critical section with a small lock.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-01-12 16:51:40 +08:00
wangmingrong1 2149d89336 macro/align: Use ALIGN_UP and ALIGN_DOWN uniformly
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-12 16:48:35 +08:00
Yanfeng Liu 71a4e86718 risc-v/Toolchain.defs: guard -r in LDELFFLAGS
This guards use of `-r` in LDELFFLAGS in risc-v common/Toolchain.defs so
that it is only used when BINFMT_ELF_RELOCATABLE is selected.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2025-01-12 16:47:54 +08:00
Leo Chung 63c8de5f03 sim: Fixes the linker 'noexecstack' warning
Signed-off-by: Leo Chung <gewalalb@gmail.com>
2025-01-12 16:17:52 +08:00
yaojiaqi 43797ea6cc drivers/timers/watchdog: add watchdog timer notifier chain
Add support for watchdog timer notifer chain so that users
can customize the callback function when the watchdog timer
times out which enabled by Auto-monitor

Signed-off-by: yaojiaqi <yaojiaqi@lixiang.com>
2025-01-12 11:15:42 +08:00
wangmingrong1 aa0aecbd80 mempool: addbacktrace should be before kasan_unpoison
If thread 1 is executing kasan_unpoison but a scheduling occurs and the block is trampled upon, the displayed backtracking may still be from the previously allocated backtracking

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-01-12 01:29:14 +08:00