Skip to content

Commit 16536d9

Browse files
changed fred detection
1 parent 55fb2bf commit 16536d9

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/idt.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ static inline void write_cr4(uint64_t cr4)
6767

6868
static bool fred_supported(void)
6969
{
70-
unsigned int eax, ebx, ecx, edx;
71-
72-
if (!__get_cpuid_count(7, 1, &eax, &ebx, &ecx, &edx)) {
73-
return false;
74-
}
75-
76-
return (eax & (1u << 17)) != 0;
70+
uint32_t eax = 7, ebx = 0, ecx = 1, edx = 0;
71+
__asm__ volatile (
72+
"cpuid"
73+
: "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
74+
: "a"(eax), "c"(ecx)
75+
);
76+
return (eax >> 17) & 1u;
7777
}
7878

7979
static void interrupt_bsp_common_early_init(void)

0 commit comments

Comments
 (0)