* uname.cc (uname): Use `wProcessorLevel' unless OS sets it wrong.

Use `dwProcessorType' then instead.
        * wincap.cc: Set flag has_valid_processorlevel appropriately.
        * wincap.h: Add flag has_valid_processorlevel.
This commit is contained in:
Corinna Vinschen
2001-10-15 09:41:18 +00:00
parent 48372ea6f1
commit 271a33443c
4 changed files with 36 additions and 6 deletions

View File

@ -57,13 +57,23 @@ uname (struct utsname *name)
{
case PROCESSOR_ARCHITECTURE_INTEL:
unsigned int ptype;
if (sysinfo.dwProcessorType < 3) /* Shouldn't happen. */
ptype = 3;
else if (sysinfo.dwProcessorType > 9) /* P4 */
ptype = 6;
if (wincap.has_valid_processorlevel ())
{
if (sysinfo.wProcessorLevel < 3) /* Shouldn't happen. */
ptype = 3;
else if (sysinfo.wProcessorLevel > 9) /* P4 */
ptype = 6;
else
ptype = sysinfo.wProcessorLevel;
}
else
ptype = sysinfo.dwProcessorType;
{
if (sysinfo.dwProcessorType == PROCESSOR_INTEL_386 ||
sysinfo.dwProcessorType == PROCESSOR_INTEL_486)
ptype = sysinfo.dwProcessorType / 100;
else
ptype = PROCESSOR_INTEL_PENTIUM / 100;
}
__small_sprintf (name->machine, "i%d86", ptype);
break;
case PROCESSOR_ARCHITECTURE_ALPHA: