From: Zhi-zhou Zhang <zhizhou.zh@gmail.com>
To: robin.murphy@arm.com, catalin.marinas@arm.com, will.deacon@arm.com
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, zhizhou <zhizhou.zh@gmail.com>
Subject: [PATCH] arm64: add architecture specified current_pt_regs
Date: Thu, 18 Feb 2016 19:48:35 +0800 [thread overview]
Message-ID: <1455796115-7844-1-git-send-email-zhizhou.zh@gmail.com> (raw)
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
next reply other threads:[~2016-02-18 11:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-18 11:48 Zhi-zhou Zhang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455796115-7844-1-git-send-email-zhizhou.zh@gmail.com \
--to=zhizhou.zh@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®