Browse Source

Kernel: Make PageDirectory.cpp compile on aarch64

James Mintram 3 năm trước cách đây
mục cha
commit
d3b6201b40

+ 1 - 1
Kernel/Arch/x86/PageDirectory.h → Kernel/Arch/PageDirectory.h

@@ -12,7 +12,6 @@
 #include <Kernel/PhysicalAddress.h>
 
 #include <AK/Platform.h>
-VALIDATE_IS_X86()
 
 namespace Kernel {
 
@@ -83,6 +82,7 @@ public:
     PhysicalPtr physical_page_base() const { return PhysicalAddress::physical_page_base(m_raw); }
     void set_physical_page_base(PhysicalPtr value)
     {
+        // FIXME: IS THIS PLATFORM SPECIFIC?
         m_raw &= 0x8000000000000fffULL;
         m_raw |= PhysicalAddress::physical_page_base(value);
     }

+ 1 - 3
Kernel/Arch/x86/PageFault.h → Kernel/Arch/PageFault.h

@@ -6,12 +6,10 @@
 
 #pragma once
 
+#include <AK/Platform.h>
 #include <AK/Types.h>
 #include <Kernel/VirtualAddress.h>
 
-#include <AK/Platform.h>
-VALIDATE_IS_X86()
-
 namespace Kernel {
 
 struct PageFaultFlags {

+ 3 - 0
Kernel/Arch/aarch64/Processor.h

@@ -33,6 +33,9 @@ public:
     ALWAYS_INLINE static void pause() { }
     ALWAYS_INLINE static void wait_check() { }
 
+    ALWAYS_INLINE u8 physical_address_bit_width() const { return 0; }
+    ALWAYS_INLINE u8 virtual_address_bit_width() const { return 0; }
+
     ALWAYS_INLINE static bool is_initialized()
     {
         return false;

+ 1 - 1
Kernel/Arch/x86/Processor.h

@@ -12,11 +12,11 @@
 #include <AK/Types.h>
 
 #include <Kernel/Arch/DeferredCallEntry.h>
+#include <Kernel/Arch/PageDirectory.h>
 #include <Kernel/Arch/ProcessorSpecificDataID.h>
 #include <Kernel/Arch/x86/ASM_wrapper.h>
 #include <Kernel/Arch/x86/CPUID.h>
 #include <Kernel/Arch/x86/DescriptorTable.h>
-#include <Kernel/Arch/x86/PageDirectory.h>
 #include <Kernel/Arch/x86/TSS.h>
 #include <Kernel/Forward.h>
 #include <Kernel/KString.h>

+ 1 - 1
Kernel/Arch/x86/common/Interrupts.cpp

@@ -23,10 +23,10 @@
 
 #include <LibC/mallocdefs.h>
 
+#include <Kernel/Arch/PageFault.h>
 #include <Kernel/Arch/Processor.h>
 #include <Kernel/Arch/RegisterState.h>
 #include <Kernel/Arch/x86/ISRStubs.h>
-#include <Kernel/Arch/x86/PageFault.h>
 #include <Kernel/Arch/x86/SafeMem.h>
 #include <Kernel/Arch/x86/TrapFrame.h>
 

+ 1 - 1
Kernel/Memory/MemoryManager.cpp

@@ -7,7 +7,7 @@
 #include <AK/Assertions.h>
 #include <AK/Memory.h>
 #include <AK/StringView.h>
-#include <Kernel/Arch/x86/PageFault.h>
+#include <Kernel/Arch/PageFault.h>
 #include <Kernel/BootInfo.h>
 #include <Kernel/CMOS.h>
 #include <Kernel/FileSystem/Inode.h>

+ 2 - 0
Kernel/Memory/PageDirectory.cpp

@@ -6,6 +6,8 @@
 
 #include <AK/Memory.h>
 #include <AK/Singleton.h>
+#include <Kernel/Arch/CPU.h>
+#include <Kernel/Arch/PageDirectory.h>
 #include <Kernel/Memory/MemoryManager.h>
 #include <Kernel/Memory/PageDirectory.h>
 #include <Kernel/Prekernel/Prekernel.h>