Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 May 2012 19:01:13 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r235559 - in stable/9/sys/amd64: amd64 include
Message-ID:  <201205171901.q4HJ1Dr1011756@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205171901.q4HJ1Dr1011756>