@@ -97,8 +97,9 @@ static MMRESULT OSTick_TimerID;
9797/*
9898 * flag in interrupt handling
9999 */
100- rt_uint32_t rt_interrupt_from_thread , rt_interrupt_to_thread ;
101- rt_uint32_t rt_thread_switch_interrupt_flag ;
100+ volatile rt_ubase_t rt_interrupt_from_thread = 0 ;
101+ volatile rt_ubase_t rt_interrupt_to_thread = 0 ;
102+ volatile rt_uint32_t rt_thread_switch_interrupt_flag = 0 ;
102103
103104/*
104105*********************************************************************************************************
@@ -248,18 +249,17 @@ void rt_hw_interrupt_enable(rt_base_t level)
248249* Note(s) : none
249250*********************************************************************************************************
250251*/
251- void rt_hw_context_switch_interrupt (rt_uint32_t from ,
252- rt_uint32_t to )
252+ void rt_hw_context_switch_interrupt (rt_ubase_t from , rt_ubase_t to , rt_thread_t from_thread , rt_thread_t to_thread )
253253{
254254 if (rt_thread_switch_interrupt_flag != 1 )
255255 {
256256 rt_thread_switch_interrupt_flag = 1 ;
257257
258258 // set rt_interrupt_from_thread
259- rt_interrupt_from_thread = * (( rt_uint32_t * )( from )) ;
259+ rt_interrupt_from_thread = from ;
260260 }
261261
262- rt_interrupt_to_thread = * (( rt_uint32_t * )( to )) ;
262+ rt_interrupt_to_thread = to ;
263263
264264 //trigger YIELD exception(cause context switch)
265265 TriggerSimulateInterrupt (CPU_INTERRUPT_YIELD );
0 commit comments