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
47fe8809
Commit
47fe8809
authored
Jan 19, 2005
by
Rein Klazes
Committed by
Alexandre Julliard
Jan 19, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return a fixed frequency of 1193182 Hz for the Performance Counter.
parent
c1b4d7d1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
cpu.c
dlls/kernel/cpu.c
+8
-5
No files found.
dlls/kernel/cpu.c
View file @
47fe8809
...
...
@@ -188,7 +188,8 @@ BOOL WINAPI QueryPerformanceCounter(PLARGE_INTEGER counter)
/* i586 optimized version */
__asm__
__volatile__
(
"rdtsc"
:
"=a"
(
counter
->
u
.
LowPart
),
"=d"
(
counter
->
u
.
HighPart
)
);
counter
->
QuadPart
=
counter
->
QuadPart
/
1000
;
/* see below */
/* see below */
counter
->
QuadPart
=
counter
->
QuadPart
/
(
cpuHz
/
1193182
)
;
return
TRUE
;
}
#endif
...
...
@@ -219,10 +220,12 @@ BOOL WINAPI QueryPerformanceFrequency(PLARGE_INTEGER frequency)
{
#if defined(__i386__) && defined(__GNUC__)
if
(
IsProcessorFeaturePresent
(
PF_RDTSC_INSTRUCTION_AVAILABLE
))
{
/* The way Windows calculates this value is unclear, however simply using the CPU frequency
gives a value out by approximately a thousand. That can cause some applications to crash,
so we divide here to make our number more similar to the one Windows gives */
frequency
->
QuadPart
=
cpuHz
/
1000
;
/* On a standard PC, Windows returns the clock frequency for the
* 8253 Programmable Interrupt Timer, which has been 1193182 Hz
* since the first IBM PC (cpuHz/4). There are applications that
* crash when the returned frequency is much higher or lower, so
* do not try to be smart */
frequency
->
QuadPart
=
1193182
;
return
TRUE
;
}
#endif
...
...
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