Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
3bbbeb8e
"platforms/vscode:/vscode.git/clone" did not exist on "b0c2c4d84ef1ac82984a577c7506912f5f91bafa"
Commit
3bbbeb8e
authored
Aug 20, 2013
by
peastman
Browse files
cpuid() works correctly on both 32 and 64 bit OSes
parent
a8ff237c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
plugins/cpupme/src/CpuPmeKernels.cpp
plugins/cpupme/src/CpuPmeKernels.cpp
+11
-0
No files found.
plugins/cpupme/src/CpuPmeKernels.cpp
View file @
3bbbeb8e
...
...
@@ -95,6 +95,16 @@ static int getNumProcessors() {
#define cpuid __cpuid
#else
static
void
cpuid
(
int
cpuInfo
[
4
],
int
infoType
){
#ifdef __LP64__
__asm__
__volatile__
(
"cpuid"
:
"=a"
(
cpuInfo
[
0
]),
"=b"
(
cpuInfo
[
1
]),
"=c"
(
cpuInfo
[
2
]),
"=d"
(
cpuInfo
[
3
])
:
"a"
(
infoType
)
);
#else
__asm__
__volatile__
(
"pushl %%ebx
\n
"
"cpuid
\n
"
...
...
@@ -106,6 +116,7 @@ static void cpuid(int cpuInfo[4], int infoType){
"=d"
(
cpuInfo
[
3
])
:
"a"
(
infoType
)
);
#endif
}
#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