~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/block/partitions/efi.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /************************************************************
  3  * EFI GUID Partition Table
  4  * Per Intel EFI Specification v1.02
  5  * http://developer.intel.com/technology/efi/efi.htm
  6  *
  7  * By Matt Domsch <Matt_Domsch@dell.com>  Fri Sep 22 22:15:56 CDT 2000  
  8  *   Copyright 2000,2001 Dell Inc.
  9  ************************************************************/
 10 
 11 #ifndef FS_PART_EFI_H_INCLUDED
 12 #define FS_PART_EFI_H_INCLUDED
 13 
 14 #include <linux/types.h>
 15 #include <linux/fs.h>
 16 #include <linux/kernel.h>
 17 #include <linux/major.h>
 18 #include <linux/string.h>
 19 #include <linux/efi.h>
 20 #include <linux/compiler.h>
 21 
 22 #define MSDOS_MBR_SIGNATURE 0xaa55
 23 #define EFI_PMBR_OSTYPE_EFI 0xEF
 24 #define EFI_PMBR_OSTYPE_EFI_GPT 0xEE
 25 
 26 #define GPT_MBR_PROTECTIVE  1
 27 #define GPT_MBR_HYBRID      2
 28 
 29 #define GPT_HEADER_SIGNATURE 0x5452415020494645ULL
 30 #define GPT_HEADER_REVISION_V1 0x00010000
 31 #define GPT_PRIMARY_PARTITION_TABLE_LBA 1
 32 
 33 #define PARTITION_SYSTEM_GUID \
 34     EFI_GUID( 0xC12A7328, 0xF81F, 0x11d2, \
 35               0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B) 
 36 #define LEGACY_MBR_PARTITION_GUID \
 37     EFI_GUID( 0x024DEE41, 0x33E7, 0x11d3, \
 38               0x9D, 0x69, 0x00, 0x08, 0xC7, 0x81, 0xF3, 0x9F)
 39 #define PARTITION_MSFT_RESERVED_GUID \
 40     EFI_GUID( 0xE3C9E316, 0x0B5C, 0x4DB8, \
 41               0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE)
 42 #define PARTITION_BASIC_DATA_GUID \
 43     EFI_GUID( 0xEBD0A0A2, 0xB9E5, 0x4433, \
 44               0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7)
 45 #define PARTITION_LINUX_RAID_GUID \
 46     EFI_GUID( 0xa19d880f, 0x05fc, 0x4d3b, \
 47               0xa0, 0x06, 0x74, 0x3f, 0x0f, 0x84, 0x91, 0x1e)
 48 #define PARTITION_LINUX_SWAP_GUID \
 49     EFI_GUID( 0x0657fd6d, 0xa4ab, 0x43c4, \
 50               0x84, 0xe5, 0x09, 0x33, 0xc8, 0x4b, 0x4f, 0x4f)
 51 #define PARTITION_LINUX_LVM_GUID \
 52     EFI_GUID( 0xe6d6d379, 0xf507, 0x44c2, \
 53               0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28)
 54 
 55 typedef struct _gpt_header {
 56         __le64 signature;
 57         __le32 revision;
 58         __le32 header_size;
 59         __le32 header_crc32;
 60         __le32 reserved1;
 61         __le64 my_lba;
 62         __le64 alternate_lba;
 63         __le64 first_usable_lba;
 64         __le64 last_usable_lba;
 65         efi_guid_t disk_guid;
 66         __le64 partition_entry_lba;
 67         __le32 num_partition_entries;
 68         __le32 sizeof_partition_entry;
 69         __le32 partition_entry_array_crc32;
 70 
 71         /* The rest of the logical block is reserved by UEFI and must be zero.
 72          * EFI standard handles this by:
 73          *
 74          * uint8_t              reserved2[ BlockSize - 92 ];
 75          */
 76 } __packed gpt_header;
 77 
 78 typedef struct _gpt_entry_attributes {
 79         u64 required_to_function:1;
 80         u64 reserved:47;
 81         u64 type_guid_specific:16;
 82 } __packed gpt_entry_attributes;
 83 
 84 typedef struct _gpt_entry {
 85         efi_guid_t partition_type_guid;
 86         efi_guid_t unique_partition_guid;
 87         __le64 starting_lba;
 88         __le64 ending_lba;
 89         gpt_entry_attributes attributes;
 90         __le16 partition_name[72/sizeof(__le16)];
 91 } __packed gpt_entry;
 92 
 93 typedef struct _gpt_mbr_record {
 94         u8      boot_indicator; /* unused by EFI, set to 0x80 for bootable */
 95         u8      start_head;     /* unused by EFI, pt start in CHS */
 96         u8      start_sector;   /* unused by EFI, pt start in CHS */
 97         u8      start_track;
 98         u8      os_type;        /* EFI and legacy non-EFI OS types */
 99         u8      end_head;       /* unused by EFI, pt end in CHS */
100         u8      end_sector;     /* unused by EFI, pt end in CHS */
101         u8      end_track;      /* unused by EFI, pt end in CHS */
102         __le32  starting_lba;   /* used by EFI - start addr of the on disk pt */
103         __le32  size_in_lba;    /* used by EFI - size of pt in LBA */
104 } __packed gpt_mbr_record;
105 
106 
107 typedef struct _legacy_mbr {
108         u8 boot_code[440];
109         __le32 unique_mbr_signature;
110         __le16 unknown;
111         gpt_mbr_record partition_record[4];
112         __le16 signature;
113 } __packed legacy_mbr;
114 
115 #endif
116 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php