This change increases the size of the kernel stack for thread0 from

PAGE_SIZE to (2 * PAGE_SIZE). It depends on the memory allocated by
pmap_steal_memory() being aligned to a PAGE_SIZE boundary.

Approved by: imp (mentor)
This commit is contained in:
neel 2010-01-05 06:58:54 +00:00
parent 4faf60f7fd
commit ab74c419fd
2 changed files with 10 additions and 1 deletions

View File

@ -260,8 +260,11 @@ mips_proc0_init(void)
{
proc_linkup0(&proc0, &thread0);
KASSERT((kstack0 & PAGE_MASK) == 0,
("kstack0 is not aligned on a page boundary: 0x%0lx",
(long)kstack0));
thread0.td_kstack = kstack0;
thread0.td_kstack_pages = KSTACK_PAGES - 1;
thread0.td_kstack_pages = KSTACK_PAGES;
thread0.td_md.md_realstack = roundup2(thread0.td_kstack, PAGE_SIZE * 2);
/*
* Do not use cpu_thread_alloc to initialize these fields

View File

@ -291,6 +291,12 @@ pmap_bootstrap(void)
/* Sort. */
again:
for (i = 0; phys_avail[i + 1] != 0; i += 2) {
/*
* Keep the memory aligned on page boundary.
*/
phys_avail[i] = round_page(phys_avail[i]);
phys_avail[i + 1] = trunc_page(phys_avail[i + 1]);
if (phys_avail[i + 1] >= MIPS_KSEG0_LARGEST_PHYS)
memory_larger_than_512meg++;
if (i < 2)