Просмотр исходного кода

解决rt_hw_context_switch_interrupt形参定义不一致

Signed-off-by: latercomer <latercomer@qq.com>
latercomer 1 месяц назад
Родитель
Сommit
130b5ba653
2 измененных файлов с 7 добавлено и 6 удалено
  1. 1 0
      bsp/simulator/template_vs2012.vcxproj
  2. 6 6
      libcpu/sim/win32/cpu_port.c

+ 1 - 0
bsp/simulator/template_vs2012.vcxproj

@@ -45,6 +45,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
       <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
       <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
       <LanguageStandard_C>stdc11</LanguageStandard_C>
       <LanguageStandard_C>stdc11</LanguageStandard_C>
+      <TreatSpecificWarningsAsErrors>4029</TreatSpecificWarningsAsErrors>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <AdditionalDependencies>winmm.lib;Packet.lib;wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalDependencies>winmm.lib;Packet.lib;wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>

+ 6 - 6
libcpu/sim/win32/cpu_port.c

@@ -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);