// Tell entryother.S what stack to use, where to enter, and what
// pgdir to use. We cannot use kpgdir yet, because the AP processor
// is running in low memory, so we use entrypgdir for the APs too.
- stack = kalloc();
+ if((stack = kalloc()) == 0)
+ panic("startothers: failed to allocate stack");
*(void**)(code-4) = stack + KSTACKSIZE;
*(void**)(code-8) = mpenter;
*(int**)(code-12) = (void *) V2P(entrypgdir);
if((pgdir = (pde_t*)kalloc()) == 0)
return 0;
memset(pgdir, 0, PGSIZE);
- if (P2V(PHYSTOP) > (void*)DEVSPACE)
- panic("PHYSTOP too high");
+ if(P2V(PHYSTOP) > (void*)DEVSPACE)
+ panic("setupkvm: PHYSTOP too high");
for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
(uint)k->phys_start, k->perm) < 0)
kvmalloc(void)
{
kpgdir = setupkvm();
+ if(kpgdir == 0)
+ panic("kvmalloc: could not create kernel page table");
switchkvm();
}