summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2012-03-04 20:24:28 +0000
committertijl <tijl@FreeBSD.org>2012-03-04 20:24:28 +0000
commitab137477da9e3fd1376fff4b2d20a7333cdbfa1b (patch)
treea44f4057b921982da3b1014d71f9af06ef650cbb /sys
parentce5ed09b9f32ad5de801af7e71592cadb77dc6e0 (diff)
downloadFreeBSD-src-ab137477da9e3fd1376fff4b2d20a7333cdbfa1b.zip
FreeBSD-src-ab137477da9e3fd1376fff4b2d20a7333cdbfa1b.tar.gz
Copy amd64 ptrace.h to x86 and merge with i386 ptrace.h. Replace
amd64/i386/pc98 ptrace.h with stubs. 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. Reviewed by: kib
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/ptrace_machdep.c6
-rw-r--r--sys/amd64/include/ptrace.h41
-rw-r--r--sys/i386/include/ptrace.h43
-rw-r--r--sys/pc98/include/ptrace.h2
-rw-r--r--sys/x86/include/ptrace.h48
5 files changed, 61 insertions, 79 deletions
diff --git a/sys/amd64/amd64/ptrace_machdep.c b/sys/amd64/amd64/ptrace_machdep.c
index 8eea132..8236321 100644
--- a/sys/amd64/amd64/ptrace_machdep.c
+++ b/sys/amd64/amd64/ptrace_machdep.c
@@ -126,6 +126,12 @@ cpu_ptrace(struct thread *td, int req, void *addr, int data)
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:
diff --git a/sys/amd64/include/ptrace.h b/sys/amd64/include/ptrace.h
index 28f94f7..bf86754 100644
--- a/sys/amd64/include/ptrace.h
+++ b/sys/amd64/include/ptrace.h
@@ -1,41 +1,6 @@
/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ptrace.h 8.1 (Berkeley) 6/11/93
- * $FreeBSD$
+ * This file is in the public domain.
*/
+/* $FreeBSD$ */
-#ifndef _MACHINE_PTRACE_H_
-#define _MACHINE_PTRACE_H_
-
-#define __HAVE_PTRACE_MACHDEP
-
-#define PT_GETXSTATE (PT_FIRSTMACH + 0)
-#define PT_SETXSTATE (PT_FIRSTMACH + 1)
-
-#endif
+#include <x86/ptrace.h>
diff --git a/sys/i386/include/ptrace.h b/sys/i386/include/ptrace.h
index c64d3e8..bf86754 100644
--- a/sys/i386/include/ptrace.h
+++ b/sys/i386/include/ptrace.h
@@ -1,43 +1,6 @@
/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ptrace.h 8.1 (Berkeley) 6/11/93
- * $FreeBSD$
+ * This file is in the public domain.
*/
+/* $FreeBSD$ */
-#ifndef _MACHINE_PTRACE_H_
-#define _MACHINE_PTRACE_H_
-
-#define __HAVE_PTRACE_MACHDEP
-
-#define PT_GETXMMREGS (PT_FIRSTMACH + 0)
-#define PT_SETXMMREGS (PT_FIRSTMACH + 1)
-#define PT_GETXSTATE (PT_FIRSTMACH + 2)
-#define PT_SETXSTATE (PT_FIRSTMACH + 3)
-
-#endif
+#include <x86/ptrace.h>
diff --git a/sys/pc98/include/ptrace.h b/sys/pc98/include/ptrace.h
index 9253dc3..bf86754 100644
--- a/sys/pc98/include/ptrace.h
+++ b/sys/pc98/include/ptrace.h
@@ -3,4 +3,4 @@
*/
/* $FreeBSD$ */
-#include <i386/ptrace.h>
+#include <x86/ptrace.h>
diff --git a/sys/x86/include/ptrace.h b/sys/x86/include/ptrace.h
new file mode 100644
index 0000000..475e369
--- /dev/null
+++ b/sys/x86/include/ptrace.h
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ptrace.h 8.1 (Berkeley) 6/11/93
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_PTRACE_H_
+#define _MACHINE_PTRACE_H_
+
+#define __HAVE_PTRACE_MACHDEP
+
+/*
+ * 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
OpenPOWER on IntegriCloud