aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/signal_64.c
diff options
context:
space:
mode:
authorGravatar Christophe Leroy <christophe.leroy@c-s.fr> 2018-11-09 17:33:28 +0000
committerGravatar Michael Ellerman <mpe@ellerman.id.au> 2018-12-19 18:56:32 +1100
commitd16952a629129ce3f20ff7299de87c4d63b27a30 (patch)
tree6d128a99da5bf4783fb9c12c53f9f48a15ea09e2 /arch/powerpc/kernel/signal_64.c
parentpowerpc/8xx: use modify_instruction_site() (diff)
downloadlinux-d16952a629129ce3f20ff7299de87c4d63b27a30.tar.gz
linux-d16952a629129ce3f20ff7299de87c4d63b27a30.tar.bz2
linux-d16952a629129ce3f20ff7299de87c4d63b27a30.zip
powerpc/signal: Use code patching instead of hardcoding
Instead of hardcoding code modifications, use code patching functions. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/signal_64.c')
-rw-r--r--arch/powerpc/kernel/signal_64.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 83d51bf586c7..e53ad11be385 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -598,11 +598,12 @@ static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp)
long err = 0;
/* addi r1, r1, __SIGNAL_FRAMESIZE # Pop the dummy stackframe */
- err |= __put_user(0x38210000UL | (__SIGNAL_FRAMESIZE & 0xffff), &tramp[0]);
+ err |= __put_user(PPC_INST_ADDI | __PPC_RT(R1) | __PPC_RA(R1) |
+ (__SIGNAL_FRAMESIZE & 0xffff), &tramp[0]);
/* li r0, __NR_[rt_]sigreturn| */
- err |= __put_user(0x38000000UL | (syscall & 0xffff), &tramp[1]);
+ err |= __put_user(PPC_INST_ADDI | (syscall & 0xffff), &tramp[1]);
/* sc */
- err |= __put_user(0x44000002UL, &tramp[2]);
+ err |= __put_user(PPC_INST_SC, &tramp[2]);
/* Minimal traceback info */
for (i=TRAMP_TRACEBACK; i < TRAMP_SIZE ;i++)