Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
abae1e81
Commit
abae1e81
authored
Sep 11, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Better CPU detection on MacOS.
parent
5f7b77bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
40 deletions
+45
-40
cpu.c
dlls/kernel/cpu.c
+45
-40
No files found.
dlls/kernel/cpu.c
View file @
abae1e81
...
...
@@ -655,7 +655,8 @@ VOID WINAPI GetSystemInfo(
unsigned
long
long
longVal
;
int
value
;
int
cputype
;
char
buffer
[
256
];
valSize
=
sizeof
(
int
);
if
(
sysctlbyname
(
"hw.optional.floatingpoint"
,
&
value
,
&
valSize
,
NULL
,
0
)
==
0
)
{
...
...
@@ -675,13 +676,13 @@ VOID WINAPI GetSystemInfo(
valSize
=
sizeof
(
int
);
if
(
sysctlbyname
(
"hw.cputype"
,
&
cputype
,
&
valSize
,
NULL
,
0
)
==
0
)
{
valSize
=
sizeof
(
int
);
if
(
sysctlbyname
(
"hw.cpusubtype"
,
&
value
,
&
valSize
,
NULL
,
0
)
==
0
)
{
switch
(
cputype
)
{
case
CPU_TYPE_POWERPC
:
cachedsi
.
u
.
s
.
wProcessorArchitecture
=
PROCESSOR_ARCHITECTURE_PPC
;
switch
(
cputype
)
{
case
CPU_TYPE_POWERPC
:
cachedsi
.
u
.
s
.
wProcessorArchitecture
=
PROCESSOR_ARCHITECTURE_PPC
;
valSize
=
sizeof
(
int
);
if
(
sysctlbyname
(
"hw.cpusubtype"
,
&
value
,
&
valSize
,
NULL
,
0
)
==
0
)
{
switch
(
value
)
{
case
CPU_SUBTYPE_POWERPC_601
:
...
...
@@ -724,38 +725,42 @@ VOID WINAPI GetSystemInfo(
break
;
default:
break
;
}
break
;
/* CPU_TYPE_POWERPC */
case
CPU_TYPE_I386
:
cachedsi
.
u
.
s
.
wProcessorArchitecture
=
PROCESSOR_ARCHITECTURE_INTEL
;
switch
(
value
)
{
case
CPU_SUBTYPE_386
:
cachedsi
.
dwProcessorType
=
PROCESSOR_INTEL_386
;
cachedsi
.
wProcessorLevel
=
3
;
break
;
case
CPU_SUBTYPE_486
:
case
CPU_SUBTYPE_486SX
:
cachedsi
.
dwProcessorType
=
PROCESSOR_INTEL_486
;
cachedsi
.
wProcessorLevel
=
4
;
break
;
case
CPU_SUBTYPE_586
:
case
CPU_SUBTYPE_PENTPRO
:
cachedsi
.
dwProcessorType
=
PROCESSOR_INTEL_PENTIUM
;
cachedsi
.
wProcessorLevel
=
5
;
break
;
case
CPU_SUBTYPE_PENTII_M3
:
case
CPU_SUBTYPE_PENTII_M5
:
cachedsi
.
dwProcessorType
=
PROCESSOR_INTEL_PENTIUM
;
cachedsi
.
wProcessorLevel
=
5
;
/* this should imply MMX */
PF
[
PF_MMX_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
break
;
default:
break
;
}
break
;
/* CPU_TYPE_I386 */
default:
break
;
}
/* switch (cputype) */
}
}
break
;
/* CPU_TYPE_POWERPC */
case
CPU_TYPE_I386
:
cachedsi
.
u
.
s
.
wProcessorArchitecture
=
PROCESSOR_ARCHITECTURE_INTEL
;
valSize
=
sizeof
(
int
);
if
(
sysctlbyname
(
"machdep.cpu.family"
,
&
value
,
&
valSize
,
NULL
,
0
)
==
0
)
{
cachedsi
.
wProcessorLevel
=
value
;
switch
(
value
)
{
case
3
:
cachedsi
.
dwProcessorType
=
PROCESSOR_INTEL_386
;
break
;
case
4
:
cachedsi
.
dwProcessorType
=
PROCESSOR_INTEL_486
;
break
;
default:
cachedsi
.
dwProcessorType
=
PROCESSOR_INTEL_PENTIUM
;
break
;
}
}
valSize
=
sizeof
(
int
);
if
(
sysctlbyname
(
"machdep.cpu.model"
,
&
value
,
&
valSize
,
NULL
,
0
)
==
0
)
cachedsi
.
wProcessorRevision
=
(
value
<<
8
);
valSize
=
sizeof
(
int
);
if
(
sysctlbyname
(
"machdep.cpu.stepping"
,
&
value
,
&
valSize
,
NULL
,
0
)
==
0
)
cachedsi
.
wProcessorRevision
|=
value
;
valSize
=
sizeof
(
buffer
);
if
(
sysctlbyname
(
"machdep.cpu.features"
,
buffer
,
&
valSize
,
NULL
,
0
)
==
0
)
{
cachedsi
.
wProcessorRevision
|=
value
;
if
(
strstr
(
buffer
,
"CX8"
))
PF
[
PF_COMPARE_EXCHANGE_DOUBLE
]
=
TRUE
;
if
(
strstr
(
buffer
,
"MMX"
))
PF
[
PF_MMX_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
if
(
strstr
(
buffer
,
"TSC"
))
PF
[
PF_RDTSC_INSTRUCTION_AVAILABLE
]
=
TRUE
;
if
(
strstr
(
buffer
,
"3DNOW"
))
PF
[
PF_3DNOW_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
if
(
strstr
(
buffer
,
"SSE"
))
PF
[
PF_XMMI_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
if
(
strstr
(
buffer
,
"SSE2"
))
PF
[
PF_XMMI64_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
if
(
strstr
(
buffer
,
"PAE"
))
PF
[
PF_PAE_ENABLED
]
=
TRUE
;
}
break
;
/* CPU_TYPE_I386 */
default:
break
;
}
/* switch (cputype) */
}
valSize
=
sizeof
(
longVal
);
if
(
!
sysctlbyname
(
"hw.cpufrequency"
,
&
longVal
,
&
valSize
,
NULL
,
0
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment