From 21b3c925c2897984247005ffcd95e2b6861250d2 Mon Sep 17 00:00:00 2001 From: Chen Peng Date: Sat, 23 May 2026 00:59:24 +0800 Subject: [PATCH] =?UTF-8?q?RISC=E4=B8=AD=E5=85=B3=E4=B8=AD=E6=96=AD?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E7=94=A8=E5=8E=9F=E5=AD=90=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E5=A4=9A=E4=BB=BB=E5=8A=A1=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=80=A0=E6=88=90=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CPU/QingKeV3/os_port.c | 6 +++++- CPU/QingKeV3/qkv3.h | 2 -- Kernel/SingleCore/os_config.h.in | 2 ++ Kernel/SingleCore/os_timewheel.c | 6 ++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CPU/QingKeV3/os_port.c b/CPU/QingKeV3/os_port.c index 706fc10..7ee3bb5 100644 --- a/CPU/QingKeV3/os_port.c +++ b/CPU/QingKeV3/os_port.c @@ -5,6 +5,7 @@ #include "os_compiler.h" #include "os_systick.h" #include "os_sched.h" +#include "os_isr.h" #include "qkv3.h" /* ------------------------------------------------------------------------------------------------------------------ */ @@ -16,7 +17,8 @@ /* ------------------------------------------------------------------------------------------------------------------ */ /* */ -static uint32_t _SysTick_Config(os_tick_t ticks) +OS_STATIC_FORCE_INLINE +uint32_t _SysTick_Config(os_tick_t ticks) { QKV3_PFIC->CFGR=0xFA050003; /* 关闭硬件压栈和嵌套 */ /* @@ -187,6 +189,7 @@ void os_port_context_switch(void* from_sp, void* to_sp){ void SysTick_Handler(void) __attribute__((interrupt())); void SysTick_Handler(void){ + os_isr_enter(); QKV3_SysTick->CTLR=0; QKV3_SysTick->CNTL0=0;QKV3_SysTick->CNTL1=0;QKV3_SysTick->CNTL2=0;QKV3_SysTick->CNTL3=0; QKV3_SysTick->CNTH0=0;QKV3_SysTick->CNTH1=0;QKV3_SysTick->CNTH2=0;QKV3_SysTick->CNTH3=0; @@ -194,5 +197,6 @@ void SysTick_Handler(void){ // 调用系统心跳处理 os_systick_tick(); + os_isr_leave(); } diff --git a/CPU/QingKeV3/qkv3.h b/CPU/QingKeV3/qkv3.h index a676fcd..f27fe42 100644 --- a/CPU/QingKeV3/qkv3.h +++ b/CPU/QingKeV3/qkv3.h @@ -38,8 +38,6 @@ #define QKV3_SysTick ((QKV3_SysTick_Type *) 0xE000F000) - - /* ------------------------------------------------------------------------------------------------------------------ */ /* */ diff --git a/Kernel/SingleCore/os_config.h.in b/Kernel/SingleCore/os_config.h.in index 92d72d8..e6ac75b 100644 --- a/Kernel/SingleCore/os_config.h.in +++ b/Kernel/SingleCore/os_config.h.in @@ -4,6 +4,7 @@ /* ==================================================================================================== */ /* OPTIONS */ +#cmakedefine OS_ALIGN_SIZE @OS_ALIGN_SIZE@ #cmakedefine OS_CFG_CPU_INT_NBITS @OS_CFG_CPU_INT_NBITS@ #cmakedefine OS_CFG_TICKS_PER_SECOND @OS_CFG_TICKS_PER_SECOND@ #cmakedefine OS_CFG_SYSCALL_PRIORITY @OS_CFG_SYSCALL_PRIORITY@ @@ -17,6 +18,7 @@ #cmakedefine OS_CFG_DEVICE_MAX @OS_CFG_DEVICE_MAX@ + /* ==================================================================================================== */ /* DEFAULT */ diff --git a/Kernel/SingleCore/os_timewheel.c b/Kernel/SingleCore/os_timewheel.c index 73b51a7..f89938d 100644 --- a/Kernel/SingleCore/os_timewheel.c +++ b/Kernel/SingleCore/os_timewheel.c @@ -5,11 +5,17 @@ /* -------------------------------------------------------------------------------------------------------------- */ /* */ +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__R[TWR_SIZE]; +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__N0[TWN_SIZE]; +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__N1[TWN_SIZE]; +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__N2[TWN_SIZE]; +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__N3[TWN_SIZE]; + volatile os_tick_t os_timewheel__tick;