isainfo.c (eb23829ff08a873c612ac45d191d559394b4b408) | isainfo.c (ebb8ac078e9265f87093fbb363e8c2cbc6ee13e6) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 10 unchanged lines hidden (view full) --- 19 * CDDL HEADER END 20 */ 21/* 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 10 unchanged lines hidden (view full) --- 19 * CDDL HEADER END 20 */ 21/* 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26/* |
27 * Copyright (c) 2011, Joyent, Inc. All rights reserved. | 27 * Copyright (c) 2012, Joyent, Inc. All rights reserved. |
28 */ 29 30#include <sys/types.h> 31#include <sys/systeminfo.h> 32#include <sys/utsname.h> 33#include <sys/stat.h> 34 35#include <sys/auxv.h> --- 106 unchanged lines hidden (view full) --- 142 143 return (0); 144} 145 146static void 147report_hwcap(int d, const char *isa) 148{ 149 struct cpuid_get_hwcap __cgh, *cgh = &__cgh; | 28 */ 29 30#include <sys/types.h> 31#include <sys/systeminfo.h> 32#include <sys/utsname.h> 33#include <sys/stat.h> 34 35#include <sys/auxv.h> --- 106 unchanged lines hidden (view full) --- 142 143 return (0); 144} 145 146static void 147report_hwcap(int d, const char *isa) 148{ 149 struct cpuid_get_hwcap __cgh, *cgh = &__cgh; |
150 char buffer[1024]; | 150 char buffer[1024], cap2[1024]; |
151 152 cgh->cgh_archname = (char *)isa; 153 if (ioctl(d, CPUID_GET_HWCAP, cgh) != 0) 154 return; 155 | 151 152 cgh->cgh_archname = (char *)isa; 153 if (ioctl(d, CPUID_GET_HWCAP, cgh) != 0) 154 return; 155 |
156 (void) elfcap_hw1_to_str(ELFCAP_STYLE_LC, cgh->cgh_hwcap, | 156 (void) elfcap_hw1_to_str(ELFCAP_STYLE_LC, cgh->cgh_hwcap[0], |
157 buffer, sizeof (buffer), ELFCAP_FMT_SNGSPACE, machtype(isa)); 158 | 157 buffer, sizeof (buffer), ELFCAP_FMT_SNGSPACE, machtype(isa)); 158 |
159 if (cgh->cgh_hwcap[1] != 0) 160 (void) elfcap_hw2_to_str(ELFCAP_STYLE_LC, cgh->cgh_hwcap[1], 161 cap2, sizeof (cap2), ELFCAP_FMT_SNGSPACE, machtype(isa)); 162 else 163 cap2[0] = '\0'; 164 |
|
159 if (mode & EXTN_MODE) { | 165 if (mode & EXTN_MODE) { |
160 (void) printf(": %s\n", buffer); | 166 (void) printf(":"); 167 if (cgh->cgh_hwcap[1] != NULL) 168 (void) printf(" %s", cap2); 169 (void) printf(" %s", buffer); 170 (void) printf("\n"); |
161 } else { 162 char *p; 163 int linecnt = 0; 164 | 171 } else { 172 char *p; 173 int linecnt = 0; 174 |
175 for (p = strtok(cap2, " "); p; p = strtok(NULL, " ")) { 176 if (linecnt + strlen(p) > 68) { 177 (void) printf("\n"); 178 linecnt = 0; 179 } 180 if (linecnt == 0) 181 linecnt = printf("\t"); 182 linecnt += printf("%s ", p); 183 } 184 |
|
165 for (p = strtok(buffer, " "); p; p = strtok(NULL, " ")) { 166 if (linecnt + strlen(p) > 68) { 167 (void) printf("\n"); 168 linecnt = 0; 169 } 170 if (linecnt == 0) 171 linecnt = printf("\t"); 172 linecnt += printf("%s ", p); 173 } | 185 for (p = strtok(buffer, " "); p; p = strtok(NULL, " ")) { 186 if (linecnt + strlen(p) > 68) { 187 (void) printf("\n"); 188 linecnt = 0; 189 } 190 if (linecnt == 0) 191 linecnt = printf("\t"); 192 linecnt += printf("%s ", p); 193 } |
194 |
|
174 if (linecnt != 0) 175 (void) printf("\n"); 176 } 177} 178 179#if !defined(TEXT_DOMAIN) 180#define TEXT_DOMAIN "SYS_TEST" 181#endif --- 102 unchanged lines hidden --- | 195 if (linecnt != 0) 196 (void) printf("\n"); 197 } 198} 199 200#if !defined(TEXT_DOMAIN) 201#define TEXT_DOMAIN "SYS_TEST" 202#endif --- 102 unchanged lines hidden --- |