diff options
| author | Robert Mustacchi <rm@joyent.com> | 2012-12-13 11:29:00 -0800 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2012-12-20 11:08:41 -0800 |
| commit | ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6 (patch) | |
| tree | 75ef00d213e7cb6ada89fc357ad3f54eebd7be50 /usr/src/cmd/isainfo | |
| parent | eb23829ff08a873c612ac45d191d559394b4b408 (diff) | |
| download | illumos-joyent-ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6.tar.gz | |
3414 Need a new word of AT_SUN_HWCAP bits
3415 Add isainfo support for f16c and rdrand
3416 Need disassembler support for rdrand and f16c
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/cmd/isainfo')
| -rw-r--r-- | usr/src/cmd/isainfo/isainfo.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/usr/src/cmd/isainfo/isainfo.c b/usr/src/cmd/isainfo/isainfo.c index fb7ef19c97..adf2f14dc9 100644 --- a/usr/src/cmd/isainfo/isainfo.c +++ b/usr/src/cmd/isainfo/isainfo.c @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #include <sys/types.h> @@ -147,21 +147,41 @@ static void report_hwcap(int d, const char *isa) { struct cpuid_get_hwcap __cgh, *cgh = &__cgh; - char buffer[1024]; + char buffer[1024], cap2[1024]; cgh->cgh_archname = (char *)isa; if (ioctl(d, CPUID_GET_HWCAP, cgh) != 0) return; - (void) elfcap_hw1_to_str(ELFCAP_STYLE_LC, cgh->cgh_hwcap, + (void) elfcap_hw1_to_str(ELFCAP_STYLE_LC, cgh->cgh_hwcap[0], buffer, sizeof (buffer), ELFCAP_FMT_SNGSPACE, machtype(isa)); + if (cgh->cgh_hwcap[1] != 0) + (void) elfcap_hw2_to_str(ELFCAP_STYLE_LC, cgh->cgh_hwcap[1], + cap2, sizeof (cap2), ELFCAP_FMT_SNGSPACE, machtype(isa)); + else + cap2[0] = '\0'; + if (mode & EXTN_MODE) { - (void) printf(": %s\n", buffer); + (void) printf(":"); + if (cgh->cgh_hwcap[1] != NULL) + (void) printf(" %s", cap2); + (void) printf(" %s", buffer); + (void) printf("\n"); } else { char *p; int linecnt = 0; + for (p = strtok(cap2, " "); p; p = strtok(NULL, " ")) { + if (linecnt + strlen(p) > 68) { + (void) printf("\n"); + linecnt = 0; + } + if (linecnt == 0) + linecnt = printf("\t"); + linecnt += printf("%s ", p); + } + for (p = strtok(buffer, " "); p; p = strtok(NULL, " ")) { if (linecnt + strlen(p) > 68) { (void) printf("\n"); @@ -171,6 +191,7 @@ report_hwcap(int d, const char *isa) linecnt = printf("\t"); linecnt += printf("%s ", p); } + if (linecnt != 0) (void) printf("\n"); } |
