aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/machine_kexec.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-03-18 04:49:45 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-03-18 05:44:32 -0400
commite4e063d0c288bd65c56dd855337780a541ed928d (patch)
tree88ac50d334c002a60861d92afc5a849b8e26b48f /arch/sh/kernel/machine_kexec.c
parent7be5c55af0cc58e54e42e1702d837527e15b8414 (diff)
sh: rework kexec segment code
Rework the kexec code to avoid using P2SEG. Instead we walk the page list in machine_kexec() and convert the addresses from physical to virtual using C. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/machine_kexec.c')
-rw-r--r--arch/sh/kernel/machine_kexec.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index d3318f99256b..25b4748fdc7b 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -76,6 +76,21 @@ void machine_kexec(struct kimage *image)
76 unsigned long page_list; 76 unsigned long page_list;
77 unsigned long reboot_code_buffer; 77 unsigned long reboot_code_buffer;
78 relocate_new_kernel_t rnk; 78 relocate_new_kernel_t rnk;
79 unsigned long entry;
80 unsigned long *ptr;
81
82 /*
83 * Nicked from the mips version of machine_kexec():
84 * The generic kexec code builds a page list with physical
85 * addresses. Use phys_to_virt() to convert them to virtual.
86 */
87 for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE);
88 ptr = (entry & IND_INDIRECTION) ?
89 phys_to_virt(entry & PAGE_MASK) : ptr + 1) {
90 if (*ptr & IND_SOURCE || *ptr & IND_INDIRECTION ||
91 *ptr & IND_DESTINATION)
92 *ptr = (unsigned long) phys_to_virt(*ptr);
93 }
79 94
80 /* Interrupts aren't acceptable while we reboot */ 95 /* Interrupts aren't acceptable while we reboot */
81 local_irq_disable(); 96 local_irq_disable();
@@ -101,7 +116,7 @@ void machine_kexec(struct kimage *image)
101#endif 116#endif
102 /* now call it */ 117 /* now call it */
103 rnk = (relocate_new_kernel_t) reboot_code_buffer; 118 rnk = (relocate_new_kernel_t) reboot_code_buffer;
104 (*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start)); 119 (*rnk)(page_list, reboot_code_buffer, image->start);
105} 120}
106 121
107void arch_crash_save_vmcoreinfo(void) 122void arch_crash_save_vmcoreinfo(void)