summaryrefslogtreecommitdiffhomepage
path: root/Kernel/FirmwareKit
diff options
context:
space:
mode:
authorAmlal <amlal@zka.com>2024-07-23 17:18:32 +0200
committerAmlal <amlal@zka.com>2024-07-23 17:18:32 +0200
commita4f908c4d3d0c8d5a3578bf81028986405e96937 (patch)
treea3a689dba643fc8393d16aed0064b7de1f13d020 /Kernel/FirmwareKit
parent274cba18b8f1c255ddcff2f5c14aab4d0c846820 (diff)
[MHR-36] Refactors and such.
Signed-off-by: Amlal <amlal@zka.com>
Diffstat (limited to 'Kernel/FirmwareKit')
-rw-r--r--Kernel/FirmwareKit/EPM.hxx88
1 files changed, 43 insertions, 45 deletions
diff --git a/Kernel/FirmwareKit/EPM.hxx b/Kernel/FirmwareKit/EPM.hxx
index cb3eaa11..2766abf6 100644
--- a/Kernel/FirmwareKit/EPM.hxx
+++ b/Kernel/FirmwareKit/EPM.hxx
@@ -17,36 +17,6 @@
#define kEPMFilesystemLength (16)
#define kEPMMagicLength (5)
-/* The first 0 > 128 addresses of a disk contains these headers. */
-
-/// @brief EPM GUID structure.
-typedef struct BlockGUID
-{
- Kernel::UInt32 Data1;
- Kernel::UInt16 Data2;
- Kernel::UInt16 Data3;
- Kernel::UInt8 Data4[8];
-} BlockGUID;
-
-/**
- * @brief The EPM boot block.
- * @note NumBlock and LbaStart are ignored on some platforms.
- */
-struct PACKED BootBlock
-{
- Kernel::Char Magic[kEPMMagicLength];
- Kernel::Char Name[kEPMNameLength];
- BlockGUID Uuid;
- Kernel::Int32 Version;
- Kernel::Int64 NumBlocks;
- Kernel::Int64 SectorSz;
- Kernel::Int64 LbaStart;
- Kernel::Int16 Kind;
- Kernel::Int32 FsVersion;
- Kernel::Char Fs[kEPMFilesystemLength]; /* NewFS, ffs2... */
- Kernel::Char Reserved[409]; // to fill a full sector.
-};
-
/* @brief AMD64 magic for EPM */
#define kEPMMagic86 "EPMAM"
@@ -79,19 +49,6 @@ struct PACKED BootBlock
#define kEPMMagicError "EPM??"
-///! @brief Version kind enum.
-///! @brief Use in boot block version field.
-
-enum kEPMKind
-{
- kEPMMpUx = 0xcf, // Bridge or other embedded OS
- kEPMLinux = 0x8f,
- kEPMBSD = 0x9f,
- kEPMNewOS = 0x1f, // This kernel.
-};
-
-typedef struct BootBlock BootBlockType;
-
#ifdef __NEWOS_AMD64__
#define kEPMMagic kEPMMagic86
#else
@@ -104,7 +61,7 @@ typedef struct BootBlock BootBlockType;
///! @brief partition must start at this address.
///! Anything below is reserved for Data backup by the Main OS.
-#define kEPMStartPartitionBlk (sizeof(BootBlock))
+#define kEPMStartPartitionBlk (sizeof(_BOOT_BLOCK_STRUCT))
///! @brief Current EPM revision
#define kEPMRevision (0xAD)
@@ -113,6 +70,47 @@ typedef struct BootBlock BootBlockType;
/// !@brief EPM base address
#define kEpmBase (0U)
-/// END OF SPECS
+/* The first 0 > 128 addresses of a disk contains these headers. */
+
+/// @brief EPM GUID structure.
+typedef struct _BLOCK_GUID_STRUCT
+{
+ Kernel::UInt32 Data1;
+ Kernel::UInt16 Data2;
+ Kernel::UInt16 Data3;
+ Kernel::UInt8 Data4[8];
+} BLOCK_GUID_STRUCT;
+
+/**
+ * @brief The EPM boot block.
+ * @note NumBlock and LbaStart are ignored on some platforms.
+ */
+struct PACKED _BOOT_BLOCK_STRUCT
+{
+ Kernel::Char Magic[kEPMMagicLength];
+ Kernel::Char Name[kEPMNameLength];
+ BLOCK_GUID_STRUCT Uuid;
+ Kernel::Int32 Version;
+ Kernel::Int64 NumBlocks;
+ Kernel::Int64 SectorSz;
+ Kernel::Int64 LbaStart;
+ Kernel::Int16 Kind;
+ Kernel::Int32 FsVersion;
+ Kernel::Char Fs[kEPMFilesystemLength]; /* NewFS, ffs2... */
+ Kernel::Char Reserved[409]; // to fill a full sector.
+};
+
+///! @brief Version kind enum.
+///! @brief Use in boot block version field.
+
+enum
+{
+ kEPMMpUx = 0xcf, // Bridge or other embedded OS
+ kEPMLinux = 0x8f,
+ kEPMBSD = 0x9f,
+ kEPMNewOS = 0x1f, // This kernel.
+};
+
+typedef struct _BOOT_BLOCK_STRUCT BOOT_BLOCK_STRUCT;
#endif // ifndef __FIRMWARE_EPM_HXX__