Introduce grub_efi_packed_guid and use it where alignment is not
guaranteed.
This commit is contained in:
parent
219401b8b9
commit
316dda716c
6 changed files with 82 additions and 70 deletions
|
@ -26,14 +26,14 @@ struct grub_acpi_rsdp_v10 *
|
|||
grub_machine_acpi_get_rsdpv1 (void)
|
||||
{
|
||||
unsigned i;
|
||||
static grub_efi_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_efi_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_efi_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_efi_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_efi_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_efi_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;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,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_efi_guid_t **protocols;
|
||||
grub_efi_packed_guid_t **protocols;
|
||||
grub_efi_device_path_t *dp;
|
||||
|
||||
grub_printf ("Handle %p\n", handle);
|
||||
|
|
|
@ -135,12 +135,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;
|
||||
grub_efi_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_efi_guid_t)) == 0)
|
||||
sizeof (grub_efi_packed_guid_t)) == 0)
|
||||
{
|
||||
disp_sal (t->vendor_table);
|
||||
return GRUB_ERR_NONE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue