Add EfiGpt.h, ElTorito.h, Mbr.h header files which are for EFI GUID Partition table...
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 3 Nov 2006 05:42:01 +0000 (05:42 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 3 Nov 2006 05:42:01 +0000 (05:42 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1893 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/IndustryStandard/EfiGpt.h [new file with mode: 0644]
MdePkg/Include/IndustryStandard/ElTorito.h [new file with mode: 0644]
MdePkg/Include/IndustryStandard/Mbr.h [new file with mode: 0644]

diff --git a/MdePkg/Include/IndustryStandard/EfiGpt.h b/MdePkg/Include/IndustryStandard/EfiGpt.h
new file mode 100644 (file)
index 0000000..1026aa0
--- /dev/null
@@ -0,0 +1,62 @@
+/** @file\r
+  EFI Guid Partition Table Format Definition.\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+--*/\r
+\r
+#ifndef _EFIGPT_H_\r
+#define _EFIGPT_H_\r
+\r
+\r
+#define PRIMARY_PART_HEADER_LBA 1\r
+\r
+#define EFI_PTAB_HEADER_ID      "EFI PART"\r
+\r
+#pragma pack(1)\r
+//\r
+// GPT Partition Table Header\r
+//\r
+typedef struct {\r
+  EFI_TABLE_HEADER  Header;\r
+  EFI_LBA           MyLBA;\r
+  EFI_LBA           AlternateLBA;\r
+  EFI_LBA           FirstUsableLBA;\r
+  EFI_LBA           LastUsableLBA;\r
+  EFI_GUID          DiskGUID;\r
+  EFI_LBA           PartitionEntryLBA;\r
+  UINT32            NumberOfPartitionEntries;\r
+  UINT32            SizeOfPartitionEntry;\r
+  UINT32            PartitionEntryArrayCRC32;\r
+} EFI_PARTITION_TABLE_HEADER;\r
+\r
+//\r
+// GPT Partition Entry\r
+//\r
+typedef struct {\r
+  EFI_GUID  PartitionTypeGUID;\r
+  EFI_GUID  UniquePartitionGUID;\r
+  EFI_LBA   StartingLBA;\r
+  EFI_LBA   EndingLBA;\r
+  UINT64    Attributes;\r
+  CHAR16    PartitionName[36];\r
+} EFI_PARTITION_ENTRY;\r
+\r
+//\r
+// GPT Partition Entry Status\r
+//\r
+typedef struct {\r
+  BOOLEAN OutOfRange;\r
+  BOOLEAN Overlap;\r
+} EFI_PARTITION_ENTRY_STATUS;\r
+\r
+#pragma pack()\r
+\r
+#endif\r
diff --git a/MdePkg/Include/IndustryStandard/ElTorito.h b/MdePkg/Include/IndustryStandard/ElTorito.h
new file mode 100644 (file)
index 0000000..bfa014c
--- /dev/null
@@ -0,0 +1,123 @@
+/** @file\r
+  ElTorito Partitions Format Definition.\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+--*/\r
+\r
+#ifndef _ELTORITO_H_\r
+#define _ELTORITO_H_\r
+\r
+//\r
+// CDROM_VOLUME_DESCRIPTOR.Types\r
+//\r
+#define CDVOL_TYPE_STANDARD 0x0\r
+#define CDVOL_TYPE_CODED    0x1\r
+#define CDVOL_TYPE_END      0xFF\r
+\r
+//\r
+// CDROM_VOLUME_DESCRIPTOR.Id\r
+//\r
+#define CDVOL_ID  "CD001"\r
+\r
+//\r
+// CDROM_VOLUME_DESCRIPTOR.SystemId\r
+//\r
+#define CDVOL_ELTORITO_ID "EL TORITO SPECIFICATION"\r
+\r
+//\r
+// Indicator types\r
+//\r
+#define ELTORITO_ID_CATALOG               0x01\r
+#define ELTORITO_ID_SECTION_BOOTABLE      0x88\r
+#define ELTORITO_ID_SECTION_NOT_BOOTABLE  0x00\r
+#define ELTORITO_ID_SECTION_HEADER        0x90\r
+#define ELTORITO_ID_SECTION_HEADER_FINAL  0x91\r
+\r
+//\r
+// ELTORITO_CATALOG.Boot.MediaTypes\r
+//\r
+#define ELTORITO_NO_EMULATION 0x00\r
+#define ELTORITO_12_DISKETTE  0x01\r
+#define ELTORITO_14_DISKETTE  0x02\r
+#define ELTORITO_28_DISKETTE  0x03\r
+#define ELTORITO_HARD_DISK    0x04\r
+\r
+\r
+#pragma pack(1)\r
+\r
+//\r
+// El Torito Volume Descriptor\r
+// Note that the CDROM_VOLUME_DESCRIPTOR does not match the ISO-9660\r
+// descriptor.  For some reason descriptor used by El Torito is\r
+// different, but they start the same.   The El Torito descriptor\r
+// is left shifted 1 byte starting with the SystemId.  (Note this\r
+// causes the field to get unaligned)\r
+//\r
+typedef struct {\r
+  UINT8   Type;\r
+  CHAR8   Id[5];  // CD001\r
+  UINT8   Version;\r
+  CHAR8   SystemId[26];\r
+  CHAR8   Unused[38];\r
+  UINT8   EltCatalog[4];\r
+  CHAR8   Unused2[5];\r
+  UINT32  VolSpaceSize[2];\r
+} CDROM_VOLUME_DESCRIPTOR;\r
+\r
+//\r
+// Catalog Entry\r
+//\r
+typedef union {\r
+  struct {\r
+    CHAR8       Reserved[0x20];\r
+  } Unknown;\r
+\r
+  //\r
+  // Catalog validation entry (Catalog header)\r
+  //\r
+  struct {\r
+    UINT8   Indicator;\r
+    UINT8   PlatformId;\r
+    UINT16  Reserved;\r
+    CHAR8   ManufacId[24];\r
+    UINT16  Checksum;\r
+    UINT16  Id55AA;\r
+  } Catalog;\r
+\r
+  //\r
+  // Initial/Default Entry or Section Entry\r
+  //\r
+  struct {\r
+    UINT8   Indicator;\r
+    UINT8   MediaType : 4;\r
+    UINT8   Reserved1 : 4;\r
+    UINT16  LoadSegment;\r
+    UINT8   SystemType;\r
+    UINT8   Reserved2;\r
+    UINT16  SectorCount;\r
+    UINT32  Lba;\r
+  } Boot;\r
+\r
+  //\r
+  // Section Header Entry\r
+  //\r
+  struct {\r
+    UINT8   Indicator;\r
+    UINT8   PlatformId;\r
+    UINT16  SectionEntries;\r
+    CHAR8   Id[28];\r
+  } Section;\r
+\r
+} ELTORITO_CATALOG;\r
+\r
+#pragma pack()\r
+\r
+#endif\r
diff --git a/MdePkg/Include/IndustryStandard/Mbr.h b/MdePkg/Include/IndustryStandard/Mbr.h
new file mode 100644 (file)
index 0000000..108741e
--- /dev/null
@@ -0,0 +1,62 @@
+/** @file\r
+  Legacy Master Boot Record Format Definition.\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php\r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+--*/\r
+\r
+#ifndef _MBR_H_\r
+#define _MBR_H_\r
+\r
+#define MBR_SIGNATURE               0xaa55\r
+#define MIN_MBR_DEVICE_SIZE         0x80000\r
+#define MBR_ERRATA_PAD              0x40000 // 128 MB\r
+\r
+#define EXTENDED_DOS_PARTITION      0x05\r
+#define EXTENDED_WINDOWS_PARTITION  0x0F\r
+\r
+#define MAX_MBR_PARTITIONS          4\r
+\r
+#define PMBR_GPT_PARTITION          0xEE\r
+#define EFI_PARTITION               0xEF\r
+\r
+#define MBR_SIZE                    512\r
+\r
+#pragma pack(1)\r
+//\r
+// MBR Partition Entry\r
+//\r
+typedef struct {\r
+  UINT8 BootIndicator;\r
+  UINT8 StartHead;\r
+  UINT8 StartSector;\r
+  UINT8 StartTrack;\r
+  UINT8 OSIndicator;\r
+  UINT8 EndHead;\r
+  UINT8 EndSector;\r
+  UINT8 EndTrack;\r
+  UINT8 StartingLBA[4];\r
+  UINT8 SizeInLBA[4];\r
+} MBR_PARTITION_RECORD;\r
+\r
+//\r
+// MBR Partition table\r
+//\r
+typedef struct {\r
+  UINT8                 BootStrapCode[440];\r
+  UINT8                 UniqueMbrSignature[4];\r
+  UINT8                 Unknown[2];\r
+  MBR_PARTITION_RECORD  Partition[MAX_MBR_PARTITIONS];\r
+  UINT16                Signature;\r
+} MASTER_BOOT_RECORD;\r
+\r
+#pragma pack()\r
+\r
+#endif\r