mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
efi_loader: use library memcpy() in helloworld.efi
Helloworld does not need its own memcpy() implementation anymore. Use the one provided in efi_freestanding.c. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
2013c6850e
commit
6446304460
1 changed files with 6 additions and 30 deletions
|
@ -17,30 +17,6 @@ static const efi_guid_t fdt_guid = EFI_FDT_GUID;
|
||||||
static const efi_guid_t acpi_guid = EFI_ACPI_TABLE_GUID;
|
static const efi_guid_t acpi_guid = EFI_ACPI_TABLE_GUID;
|
||||||
static const efi_guid_t smbios_guid = SMBIOS_TABLE_GUID;
|
static const efi_guid_t smbios_guid = SMBIOS_TABLE_GUID;
|
||||||
|
|
||||||
/**
|
|
||||||
* hw_memcmp() - compare memory areas
|
|
||||||
*
|
|
||||||
* @buf1: pointer to first area
|
|
||||||
* @buf2: pointer to second area
|
|
||||||
* @length: number of bytes to compare
|
|
||||||
* Return: 0 if both memory areas are the same, otherwise the sign of the
|
|
||||||
* result value is the same as the sign of ghe difference between
|
|
||||||
* the first differing pair of bytes taken as u8.
|
|
||||||
*/
|
|
||||||
static int hw_memcmp(const void *buf1, const void *buf2, size_t length)
|
|
||||||
{
|
|
||||||
const u8 *pos1 = buf1;
|
|
||||||
const u8 *pos2 = buf2;
|
|
||||||
|
|
||||||
for (; length; --length) {
|
|
||||||
if (*pos1 != *pos2)
|
|
||||||
return *pos1 - *pos2;
|
|
||||||
++pos1;
|
|
||||||
++pos2;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* efi_main() - entry point of the EFI application.
|
* efi_main() - entry point of the EFI application.
|
||||||
*
|
*
|
||||||
|
@ -88,16 +64,16 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle,
|
||||||
}
|
}
|
||||||
/* Find configuration tables */
|
/* Find configuration tables */
|
||||||
for (i = 0; i < systable->nr_tables; ++i) {
|
for (i = 0; i < systable->nr_tables; ++i) {
|
||||||
if (!hw_memcmp(&systable->tables[i].guid, &fdt_guid,
|
if (!memcmp(&systable->tables[i].guid, &fdt_guid,
|
||||||
sizeof(efi_guid_t)))
|
sizeof(efi_guid_t)))
|
||||||
con_out->output_string
|
con_out->output_string
|
||||||
(con_out, L"Have device tree\r\n");
|
(con_out, L"Have device tree\r\n");
|
||||||
if (!hw_memcmp(&systable->tables[i].guid, &acpi_guid,
|
if (!memcmp(&systable->tables[i].guid, &acpi_guid,
|
||||||
sizeof(efi_guid_t)))
|
sizeof(efi_guid_t)))
|
||||||
con_out->output_string
|
con_out->output_string
|
||||||
(con_out, L"Have ACPI 2.0 table\r\n");
|
(con_out, L"Have ACPI 2.0 table\r\n");
|
||||||
if (!hw_memcmp(&systable->tables[i].guid, &smbios_guid,
|
if (!memcmp(&systable->tables[i].guid, &smbios_guid,
|
||||||
sizeof(efi_guid_t)))
|
sizeof(efi_guid_t)))
|
||||||
con_out->output_string
|
con_out->output_string
|
||||||
(con_out, L"Have SMBIOS table\r\n");
|
(con_out, L"Have SMBIOS table\r\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue