From 0e84a0ec6e7893dad13dff9a958c5bc987b79c82 Mon Sep 17 00:00:00 2001 From: rtm Date: Tue, 8 Aug 2006 19:58:06 +0000 Subject: fix race in holding() check in acquire() give cpu1 a TSS and gdt for when it enters scheduler() and a pseudo proc[] entry for each cpu cpu0 waits for each other cpu to start up read() for files --- proc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'proc.h') diff --git a/proc.h b/proc.h index a273141..c6f5be6 100644 --- a/proc.h +++ b/proc.h @@ -33,7 +33,8 @@ struct jmpbuf { int eip; }; -enum proc_state { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE }; +enum proc_state { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE, + IDLEPROC }; struct proc{ char *mem; // start of process's physical memory @@ -67,8 +68,8 @@ extern struct proc *curproc[NCPU]; // can be NULL if no proc running. struct cpu { uchar apicid; // Local APIC ID struct jmpbuf jmpbuf; - char mpstack[MPSTACK]; // per-cpu start-up stack, only used to get into main() - struct proc *lastproc; // last proc scheduled on this cpu (never NULL) + char mpstack[MPSTACK]; // per-cpu start-up stack + volatile int booted; int nlock; // # of locks currently held struct spinlock *lastacquire; // xxx debug struct spinlock *lastrelease; // xxx debug -- cgit v1.2.3