aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_32.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/setup_32.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/setup_32.c')
-rw-r--r--arch/x86/kernel/setup_32.c67
1 files changed, 36 insertions, 31 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index c8e1bc38d421..b87a6fd5ba48 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -137,10 +137,11 @@ EXPORT_SYMBOL(edd);
137 */ 137 */
138static inline void copy_edd(void) 138static inline void copy_edd(void)
139{ 139{
140 memcpy(edd.mbr_signature, EDD_MBR_SIGNATURE, sizeof(edd.mbr_signature)); 140 memcpy(edd.mbr_signature, boot_params.edd_mbr_sig_buffer,
141 memcpy(edd.edd_info, EDD_BUF, sizeof(edd.edd_info)); 141 sizeof(edd.mbr_signature));
142 edd.mbr_signature_nr = EDD_MBR_SIG_NR; 142 memcpy(edd.edd_info, boot_params.eddbuf, sizeof(edd.edd_info));
143 edd.edd_info_nr = EDD_NR; 143 edd.mbr_signature_nr = boot_params.edd_mbr_sig_buf_entries;
144 edd.edd_info_nr = boot_params.eddbuf_entries;
144} 145}
145#else 146#else
146static inline void copy_edd(void) 147static inline void copy_edd(void)
@@ -434,17 +435,20 @@ void __init setup_bootmem_allocator(void)
434#endif 435#endif
435 numa_kva_reserve(); 436 numa_kva_reserve();
436#ifdef CONFIG_BLK_DEV_INITRD 437#ifdef CONFIG_BLK_DEV_INITRD
437 if (LOADER_TYPE && INITRD_START) { 438 if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
438 if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) { 439 unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
439 reserve_bootmem(INITRD_START, INITRD_SIZE); 440 unsigned long ramdisk_size = boot_params.hdr.ramdisk_size;
440 initrd_start = INITRD_START + PAGE_OFFSET; 441 unsigned long ramdisk_end = ramdisk_image + ramdisk_size;
441 initrd_end = initrd_start+INITRD_SIZE; 442 unsigned long end_of_lowmem = max_low_pfn << PAGE_SHIFT;
442 } 443
443 else { 444 if (ramdisk_end <= end_of_lowmem) {
445 reserve_bootmem(ramdisk_image, ramdisk_size);
446 initrd_start = ramdisk_image + PAGE_OFFSET;
447 initrd_end = initrd_start+ramdisk_size;
448 } else {
444 printk(KERN_ERR "initrd extends beyond end of memory " 449 printk(KERN_ERR "initrd extends beyond end of memory "
445 "(0x%08lx > 0x%08lx)\ndisabling initrd\n", 450 "(0x%08lx > 0x%08lx)\ndisabling initrd\n",
446 INITRD_START + INITRD_SIZE, 451 ramdisk_end, end_of_lowmem);
447 max_low_pfn << PAGE_SHIFT);
448 initrd_start = 0; 452 initrd_start = 0;
449 } 453 }
450 } 454 }
@@ -512,28 +516,29 @@ void __init setup_arch(char **cmdline_p)
512 * the system table is valid. If not, then initialize normally. 516 * the system table is valid. If not, then initialize normally.
513 */ 517 */
514#ifdef CONFIG_EFI 518#ifdef CONFIG_EFI
515 if ((LOADER_TYPE == 0x50) && EFI_SYSTAB) 519 if ((boot_params.hdr.type_of_loader == 0x50) &&
520 boot_params.efi_info.efi_systab)
516 efi_enabled = 1; 521 efi_enabled = 1;
517#endif 522#endif
518 523
519 ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); 524 ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
520 screen_info = SCREEN_INFO; 525 screen_info = boot_params.screen_info;
521 edid_info = EDID_INFO; 526 edid_info = boot_params.edid_info;
522 apm_info.bios = APM_BIOS_INFO; 527 apm_info.bios = boot_params.apm_bios_info;
523 ist_info = IST_INFO; 528 ist_info = boot_params.ist_info;
524 saved_videomode = VIDEO_MODE; 529 saved_videomode = boot_params.hdr.vid_mode;
525 if( SYS_DESC_TABLE.length != 0 ) { 530 if( boot_params.sys_desc_table.length != 0 ) {
526 set_mca_bus(SYS_DESC_TABLE.table[3] & 0x2); 531 set_mca_bus(boot_params.sys_desc_table.table[3] & 0x2);
527 machine_id = SYS_DESC_TABLE.table[0]; 532 machine_id = boot_params.sys_desc_table.table[0];
528 machine_submodel_id = SYS_DESC_TABLE.table[1]; 533 machine_submodel_id = boot_params.sys_desc_table.table[1];
529 BIOS_revision = SYS_DESC_TABLE.table[2]; 534 BIOS_revision = boot_params.sys_desc_table.table[2];
530 } 535 }
531 bootloader_type = LOADER_TYPE; 536 bootloader_type = boot_params.hdr.type_of_loader;
532 537
533#ifdef CONFIG_BLK_DEV_RAM 538#ifdef CONFIG_BLK_DEV_RAM
534 rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; 539 rd_image_start = boot_params.hdr.ram_size & RAMDISK_IMAGE_START_MASK;
535 rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0); 540 rd_prompt = ((boot_params.hdr.ram_size & RAMDISK_PROMPT_FLAG) != 0);
536 rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0); 541 rd_doload = ((boot_params.hdr.ram_size & RAMDISK_LOAD_FLAG) != 0);
537#endif 542#endif
538 ARCH_SETUP 543 ARCH_SETUP
539 if (efi_enabled) 544 if (efi_enabled)
@@ -545,7 +550,7 @@ void __init setup_arch(char **cmdline_p)
545 550
546 copy_edd(); 551 copy_edd();
547 552
548 if (!MOUNT_ROOT_RDONLY) 553 if (!boot_params.hdr.root_flags)
549 root_mountflags &= ~MS_RDONLY; 554 root_mountflags &= ~MS_RDONLY;
550 init_mm.start_code = (unsigned long) _text; 555 init_mm.start_code = (unsigned long) _text;
551 init_mm.end_code = (unsigned long) _etext; 556 init_mm.end_code = (unsigned long) _etext;