Print cpu features line only when corresponding part of bits are set.

This commit is contained in:
enami 2000-12-21 05:11:00 +00:00
parent 5389a2b390
commit 5575e1f704
2 changed files with 20 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.422 2000/12/11 17:36:03 mycroft Exp $ */
/* $NetBSD: machdep.c,v 1.423 2000/12/21 05:11:00 enami Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -364,12 +364,17 @@ cpu_startup()
printf("cpu0: L2 cache %s\n", cpu_l2cache_info->cai_string);
if (cpu_feature) {
char buf[1024];
bitmask_snprintf(cpu_feature, CPUID_FLAGS1,
buf, sizeof(buf));
printf("cpu0: features %s\n", buf);
bitmask_snprintf(cpu_feature, CPUID_FLAGS2,
buf, sizeof(buf));
printf("cpu0: features %s\n", buf);
if ((cpu_feature & CPUID_MASK1) != 0) {
bitmask_snprintf(cpu_feature, CPUID_FLAGS1,
buf, sizeof(buf));
printf("cpu0: features %s\n", buf);
}
if ((cpu_feature & CPUID_MASK2) != 0) {
bitmask_snprintf(cpu_feature, CPUID_FLAGS2,
buf, sizeof(buf));
printf("cpu0: features %s\n", buf);
}
}
if (cpuid_level >= 3 && ((cpu_feature & CPUID_PN) != 0)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: specialreg.h,v 1.14 2000/09/20 22:59:44 fvdl Exp $ */
/* $NetBSD: specialreg.h,v 1.15 2000/12/21 05:11:00 enami Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@ -117,8 +117,13 @@
#define CPUID_XMM 0x02000000 /* streaming SIMD extensions */
/* bits 26->31 also reserved. */
#define CPUID_FLAGS1 "\20\1FPU\2VME\3DE\4PSE\5TSC\6MSR\7PAE\10MCE\11CX8\12APIC\13B10\14SEP\15MTRR"
#define CPUID_FLAGS2 "\20\16PGE\17MCA\20CMOV\21FGPAT\22PSE36\23PN\24B19\25B20\26B21\27B22\30MMX\31FXSR\32XMM\33B26\34B27\35B28\36B29\37B30\40B31"
#define CPUID_FLAGS1 "\20\1FPU\2VME\3DE\4PSE\5TSC\6MSR\7PAE" \
"\10MCE\11CX8\12APIC\13B10\14SEP\15MTRR"
#define CPUID_MASK1 0x00001fff
#define CPUID_FLAGS2 "\20\16PGE\17MCA\20CMOV\21FGPAT\22PSE36\23PN\24B19" \
"\25B20\26B21\27B22\30MMX\31FXSR\32XMM\33B26" \
"\34B27\35B28\36B29\37B30\40B31"
#define CPUID_MASK2 0xffffe000
/*
* Model-specific registers for the i386 family