Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
2ecac63d
Commit
2ecac63d
authored
Aug 11, 2015
by
A. Samy
Committed by
Rusty Russell
Aug 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpuid: rename ___cpuid to get_cpuid
parent
ea830cd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
ccan/cpuid/cpuid.c
ccan/cpuid/cpuid.c
+7
-7
No files found.
ccan/cpuid/cpuid.c
View file @
2ecac63d
...
...
@@ -37,7 +37,7 @@ enum {
};
#ifndef _MSC_VER
static
void
__
_cpuid
(
cpuid_t
info
,
uint32_t
*
eax
,
uint32_t
*
ebx
,
uint32_t
*
ecx
,
uint32_t
*
edx
)
static
void
get
_cpuid
(
cpuid_t
info
,
uint32_t
*
eax
,
uint32_t
*
ebx
,
uint32_t
*
ecx
,
uint32_t
*
edx
)
{
__asm__
(
"xchg %%ebx, %%edi
\n\t
"
/* 32bit PIC: Don't clobber ebx. */
...
...
@@ -50,7 +50,7 @@ static void ___cpuid(cpuid_t info, uint32_t *eax, uint32_t *ebx, uint32_t *ecx,
#else
#include <intrin.h>
static
void
__
_cpuid
(
cpuid_t
info
,
uint32_t
*
eax
,
uint32_t
*
ebx
,
uint32_t
*
ecx
,
uint32_t
*
edx
)
static
void
get
_cpuid
(
cpuid_t
info
,
uint32_t
*
eax
,
uint32_t
*
ebx
,
uint32_t
*
ecx
,
uint32_t
*
edx
)
{
uint32_t
registers
[
4
];
__cpuid
(
registers
,
info
);
...
...
@@ -236,7 +236,7 @@ cputype_t cpuid_get_cpu_type(void)
}
u
;
uint32_t
i
;
__
_cpuid
(
CPUID_VENDORID
,
&
i
,
&
u
.
bufu32
[
0
],
&
u
.
bufu32
[
2
],
&
u
.
bufu32
[
1
]);
get
_cpuid
(
CPUID_VENDORID
,
&
i
,
&
u
.
bufu32
[
0
],
&
u
.
bufu32
[
2
],
&
u
.
bufu32
[
1
]);
for
(
i
=
0
;
i
<
sizeof
(
c_cpunames
)
/
sizeof
(
c_cpunames
);
++
i
)
{
if
(
strncmp
(
c_cpunames
[
i
],
u
.
buf
,
sizeof
(
c_cpunames
[
0
]))
==
0
)
{
cputype
=
(
cputype_t
)
i
;
...
...
@@ -283,9 +283,9 @@ void cpuid(cpuid_t request, uint32_t *buf)
if
(
request
==
CPUID_PROC_BRAND_STRING
)
{
static
char
cached
[
48
]
=
{
0
};
if
(
cached
[
0
]
==
'\0'
)
{
__
_cpuid
(
CPUID_PROC_BRAND_STRING
,
&
buf
[
0
],
&
buf
[
1
],
&
buf
[
2
],
&
buf
[
3
]
);
__
_cpuid
(
CPUID_PROC_BRAND_STRING_INTERNAL0
,
&
buf
[
4
],
&
buf
[
5
],
&
buf
[
6
],
&
buf
[
7
]
);
__
_cpuid
(
CPUID_PROC_BRAND_STRING_INTERNAL1
,
&
buf
[
8
],
&
buf
[
9
],
&
buf
[
10
],
&
buf
[
11
]);
get
_cpuid
(
CPUID_PROC_BRAND_STRING
,
&
buf
[
0
],
&
buf
[
1
],
&
buf
[
2
],
&
buf
[
3
]
);
get
_cpuid
(
CPUID_PROC_BRAND_STRING_INTERNAL0
,
&
buf
[
4
],
&
buf
[
5
],
&
buf
[
6
],
&
buf
[
7
]
);
get
_cpuid
(
CPUID_PROC_BRAND_STRING_INTERNAL1
,
&
buf
[
8
],
&
buf
[
9
],
&
buf
[
10
],
&
buf
[
11
]);
memcpy
(
cached
,
buf
,
sizeof
cached
);
}
else
...
...
@@ -298,7 +298,7 @@ void cpuid(cpuid_t request, uint32_t *buf)
}
uint32_t
eax
,
ebx
,
ecx
,
edx
;
__
_cpuid
(
request
,
&
eax
,
&
ebx
,
&
ecx
,
&
edx
);
get
_cpuid
(
request
,
&
eax
,
&
ebx
,
&
ecx
,
&
edx
);
switch
(
request
)
{
case
CPUID_VENDORID
:
...
...
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