Browse Source

Kernel: Use FlatPtr for register-sized values

Gunnar Beutner 4 years ago
parent
commit
a8587fbfb9

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

@@ -437,7 +437,7 @@ public:
     [[noreturn]] void initialize_context_switching(Thread& initial_thread);
     NEVER_INLINE void switch_context(Thread*& from_thread, Thread*& to_thread);
     [[noreturn]] static void assume_context(Thread& thread, FlatPtr flags);
-    u32 init_context(Thread& thread, bool leave_crit);
+    FlatPtr init_context(Thread& thread, bool leave_crit);
     static Vector<FlatPtr> capture_stack_trace(Thread& thread, size_t max_frames = 0);
 
     String platform_string() const;

+ 2 - 2
Kernel/Arch/x86/common/Processor.cpp

@@ -44,7 +44,7 @@ extern "C" void exit_kernel_thread(void);
 // Declare them, to avoid dead code warnings.
 extern "C" void context_first_init(Thread* from_thread, Thread* to_thread, TrapFrame* trap) __attribute__((used));
 extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread) __attribute__((used));
-extern "C" u32 do_init_context(Thread* thread, u32 flags) __attribute__((used));
+extern "C" FlatPtr do_init_context(Thread* thread, u32 flags) __attribute__((used));
 
 UNMAP_AFTER_INIT static void sse_init()
 {
@@ -1223,7 +1223,7 @@ extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread)
     // TODO: ioperm?
 }
 
-extern "C" u32 do_init_context(Thread* thread, u32 flags)
+extern "C" FlatPtr do_init_context(Thread* thread, u32 flags)
 {
     VERIFY_INTERRUPTS_DISABLED();
 #if ARCH(I386)

+ 1 - 1
Kernel/Arch/x86/i386/Processor.cpp

@@ -65,7 +65,7 @@ String Processor::platform_string() const
     return "i386";
 }
 
-u32 Processor::init_context(Thread& thread, bool leave_crit)
+FlatPtr Processor::init_context(Thread& thread, bool leave_crit)
 {
     VERIFY(is_kernel_mode());
     VERIFY(g_scheduler_lock.is_locked());

+ 1 - 1
Kernel/Arch/x86/x86_64/Processor.cpp

@@ -67,7 +67,7 @@ String Processor::platform_string() const
 }
 
 // FIXME: For the most part this is a copy of the i386-specific function, get rid of the code duplication
-u32 Processor::init_context(Thread& thread, bool leave_crit)
+FlatPtr Processor::init_context(Thread& thread, bool leave_crit)
 {
     VERIFY(is_kernel_mode());
     VERIFY(g_scheduler_lock.is_locked());