aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-03-19 13:49:34 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-04-30 10:25:07 +0200
commit25801acc1fd64b284d250e8cee7c5ea0c5186f1c (patch)
tree11aa991de56aeb05cf0fea959c97ef6b70b1b7ed /include
parent4fe050e65f61cc5e7734aee0637a18ac16b10061 (diff)
downloadu-boot-25801acc1fd64b284d250e8cee7c5ea0c5186f1c.zip
u-boot-25801acc1fd64b284d250e8cee7c5ea0c5186f1c.tar.gz
u-boot-25801acc1fd64b284d250e8cee7c5ea0c5186f1c.tar.bz2
part: detect EFI system partition
Up to now for MBR and GPT partitions the info field 'bootable' was set to 1 if either the partition was an EFI system partition or the bootable flag was set. Turn info field 'bootable' into a bit mask with separate bits for bootable and EFI system partition. This will allow us to identify the EFI system partition in the UEFI sub-system. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'include')
-rw-r--r--include/part.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/part.h b/include/part.h
index 0b5cf3d..3693527 100644
--- a/include/part.h
+++ b/include/part.h
@@ -51,13 +51,22 @@ struct block_drvr {
#define PART_TYPE_LEN 32
#define MAX_SEARCH_PARTITIONS 64
+#define PART_BOOTABLE ((int)BIT(0))
+#define PART_EFI_SYSTEM_PARTITION ((int)BIT(1))
+
typedef struct disk_partition {
lbaint_t start; /* # of first block in partition */
lbaint_t size; /* number of blocks in partition */
ulong blksz; /* block size in bytes */
uchar name[PART_NAME_LEN]; /* partition name */
uchar type[PART_TYPE_LEN]; /* string type description */
- int bootable; /* Active/Bootable flag is set */
+ /*
+ * The bootable is a bitmask with the following fields:
+ *
+ * PART_BOOTABLE the MBR bootable flag is set
+ * PART_EFI_SYSTEM_PARTITION the partition is an EFI system partition
+ */
+ int bootable;
#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
char uuid[UUID_STR_LEN + 1]; /* filesystem UUID as string, if exists */
#endif