PERFORCE change 79016 for review
Peter Wemm
peter at FreeBSD.org
Sun Jun 26 21:17:19 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=79016
Change 79016 by peter at peter_daintree on 2005/06/26 21:16:20
Checkpoint in case I lose it. Build dump_avail[] array alongside
phys_avail[], so that we have an accurate complete list of things
to dump, without the hacking that goes on in vm_page.c and later
in machdep.c
Affected files ...
.. //depot/projects/hammer/sys/i386/i386/machdep.c#53 edit
Differences ...
==== //depot/projects/hammer/sys/i386/i386/machdep.c#53 (text+ko) ====
@@ -185,10 +185,12 @@
long realmem = 0;
vm_paddr_t phys_avail[10];
+vm_paddr_t dump_avail[10];
vm_paddr_t kernphys[2];
/* must be 2 less so 0 0 can signal end of chunks */
-#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2)
+#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(phys_avail[0])) - 2)
+#define DUMP_AVAIL_ARRAY_END ((sizeof(dump_avail) / sizeof(dump_avail[0])) - 2)
struct kva_md_info kmi;
@@ -1612,7 +1614,7 @@
static void
getmemsize(int first)
{
- int i, physmap_idx, pa_indx;
+ int i, physmap_idx, pa_indx, da_indx;
int hasbrokenint12;
u_long physmem_tunable;
u_int extmem;
@@ -1897,14 +1899,15 @@
if (physmap[i + 1] < end)
end = trunc_page(physmap[i + 1]);
for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) {
- int tmp, page_bad;
+ int tmp, page_bad, full;
int *ptr = (int *)CADDR1;
+ full = FALSE;
/*
* block out kernel memory as not available.
*/
if (pa >= kernphys[0] && pa < kernphys[1])
- continue;
+ goto do_dump_avail;
/*
* block out dcons buffer
@@ -1912,7 +1915,7 @@
if (dcons_addr > 0
&& pa >= trunc_page(dcons_addr)
&& pa < dcons_addr + dcons_size)
- continue;
+ goto do_dump_avail;
page_bad = FALSE;
@@ -1981,12 +1984,28 @@
printf(
"Too many holes in the physical address space, giving up\n");
pa_indx--;
- break;
+ full = TRUE;
+ goto do_dump_avail;
}
phys_avail[pa_indx++] = pa; /* start */
phys_avail[pa_indx] = pa + PAGE_SIZE; /* end */
}
physmem++;
+do_dump_avail:
+ if (dump_avail[da_indx] == pa) {
+ dump_avail[da_indx] += PAGE_SIZE;
+ } else {
+ da_indx++;
+ if (da_indx == DUMP_AVAIL_ARRAY_END) {
+ da_indx--;
+ goto do_next;
+ }
+ dump_avail[da_indx++] = pa; /* start */
+ dump_avail[da_indx] = pa + PAGE_SIZE; /* end */
+ }
+do_next;
+ if (full)
+ break;
}
}
*pte = 0;
More information about the p4-projects
mailing list