From b8e9f7e0f59115b78caa2a9ca5b106ec7114d5b0 Mon Sep 17 00:00:00 2001 From: latercomer Date: Sun, 16 Mar 2025 21:05:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drt=5Fhw=5Fcontext=5Fswitch=5F?= =?UTF-8?q?to=E5=92=8Crt=5Fhw=5Fcontext=5Fswitch=E7=9A=84=E5=BD=A2?= =?UTF-8?q?=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: latercomer --- libcpu/sim/win32/cpu_port.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libcpu/sim/win32/cpu_port.c b/libcpu/sim/win32/cpu_port.c index 15d0218f03..1ac9fc0379 100644 --- a/libcpu/sim/win32/cpu_port.c +++ b/libcpu/sim/win32/cpu_port.c @@ -267,20 +267,19 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to, rt_thread_t -void rt_hw_context_switch(rt_uint32_t from, - rt_uint32_t to) +void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to) { if(rt_thread_switch_interrupt_flag != 1) { rt_thread_switch_interrupt_flag = 1; // set rt_interrupt_from_thread - rt_interrupt_from_thread = *((rt_uint32_t *)(from)); + rt_interrupt_from_thread = from; } // set rt_interrupt_to_thread - rt_interrupt_to_thread = *((rt_uint32_t *)(to)); + rt_interrupt_to_thread = to; //trigger YIELD exception(cause contex switch) TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD); @@ -310,10 +309,10 @@ void rt_hw_context_switch(rt_uint32_t from, * Note(s) : this function is used to perform the first thread switch ********************************************************************************************************* */ -void rt_hw_context_switch_to(rt_uint32_t to) +void rt_hw_context_switch_to(rt_ubase_t to) { //set to thread - rt_interrupt_to_thread = *((rt_uint32_t *)(to)); + rt_interrupt_to_thread = to; //clear from thread rt_interrupt_from_thread = 0;