diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-10-15 20:13:22 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-10-16 20:38:31 -0400 |
commit | 30c826451d3e5bbc6e11bba0e7fee5d2f49d9b75 (patch) | |
tree | 61abd11d1703673ff21227d42ed4b07d85dd0290 /arch/x86/kernel/setup_64.c | |
parent | 2b0460b534f383eca744eb8fff66ec9f57e702b9 (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/setup_64.c')
-rw-r--r-- | arch/x86/kernel/setup_64.c | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index 85b5b6310acc..8159bf0be17a 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
@@ -52,7 +52,6 @@ | |||
52 | #include <asm/dma.h> | 52 | #include <asm/dma.h> |
53 | #include <asm/mpspec.h> | 53 | #include <asm/mpspec.h> |
54 | #include <asm/mmu_context.h> | 54 | #include <asm/mmu_context.h> |
55 | #include <asm/bootsetup.h> | ||
56 | #include <asm/proto.h> | 55 | #include <asm/proto.h> |
57 | #include <asm/setup.h> | 56 | #include <asm/setup.h> |
58 | #include <asm/mach_apic.h> | 57 | #include <asm/mach_apic.h> |
@@ -180,10 +179,11 @@ EXPORT_SYMBOL(edd); | |||
180 | */ | 179 | */ |
181 | static inline void copy_edd(void) | 180 | static inline void copy_edd(void) |
182 | { | 181 | { |
183 | memcpy(edd.mbr_signature, EDD_MBR_SIGNATURE, sizeof(edd.mbr_signature)); | 182 | memcpy(edd.mbr_signature, boot_params.edd_mbr_sig_buffer, |
184 | memcpy(edd.edd_info, EDD_BUF, sizeof(edd.edd_info)); | 183 | sizeof(edd.mbr_signature)); |
185 | edd.mbr_signature_nr = EDD_MBR_SIG_NR; | 184 | memcpy(edd.edd_info, boot_params.eddbuf, sizeof(edd.edd_info)); |
186 | edd.edd_info_nr = EDD_NR; | 185 | edd.mbr_signature_nr = boot_params.edd_mbr_sig_buf_entries; |
186 | edd.edd_info_nr = boot_params.eddbuf_entries; | ||
187 | } | 187 | } |
188 | #else | 188 | #else |
189 | static inline void copy_edd(void) | 189 | static inline void copy_edd(void) |
@@ -220,21 +220,21 @@ void __init setup_arch(char **cmdline_p) | |||
220 | { | 220 | { |
221 | printk(KERN_INFO "Command line: %s\n", boot_command_line); | 221 | printk(KERN_INFO "Command line: %s\n", boot_command_line); |
222 | 222 | ||
223 | ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); | 223 | ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev); |
224 | screen_info = SCREEN_INFO; | 224 | screen_info = boot_params.screen_info; |
225 | edid_info = EDID_INFO; | 225 | edid_info = boot_params.edid_info; |
226 | saved_video_mode = SAVED_VIDEO_MODE; | 226 | saved_video_mode = boot_params.hdr.vid_mode; |
227 | bootloader_type = LOADER_TYPE; | 227 | bootloader_type = boot_params.hdr.type_of_loader; |
228 | 228 | ||
229 | #ifdef CONFIG_BLK_DEV_RAM | 229 | #ifdef CONFIG_BLK_DEV_RAM |
230 | rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; | 230 | rd_image_start = boot_params.hdr.ram_size & RAMDISK_IMAGE_START_MASK; |
231 | rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0); | 231 | rd_prompt = ((boot_params.hdr.ram_size & RAMDISK_PROMPT_FLAG) != 0); |
232 | rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0); | 232 | rd_doload = ((boot_params.hdr.ram_size & RAMDISK_LOAD_FLAG) != 0); |
233 | #endif | 233 | #endif |
234 | setup_memory_region(); | 234 | setup_memory_region(); |
235 | copy_edd(); | 235 | copy_edd(); |
236 | 236 | ||
237 | if (!MOUNT_ROOT_RDONLY) | 237 | if (!boot_params.hdr.root_flags) |
238 | root_mountflags &= ~MS_RDONLY; | 238 | root_mountflags &= ~MS_RDONLY; |
239 | init_mm.start_code = (unsigned long) &_text; | 239 | init_mm.start_code = (unsigned long) &_text; |
240 | init_mm.end_code = (unsigned long) &_etext; | 240 | init_mm.end_code = (unsigned long) &_etext; |
@@ -339,17 +339,20 @@ void __init setup_arch(char **cmdline_p) | |||
339 | */ | 339 | */ |
340 | find_smp_config(); | 340 | find_smp_config(); |
341 | #ifdef CONFIG_BLK_DEV_INITRD | 341 | #ifdef CONFIG_BLK_DEV_INITRD |
342 | if (LOADER_TYPE && INITRD_START) { | 342 | if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) { |
343 | if (INITRD_START + INITRD_SIZE <= (end_pfn << PAGE_SHIFT)) { | 343 | unsigned long ramdisk_image = boot_params.hdr.ramdisk_image; |
344 | reserve_bootmem_generic(INITRD_START, INITRD_SIZE); | 344 | unsigned long ramdisk_size = boot_params.hdr.ramdisk_size; |
345 | initrd_start = INITRD_START + PAGE_OFFSET; | 345 | unsigned long ramdisk_end = ramdisk_image + ramdisk_size; |
346 | initrd_end = initrd_start+INITRD_SIZE; | 346 | unsigned long end_of_mem = end_pfn << PAGE_SHIFT; |
347 | } | 347 | |
348 | else { | 348 | if (ramdisk_end <= end_of_mem) { |
349 | reserve_bootmem_generic(ramdisk_image, ramdisk_size); | ||
350 | initrd_start = ramdisk_image + PAGE_OFFSET; | ||
351 | initrd_end = initrd_start+ramdisk_size; | ||
352 | } else { | ||
349 | printk(KERN_ERR "initrd extends beyond end of memory " | 353 | printk(KERN_ERR "initrd extends beyond end of memory " |
350 | "(0x%08lx > 0x%08lx)\ndisabling initrd\n", | 354 | "(0x%08lx > 0x%08lx)\ndisabling initrd\n", |
351 | (unsigned long)(INITRD_START + INITRD_SIZE), | 355 | ramdisk_end, end_of_mem); |
352 | (unsigned long)(end_pfn << PAGE_SHIFT)); | ||
353 | initrd_start = 0; | 356 | initrd_start = 0; |
354 | } | 357 | } |
355 | } | 358 | } |