[PATCH] ptrace: Mark PTRACE_{PEEK,POKE}USR as deprecated for new ports

Palmer Dabbelt posted 1 patch 3 years, 6 months ago
include/uapi/linux/ptrace.h | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
[PATCH] ptrace: Mark PTRACE_{PEEK,POKE}USR as deprecated for new ports
Posted by Palmer Dabbelt 3 years, 6 months ago
From: Palmer Dabbelt <palmer@rivosinc.com>

Folks keep submitting implementations of these for RISC-V.  As far as I
understand they're not meant to be implemented in new ports, this adds a
comment to make that more explicit.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
---
 include/uapi/linux/ptrace.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h
index 195ae64a8c87..38201ebec276 100644
--- a/include/uapi/linux/ptrace.h
+++ b/include/uapi/linux/ptrace.h
@@ -11,14 +11,19 @@
 #define PTRACE_TRACEME		   0
 #define PTRACE_PEEKTEXT		   1
 #define PTRACE_PEEKDATA		   2
-#define PTRACE_PEEKUSR		   3
 #define PTRACE_POKETEXT		   4
 #define PTRACE_POKEDATA		   5
-#define PTRACE_POKEUSR		   6
 #define PTRACE_CONT		   7
 #define PTRACE_KILL		   8
 #define PTRACE_SINGLESTEP	   9
 
+/*
+ * These are deprecated for new ports in favor of PTRACE_{GET,SET}REGSET, which
+ * support accessing multiple CPU registers in a single syscall.
+ */
+#define PTRACE_PEEKUSR		   3
+#define PTRACE_POKEUSR		   6
+
 #define PTRACE_ATTACH		  16
 #define PTRACE_DETACH		  17
 
-- 
2.34.1