* uname.cc (uname): Eliminate os specific retrieving of x86

processor type.
This commit is contained in:
Corinna Vinschen 2001-09-04 20:16:33 +00:00
parent 63c17b5426
commit 37f75da24d
2 changed files with 14 additions and 25 deletions

View File

@ -1,3 +1,8 @@
Tue Sep 4 22:14:00 2001 Corinna Vinschen <corinna@vinschen.de>
* uname.cc (uname): Eliminate os specific retrieving of x86
processor type.
2001-09-04 Kazuhiro Fujieda <fujieda@jaist.ac.jp> 2001-09-04 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* fhandler_console.cc (fhandler_console::char_command): Save the cursor * fhandler_console.cc (fhandler_console::char_command): Save the cursor

View File

@ -53,31 +53,15 @@ uname (struct utsname *name)
switch (sysinfo.wProcessorArchitecture) switch (sysinfo.wProcessorArchitecture)
{ {
case PROCESSOR_ARCHITECTURE_INTEL: case PROCESSOR_ARCHITECTURE_INTEL:
/* But which of the x86 chips are we? */ unsigned int ptype;
/* Default to i386 if the specific chip cannot be determined */ if (sysinfo.dwProcessorType < 3) /* Shouldn't happen. */
switch (os_being_run) ptype = 3;
{ else if (sysinfo.dwProcessorType > 9) /* P4 */
case win95: ptype = 6;
case win98:
case winME:
/* dwProcessorType only valid in Windows 95 */
if ((sysinfo.dwProcessorType == PROCESSOR_INTEL_386) ||
(sysinfo.dwProcessorType == PROCESSOR_INTEL_486) ||
(sysinfo.dwProcessorType == PROCESSOR_INTEL_PENTIUM))
__small_sprintf (name->machine, "i%d", sysinfo.dwProcessorType);
else else
strcpy (name->machine, "i386"); ptype = sysinfo.dwProcessorType;
break;
case winNT: __small_sprintf (name->machine, "i%d86", ptype);
/* wProcessorLevel only valid in Windows NT */
__small_sprintf (name->machine, "i%d86",
sysinfo.dwProcessorType > 6 ?
6 : sysinfo.dwProcessorType);
break;
default:
strcpy (name->machine, "i386");
break;
}
break; break;
case PROCESSOR_ARCHITECTURE_ALPHA: case PROCESSOR_ARCHITECTURE_ALPHA:
strcpy (name->machine, "alpha"); strcpy (name->machine, "alpha");