summaryrefslogtreecommitdiff
path: root/libcpu
diff options
context:
space:
mode:
authorlatercomer <[email protected]>2025-03-16 23:11:17 +0800
committerRbb666 <[email protected]>2025-03-17 16:45:59 +0800
commit40360efe1dfc3d3cc1e58496361f89c88cfc8941 (patch)
treec3a8502cc7f57413b56d60b5f9e5a8e8c8ce316d /libcpu
parentb8e9f7e0f59115b78caa2a9ca5b106ec7114d5b0 (diff)
解决rt_interrupt_from_thread和rt_interrupt_to_thread指针赋值错误
Signed-off-by: latercomer <[email protected]>
Diffstat (limited to 'libcpu')
-rw-r--r--libcpu/sim/win32/cpu_port.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libcpu/sim/win32/cpu_port.c b/libcpu/sim/win32/cpu_port.c
index 1ac9fc0379..ad5891c91f 100644
--- a/libcpu/sim/win32/cpu_port.c
+++ b/libcpu/sim/win32/cpu_port.c
@@ -256,10 +256,10 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to, rt_thread_t
rt_thread_switch_interrupt_flag = 1;
// set rt_interrupt_from_thread
- rt_interrupt_from_thread = from;
+ rt_interrupt_from_thread = *((rt_ubase_t *)(from));
}
- rt_interrupt_to_thread = to;
+ rt_interrupt_to_thread = *((rt_ubase_t *)(to));
//trigger YIELD exception(cause context switch)
TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD);
@@ -274,12 +274,12 @@ void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to)
rt_thread_switch_interrupt_flag = 1;
// set rt_interrupt_from_thread
- rt_interrupt_from_thread = from;
+ rt_interrupt_from_thread = *((rt_ubase_t *)(from));
}
// set rt_interrupt_to_thread
- rt_interrupt_to_thread = to;
+ rt_interrupt_to_thread = *((rt_ubase_t *)(to));
//trigger YIELD exception(cause contex switch)
TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD);
@@ -312,7 +312,7 @@ void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to)
void rt_hw_context_switch_to(rt_ubase_t to)
{
//set to thread
- rt_interrupt_to_thread = to;
+ rt_interrupt_to_thread = *((rt_ubase_t *)(to));
//clear from thread
rt_interrupt_from_thread = 0;