Thread (3 messages) 3 messages, 2 authors, 2021-06-26

[PATCH 1/2] powerpc/ptrace: Move set_return_regs_changed() before regs_set_return_{msr/ip}

flat view
STALE1937d LANDED

From: Christophe Leroy <hidden>
Date: 2021-06-25 11:13:21
Also in: lkml
Subsystem: linux for powerpc (32-bit and 64-bit), ptrace support, the rest · Maintainers: Madhavan Srinivasan, Oleg Nesterov, Linus Torvalds

Landed in mainline as 5f0f95f1e1b6 on 2021-06-25.

regs_set_return_msr() and regs_set_return_ip() have a copy
of the code of set_return_regs_changed().

Move up set_return_regs_changed() so it can be reused by
regs_set_return_{msr/ip}

Signed-off-by: Christophe Leroy <redacted>
---
 arch/powerpc/include/asm/ptrace.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index fcf63f559344..14b8105a1e27 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -135,26 +135,26 @@ extern unsigned long profile_pc(struct pt_regs *regs);
 long do_syscall_trace_enter(struct pt_regs *regs);
 void do_syscall_trace_leave(struct pt_regs *regs);
 
-static inline void regs_set_return_ip(struct pt_regs *regs, unsigned long ip)
+static inline void set_return_regs_changed(void)
 {
-	regs->nip = ip;
 #ifdef CONFIG_PPC_BOOK3S_64
 	local_paca->hsrr_valid = 0;
 	local_paca->srr_valid = 0;
 #endif
 }
 
-static inline void regs_set_return_msr(struct pt_regs *regs, unsigned long msr)
+static inline void regs_set_return_ip(struct pt_regs *regs, unsigned long ip)
 {
-	regs->msr = msr;
+	regs->nip = ip;
 #ifdef CONFIG_PPC_BOOK3S_64
 	local_paca->hsrr_valid = 0;
 	local_paca->srr_valid = 0;
 #endif
 }
 
-static inline void set_return_regs_changed(void)
+static inline void regs_set_return_msr(struct pt_regs *regs, unsigned long msr)
 {
+	regs->msr = msr;
 #ifdef CONFIG_PPC_BOOK3S_64
 	local_paca->hsrr_valid = 0;
 	local_paca->srr_valid = 0;
-- 
2.25.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help