forked from Imagelibrary/rtems
2009-10-28 Till Straumann <strauman@slac.stanford.edu>
* cpuModel.S, cpuModel.h, displayCpu.c: Save/cache CPUID:ECX (extended capabilities) in a new variable (x86_capability_x). Added more known flag description strings (printCpuInfo()) and let 'printCpuInfo()' dump the extended feature flags, too.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2009-10-28 Till Straumann <strauman@slac.stanford.edu>
|
||||
|
||||
* cpuModel.S, cpuModel.h, displayCpu.c: Save/cache CPUID:ECX
|
||||
(extended capabilities) in a new variable (x86_capability_x).
|
||||
Added more known flag description strings (printCpuInfo())
|
||||
and let 'printCpuInfo()' dump the extended feature flags, too.
|
||||
|
||||
2009-05-06 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* page.c: Fixed warnings.
|
||||
|
||||
@@ -95,6 +95,7 @@ isnew:
|
||||
*/
|
||||
movl $1, eax
|
||||
cpuid
|
||||
movl ecx,SYM(x86_capability_x) /* store ecx feature flags */
|
||||
|
||||
movb al, cl /* save reg for future use */
|
||||
|
||||
@@ -234,6 +235,7 @@ BEGIN_DATA
|
||||
PUBLIC(x86_model)
|
||||
PUBLIC(x86_mask)
|
||||
PUBLIC(x86_capability)
|
||||
PUBLIC(x86_capability_x)
|
||||
PUBLIC(x86_vendor_id)
|
||||
PUBLIC(hard_math)
|
||||
|
||||
@@ -247,6 +249,8 @@ SYM(x86_mask):
|
||||
.byte 0
|
||||
SYM(x86_capability):
|
||||
.long 0
|
||||
SYM(x86_capability_x):
|
||||
.long 0
|
||||
SYM(x86_vendor_id):
|
||||
.zero 13
|
||||
SYM(hard_math):
|
||||
|
||||
@@ -24,7 +24,8 @@ extern char hard_math; /* floating point coprocessor present indicator */
|
||||
extern char x86; /* type of cpu (3 = 386, 4 =486, ...) */
|
||||
extern char x86_model;
|
||||
extern char x86_mask;
|
||||
extern int x86_capability;
|
||||
extern int x86_capability; /* cpuid:EDX */
|
||||
extern int x86_capability_x; /* cpuid:ECX */
|
||||
extern char x86_vendor_id[13];
|
||||
extern int have_cpuid;
|
||||
extern unsigned char Cx86_step; /* cyrix processor identification */
|
||||
|
||||
@@ -177,11 +177,17 @@ void printCpuInfo(void)
|
||||
int i;
|
||||
static const char *x86_cap_flags[] = {
|
||||
"fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
|
||||
"cx8", "apic", "10", "11", "mtrr", "pge", "mca", "cmov",
|
||||
"16", "17", "18", "19", "20", "21", "22", "mmx",
|
||||
"24", "25", "26", "27", "28", "29", "30", "31"
|
||||
"cx8", "apic", "10", "sep", "mtrr", "pge", "mca", "cmov",
|
||||
"pat", "pse36", "psn", "cflsh", "20", "ds", "acpi", "mmx",
|
||||
"fxsr", "sse", "sse2", "ss", "htt", "tm", "30", "pbe"
|
||||
};
|
||||
|
||||
static const char *x86_cap_x_flags[] = {
|
||||
"sse3", "1", "2", "monitor", "ds-cpl", "vmx", "6", "est",
|
||||
"tm2", "9", "cnxt-id", "11", "12", "cmpxchg16b", "14", "15",
|
||||
"16", "17", "18", "19", "20", "21", "22", "23"
|
||||
"24", "25", "26", "27", "28", "29", "30", "31"
|
||||
};
|
||||
|
||||
printk("cpu\t\t\t: %c86\n", x86+'0');
|
||||
printk("model\t\t: %s\n",
|
||||
have_cpuid ? getmodel(x86, x86_model) : "unknown");
|
||||
@@ -208,4 +214,10 @@ void printCpuInfo(void)
|
||||
}
|
||||
}
|
||||
printk("\n");
|
||||
for ( i = 0 ; i < 32 ; i++ ) {
|
||||
if ( x86_capability_x & (1 << i) ) {
|
||||
printk(" %s", x86_cap_x_flags[i]);
|
||||
}
|
||||
}
|
||||
printk("\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user