aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-09-04 20:16:33 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-09-04 20:16:33 +0000
commit37f75da24dfd63f71025233f1a139b05f0de0904 (patch)
tree0e28114509fa00308f2cb646b7610daf5274e365 /winsup
parent63c17b54266cd051776eb1448797921883991b61 (diff)
downloadnewlib-37f75da24dfd63f71025233f1a139b05f0de0904.zip
newlib-37f75da24dfd63f71025233f1a139b05f0de0904.tar.gz
newlib-37f75da24dfd63f71025233f1a139b05f0de0904.tar.bz2
* uname.cc (uname): Eliminate os specific retrieving of x86
processor type.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/uname.cc34
2 files changed, 14 insertions, 25 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 350b894..2140aec 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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>
* fhandler_console.cc (fhandler_console::char_command): Save the cursor
diff --git a/winsup/cygwin/uname.cc b/winsup/cygwin/uname.cc
index b113eaf..b930a87 100644
--- a/winsup/cygwin/uname.cc
+++ b/winsup/cygwin/uname.cc
@@ -53,31 +53,15 @@ uname (struct utsname *name)
switch (sysinfo.wProcessorArchitecture)
{
case PROCESSOR_ARCHITECTURE_INTEL:
- /* But which of the x86 chips are we? */
- /* Default to i386 if the specific chip cannot be determined */
- switch (os_being_run)
- {
- case win95:
- 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
- strcpy (name->machine, "i386");
- break;
- case winNT:
- /* 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;
- }
+ unsigned int ptype;
+ if (sysinfo.dwProcessorType < 3) /* Shouldn't happen. */
+ ptype = 3;
+ else if (sysinfo.dwProcessorType > 9) /* P4 */
+ ptype = 6;
+ else
+ ptype = sysinfo.dwProcessorType;
+
+ __small_sprintf (name->machine, "i%d86", ptype);
break;
case PROCESSOR_ARCHITECTURE_ALPHA:
strcpy (name->machine, "alpha");