Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0a9b6cf1
Commit
0a9b6cf1
authored
Aug 05, 2003
by
Lionel Ulmer
Committed by
Alexandre Julliard
Aug 05, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the MHz detection code.
parent
2ec3bbcc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
cpu.c
misc/cpu.c
+23
-12
No files found.
misc/cpu.c
View file @
0a9b6cf1
...
...
@@ -273,15 +273,20 @@ VOID WINAPI GetSystemInfo(
/* NOTE: the ':' is the only character we can rely on */
if
(
!
(
value
=
strchr
(
line
,
':'
)))
continue
;
/* terminate the valuename */
*
value
++
=
'\0'
;
/* skip any leading spaces */
s
=
value
-
1
;
while
((
s
>=
line
)
&&
((
*
s
==
' '
)
||
(
*
s
==
'\t'
)))
s
--
;
*
(
s
+
1
)
=
'\0'
;
/* and strip leading spaces from value */
value
+=
1
;
while
(
*
value
==
' '
)
value
++
;
if
((
s
=
strchr
(
value
,
'\n'
)))
*
s
=
'\0'
;
/* 2.1 method */
if
(
!
str
ncasecmp
(
line
,
"cpu family"
,
strlen
(
"cpu family"
)
))
{
if
(
!
str
casecmp
(
line
,
"cpu family"
))
{
if
(
isdigit
(
value
[
0
]))
{
switch
(
value
[
0
]
-
'0'
)
{
case
3
:
cachedsi
.
dwProcessorType
=
PROCESSOR_INTEL_386
;
...
...
@@ -311,7 +316,7 @@ VOID WINAPI GetSystemInfo(
continue
;
}
/* old 2.0 method */
if
(
!
str
ncasecmp
(
line
,
"cpu"
,
strlen
(
"cpu"
)
))
{
if
(
!
str
casecmp
(
line
,
"cpu"
))
{
if
(
isdigit
(
value
[
0
])
&&
value
[
1
]
==
'8'
&&
value
[
2
]
==
'6'
&&
value
[
3
]
==
0
)
{
...
...
@@ -334,42 +339,47 @@ VOID WINAPI GetSystemInfo(
}
continue
;
}
if
(
!
str
ncasecmp
(
line
,
"fdiv_bug"
,
strlen
(
"fdiv_bug"
)
))
{
if
(
!
str
casecmp
(
line
,
"fdiv_bug"
))
{
if
(
!
strncasecmp
(
value
,
"yes"
,
3
))
PF
[
PF_FLOATING_POINT_PRECISION_ERRATA
]
=
TRUE
;
continue
;
}
if
(
!
str
ncasecmp
(
line
,
"fpu"
,
strlen
(
"fpu"
)
))
{
if
(
!
str
casecmp
(
line
,
"fpu"
))
{
if
(
!
strncasecmp
(
value
,
"no"
,
2
))
PF
[
PF_FLOATING_POINT_EMULATED
]
=
TRUE
;
continue
;
}
if
(
!
str
ncasecmp
(
line
,
"processor"
,
strlen
(
"processor"
)
))
{
if
(
!
str
casecmp
(
line
,
"processor"
))
{
/* processor number counts up... */
unsigned
int
x
;
if
(
sscanf
(
value
,
"%d"
,
&
x
))
if
(
x
+
1
>
cachedsi
.
dwNumberOfProcessors
)
cachedsi
.
dwNumberOfProcessors
=
x
+
1
;
continue
;
}
if
(
!
str
ncasecmp
(
line
,
"stepping"
,
strlen
(
"stepping"
)
))
{
if
(
!
str
casecmp
(
line
,
"stepping"
))
{
int
x
;
if
(
sscanf
(
value
,
"%d"
,
&
x
))
cachedsi
.
wProcessorRevision
=
x
;
continue
;
}
if
(
!
str
ncasecmp
(
line
,
"cpu MHz"
,
strlen
(
"cpu MHz"
)
))
{
if
(
!
str
casecmp
(
line
,
"cpu MHz"
))
{
double
cmz
;
if
(
sscanf
(
value
,
"%lf"
,
&
cmz
)
==
1
)
{
/* SYSTEMINFO doesn't have a slot for cpu speed, so store in a global */
cpuHz
=
cmz
*
1000
*
1000
;
TRACE
(
"CPU speed read as %lld
\n
"
,
cpuHz
);
}
continue
;
}
if
(
!
str
ncasecmp
(
line
,
"flags"
,
strlen
(
"flags"
)
)
||
!
str
ncasecmp
(
line
,
"features"
,
strlen
(
"features"
)
)
if
(
!
str
casecmp
(
line
,
"flags"
)
||
!
str
casecmp
(
line
,
"features"
)
)
{
if
(
strstr
(
value
,
"cx8"
))
PF
[
PF_COMPARE_EXCHANGE_DOUBLE
]
=
TRUE
;
...
...
@@ -387,7 +397,8 @@ VOID WINAPI GetSystemInfo(
PF
[
PF_XMMI64_INSTRUCTIONS_AVAILABLE
]
=
TRUE
;
if
(
strstr
(
value
,
"pae"
))
PF
[
PF_PAE_ENABLED
]
=
TRUE
;
continue
;
}
}
fclose
(
f
);
...
...
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