aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/e820_64.c')
-rw-r--r--arch/x86/kernel/e820_64.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c
deleted file mode 100644
index cb03bff9fa2f..000000000000
--- a/arch/x86/kernel/e820_64.c
+++ /dev/null
@@ -1,92 +0,0 @@
1/*
2 * Handle the memory map.
3 * The functions here do the job until bootmem takes over.
4 *
5 * Getting sanitize_e820_map() in sync with i386 version by applying change:
6 * - Provisions for empty E820 memory regions (reported by certain BIOSes).
7 * Alex Achenbach <xela@slit.de>, December 2002.
8 * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
9 *
10 */
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/bootmem.h>
15#include <linux/ioport.h>
16#include <linux/string.h>
17#include <linux/kexec.h>
18#include <linux/module.h>
19#include <linux/mm.h>
20#include <linux/pfn.h>
21#include <linux/pci.h>
22
23#include <asm/pgtable.h>
24#include <asm/page.h>
25#include <asm/e820.h>
26#include <asm/proto.h>
27#include <asm/setup.h>
28#include <asm/sections.h>
29#include <asm/kdebug.h>
30#include <asm/trampoline.h>
31
32/*
33 * PFN of last memory page.
34 */
35unsigned long end_pfn;
36
37/*
38 * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries.
39 * The direct mapping extends to max_pfn_mapped, so that we can directly access
40 * apertures, ACPI and other tables without having to play with fixmaps.
41 */
42unsigned long max_pfn_mapped;
43
44static void early_panic(char *msg)
45{
46 early_printk(msg);
47 panic(msg);
48}
49
50/* We're not void only for x86 32-bit compat */
51char *__init machine_specific_memory_setup(void)
52{
53 char *who = "BIOS-e820";
54 int new_nr;
55 /*
56 * Try to copy the BIOS-supplied E820-map.
57 *
58 * Otherwise fake a memory map; one section from 0k->640k,
59 * the next section from 1mb->appropriate_mem_k
60 */
61 new_nr = boot_params.e820_entries;
62 sanitize_e820_map(boot_params.e820_map,
63 ARRAY_SIZE(boot_params.e820_map),
64 &new_nr);
65 boot_params.e820_entries = new_nr;
66 if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries) < 0)
67 early_panic("Cannot find a valid memory map");
68 printk(KERN_INFO "BIOS-provided physical RAM map:\n");
69 e820_print_map(who);
70
71 /* In case someone cares... */
72 return who;
73}
74
75int __init arch_get_ram_range(int slot, u64 *addr, u64 *size)
76{
77 int i;
78
79 if (slot < 0 || slot >= e820.nr_map)
80 return -1;
81 for (i = slot; i < e820.nr_map; i++) {
82 if (e820.map[i].type != E820_RAM)
83 continue;
84 break;
85 }
86 if (i == e820.nr_map || e820.map[i].addr > (max_pfn << PAGE_SHIFT))
87 return -1;
88 *addr = e820.map[i].addr;
89 *size = min_t(u64, e820.map[i].size + e820.map[i].addr,
90 max_pfn << PAGE_SHIFT) - *addr;
91 return i + 1;
92}