diff --git a/kernel/include/kernel/CPUID.h b/kernel/include/kernel/CPUID.h index ac12e2e8e4..e4aef13a60 100644 --- a/kernel/include/kernel/CPUID.h +++ b/kernel/include/kernel/CPUID.h @@ -80,5 +80,6 @@ namespace CPUID bool has_nxe(); bool has_pge(); bool has_pat(); + bool has_1gib_pages(); } diff --git a/kernel/kernel/CPUID.cpp b/kernel/kernel/CPUID.cpp index 046aeee6f2..57b1a13876 100644 --- a/kernel/kernel/CPUID.cpp +++ b/kernel/kernel/CPUID.cpp @@ -64,6 +64,16 @@ namespace CPUID return edx & CPUID::EDX_PAT; } + bool has_1gib_pages() + { + uint32_t buffer[4] {}; + get_cpuid(0x80000000, buffer); + if (buffer[0] < 0x80000001) + return false; + get_cpuid(0x80000001, buffer); + return buffer[3] & (1 << 26); + } + const char* feature_string_ecx(uint32_t feat) { switch (feat)