Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133344
b: refs/heads/master
c: e4e063d
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Mar 18, 2009
1 parent 22dcde8 commit ef25d9c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7be5c55af0cc58e54e42e1702d837527e15b8414
refs/heads/master: e4e063d0c288bd65c56dd855337780a541ed928d
17 changes: 16 additions & 1 deletion trunk/arch/sh/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions trunk/arch/sh/kernel/relocate_kernel.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -85,8 +83,6 @@ relocate_new_kernel:
.align 2
10:
.long PAGE_SIZE
11:
.long P2SEG

relocate_new_kernel_end:

Expand Down

0 comments on commit ef25d9c

Please sign in to comment.