From 14c7af39fb81f679d7d666951af9816d0e4e5903 Mon Sep 17 00:00:00 2001 From: pmf Date: Mon, 15 Oct 2007 18:54:36 +0000 Subject: [PATCH] resourceview: handle properly schedule()'s within traps git-svn-id: http://ltt.polymtl.ca/svn@2696 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/state.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index b15c6168..6bd7912a 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -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; } -- 2.34.1