Skip to content

Commit 40360ef

Browse files
ComerLaterRbb666
authored andcommitted
解决rt_interrupt_from_thread和rt_interrupt_to_thread指针赋值错误
Signed-off-by: latercomer <[email protected]>
1 parent b8e9f7e commit 40360ef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libcpu/sim/win32/cpu_port.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to, rt_thread_t
256256
rt_thread_switch_interrupt_flag = 1;
257257

258258
// set rt_interrupt_from_thread
259-
rt_interrupt_from_thread = from;
259+
rt_interrupt_from_thread = *((rt_ubase_t *)(from));
260260
}
261261

262-
rt_interrupt_to_thread = to;
262+
rt_interrupt_to_thread = *((rt_ubase_t *)(to));
263263

264264
//trigger YIELD exception(cause context switch)
265265
TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD);
@@ -274,12 +274,12 @@ void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to)
274274
rt_thread_switch_interrupt_flag = 1;
275275

276276
// set rt_interrupt_from_thread
277-
rt_interrupt_from_thread = from;
277+
rt_interrupt_from_thread = *((rt_ubase_t *)(from));
278278

279279
}
280280

281281
// set rt_interrupt_to_thread
282-
rt_interrupt_to_thread = to;
282+
rt_interrupt_to_thread = *((rt_ubase_t *)(to));
283283

284284
//trigger YIELD exception(cause contex switch)
285285
TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD);
@@ -312,7 +312,7 @@ void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to)
312312
void rt_hw_context_switch_to(rt_ubase_t to)
313313
{
314314
//set to thread
315-
rt_interrupt_to_thread = to;
315+
rt_interrupt_to_thread = *((rt_ubase_t *)(to));
316316

317317
//clear from thread
318318
rt_interrupt_from_thread = 0;

0 commit comments

Comments
 (0)