core/sys/info: Fix the CPUID check
This needs to test that the n-th bit is set.
This commit is contained in:
1 parent
3fed1af7df
commit
def4fdc3f3
1 file changed
+1
-1
@@ -38,7 +38,7 @@ cpu_name: Maybe(string)
|
|||||||
@(init, private)
|
@(init, private)
|
||||||
init_cpu_features :: proc "c" () {
|
init_cpu_features :: proc "c" () {
|
||||||
is_set :: #force_inline proc "c" (hwc: u32, value: u32) -> bool {
|
is_set :: #force_inline proc "c" (hwc: u32, value: u32) -> bool {
|
||||||
return hwc&value != 0
|
return hwc&(1 << value) != 0
|
||||||
}
|
}
|
||||||
try_set :: #force_inline proc "c" (set: ^CPU_Features, feature: CPU_Feature, hwc: u32, value: u32) {
|
try_set :: #force_inline proc "c" (set: ^CPU_Features, feature: CPU_Feature, hwc: u32, value: u32) {
|
||||||
if is_set(hwc, value) {
|
if is_set(hwc, value) {
|
||||||
|
|||||||
Reference in new issue
Block a user