summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/FirmwareKit/GPT.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-02 19:38:46 +0200
committerGitHub <noreply@github.com>2025-05-02 19:38:46 +0200
commit997be16e5ac9a68d54882ab69529815860d62955 (patch)
tree19d6129c2d776bb1edc5d4a7325e39ca176c3403 /dev/kernel/FirmwareKit/GPT.h
parent618104e74c195d7508a18450524f8ed7f9af8cc6 (diff)
parentb3b4b1ebdcd6adeac914869017c86d892b7a8ced (diff)
Merge pull request #28 from nekernel-org/dev
0.0.2
Diffstat (limited to 'dev/kernel/FirmwareKit/GPT.h')
-rw-r--r--dev/kernel/FirmwareKit/GPT.h85
1 files changed, 36 insertions, 49 deletions
diff --git a/dev/kernel/FirmwareKit/GPT.h b/dev/kernel/FirmwareKit/GPT.h
index dc2b5ce3..7e5a910b 100644
--- a/dev/kernel/FirmwareKit/GPT.h
+++ b/dev/kernel/FirmwareKit/GPT.h
@@ -1,61 +1,48 @@
/* -------------------------------------------
- Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
+ Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
------------------------------------------- */
#pragma once
-#include <NewKit/Defines.h>
#include <FirmwareKit/EFI/EFI.h>
+#include <NewKit/Defines.h>
-#define kSectorAlignGPT_PartTbl (420U)
+#define kSectorAlignGPT_PartTbl (420U)
#define kSectorAlignGPT_PartEntry (72U)
-#define kMagicLenGPT (8U)
-#define kMagicGPT ("EFI PART") // "EFI PART"
+#define kMagicLenGPT (8U)
+#define kMagicGPT ("EFI PART") // "EFI PART"
#define kGPTPartitionTableLBA (512U + sizeof(GPT_PARTITION_TABLE))
-namespace Kernel
-{
- struct GPT_GUID;
- struct GPT_PARTITION_TABLE;
- struct GPT_PARTITION_ENTRY;
-
- /// @brief GPT GUID structure.
- typedef struct GPT_GUID
- {
- Kernel::UInt32 Data1;
- Kernel::UInt16 Data2;
- Kernel::UInt16 Data3;
- Kernel::UInt8 Data4[8];
- } GPT_GUID;
-
- struct PACKED GPT_PARTITION_TABLE final
- {
- Char Signature[kMagicLenGPT];
- UInt32 Revision;
- UInt32 HeaderSize;
- UInt32 CRC32;
- UInt32 Reserved1;
- UInt64 LBAHeader;
- UInt64 LBAAltHeader;
- UInt64 FirstGPTEntry;
- UInt64 LastGPTEntry;
- GPT_GUID Guid;
- UInt64 StartingLBA;
- UInt32 NumPartitionEntries;
- UInt32 SizeOfEntries;
- UInt32 CRC32PartEntry;
- UInt8 Reserved2[kSectorAlignGPT_PartTbl];
- };
-
- struct PACKED GPT_PARTITION_ENTRY
- {
- GPT_GUID PartitionTypeGUID;
- GPT_GUID UniquePartitionGUID;
- UInt64 StartLBA;
- UInt64 EndLBA;
- UInt64 Attributes;
- UInt8 Name[kSectorAlignGPT_PartEntry];
- };
-} // namespace Kernel
+namespace Kernel {
+struct GPT_PARTITION_TABLE;
+struct GPT_PARTITION_ENTRY;
+
+struct PACKED GPT_PARTITION_TABLE final {
+ Char Signature[kMagicLenGPT];
+ UInt32 Revision;
+ UInt32 HeaderSize;
+ UInt32 CRC32;
+ UInt32 Reserved1;
+ UInt64 LBAHeader;
+ UInt64 LBAAltHeader;
+ UInt64 FirstGPTEntry;
+ UInt64 LastGPTEntry;
+ EfiGUID Guid;
+ UInt64 StartingLBA;
+ UInt32 NumPartitionEntries;
+ UInt32 SizeOfEntries;
+ UInt32 CRC32PartEntry;
+ UInt8 Reserved2[kSectorAlignGPT_PartTbl];
+};
+
+struct PACKED GPT_PARTITION_ENTRY {
+ EfiGUID PartitionTypeGUID;
+ EfiGUID UniquePartitionGUID;
+ UInt64 StartLBA;
+ UInt64 EndLBA;
+ UInt64 Attributes;
+ UInt8 Name[kSectorAlignGPT_PartEntry];
+};
+} // namespace Kernel