|
@@ -97,8 +97,9 @@ static MMRESULT OSTick_TimerID;
|
|
/*
|
|
/*
|
|
* flag in interrupt handling
|
|
* flag in interrupt handling
|
|
*/
|
|
*/
|
|
-rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread;
|
|
|
|
-rt_uint32_t rt_thread_switch_interrupt_flag;
|
|
|
|
|
|
+volatile rt_ubase_t rt_interrupt_from_thread = 0;
|
|
|
|
+volatile rt_ubase_t rt_interrupt_to_thread = 0;
|
|
|
|
+volatile rt_uint32_t rt_thread_switch_interrupt_flag = 0;
|
|
|
|
|
|
/*
|
|
/*
|
|
*********************************************************************************************************
|
|
*********************************************************************************************************
|
|
@@ -248,18 +249,17 @@ void rt_hw_interrupt_enable(rt_base_t level)
|
|
* Note(s) : none
|
|
* Note(s) : none
|
|
*********************************************************************************************************
|
|
*********************************************************************************************************
|
|
*/
|
|
*/
|
|
-void rt_hw_context_switch_interrupt(rt_uint32_t from,
|
|
|
|
- rt_uint32_t to)
|
|
|
|
|
|
+void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to, rt_thread_t from_thread, rt_thread_t to_thread)
|
|
{
|
|
{
|
|
if(rt_thread_switch_interrupt_flag != 1)
|
|
if(rt_thread_switch_interrupt_flag != 1)
|
|
{
|
|
{
|
|
rt_thread_switch_interrupt_flag = 1;
|
|
rt_thread_switch_interrupt_flag = 1;
|
|
|
|
|
|
// set rt_interrupt_from_thread
|
|
// set rt_interrupt_from_thread
|
|
- rt_interrupt_from_thread = *((rt_uint32_t *)(from));
|
|
|
|
|
|
+ rt_interrupt_from_thread = from;
|
|
}
|
|
}
|
|
|
|
|
|
- rt_interrupt_to_thread = *((rt_uint32_t *)(to));
|
|
|
|
|
|
+ rt_interrupt_to_thread = to;
|
|
|
|
|
|
//trigger YIELD exception(cause context switch)
|
|
//trigger YIELD exception(cause context switch)
|
|
TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD);
|
|
TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD);
|