feat(partition): cleanup partition and gpt headers
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
diff --git a/include/drivers/partition/gpt.h b/include/drivers/partition/gpt.h
index d923e95..c2a229e 100644
--- a/include/drivers/partition/gpt.h
+++ b/include/drivers/partition/gpt.h
@@ -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 @@
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 */
diff --git a/include/drivers/partition/partition.h b/include/drivers/partition/partition.h
index 5f64833..3ec6fa3 100644
--- a/include/drivers/partition/partition.h
+++ b/include/drivers/partition/partition.h
@@ -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 @@
#define LEGACY_PARTITION_BLOCK_SIZE 512
-#define EFI_NAMELEN 36
-
typedef struct partition_entry {
uint64_t start;
uint64_t length;