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
dce6f0fa
Commit
dce6f0fa
authored
Nov 07, 2013
by
Ahmed Samy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpuid: parse additional feature information for pCPU_PROCINFO_AND_FEATUREBITS
Signed-off-by:
Ahmed Samy
<
f.fallen45@gmail.com
>
parent
0e528772
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
ccan/cpuid/cpuid.c
ccan/cpuid/cpuid.c
+6
-2
ccan/cpuid/cpuid.h
ccan/cpuid/cpuid.h
+4
-2
ccan/cpuid/test/run.c
ccan/cpuid/test/run.c
+3
-1
No files found.
ccan/cpuid/cpuid.c
View file @
dce6f0fa
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
#include "cpuid.h"
#include "cpuid.h"
#include <string.h>
#include <string.h>
#include <stdio.h>
enum
{
enum
{
CPU_PROC_BRAND_STRING_INTERNAL0
=
0x80000003
,
CPU_PROC_BRAND_STRING_INTERNAL0
=
0x80000003
,
...
@@ -318,7 +317,12 @@ void cpuid(cpuid_t info, uint32_t *buf)
...
@@ -318,7 +317,12 @@ void cpuid(cpuid_t info, uint32_t *buf)
buf
[
5
]
=
edx
;
/* Feature flags #1. */
buf
[
5
]
=
edx
;
/* Feature flags #1. */
buf
[
6
]
=
ecx
;
/* Feature flags #2. */
buf
[
6
]
=
ecx
;
/* Feature flags #2. */
buf
[
7
]
=
ebx
;
/* Additional feature information. */
/* Additional Feature information. */
buf
[
7
]
=
ebx
&
0xFF
;
buf
[
8
]
=
(
ebx
>>
8
)
&
0xFF
;
buf
[
9
]
=
(
ebx
>>
16
)
&
0xFF
;
buf
[
10
]
=
(
ebx
>>
24
)
&
0xFF
;
break
;
break
;
case
CPU_CACHE_AND_TLBD_INFO
:
case
CPU_CACHE_AND_TLBD_INFO
:
buf
[
0
]
=
eax
;
buf
[
0
]
=
eax
;
...
...
ccan/cpuid/cpuid.h
View file @
dce6f0fa
...
@@ -180,8 +180,10 @@ uint32_t cpuid_highest_ext_func_supported(void);
...
@@ -180,8 +180,10 @@ uint32_t cpuid_highest_ext_func_supported(void);
* buf[4]: Extended Family
* buf[4]: Extended Family
* buf[5] and buf[6]:
* buf[5] and buf[6]:
* Feature flags
* Feature flags
* buf[7]:
* buf[7]: Brand Index
* Additional feature information.
* buf[8]: CL Flush Line Size
* buf[9]: Logical Processors
* buf[10]: Initial APICID
*
*
* For CPU_L1_CACHE_AND_TLB_IDS:
* For CPU_L1_CACHE_AND_TLB_IDS:
* buf[0]: (eax):
* buf[0]: (eax):
...
...
ccan/cpuid/test/run.c
View file @
dce6f0fa
...
@@ -18,10 +18,12 @@ int main(void)
...
@@ -18,10 +18,12 @@ int main(void)
cpuid
(
CPU_PROC_BRAND_STRING
,
(
uint32_t
*
)
buf
);
cpuid
(
CPU_PROC_BRAND_STRING
,
(
uint32_t
*
)
buf
);
printf
(
"Processor Brand: %s
\n
"
,
buf
);
printf
(
"Processor Brand: %s
\n
"
,
buf
);
uint32_t
procinfo
[
8
];
uint32_t
procinfo
[
11
];
cpuid
(
CPU_PROCINFO_AND_FEATUREBITS
,
procinfo
);
cpuid
(
CPU_PROCINFO_AND_FEATUREBITS
,
procinfo
);
printf
(
"Stepping: %d Model: 0x%X Family: %d extended model: %d extended family: %d
\n
"
,
printf
(
"Stepping: %d Model: 0x%X Family: %d extended model: %d extended family: %d
\n
"
,
procinfo
[
0
],
procinfo
[
1
],
procinfo
[
2
],
procinfo
[
3
],
procinfo
[
4
]);
procinfo
[
0
],
procinfo
[
1
],
procinfo
[
2
],
procinfo
[
3
],
procinfo
[
4
]);
printf
(
"Brand Index: %d CL Flush Line Size: %d Logical Processors: %d Initial APICID: %d
\n
"
,
procinfo
[
7
],
procinfo
[
8
],
procinfo
[
9
],
procinfo
[
10
]);
printf
(
"Highest extended function supported: %#010x
\n
"
,
cpuid_highest_ext_func_supported
());
printf
(
"Highest extended function supported: %#010x
\n
"
,
cpuid_highest_ext_func_supported
());
...
...
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