lkml.org 
[lkml]   [2013]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3 21/23] mm/ARM: kernel: Use memblock apis for early memory allocations
    Date
    Switch to memblock interfaces for early memory allocator instead of
    bootmem allocator. No functional change in beahvior than what it is
    in current code from bootmem users points of view.

    Archs already converted to NO_BOOTMEM now directly use memblock
    interfaces instead of bootmem wrappers build on top of memblock. And the
    archs which still uses bootmem, these new apis just fallback to exiting
    bootmem APIs.

    Cc: Yinghai Lu <yinghai@kernel.org>
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
    ---
    arch/arm/kernel/devtree.c | 2 +-
    arch/arm/kernel/setup.c | 2 +-
    2 files changed, 2 insertions(+), 2 deletions(-)

    diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
    index 739c3df..5a0041e 100644
    --- a/arch/arm/kernel/devtree.c
    +++ b/arch/arm/kernel/devtree.c
    @@ -33,7 +33,7 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)

    void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
    {
    - return alloc_bootmem_align(size, align);
    + return memblock_virt_alloc(size, align);
    }

    void __init arm_dt_memblock_reserve(void)
    diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
    index 6a1b8a8..fffb978 100644
    --- a/arch/arm/kernel/setup.c
    +++ b/arch/arm/kernel/setup.c
    @@ -717,7 +717,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
    kernel_data.end = virt_to_phys(_end - 1);

    for_each_memblock(memory, region) {
    - res = alloc_bootmem_low(sizeof(*res));
    + res = memblock_virt_alloc(sizeof(*res), 0);
    res->name = "System RAM";
    res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
    res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
    --
    1.7.9.5


    \
     
     \ /
      Last update: 2013-12-10 00:21    [W:5.502 / U:0.348 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site