Skip to content

Commit b8e9f7e

Browse files
ComerLaterRbb666
authored andcommitted
修复rt_hw_context_switch_to和rt_hw_context_switch的形参
Signed-off-by: latercomer <[email protected]>
1 parent e91131b commit b8e9f7e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

libcpu/sim/win32/cpu_port.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -267,20 +267,19 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to, rt_thread_t
267267

268268

269269

270-
void rt_hw_context_switch(rt_uint32_t from,
271-
rt_uint32_t to)
270+
void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to)
272271
{
273272
if(rt_thread_switch_interrupt_flag != 1)
274273
{
275274
rt_thread_switch_interrupt_flag = 1;
276275

277276
// set rt_interrupt_from_thread
278-
rt_interrupt_from_thread = *((rt_uint32_t *)(from));
277+
rt_interrupt_from_thread = from;
279278

280279
}
281280

282281
// set rt_interrupt_to_thread
283-
rt_interrupt_to_thread = *((rt_uint32_t *)(to));
282+
rt_interrupt_to_thread = to;
284283

285284
//trigger YIELD exception(cause contex switch)
286285
TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD);
@@ -310,10 +309,10 @@ void rt_hw_context_switch(rt_uint32_t from,
310309
* Note(s) : this function is used to perform the first thread switch
311310
*********************************************************************************************************
312311
*/
313-
void rt_hw_context_switch_to(rt_uint32_t to)
312+
void rt_hw_context_switch_to(rt_ubase_t to)
314313
{
315314
//set to thread
316-
rt_interrupt_to_thread = *((rt_uint32_t *)(to));
315+
rt_interrupt_to_thread = to;
317316

318317
//clear from thread
319318
rt_interrupt_from_thread = 0;

0 commit comments

Comments
 (0)