Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jul 2016 03:09:58 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303534 - in head/cddl/contrib/opensolaris/lib/libdtrace: arm i386
Message-ID:  <201607300309.u6U39whe006177@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sat Jul 30 03:09:57 2016
New Revision: 303534
URL: https://svnweb.freebsd.org/changeset/base/303534

Log:
  libdtrace: Don't hard-code the native data model.
  
  MFC after:	1 month

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c
  head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c	Sat Jul 30 03:09:23 2016	(r303533)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c	Sat Jul 30 03:09:57 2016	(r303534)
@@ -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
 

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c	Sat Jul 30 03:09:23 2016	(r303533)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c	Sat Jul 30 03:09:57 2016	(r303534)
@@ -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_prochand
 	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_pro
 	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_pro
 		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 
 	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;



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