summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AK/Debug.h.in4
-rw-r--r--Kernel/CMakeLists.txt2
-rw-r--r--Kernel/Debug.h.in4
-rw-r--r--Kernel/Storage/StorageManagement.cpp4
-rw-r--r--Userland/Libraries/LibPartition/CMakeLists.txt1
-rw-r--r--Userland/Libraries/LibPartition/GUIDPartitionTable.cpp (renamed from Kernel/Storage/Partition/GUIDPartitionTable.cpp)13
-rw-r--r--Userland/Libraries/LibPartition/GUIDPartitionTable.h (renamed from Kernel/Storage/Partition/GUIDPartitionTable.h)14
7 files changed, 17 insertions, 25 deletions
diff --git a/AK/Debug.h.in b/AK/Debug.h.in
index dfaaf8a234..df89896591 100644
--- a/AK/Debug.h.in
+++ b/AK/Debug.h.in
@@ -174,6 +174,10 @@
#cmakedefine01 GLOBAL_DTORS_DEBUG
#endif
+#ifndef GPT_DEBUG
+#cmakedefine01 GPT_DEBUG
+#endif
+
#ifndef GZIP_DEBUG
#cmakedefine01 GZIP_DEBUG
#endif
diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt
index 59deda8990..4cdbdaf0ee 100644
--- a/Kernel/CMakeLists.txt
+++ b/Kernel/CMakeLists.txt
@@ -104,7 +104,6 @@ set(KERNEL_SOURCES
Storage/ATA/ATAPIDiscDevice.cpp
Storage/ATA/ATAPort.cpp
Storage/Partition/DiskPartition.cpp
- Storage/Partition/GUIDPartitionTable.cpp
Storage/NVMe/NVMeController.cpp
Storage/NVMe/NVMeNameSpace.cpp
Storage/NVMe/NVMeInterruptQueue.cpp
@@ -404,6 +403,7 @@ set(CRYPTO_SOURCES
set(PARTITION_SOURCES
../Userland/Libraries/LibPartition/DiskPartitionMetadata.cpp
../Userland/Libraries/LibPartition/EBRPartitionTable.cpp
+ ../Userland/Libraries/LibPartition/GUIDPartitionTable.cpp
../Userland/Libraries/LibPartition/MBRPartitionTable.cpp
../Userland/Libraries/LibPartition/PartitionTable.cpp
)
diff --git a/Kernel/Debug.h.in b/Kernel/Debug.h.in
index d5d6d9fc09..6ae13d54aa 100644
--- a/Kernel/Debug.h.in
+++ b/Kernel/Debug.h.in
@@ -107,10 +107,6 @@
#cmakedefine01 FUTEXQUEUE_DEBUG
#endif
-#ifndef GPT_DEBUG
-#cmakedefine01 GPT_DEBUG
-#endif
-
#ifndef HPET_COMPARATOR_DEBUG
#cmakedefine01 HPET_COMPARATOR_DEBUG
#endif
diff --git a/Kernel/Storage/StorageManagement.cpp b/Kernel/Storage/StorageManagement.cpp
index ce7c41e5c3..335d80f782 100644
--- a/Kernel/Storage/StorageManagement.cpp
+++ b/Kernel/Storage/StorageManagement.cpp
@@ -21,10 +21,10 @@
#include <Kernel/Storage/ATA/GenericIDE/ISAController.h>
#include <Kernel/Storage/ATA/GenericIDE/PCIController.h>
#include <Kernel/Storage/NVMe/NVMeController.h>
-#include <Kernel/Storage/Partition/GUIDPartitionTable.h>
#include <Kernel/Storage/Ramdisk/Controller.h>
#include <Kernel/Storage/StorageManagement.h>
#include <LibPartition/EBRPartitionTable.h>
+#include <LibPartition/GUIDPartitionTable.h>
#include <LibPartition/MBRPartitionTable.h>
namespace Kernel {
@@ -140,7 +140,7 @@ UNMAP_AFTER_INIT ErrorOr<NonnullOwnPtr<Partition::PartitionTable>> StorageManage
if (!ebr_table_or_error.is_error()) {
return ebr_table_or_error.release_value();
}
- return TRY(GUIDPartitionTable::try_to_initialize(device));
+ return TRY(Partition::GUIDPartitionTable::try_to_initialize(device));
}
UNMAP_AFTER_INIT void StorageManagement::enumerate_disk_partitions()
diff --git a/Userland/Libraries/LibPartition/CMakeLists.txt b/Userland/Libraries/LibPartition/CMakeLists.txt
index adae3e4c98..08682886dc 100644
--- a/Userland/Libraries/LibPartition/CMakeLists.txt
+++ b/Userland/Libraries/LibPartition/CMakeLists.txt
@@ -1,6 +1,7 @@
set(SOURCES
DiskPartitionMetadata.cpp
EBRPartitionTable.cpp
+ GUIDPartitionTable.cpp
MBRPartitionTable.cpp
PartitionTable.cpp
)
diff --git a/Kernel/Storage/Partition/GUIDPartitionTable.cpp b/Userland/Libraries/LibPartition/GUIDPartitionTable.cpp
index ff71737ea4..45028102ff 100644
--- a/Kernel/Storage/Partition/GUIDPartitionTable.cpp
+++ b/Userland/Libraries/LibPartition/GUIDPartitionTable.cpp
@@ -4,16 +4,13 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-#include <AK/AllOf.h>
-#include <AK/Array.h>
-#include <Kernel/Debug.h>
-#include <Kernel/Storage/Partition/GUIDPartitionTable.h>
+#include <AK/Debug.h>
+#include <LibPartition/GUIDPartitionTable.h>
-namespace Kernel {
+namespace Partition {
#define GPT_SIGNATURE2 0x54524150
#define GPT_SIGNATURE 0x20494645
-#define BytesPerSector 512
struct [[gnu::packed]] GPTPartitionEntry {
u8 partition_guid[16];
@@ -47,7 +44,7 @@ struct [[gnu::packed]] GUIDPartitionHeader {
u32 crc32_entries_array;
};
-ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize(StorageDevice const& device)
+ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize(Kernel::StorageDevice const& device)
{
auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) GUIDPartitionTable(device)));
if (!table->is_valid())
@@ -55,7 +52,7 @@ ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize
return table;
}
-GUIDPartitionTable::GUIDPartitionTable(StorageDevice const& device)
+GUIDPartitionTable::GUIDPartitionTable(Kernel::StorageDevice const& device)
: MBRPartitionTable(device)
{
// FIXME: Handle OOM failure here.
diff --git a/Kernel/Storage/Partition/GUIDPartitionTable.h b/Userland/Libraries/LibPartition/GUIDPartitionTable.h
index 163e75fb61..eda6473933 100644
--- a/Kernel/Storage/Partition/GUIDPartitionTable.h
+++ b/Userland/Libraries/LibPartition/GUIDPartitionTable.h
@@ -6,23 +6,17 @@
#pragma once
-#include <AK/Error.h>
-#include <AK/RefPtr.h>
-#include <AK/Result.h>
-#include <AK/Types.h>
-#include <AK/Vector.h>
#include <LibPartition/MBRPartitionTable.h>
-namespace Kernel {
+namespace Partition {
struct GUIDPartitionHeader;
-class GUIDPartitionTable final : public Partition::MBRPartitionTable {
+class GUIDPartitionTable final : public MBRPartitionTable {
public:
virtual ~GUIDPartitionTable() = default;
- ;
- static ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> try_to_initialize(StorageDevice const&);
- explicit GUIDPartitionTable(StorageDevice const&);
+ static ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> try_to_initialize(Kernel::StorageDevice const&);
+ explicit GUIDPartitionTable(Kernel::StorageDevice const&);
virtual bool is_valid() const override { return m_valid; };