diff options
Diffstat (limited to 'kexec/arch/i386/kexec-x86.c')
-rw-r--r-- | kexec/arch/i386/kexec-x86.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/kexec/arch/i386/kexec-x86.c b/kexec/arch/i386/kexec-x86.c index 89ccb0b..31e4752 100644 --- a/kexec/arch/i386/kexec-x86.c +++ b/kexec/arch/i386/kexec-x86.c @@ -44,7 +44,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges, FILE *fp; fp = fopen(iomem, "r"); if (!fp) { - fprintf(stderr, "Cannot open %s: %s\n", + fprintf(stderr, "Cannot open %s: %s\n", iomem, strerror(errno)); return -1; } @@ -58,7 +58,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges, break; count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed); - if (count != 2) + if (count != 2) continue; str = line + consumed; end = end + 1; @@ -68,7 +68,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges, #endif if (memcmp(str, "System RAM\n", 11) == 0) { type = RANGE_RAM; - } + } else if (memcmp(str, "reserved\n", 9) == 0) { type = RANGE_RESERVED; } @@ -115,7 +115,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges, } struct file_type file_type[] = { - { "multiboot-x86", multiboot_x86_probe, multiboot_x86_load, + { "multiboot-x86", multiboot_x86_probe, multiboot_x86_load, multiboot_x86_usage }, { "elf-x86", elf_x86_probe, elf_x86_load, elf_x86_usage }, { "bzImage", bzImage_probe, bzImage_load, bzImage_usage }, @@ -187,24 +187,24 @@ int arch_process_options(int argc, char **argv) } } if (value >= 65536) { - fprintf(stderr, "Bad serial port base '%s'\n", + fprintf(stderr, "Bad serial port base '%s'\n", optarg); usage(); return -1; - + } arch_options.serial_base = value; break; case OPT_SERIAL_BAUD: value = strtoul(optarg, &end, 0); - if ((value > 115200) || ((115200 %value) != 0) || - (value < 9600) || (*end)) + if ((value > 115200) || ((115200 %value) != 0) || + (value < 9600) || (*end)) { fprintf(stderr, "Bad serial port baud rate '%s'\n", optarg); usage(); return -1; - + } arch_options.serial_baud = value; break; @@ -239,13 +239,13 @@ int arch_compat_trampoline(struct kexec_info *info) if ((info->kexec_flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_X86_64) { if (!info->rhdr.e_shdr) { - fprintf(stderr, + fprintf(stderr, "A trampoline is required for cross architecture support\n"); return -1; } elf_rel_set_symbol(&info->rhdr, "compat_x86_64_entry32", &info->entry, sizeof(info->entry)); - + info->entry = (void *)elf_rel_get_addr(&info->rhdr, "compat_x86_64"); } return 0; @@ -259,11 +259,11 @@ void arch_update_purgatory(struct kexec_info *info) &arch_options.reset_vga, sizeof(arch_options.reset_vga)); elf_rel_set_symbol(&info->rhdr, "serial_base", &arch_options.serial_base, sizeof(arch_options.serial_base)); - elf_rel_set_symbol(&info->rhdr, "serial_baud", + elf_rel_set_symbol(&info->rhdr, "serial_baud", &arch_options.serial_baud, sizeof(arch_options.serial_baud)); - elf_rel_set_symbol(&info->rhdr, "console_vga", + elf_rel_set_symbol(&info->rhdr, "console_vga", &arch_options.console_vga, sizeof(arch_options.console_vga)); - elf_rel_set_symbol(&info->rhdr, "console_serial", + elf_rel_set_symbol(&info->rhdr, "console_serial", &arch_options.console_serial, sizeof(arch_options.console_serial)); if (info->kexec_flags & KEXEC_ON_CRASH) { panic_kernel = 1; |