Calculate physmem before calling init_param2().

Submitted by:	jake
This commit is contained in:
tmm 2002-02-13 17:05:56 +00:00
parent 192c359134
commit ec412094f2
2 changed files with 10 additions and 10 deletions

View File

@ -243,9 +243,14 @@ sparc64_init(caddr_t mdp, u_int *state, u_int mid, u_int bootmid,
end = (vm_offset_t)_end;
}
#ifdef DDB
kdb_init();
#endif
/*
* XXX calculate physmem
* Initialize virtual memory and calculate physmem.
*/
pmap_bootstrap(end);
/*
* Initialize tunables.
@ -253,15 +258,6 @@ sparc64_init(caddr_t mdp, u_int *state, u_int mid, u_int bootmid,
init_param1();
init_param2(physmem);
#ifdef DDB
kdb_init();
#endif
/*
* Initialize virtual memory.
*/
pmap_bootstrap(end);
/*
* Disable tick for now.
*/

View File

@ -256,6 +256,7 @@ pmap_bootstrap(vm_offset_t ekva)
vm_offset_t off;
vm_offset_t pa;
vm_offset_t va;
vm_size_t physsz;
ihandle_t pmem;
ihandle_t vmem;
int sz;
@ -292,12 +293,15 @@ pmap_bootstrap(vm_offset_t ekva)
sz /= sizeof(*mra);
CTR0(KTR_PMAP, "pmap_bootstrap: physical memory");
qsort(mra, sz, sizeof (*mra), mr_cmp);
physsz = 0;
for (i = 0, j = 0; i < sz; i++, j += 2) {
CTR2(KTR_PMAP, "start=%#lx size=%#lx", mra[i].mr_start,
mra[i].mr_size);
phys_avail[j] = mra[i].mr_start;
phys_avail[j + 1] = mra[i].mr_start + mra[i].mr_size;
physsz += mra[i].mr_size;
}
physmem = btoc(physsz);
/*
* Allocate the kernel tsb and lock it in the tlb.