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
#ifdef OS_CFG_CPU_CLZ_ASM_PRESENT
.section .text.cpu_clz,"ax",%progbits
.align 8
.func
.global cpu_clz
.section .text.cpu_clz,"ax",%progbits
.align 8
.func
.global cpu_clz
cpu_clz:
clz a0, a0
ret
.endfunc
#endif
.section .text.os_port_context_switch_to,"ax",%progbits
.align 2
.func
.global os_port_context_switch_to
.extern os_port_on_switch_success
.section .text.os_port_context_switch_to,"ax",%progbits
.align 2
.func
.global os_port_context_switch_to
.extern os_port_on_switch_success
os_port_context_switch_to:
li t0, 0x1800
csrw mstatus, t0 // 1.
@@ -151,13 +151,13 @@ os_port_context_switch_to:
.endfunc
.section .text.SW_Handler,"ax",%progbits
.align 2
.func
.global SW_Handler
.extern g_os_port_switch_from_sp
.extern g_os_port_switch_to_sp
.extern os_port_on_switch_success
.section .text.SW_Handler,"ax",%progbits
.align 2
.func
.global SW_Handler
.extern g_os_port_switch_from_sp
.extern g_os_port_switch_to_sp
.extern os_port_on_switch_success
SW_Handler:
csrci mstatus, 0x08 // MIE = 0
@@ -369,11 +369,11 @@ SW_Handler:
.section .text.SysTick_Handler,"ax",%progbits
.align 2
.global SysTick_Handler
.extern SysTick_Handler_C
.func
.section .text.SysTick_Handler,"ax",%progbits
.align 2
.global SysTick_Handler
.extern SysTick_Handler_C
.func
SysTick_Handler:
// csrci mstatus, 8 //
/* 1. 因为是硬件中断,先在当前栈上保存必要的临时寄存器(Caller-saved) */