CH32V10X 适配

This commit is contained in:
2026-05-28 15:25:30 +08:00
parent e5a2334bb6
commit 071bc89ade
+21 -21
View File
@@ -22,21 +22,21 @@
//// CODE //// CODE
#ifdef OS_CFG_CPU_CLZ_ASM_PRESENT #ifdef OS_CFG_CPU_CLZ_ASM_PRESENT
.section .text.cpu_clz,"ax",%progbits .section .text.cpu_clz,"ax",%progbits
.align 8 .align 8
.func .func
.global cpu_clz .global cpu_clz
cpu_clz: cpu_clz:
clz a0, a0 clz a0, a0
ret ret
.endfunc .endfunc
#endif #endif
.section .text.os_port_context_switch_to,"ax",%progbits .section .text.os_port_context_switch_to,"ax",%progbits
.align 2 .align 2
.func .func
.global os_port_context_switch_to .global os_port_context_switch_to
.extern os_port_on_switch_success .extern os_port_on_switch_success
os_port_context_switch_to: os_port_context_switch_to:
li t0, 0x1800 li t0, 0x1800
csrw mstatus, t0 // 1. csrw mstatus, t0 // 1.
@@ -151,13 +151,13 @@ os_port_context_switch_to:
.endfunc .endfunc
.section .text.SW_Handler,"ax",%progbits .section .text.SW_Handler,"ax",%progbits
.align 2 .align 2
.func .func
.global SW_Handler .global SW_Handler
.extern g_os_port_switch_from_sp .extern g_os_port_switch_from_sp
.extern g_os_port_switch_to_sp .extern g_os_port_switch_to_sp
.extern os_port_on_switch_success .extern os_port_on_switch_success
SW_Handler: SW_Handler:
csrci mstatus, 0x08 // MIE = 0 csrci mstatus, 0x08 // MIE = 0
@@ -369,11 +369,11 @@ SW_Handler:
.section .text.SysTick_Handler,"ax",%progbits .section .text.SysTick_Handler,"ax",%progbits
.align 2 .align 2
.global SysTick_Handler .global SysTick_Handler
.extern SysTick_Handler_C .extern SysTick_Handler_C
.func .func
SysTick_Handler: SysTick_Handler:
// csrci mstatus, 8 // // csrci mstatus, 8 //
/* 1. 因为是硬件中断,先在当前栈上保存必要的临时寄存器(Caller-saved) */ /* 1. 因为是硬件中断,先在当前栈上保存必要的临时寄存器(Caller-saved) */