resourceview: handle properly schedule()'s within traps
authorpmf <pmf@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 15 Oct 2007 18:54:36 +0000 (18:54 +0000)
committerpmf <pmf@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 15 Oct 2007 18:54:36 +0000 (18:54 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2696 04897980-b3bd-0310-b5e0-8ef037075253

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.026505 seconds and 4 git commands to generate.