summaryrefslogtreecommitdiff
path: root/Kernel/Prekernel
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-07-19 17:54:51 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-20 15:12:19 +0200
commitdd42093b932161bf4d6f98f1e25093049824d6b2 (patch)
treeef9be622374afc88cd4186ad4a4ca8306aed0351 /Kernel/Prekernel
parentb4600f2996c5f29dbcb17b3c33d3edf8a55ef5b5 (diff)
downloadserenity-dd42093b932161bf4d6f98f1e25093049824d6b2.zip
Kernel: Move boot info declarations to a header file
Instead of manually redeclaring those variables in various files this now adds a header file for them.
Diffstat (limited to 'Kernel/Prekernel')
-rw-r--r--Kernel/Prekernel/BootInfo.h30
-rw-r--r--Kernel/Prekernel/Prekernel.h26
-rw-r--r--Kernel/Prekernel/init.cpp1
3 files changed, 26 insertions, 31 deletions
diff --git a/Kernel/Prekernel/BootInfo.h b/Kernel/Prekernel/BootInfo.h
deleted file mode 100644
index 04dcba19ce..0000000000
--- a/Kernel/Prekernel/BootInfo.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2021, Gunnar Beutner <gbeutner@serenityos.org>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
-
-#pragma once
-
-#include <AK/Platform.h>
-#include <Kernel/Multiboot.h>
-
-namespace Kernel {
-
-struct [[gnu::packed]] BootInfo {
- u8 const* start_of_prekernel_image;
- u8 const* end_of_prekernel_image;
- FlatPtr kernel_base;
- multiboot_info* multiboot_info_ptr;
-#if ARCH(X86_64)
- u32 gdt64ptr;
- u16 code64_sel;
- FlatPtr boot_pml4t;
-#endif
- FlatPtr boot_pdpt;
- FlatPtr boot_pd0;
- FlatPtr boot_pd_kernel;
- FlatPtr boot_pd_kernel_pt1023;
- char const* kernel_cmdline;
-};
-}
diff --git a/Kernel/Prekernel/Prekernel.h b/Kernel/Prekernel/Prekernel.h
index 6ce2159be0..fede32092b 100644
--- a/Kernel/Prekernel/Prekernel.h
+++ b/Kernel/Prekernel/Prekernel.h
@@ -6,4 +6,30 @@
#pragma once
+#ifdef __cplusplus
+# include <Kernel/Multiboot.h>
+#endif
+
#define MAX_KERNEL_SIZE 0x3000000
+
+#ifdef __cplusplus
+namespace Kernel {
+
+struct [[gnu::packed]] BootInfo {
+ u8 const* start_of_prekernel_image;
+ u8 const* end_of_prekernel_image;
+ FlatPtr kernel_base;
+ multiboot_info* multiboot_info_ptr;
+# if ARCH(X86_64)
+ u32 gdt64ptr;
+ u16 code64_sel;
+ FlatPtr boot_pml4t;
+# endif
+ FlatPtr boot_pdpt;
+ FlatPtr boot_pd0;
+ FlatPtr boot_pd_kernel;
+ FlatPtr boot_pd_kernel_pt1023;
+ char const* kernel_cmdline;
+};
+}
+#endif
diff --git a/Kernel/Prekernel/init.cpp b/Kernel/Prekernel/init.cpp
index a45930a1ba..a0801f6dc6 100644
--- a/Kernel/Prekernel/init.cpp
+++ b/Kernel/Prekernel/init.cpp
@@ -8,7 +8,6 @@
#include <AK/Types.h>
#include <Kernel/Multiboot.h>
-#include <Kernel/Prekernel/BootInfo.h>
#include <Kernel/Prekernel/Prekernel.h>
#include <Kernel/VirtualAddress.h>
#include <LibC/elf.h>