···1111#include <linux/kernel.h>1212#include <linux/errno.h>1313#include <linux/init.h>1414-#include <linux/bootmem.h>1514#include <linux/mman.h>1615#include <linux/nodemask.h>1616+#include <linux/memblock.h>1717#include <linux/sort.h>18181919#include <asm/cputype.h>···489489490490static void __init *early_alloc(unsigned long sz)491491{492492- return alloc_bootmem_low_pages(sz);492492+ void *ptr = __va(memblock_alloc(sz, sz));493493+ memset(ptr, 0, sz);494494+ return ptr;493495}494496495497static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot)···707705}708706early_param("vmalloc", early_vmalloc);709707708708+phys_addr_t lowmem_end_addr;709709+710710static void __init sanity_check_meminfo(void)711711{712712 int i, j, highmem = 0;713713+714714+ lowmem_end_addr = __pa(vmalloc_min - 1) + 1;713715714716 for (i = 0, j = 0; i < meminfo.nr_banks; i++) {715717 struct membank *bank = &meminfo.bank[j];···840834}841835842836/*843843- * Reserve the various regions837837+ * Reserve the special regions of memory844838 */845845-void __init reserve_special_regions(void)839839+void __init arm_mm_memblock_reserve(void)846840{847847- /*848848- * Register the kernel text and data with bootmem.849849- * Note that this can only be in node 0.850850- */851851-#ifdef CONFIG_XIP_KERNEL852852- reserve_bootmem(__pa(_data), _end - _data, BOOTMEM_DEFAULT);853853-#else854854- reserve_bootmem(__pa(_stext), _end - _stext, BOOTMEM_DEFAULT);855855-#endif856856-857841 /*858842 * Reserve the page tables. These are already in use,859843 * and can only be in node 0.860844 */861861- reserve_bootmem(__pa(swapper_pg_dir),862862- PTRS_PER_PGD * sizeof(pgd_t), BOOTMEM_DEFAULT);845845+ memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t));863846864847#ifdef CONFIG_SA1111865848 /*866849 * Because of the SA1111 DMA bug, we want to preserve our867850 * precious DMA-able memory...868851 */869869- reserve_bootmem(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET,870870- BOOTMEM_DEFAULT);852852+ memblock_reserve(PHYS_OFFSET, __pa(swapper_pg_dir) - PHYS_OFFSET);871853#endif872854}873855···9981004 sanity_check_meminfo();9991005 prepare_page_table();10001006 map_lowmem();10011001- bootmem_init(mdesc);10021007 devicemaps_init(mdesc);10031008 kmap_init();10041009···1005101210061013 /* allocate the zero page. */10071014 zero_page = early_alloc(PAGE_SIZE);10151015+10161016+ bootmem_init(mdesc);10171017+10081018 empty_zero_page = virt_to_page(zero_page);10091019 __flush_dcache_page(NULL, empty_zero_page);10101020}
+3-16
arch/arm/mm/nommu.c
···66#include <linux/module.h>77#include <linux/mm.h>88#include <linux/pagemap.h>99-#include <linux/bootmem.h>109#include <linux/io.h>1010+#include <linux/memblock.h>11111212#include <asm/cacheflush.h>1313#include <asm/sections.h>···17171818#include "mm.h"19192020-/*2121- * Reserve the various regions2222- */2323-void __init reserve_special_regions(void)2020+void __init arm_mm_memblock_reserve(void)2421{2525- /*2626- * Register the kernel text and data with bootmem.2727- * Note that this can only be in node 0.2828- */2929-#ifdef CONFIG_XIP_KERNEL3030- reserve_bootmem(__pa(_data), _end - _data, BOOTMEM_DEFAULT);3131-#else3232- reserve_bootmem(__pa(_stext), _end - _stext, BOOTMEM_DEFAULT);3333-#endif3434-3522 /*3623 * Register the exception vector page.3724 * some architectures which the DRAM is the exception vector to trap,3825 * alloc_page breaks with error, although it is not NULL, but "0."3926 */4040- reserve_bootmem(CONFIG_VECTORS_BASE, PAGE_SIZE, BOOTMEM_DEFAULT);2727+ memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);4128}42294330/*