diff options
author | benno <benno@FreeBSD.org> | 2002-03-07 10:09:24 +0000 |
---|---|---|
committer | benno <benno@FreeBSD.org> | 2002-03-07 10:09:24 +0000 |
commit | a4f95150fbad505613d53ed279717f68643b1072 (patch) | |
tree | d961860330b1f923f8292844ed6314749eb5a167 /sys/powerpc | |
parent | 4232c2291377495f019e32d3715e72a5828aa7b8 (diff) | |
download | FreeBSD-src-a4f95150fbad505613d53ed279717f68643b1072.zip FreeBSD-src-a4f95150fbad505613d53ed279717f68643b1072.tar.gz |
Calculate physmem.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/mmu_oea.c | 5 | ||||
-rw-r--r-- | sys/powerpc/powerpc/mmu_oea.c | 5 | ||||
-rw-r--r-- | sys/powerpc/powerpc/pmap.c | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 20f9bae..70a2d4c 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -531,7 +531,7 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) phandle_t chosen, mmu; int sz; int i, j; - vm_size_t size; + vm_size_t size, physsz; vm_offset_t pa, va, off; u_int batl, batu; @@ -571,6 +571,7 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) CTR0(KTR_PMAP, "pmap_bootstrap: physical memory"); qsort(regions, sz, sizeof(*regions), mr_cmp); phys_avail_count = 0; + physsz = 0; for (i = 0, j = 0; i < sz; i++, j += 2) { CTR3(KTR_PMAP, "region: %#x - %#x (%#x)", regions[i].mr_start, regions[i].mr_start + regions[i].mr_size, @@ -578,7 +579,9 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) phys_avail[j] = regions[i].mr_start; phys_avail[j + 1] = regions[i].mr_start + regions[i].mr_size; phys_avail_count++; + physsz += regions[i].mr_size; } + physmem = btoc(physsz); /* * Allocate PTEG table. diff --git a/sys/powerpc/powerpc/mmu_oea.c b/sys/powerpc/powerpc/mmu_oea.c index 20f9bae..70a2d4c 100644 --- a/sys/powerpc/powerpc/mmu_oea.c +++ b/sys/powerpc/powerpc/mmu_oea.c @@ -531,7 +531,7 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) phandle_t chosen, mmu; int sz; int i, j; - vm_size_t size; + vm_size_t size, physsz; vm_offset_t pa, va, off; u_int batl, batu; @@ -571,6 +571,7 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) CTR0(KTR_PMAP, "pmap_bootstrap: physical memory"); qsort(regions, sz, sizeof(*regions), mr_cmp); phys_avail_count = 0; + physsz = 0; for (i = 0, j = 0; i < sz; i++, j += 2) { CTR3(KTR_PMAP, "region: %#x - %#x (%#x)", regions[i].mr_start, regions[i].mr_start + regions[i].mr_size, @@ -578,7 +579,9 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) phys_avail[j] = regions[i].mr_start; phys_avail[j + 1] = regions[i].mr_start + regions[i].mr_size; phys_avail_count++; + physsz += regions[i].mr_size; } + physmem = btoc(physsz); /* * Allocate PTEG table. diff --git a/sys/powerpc/powerpc/pmap.c b/sys/powerpc/powerpc/pmap.c index 20f9bae..70a2d4c 100644 --- a/sys/powerpc/powerpc/pmap.c +++ b/sys/powerpc/powerpc/pmap.c @@ -531,7 +531,7 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) phandle_t chosen, mmu; int sz; int i, j; - vm_size_t size; + vm_size_t size, physsz; vm_offset_t pa, va, off; u_int batl, batu; @@ -571,6 +571,7 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) CTR0(KTR_PMAP, "pmap_bootstrap: physical memory"); qsort(regions, sz, sizeof(*regions), mr_cmp); phys_avail_count = 0; + physsz = 0; for (i = 0, j = 0; i < sz; i++, j += 2) { CTR3(KTR_PMAP, "region: %#x - %#x (%#x)", regions[i].mr_start, regions[i].mr_start + regions[i].mr_size, @@ -578,7 +579,9 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) phys_avail[j] = regions[i].mr_start; phys_avail[j + 1] = regions[i].mr_start + regions[i].mr_size; phys_avail_count++; + physsz += regions[i].mr_size; } + physmem = btoc(physsz); /* * Allocate PTEG table. |