#include <linux/swap.h>
#include <linux/init.h>
#include <linux/bootmem.h>
+#include <linux/mman.h>
#include <linux/initrd.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
-#ifdef CONFIG_CPU_32
-#define TABLE_OFFSET (PTRS_PER_PTE)
-#else
-#define TABLE_OFFSET 0
-#endif
-
-#define TABLE_SIZE ((TABLE_OFFSET + PTRS_PER_PTE) * sizeof(pte_t))
+#define TABLE_SIZE (2 * PTRS_PER_PTE * sizeof(pte_t))
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
printk("Mem-info:\n");
show_free_areas();
- printk("Free swap: %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+ printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
for (node = 0; node < numnodes; node++) {
struct page *page, *end;
*/
reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
-#ifdef CONFIG_CPU_32
/*
* Reserve the page tables. These are already in use,
* and can only be in node 0.
*/
reserve_bootmem_node(pgdat, __pa(swapper_pg_dir),
PTRS_PER_PGD * sizeof(pgd_t));
-#endif
+
/*
* And don't forget to reserve the allocator bitmap,
* which will be freed later.
* Initialise the bootmem allocator for all nodes. This is called
* early during the architecture specific initialisation.
*/
-void __init bootmem_init(struct meminfo *mi)
+static void __init bootmem_init(struct meminfo *mi)
{
struct node_info node_info[MAX_NUMNODES], *np = node_info;
unsigned int bootmap_pages, bootmap_pfn, map_pg;
}
#endif
- if (map_pg != bootmap_pfn + bootmap_pages)
- BUG();
-
+ BUG_ON(map_pg != bootmap_pfn + bootmap_pages);
}
/*
void *zero_page;
int node;
+ bootmem_init(mi);
+
memcpy(&meminfo, mi, sizeof(meminfo));
/*
*/
arch_adjust_zones(node, zone_size, zhole_size);
- free_area_init_node(node, pgdat, 0, zone_size,
+ free_area_init_node(node, pgdat, zone_size,
bdata->node_boot_start >> PAGE_SHIFT, zhole_size);
}
* anywhere without overcommit, so turn
* it on by default.
*/
- sysctl_overcommit_memory = 1;
+ sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
}
}