xref: /freebsd/stand/efi/include/efipart.h (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1 #ifndef _EFI_PART_H
2 #define _EFI_PART_H
3 
4 /*++
5 
6 Copyright (c)  1999 - 2002 Intel Corporation. All rights reserved
7 This software and associated documentation (if any) is furnished
8 under a license and may only be used or copied in accordance
9 with the terms of the license. Except as permitted by such
10 license, no part of this software or documentation may be
11 reproduced, stored in a retrieval system, or transmitted in any
12 form or by any means without the express written consent of
13 Intel Corporation.
14 
15 Module Name:
16 
17     efipart.h
18 
19 Abstract:
20     Info about disk partitions and Master Boot Records
21 
22 
23 
24 
25 Revision History
26 
27 --*/
28 
29 //
30 //
31 //
32 
33 #define EFI_PARTITION   0xef
34 #define MBR_SIZE        512
35 
36 #pragma pack(1)
37 
38 typedef struct {
39     UINT8       BootIndicator;
40     UINT8       StartHead;
41     UINT8       StartSector;
42     UINT8       StartTrack;
43     UINT8       OSIndicator;
44     UINT8       EndHead;
45     UINT8       EndSector;
46     UINT8       EndTrack;
47     UINT8       StartingLBA[4];
48     UINT8       SizeInLBA[4];
49 } MBR_PARTITION_RECORD;
50 
51 #define EXTRACT_UINT32(D) (UINT32)(D[0] | (D[1] << 8) | (D[2] << 16) | (D[3] << 24))
52 
53 #define MBR_SIGNATURE           0xaa55
54 #define MIN_MBR_DEVICE_SIZE     0x80000
55 #define MBR_ERRATA_PAD          0x40000 // 128 MB
56 
57 #define MAX_MBR_PARTITIONS  4
58 typedef struct {
59     UINT8                   BootStrapCode[440];
60     UINT8                   UniqueMbrSignature[4];
61     UINT8                   Unknown[2];
62     MBR_PARTITION_RECORD    Partition[MAX_MBR_PARTITIONS];
63     UINT16                  Signature;
64 } MASTER_BOOT_RECORD;
65 #pragma pack()
66 
67 
68 #endif
69