linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: add architecture specified current_pt_regs
@ 2016-02-18 11:48 Zhi-zhou Zhang
  2016-02-18 11:58 ` Catalin Marinas
  0 siblings, 1 reply; 5+ messages in thread
From: Zhi-zhou Zhang @ 2016-02-18 11:48 UTC (permalink / raw)
  To: robin.murphy, catalin.marinas, will.deacon
  Cc: linux-arm-kernel, linux-kernel, zhizhou

From: zhizhou <zhizhou.zh@gmail.com>

This patch is based on the implementation of arm. The generic
current_pt_regs is implemented with current->stack. It need to access
memory that would be too expensive.

Signed-off-by: zhizhou <zhizhou.zh@gmail.com>
---
 arch/arm64/include/asm/ptrace.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
index e9e5467..1865d54 100644
--- a/arch/arm64/include/asm/ptrace.h
+++ b/arch/arm64/include/asm/ptrace.h
@@ -185,5 +185,9 @@ static inline int valid_user_regs(struct user_pt_regs *regs)
 
 extern unsigned long profile_pc(struct pt_regs *regs);
 
+#define current_pt_regs(void) ({ (struct pt_regs *)			\
+	((current_stack_pointer | (THREAD_SIZE - 1)) - 0xf) - 1;	\
+})
+
 #endif /* __ASSEMBLY__ */
 #endif
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-19 12:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 11:48 [PATCH] arm64: add architecture specified current_pt_regs Zhi-zhou Zhang
2016-02-18 11:58 ` Catalin Marinas
2016-02-19  2:30   ` Zhi-zhou
2016-02-19 10:32     ` Will Deacon
2016-02-19 12:01       ` Zhizhou Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).