diff --git a/CPU/CH32V10x/os_port_gnu.S b/CPU/CH32V10x/os_port_gnu.S index a773351..af4077f 100644 --- a/CPU/CH32V10x/os_port_gnu.S +++ b/CPU/CH32V10x/os_port_gnu.S @@ -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) */