Commit Graph

1000 Commits

Author SHA1 Message Date
ligr
9da813b151 [libcpu][risc-v]add code for handling exception scenarios in _unmap_area.
Some checks failed
AutoTestCI / components/cpp11 (push) Waiting to run
AutoTestCI / kernel/atomic (push) Waiting to run
AutoTestCI / kernel/atomic/riscv64 (push) Waiting to run
AutoTestCI / kernel/atomic_c11 (push) Waiting to run
AutoTestCI / kernel/atomic_c11/riscv64 (push) Waiting to run
AutoTestCI / kernel/device (push) Waiting to run
AutoTestCI / kernel/ipc (push) Waiting to run
AutoTestCI / kernel/irq (push) Waiting to run
AutoTestCI / kernel/mem (push) Waiting to run
AutoTestCI / kernel/mem/riscv64 (push) Waiting to run
AutoTestCI / kernel/thread (push) Waiting to run
AutoTestCI / kernel/timer (push) Waiting to run
AutoTestCI / rtsmart/aarch64 (push) Waiting to run
AutoTestCI / rtsmart/arm (push) Waiting to run
AutoTestCI / rtsmart/riscv64 (push) Waiting to run
AutoTestCI / components/utest (push) Waiting to run
RT-Thread BSP Static Build Check / ESP32C3 (push) Waiting to run
RT-Thread BSP Static Build Check / Infineon_TI_microchip (push) Waiting to run
RT-Thread BSP Static Build Check / RT-Thread Online Packages (STM32F407 RT-Spark) (push) Waiting to run
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (Raspberry Pico) (push) Waiting to run
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (STM32F412 Nucleo) (push) Waiting to run
RT-Thread BSP Static Build Check / aarch64 (push) Waiting to run
RT-Thread BSP Static Build Check / at32_hc32_ht32 (push) Waiting to run
RT-Thread BSP Static Build Check / gd32_n32_apm32 (push) Waiting to run
RT-Thread BSP Static Build Check / hpmicro (push) Waiting to run
RT-Thread BSP Static Build Check / i386-unknown (push) Waiting to run
RT-Thread BSP Static Build Check / llvm-arm (push) Waiting to run
RT-Thread BSP Static Build Check / mips (push) Waiting to run
RT-Thread BSP Static Build Check / nordic(yml) (push) Waiting to run
RT-Thread BSP Static Build Check / nuvoton (push) Waiting to run
RT-Thread BSP Static Build Check / nxp_renesas (push) Waiting to run
RT-Thread BSP Static Build Check / others_ft32_mm32_acm32 (push) Waiting to run
RT-Thread BSP Static Build Check / riscv-none (push) Waiting to run
RT-Thread BSP Static Build Check / riscv64-unknown (push) Waiting to run
RT-Thread BSP Static Build Check / simulator (push) Waiting to run
RT-Thread BSP Static Build Check / stm32_f2_f4 (push) Waiting to run
RT-Thread BSP Static Build Check / stm32_f7_g0_h7_mp15_u5_h5_wb5 (push) Waiting to run
RT-Thread BSP Static Build Check / stm32f0_f1 (push) Waiting to run
RT-Thread BSP Static Build Check / stm32l4 (push) Waiting to run
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Waiting to run
pkgs_test / change (push) Has been skipped
utest_auto_run / A9-rtsmart :default.cfg (push) Waiting to run
utest_auto_run / RISCV-rtsmart :default.cfg (push) Waiting to run
utest_auto_run / AARCH64 :default.cfg (push) Waiting to run
utest_auto_run / A9 :default.cfg (push) Waiting to run
utest_auto_run / A9-smp :default.cfg (push) Waiting to run
utest_auto_run / RISCV :default.cfg (push) Waiting to run
ToolsCI / Tools (push) Has been cancelled
doc_doxygen / doxygen_doc generate (push) Has been cancelled
doc_doxygen / deploy (push) Has been cancelled
2025-03-17 17:40:55 +08:00
ligr
b04aacbd94 [libcpu][risc-v]remove unused parameter 'size' for func _unmap_area.
Signed-off-by: ligr <liguorui1213@163.com>
2025-03-17 17:40:55 +08:00
latercomer
40360efe1d 解决rt_interrupt_from_thread和rt_interrupt_to_thread指针赋值错误
Signed-off-by: latercomer <latercomer@qq.com>
2025-03-17 16:45:59 +08:00
latercomer
b8e9f7e0f5 修复rt_hw_context_switch_to和rt_hw_context_switch的形参
Signed-off-by: latercomer <latercomer@qq.com>
2025-03-17 16:45:59 +08:00
latercomer
130b5ba653 解决rt_hw_context_switch_interrupt形参定义不一致
Signed-off-by: latercomer <latercomer@qq.com>
2025-03-17 16:45:59 +08:00
latercomer
9e13f67018 删除libcpu/sim/simulator中msvc编译器多余代码,为后续支持mingw64做准备
Signed-off-by: latercomer <latercomer@qq.com>
2025-03-17 16:45:59 +08:00
Guorui Li
5a09694f05 [libcpu][risc-v]add comments for rt_hw_mem_setup_early. (#10102) 2025-03-12 09:40:46 +08:00
Kai
f7d542155f [libcpu][riscv] add a doc for wch saving the irq stack as stack-512 (#10063) 2025-03-03 23:13:11 +08:00
Guorui Li
7f05592592 [libcpu][risc-v]add comments for rv64 sv39 mmu APIs. (#10053)
Some checks are pending
AutoTestCI / components/cpp11 (push) Waiting to run
AutoTestCI / kernel/atomic (push) Waiting to run
AutoTestCI / kernel/atomic/riscv64 (push) Waiting to run
AutoTestCI / kernel/atomic_c11 (push) Waiting to run
AutoTestCI / kernel/atomic_c11/riscv64 (push) Waiting to run
AutoTestCI / kernel/device (push) Waiting to run
AutoTestCI / kernel/ipc (push) Waiting to run
AutoTestCI / kernel/irq (push) Waiting to run
AutoTestCI / kernel/mem (push) Waiting to run
AutoTestCI / kernel/mem/riscv64 (push) Waiting to run
AutoTestCI / kernel/thread (push) Waiting to run
AutoTestCI / kernel/timer (push) Waiting to run
AutoTestCI / rtsmart/aarch64 (push) Waiting to run
AutoTestCI / rtsmart/arm (push) Waiting to run
AutoTestCI / rtsmart/riscv64 (push) Waiting to run
AutoTestCI / components/utest (push) Waiting to run
RT-Thread BSP Static Build Check / ESP32C3 (push) Waiting to run
RT-Thread BSP Static Build Check / Infineon_TI_microchip (push) Waiting to run
RT-Thread BSP Static Build Check / RT-Thread Online Packages (STM32F407 RT-Spark) (push) Waiting to run
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (Raspberry Pico) (push) Waiting to run
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (STM32F412 Nucleo) (push) Waiting to run
RT-Thread BSP Static Build Check / aarch64 (push) Waiting to run
RT-Thread BSP Static Build Check / gd32_n32_apm32 (push) Waiting to run
RT-Thread BSP Static Build Check / hpmicro (push) Waiting to run
RT-Thread BSP Static Build Check / i386-unknown (push) Waiting to run
RT-Thread BSP Static Build Check / llvm-arm (push) Waiting to run
RT-Thread BSP Static Build Check / mips (push) Waiting to run
RT-Thread BSP Static Build Check / nordic(yml) (push) Waiting to run
RT-Thread BSP Static Build Check / nuvoton (push) Waiting to run
RT-Thread BSP Static Build Check / nxp_renesas (push) Waiting to run
RT-Thread BSP Static Build Check / others_at32_hc32_ht32 (push) Waiting to run
RT-Thread BSP Static Build Check / riscv-none (push) Waiting to run
RT-Thread BSP Static Build Check / riscv64-unknown (push) Waiting to run
RT-Thread BSP Static Build Check / simulator (push) Waiting to run
RT-Thread BSP Static Build Check / stm32_f2_f4 (push) Waiting to run
RT-Thread BSP Static Build Check / stm32_f7_g0_h7_mp15_u5_h5_wb5 (push) Waiting to run
RT-Thread BSP Static Build Check / stm32f0_f1 (push) Waiting to run
RT-Thread BSP Static Build Check / stm32l4 (push) Waiting to run
BSP compilation with more drivers / BSP Compilation with More Drivers (push) Waiting to run
pkgs_test / change (push) Has been skipped
2025-03-02 00:03:13 +08:00
Guorui Li
8adae0725d [bugfix][risc-v]fix the PPN length error in GET_PPN(pte). (#10020)
Some checks failed
pkgs_test / change (push) Has been skipped
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / ESP32C3 (push) Has been cancelled
RT-Thread BSP Static Build Check / Infineon_TI_microchip (push) Has been cancelled
RT-Thread BSP Static Build Check / RT-Thread Online Packages (STM32F407 RT-Spark) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (Raspberry Pico) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (STM32F412 Nucleo) (push) Has been cancelled
RT-Thread BSP Static Build Check / aarch64 (push) Has been cancelled
RT-Thread BSP Static Build Check / gd32_n32_apm32 (push) Has been cancelled
RT-Thread BSP Static Build Check / hpmicro (push) Has been cancelled
RT-Thread BSP Static Build Check / i386-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / llvm-arm (push) Has been cancelled
RT-Thread BSP Static Build Check / mips (push) Has been cancelled
RT-Thread BSP Static Build Check / nordic(yml) (push) Has been cancelled
RT-Thread BSP Static Build Check / nuvoton (push) Has been cancelled
RT-Thread BSP Static Build Check / nxp_renesas (push) Has been cancelled
RT-Thread BSP Static Build Check / others_at32_hc32_ht32 (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv-none (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv64-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / simulator (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f2_f4 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f7_g0_h7_mp15_u5_h5_wb5 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32f0_f1 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32l4 (push) Has been cancelled
BSP compilation with more drivers / BSP Compilation with More Drivers (push) Has been cancelled
2025-02-28 08:23:46 +08:00
Shell
9386411d13 feat: mm: added affinity pages allocator
This patch introduces a tagged pages allocator to address the existing problems
of page aliasing on specific platforms and the requirement of page coloring.
It implements an affinity-id aware page manager by separating the runtime page
list into two types: a normal single linked-list and a multi-dimensional affinity-list.

Changes:
- Introduced tagged pages allocator and managing algorithm for affinity pages list
- Modified components to support affinity-id list management
- Updated page allocation and freeing functions to handle tagged pages
- Added configuration options for page affinity block size and debugging
- Modified mmap and elf loading to respect affinity settings
- Enhanced page list management to support multi-dimensional affinity-list

Signed-off-by: Shell <smokewood@qq.com>
2025-02-25 11:26:30 +08:00
kenneth.liu
2be83d5cad libcpu: riscv: fixed ARCH_RISCV_VECTOR issue
description: Using the vector instruction set to trigger
an illegal instruction exception when ARCH_SISCV_VECTOR=y.

analysis: When initializing the thread stack,
the rt_cw_stack_init function did not enable VS for SSTATUS.

Solution: When ARCH_SISCV_VECTOR=y,
increment the initial value of sstatus by 0x600(SSTATUS_VS).

Signed-off-by: Liu Gui <kenneth.liu@sophgo.com>
2025-02-22 14:17:54 -05:00
GuEe-GUI
d41a0351db [AARCH64] Update kernel's boot link for ARM64
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
Chen Wang
c66374705a libcpu: riscv: rv64: fixed warnings
When building bsp/cvitek/c906_little, compiler reports:

```
.../rt-thread/libcpu/risc-v/rv64/trap.c:
In function 'handle_trap':
.../rt-thread/libcpu/risc-v/rv64/trap.c:106:13:
warning: implicit declaration of function 'rt_hw_tick_isr';
did you mean 'rt_hw_stack_init'? [-Wimplicit-function-declaration]
  106 |             rt_hw_tick_isr();
      |             ^~~~~~~~~~~~~~
      |             rt_hw_stack_init
.../rt-thread/libcpu/risc-v/rv64/trap.c:110:13:
warning: implicit declaration of function 'rt_hw_irq_isr';
did you mean 'rt_hw_soft_irq_isr'? [-Wimplicit-function-declaration]
  110 |             rt_hw_irq_isr();
      |             ^~~~~~~~~~~~~
      |             rt_hw_soft_irq_isr
```

rt_hw_tick_isr()/rt_hw_irq_isr() are implemented by bsp, but
libcpu/risc-v/rv64 doesn't declare them, so compiler warns.

There are three BSPs using 'rv64' (libcpu/risc-v/rv64):
- `bsp/cvitek/c906_little/rtconfig.py`
- `bsp/juicevm/rtconfig.py`
- `bsp/k210/rtconfig.py`

`handle_trap` in `libcpu/risc-v/rv64` is defined as weak.
BSP can use this function directly or define and overload
it by itself.
If bsp use this function directly, bsp need to pay
attention to the fact that three functions will be called
in this function:

- `rt_hw_soft_irq_isr`
- `rt_hw_tick_isr`
- `rt_hw_irq_isr`

In `libcpu/risc-v/rv64`, `rt_hw_soft_irq_isr` has a weak
definition, while the other two do not. This means that
if the bsp does not overload `handle_trap`, bsp must
define `rt_hw_tick_isr` and `rt_hw_irq_isr` itself.
This is also the practice of `bsp/cvitek/c906_little`.
There is also a similar bsp `bsp/k210`, and the form of
`bsp/juicevm` implements `handle_trap` by itself.

It seems that `rt_hw_tick_isr` and `rt_hw_irq_isr` are
not required to be implemented by all BSPs using
`libcpu/risc-v/rv64`. The premise for BSP to implement
them is that it does not overload `handle_trap`. So
declaring `rt_hw_tick_isr` and `rt_hw_irq_isr` with
extern in `libcpu/risc-v/rv64` is not proper.

In addition, the `rt_hw_tick_isr/rt_hw_irq_isr` are only
used by `libcpu/risc-v/rv64`, so it is not worth putting
the declaration in `./include/rthw.h`.

Sum up, the best solution is to add weak definition to
`rt_hw_tick_isr/rt_hw_irq_isr` as existing `rt_hw_soft_irq_isr`.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-29 20:28:38 -05:00
Chen Wang
2dfbae2853 libcpu: riscv: common: fixed build warnings
When building bsp/cvitek/c906_little, compiler warns:

```
.../rt-thread/libcpu/risc-v/common/trap_common.c:
In function 'rt_hw_interrupt_install':
.../rt-thread/libcpu/risc-v/common/trap_common.c:50:11:
warning: unused variable 'user_param' [-Wunused-variable]
   50 |     void *user_param = param;
      |           ^~~~~~~~~~
.../rt-thread/libcpu/risc-v/common/trap_common.c:
In function 'rt_rv32_system_irq_handler':
.../rt-thread/libcpu/risc-v/common/trap_common.c:77:25:
warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   77 |         s_stack_frame = (rt_hw_stack_frame_t *)mscratch;
      |                         ^
```

Fixed these warnings as per indication from gcc.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-29 20:28:38 -05:00
Chen Wang
123ed1be1b bsp: qemu-virt64-riscv: remove config RISCV_S_MODE
Some checks failed
ToolsCI / Tools (push) Has been cancelled
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / ESP32C3 (push) Has been cancelled
RT-Thread BSP Static Build Check / Infineon_TI_microchip (push) Has been cancelled
RT-Thread BSP Static Build Check / RT-Thread Online Packages (STM32F407 RT-Spark) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (Raspberry Pico) (push) Has been cancelled
RT-Thread BSP Static Build Check / RTduino/Arduino Libraries (STM32F412 Nucleo) (push) Has been cancelled
RT-Thread BSP Static Build Check / aarch64 (push) Has been cancelled
RT-Thread BSP Static Build Check / gd32_n32_apm32 (push) Has been cancelled
RT-Thread BSP Static Build Check / hpmicro (push) Has been cancelled
RT-Thread BSP Static Build Check / i386-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / llvm-arm (push) Has been cancelled
RT-Thread BSP Static Build Check / mips (push) Has been cancelled
RT-Thread BSP Static Build Check / nordic(yml) (push) Has been cancelled
RT-Thread BSP Static Build Check / nuvoton (push) Has been cancelled
RT-Thread BSP Static Build Check / nxp_renesas (push) Has been cancelled
RT-Thread BSP Static Build Check / others_at32_hc32_ht32 (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv-none (push) Has been cancelled
RT-Thread BSP Static Build Check / riscv64-unknown (push) Has been cancelled
RT-Thread BSP Static Build Check / simulator (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f2_f4 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32_f7_g0_h7_mp15_u5_h5_wb5 (push) Has been cancelled
RT-Thread BSP Static Build Check / stm32l4_f0_f1 (push) Has been cancelled
BSP compilation with more drivers / BSP Compilation with More Drivers (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
RISCV_S_MODE configuration only affects the code in
libcpu/risc-v/virt64, and the only bsp using this
libcpu is qemu-virt64-riscv.

Considering s-mode is the default mode RT-Thread
running on virt64 machine, it seems unnecessary to
make RISCV_S_MODE a Kconfig option.

Solution: Remove RISCV_S_MODE from Kconfig and define
it as a macro in the code in libcpu/risc-v/virt64.

Plus, due to this macro is only related to virt64, rename
RISCV_S_MODE to RISCV_VIRT64_S_MODE.

Update the .config/rtconfig.h in this patch.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-10 17:14:13 +08:00
Meco Man
97b9cc5000 fix: add \n for addr2line hint
Some checks failed
ToolsCI / Tools (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:cpp11/cpp11.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:components/cpp11]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/atomic.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:kernel/atomic]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/atomic.conf QEMU_ARCH:riscv64 QEMU_MACHINE:virt RTT_BSP:bsp/qemu-virt64-riscv RUN:yes SD_FILE:None UTEST:kernel/atomic/riscv64]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/atomic_c11.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:kernel/atomic_c11]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/atomic_c11.conf QEMU_ARCH:riscv64 QEMU_MACHINE:virt RTT_BSP:bsp/qemu-virt64-riscv RUN:yes SD_FILE:None UTEST:kernel/atomic_c11/riscv64]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/device.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:kernel/device]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/ipc.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:kernel/ipc]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/irq.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:kernel/irq]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/mem.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:kernel/mem]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/mem.conf QEMU_ARCH:riscv64 QEMU_MACHINE:virt RTT_BSP:bsp/qemu-virt64-riscv RUN:yes SD_FILE:None UTEST:kernel/mem/riscv64]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/thread.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:kernel/thread]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:kernel/timer.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:kernel/timer]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:rtsmart/base.conf QEMU_ARCH:aarch64 QEMU_MACHINE:virt RTT_BSP:bsp/qemu-virt64-aarch64 RUN:no SD_FILE:sd.bin UTEST:rtsmart/aarch64]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:rtsmart/base.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:no SD_FILE:sd.bin UTEST:rtsmart/arm]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:rtsmart/base.conf QEMU_ARCH:riscv64 QEMU_MACHINE:virt RTT_BSP:bsp/qemu-virt64-riscv RUN:yes SD_FILE:None UTEST:rtsmart/riscv64]) (push) Waiting to run
AutoTestCI / ${{ matrix.legs.UTEST }} (map[CONFIG_FILE:utest_self/self.conf QEMU_ARCH:arm QEMU_MACHINE:vexpress-a9 RTT_BSP:bsp/qemu-vexpress-a9 RUN:yes SD_FILE:sd.bin UTEST:components/utest]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:ESP32C3 RTT_TOOL_CHAIN:sourcery-riscv32-esp32 SUB_RTT_BSP:[ESP32_C3]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:Infineon_TI_microchip RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[Infineon/psoc6-cy8ckit-062S2-43012 Infineon/psoc6-cy8ckit-062-BLE Infineon/psoc6-cy8ckit-062s4 Infineon/psoc6-cy8ckit-062-WIFI-BT Infineon/psoc6-cy8c… (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:RT-Thread Online Packages (STM32F407 RT-Spark) RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[stm32/stm32f407-rt-spark]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:RTduino/Arduino Libraries (Raspberry Pico) RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[raspberry-pico]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:RTduino/Arduino Libraries (STM32F412 Nucleo) RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[stm32/stm32f412-st-nucleo]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:aarch64 RTT_TOOL_CHAIN:sourcery-aarch64 SUB_RTT_BSP:[qemu-virt64-aarch64 raspberry-pi/raspi3-64 raspberry-pi/raspi4-64 phytium/aarch64]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:gd32_n32_apm32 RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[gd32/arm/gd32103c-eval gd32/arm/gd32105c-eval gd32/arm/gd32105r-start gd32/arm/gd32107c-eval gd32/arm/gd32205r-start gd32/arm/gd32207i-eval gd32/arm/gd32303… (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:hpmicro RTT_TOOL_CHAIN:RISC-V-GCC-RV32 SUB_RTT_BSP:[hpmicro/hpm6750evkmini hpmicro/hpm6750evk hpmicro/hpm6750evk2 hpmicro/hpm6300evk hpmicro/hpm6200evk hpmicro/hpm5300evk hpmicro/hpm5301evklite hpmicro/hpm6800evk… (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:i386-unknown RTT_TOOL_CHAIN:sourcery-i386-unknown-elf SUB_RTT_BSP:[x86]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:llvm-arm RTT_TOOL_CHAIN:llvm-arm SUB_RTT_BSP:[stm32/stm32l475-atk-pandora]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:mips RTT_TOOL_CHAIN:sourcery-mips SUB_RTT_BSP:[loongson/ls1bdev loongson/ls2kdev loongson/ls1cdev]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:nordic(yml) RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[nrf5x/nrf51822 nrf5x/nrf52832 nrf5x/nrf52833 nrf5x/nrf52840 nrf5x/nrf5340]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:nuvoton RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[nuvoton/numaker-pfm-m487 nuvoton/numaker-hmi-ma35d1 nuvoton/numaker-iot-m487 nuvoton/numaker-m032ki nuvoton/numaker-iot-m467 nuvoton/numaker-m467hj nuvoton/nk-n9h3… (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:nxp_renesas RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[nxp/lpc/lpc55sxx/lpc55s69_nxp_evk nxp/lpc/lpc55sxx/lpc55s28_nxp_evk nxp/lpc/lpc55sxx/lpc55s06_nxp_evk nxp/lpc/lpc55sxx/lpc55s16_nxp_evk nxp/lpc/lpc55sxx/lpc55s… (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:others_at32_hc32_ht32 RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[qemu-vexpress-a9 airm2m/air32f103 acm32/acm32f0x0-nucleo CME_M7 apollo2 asm9260t allwinner_tina ft32/ft32f072xb-starter mini2440 at91/at91sam9g45 at9… (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:riscv-none RTT_TOOL_CHAIN:sourcery-riscv-none-embed SUB_RTT_BSP:[k210]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:riscv64-unknown RTT_TOOL_CHAIN:sourcery-riscv64-unknown-elf SUB_RTT_BSP:[bluetrum/ab32vg1-ab-prougen bouffalo_lab/bl60x bouffalo_lab/bl70x]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:simulator RTT_TOOL_CHAIN:gcc SUB_RTT_BSP:[simulator]]) (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:stm32_f2_f4 RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[stm32/stm32f207-st-nucleo stm32/stm32f302-st-nucleo stm32/stm32f334-st-nucleo stm32/stm32f401-st-nucleo stm32/stm32f401-weact-blackpill stm32/stm32f405-smdz-br… (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:stm32_f7_g0_h7_mp15_u5_h5_wb5 RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[stm32/stm32f746-st-disco stm32/stm32f746-st-nucleo stm32/stm32f767-atk-apollo stm32/stm32f767-fire-challenger-v1 stm32/stm32f767-st-nucleo st… (push) Waiting to run
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (map[RTT_BSP:stm32l4_f0_f1 RTT_TOOL_CHAIN:sourcery-arm SUB_RTT_BSP:[stm32/stm32l4r5-st-nucleo stm32/stm32l4r9-st-eval stm32/stm32l4r9-st-sensortile-box stm32/stm32l010-st-nucleo stm32/stm32l053-st-nucleo stm32/stm32l412-st-nu… (push) Waiting to run
BSP compilation with more drivers / BSP Compilation with More Drivers (push) Waiting to run
pkgs_test / change (push) Waiting to run
doc_doxygen / doxygen_doc generate (push) Has been cancelled
doc_doxygen / deploy (push) Has been cancelled
2025-01-08 17:54:46 -05:00
Shell
7ff75e21fa feat: arm64: mmu: auto-sensing of best paging stride
Improves the memory mapping process by dynamically selecting the optimal
paging stride (4K or 2M) based on virtual address alignment and mapping
size. This eliminates the need for upfront stride determination, enhancing
flexibility and maintainability in memory management.

Changes:
- Replaced fixed stride selection logic with a dynamic decision loop.
- Removed `npages` calculation and replaced with `remaining_sz` to track
  unprocessed memory size.
- Added assertions to ensure `size` is properly aligned to the smallest
  page size.
- Adjusted loop to dynamically determine and apply the appropriate stride
  (4K or 2M) for each mapping iteration.
- Updated virtual and physical address increments to use the dynamically
  selected stride.

Signed-off-by: Shell <smokewood@qq.com>
2024-12-13 23:38:32 -05:00
GuEe-GUI
78f318aa8f [FIXUP] __rt_clz loss in aarch64
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-12-13 10:39:20 +08:00
kurisaw
2c3ee65d7f rzn2l-rsk support studio 2024-12-04 10:11:04 +08:00
kurisaw
3f1a62cfe3 [libcpu][drivers] cortex-r52 abnormal takeover and software rtc naming change 2024-12-04 10:11:04 +08:00
heyuanjie87
03a9729eb8 [libcpu/riscv]解决smp下cpuport.h中的编译问题 (#9714) 2024-11-29 09:39:41 +08:00
heyuanjie87
d3820ed77e 给vector模块添加构建脚本 2024-11-27 18:04:59 +08:00
heyuanjie87
3268716c4f [libcpu][riscv]virt64使用通用vector支持代码 2024-11-27 18:04:59 +08:00
Shell
b7520e262b feat: Kconfig: moving the arm64 specified configs to sub-menu
Just for better readability.

Signed-off-by: Shell <smokewood@qq.com>
2024-11-24 13:44:34 -05:00
Shell
fe2b124345 feat: arm64 ASID support
Support for ARM64 ASID to enhance virtual memory management efficiency
by reducing the need for TLB flushes during address space switches.
These changes improve performance especially for multi-process systems.

Changes:
- Added `ARCH_USING_ASID` configuration in `libcpu/aarch64/Kconfig`.
- Defined ASID-related constants in `mmu.h`.
- Updated `TLBI_ARG` macro to include ASID manipulation.
- Implemented ASID allocation mechanism with spinlock synchronization.
- Enhanced TLB invalidation to support ASID-specific operations.
- Modified `rt_hw_aspace_switch` to use ASIDs when switching address spaces.
- Adjusted debug logging and function documentation to reflect ASID usage.
- Refactored AArch64 MMU and TLB handling for ASID integration.

Signed-off-by: Shell <smokewood@qq.com>
2024-11-24 13:44:34 -05:00
heyuanjie87
2a684126c0 [libcpu][riscv]纠正pv_offset的对齐检查 2024-11-21 19:23:11 -05:00
GuEe-GUI
5dda65c21b [DM/FIXUP] add cortex-m23's cpuport.h
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-11-20 16:11:10 +08:00
GuEe-GUI
1bef42c64c [DM/FIXUP] remove some redundant INIT_EXPORT
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-11-18 15:03:23 +08:00
zhujiale
44515624e2 [libcpu] fix No memory higher than 1 GB is mapped 2024-11-17 21:13:07 -05:00
zhujiale
96da7abd3e [libcpu] fix No memory higher than 1 GB is mapped 2024-11-17 21:13:07 -05:00
heyuanjie87
2b21b095f9 [libcpu]riscv使用call指令解决长跳转问题 2024-11-15 14:34:32 +08:00
kurisaw
2241f4676b [libcpu][component] fixed the r52 kernel gcc context switch assembly 2024-11-06 16:09:52 +08:00
Shell
a573ea06b7 🚚 renaming: move smp to smp_call 2024-11-03 10:08:45 +08:00
Shell
2f6d98bfcb feat: smp_call: added signaling call_req
This patch introduces `rt_smp_call_request` API to handle queued
requests across cores with user provided data buffer, which provides a
way to request IPI through a non-blocking pattern.

It also resolved several issues in the old implementation:
- Multiple requests from different cores can not be queued in the work
  object of the target core.
- Data racing on `rt_smp_work` of same core. If multiple requests came
  in turns, or if the call is used by the target cpu, while a new
  request is coming, the value will be overwrite.
- Memory vulnerability. The rt_smp_event is allocated on stack, though
  the caller may not wait until the call is done.
- API naming problem. Actually we don't provide a way to issue an IPI to
  ANY core in mask. What the API do is aligned to MANY pattern.
- FUNC_IPI registering to PIC.

Changes:
- Declared and configured the new `RT_SMP_CALL_IPI` to support
  functional IPIs for task requests across cores.
- Replaced the single `rt_smp_work` array with `call_req_cores` to
  manage per-core call requests safely.
- Added `_call_req_take` and `_call_req_release` functions for atomic
  handling of request lifetimes, preventing data race conditions.
- Replaced single event handling with a queue-based approach
  (`call_queue`) for efficient multi-request processing per core.
- Introduced `rt_smp_call_ipi_handler` to process queued requests,
  reducing IPI contention by only sending new requests when needed.
- Implemented `_smp_call_remote_request` to handle remote requests
  with specific flags, enabling more flexible core-to-core task
  signaling.
- Refined `rt_smp_call_req_init` to initialize and track requests
  with atomic usage flags, mitigating potential memory vulnerabilities.

Signed-off-by: Shell <smokewood@qq.com>
2024-11-03 10:08:45 +08:00
Shell
40cd8cce99 feat: Added rt_interrupt_context* family for nested interrupt handling
These changes introduce the rt_interrupt_context family, providing a
mechanism for managing nested interrupts. The context management
ensures proper storage and retrieval of interrupt states, improving
reliability in nested interrupt scenarios by enabling context tracking
across different interrupt levels. This enhancement is essential for
platforms where nested interrupt handling is crucial, such as in real-
time or multi-threaded applications.

Changes:
- Defined rt_interrupt_context structure with context and node fields
  in `rtdef.h` to support nested interrupts.
- Added rt_slist_pop function in `rtservice.h` for simplified node
  removal in singly linked lists.
- Declared rt_interrupt_context_push, rt_interrupt_context_pop, and
  rt_interrupt_context_get functions in `rtthread.h` to manage the
  interrupt/exception stack.
- Modified AArch64 CPU support in `cpuport.h` to include
  rt_hw_show_register for debugging registers.
- Refactored `_rt_hw_trap_irq` in `trap.c` for context-aware IRQ
  handling, with stack push/pop logic to handle nested contexts.
- Implemented interrupt context push, pop, and retrieval logic in
  `irq.c` to manage context at the CPU level.

Signed-off-by: Shell <smokewood@qq.com>
2024-11-03 10:08:45 +08:00
Kai
7bf8589fad [libcpu][cortex-m7] use hw atomic 2024-11-01 18:45:00 -04:00
Yuqiang Wang
b3d59050b0 [kernel] Specification interrupt nested level variable declaration type (#9568) 2024-10-23 17:08:29 -04:00
heyuanjie87
49b6614763 [libcpu]添加对riscv vector的支持 (#9531)
[libcpu]添加对riscv vector的支持
2024-10-16 14:10:09 +08:00
zhangjing0303
523b123995 [libcpu][risc-v] fix the bug when using ASID in the RV64 MMU
* (fix) mmu: satp value should be 64-bit
Corrected the SATP register to ensure it uses the correct 64-bit format as required by the system architecture.

* use __asm__ instead of asm for the GNU C compiler

Co-authored-by: Shell <smokewood@qq.com>

---------

Co-authored-by: Shell <smokewood@qq.com>
2024-10-11 00:10:46 -04:00
Shell
5796e0d646 feat: arm64: update thread self on sp-switch
This patch improves the atomicity of context switching by ensuring that
the stack pointer (sp) and thread self updates occur simultaneously.
This enhancement is crucial for maintaining thread safety and
preventing potential inconsistencies during context switches.

Changes:
- Modified `cpuport.h` to use `ARM64_THREAD_REG` for thread self access.
- Added an `update_tidr` macro in `context_gcc.S` to streamline thread ID
  updates.
- Adjusted `rt_hw_context_switch_to` and `rt_hw_context_switch` to call
  `update_tidr`, ensuring atomic updates during context switches.
- Cleaned up `scheduler_mp.c` by removing redundant thread self
  assignments.

Signed-off-by: Shell <smokewood@qq.com>
2024-10-11 00:09:01 -04:00
zhangjing0303
65234401f3 [libcpu][risc-v]remove the redundant "0x" from the printed information when cpu is in exception (#9516)
Remove redundant '0x' from printed output
2024-10-09 15:46:39 +08:00
zhangjing0303
bf8f7b04b5 [libcpu][risc-v]add README for RV64 2024-10-08 17:56:55 -04:00
zhujiale
8ce405f739 smp 2024-09-24 09:56:30 +08:00
zhujiale
244cf61af6 SMP 2024-09-24 09:56:30 +08:00
zhujiale
512dae84be smp_ipi 2024-09-24 09:56:30 +08:00
heyuanjie87
8a53e6d639 删除多余空格 2024-09-23 12:57:53 +08:00
heyuanjie87
af5ca55736 [libcpu]rv添加c908 cpu 2024-09-23 12:57:53 +08:00
Shell
9a27de92ae feat: smart: user space context optimization
This patch optimizes the user-space context handling in the ARM64
architecture, specifically improving how the context is saved and
restored during system calls and interrupts. The changes make the
code more efficient and easier to maintain, while ensuring proper
preservation of user context during system transitions.

Changes:
- Introduced a parameter for context saving to improve flexibility.
- Replaced hardcoded stack pointer operations with frame-relative
  references for better readability and code reuse.
- Simplified context restoration, removing redundant operations like
  loading/storing floating-point registers.

Signed-off-by: Shell <smokewood@qq.com>
2024-09-19 23:02:39 -04:00
heyuanjie87
29c0357ff8 [libcpu]优化rv构建脚本中选择vendor目录的判断条件 2024-09-18 22:00:35 -04:00