diff options
author | Till Straumann <strauman@slac.stanford.edu> | 2009-10-28 21:40:14 +0000 |
---|---|---|
committer | Till Straumann <strauman@slac.stanford.edu> | 2009-10-28 21:40:14 +0000 |
commit | caf761f0d332735decc2b27c269238684221168e (patch) | |
tree | 198e5ab455c7546e87ffa44d4ea90e413554bf4d /c/src/lib/libcpu/i386 | |
parent | New. (diff) | |
download | rtems-caf761f0d332735decc2b27c269238684221168e.tar.bz2 |
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.
Diffstat (limited to 'c/src/lib/libcpu/i386')
-rw-r--r-- | c/src/lib/libcpu/i386/ChangeLog | 7 | ||||
-rw-r--r-- | c/src/lib/libcpu/i386/cpuModel.S | 4 | ||||
-rw-r--r-- | c/src/lib/libcpu/i386/cpuModel.h | 3 | ||||
-rw-r--r-- | c/src/lib/libcpu/i386/displayCpu.c | 20 |
4 files changed, 29 insertions, 5 deletions
diff --git a/c/src/lib/libcpu/i386/ChangeLog b/c/src/lib/libcpu/i386/ChangeLog index 803eb83ae5..4c9c7d965f 100644 --- a/c/src/lib/libcpu/i386/ChangeLog +++ b/c/src/lib/libcpu/i386/ChangeLog @@ -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. diff --git a/c/src/lib/libcpu/i386/cpuModel.S b/c/src/lib/libcpu/i386/cpuModel.S index 72520aa5b8..74fffd31d2 100644 --- a/c/src/lib/libcpu/i386/cpuModel.S +++ b/c/src/lib/libcpu/i386/cpuModel.S @@ -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): diff --git a/c/src/lib/libcpu/i386/cpuModel.h b/c/src/lib/libcpu/i386/cpuModel.h index c5451d851b..cb4a4daea4 100644 --- a/c/src/lib/libcpu/i386/cpuModel.h +++ b/c/src/lib/libcpu/i386/cpuModel.h @@ -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 */ diff --git a/c/src/lib/libcpu/i386/displayCpu.c b/c/src/lib/libcpu/i386/displayCpu.c index d0b0c9f3a6..d77843a5f3 100644 --- a/c/src/lib/libcpu/i386/displayCpu.c +++ b/c/src/lib/libcpu/i386/displayCpu.c @@ -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"); } |