grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/4] guid: un-unifiy GUID types


From: Laszlo Ersek
Subject: Re: [PATCH 4/4] guid: un-unifiy GUID types
Date: Thu, 5 Oct 2023 16:38:37 +0200

On 10/5/23 12:47, Oliver Steffen wrote:
> Switch back to separate GUID types, depending on use-case.
> 
> - Reverts commit 06edd40db76bb78457ac26156ed5f7b62381bbe8,
>   "guid: Unify GUID types"

ack

> - Changes the guid type used in grub_efi_set_variable_to_string()
>   to grub_efi_guid_t.

Yes, that seems justified; the function was added in a later commit in
the series (e83a88f6ea7f, "efi: Add grub_efi_set_variable_to_string()",
2023-06-01).

> - Fixes the type of bli_vendor_guid in bli.c

Ditto (e0fa7dc84c03, "bli: Add a module for the Boot Loader Interface",
2023-06-01).

Acked-by: Laszlo Ersek <lersek@redhat.com>

I support "revisit[ing] the topic of guid data types and related
functions at a later point". I too happen to have a particular technical
opinion on how that should be done, but first of all, this mess needs to
be disentangled for getting the release unstuck (with BLI included), and
then it should be re-approached in isolation, with a clean slate.

Laszlo


> 
> Signed-off-by: Oliver Steffen <osteffen@redhat.com>
> ---
>  grub-core/commands/acpi.c            |  4 +-
>  grub-core/commands/bli.c             |  2 +-
>  grub-core/commands/efi/efifwsetup.c  |  4 +-
>  grub-core/commands/efi/loadbios.c    | 14 +++---
>  grub-core/commands/efi/lsefi.c       |  4 +-
>  grub-core/commands/efi/lsefisystab.c |  4 +-
>  grub-core/commands/efi/lssal.c       |  4 +-
>  grub-core/commands/efi/smbios.c      | 12 +++---
>  grub-core/commands/efi/tpm.c         |  6 +--
>  grub-core/commands/probe.c           |  2 +-
>  grub-core/disk/efi/efidisk.c         |  4 +-
>  grub-core/disk/ldm.c                 |  2 +-
>  grub-core/efiemu/i386/pc/cfgtables.c |  6 +--
>  grub-core/efiemu/main.c              |  4 +-
>  grub-core/efiemu/runtime/efiemu.c    | 14 +++---
>  grub-core/kern/efi/acpi.c            | 12 +++---
>  grub-core/kern/efi/efi.c             | 24 +++++------
>  grub-core/kern/efi/fdt.c             |  2 +-
>  grub-core/kern/efi/init.c            |  2 +-
>  grub-core/kern/efi/sb.c              |  4 +-
>  grub-core/loader/efi/fdt.c           |  2 +-
>  grub-core/loader/efi/linux.c         |  4 +-
>  grub-core/loader/i386/xnu.c          |  4 +-
>  grub-core/loader/ia64/efi/linux.c    |  2 +-
>  grub-core/net/drivers/efi/efinet.c   |  4 +-
>  grub-core/partmap/gpt.c              |  4 +-
>  grub-core/term/efi/console.c         |  2 +-
>  grub-core/term/efi/serial.c          |  2 +-
>  grub-core/video/efi_gop.c            |  8 ++--
>  grub-core/video/efi_uga.c            |  2 +-
>  include/grub/efi/api.h               | 64 ++++++++++++++++++----------
>  include/grub/efi/efi.h               | 18 ++++----
>  include/grub/efiemu/efiemu.h         | 10 ++---
>  include/grub/efiemu/runtime.h        |  2 +-
>  include/grub/gpt_partition.h         | 13 +++++-
>  include/grub/types.h                 |  9 ----
>  util/grub-install.c                  |  2 +-
>  util/grub-probe.c                    |  2 +-
>  38 files changed, 151 insertions(+), 133 deletions(-)
> 
> diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c
> index 1c034463c..0d0c14810 100644
> --- a/grub-core/commands/acpi.c
> +++ b/grub-core/commands/acpi.c
> @@ -763,8 +763,8 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int 
> argc, char **args)
>  
>  #ifdef GRUB_MACHINE_EFI
>    {
> -    static grub_guid_t acpi = GRUB_EFI_ACPI_TABLE_GUID;
> -    static grub_guid_t acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID;
> +    struct grub_efi_guid acpi = GRUB_EFI_ACPI_TABLE_GUID;
> +    struct grub_efi_guid acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID;
>  
>      grub_efi_system_table->boot_services->install_configuration_table 
> (&acpi20,
>                                                                      
> grub_acpi_get_rsdpv2 ());
> diff --git a/grub-core/commands/bli.c b/grub-core/commands/bli.c
> index 2a3933925..d1aeeea59 100644
> --- a/grub-core/commands/bli.c
> +++ b/grub-core/commands/bli.c
> @@ -34,7 +34,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
>  
>  #define MODNAME "bli"
>  
> -static const grub_guid_t bli_vendor_guid = 
> GRUB_EFI_VENDOR_BOOT_LOADER_INTERFACE_GUID;
> +static const grub_efi_guid_t bli_vendor_guid = 
> GRUB_EFI_VENDOR_BOOT_LOADER_INTERFACE_GUID;
>  
>  static grub_err_t
>  get_part_uuid (const char *device_name, char **part_uuid)
> diff --git a/grub-core/commands/efi/efifwsetup.c 
> b/grub-core/commands/efi/efifwsetup.c
> index 704f9d352..de66c3035 100644
> --- a/grub-core/commands/efi/efifwsetup.c
> +++ b/grub-core/commands/efi/efifwsetup.c
> @@ -38,7 +38,7 @@ grub_cmd_fwsetup (grub_command_t cmd __attribute__ 
> ((unused)),
>    grub_efi_uint64_t os_indications = GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI;
>    grub_err_t status;
>    grub_size_t oi_size;
> -  static grub_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
> +  static grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
>  
>    if (argc >= 1 && grub_strcmp(args[0], "--is-supported") == 0)
>      return !efifwsetup_is_supported ();
> @@ -72,7 +72,7 @@ efifwsetup_is_supported (void)
>  {
>    grub_efi_uint64_t *os_indications_supported = NULL;
>    grub_size_t oi_size = 0;
> -  static grub_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
> +  static grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
>    grub_efi_boolean_t ret = 0;
>  
>    grub_efi_get_variable ("OsIndicationsSupported", &global, &oi_size,
> diff --git a/grub-core/commands/efi/loadbios.c 
> b/grub-core/commands/efi/loadbios.c
> index 8f6b0ecfc..574e41046 100644
> --- a/grub-core/commands/efi/loadbios.c
> +++ b/grub-core/commands/efi/loadbios.c
> @@ -27,9 +27,9 @@
>  
>  GRUB_MOD_LICENSE ("GPLv3+");
>  
> -static grub_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
> -static grub_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
> -static grub_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID;
> +static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
> +static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
> +static grub_efi_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID;
>  
>  #define EBDA_SEG_ADDR        0x40e
>  #define LOW_MEM_ADDR 0x413
> @@ -105,15 +105,15 @@ fake_bios_data (int use_rom)
>    smbios = 0;
>    for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
>      {
> -      grub_guid_t *guid =
> +      grub_efi_packed_guid_t *guid =
>       &grub_efi_system_table->configuration_table[i].vendor_guid;
>  
> -      if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_guid_t)))
> +      if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t)))
>       {
>         acpi = grub_efi_system_table->configuration_table[i].vendor_table;
>         grub_dprintf ("efi", "ACPI2: %p\n", acpi);
>       }
> -      else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_guid_t)))
> +      else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t)))
>       {
>         void *t;
>  
> @@ -122,7 +122,7 @@ fake_bios_data (int use_rom)
>           acpi = t;
>         grub_dprintf ("efi", "ACPI: %p\n", t);
>       }
> -      else if (! grub_memcmp (guid, &smbios_guid, sizeof (grub_guid_t)))
> +      else if (! grub_memcmp (guid, &smbios_guid, sizeof (grub_efi_guid_t)))
>       {
>         smbios = grub_efi_system_table->configuration_table[i].vendor_table;
>         grub_dprintf ("efi", "SMBIOS: %p\n", smbios);
> diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c
> index 6935cd302..539701497 100644
> --- a/grub-core/commands/efi/lsefi.c
> +++ b/grub-core/commands/efi/lsefi.c
> @@ -31,7 +31,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
>  
>  struct known_protocol
>  {
> -  grub_guid_t guid;
> +  grub_efi_guid_t guid;
>    const char *name;
>  } known_protocols[] =
>    {
> @@ -96,7 +96,7 @@ grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)),
>        grub_efi_handle_t handle = handles[i];
>        grub_efi_status_t status;
>        grub_efi_uintn_t num_protocols;
> -      grub_guid_t **protocols;
> +      grub_efi_packed_guid_t **protocols;
>        grub_efi_device_path_t *dp;
>  
>        grub_printf ("Handle %p\n", handle);
> diff --git a/grub-core/commands/efi/lsefisystab.c 
> b/grub-core/commands/efi/lsefisystab.c
> index eff8c41f3..ac3299b7f 100644
> --- a/grub-core/commands/efi/lsefisystab.c
> +++ b/grub-core/commands/efi/lsefisystab.c
> @@ -29,7 +29,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
>  
>  struct guid_mapping
>  {
> -  grub_guid_t guid;
> +  grub_efi_guid_t guid;
>    const char *name;
>  };
>  
> @@ -104,7 +104,7 @@ grub_cmd_lsefisystab (struct grub_command *cmd 
> __attribute__ ((unused)),
>  
>        for (j = 0; j < ARRAY_SIZE (guid_mappings); j++)
>       if (grub_memcmp (&guid_mappings[j].guid, &t->vendor_guid,
> -                      sizeof (grub_guid_t)) == 0)
> +                      sizeof (grub_efi_guid_t)) == 0)
>         grub_printf ("   %s", guid_mappings[j].name);
>  
>        grub_printf ("\n");
> diff --git a/grub-core/commands/efi/lssal.c b/grub-core/commands/efi/lssal.c
> index fd6085f1b..5084ddd8b 100644
> --- a/grub-core/commands/efi/lssal.c
> +++ b/grub-core/commands/efi/lssal.c
> @@ -139,12 +139,12 @@ grub_cmd_lssal (struct grub_command *cmd __attribute__ 
> ((unused)),
>    const grub_efi_system_table_t *st = grub_efi_system_table;
>    grub_efi_configuration_table_t *t = st->configuration_table;
>    unsigned int i;
> -  static grub_guid_t guid = GRUB_EFI_SAL_TABLE_GUID;
> +  grub_efi_packed_guid_t guid = GRUB_EFI_SAL_TABLE_GUID;
>  
>    for (i = 0; i < st->num_table_entries; i++)
>      {
>        if (grub_memcmp (&guid, &t->vendor_guid,
> -                    sizeof (grub_guid_t)) == 0)
> +                    sizeof (grub_efi_packed_guid_t)) == 0)
>       {
>         disp_sal (t->vendor_table);
>         return GRUB_ERR_NONE;
> diff --git a/grub-core/commands/efi/smbios.c b/grub-core/commands/efi/smbios.c
> index d77239732..75202d5aa 100644
> --- a/grub-core/commands/efi/smbios.c
> +++ b/grub-core/commands/efi/smbios.c
> @@ -26,14 +26,14 @@ struct grub_smbios_eps *
>  grub_machine_smbios_get_eps (void)
>  {
>    unsigned i;
> -  static grub_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID;
> +  static grub_efi_packed_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID;
>  
>    for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
>      {
> -      grub_guid_t *guid =
> +      grub_efi_packed_guid_t *guid =
>       &grub_efi_system_table->configuration_table[i].vendor_guid;
>  
> -      if (! grub_memcmp (guid, &smbios_guid, sizeof (grub_guid_t)))
> +      if (! grub_memcmp (guid, &smbios_guid, sizeof 
> (grub_efi_packed_guid_t)))
>       return (struct grub_smbios_eps *)
>         grub_efi_system_table->configuration_table[i].vendor_table;
>      }
> @@ -45,14 +45,14 @@ struct grub_smbios_eps3 *
>  grub_machine_smbios_get_eps3 (void)
>  {
>    unsigned i;
> -  static grub_guid_t smbios3_guid = GRUB_EFI_SMBIOS3_TABLE_GUID;
> +  static grub_efi_packed_guid_t smbios3_guid = GRUB_EFI_SMBIOS3_TABLE_GUID;
>  
>    for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
>      {
> -      grub_guid_t *guid =
> +      grub_efi_packed_guid_t *guid =
>       &grub_efi_system_table->configuration_table[i].vendor_guid;
>  
> -      if (! grub_memcmp (guid, &smbios3_guid, sizeof (grub_guid_t)))
> +      if (! grub_memcmp (guid, &smbios3_guid, sizeof 
> (grub_efi_packed_guid_t)))
>       return (struct grub_smbios_eps3 *)
>         grub_efi_system_table->configuration_table[i].vendor_table;
>      }
> diff --git a/grub-core/commands/efi/tpm.c b/grub-core/commands/efi/tpm.c
> index f250c30db..bf98c9a6d 100644
> --- a/grub-core/commands/efi/tpm.c
> +++ b/grub-core/commands/efi/tpm.c
> @@ -30,9 +30,9 @@
>  
>  typedef TCG_PCR_EVENT grub_tpm_event_t;
>  
> -static grub_guid_t tpm_guid = EFI_TPM_GUID;
> -static grub_guid_t tpm2_guid = EFI_TPM2_GUID;
> -static grub_guid_t cc_measurement_guid = 
> GRUB_EFI_CC_MEASUREMENT_PROTOCOL_GUID;
> +static grub_efi_guid_t tpm_guid = EFI_TPM_GUID;
> +static grub_efi_guid_t tpm2_guid = EFI_TPM2_GUID;
> +static grub_efi_guid_t cc_measurement_guid = 
> GRUB_EFI_CC_MEASUREMENT_PROTOCOL_GUID;
>  
>  static grub_efi_handle_t *grub_tpm_handle;
>  static grub_uint8_t grub_tpm_version;
> diff --git a/grub-core/commands/probe.c b/grub-core/commands/probe.c
> index cc8c05586..9a80ea54f 100644
> --- a/grub-core/commands/probe.c
> +++ b/grub-core/commands/probe.c
> @@ -119,7 +119,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, 
> char **args)
>         if (grub_strcmp(dev->disk->partition->partmap->name, "gpt") == 0)
>           {
>             struct grub_gpt_partentry entry;
> -           grub_guid_t *guid;
> +           grub_gpt_part_guid_t *guid;
>  
>             if (grub_disk_read(disk, p->offset, p->index, sizeof(entry), 
> &entry))
>               {
> diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c
> index 3b5ed5691..ad025010a 100644
> --- a/grub-core/disk/efi/efidisk.c
> +++ b/grub-core/disk/efi/efidisk.c
> @@ -37,7 +37,7 @@ struct grub_efidisk_data
>  };
>  
>  /* GUID.  */
> -static grub_guid_t block_io_guid = GRUB_EFI_BLOCK_IO_GUID;
> +static grub_efi_guid_t block_io_guid = GRUB_EFI_BLOCK_IO_GUID;
>  
>  static struct grub_efidisk_data *fd_devices;
>  static struct grub_efidisk_data *hd_devices;
> @@ -319,7 +319,7 @@ name_devices (struct grub_efidisk_data *devices)
>         == GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE)
>       {
>         grub_efi_vendor_device_path_t *vendor = 
> (grub_efi_vendor_device_path_t *) dp;
> -       static const grub_guid_t apple = GRUB_EFI_VENDOR_APPLE_GUID;
> +       const struct grub_efi_guid apple = GRUB_EFI_VENDOR_APPLE_GUID;
>  
>         if (vendor->header.length == sizeof (*vendor)
>             && grub_memcmp (&vendor->vendor_guid, &apple,
> diff --git a/grub-core/disk/ldm.c b/grub-core/disk/ldm.c
> index 34bfe6bd1..9632bc489 100644
> --- a/grub-core/disk/ldm.c
> +++ b/grub-core/disk/ldm.c
> @@ -136,7 +136,7 @@ msdos_has_ldm_partition (grub_disk_t dsk)
>    return has_ldm;
>  }
>  
> -static const grub_guid_t ldm_type = GRUB_GPT_PARTITION_TYPE_LDM;
> +static const grub_gpt_part_guid_t ldm_type = GRUB_GPT_PARTITION_TYPE_LDM;
>  
>  /* Helper for gpt_ldm_sector.  */
>  static int
> diff --git a/grub-core/efiemu/i386/pc/cfgtables.c 
> b/grub-core/efiemu/i386/pc/cfgtables.c
> index 056ec0bc9..1098f0b79 100644
> --- a/grub-core/efiemu/i386/pc/cfgtables.c
> +++ b/grub-core/efiemu/i386/pc/cfgtables.c
> @@ -29,9 +29,9 @@ grub_machine_efiemu_init_tables (void)
>  {
>    void *table;
>    grub_err_t err;
> -  static grub_guid_t smbios = GRUB_EFI_SMBIOS_TABLE_GUID;
> -  static grub_guid_t acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID;
> -  static grub_guid_t acpi = GRUB_EFI_ACPI_TABLE_GUID;
> +  static grub_efi_guid_t smbios = GRUB_EFI_SMBIOS_TABLE_GUID;
> +  static grub_efi_guid_t acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID;
> +  static grub_efi_guid_t acpi = GRUB_EFI_ACPI_TABLE_GUID;
>  
>    err = grub_efiemu_unregister_configuration_table (smbios);
>    if (err)
> diff --git a/grub-core/efiemu/main.c b/grub-core/efiemu/main.c
> index e7037f4ed..a81934725 100644
> --- a/grub-core/efiemu/main.c
> +++ b/grub-core/efiemu/main.c
> @@ -80,7 +80,7 @@ grub_efiemu_unload (void)
>  
>  /* Remove previously registered table from the list */
>  grub_err_t
> -grub_efiemu_unregister_configuration_table (grub_guid_t guid)
> +grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid)
>  {
>    struct grub_efiemu_configuration_table *cur, *prev;
>  
> @@ -136,7 +136,7 @@ grub_efiemu_register_prepare_hook (grub_err_t (*hook) 
> (void *data),
>     or with a hook
>  */
>  grub_err_t
> -grub_efiemu_register_configuration_table (grub_guid_t guid,
> +grub_efiemu_register_configuration_table (grub_efi_guid_t guid,
>                                         void * (*get_table) (void *data),
>                                         void (*unload) (void *data),
>                                         void *data)
> diff --git a/grub-core/efiemu/runtime/efiemu.c 
> b/grub-core/efiemu/runtime/efiemu.c
> index c84b30652..53b3cce7b 100644
> --- a/grub-core/efiemu/runtime/efiemu.c
> +++ b/grub-core/efiemu/runtime/efiemu.c
> @@ -66,7 +66,7 @@ efiemu_convert_pointer (grub_efi_uintn_t debug_disposition,
>  
>  grub_efi_status_t __grub_efi_api
>  efiemu_get_variable (grub_efi_char16_t *variable_name,
> -                  const grub_guid_t *vendor_guid,
> +                  const grub_efi_guid_t *vendor_guid,
>                    grub_efi_uint32_t *attributes,
>                    grub_efi_uintn_t *data_size,
>                    void *data);
> @@ -74,11 +74,11 @@ efiemu_get_variable (grub_efi_char16_t *variable_name,
>  grub_efi_status_t __grub_efi_api
>  efiemu_get_next_variable_name (grub_efi_uintn_t *variable_name_size,
>                              grub_efi_char16_t *variable_name,
> -                            grub_guid_t *vendor_guid);
> +                            grub_efi_guid_t *vendor_guid);
>  
>  grub_efi_status_t __grub_efi_api
>  efiemu_set_variable (grub_efi_char16_t *variable_name,
> -                  const grub_guid_t *vendor_guid,
> +                  const grub_efi_guid_t *vendor_guid,
>                    grub_efi_uint32_t attributes,
>                    grub_efi_uintn_t data_size,
>                    void *data);
> @@ -416,7 +416,7 @@ EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t 
> debug_disposition,
>  
>  /* Find variable by name and GUID. */
>  static struct efi_variable *
> -find_variable (const grub_guid_t *vendor_guid,
> +find_variable (const grub_efi_guid_t *vendor_guid,
>              grub_efi_char16_t *variable_name)
>  {
>    grub_uint8_t *ptr;
> @@ -438,7 +438,7 @@ find_variable (const grub_guid_t *vendor_guid,
>  
>  grub_efi_status_t __grub_efi_api
>  EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t *variable_name,
> -                             const grub_guid_t *vendor_guid,
> +                             const grub_efi_guid_t *vendor_guid,
>                               grub_efi_uint32_t *attributes,
>                               grub_efi_uintn_t *data_size,
>                               void *data)
> @@ -464,7 +464,7 @@ EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t 
> *variable_name,
>  grub_efi_status_t __grub_efi_api EFI_FUNC
>  (efiemu_get_next_variable_name) (grub_efi_uintn_t *variable_name_size,
>                                grub_efi_char16_t *variable_name,
> -                              grub_guid_t *vendor_guid)
> +                              grub_efi_guid_t *vendor_guid)
>  {
>    struct efi_variable *efivar;
>    LOG ('l');
> @@ -503,7 +503,7 @@ grub_efi_status_t __grub_efi_api EFI_FUNC
>  
>  grub_efi_status_t __grub_efi_api
>  EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name,
> -                             const grub_guid_t *vendor_guid,
> +                             const grub_efi_guid_t *vendor_guid,
>                               grub_efi_uint32_t attributes,
>                               grub_efi_uintn_t data_size,
>                               void *data)
> diff --git a/grub-core/kern/efi/acpi.c b/grub-core/kern/efi/acpi.c
> index 461c77c33..74f8cd1a9 100644
> --- a/grub-core/kern/efi/acpi.c
> +++ b/grub-core/kern/efi/acpi.c
> @@ -26,14 +26,14 @@ struct grub_acpi_rsdp_v10 *
>  grub_machine_acpi_get_rsdpv1 (void)
>  {
>    unsigned i;
> -  static grub_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
> +  static grub_efi_packed_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
>  
>    for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
>      {
> -      grub_guid_t *guid =
> +      grub_efi_packed_guid_t *guid =
>       &grub_efi_system_table->configuration_table[i].vendor_guid;
>  
> -      if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_guid_t)))
> +      if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_packed_guid_t)))
>       return (struct grub_acpi_rsdp_v10 *)
>         grub_efi_system_table->configuration_table[i].vendor_table;
>      }
> @@ -44,14 +44,14 @@ struct grub_acpi_rsdp_v20 *
>  grub_machine_acpi_get_rsdpv2 (void)
>  {
>    unsigned i;
> -  static grub_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
> +  static grub_efi_packed_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
>  
>    for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
>      {
> -      grub_guid_t *guid =
> +      grub_efi_packed_guid_t *guid =
>       &grub_efi_system_table->configuration_table[i].vendor_guid;
>  
> -      if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_guid_t)))
> +      if (! grub_memcmp (guid, &acpi20_guid, sizeof 
> (grub_efi_packed_guid_t)))
>       return (struct grub_acpi_rsdp_v20 *)
>         grub_efi_system_table->configuration_table[i].vendor_table;
>      }
> diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
> index 5e1c147a5..629ccb7b7 100644
> --- a/grub-core/kern/efi/efi.c
> +++ b/grub-core/kern/efi/efi.c
> @@ -35,12 +35,12 @@ grub_efi_handle_t grub_efi_image_handle;
>  /* The pointer to a system table. Filled in by the startup code.  */
>  grub_efi_system_table_t *grub_efi_system_table;
>  
> -static grub_guid_t console_control_guid = GRUB_EFI_CONSOLE_CONTROL_GUID;
> -static grub_guid_t loaded_image_guid = GRUB_EFI_LOADED_IMAGE_GUID;
> -static grub_guid_t device_path_guid = GRUB_EFI_DEVICE_PATH_GUID;
> +static grub_efi_guid_t console_control_guid = GRUB_EFI_CONSOLE_CONTROL_GUID;
> +static grub_efi_guid_t loaded_image_guid = GRUB_EFI_LOADED_IMAGE_GUID;
> +static grub_efi_guid_t device_path_guid = GRUB_EFI_DEVICE_PATH_GUID;
>  
>  void *
> -grub_efi_locate_protocol (grub_guid_t *protocol, void *registration)
> +grub_efi_locate_protocol (grub_efi_guid_t *protocol, void *registration)
>  {
>    void *interface;
>    grub_efi_status_t status;
> @@ -59,7 +59,7 @@ grub_efi_locate_protocol (grub_guid_t *protocol, void 
> *registration)
>     from the heap.  */
>  grub_efi_handle_t *
>  grub_efi_locate_handle (grub_efi_locate_search_type_t search_type,
> -                     grub_guid_t *protocol,
> +                     grub_efi_guid_t *protocol,
>                       void *search_key,
>                       grub_efi_uintn_t *num_handles)
>  {
> @@ -98,7 +98,7 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t 
> search_type,
>  
>  void *
>  grub_efi_open_protocol (grub_efi_handle_t handle,
> -                     grub_guid_t *protocol,
> +                     grub_efi_guid_t *protocol,
>                       grub_efi_uint32_t attributes)
>  {
>    grub_efi_boot_services_t *b;
> @@ -119,7 +119,7 @@ grub_efi_open_protocol (grub_efi_handle_t handle,
>  }
>  
>  grub_efi_status_t
> -grub_efi_close_protocol (grub_efi_handle_t handle, grub_guid_t *protocol)
> +grub_efi_close_protocol (grub_efi_handle_t handle, grub_efi_guid_t *protocol)
>  {
>    grub_efi_boot_services_t *b = grub_efi_system_table->boot_services;
>  
> @@ -203,7 +203,7 @@ grub_efi_set_virtual_address_map (grub_efi_uintn_t 
> memory_map_size,
>  }
>  
>  grub_err_t
> -grub_efi_set_variable_with_attributes (const char *var, const grub_guid_t 
> *guid,
> +grub_efi_set_variable_with_attributes (const char *var, const 
> grub_efi_guid_t *guid,
>                     void *data, grub_size_t datasize, grub_efi_uint32_t 
> attributes)
>  {
>    grub_efi_status_t status;
> @@ -226,7 +226,7 @@ grub_efi_set_variable_with_attributes (const char *var, 
> const grub_guid_t *guid,
>  }
>  
>  grub_err_t
> -grub_efi_set_variable (const char *var, const grub_guid_t *guid,
> +grub_efi_set_variable (const char *var, const grub_efi_guid_t *guid,
>                     void *data, grub_size_t datasize)
>  {
>    return grub_efi_set_variable_with_attributes (var, guid, data, datasize,
> @@ -237,7 +237,7 @@ grub_efi_set_variable (const char *var, const grub_guid_t 
> *guid,
>  
>  grub_efi_status_t
>  grub_efi_get_variable_with_attributes (const char *var,
> -                                    const grub_guid_t *guid,
> +                                    const grub_efi_guid_t *guid,
>                                      grub_size_t *datasize_out,
>                                      void **data_out,
>                                      grub_efi_uint32_t *attributes)
> @@ -287,7 +287,7 @@ grub_efi_get_variable_with_attributes (const char *var,
>  }
>  
>  grub_err_t
> -grub_efi_set_variable_to_string (const char *name, const grub_guid_t *guid,
> +grub_efi_set_variable_to_string (const char *name, const grub_efi_guid_t 
> *guid,
>                                const char *value, grub_efi_uint32_t 
> attributes)
>  {
>    grub_efi_char16_t *value_16;
> @@ -309,7 +309,7 @@ grub_efi_set_variable_to_string (const char *name, const 
> grub_guid_t *guid,
>  }
>  
>  grub_efi_status_t
> -grub_efi_get_variable (const char *var, const grub_guid_t *guid,
> +grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid,
>                      grub_size_t *datasize_out, void **data_out)
>  {
>    return grub_efi_get_variable_with_attributes (var, guid, datasize_out, 
> data_out, NULL);
> diff --git a/grub-core/kern/efi/fdt.c b/grub-core/kern/efi/fdt.c
> index 8fcf43f1b..24f955289 100644
> --- a/grub-core/kern/efi/fdt.c
> +++ b/grub-core/kern/efi/fdt.c
> @@ -24,7 +24,7 @@ void *
>  grub_efi_get_firmware_fdt (void)
>  {
>    grub_efi_configuration_table_t *tables;
> -  static grub_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
> +  static grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
>    void *firmware_fdt = NULL;
>    unsigned int i;
>  
> diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c
> index 6fe1ff8c8..ae8c2e1e4 100644
> --- a/grub-core/kern/efi/init.c
> +++ b/grub-core/kern/efi/init.c
> @@ -37,7 +37,7 @@ static grub_efi_char16_t stack_chk_fail_msg[] =
>    L"* GRUB: ABORTED!!! *\r\n"
>    L"* GRUB: REBOOTING IN 5 SECONDS... *\r\n";
>  
> -static grub_guid_t rng_protocol_guid = GRUB_EFI_RNG_PROTOCOL_GUID;
> +static grub_efi_guid_t rng_protocol_guid = GRUB_EFI_RNG_PROTOCOL_GUID;
>  
>  /*
>   * Don't put this on grub_efi_init()'s local stack to avoid it
> diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c
> index 60550a6da..583002ae4 100644
> --- a/grub-core/kern/efi/sb.c
> +++ b/grub-core/kern/efi/sb.c
> @@ -30,7 +30,7 @@
>  #include <grub/types.h>
>  #include <grub/verify.h>
>  
> -static grub_guid_t shim_lock_guid = GRUB_EFI_SHIM_LOCK_GUID;
> +static grub_efi_guid_t shim_lock_guid = GRUB_EFI_SHIM_LOCK_GUID;
>  
>  static bool shim_lock_enabled = false;
>  
> @@ -43,7 +43,7 @@ static bool shim_lock_enabled = false;
>  grub_uint8_t
>  grub_efi_get_secureboot (void)
>  {
> -  static grub_guid_t efi_variable_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID;
> +  static grub_efi_guid_t efi_variable_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID;
>    grub_efi_status_t status;
>    grub_efi_uint32_t attr = 0;
>    grub_size_t size = 0;
> diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c
> index 439964b9c..35a3be2e5 100644
> --- a/grub-core/loader/efi/fdt.c
> +++ b/grub-core/loader/efi/fdt.c
> @@ -86,7 +86,7 @@ grub_err_t
>  grub_fdt_install (void)
>  {
>    grub_efi_boot_services_t *b;
> -  static grub_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
> +  static grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
>    grub_efi_status_t status;
>  
>    if (fdt == NULL && loaded_fdt == NULL)
> diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
> index bfbd95aee..ca69f4350 100644
> --- a/grub-core/loader/efi/linux.c
> +++ b/grub-core/loader/efi/linux.c
> @@ -52,8 +52,8 @@ static struct grub_linux_initrd_context initrd_ctx = {0, 0, 
> 0};
>  static grub_efi_handle_t initrd_lf2_handle = NULL;
>  static bool initrd_use_loadfile2 = false;
>  
> -static grub_guid_t load_file2_guid = GRUB_EFI_LOAD_FILE2_PROTOCOL_GUID;
> -static grub_guid_t device_path_guid = GRUB_EFI_DEVICE_PATH_GUID;
> +static grub_efi_guid_t load_file2_guid = GRUB_EFI_LOAD_FILE2_PROTOCOL_GUID;
> +static grub_efi_guid_t device_path_guid = GRUB_EFI_DEVICE_PATH_GUID;
>  
>  static initrd_media_device_path_t initrd_lf2_device_path = {
>    {
> diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c
> index 93ba4476d..4c88ce5e0 100644
> --- a/grub-core/loader/i386/xnu.c
> +++ b/grub-core/loader/i386/xnu.c
> @@ -48,7 +48,7 @@ grub_uint32_t grub_xnu_entry_point, grub_xnu_arg1, 
> grub_xnu_stack;
>  /* Aliases set for some tables. */
>  struct tbl_alias
>  {
> -  grub_guid_t guid;
> +  grub_efi_guid_t guid;
>    const char *name;
>  };
>  
> @@ -694,7 +694,7 @@ grub_cpu_xnu_fill_devicetree (grub_uint64_t *fsbfreq_out)
>      {
>        void *ptr;
>        struct grub_xnu_devtree_key *curkey;
> -      grub_guid_t guid;
> +      grub_efi_packed_guid_t guid;
>        char guidbuf[64];
>  
>        /* Retrieve current key. */
> diff --git a/grub-core/loader/ia64/efi/linux.c 
> b/grub-core/loader/ia64/efi/linux.c
> index 3dd2e8236..fb9b961f7 100644
> --- a/grub-core/loader/ia64/efi/linux.c
> +++ b/grub-core/loader/ia64/efi/linux.c
> @@ -106,7 +106,7 @@ query_fpswa (void)
>    grub_efi_boot_services_t *bs;
>    grub_efi_status_t status;
>    grub_efi_uintn_t size;
> -  static const grub_guid_t fpswa_protocol =
> +  static const grub_efi_guid_t fpswa_protocol =
>      { 0xc41b6531, 0x97b9, 0x11d3,
>        {0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} };
>  
> diff --git a/grub-core/net/drivers/efi/efinet.c 
> b/grub-core/net/drivers/efi/efinet.c
> index 3ea25cf98..56a179709 100644
> --- a/grub-core/net/drivers/efi/efinet.c
> +++ b/grub-core/net/drivers/efi/efinet.c
> @@ -27,8 +27,8 @@
>  GRUB_MOD_LICENSE ("GPLv3+");
>  
>  /* GUID.  */
> -static grub_guid_t net_io_guid = GRUB_EFI_SIMPLE_NETWORK_GUID;
> -static grub_guid_t pxe_io_guid = GRUB_EFI_PXE_GUID;
> +static grub_efi_guid_t net_io_guid = GRUB_EFI_SIMPLE_NETWORK_GUID;
> +static grub_efi_guid_t pxe_io_guid = GRUB_EFI_PXE_GUID;
>  
>  static grub_err_t
>  send_card_buffer (struct grub_net_card *dev,
> diff --git a/grub-core/partmap/gpt.c b/grub-core/partmap/gpt.c
> index 877ceefc3..075cc96f1 100644
> --- a/grub-core/partmap/gpt.c
> +++ b/grub-core/partmap/gpt.c
> @@ -36,10 +36,10 @@ static grub_uint8_t grub_gpt_magic[8] =
>      0x45, 0x46, 0x49, 0x20, 0x50, 0x41, 0x52, 0x54
>    };
>  
> -static const grub_guid_t grub_gpt_partition_type_empty = 
> GRUB_GPT_PARTITION_TYPE_EMPTY;
> +static const grub_gpt_part_guid_t grub_gpt_partition_type_empty = 
> GRUB_GPT_PARTITION_TYPE_EMPTY;
>  
>  #ifdef GRUB_UTIL
> -static const grub_guid_t grub_gpt_partition_type_bios_boot = 
> GRUB_GPT_PARTITION_TYPE_BIOS_BOOT;
> +static const grub_gpt_part_guid_t grub_gpt_partition_type_bios_boot = 
> GRUB_GPT_PARTITION_TYPE_BIOS_BOOT;
>  #endif
>  
>  /* 512 << 7 = 65536 byte sectors.  */
> diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
> index bb587f39d..9a7bc0fcf 100644
> --- a/grub-core/term/efi/console.c
> +++ b/grub-core/term/efi/console.c
> @@ -352,7 +352,7 @@ grub_console_getkeystatus (struct grub_term_input *term)
>  static grub_err_t
>  grub_efi_console_input_init (struct grub_term_input *term)
>  {
> -  static grub_guid_t text_input_ex_guid =
> +  static grub_efi_guid_t text_input_ex_guid =
>      GRUB_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID;
>  
>    if (grub_efi_is_finished)
> diff --git a/grub-core/term/efi/serial.c b/grub-core/term/efi/serial.c
> index 5dfd2d86c..e86ebce3f 100644
> --- a/grub-core/term/efi/serial.c
> +++ b/grub-core/term/efi/serial.c
> @@ -31,7 +31,7 @@
>  #include <grub/i18n.h>
>  
>  /* GUID.  */
> -static grub_guid_t serial_io_guid = GRUB_EFI_SERIAL_IO_GUID;
> +static grub_efi_guid_t serial_io_guid = GRUB_EFI_SERIAL_IO_GUID;
>  
>  static void
>  do_real_config (struct grub_serial_port *port)
> diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c
> index 9452f5e58..68c9d58f9 100644
> --- a/grub-core/video/efi_gop.c
> +++ b/grub-core/video/efi_gop.c
> @@ -32,10 +32,10 @@
>  
>  GRUB_MOD_LICENSE ("GPLv3+");
>  
> -static grub_guid_t graphics_output_guid = GRUB_EFI_GOP_GUID;
> -static grub_guid_t active_edid_guid = GRUB_EFI_EDID_ACTIVE_GUID;
> -static grub_guid_t discovered_edid_guid = GRUB_EFI_EDID_DISCOVERED_GUID;
> -static grub_guid_t efi_var_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID;
> +static grub_efi_guid_t graphics_output_guid = GRUB_EFI_GOP_GUID;
> +static grub_efi_guid_t active_edid_guid = GRUB_EFI_EDID_ACTIVE_GUID;
> +static grub_efi_guid_t discovered_edid_guid = GRUB_EFI_EDID_DISCOVERED_GUID;
> +static grub_efi_guid_t efi_var_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID;
>  static struct grub_efi_gop *gop;
>  static unsigned old_mode;
>  static int restore_needed;
> diff --git a/grub-core/video/efi_uga.c b/grub-core/video/efi_uga.c
> index d53079e0b..aa4659b8e 100644
> --- a/grub-core/video/efi_uga.c
> +++ b/grub-core/video/efi_uga.c
> @@ -32,7 +32,7 @@
>  
>  GRUB_MOD_LICENSE ("GPLv3+");
>  
> -static grub_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID;
> +static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID;
>  static struct grub_efi_uga_draw_protocol *uga;
>  static grub_uint64_t uga_fb;
>  static grub_uint32_t uga_pitch;
> diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
> index d3eaef3fb..b846c2e5d 100644
> --- a/include/grub/efi/api.h
> +++ b/include/grub/efi/api.h
> @@ -644,6 +644,24 @@ typedef grub_uint8_t grub_efi_ip_address_t[8] 
> __attribute__ ((aligned(4)));
>  typedef grub_efi_uint64_t grub_efi_physical_address_t;
>  typedef grub_efi_uint64_t grub_efi_virtual_address_t;
>  
> +struct grub_efi_guid
> +{
> +  grub_uint32_t data1;
> +  grub_uint16_t data2;
> +  grub_uint16_t data3;
> +  grub_uint8_t data4[8];
> +} __attribute__ ((aligned(8)));
> +typedef struct grub_efi_guid grub_efi_guid_t;
> +
> +struct grub_efi_packed_guid
> +{
> +  grub_uint32_t data1;
> +  grub_uint16_t data2;
> +  grub_uint16_t data3;
> +  grub_uint8_t data4[8];
> +} GRUB_PACKED;
> +typedef struct grub_efi_packed_guid grub_efi_packed_guid_t;
> +
>  /* XXX although the spec does not specify the padding, this actually
>     must have the padding!  */
>  struct grub_efi_memory_descriptor
> @@ -730,7 +748,7 @@ typedef struct grub_efi_memory_mapped_device_path 
> grub_efi_memory_mapped_device_
>  struct grub_efi_vendor_device_path
>  {
>    grub_efi_device_path_t header;
> -  grub_guid_t vendor_guid;
> +  grub_efi_packed_guid_t vendor_guid;
>    grub_efi_uint8_t vendor_defined_data[0];
>  } GRUB_PACKED;
>  typedef struct grub_efi_vendor_device_path grub_efi_vendor_device_path_t;
> @@ -974,7 +992,7 @@ typedef struct grub_efi_cdrom_device_path 
> grub_efi_cdrom_device_path_t;
>  struct grub_efi_vendor_media_device_path
>  {
>    grub_efi_device_path_t header;
> -  grub_guid_t vendor_guid;
> +  grub_efi_packed_guid_t vendor_guid;
>    grub_efi_uint8_t vendor_defined_data[0];
>  } GRUB_PACKED;
>  typedef struct grub_efi_vendor_media_device_path 
> grub_efi_vendor_media_device_path_t;
> @@ -993,7 +1011,7 @@ typedef struct grub_efi_file_path_device_path 
> grub_efi_file_path_device_path_t;
>  struct grub_efi_protocol_device_path
>  {
>    grub_efi_device_path_t header;
> -  grub_guid_t guid;
> +  grub_efi_packed_guid_t guid;
>  } GRUB_PACKED;
>  typedef struct grub_efi_protocol_device_path grub_efi_protocol_device_path_t;
>  
> @@ -1002,7 +1020,7 @@ typedef struct grub_efi_protocol_device_path 
> grub_efi_protocol_device_path_t;
>  struct grub_efi_piwg_device_path
>  {
>    grub_efi_device_path_t header;
> -  grub_guid_t guid;
> +  grub_efi_packed_guid_t guid;
>  } GRUB_PACKED;
>  typedef struct grub_efi_piwg_device_path grub_efi_piwg_device_path_t;
>  
> @@ -1173,47 +1191,47 @@ struct grub_efi_boot_services
>  
>    grub_efi_status_t
>    (__grub_efi_api *install_protocol_interface) (grub_efi_handle_t *handle,
> -                                             grub_guid_t *protocol,
> +                                             grub_efi_guid_t *protocol,
>                                               grub_efi_interface_type_t 
> protocol_interface_type,
>                                               void *protocol_interface);
>  
>    grub_efi_status_t
>    (__grub_efi_api *reinstall_protocol_interface) (grub_efi_handle_t handle,
> -                                               grub_guid_t *protocol,
> +                                               grub_efi_guid_t *protocol,
>                                                 void *old_interface,
>                                                 void *new_interface);
>  
>    grub_efi_status_t
>    (__grub_efi_api *uninstall_protocol_interface) (grub_efi_handle_t handle,
> -                                               grub_guid_t *protocol,
> +                                               grub_efi_guid_t *protocol,
>                                                 void *protocol_interface);
>  
>    grub_efi_status_t
>    (__grub_efi_api *handle_protocol) (grub_efi_handle_t handle,
> -                                  grub_guid_t *protocol,
> +                                  grub_efi_guid_t *protocol,
>                                    void **protocol_interface);
>  
>    void *reserved;
>  
>    grub_efi_status_t
> -  (__grub_efi_api *register_protocol_notify) (grub_guid_t *protocol,
> +  (__grub_efi_api *register_protocol_notify) (grub_efi_guid_t *protocol,
>                                             grub_efi_event_t event,
>                                             void **registration);
>  
>    grub_efi_status_t
>    (__grub_efi_api *locate_handle) (grub_efi_locate_search_type_t search_type,
> -                                grub_guid_t *protocol,
> +                                grub_efi_guid_t *protocol,
>                                  void *search_key,
>                                  grub_efi_uintn_t *buffer_size,
>                                  grub_efi_handle_t *buffer);
>  
>    grub_efi_status_t
> -  (__grub_efi_api *locate_device_path) (grub_guid_t *protocol,
> +  (__grub_efi_api *locate_device_path) (grub_efi_guid_t *protocol,
>                                       grub_efi_device_path_t **device_path,
>                                       grub_efi_handle_t *device);
>  
>    grub_efi_status_t
> -  (__grub_efi_api *install_configuration_table) (grub_guid_t *guid,
> +  (__grub_efi_api *install_configuration_table) (grub_efi_guid_t *guid,
>                                                void *table);
>  
>    grub_efi_status_t
> @@ -1267,7 +1285,7 @@ struct grub_efi_boot_services
>  
>    grub_efi_status_t
>    (__grub_efi_api *open_protocol) (grub_efi_handle_t handle,
> -                                grub_guid_t *protocol,
> +                                grub_efi_guid_t *protocol,
>                                  void **protocol_interface,
>                                  grub_efi_handle_t agent_handle,
>                                  grub_efi_handle_t controller_handle,
> @@ -1275,30 +1293,30 @@ struct grub_efi_boot_services
>  
>    grub_efi_status_t
>    (__grub_efi_api *close_protocol) (grub_efi_handle_t handle,
> -                                 grub_guid_t *protocol,
> +                                 grub_efi_guid_t *protocol,
>                                   grub_efi_handle_t agent_handle,
>                                   grub_efi_handle_t controller_handle);
>  
>    grub_efi_status_t
>    (__grub_efi_api *open_protocol_information) (grub_efi_handle_t handle,
> -                                            grub_guid_t *protocol,
> +                                            grub_efi_guid_t *protocol,
>                                              
> grub_efi_open_protocol_information_entry_t **entry_buffer,
>                                              grub_efi_uintn_t *entry_count);
>  
>    grub_efi_status_t
>    (__grub_efi_api *protocols_per_handle) (grub_efi_handle_t handle,
> -                                       grub_guid_t ***protocol_buffer,
> +                                       grub_efi_packed_guid_t 
> ***protocol_buffer,
>                                         grub_efi_uintn_t 
> *protocol_buffer_count);
>  
>    grub_efi_status_t
>    (__grub_efi_api *locate_handle_buffer) (grub_efi_locate_search_type_t 
> search_type,
> -                                       grub_guid_t *protocol,
> +                                       grub_efi_guid_t *protocol,
>                                         void *search_key,
>                                         grub_efi_uintn_t *no_handles,
>                                         grub_efi_handle_t **buffer);
>  
>    grub_efi_status_t
> -  (__grub_efi_api *locate_protocol) (grub_guid_t *protocol,
> +  (__grub_efi_api *locate_protocol) (grub_efi_guid_t *protocol,
>                                    void *registration,
>                                    void **protocol_interface);
>  
> @@ -1356,7 +1374,7 @@ struct grub_efi_runtime_services
>  
>    grub_efi_status_t
>    (__grub_efi_api *get_variable) (grub_efi_char16_t *variable_name,
> -                               const grub_guid_t *vendor_guid,
> +                               const grub_efi_guid_t *vendor_guid,
>                                 grub_efi_uint32_t *attributes,
>                                 grub_efi_uintn_t *data_size,
>                                 void *data);
> @@ -1364,11 +1382,11 @@ struct grub_efi_runtime_services
>    grub_efi_status_t
>    (__grub_efi_api *get_next_variable_name) (grub_efi_uintn_t 
> *variable_name_size,
>                                           grub_efi_char16_t *variable_name,
> -                                         grub_guid_t *vendor_guid);
> +                                         grub_efi_guid_t *vendor_guid);
>  
>    grub_efi_status_t
>    (__grub_efi_api *set_variable) (grub_efi_char16_t *variable_name,
> -                               const grub_guid_t *vendor_guid,
> +                               const grub_efi_guid_t *vendor_guid,
>                                 grub_efi_uint32_t attributes,
>                                 grub_efi_uintn_t data_size,
>                                 void *data);
> @@ -1386,7 +1404,7 @@ typedef struct grub_efi_runtime_services 
> grub_efi_runtime_services_t;
>  
>  struct grub_efi_configuration_table
>  {
> -  grub_guid_t vendor_guid;
> +  grub_efi_packed_guid_t vendor_guid;
>    void *vendor_table;
>  } GRUB_PACKED;
>  typedef struct grub_efi_configuration_table grub_efi_configuration_table_t;
> @@ -1785,7 +1803,7 @@ struct grub_efi_shim_lock_protocol
>  };
>  typedef struct grub_efi_shim_lock_protocol grub_efi_shim_lock_protocol_t;
>  
> -typedef grub_guid_t grub_efi_rng_algorithm_t;
> +typedef grub_efi_guid_t grub_efi_rng_algorithm_t;
>  
>  struct grub_efi_rng_protocol
>  {
> diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
> index 572f7135f..bf9e7f275 100644
> --- a/include/grub/efi/efi.h
> +++ b/include/grub/efi/efi.h
> @@ -37,18 +37,18 @@ struct linux_arch_kernel_header {
>  };
>  
>  /* Functions.  */
> -void *EXPORT_FUNC(grub_efi_locate_protocol) (grub_guid_t *protocol,
> +void *EXPORT_FUNC(grub_efi_locate_protocol) (grub_efi_guid_t *protocol,
>                                            void *registration);
>  grub_efi_handle_t *
>  EXPORT_FUNC(grub_efi_locate_handle) (grub_efi_locate_search_type_t 
> search_type,
> -                                  grub_guid_t *protocol,
> +                                  grub_efi_guid_t *protocol,
>                                    void *search_key,
>                                    grub_efi_uintn_t *num_handles);
>  void *EXPORT_FUNC(grub_efi_open_protocol) (grub_efi_handle_t handle,
> -                                        grub_guid_t *protocol,
> +                                        grub_efi_guid_t *protocol,
>                                          grub_efi_uint32_t attributes);
>  grub_efi_status_t
> -EXPORT_FUNC(grub_efi_close_protocol) (grub_efi_handle_t handle, grub_guid_t 
> *protocol);
> +EXPORT_FUNC(grub_efi_close_protocol) (grub_efi_handle_t handle, 
> grub_efi_guid_t *protocol);
>  int EXPORT_FUNC(grub_efi_set_text_mode) (int on);
>  void EXPORT_FUNC(grub_efi_stall) (grub_efi_uintn_t microseconds);
>  void *
> @@ -89,27 +89,27 @@ grub_err_t EXPORT_FUNC (grub_efi_set_virtual_address_map) 
> (grub_efi_uintn_t memo
>                                                          grub_efi_uint32_t 
> descriptor_version,
>                                                          
> grub_efi_memory_descriptor_t *virtual_map);
>  grub_efi_status_t EXPORT_FUNC (grub_efi_get_variable_with_attributes) (const 
> char *variable,
> -                                                                    const 
> grub_guid_t *guid,
> +                                                                    const 
> grub_efi_guid_t *guid,
>                                                                      
> grub_size_t *datasize_out,
>                                                                      void 
> **data_out,
>                                                                      
> grub_efi_uint32_t *attributes);
>  grub_efi_status_t EXPORT_FUNC (grub_efi_get_variable) (const char *variable,
> -                                                    const grub_guid_t *guid,
> +                                                    const grub_efi_guid_t 
> *guid,
>                                                      grub_size_t 
> *datasize_out,
>                                                      void **data_out);
>  grub_err_t
>  EXPORT_FUNC (grub_efi_set_variable_with_attributes) (const char *var,
> -                                  const grub_guid_t *guid,
> +                                  const grub_efi_guid_t *guid,
>                                    void *data,
>                                    grub_size_t datasize,
>                                    grub_efi_uint32_t attributes);
>  grub_err_t
>  EXPORT_FUNC (grub_efi_set_variable) (const char *var,
> -                                  const grub_guid_t *guid,
> +                                  const grub_efi_guid_t *guid,
>                                    void *data,
>                                    grub_size_t datasize);
>  grub_err_t
> -EXPORT_FUNC (grub_efi_set_variable_to_string) (const char *name, const 
> grub_guid_t *guid,
> +EXPORT_FUNC (grub_efi_set_variable_to_string) (const char *name, const 
> grub_efi_guid_t *guid,
>                                              const char *value, 
> grub_efi_uint32_t attributes);
>  int
>  EXPORT_FUNC (grub_efi_compare_device_paths) (const grub_efi_device_path_t 
> *dp1,
> diff --git a/include/grub/efiemu/efiemu.h b/include/grub/efiemu/efiemu.h
> index caf0b505f..5325e5839 100644
> --- a/include/grub/efiemu/efiemu.h
> +++ b/include/grub/efiemu/efiemu.h
> @@ -176,26 +176,26 @@ grub_err_t grub_efiemu_loadcore_load (void);
>  struct grub_efiemu_configuration_table
>  {
>    struct grub_efiemu_configuration_table *next;
> -  grub_guid_t guid;
> +  grub_efi_guid_t guid;
>    void * (*get_table) (void *data);
>    void (*unload) (void *data);
>    void *data;
>  };
>  struct grub_efiemu_configuration_table32
>  {
> -  grub_guid_t vendor_guid;
> +  grub_efi_packed_guid_t vendor_guid;
>    grub_efi_uint32_t vendor_table;
>  } GRUB_PACKED;
>  typedef struct grub_efiemu_configuration_table32 
> grub_efiemu_configuration_table32_t;
>  struct grub_efiemu_configuration_table64
>  {
> -  grub_guid_t vendor_guid;
> +  grub_efi_packed_guid_t vendor_guid;
>    grub_efi_uint64_t vendor_table;
>  } GRUB_PACKED;
>  typedef struct grub_efiemu_configuration_table64 
> grub_efiemu_configuration_table64_t;
> -grub_err_t grub_efiemu_unregister_configuration_table (grub_guid_t guid);
> +grub_err_t grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid);
>  grub_err_t
> -grub_efiemu_register_configuration_table (grub_guid_t guid,
> +grub_efiemu_register_configuration_table (grub_efi_guid_t guid,
>                                         void * (*get_table) (void *data),
>                                         void (*unload) (void *data),
>                                         void *data);
> diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h
> index c9ad9fdfa..36d2dedf4 100644
> --- a/include/grub/efiemu/runtime.h
> +++ b/include/grub/efiemu/runtime.h
> @@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel
>  
>  struct efi_variable
>  {
> -  grub_guid_t guid;
> +  grub_efi_packed_guid_t guid;
>    grub_uint32_t namelen;
>    grub_uint32_t size;
>    grub_efi_uint32_t attributes;
> diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h
> index 020e71920..7a93f4329 100644
> --- a/include/grub/gpt_partition.h
> +++ b/include/grub/gpt_partition.h
> @@ -22,6 +22,15 @@
>  #include <grub/types.h>
>  #include <grub/partition.h>
>  
> +struct grub_gpt_part_guid
> +{
> +  grub_uint32_t data1;
> +  grub_uint16_t data2;
> +  grub_uint16_t data3;
> +  grub_uint8_t data4[8];
> +} GRUB_PACKED;
> +typedef struct grub_gpt_part_guid grub_gpt_part_guid_t;
> +
>  #define GRUB_GPT_PARTITION_TYPE_EMPTY \
>    { 0x0, 0x0, 0x0, \
>      { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } \
> @@ -61,8 +70,8 @@ struct grub_gpt_header
>  
>  struct grub_gpt_partentry
>  {
> -  grub_guid_t type;
> -  grub_guid_t guid;
> +  grub_gpt_part_guid_t type;
> +  grub_gpt_part_guid_t guid;
>    grub_uint64_t start;
>    grub_uint64_t end;
>    grub_uint64_t attrib;
> diff --git a/include/grub/types.h b/include/grub/types.h
> index 0d96006fe..756a29a08 100644
> --- a/include/grub/types.h
> +++ b/include/grub/types.h
> @@ -370,13 +370,4 @@ static inline void grub_set_unaligned64 (void *ptr, 
> grub_uint64_t val)
>  # define grub_absolute_pointer(val) ((void *) (val))
>  #endif
>  
> -struct grub_guid
> -{
> -  grub_uint32_t data1;
> -  grub_uint16_t data2;
> -  grub_uint16_t data3;
> -  grub_uint8_t data4[8];
> -} GRUB_PACKED;
> -typedef struct grub_guid grub_guid_t;
> -
>  #endif /* ! GRUB_TYPES_HEADER */
> diff --git a/util/grub-install.c b/util/grub-install.c
> index 1ad04db36..e20820d9e 100644
> --- a/util/grub-install.c
> +++ b/util/grub-install.c
> @@ -728,7 +728,7 @@ is_prep_partition (grub_device_t dev)
>        if (grub_disk_read (dev->disk, p->offset, p->index,
>                         sizeof (gptdata), &gptdata) == 0)
>       {
> -       const grub_guid_t template = {
> +       const grub_gpt_part_guid_t template = {
>           grub_cpu_to_le32_compile_time (0x9e1a2d38),
>           grub_cpu_to_le16_compile_time (0xc612),
>           grub_cpu_to_le16_compile_time (0x4316),
> diff --git a/util/grub-probe.c b/util/grub-probe.c
> index 65c1ca3f8..446bd2553 100644
> --- a/util/grub-probe.c
> +++ b/util/grub-probe.c
> @@ -133,7 +133,7 @@ get_targets_string (void)
>  }
>  
>  static int
> -print_gpt_guid (grub_guid_t guid)
> +print_gpt_guid (grub_gpt_part_guid_t guid)
>  {
>    guid.data1 = grub_le_to_cpu32 (guid.data1);
>    guid.data2 = grub_le_to_cpu16 (guid.data2);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]