grub_efi_status_t __grub_efi_api
efiemu_get_variable (grub_efi_char16_t *variable_name,
- const grub_guid_t *vendor_guid,
+ const grub_packed_guid_t *vendor_guid,
grub_efi_uint32_t *attributes,
grub_efi_uintn_t *data_size,
void *data);
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_packed_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_packed_guid_t *vendor_guid,
grub_efi_uint32_t attributes,
grub_efi_uintn_t data_size,
void *data);
/* Find variable by name and GUID. */
static struct efi_variable *
-find_variable (const grub_guid_t *vendor_guid,
+find_variable (const grub_packed_guid_t *vendor_guid,
grub_efi_char16_t *variable_name)
{
grub_uint8_t *ptr;
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_packed_guid_t *vendor_guid,
grub_efi_uint32_t *attributes,
grub_efi_uintn_t *data_size,
void *data)
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_packed_guid_t *vendor_guid)
{
struct efi_variable *efivar;
LOG ('l');
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_packed_guid_t *vendor_guid,
grub_efi_uint32_t attributes,
grub_efi_uintn_t data_size,
void *data)
.set_virtual_address_map = efiemu_set_virtual_address_map,
.convert_pointer = efiemu_convert_pointer,
- .get_variable = efiemu_get_variable,
- .get_next_variable_name = efiemu_get_next_variable_name,
- .set_variable = efiemu_set_variable,
+ /*
+ The code is structured in a way to accept unaligned inputs
+ in most cases and supply 4-byte aligned outputs.
+
+ Efiemu case is a bit ugly because there inputs and outputs are
+ reversed and so we need careful casts to account for this
+ inversion.
+ */
+ .get_variable = (grub_efi_status_t
+ (__grub_efi_api *) (grub_efi_char16_t *variable_name,
+ const grub_guid_t *vendor_guid,
+ grub_efi_uint32_t *attributes,
+ grub_efi_uintn_t *data_size,
+ void *data)) efiemu_get_variable,
+ .get_next_variable_name = (grub_efi_status_t
+ (__grub_efi_api *) (grub_efi_uintn_t *variable_name_size,
+ grub_efi_char16_t *variable_name,
+ grub_guid_t *vendor_guid)) efiemu_get_next_variable_name,
+ .set_variable = (grub_efi_status_t
+ (__grub_efi_api *) (grub_efi_char16_t *variable_name,
+ const grub_guid_t *vendor_guid,
+ grub_efi_uint32_t attributes,
+ grub_efi_uintn_t data_size,
+ void *data)) efiemu_set_variable,
.get_next_high_monotonic_count = efiemu_get_next_high_monotonic_count,
.reset_system = efiemu_reset_system
struct grub_efi_vendor_device_path
{
grub_efi_device_path_t header;
- grub_guid_t vendor_guid;
+ grub_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;
struct grub_efi_vendor_media_device_path
{
grub_efi_device_path_t header;
- grub_guid_t vendor_guid;
+ grub_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;
struct grub_efi_protocol_device_path
{
grub_efi_device_path_t header;
- grub_guid_t guid;
+ grub_packed_guid_t guid;
} GRUB_PACKED;
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_packed_guid_t guid;
} GRUB_PACKED;
typedef struct grub_efi_piwg_device_path grub_efi_piwg_device_path_t;
grub_efi_status_t
(__grub_efi_api *protocols_per_handle) (grub_efi_handle_t handle,
- grub_guid_t ***protocol_buffer,
+ grub_packed_guid_t ***protocol_buffer,
grub_efi_uintn_t *protocol_buffer_count);
grub_efi_status_t
struct grub_efi_configuration_table
{
- grub_guid_t vendor_guid;
+ grub_packed_guid_t vendor_guid;
void *vendor_table;
} GRUB_PACKED;
typedef struct grub_efi_configuration_table grub_efi_configuration_table_t;