aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/contrib/opensolaris/uts/powerpc/sys
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2013-10-15 15:00:29 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2013-10-15 15:00:29 +0000
commit30b318b92f13d33f63270b76fba2c32d8668ab7a (patch)
tree8e64b4f75c8e219a401f5b73b50c31c41b239708 /sys/cddl/contrib/opensolaris/uts/powerpc/sys
parentb2da17ea5434831807bdf102dfd91e1e507f3326 (diff)
downloadsrc-30b318b92f13d33f63270b76fba2c32d8668ab7a.tar.gz
src-30b318b92f13d33f63270b76fba2c32d8668ab7a.zip
Add fasttrap for PowerPC. This is the last piece of the dtrace/ppc puzzle.
It's incomplete, it doesn't contain full instruction emulation, but it should be sufficient for most cases. MFC after: 1 month
Notes
Notes: svn path=/head/; revision=256543
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/powerpc/sys')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h37
1 files changed, 32 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h b/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h
index 0f21899f7019..98d5d2675662 100644
--- a/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h
+++ b/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h
@@ -19,6 +19,7 @@
*
* CDDL HEADER END
*/
+/* Portions Copyright 2013 Justin Hibbits */
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
@@ -34,13 +35,39 @@
#ifdef __cplusplus
extern "C" {
#endif
-/*
- * XXXDTRACE: placehodler for PowerPC fasttrap stuff
- */
-typedef uint32_t fasttrap_instr_t;
#define FASTTRAP_SUNWDTRACE_SIZE 64
-#define FASTTRAP_INSTR 0x0FFFDDDD
+#define FASTTRAP_INSTR 0x0FFFDDDD
+
+typedef uint32_t fasttrap_instr_t;
+
+typedef struct fasttrap_machtp_t {
+ fasttrap_instr_t ftmt_instr; /* original instruction */
+ uintptr_t ftmt_dest; /* branch target */
+ uint8_t ftmt_type; /* emulation type */
+ uint8_t ftmt_flags; /* emulation flags */
+ uint8_t ftmt_bo; /* BO field */
+ uint8_t ftmt_bi; /* BI field (CR bit) */
+} fasttrap_machtp_t;
+
+#define ftt_instr ftt_mtp.ftmt_instr
+#define ftt_dest ftt_mtp.ftmt_dest
+#define ftt_type ftt_mtp.ftmt_type
+#define ftt_flags ftt_mtp.ftmt_flags
+#define ftt_bo ftt_mtp.ftmt_bo
+#define ftt_bi ftt_mtp.ftmt_bi
+
+#define FASTTRAP_T_COMMON 0x00
+#define FASTTRAP_T_B 0x01
+#define FASTTRAP_T_BC 0x02
+#define FASTTRAP_T_BLR 0x03
+#define FASTTRAP_T_BCTR 0x04
+#define FASTTRAP_T_NOP 0x05
+
+#define FASTTRAP_AFRAMES 3
+#define FASTTRAP_RETURN_AFRAMES 4
+#define FASTTRAP_ENTRY_AFRAMES 3
+#define FASTTRAP_OFFSET_AFRAMES 3
#ifdef __cplusplus
}