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