diff options
author | Bryan Cantrill <bryan@joyent.com> | 2012-12-13 11:25:45 -0800 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2012-12-20 11:07:47 -0800 |
commit | eb23829ff08a873c612ac45d191d559394b4b408 (patch) | |
tree | bb449926f653e33b328c5c9e92f33d29c1328689 | |
parent | 636dfb4b6ac0749387c883053011a3afb4b4893b (diff) | |
download | illumos-joyent-eb23829ff08a873c612ac45d191d559394b4b408.tar.gz |
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>
-rw-r--r-- | usr/src/cmd/isainfo/isainfo.c | 12 | ||||
-rw-r--r-- | usr/src/common/dis/i386/dis_tables.c | 15 |
2 files changed, 18 insertions, 9 deletions
diff --git a/usr/src/cmd/isainfo/isainfo.c b/usr/src/cmd/isainfo/isainfo.c index b460ef289e..fb7ef19c97 100644 --- a/usr/src/cmd/isainfo/isainfo.c +++ b/usr/src/cmd/isainfo/isainfo.c @@ -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 @@ report_hwcap(int d, const char *isa) int linecnt = 0; for (p = strtok(buffer, " "); p; p = strtok(NULL, " ")) { - if (linecnt == 0) - linecnt = printf("\t"); - linecnt += printf("%s ", p); - if (linecnt > 68) { + if (linecnt + strlen(p) > 68) { (void) printf("\n"); linecnt = 0; } + if (linecnt == 0) + linecnt = printf("\t"); + linecnt += printf("%s ", p); } if (linecnt != 0) (void) printf("\n"); diff --git a/usr/src/common/dis/i386/dis_tables.c b/usr/src/common/dis/i386/dis_tables.c index 26067a0fc5..87158fa2eb 100644 --- a/usr/src/common/dis/i386/dis_tables.c +++ b/usr/src/common/dis/i386/dis_tables.c @@ -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 @@ enum { 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_op0F00[8] = { 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 @@ just_mem: 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 */ |