diff options
Diffstat (limited to 'arch/powerpc/kernel/crash_dump.c')
-rw-r--r-- | arch/powerpc/kernel/crash_dump.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c index 9ee3c5278db0..e0debcca0bfa 100644 --- a/arch/powerpc/kernel/crash_dump.c +++ b/arch/powerpc/kernel/crash_dump.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/crash_dump.h> | 14 | #include <linux/crash_dump.h> |
15 | #include <linux/bootmem.h> | 15 | #include <linux/bootmem.h> |
16 | #include <linux/lmb.h> | 16 | #include <linux/lmb.h> |
17 | #include <asm/code-patching.h> | ||
17 | #include <asm/kdump.h> | 18 | #include <asm/kdump.h> |
18 | #include <asm/prom.h> | 19 | #include <asm/prom.h> |
19 | #include <asm/firmware.h> | 20 | #include <asm/firmware.h> |
@@ -33,6 +34,8 @@ void __init reserve_kdump_trampoline(void) | |||
33 | 34 | ||
34 | static void __init create_trampoline(unsigned long addr) | 35 | static void __init create_trampoline(unsigned long addr) |
35 | { | 36 | { |
37 | unsigned int *p = (unsigned int *)addr; | ||
38 | |||
36 | /* The maximum range of a single instruction branch, is the current | 39 | /* The maximum range of a single instruction branch, is the current |
37 | * instruction's address + (32 MB - 4) bytes. For the trampoline we | 40 | * instruction's address + (32 MB - 4) bytes. For the trampoline we |
38 | * need to branch to current address + 32 MB. So we insert a nop at | 41 | * need to branch to current address + 32 MB. So we insert a nop at |
@@ -41,8 +44,8 @@ static void __init create_trampoline(unsigned long addr) | |||
41 | * branch to "addr" we jump to ("addr" + 32 MB). Although it requires | 44 | * branch to "addr" we jump to ("addr" + 32 MB). Although it requires |
42 | * two instructions it doesn't require any registers. | 45 | * two instructions it doesn't require any registers. |
43 | */ | 46 | */ |
44 | create_instruction(addr, 0x60000000); /* nop */ | 47 | patch_instruction(p, PPC_NOP_INSTR); |
45 | create_branch(addr + 4, addr + PHYSICAL_START, 0); | 48 | patch_branch(++p, addr + PHYSICAL_START, 0); |
46 | } | 49 | } |
47 | 50 | ||
48 | void __init setup_kdump_trampoline(void) | 51 | void __init setup_kdump_trampoline(void) |