177943Sdfr/* $FreeBSD: releng/10.3/sys/boot/efi/include/efipart.h 163898 2006-11-02 02:42:48Z marcel $ */
277943Sdfr#ifndef _EFI_PART_H
377943Sdfr#define _EFI_PART_H
477943Sdfr
577943Sdfr/*++
677943Sdfr
7163898SmarcelCopyright (c)  1999 - 2002 Intel Corporation. All rights reserved
8163898SmarcelThis software and associated documentation (if any) is furnished
9163898Smarcelunder a license and may only be used or copied in accordance
10163898Smarcelwith the terms of the license. Except as permitted by such
11163898Smarcellicense, no part of this software or documentation may be
12163898Smarcelreproduced, stored in a retrieval system, or transmitted in any
13163898Smarcelform or by any means without the express written consent of
14163898SmarcelIntel Corporation.
1577943Sdfr
1677943SdfrModule Name:
1777943Sdfr
1877943Sdfr    efipart.h
1977943Sdfr
2077943SdfrAbstract:
2177943Sdfr    Info about disk partitions and Master Boot Records
2277943Sdfr
2377943Sdfr
2477943Sdfr
2577943Sdfr
2677943SdfrRevision History
2777943Sdfr
2877943Sdfr--*/
2977943Sdfr
30163898Smarcel//
31163898Smarcel//
32163898Smarcel//
33163898Smarcel
3477943Sdfr#define EFI_PARTITION   0xef
3577943Sdfr#define MBR_SIZE        512
3677943Sdfr
3777943Sdfr#pragma pack(1)
3877943Sdfr
3977943Sdfrtypedef struct {
4077943Sdfr    UINT8       BootIndicator;
4177943Sdfr    UINT8       StartHead;
4277943Sdfr    UINT8       StartSector;
4377943Sdfr    UINT8       StartTrack;
4477943Sdfr    UINT8       OSIndicator;
4577943Sdfr    UINT8       EndHead;
4677943Sdfr    UINT8       EndSector;
4777943Sdfr    UINT8       EndTrack;
4877943Sdfr    UINT8       StartingLBA[4];
4977943Sdfr    UINT8       SizeInLBA[4];
5077943Sdfr} MBR_PARTITION_RECORD;
5177943Sdfr
5277943Sdfr#define EXTRACT_UINT32(D) (UINT32)(D[0] | (D[1] << 8) | (D[2] << 16) | (D[3] << 24))
5377943Sdfr
5477943Sdfr#define MBR_SIGNATURE           0xaa55
5577943Sdfr#define MIN_MBR_DEVICE_SIZE     0x80000
56163898Smarcel#define MBR_ERRATA_PAD          0x40000 // 128 MB
5777943Sdfr
5877943Sdfr#define MAX_MBR_PARTITIONS  4
5977943Sdfrtypedef struct {
6077943Sdfr    UINT8                   BootStrapCode[440];
6177943Sdfr    UINT8                   UniqueMbrSignature[4];
6277943Sdfr    UINT8                   Unknown[2];
6377943Sdfr    MBR_PARTITION_RECORD    Partition[MAX_MBR_PARTITIONS];
6477943Sdfr    UINT16                  Signature;
6577943Sdfr} MASTER_BOOT_RECORD;
6677943Sdfr#pragma pack()
6777943Sdfr
6877943Sdfr
6977943Sdfr#endif
70