diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-05-18 04:18:57 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-25 04:55:11 -0400 |
commit | a4c81cf684350797939416c99effb9d3ae46bca6 (patch) | |
tree | 93f58c28e1dae637a5bb9fd6166968808f10e472 /arch/x86/kernel/head32.c | |
parent | 69c9189320c46b14e5ae3ad4b3a0d35cc63cba20 (diff) |
x86: extend e820 ealy_res support 32bit
move early_res related from e820_64.c to e820.c
make edba detection to be done in head32.c
remove smp_alloc_memory, because we have fixed trampoline address now.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
arch/x86/kernel/e820.c | 214 ++++++++++++++++++++++++++++++++++++
arch/x86/kernel/e820_64.c | 196 --------------------------------
arch/x86/kernel/head32.c | 76 ++++++++++++
arch/x86/kernel/setup_32.c | 109 +++---------------
arch/x86/kernel/smpboot.c | 17 --
arch/x86/kernel/trampoline.c | 2
arch/x86/mach-voyager/voyager_smp.c | 9 -
include/asm-x86/e820.h | 6 +
include/asm-x86/e820_64.h | 9 -
include/asm-x86/smp.h | 1
arch/x86/kernel/e820.c | 214 ++++++++++++++++++++++++++++++++++++
arch/x86/kernel/e820_64.c | 196 --------------------------------
arch/x86/kernel/head32.c | 76 ++++++++++++
arch/x86/kernel/setup_32.c | 109 +++---------------
arch/x86/kernel/smpboot.c | 17 --
arch/x86/kernel/trampoline.c | 2
arch/x86/mach-voyager/voyager_smp.c | 9 -
include/asm-x86/e820.h | 6 +
include/asm-x86/e820_64.h | 9 -
include/asm-x86/smp.h | 1
arch/x86/kernel/e820.c | 214 ++++++++++++++++++++++++++++++++++++
arch/x86/kernel/e820_64.c | 196 --------------------------------
arch/x86/kernel/head32.c | 76 ++++++++++++
arch/x86/kernel/setup_32.c | 109 +++---------------
arch/x86/kernel/smpboot.c | 17 --
arch/x86/kernel/trampoline.c | 2
arch/x86/mach-voyager/voyager_smp.c | 9 -
include/asm-x86/e820.h | 6 +
include/asm-x86/e820_64.h | 9 -
include/asm-x86/smp.h | 1
10 files changed, 320 insertions(+), 319 deletions(-)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/head32.c')
-rw-r--r-- | arch/x86/kernel/head32.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c index 3db059058927..c216d3c2a991 100644 --- a/arch/x86/kernel/head32.c +++ b/arch/x86/kernel/head32.c | |||
@@ -8,7 +8,83 @@ | |||
8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
9 | #include <linux/start_kernel.h> | 9 | #include <linux/start_kernel.h> |
10 | 10 | ||
11 | #include <asm/setup.h> | ||
12 | #include <asm/sections.h> | ||
13 | #include <asm/e820.h> | ||
14 | #include <asm/bios_ebda.h> | ||
15 | |||
16 | #define BIOS_LOWMEM_KILOBYTES 0x413 | ||
17 | |||
18 | /* | ||
19 | * The BIOS places the EBDA/XBDA at the top of conventional | ||
20 | * memory, and usually decreases the reported amount of | ||
21 | * conventional memory (int 0x12) too. This also contains a | ||
22 | * workaround for Dell systems that neglect to reserve EBDA. | ||
23 | * The same workaround also avoids a problem with the AMD768MPX | ||
24 | * chipset: reserve a page before VGA to prevent PCI prefetch | ||
25 | * into it (errata #56). Usually the page is reserved anyways, | ||
26 | * unless you have no PS/2 mouse plugged in. | ||
27 | */ | ||
28 | static void __init reserve_ebda_region(void) | ||
29 | { | ||
30 | unsigned int lowmem, ebda_addr; | ||
31 | |||
32 | /* To determine the position of the EBDA and the */ | ||
33 | /* end of conventional memory, we need to look at */ | ||
34 | /* the BIOS data area. In a paravirtual environment */ | ||
35 | /* that area is absent. We'll just have to assume */ | ||
36 | /* that the paravirt case can handle memory setup */ | ||
37 | /* correctly, without our help. */ | ||
38 | if (paravirt_enabled()) | ||
39 | return; | ||
40 | |||
41 | /* end of low (conventional) memory */ | ||
42 | lowmem = *(unsigned short *)__va(BIOS_LOWMEM_KILOBYTES); | ||
43 | lowmem <<= 10; | ||
44 | |||
45 | /* start of EBDA area */ | ||
46 | ebda_addr = get_bios_ebda(); | ||
47 | |||
48 | /* Fixup: bios puts an EBDA in the top 64K segment */ | ||
49 | /* of conventional memory, but does not adjust lowmem. */ | ||
50 | if ((lowmem - ebda_addr) <= 0x10000) | ||
51 | lowmem = ebda_addr; | ||
52 | |||
53 | /* Fixup: bios does not report an EBDA at all. */ | ||
54 | /* Some old Dells seem to need 4k anyhow (bugzilla 2990) */ | ||
55 | if ((ebda_addr == 0) && (lowmem >= 0x9f000)) | ||
56 | lowmem = 0x9f000; | ||
57 | |||
58 | /* Paranoia: should never happen, but... */ | ||
59 | if ((lowmem == 0) || (lowmem >= 0x100000)) | ||
60 | lowmem = 0x9f000; | ||
61 | |||
62 | /* reserve all memory between lowmem and the 1MB mark */ | ||
63 | reserve_early(lowmem, 0x100000, "BIOS reserved"); | ||
64 | } | ||
65 | |||
11 | void __init i386_start_kernel(void) | 66 | void __init i386_start_kernel(void) |
12 | { | 67 | { |
68 | reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS"); | ||
69 | |||
70 | #ifdef CONFIG_BLK_DEV_INITRD | ||
71 | /* Reserve INITRD */ | ||
72 | if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) { | ||
73 | u64 ramdisk_image = boot_params.hdr.ramdisk_image; | ||
74 | u64 ramdisk_size = boot_params.hdr.ramdisk_size; | ||
75 | u64 ramdisk_end = ramdisk_image + ramdisk_size; | ||
76 | reserve_early(ramdisk_image, ramdisk_end, "RAMDISK"); | ||
77 | } | ||
78 | #endif | ||
79 | reserve_early(__pa_symbol(&_end), init_pg_tables_end, "INIT_PG_TABLE"); | ||
80 | |||
81 | reserve_ebda_region(); | ||
82 | |||
83 | /* | ||
84 | * At this point everything still needed from the boot loader | ||
85 | * or BIOS or kernel text should be early reserved or marked not | ||
86 | * RAM in e820. All other memory is free game. | ||
87 | */ | ||
88 | |||
13 | start_kernel(); | 89 | start_kernel(); |
14 | } | 90 | } |