more bugs

This commit is contained in:
rsc 2007-08-08 09:10:16 +00:00
parent 5f0c20ec14
commit 5d0fe3445b
2 changed files with 3 additions and 10 deletions

7
BUGS
View file

@ -4,13 +4,6 @@ index:
mmu.h: mmu.h:
funny \ alignment in mmu.h funny \ alignment in mmu.h
main.c:
should use static int bcpu to avoid having live
stack variable across the asm volatile that
changes %esp and %ebp.
cpus[0] -> cpus[bcpu]
proc.c: proc.c:
as a consequence of the implementation of proc_kill, as a consequence of the implementation of proc_kill,
any loop calling sleep should check for p->killed any loop calling sleep should check for p->killed

6
main.c
View file

@ -23,7 +23,7 @@ void
main0(void) main0(void)
{ {
int i; int i;
int bcpu; static int bcpu; // cannot be on stack
struct proc *p; struct proc *p;
// clear BSS // clear BSS
@ -37,8 +37,8 @@ main0(void)
bcpu = mp_bcpu(); bcpu = mp_bcpu();
// switch to bootstrap processor's stack // switch to bootstrap processor's stack
asm volatile("movl %0, %%esp" : : "r" (cpus[0].mpstack + MPSTACK - 32)); asm volatile("movl %0, %%esp" : : "r" (cpus[bcpu].mpstack + MPSTACK - 32));
asm volatile("movl %0, %%ebp" : : "r" (cpus[0].mpstack + MPSTACK)); asm volatile("movl %0, %%ebp" : : "r" (cpus[bcpu].mpstack + MPSTACK));
lapic_init(bcpu); lapic_init(bcpu);