efipart.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef _EFI_PART_H
  2. #define _EFI_PART_H
  3. /*++
  4. Copyright (c) 1998 Intel Corporation
  5. Module Name:
  6. efipart.h
  7. Abstract:
  8. Info about disk partitions and Master Boot Records
  9. Revision History
  10. --*/
  11. //
  12. //
  13. //
  14. #define EFI_PARTITION 0xef
  15. #define MBR_SIZE 512
  16. #pragma pack(1)
  17. typedef struct {
  18. UINT8 BootIndicator;
  19. UINT8 StartHead;
  20. UINT8 StartSector;
  21. UINT8 StartTrack;
  22. UINT8 OSIndicator;
  23. UINT8 EndHead;
  24. UINT8 EndSector;
  25. UINT8 EndTrack;
  26. UINT8 StartingLBA[4];
  27. UINT8 SizeInLBA[4];
  28. } MBR_PARTITION_RECORD;
  29. #define EXTRACT_UINT32(D) (UINT32)(D[0] | (D[1] << 8) | (D[2] << 16) | (D[3] << 24))
  30. #define MBR_SIGNATURE 0xaa55
  31. #define MIN_MBR_DEVICE_SIZE 0x80000
  32. #define MBR_ERRATA_PAD 0x40000 // 128 MB
  33. #define MAX_MBR_PARTITIONS 4
  34. typedef struct {
  35. UINT8 BootStrapCode[440];
  36. UINT8 UniqueMbrSignature[4];
  37. UINT8 Unknown[2];
  38. MBR_PARTITION_RECORD Partition[MAX_MBR_PARTITIONS];
  39. UINT16 Signature;
  40. } MASTER_BOOT_RECORD;
  41. #pragma pack()
  42. #endif