svn commit: r235559 - in stable/9/sys/amd64: amd64 include

John Baldwin jhb at FreeBSD.org
Thu May 17 19:01:14 UTC 2012


Author: jhb
Date: Thu May 17 19:01:13 2012
New Revision: 235559
URL: http://svn.freebsd.org/changeset/base/235559

Log:
  Partial MFC of 232520:
  For amd64 PT_GETXSTATE and PT_SETXSTATE have been redefined to match the
  i386 values. The old values are still supported but should no longer be
  used.

Modified:
  stable/9/sys/amd64/amd64/ptrace_machdep.c
  stable/9/sys/amd64/include/ptrace.h

Modified: stable/9/sys/amd64/amd64/ptrace_machdep.c
==============================================================================
--- stable/9/sys/amd64/amd64/ptrace_machdep.c	Thu May 17 18:40:27 2012	(r235558)
+++ stable/9/sys/amd64/amd64/ptrace_machdep.c	Thu May 17 19:01:13 2012	(r235559)
@@ -126,6 +126,12 @@ cpu_ptrace(struct thread *td, int req, v
 		return (cpu32_ptrace(td, req, addr, data));
 #endif
 
+	/* Support old values of PT_GETXSTATE and PT_SETXSTATE. */
+	if (req == PT_FIRSTMACH + 0)
+		req = PT_GETXSTATE;
+	if (req == PT_FIRSTMACH + 1)
+		req = PT_SETXSTATE;
+
 	switch (req) {
 	case PT_GETXSTATE:
 	case PT_SETXSTATE:

Modified: stable/9/sys/amd64/include/ptrace.h
==============================================================================
--- stable/9/sys/amd64/include/ptrace.h	Thu May 17 18:40:27 2012	(r235558)
+++ stable/9/sys/amd64/include/ptrace.h	Thu May 17 19:01:13 2012	(r235559)
@@ -35,7 +35,14 @@
 
 #define	__HAVE_PTRACE_MACHDEP
 
-#define PT_GETXSTATE	(PT_FIRSTMACH + 0)
-#define PT_SETXSTATE	(PT_FIRSTMACH + 1)
+/*
+ * On amd64 (PT_FIRSTMACH + 0) and (PT_FIRSTMACH + 1) are old values for
+ * PT_GETXSTATE and PT_SETXSTATE.  They should not be (re)used.
+ */
+
+#define	PT_GETXMMREGS	(PT_FIRSTMACH + 0)	/* i386 only */
+#define	PT_SETXMMREGS	(PT_FIRSTMACH + 1)	/* i386 only */
+#define	PT_GETXSTATE	(PT_FIRSTMACH + 2)
+#define	PT_SETXSTATE	(PT_FIRSTMACH + 3)
 
 #endif


More information about the svn-src-stable-9 mailing list