View | Details | Raw Unified | Return to bug 18154
Collapse All | Expand All

(-)sys/i386/i386/identcpu.c (-2 / +28 lines)
Lines 78-83 Link Here
78
78
79
u_int	cyrix_did;		/* Device ID of Cyrix CPU */
79
u_int	cyrix_did;		/* Device ID of Cyrix CPU */
80
int cpu_class = CPUCLASS_386;	/* least common denominator */
80
int cpu_class = CPUCLASS_386;	/* least common denominator */
81
SYSCTL_INT(_hw, HW_CPUCLASS, cpu_class, CTLFLAG_RD,
82
    &cpu_class, 0, "CPU class");
83
81
char machine[] = "i386";
84
char machine[] = "i386";
82
SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, 
85
SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, 
83
    machine, 0, "Machine class");
86
    machine, 0, "Machine class");
Lines 86-91 Link Here
86
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, 
89
SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, 
87
    cpu_model, 0, "Machine model");
90
    cpu_model, 0, "Machine model");
88
91
92
SYSCTL_NODE(_hw, OID_AUTO,  features,  CTLFLAG_RW, 0,
93
        "CPU features");
94
95
int featuresmmx;
96
SYSCTL_INT(_hw_features, OID_AUTO, mmx, CTLFLAG_RD,
97
    &featuresmmx, 0, "MMX Support");
98
99
int features3dnow;
100
SYSCTL_INT(_hw_features, OID_AUTO, 3dnow, CTLFLAG_RD,
101
    &features3dnow, 0, "3DNow! Support");
102
103
int featuressimd;
104
SYSCTL_INT(_hw_features, OID_AUTO, simd, CTLFLAG_RD,
105
    &featuressimd, 0, "SIMD Support");
106
107
        
108
        
89
static struct cpu_nameclass i386_cpus[] = {
109
static struct cpu_nameclass i386_cpus[] = {
90
	{ "Intel 80286",	CPUCLASS_286 },		/* CPU_286   */
110
	{ "Intel 80286",	CPUCLASS_286 },		/* CPU_286   */
91
	{ "i386SX",		CPUCLASS_386 },		/* CPU_386SX */
111
	{ "i386SX",		CPUCLASS_386 },		/* CPU_386SX */
Lines 580-585 Link Here
580
			"\037<b30>"
600
			"\037<b30>"
581
			"\040<b31>"
601
			"\040<b31>"
582
			);
602
			);
603
			if (cpu_feature & 0x800000)
604
			    featuresmmx = 1;
605
			if (cpu_feature & 0x2000000)
606
			    features3dnow = 1;	
583
		}
607
		}
584
		if (strcmp(cpu_vendor, "AuthenticAMD") == 0 &&
608
		if (strcmp(cpu_vendor, "AuthenticAMD") == 0 &&
585
		    nreg >= 0x80000001)
609
		    nreg >= 0x80000001)
Lines 987-993 Link Here
987
		"\034<b27>"
1011
		"\034<b27>"
988
		"\035<b28>"
1012
		"\035<b28>"
989
		"\036<b29>"
1013
		"\036<b29>"
990
		"\037DSP"	/* AMD 3DNow! Instruction Extensions */
1014
		"\037DSP"
991
		"\0403DNow!"
1015
		"\0403DNow!"	/* AMD 3DNow! Instruction Extensions */
992
		);
1016
		);
1017
		if (regs[3] & 0x80000000)
1018
		    features3dnow = 1;
993
}
1019
}
(-)sys/sys/sysctl.h (-1 / +4 lines)
Lines 346-352 Link Here
346
#define	HW_DISKSTATS	 9		/* struct: diskstats[] */
346
#define	HW_DISKSTATS	 9		/* struct: diskstats[] */
347
#define	HW_FLOATINGPT	10		/* int: has HW floating point? */
347
#define	HW_FLOATINGPT	10		/* int: has HW floating point? */
348
#define	HW_MACHINE_ARCH	11		/* string: machine architecture */
348
#define	HW_MACHINE_ARCH	11		/* string: machine architecture */
349
#define	HW_MAXID	12		/* number of valid hw ids */
349
#define	HW_CPUCLASS	12		/* int: class of cpu <machine/cpuclass.h> */
350
#define	HW_MAXID	13		/* number of valid hw ids */
350
351
351
#define CTL_HW_NAMES { \
352
#define CTL_HW_NAMES { \
352
	{ 0, 0 }, \
353
	{ 0, 0 }, \
Lines 360-365 Link Here
360
	{ "disknames", CTLTYPE_STRUCT }, \
361
	{ "disknames", CTLTYPE_STRUCT }, \
361
	{ "diskstats", CTLTYPE_STRUCT }, \
362
	{ "diskstats", CTLTYPE_STRUCT }, \
362
	{ "floatingpoint", CTLTYPE_INT }, \
363
	{ "floatingpoint", CTLTYPE_INT }, \
364
	{ "machinearch", CTLTYPE_STRING }, \
365
	{ "cpuclass", CTLTYPE_INT }, \
363
}
366
}
364
367
365
/*
368
/*

Return to bug 18154