]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mm/nommu.c
Merge branch 'proc' of git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc
[linux-2.6-omap-h63xx.git] / arch / arm / mm / nommu.c
index 63c62fdea52115e168751c5efa5eec96c7602341..07b62b23897909bca58218aec816e41e7608ab3f 100644 (file)
@@ -7,16 +7,14 @@
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/bootmem.h>
+#include <linux/io.h>
 
 #include <asm/cacheflush.h>
-#include <asm/io.h>
 #include <asm/page.h>
 #include <asm/mach/arch.h>
 
 #include "mm.h"
 
-extern void _stext, __data_start, _end;
-
 /*
  * Reserve the various regions of node 0
  */
@@ -43,12 +41,26 @@ void __init reserve_node_zero(pg_data_t *pgdat)
                        BOOTMEM_DEFAULT);
 }
 
+static void __init sanity_check_meminfo(struct meminfo *mi)
+{
+       int i, j;
+
+       for (i = 0, j = 0; i < mi->nr_banks; i++) {
+               struct membank *mb = &mi->bank[i];
+
+               if (mb->size != 0 && mb->node < MAX_NUMNODES)
+                       mi->bank[j++] = mi->bank[i];
+       }
+       mi->nr_banks = j;
+}
+
 /*
  * paging_init() sets up the page tables, initialises the zone memory
  * maps, and sets up the zero page, bad page and bad page tables.
  */
 void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
 {
+       sanity_check_meminfo(mi);
        bootmem_init(mi);
 }