diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-01-28 15:25:45 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-01-28 16:42:29 +0300 |
commit | da92139bff5fb334981d56225d3d80e73125b51f (patch) | |
tree | cd4e8a151f7356a7ec423fb0ce47bdd9a9b8c3a3 /arch/x86/kernel/e820.c | |
parent | 914053c08e95b2577d5834d51d5962c922ad0a72 (diff) | |
download | linux-da92139bff5fb334981d56225d3d80e73125b51f.tar.xz |
x86/boot/e820: Move e820_reserve_setup_data() to e820.c
The e820_reserve_setup_data() is local to arch/x86/kernel/setup.c,
but it is E820 functionality - so move it to e820.c to better
isolate E820 functionality.
No change in functionality.
Cc: Alex Thorlton <athorlton@sgi.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Huang, Ying <ying.huang@intel.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Wei Yang <richard.weiyang@gmail.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r-- | arch/x86/kernel/e820.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index d24c0f2b4a1c..79b9401bbbea 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -910,6 +910,28 @@ static int __init parse_memmap_opt(char *str) } early_param("memmap", parse_memmap_opt); +void __init e820_reserve_setup_data(void) +{ + struct setup_data *data; + u64 pa_data; + + pa_data = boot_params.hdr.setup_data; + if (!pa_data) + return; + + while (pa_data) { + data = early_memremap(pa_data, sizeof(*data)); + e820_update_range(pa_data, sizeof(*data)+data->len, E820_RAM, E820_RESERVED_KERN); + pa_data = data->next; + early_memunmap(data, sizeof(*data)); + } + + sanitize_e820_table(e820_table->entries, ARRAY_SIZE(e820_table->entries), &e820_table->nr_entries); + memcpy(e820_table_firmware, e820_table, sizeof(struct e820_table)); + printk(KERN_INFO "extended physical RAM map:\n"); + e820_print_map("reserve setup_data"); +} + void __init finish_e820_parsing(void) { if (userdef) { |