Kernel: Add CPUID check for 1 GiB page support

This commit is contained in:
Bananymous 2024-10-14 11:38:03 +03:00
parent 2b43569927
commit 5f63ea8f8a
2 changed files with 11 additions and 0 deletions

View File

@ -80,5 +80,6 @@ namespace CPUID
bool has_nxe();
bool has_pge();
bool has_pat();
bool has_1gib_pages();
}

View File

@ -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)