X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/ms2-kexec/blobdiff_plain/4e93cb000786b18ffd9929f33055cad2a7cebbcf..564905afa42095ac74577634db65f902f2533c31:/kexec.c?ds=sidebyside diff --git a/kexec.c b/kexec.c index 8a437da..e7ea604 100644 --- a/kexec.c +++ b/kexec.c @@ -1140,7 +1140,7 @@ void crash_save_cpu(struct pt_regs *regs, int cpu) return; memset(&prstatus, 0, sizeof(prstatus)); prstatus.pr_pid = current->pid; - elf_core_copy_regs(&prstatus.pr_reg, regs); + elf_core_copy_kernel_regs(&prstatus.pr_reg, regs); buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS, &prstatus, sizeof(prstatus)); final_note(buf); @@ -1224,7 +1224,7 @@ static int __init parse_crashkernel_mem(char *cmdline, } while (*cur++ == ','); if (*crash_size > 0) { - while (*cur != ' ' && *cur != '@') + while (*cur && *cur != ' ' && *cur != '@') cur++; if (*cur == '@') { cur++; @@ -1383,29 +1383,27 @@ int kernel_kexec(void) goto Restore_console; } suspend_console(); - error = device_suspend(PMSG_FREEZE); + error = dpm_suspend_start(PMSG_FREEZE); if (error) goto Resume_console; - error = disable_nonboot_cpus(); - if (error) - goto Resume_devices; - device_pm_lock(); - local_irq_disable(); - /* At this point, device_suspend() has been called, - * but *not* device_power_down(). We *must* - * device_power_down() now. Otherwise, drivers for + /* At this point, dpm_suspend_start() has been called, + * but *not* dpm_suspend_noirq(). We *must* call + * dpm_suspend_noirq() now. Otherwise, drivers for * some devices (e.g. interrupt controllers) become * desynchronized with the actual state of the * hardware at resume time, and evil weirdness ensues. */ - error = device_power_down(PMSG_FREEZE); + error = dpm_suspend_noirq(PMSG_FREEZE); if (error) - goto Enable_irqs; - + goto Resume_devices; + error = disable_nonboot_cpus(); + if (error) + goto Enable_cpus; + local_irq_disable(); /* Suspend system devices */ error = sysdev_suspend(PMSG_FREEZE); if (error) - goto Power_up_devices; + goto Enable_irqs; } else #endif { @@ -1419,14 +1417,13 @@ int kernel_kexec(void) #ifdef CONFIG_KEXEC_JUMP if (kexec_image->preserve_context) { sysdev_resume(); - Power_up_devices: - device_power_up(PMSG_RESTORE); Enable_irqs: local_irq_enable(); - device_pm_unlock(); + Enable_cpus: enable_nonboot_cpus(); + dpm_resume_noirq(PMSG_RESTORE); Resume_devices: - device_resume(PMSG_RESTORE); + dpm_resume_end(PMSG_RESTORE); Resume_console: resume_console(); thaw_processes(); @@ -1459,13 +1456,17 @@ unsigned long **find_sys_call_table(void) { static int __init kexec_module_init(void) { -// sys_call_table=(void **)find_sys_call_table(); -// if(sys_call_table==NULL) { -// printk(KERN_ERR "Cannot find the system call address\n"); -// return -1; // do not load -// } + sys_call_table=(void **)find_sys_call_table(); + if(sys_call_table==NULL) { + printk(KERN_ERR "Cannot find the system call address\n"); + return -1; // do not load + } + + printk(KERN_INFO "kexec: Found sys_call_table at: %p\n", sys_call_table); - sys_call_table=(void **)0xc003d004; + //sys_call_table=(void **)0xc003d004; + sys_call_table=(void **)0xc00350c4; + printk(KERN_INFO "kexec: Force sys_call_table at: %p\n", sys_call_table); /* Set kexec_load() syscall. */ sys_call_table[__NR_kexec_load]=kexec_load;