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

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; }
}

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

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 */
}

View File

@ -346,12 +346,9 @@ PUBLIC int do_getprocnr()
if (((rmp->mp_flags & (IN_USE | ZOMBIE)) == IN_USE) &&
strncmp(rmp->mp_name, search_key, key_len)==0) {
mp->mp_reply.endpt = rmp->mp_endpoint;
printf("PM: name %s result: %d\n", search_key,
rmp->mp_endpoint);
return(OK);
}
}
printf("PM: name %s result: ESRCH\n", search_key);
return(ESRCH);
} else { /* return own/parent process number */
#if 0

View File

@ -3,6 +3,7 @@
set -e
XBIN=usr/xbin
BRANCHNAME=src.beng-working.r4327
SRC=src
# size of /tmp during build
@ -136,7 +137,7 @@ do
done
if [ ! "$USRMB" ]
then USRMB=550
then USRMB=120
fi
echo $USRMB MB
@ -232,10 +233,10 @@ chmod -R u+w $RELEASEDIR/usr/lib
if [ "$COPY" -ne 1 ]
then
echo " * Doing new svn export"
REPO=https://gforge.cs.vu.nl/svn/minix/trunk/$SRC
REPO=https://gforge.cs.vu.nl/svn/minix/branches/$BRANCHNAME
REVISION="`svn info $USERNAME $SVNREV $REPO | grep '^Revision: ' | awk '{ print $2 }'`"
echo "Doing export of revision $REVISION from $REPO."
( cd $RELEASEDIR/usr && svn $USERNAME export -r$REVISION $REPO )
( cd $RELEASEDIR/usr && svn $USERNAME export -r$REVISION $REPO && mv $BRANCHNAME $SRC )
REVTAG=r$REVISION
echo "