resourceview: handle properly schedule()'s within traps
[lttv.git] / ltt / branches / poly / lttv / lttv / state.c
index b15c616847d77276471919f5f1808a1eab055ac7..6bd7912a1b319c39575c95668df78c85d1a03fb2 100644 (file)
@@ -2565,9 +2565,18 @@ static gboolean schedchange(void *hook_data, void *call_data)
 
   /* update cpu status */
   if(pid_in == 0)
+    /* going to idle task */
     cpu_set_base_mode(s->cpu_state, LTTV_CPU_IDLE);
-  else
+  else {
+    /* scheduling a real task.
+     * we must be careful here:
+     * if we just schedule()'ed to a process that is
+     * in a trap, we must put the cpu in trap mode
+     */
     cpu_set_base_mode(s->cpu_state, LTTV_CPU_BUSY);
+    if(process->state->t == LTTV_STATE_TRAP)
+      cpu_push_mode(s->cpu_state, LTTV_CPU_TRAP);
+  }
 
   return FALSE;
 }
This page took 0.024586 seconds and 4 git commands to generate.