Kernel: Consolidate features into CPUFeature enum

This allows us to consolidate printing out all the CPU features
into one log statement. Also expose them in /proc/cpuinfo
This commit is contained in:
Tom 2020-07-03 10:23:09 -06:00 committed by Andreas Kling
parent e373e5f007
commit 9b4e6f6a23
Notes: sideshowbarker 2024-07-19 05:12:39 +09:00
9 changed files with 197 additions and 145 deletions

View file

@ -80,7 +80,7 @@ void MemoryManager::protect_kernel_image()
pte.set_writable(false);
}
if (g_cpu_supports_nx) {
if (Processor::current().has_feature(CPUFeature::NX)) {
// Disable execution of the kernel data and bss segments.
for (size_t i = (FlatPtr)&start_of_kernel_data; i < (FlatPtr)&end_of_kernel_bss; i += PAGE_SIZE) {
auto& pte = ensure_pte(kernel_page_directory(), VirtualAddress(i));