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

修正单核版本中thread tls设置没有切换的问题

shaojinchun 4 лет назад
Родитель
Сommit
0f7ade74d9
2 измененных файлов с 1 добавлено и 5 удалено
  1. 1 0
      components/lwp/lwp_user_mm.c
  2. 0 5
      src/cpu.c

+ 1 - 0
components/lwp/lwp_user_mm.c

@@ -73,6 +73,7 @@ void lwp_mmu_switch(struct rt_thread *thread)
 #endif
         switch_mmu(new_mmu_table);
     }
+    rt_cpu_set_thread_idr(thread->thread_idr);
 #ifdef RT_USING_GDBSERVER
     if (l && l->debug)
     {

+ 0 - 5
src/cpu.c

@@ -201,12 +201,7 @@ void rt_cpus_lock_status_restore(struct rt_thread *thread)
     struct rt_cpu* pcpu = rt_cpu_self();
 
 #ifdef RT_USING_USERSPACE
-    if (pcpu->current_thread)
-    {
-        pcpu->current_thread->thread_idr = rt_cpu_get_thread_idr();
-    }
     lwp_mmu_switch(thread);
-    rt_cpu_set_thread_idr(thread->thread_idr);
 #endif
     pcpu->current_thread = thread;
     if (!thread->cpus_lock_nest)