diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/powerpc/lib/code-patching.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'arch/powerpc/lib/code-patching.c')
-rw-r--r-- | arch/powerpc/lib/code-patching.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index 17e5b236431..7c975d43e3f 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c | |||
@@ -13,23 +13,17 @@ | |||
13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
14 | #include <asm/page.h> | 14 | #include <asm/page.h> |
15 | #include <asm/code-patching.h> | 15 | #include <asm/code-patching.h> |
16 | #include <asm/uaccess.h> | ||
17 | 16 | ||
18 | 17 | ||
19 | int patch_instruction(unsigned int *addr, unsigned int instr) | 18 | void patch_instruction(unsigned int *addr, unsigned int instr) |
20 | { | 19 | { |
21 | int err; | 20 | *addr = instr; |
22 | |||
23 | __put_user_size(instr, addr, 4, err); | ||
24 | if (err) | ||
25 | return err; | ||
26 | asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); | 21 | asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); |
27 | return 0; | ||
28 | } | 22 | } |
29 | 23 | ||
30 | int patch_branch(unsigned int *addr, unsigned long target, int flags) | 24 | void patch_branch(unsigned int *addr, unsigned long target, int flags) |
31 | { | 25 | { |
32 | return patch_instruction(addr, create_branch(addr, target, flags)); | 26 | patch_instruction(addr, create_branch(addr, target, flags)); |
33 | } | 27 | } |
34 | 28 | ||
35 | unsigned int create_branch(const unsigned int *addr, | 29 | unsigned int create_branch(const unsigned int *addr, |