From 7da43069d71f82e67aa91b32b5b46b117f6d678c Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 5 Sep 2009 03:28:58 +0000 Subject: [PATCH] - Fixed: The aliasing of CPUInfo was still wrong. (Yarr! The things I do for you, GCC!) The AMD feature flags weren't stored anywhere, either; not that it really matters. SVN r1794 (trunk) --- docs/rh-log.txt | 3 +++ src/x86.cpp | 8 ++++---- src/x86.h | 12 ++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 465ad7a728..4cc334b88f 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -2,6 +2,9 @@ September 5, 2009 (Changes by Graf Zahl) - made menu dimming a mapping option but kept the CVARS as user override. September 4, 2009 +- Fixed: The aliasing of CPUInfo was still wrong. (Yarr! The things I do + for you, GCC!) The AMD feature flags weren't stored anywhere, either; not + that it really matters. - Add an alternate PIC-compliant __cpuid macro in x86.cpp. - Fixed: S_LoadSound() did not byte-swap the frequency and length it reads from DMX sounds. diff --git a/src/x86.cpp b/src/x86.cpp index 880149bc4e..e03b4795e7 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -96,9 +96,9 @@ haveid: // Get vendor ID __cpuid(foo, 0); - cpu->VendorID[0] = foo[1]; - cpu->VendorID[1] = foo[3]; - cpu->VendorID[2] = foo[2]; + cpu->dwVendorID[0] = foo[1]; + cpu->dwVendorID[1] = foo[3]; + cpu->dwVendorID[2] = foo[2]; if (foo[1] == MAKE_ID('A','u','t','h') && foo[3] == MAKE_ID('e','n','t','i') && foo[2] == MAKE_ID('c','A','M','D')) @@ -162,9 +162,9 @@ haveid: cpu->AMDFamily += (foo[0] >> 20) & 0xFF; cpu->AMDModel |= (foo[0] >> 12) & 0xF0; } + cpu->FeatureFlags[3] = foo[3]; // AMD feature flags } } - #endif } diff --git a/src/x86.h b/src/x86.h index 0c6c75a2fd..d2a37e9ad0 100644 --- a/src/x86.h +++ b/src/x86.h @@ -21,15 +21,15 @@ struct CPUInfo // 92 bytes BYTE Family; BYTE Type; - BYTE BrandIndex; - BYTE CLFlush; - BYTE CPUCount; - BYTE APICID; - union { struct { + BYTE BrandIndex; + BYTE CLFlush; + BYTE CPUCount; + BYTE APICID; + DWORD bSSE3:1; DWORD DontCare1:8; DWORD bSSSE3:1; @@ -78,7 +78,7 @@ struct CPUInfo // 92 bytes DWORD b3DNowPlus:1; DWORD b3DNow:1; }; - DWORD FeatureFlags[3]; + DWORD FeatureFlags[4]; }; BYTE AMDStepping;