]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(partition): cleanup partition and gpt headers
authorSughosh Ganu <sughosh.ganu@linaro.org>
Tue, 7 Dec 2021 11:19:21 +0000 (16:49 +0530)
committerSughosh Ganu <sughosh.ganu@linaro.org>
Thu, 27 Jan 2022 12:39:02 +0000 (18:09 +0530)
The EFI_NAMELEN macro has been moved to efi.h header. Get the macro
from efi.h. Use the struct efi_guid structure for declaring GUID
members in gpt.h

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Change-Id: I1c3a2605b9f857b9cf2dcfdaed4dc9d0a2cbf0f0

include/drivers/partition/gpt.h
include/drivers/partition/partition.h

index d923e9535f3771de647256368fc3c86d3db3e3b2..c2a229e3376d853f8a07086a44531bc264e6b3a7 100644 (file)
@@ -7,19 +7,20 @@
 #ifndef GPT_H
 #define GPT_H
 
+#include <drivers/partition/efi.h>
 #include <drivers/partition/partition.h>
+#include <tools_share/uuid.h>
 
 #define PARTITION_TYPE_GPT             0xee
 #define GPT_HEADER_OFFSET              PLAT_PARTITION_BLOCK_SIZE
 #define GPT_ENTRY_OFFSET               (GPT_HEADER_OFFSET +            \
                                         PLAT_PARTITION_BLOCK_SIZE)
-#define GUID_LEN                       16
 
 #define GPT_SIGNATURE                  "EFI PART"
 
 typedef struct gpt_entry {
-       unsigned char           type_uuid[GUID_LEN];
-       unsigned char           unique_uuid[GUID_LEN];
+       struct efi_guid         type_uuid;
+       struct efi_guid         unique_uuid;
        unsigned long long      first_lba;
        unsigned long long      last_lba;
        unsigned long long      attr;
@@ -36,7 +37,7 @@ typedef struct gpt_header {
        unsigned long long      backup_lba;
        unsigned long long      first_lba;
        unsigned long long      last_lba;
-       unsigned char           disk_uuid[16];
+       struct efi_guid         disk_uuid;
        /* starting LBA of array of partition entries */
        unsigned long long      part_lba;
        /* number of partition entries in array */
index 5f6483373f3da2ab55b7ed5cc00e6e01952a4172..3ec6fa3357cef983a31478fa1da5ff7732f8f3d7 100644 (file)
@@ -10,6 +10,7 @@
 #include <stdint.h>
 
 #include <lib/cassert.h>
+#include <drivers/partition/efi.h>
 
 #if !PLAT_PARTITION_MAX_ENTRIES
 # define PLAT_PARTITION_MAX_ENTRIES    128
@@ -27,8 +28,6 @@ CASSERT((PLAT_PARTITION_BLOCK_SIZE == 512) ||
 
 #define LEGACY_PARTITION_BLOCK_SIZE    512
 
-#define EFI_NAMELEN                    36
-
 typedef struct partition_entry {
        uint64_t                start;
        uint64_t                length;