aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820_64.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-15 20:13:22 -0400
committerH. Peter Anvin <hpa@zytor.com>2007-10-16 20:38:31 -0400
commit30c826451d3e5bbc6e11bba0e7fee5d2f49d9b75 (patch)
tree61abd11d1703673ff21227d42ed4b07d85dd0290 /arch/x86/kernel/e820_64.c
parent2b0460b534f383eca744eb8fff66ec9f57e702b9 (diff)
[x86] remove uses of magic macros for boot_params access
Instead of using magic macros for boot_params access, simply use the boot_params structure. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/e820_64.c')
-rw-r--r--arch/x86/kernel/e820_64.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c
index 0f4d5e209e9b..e422b8159f69 100644
--- a/arch/x86/kernel/e820_64.c
+++ b/arch/x86/kernel/e820_64.c
@@ -24,7 +24,7 @@
24#include <asm/page.h> 24#include <asm/page.h>
25#include <asm/e820.h> 25#include <asm/e820.h>
26#include <asm/proto.h> 26#include <asm/proto.h>
27#include <asm/bootsetup.h> 27#include <asm/setup.h>
28#include <asm/sections.h> 28#include <asm/sections.h>
29 29
30struct e820map e820; 30struct e820map e820;
@@ -68,10 +68,15 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size)
68 68
69 /* initrd */ 69 /* initrd */
70#ifdef CONFIG_BLK_DEV_INITRD 70#ifdef CONFIG_BLK_DEV_INITRD
71 if (LOADER_TYPE && INITRD_START && last >= INITRD_START && 71 if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
72 addr < INITRD_START+INITRD_SIZE) { 72 unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
73 *addrp = PAGE_ALIGN(INITRD_START + INITRD_SIZE); 73 unsigned long ramdisk_size = boot_params.hdr.ramdisk_size;
74 return 1; 74 unsigned long ramdisk_end = ramdisk_image+ramdisk_size;
75
76 if (last >= ramdisk_image && addr < ramdisk_end) {
77 *addrp = PAGE_ALIGN(ramdisk_end);
78 return 1;
79 }
75 } 80 }
76#endif 81#endif
77 /* kernel code */ 82 /* kernel code */
@@ -594,8 +599,8 @@ void __init setup_memory_region(void)
594 * Otherwise fake a memory map; one section from 0k->640k, 599 * Otherwise fake a memory map; one section from 0k->640k,
595 * the next section from 1mb->appropriate_mem_k 600 * the next section from 1mb->appropriate_mem_k
596 */ 601 */
597 sanitize_e820_map(E820_MAP, &E820_MAP_NR); 602 sanitize_e820_map(boot_params.e820_map, &boot_params.e820_entries);
598 if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) 603 if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries) < 0)
599 early_panic("Cannot find a valid memory map"); 604 early_panic("Cannot find a valid memory map");
600 printk(KERN_INFO "BIOS-provided physical RAM map:\n"); 605 printk(KERN_INFO "BIOS-provided physical RAM map:\n");
601 e820_print_map("BIOS-e820"); 606 e820_print_map("BIOS-e820");