hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/arch/m68k/mm/sun3mmu.c
....@@ -16,12 +16,11 @@
1616 #include <linux/string.h>
1717 #include <linux/types.h>
1818 #include <linux/init.h>
19
-#include <linux/bootmem.h>
19
+#include <linux/memblock.h>
2020
2121 #include <asm/setup.h>
2222 #include <linux/uaccess.h>
2323 #include <asm/page.h>
24
-#include <asm/pgtable.h>
2524 #include <asm/machdep.h>
2625 #include <asm/io.h>
2726
....@@ -42,10 +41,13 @@
4241 unsigned long address;
4342 unsigned long next_pgtable;
4443 unsigned long bootmem_end;
45
- unsigned long zones_size[MAX_NR_ZONES] = { 0, };
44
+ unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0, };
4645 unsigned long size;
4746
48
- empty_zero_page = alloc_bootmem_pages(PAGE_SIZE);
47
+ empty_zero_page = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
48
+ if (!empty_zero_page)
49
+ panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
50
+ __func__, PAGE_SIZE, PAGE_SIZE);
4951
5052 address = PAGE_OFFSET;
5153 pg_dir = swapper_pg_dir;
....@@ -55,7 +57,10 @@
5557 size = num_pages * sizeof(pte_t);
5658 size = (size + PAGE_SIZE) & ~(PAGE_SIZE-1);
5759
58
- next_pgtable = (unsigned long)alloc_bootmem_pages(size);
60
+ next_pgtable = (unsigned long)memblock_alloc(size, PAGE_SIZE);
61
+ if (!next_pgtable)
62
+ panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
63
+ __func__, size, PAGE_SIZE);
5964 bootmem_end = (next_pgtable + size + PAGE_SIZE) & PAGE_MASK;
6065
6166 /* Map whole memory from PAGE_OFFSET (0x0E000000) */
....@@ -83,14 +88,10 @@
8388 current->mm = NULL;
8489
8590 /* memory sizing is a hack stolen from motorola.c.. hope it works for us */
86
- zones_size[ZONE_DMA] = ((unsigned long)high_memory - PAGE_OFFSET) >> PAGE_SHIFT;
91
+ max_zone_pfn[ZONE_DMA] = ((unsigned long)high_memory) >> PAGE_SHIFT;
8792
8893 /* I really wish I knew why the following change made things better... -- Sam */
89
-/* free_area_init(zones_size); */
90
- free_area_init_node(0, zones_size,
91
- (__pa(PAGE_OFFSET) >> PAGE_SHIFT) + 1, NULL);
94
+ free_area_init(max_zone_pfn);
9295
9396
9497 }
95
-
96
-