From patchwork Fri Oct 5 19:29:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,5/9] disk: part_efi: print raw partition attributes Date: Fri, 05 Oct 2012 09:29:50 -0000 From: Stephen Warren X-Patchwork-Id: 189573 Message-Id: <1349465394-3157-5-git-send-email-swarren@wwwdotorg.org> To: Tom Rini Cc: u-boot@lists.denx.de, Stephen Warren , Rob Herring From: Stephen Warren When printing the EFI partition table, print the raw attributes. Convert struct gpt_entry_attributes to a union to allow raw access. Signed-off-by: Stephen Warren --- disk/part_efi.c | 2 ++ disk/part_efi.h | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/disk/part_efi.c b/disk/part_efi.c index 6b80cd9..d563509 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -158,6 +158,7 @@ void print_part_efi(block_dev_desc_t * dev_desc) debug("%s: gpt-entry at %p\n", __func__, gpt_pte); printf("Part\tStart LBA\tEnd LBA\t\tName\n"); + printf("\tAttributes\n"); printf("\tType UUID\n"); printf("\tPartition UUID\n"); @@ -170,6 +171,7 @@ void print_part_efi(block_dev_desc_t * dev_desc) le64_to_int(gpt_pte[i].starting_lba), le64_to_int(gpt_pte[i].ending_lba), print_efiname(&gpt_pte[i])); + printf("\tattrs:\t0x%016llx\n", gpt_pte[i].attributes.raw); uuid_string(gpt_pte[i].partition_type_guid.b, uuid); printf("\ttype:\t%s\n", uuid); uuid_string(gpt_pte[i].unique_partition_guid.b, uuid); diff --git a/disk/part_efi.h b/disk/part_efi.h index 1d0c67c..4e28d1d 100644 --- a/disk/part_efi.h +++ b/disk/part_efi.h @@ -111,12 +111,15 @@ typedef struct _gpt_header { unsigned char reserved2[GPT_BLOCK_SIZE - 92]; } __attribute__ ((packed)) gpt_header; -typedef struct _gpt_entry_attributes { - unsigned long long required_to_function:1; - unsigned long long no_block_io_protocol:1; - unsigned long long legacy_bios_bootable:1; - unsigned long long reserved:45; - unsigned long long type_guid_specific:16; +typedef union _gpt_entry_attributes { + struct { + unsigned long long required_to_function:1; + unsigned long long no_block_io_protocol:1; + unsigned long long legacy_bios_bootable:1; + unsigned long long reserved:45; + unsigned long long type_guid_specific:16; + } fields; + unsigned long long raw; } __attribute__ ((packed)) gpt_entry_attributes; #define PARTNAME_SZ (72 / sizeof(efi_char16_t))