lkml.org 
[lkml]   [2010]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 31/37] x86: Change e820_saved to __initdata
    Date
    for 2.6.34

    Add save_e820_map() and change e820_saved to static
    also make it to be __initdata to get some bytes memory back.

    Signed-off-by: Yinghai Lu <yinghai@kernel.org>
    ---
    arch/x86/include/asm/e820.h | 2 +-
    arch/x86/kernel/e820.c | 9 +++++++--
    arch/x86/kernel/setup.c | 2 +-
    3 files changed, 9 insertions(+), 4 deletions(-)

    diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
    index 25962e1..334281f 100644
    --- a/arch/x86/include/asm/e820.h
    +++ b/arch/x86/include/asm/e820.h
    @@ -75,7 +75,6 @@ struct e820map {
    #ifdef __KERNEL__
    /* see comment in arch/x86/kernel/e820.c */
    extern struct e820map e820;
    -extern struct e820map e820_saved;

    extern unsigned long pci_mem_start;
    extern int e820_any_mapped(u64 start, u64 end, unsigned type);
    @@ -83,6 +82,7 @@ extern int e820_all_mapped(u64 start, u64 end, unsigned type);
    extern void e820_add_region(u64 start, u64 size, int type);
    extern void e820_print_map(char *who);
    int sanitize_e820_map(void);
    +void save_e820_map(void);
    extern u64 e820_update_range(u64 start, u64 size, unsigned old_type,
    unsigned new_type);
    extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type,
    diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
    index 3c4ddaa..bae44dd 100644
    --- a/arch/x86/kernel/e820.c
    +++ b/arch/x86/kernel/e820.c
    @@ -36,7 +36,7 @@
    * next kernel with full memory.
    */
    struct e820map e820;
    -struct e820map e820_saved;
    +static struct e820map __initdata e820_saved;

    /* For PCI or other memory-mapped resources */
    unsigned long pci_mem_start = 0xaeedbabe;
    @@ -1072,12 +1072,17 @@ char *__init default_machine_specific_memory_setup(void)
    return who;
    }

    +void __init save_e820_map(void)
    +{
    + memcpy(&e820_saved, &e820, sizeof(struct e820map));
    +}
    +
    void __init setup_memory_map(void)
    {
    char *who;

    who = x86_init.resources.memory_setup();
    - memcpy(&e820_saved, &e820, sizeof(struct e820map));
    + save_e820_map();
    printk(KERN_INFO "BIOS-provided physical RAM map:\n");
    e820_print_map(who);
    }
    diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
    index 33ff7f4..d165b2d 100644
    --- a/arch/x86/kernel/setup.c
    +++ b/arch/x86/kernel/setup.c
    @@ -463,7 +463,7 @@ static void __init e820_reserve_setup_data(void)
    return;

    sanitize_e820_map();
    - memcpy(&e820_saved, &e820, sizeof(struct e820map));
    + save_e820_map();
    printk(KERN_INFO "extended physical RAM map:\n");
    e820_print_map("reserve setup_data");
    }
    --
    1.6.4.2


    \
     
     \ /
      Last update: 2010-05-14 21:55    [W:0.027 / U:98.388 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site