diff options
author | benno <benno@FreeBSD.org> | 2002-07-18 12:43:08 +0000 |
---|---|---|
committer | benno <benno@FreeBSD.org> | 2002-07-18 12:43:08 +0000 |
commit | 044696821aae8928a3219ff438dfb21f808c6494 (patch) | |
tree | 55aaa9281d7586c9cd5043cf16a1b1fd439a1fd5 /sys/powerpc | |
parent | 44423651cb9bcc3ccbb2b1be3edc47d91ce6bcdb (diff) | |
download | FreeBSD-src-044696821aae8928a3219ff438dfb21f808c6494.zip FreeBSD-src-044696821aae8928a3219ff438dfb21f808c6494.tar.gz |
Remove the statically allocated array that holds OpenFirmware memory mappings
during pmap_bootstrap. Instead, temporarily help ourselves to some memory
from phys_avail since we won't need it post-boostrap.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/mmu_oea.c | 12 | ||||
-rw-r--r-- | sys/powerpc/powerpc/mmu_oea.c | 12 | ||||
-rw-r--r-- | sys/powerpc/powerpc/pmap.c | 12 |
3 files changed, 24 insertions, 12 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 50e3f12..789f40b 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -211,8 +211,7 @@ u_int phys_avail_count; static struct mem_region *regions; static struct mem_region *pregions; int regions_sz, pregions_sz; -static struct ofw_map translations[128]; -static int translations_size; +static struct ofw_map *translations; /* * First and last available kernel virtual addresses. @@ -688,8 +687,13 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) panic("pmap_bootstrap: can't get mmu package"); if ((sz = OF_getproplen(mmu, "translations")) == -1) panic("pmap_bootstrap: can't get ofw translation count"); - if (sizeof(translations) < sz) - panic("pmap_bootstrap: translations too small"); + translations = NULL; + for (i = 0; phys_avail[i + 2] != 0; i += 2) { + if (phys_avail[i + 1] >= sz) + translations = (struct ofw_map *)phys_avail[i]; + } + if (translations == NULL) + panic("pmap_bootstrap: no space to copy translations"); bzero(translations, sz); if (OF_getprop(mmu, "translations", translations, sz) == -1) panic("pmap_bootstrap: can't get ofw translations"); diff --git a/sys/powerpc/powerpc/mmu_oea.c b/sys/powerpc/powerpc/mmu_oea.c index 50e3f12..789f40b 100644 --- a/sys/powerpc/powerpc/mmu_oea.c +++ b/sys/powerpc/powerpc/mmu_oea.c @@ -211,8 +211,7 @@ u_int phys_avail_count; static struct mem_region *regions; static struct mem_region *pregions; int regions_sz, pregions_sz; -static struct ofw_map translations[128]; -static int translations_size; +static struct ofw_map *translations; /* * First and last available kernel virtual addresses. @@ -688,8 +687,13 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) panic("pmap_bootstrap: can't get mmu package"); if ((sz = OF_getproplen(mmu, "translations")) == -1) panic("pmap_bootstrap: can't get ofw translation count"); - if (sizeof(translations) < sz) - panic("pmap_bootstrap: translations too small"); + translations = NULL; + for (i = 0; phys_avail[i + 2] != 0; i += 2) { + if (phys_avail[i + 1] >= sz) + translations = (struct ofw_map *)phys_avail[i]; + } + if (translations == NULL) + panic("pmap_bootstrap: no space to copy translations"); bzero(translations, sz); if (OF_getprop(mmu, "translations", translations, sz) == -1) panic("pmap_bootstrap: can't get ofw translations"); diff --git a/sys/powerpc/powerpc/pmap.c b/sys/powerpc/powerpc/pmap.c index 50e3f12..789f40b 100644 --- a/sys/powerpc/powerpc/pmap.c +++ b/sys/powerpc/powerpc/pmap.c @@ -211,8 +211,7 @@ u_int phys_avail_count; static struct mem_region *regions; static struct mem_region *pregions; int regions_sz, pregions_sz; -static struct ofw_map translations[128]; -static int translations_size; +static struct ofw_map *translations; /* * First and last available kernel virtual addresses. @@ -688,8 +687,13 @@ pmap_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) panic("pmap_bootstrap: can't get mmu package"); if ((sz = OF_getproplen(mmu, "translations")) == -1) panic("pmap_bootstrap: can't get ofw translation count"); - if (sizeof(translations) < sz) - panic("pmap_bootstrap: translations too small"); + translations = NULL; + for (i = 0; phys_avail[i + 2] != 0; i += 2) { + if (phys_avail[i + 1] >= sz) + translations = (struct ofw_map *)phys_avail[i]; + } + if (translations == NULL) + panic("pmap_bootstrap: no space to copy translations"); bzero(translations, sz); if (OF_getprop(mmu, "translations", translations, sz) == -1) panic("pmap_bootstrap: can't get ofw translations"); |