mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-22 23:32:39 +00:00
guid: Unify GUID types
There are 3 implementations of a GUID in GRUB. Replace them with a common one, placed in types.h. It uses the "packed" flavor of the GUID structs, the alignment attribute is dropped, since it is not required. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
7e4da6fb2d
commit
06edd40db7
37 files changed
+130
-148
No files matched your search
@@ -26,14 +26,14 @@ struct grub_acpi_rsdp_v10 *
|
||||
grub_machine_acpi_get_rsdpv1 (void)
|
||||
{
|
||||
unsigned i;
|
||||
static grub_efi_packed_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
|
||||
static grub_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
|
||||
|
||||
for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
|
||||
{
|
||||
grub_efi_packed_guid_t *guid =
|
||||
grub_guid_t *guid =
|
||||
&grub_efi_system_table->configuration_table[i].vendor_guid;
|
||||
|
||||
if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_packed_guid_t)))
|
||||
if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_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_efi_packed_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
|
||||
static grub_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
|
||||
|
||||
for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
|
||||
{
|
||||
grub_efi_packed_guid_t *guid =
|
||||
grub_guid_t *guid =
|
||||
&grub_efi_system_table->configuration_table[i].vendor_guid;
|
||||
|
||||
if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_efi_packed_guid_t)))
|
||||
if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_guid_t)))
|
||||
return (struct grub_acpi_rsdp_v20 *)
|
||||
grub_efi_system_table->configuration_table[i].vendor_table;
|
||||
}
|
||||
|
||||
+11
-11
@@ -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_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;
|
||||
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;
|
||||
|
||||
void *
|
||||
grub_efi_locate_protocol (grub_efi_guid_t *protocol, void *registration)
|
||||
grub_efi_locate_protocol (grub_guid_t *protocol, void *registration)
|
||||
{
|
||||
void *interface;
|
||||
grub_efi_status_t status;
|
||||
@@ -59,7 +59,7 @@ grub_efi_locate_protocol (grub_efi_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_efi_guid_t *protocol,
|
||||
grub_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_efi_guid_t *protocol,
|
||||
grub_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_efi_guid_t *protocol)
|
||||
grub_efi_close_protocol (grub_efi_handle_t handle, grub_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_efi_guid_t *guid,
|
||||
grub_efi_set_variable_with_attributes (const char *var, const grub_guid_t *guid,
|
||||
void *data, grub_size_t datasize, grub_efi_uint32_t attributes)
|
||||
{
|
||||
grub_efi_status_t status;
|
||||
@@ -230,7 +230,7 @@ grub_efi_set_variable_with_attributes (const char *var, const grub_efi_guid_t *g
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_efi_set_variable (const char *var, const grub_efi_guid_t *guid,
|
||||
grub_efi_set_variable (const char *var, const grub_guid_t *guid,
|
||||
void *data, grub_size_t datasize)
|
||||
{
|
||||
return grub_efi_set_variable_with_attributes (var, guid, data, datasize,
|
||||
@@ -241,7 +241,7 @@ grub_efi_set_variable (const char *var, const grub_efi_guid_t *guid,
|
||||
|
||||
grub_efi_status_t
|
||||
grub_efi_get_variable_with_attributes (const char *var,
|
||||
const grub_efi_guid_t *guid,
|
||||
const grub_guid_t *guid,
|
||||
grub_size_t *datasize_out,
|
||||
void **data_out,
|
||||
grub_efi_uint32_t *attributes)
|
||||
@@ -296,7 +296,7 @@ grub_efi_get_variable_with_attributes (const char *var,
|
||||
}
|
||||
|
||||
grub_efi_status_t
|
||||
grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid,
|
||||
grub_efi_get_variable (const char *var, const grub_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);
|
||||
|
||||
@@ -24,7 +24,7 @@ void *
|
||||
grub_efi_get_firmware_fdt (void)
|
||||
{
|
||||
grub_efi_configuration_table_t *tables;
|
||||
static grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
|
||||
static grub_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
|
||||
void *firmware_fdt = NULL;
|
||||
unsigned int i;
|
||||
|
||||
|
||||
@@ -36,7 +36,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_efi_guid_t rng_protocol_guid = GRUB_EFI_RNG_PROTOCOL_GUID;
|
||||
static grub_guid_t rng_protocol_guid = GRUB_EFI_RNG_PROTOCOL_GUID;
|
||||
|
||||
/*
|
||||
* Don't put this on grub_efi_init()'s local stack to avoid it
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <grub/types.h>
|
||||
#include <grub/verify.h>
|
||||
|
||||
static grub_efi_guid_t shim_lock_guid = GRUB_EFI_SHIM_LOCK_GUID;
|
||||
static grub_guid_t shim_lock_guid = GRUB_EFI_SHIM_LOCK_GUID;
|
||||
|
||||
/*
|
||||
* Determine whether we're in secure boot mode.
|
||||
@@ -41,7 +41,7 @@ static grub_efi_guid_t shim_lock_guid = GRUB_EFI_SHIM_LOCK_GUID;
|
||||
grub_uint8_t
|
||||
grub_efi_get_secureboot (void)
|
||||
{
|
||||
static grub_efi_guid_t efi_variable_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID;
|
||||
static grub_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;
|
||||
|
||||
Reference in new issue
Block a user