aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib/libdtrace
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2016-07-30 03:09:57 +0000
committerMark Johnston <markj@FreeBSD.org>2016-07-30 03:09:57 +0000
commit907b59d76938e654f0d040a888e8dfca3de1e222 (patch)
tree94ba6fff260f2156ceb53b29ed8103bb072e9ded /cddl/contrib/opensolaris/lib/libdtrace
parent4808a67805fe7287d8054934d978cd1076302689 (diff)
downloadsrc-907b59d76938e654f0d040a888e8dfca3de1e222.tar.gz
src-907b59d76938e654f0d040a888e8dfca3de1e222.zip
libdtrace: Don't hard-code the native data model.
MFC after: 1 month
Notes
Notes: svn path=/head/; revision=303534
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c4
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c29
2 files changed, 7 insertions, 26 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c b/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c
index 25a250dd525d..802d9d9752a6 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c
@@ -38,9 +38,7 @@
#include <dt_impl.h>
#include <dt_pid.h>
-#if !defined(sun)
-#define PR_MODEL_ILP32 1
-#define PR_MODEL_LP64 2
+#ifdef __FreeBSD__
#include <libproc_compat.h>
#endif
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c b/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
index 34d558767b9e..5d8d034fe216 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
@@ -39,9 +39,8 @@
#include <dis_tables.h>
-#ifndef illumos
-#define PR_MODEL_ILP32 1
-#define PR_MODEL_LP64 2
+#ifdef __FreeBSD__
+#include <libproc.h>
#include <libproc_compat.h>
#endif
@@ -93,11 +92,7 @@ dt_pid_has_jump_table(struct ps_prochandle *P, dtrace_hdl_t *dtp,
char dmodel = Pstatus(P)->pr_dmodel;
#else
pid_t pid = proc_getpid(P);
-#if __i386__
- char dmodel = PR_MODEL_ILP32;
-#elif __amd64__
- char dmodel = PR_MODEL_LP64;
-#endif
+ char dmodel = proc_getmodel(P);
#endif
/*
@@ -149,11 +144,7 @@ dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
char dmodel = Pstatus(P)->pr_dmodel;
#else
pid_t pid = proc_getpid(P);
-#if __i386__
- char dmodel = PR_MODEL_ILP32;
-#elif __amd64__
- char dmodel = PR_MODEL_LP64;
-#endif
+ char dmodel = proc_getmodel(P);
#endif
/*
@@ -310,11 +301,7 @@ dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
char dmodel = Pstatus(P)->pr_dmodel;
#else
pid_t pid = proc_getpid(P);
-#if __i386__
- char dmodel = PR_MODEL_ILP32;
-#elif __amd64__
- char dmodel = PR_MODEL_LP64;
-#endif
+ char dmodel = proc_getmodel(P);
#endif
if ((text = malloc(symp->st_size)) == NULL) {
@@ -393,11 +380,7 @@ dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp,
char dmodel = Pstatus(P)->pr_dmodel;
#else
pid_t pid = proc_getpid(P);
-#if __i386__
- char dmodel = PR_MODEL_ILP32;
-#elif __amd64__
- char dmodel = PR_MODEL_LP64;
-#endif
+ char dmodel = proc_getmodel(P);
#endif
ftp->ftps_type = DTFTP_OFFSETS;