diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 12:00:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 12:00:30 -0400 |
commit | 5c8e191e8437616a498a8e1cc0af3dd0d32bbff2 (patch) | |
tree | 78ed04467e3bd034eaa9696cdf8d668ba7e16381 /arch/x86/kernel | |
parent | cbfee34520666862f8ff539e580c48958fbb7706 (diff) | |
parent | 3ea335100014785fd2518461705654b200e58d00 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup:
Remove magic macros for screen_info structure members
[x86] remove uses of magic macros for boot_params access
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/e820_64.c | 19 | ||||
-rw-r--r-- | arch/x86/kernel/early_printk.c | 15 | ||||
-rw-r--r-- | arch/x86/kernel/efi_32.c | 15 | ||||
-rw-r--r-- | arch/x86/kernel/head64.c | 20 | ||||
-rw-r--r-- | arch/x86/kernel/setup64.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/setup_32.c | 67 | ||||
-rw-r--r-- | arch/x86/kernel/setup_64.c | 51 |
7 files changed, 95 insertions, 96 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 | ||
30 | struct e820map e820; | 30 | struct 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"); |
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c index fd9aff3f3890..b7d6c23f2871 100644 --- a/arch/x86/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c | |||
@@ -6,15 +6,10 @@ | |||
6 | #include <asm/io.h> | 6 | #include <asm/io.h> |
7 | #include <asm/processor.h> | 7 | #include <asm/processor.h> |
8 | #include <asm/fcntl.h> | 8 | #include <asm/fcntl.h> |
9 | #include <asm/setup.h> | ||
9 | #include <xen/hvc-console.h> | 10 | #include <xen/hvc-console.h> |
10 | 11 | ||
11 | /* Simple VGA output */ | 12 | /* Simple VGA output */ |
12 | |||
13 | #ifdef __i386__ | ||
14 | #include <asm/setup.h> | ||
15 | #else | ||
16 | #include <asm/bootsetup.h> | ||
17 | #endif | ||
18 | #define VGABASE (__ISA_IO_base + 0xb8000) | 13 | #define VGABASE (__ISA_IO_base + 0xb8000) |
19 | 14 | ||
20 | static int max_ypos = 25, max_xpos = 80; | 15 | static int max_ypos = 25, max_xpos = 80; |
@@ -234,10 +229,10 @@ static int __init setup_early_printk(char *buf) | |||
234 | early_serial_init(buf); | 229 | early_serial_init(buf); |
235 | early_console = &early_serial_console; | 230 | early_console = &early_serial_console; |
236 | } else if (!strncmp(buf, "vga", 3) | 231 | } else if (!strncmp(buf, "vga", 3) |
237 | && SCREEN_INFO.orig_video_isVGA == 1) { | 232 | && boot_params.screen_info.orig_video_isVGA == 1) { |
238 | max_xpos = SCREEN_INFO.orig_video_cols; | 233 | max_xpos = boot_params.screen_info.orig_video_cols; |
239 | max_ypos = SCREEN_INFO.orig_video_lines; | 234 | max_ypos = boot_params.screen_info.orig_video_lines; |
240 | current_ypos = SCREEN_INFO.orig_y; | 235 | current_ypos = boot_params.screen_info.orig_y; |
241 | early_console = &early_vga_console; | 236 | early_console = &early_vga_console; |
242 | } else if (!strncmp(buf, "simnow", 6)) { | 237 | } else if (!strncmp(buf, "simnow", 6)) { |
243 | simnow_init(buf + 6); | 238 | simnow_init(buf + 6); |
diff --git a/arch/x86/kernel/efi_32.c b/arch/x86/kernel/efi_32.c index 2452c6fbe992..b42558c48e9d 100644 --- a/arch/x86/kernel/efi_32.c +++ b/arch/x86/kernel/efi_32.c | |||
@@ -331,11 +331,13 @@ void __init efi_init(void) | |||
331 | memset(&efi, 0, sizeof(efi) ); | 331 | memset(&efi, 0, sizeof(efi) ); |
332 | memset(&efi_phys, 0, sizeof(efi_phys)); | 332 | memset(&efi_phys, 0, sizeof(efi_phys)); |
333 | 333 | ||
334 | efi_phys.systab = EFI_SYSTAB; | 334 | efi_phys.systab = |
335 | memmap.phys_map = EFI_MEMMAP; | 335 | (efi_system_table_t *)boot_params.efi_info.efi_systab; |
336 | memmap.nr_map = EFI_MEMMAP_SIZE/EFI_MEMDESC_SIZE; | 336 | memmap.phys_map = (void *)boot_params.efi_info.efi_memmap; |
337 | memmap.desc_version = EFI_MEMDESC_VERSION; | 337 | memmap.nr_map = boot_params.efi_info.efi_memmap_size/ |
338 | memmap.desc_size = EFI_MEMDESC_SIZE; | 338 | boot_params.efi_info.efi_memdesc_size; |
339 | memmap.desc_version = boot_params.efi_info.efi_memdesc_version; | ||
340 | memmap.desc_size = boot_params.efi_info.efi_memdesc_size; | ||
339 | 341 | ||
340 | efi.systab = (efi_system_table_t *) | 342 | efi.systab = (efi_system_table_t *) |
341 | boot_ioremap((unsigned long) efi_phys.systab, | 343 | boot_ioremap((unsigned long) efi_phys.systab, |
@@ -446,7 +448,8 @@ void __init efi_init(void) | |||
446 | printk(KERN_ERR PFX "Could not map the runtime service table!\n"); | 448 | printk(KERN_ERR PFX "Could not map the runtime service table!\n"); |
447 | 449 | ||
448 | /* Map the EFI memory map for use until paging_init() */ | 450 | /* Map the EFI memory map for use until paging_init() */ |
449 | memmap.map = boot_ioremap((unsigned long) EFI_MEMMAP, EFI_MEMMAP_SIZE); | 451 | memmap.map = boot_ioremap(boot_params.efi_info.efi_memmap, |
452 | boot_params.efi_info.efi_memmap_size); | ||
450 | if (memmap.map == NULL) | 453 | if (memmap.map == NULL) |
451 | printk(KERN_ERR PFX "Could not map the EFI memory map!\n"); | 454 | printk(KERN_ERR PFX "Could not map the EFI memory map!\n"); |
452 | 455 | ||
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 8561f626edad..a7eee0a4751d 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
15 | #include <asm/proto.h> | 15 | #include <asm/proto.h> |
16 | #include <asm/smp.h> | 16 | #include <asm/smp.h> |
17 | #include <asm/bootsetup.h> | ||
18 | #include <asm/setup.h> | 17 | #include <asm/setup.h> |
19 | #include <asm/desc.h> | 18 | #include <asm/desc.h> |
20 | #include <asm/pgtable.h> | 19 | #include <asm/pgtable.h> |
@@ -36,26 +35,15 @@ static void __init clear_bss(void) | |||
36 | (unsigned long) __bss_stop - (unsigned long) __bss_start); | 35 | (unsigned long) __bss_stop - (unsigned long) __bss_start); |
37 | } | 36 | } |
38 | 37 | ||
39 | #define NEW_CL_POINTER 0x228 /* Relative to real mode data */ | ||
40 | #define OLD_CL_MAGIC_ADDR 0x20 | ||
41 | #define OLD_CL_MAGIC 0xA33F | ||
42 | #define OLD_CL_OFFSET 0x22 | ||
43 | |||
44 | static void __init copy_bootdata(char *real_mode_data) | 38 | static void __init copy_bootdata(char *real_mode_data) |
45 | { | 39 | { |
46 | unsigned long new_data; | ||
47 | char * command_line; | 40 | char * command_line; |
48 | 41 | ||
49 | memcpy(x86_boot_params, real_mode_data, BOOT_PARAM_SIZE); | 42 | memcpy(&boot_params, real_mode_data, sizeof boot_params); |
50 | new_data = *(u32 *) (x86_boot_params + NEW_CL_POINTER); | 43 | if (boot_params.hdr.cmd_line_ptr) { |
51 | if (!new_data) { | 44 | command_line = __va(boot_params.hdr.cmd_line_ptr); |
52 | if (OLD_CL_MAGIC != *(u16 *)(real_mode_data + OLD_CL_MAGIC_ADDR)) { | 45 | memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); |
53 | return; | ||
54 | } | ||
55 | new_data = __pa(real_mode_data) + *(u16 *)(real_mode_data + OLD_CL_OFFSET); | ||
56 | } | 46 | } |
57 | command_line = __va(new_data); | ||
58 | memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); | ||
59 | } | 47 | } |
60 | 48 | ||
61 | void __init x86_64_start_kernel(char * real_mode_data) | 49 | void __init x86_64_start_kernel(char * real_mode_data) |
diff --git a/arch/x86/kernel/setup64.c b/arch/x86/kernel/setup64.c index 1200aaac403e..ba9188235057 100644 --- a/arch/x86/kernel/setup64.c +++ b/arch/x86/kernel/setup64.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
12 | #include <linux/bitops.h> | 12 | #include <linux/bitops.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <asm/bootsetup.h> | ||
15 | #include <asm/pda.h> | 14 | #include <asm/pda.h> |
16 | #include <asm/pgtable.h> | 15 | #include <asm/pgtable.h> |
17 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
@@ -23,8 +22,9 @@ | |||
23 | #include <asm/percpu.h> | 22 | #include <asm/percpu.h> |
24 | #include <asm/proto.h> | 23 | #include <asm/proto.h> |
25 | #include <asm/sections.h> | 24 | #include <asm/sections.h> |
25 | #include <asm/setup.h> | ||
26 | 26 | ||
27 | char x86_boot_params[BOOT_PARAM_SIZE] __initdata; | 27 | struct boot_params __initdata boot_params; |
28 | 28 | ||
29 | cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE; | 29 | cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE; |
30 | 30 | ||
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 | */ |
138 | static inline void copy_edd(void) | 138 | static 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 |
146 | static inline void copy_edd(void) | 147 | static 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; |
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 | } |