aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
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");