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
This commit is contained in:
Sughosh Ganu 2021-12-07 16:49:21 +05:30
parent 19d63df1af
commit 2029f93009
2 changed files with 6 additions and 6 deletions

View 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 */

View 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;