Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel
Commits
3a4df3da
Commit
3a4df3da
authored
Mar 27, 2022
by
carlushuang
Browse files
fix a bug in cpuid on amdcpu
parent
2af81173
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
include/ck/utility/cpuid.hpp
include/ck/utility/cpuid.hpp
+8
-2
No files found.
include/ck/utility/cpuid.hpp
View file @
3a4df3da
...
...
@@ -76,16 +76,21 @@ static inline cpuid_vendor cpuid_query_vendor()
{
return
cpuid_vendor_intel
;
}
if
(
r
.
ebx
==
0x68747541U
/*Auth*/
&&
r
.
edx
==
0x746
56273
U
/*enti*/
&&
if
(
r
.
ebx
==
0x68747541U
/*Auth*/
&&
r
.
edx
==
0x
69
746
E65
U
/*enti*/
&&
r
.
ecx
==
0x444D4163U
/*cAMD*/
)
{
return
cpuid_vendor_amd
;
}
if
(
r
.
ebx
==
0x69444D41U
/*AMDi*/
&&
r
.
edx
==
0x
69746E65
U
/*sbet*/
&&
if
(
r
.
ebx
==
0x69444D41U
/*AMDi*/
&&
r
.
edx
==
0x
74656273
U
/*sbet*/
&&
r
.
ecx
==
0x21726574U
/*ter */
)
{
return
cpuid_vendor_amd
;
}
if
(
r
.
ebx
==
0x20444D41U
/*AMD */
&&
r
.
edx
==
0x45425349U
/*ISBE*/
&&
r
.
ecx
==
0x52455454U
/*TTER*/
)
{
return
cpuid_vendor_amd
;
}
return
cpuid_vendor_other
;
}
...
...
@@ -94,6 +99,7 @@ static inline cpuid_cache_hierarchy cpuid_query_cache()
cpuid_cache_hierarchy
cache_hierarchy
;
cpuid_vendor
vendor
=
cpuid_query_vendor
();
uint32_t
leaf_cache_id
=
vendor
==
cpuid_vendor_amd
?
0x8000001d
:
0x4
;
printf
(
"leaf_cache_id:%u, vendor:%d
\n
"
,
leaf_cache_id
,
vendor
);
for
(
uint32_t
ecx_idx
=
0
;;
ecx_idx
++
)
{
...
...
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