changeset 13904:dbedaaf7ebd8

3413 isainfo -v overflows 80 columns 3417 mdb disassembler confuses rdtscp for invlpg Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com> Approved by: Garrett D'Amore <garrett@damore.org>
author Bryan Cantrill <bryan@joyent.com>
date Thu, 13 Dec 2012 11:25:45 -0800
parents 93cd9d7e48de
children b151bd260b71
files usr/src/cmd/isainfo/isainfo.c usr/src/common/dis/i386/dis_tables.c
diffstat 2 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/isainfo/isainfo.c	Wed Nov 14 10:16:04 2012 -0800
+++ b/usr/src/cmd/isainfo/isainfo.c	Thu Dec 13 11:25:45 2012 -0800
@@ -23,7 +23,9 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
 
 #include <sys/types.h>
 #include <sys/systeminfo.h>
@@ -161,13 +163,13 @@
 		int linecnt = 0;
 
 		for (p = strtok(buffer, " "); p; p = strtok(NULL, " ")) {
+			if (linecnt + strlen(p) > 68) {
+				(void) printf("\n");
+				linecnt = 0;
+			}
 			if (linecnt == 0)
 				linecnt = printf("\t");
 			linecnt += printf("%s ", p);
-			if (linecnt > 68) {
-				(void) printf("\n");
-				linecnt = 0;
-			}
 		}
 		if (linecnt != 0)
 			(void) printf("\n");
--- a/usr/src/common/dis/i386/dis_tables.c	Wed Nov 14 10:16:04 2012 -0800
+++ b/usr/src/common/dis/i386/dis_tables.c	Thu Dec 13 11:25:45 2012 -0800
@@ -21,7 +21,7 @@
  */
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  */
 
 /*
@@ -106,7 +106,7 @@
 	Mb,		/* register or memory, always byte sized */
 	MO,		/* memory only (no registers) */
 	PREF,
-	SWAPGS,
+	SWAPGS_RDTSCP,
 	MONITOR_MWAIT,
 	R,
 	RA,
@@ -500,7 +500,7 @@
 const instable_t dis_op0F01[8] = {
 
 /*  [0]  */	TNSZ("sgdt",VMx,6),	TNSZ("sidt",MONITOR_MWAIT,6),	TNSZ("lgdt",XGETBV_XSETBV,6),	TNSZ("lidt",SVM,6),
-/*  [4]  */	TNSZ("smsw",M,2),	INVALID, 		TNSZ("lmsw",M,2),	TNS("invlpg",SWAPGS),
+/*  [4]  */	TNSZ("smsw",M,2),	INVALID, 		TNSZ("lmsw",M,2),	TNS("invlpg",SWAPGS_RDTSCP),
 };
 
 /*
@@ -3493,14 +3493,21 @@
 		dtrace_get_operand(x, mode, r_m, wbit, 0);
 		break;
 
-	case SWAPGS:
+	case SWAPGS_RDTSCP:
 		if (cpu_mode == SIZE64 && mode == 3 && r_m == 0) {
 #ifdef DIS_TEXT
 			(void) strncpy(x->d86_mnem, "swapgs", OPLEN);
 #endif
 			NOMEM;
 			break;
+		} else if (mode == 3 && r_m == 1) {
+#ifdef DIS_TEXT
+			(void) strncpy(x->d86_mnem, "rdtscp", OPLEN);
+#endif
+			NOMEM;
+			break;
 		}
+
 		/*FALLTHROUGH*/
 
 	/* prefetch instruction - memory operand, but no memory acess */