lkml.org 
[lkml]   [2018]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] asm-generic/ptrace.h: add a comment about frame_pointer
I have been misled by comments in asm-generic/ptrace.h into thinking
that frame_pointer() is universally available across architectures,
which resulted in a wrong design decision.

Add a comment about frame_pointer in a hope that it will help others
to avoid this mistake in the future.

Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
include/asm-generic/ptrace.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/include/asm-generic/ptrace.h b/include/asm-generic/ptrace.h
index 82e674f6b337..3186c30bd50d 100644
--- a/include/asm-generic/ptrace.h
+++ b/include/asm-generic/ptrace.h
@@ -59,6 +59,10 @@ static inline void user_stack_pointer_set(struct pt_regs *regs,
#define SET_FP(regs, val) (GET_FP(regs) = (val))
#endif

+/*
+ * Unlike instruction_pointer and user_stack_pointer,
+ * frame_pointer is not universally available across architectures.
+ */
static inline unsigned long frame_pointer(struct pt_regs *regs)
{
return GET_FP(regs);
--
ldv
\
 
 \ /
  Last update: 2018-12-10 22:32    [W:0.018 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site