cleanup, sanity checking

This commit is contained in:
Ben Gras
2009-06-08 06:08:11 +00:00
parent 782133423e
commit de1b5e0076
5 changed files with 17 additions and 7 deletions
+3 -1
View File
@@ -142,7 +142,6 @@ int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr,
NOREC_ENTER(linlincopy);
vmassert(vm_running);
vmassert(!catch_pagefaults);
vmassert(nfreepdes >= 3);
vmassert(ptproc);
@@ -219,8 +218,11 @@ PRIVATE void vm_set_cr3(struct proc *newptproc)
if(!intr_disabled()) { lock; u = 1; }
vm_cr3= newptproc->p_seg.p_cr3;
if(vm_cr3) {
vmassert(intr_disabled());
level0(set_cr3);
vmassert(intr_disabled());
ptproc = newptproc;
vmassert(intr_disabled());
}
if(u) { unlock; }
}
+1
View File
@@ -403,6 +403,7 @@ _restart:
! Restart the current process or the next process if it is set.
cli
call _schedcheck ! ask C function who we're running
mov esp, (_proc_ptr) ! will assume P_STACKBASE == 0
lldt P_LDT_SEL(esp) ! enable process' segment descriptors
+9
View File
@@ -99,6 +99,7 @@ message *m_ptr; /* pointer to request message */
/* Despite its name, this routine is not called on every clock tick. It
* is called on those clock ticks when a lot of work needs to be done.
*/
vmassert(!vm_running || (read_cr3() == ptproc->p_seg.p_cr3));
/* A process used up a full quantum. The interrupt handler stored this
* process in 'prev_ptr'. First make sure that the process is not on the
@@ -120,12 +121,17 @@ message *m_ptr; /* pointer to request message */
}
}
vmassert(!vm_running || (read_cr3() == ptproc->p_seg.p_cr3));
/* Check if a clock timer expired and run its watchdog function. */
if (next_timeout <= realtime) {
vmassert(!vm_running || (read_cr3() == ptproc->p_seg.p_cr3));
tmrs_exptimers(&clock_timers, realtime, NULL);
vmassert(!vm_running || (read_cr3() == ptproc->p_seg.p_cr3));
next_timeout = (clock_timers == NULL) ?
TMR_NEVER : clock_timers->tmr_exp_time;
vmassert(!vm_running || (read_cr3() == ptproc->p_seg.p_cr3));
}
vmassert(!vm_running || (read_cr3() == ptproc->p_seg.p_cr3));
return;
}
@@ -188,6 +194,8 @@ irq_hook_t *hook;
if(minix_panicing) return;
vmassert(!vm_running || (read_cr3() == ptproc->p_seg.p_cr3));
/* Get number of ticks and update realtime. */
ticks = lost_ticks + 1;
lost_ticks = 0;
@@ -223,6 +231,7 @@ irq_hook_t *hook;
if (do_serial_debug)
do_ser_debug();
vmassert(!vm_running || (read_cr3() == ptproc->p_seg.p_cr3));
return(1); /* reenable interrupts */
}