mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
efi_loader: Add guidcpy function
Add guidcpy function to copy the source guid to the destination guid. Use this function instead of memcpy for copying to the destination guid. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Use void * instead of efi_guid_t * for arguments to allow copying unaligned GUIDs. The GUIDs of configuration tables are __packed. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
committed by
Heinrich Schuchardt
parent
9bb758aab6
commit
61e42d9465
@@ -17,6 +17,11 @@ static inline int guidcmp(const void *g1, const void *g2)
|
|||||||
return memcmp(g1, g2, sizeof(efi_guid_t));
|
return memcmp(g1, g2, sizeof(efi_guid_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void *guidcpy(void *dst, const void *src)
|
||||||
|
{
|
||||||
|
return memcpy(dst, src, sizeof(efi_guid_t));
|
||||||
|
}
|
||||||
|
|
||||||
/* No need for efi loader support in SPL */
|
/* No need for efi loader support in SPL */
|
||||||
#if CONFIG_IS_ENABLED(EFI_LOADER)
|
#if CONFIG_IS_ENABLED(EFI_LOADER)
|
||||||
|
|
||||||
|
@@ -1401,7 +1401,7 @@ static efi_status_t EFIAPI efi_register_protocol_notify(
|
|||||||
}
|
}
|
||||||
|
|
||||||
item->event = event;
|
item->event = event;
|
||||||
memcpy(&item->protocol, protocol, sizeof(efi_guid_t));
|
guidcpy(&item->protocol, protocol);
|
||||||
INIT_LIST_HEAD(&item->handles);
|
INIT_LIST_HEAD(&item->handles);
|
||||||
|
|
||||||
list_add_tail(&item->link, &efi_register_notify_events);
|
list_add_tail(&item->link, &efi_register_notify_events);
|
||||||
@@ -1632,7 +1632,7 @@ efi_status_t efi_install_configuration_table(const efi_guid_t *guid,
|
|||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
|
||||||
/* Add a new entry */
|
/* Add a new entry */
|
||||||
memcpy(&systab.tables[i].guid, guid, sizeof(*guid));
|
guidcpy(&systab.tables[i].guid, guid);
|
||||||
systab.tables[i].table = table;
|
systab.tables[i].table = table;
|
||||||
systab.nr_tables = i + 1;
|
systab.nr_tables = i + 1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user