]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
sh: rework kexec segment code
authorMagnus Damm <damm@igel.co.jp>
Wed, 18 Mar 2009 08:49:45 +0000 (08:49 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 18 Mar 2009 09:44:32 +0000 (18:44 +0900)
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>
arch/sh/kernel/machine_kexec.c
arch/sh/kernel/relocate_kernel.S

index d3318f99256b3ae8c8ad32ca5dff773fbb7feb7b..25b4748fdc7bb4e1b40ebcc988d5546ff28a80ad 100644 (file)
@@ -76,6 +76,21 @@ void machine_kexec(struct kimage *image)
        unsigned long page_list;
        unsigned long reboot_code_buffer;
        relocate_new_kernel_t rnk;
+       unsigned long entry;
+       unsigned long *ptr;
+
+       /*
+        * Nicked from the mips version of machine_kexec():
+        * The generic kexec code builds a page list with physical
+        * addresses. Use phys_to_virt() to convert them to virtual.
+        */
+       for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE);
+            ptr = (entry & IND_INDIRECTION) ?
+              phys_to_virt(entry & PAGE_MASK) : ptr + 1) {
+               if (*ptr & IND_SOURCE || *ptr & IND_INDIRECTION ||
+                   *ptr & IND_DESTINATION)
+                       *ptr = (unsigned long) phys_to_virt(*ptr);
+       }
 
        /* Interrupts aren't acceptable while we reboot */
        local_irq_disable();
@@ -101,7 +116,7 @@ void machine_kexec(struct kimage *image)
 #endif
        /* now call it */
        rnk = (relocate_new_kernel_t) reboot_code_buffer;
-       (*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start));
+       (*rnk)(page_list, reboot_code_buffer, image->start);
 }
 
 void arch_crash_save_vmcoreinfo(void)
index 8b50b2c873a4e38a1269564025c5ae523ed281cb..2a6630be668c769f4d6da99e68a1f643d686bd7a 100644 (file)
@@ -18,7 +18,6 @@ relocate_new_kernel:
        /* r6 = start_address      */
 
        mov.l   10f,r8    /* PAGE_SIZE */
-       mov.l   11f,r9    /* P2SEG */
 
        /*  stack setting */
        add     r8,r5
@@ -29,9 +28,8 @@ relocate_new_kernel:
 0:
        mov.l   @r4+,r0   /* cmd = *ind++ */
 
-1:     /* addr = (cmd | P2SEG) & 0xfffffff0 */
+1:     /* addr = cmd & 0xfffffff0 */
        mov     r0,r2
-       or      r9,r2
        mov     #-16,r1
        and     r1,r2
 
@@ -85,8 +83,6 @@ relocate_new_kernel:
        .align 2
 10:
        .long   PAGE_SIZE
-11:
-       .long   P2SEG
 
 relocate_new_kernel_end: