Kernel: Move CPU feature detection to Arch/x86/CPU.{cpp.h}

We now refuse to boot on machines that don't support PAE since all
of our paging code depends on it.

Also let's only enable SSE and PGE support if the CPU advertises it.
This commit is contained in:
Andreas Kling 2020-01-01 12:56:21 +01:00
commit 5aeaab601e
Notes: sideshowbarker 2024-07-19 10:29:46 +09:00
6 changed files with 70 additions and 44 deletions

View file

@ -223,7 +223,7 @@ void Region::remap_page(size_t index)
pte.set_writable(false);
else
pte.set_writable(is_writable());
if (MM.has_nx_support())
if (g_cpu_supports_nx)
pte.set_execute_disabled(!is_executable());
pte.set_user_allowed(is_user_accessible());
m_page_directory->flush(page_vaddr);
@ -273,7 +273,7 @@ void Region::map(PageDirectory& page_directory)
pte.set_writable(false);
else
pte.set_writable(is_writable());
if (MM.has_nx_support())
if (g_cpu_supports_nx)
pte.set_execute_disabled(!is_executable());
} else {
pte.set_physical_page_base(0);