mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
core/sys/info: Fix the CPUID check
This needs to test that the n-th bit is set.
This commit is contained in:
@@ -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