diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-01-20 10:20:32 +0300 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2019-02-13 11:40:06 +0300 |
commit | 6446304460a63b46ce2ffebafc332b20a76e5ef6 (patch) | |
tree | 0b566111e72a282ba95578c42365862c91871636 /lib | |
parent | 2013c6850e169bfd5ef662a5fb49fdba2860c4f1 (diff) | |
download | u-boot-6446304460a63b46ce2ffebafc332b20a76e5ef6.tar.xz |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/helloworld.c | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c index 2905479e65..426f276361 100644 --- a/lib/efi_loader/helloworld.c +++ b/lib/efi_loader/helloworld.c @@ -18,30 +18,6 @@ static const efi_guid_t acpi_guid = EFI_ACPI_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. * * @handle: handle of the loaded image @@ -88,16 +64,16 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle, } /* Find configuration tables */ for (i = 0; i < systable->nr_tables; ++i) { - if (!hw_memcmp(&systable->tables[i].guid, &fdt_guid, - sizeof(efi_guid_t))) + if (!memcmp(&systable->tables[i].guid, &fdt_guid, + sizeof(efi_guid_t))) con_out->output_string (con_out, L"Have device tree\r\n"); - if (!hw_memcmp(&systable->tables[i].guid, &acpi_guid, - sizeof(efi_guid_t))) + if (!memcmp(&systable->tables[i].guid, &acpi_guid, + sizeof(efi_guid_t))) con_out->output_string (con_out, L"Have ACPI 2.0 table\r\n"); - if (!hw_memcmp(&systable->tables[i].guid, &smbios_guid, - sizeof(efi_guid_t))) + if (!memcmp(&systable->tables[i].guid, &smbios_guid, + sizeof(efi_guid_t))) con_out->output_string (con_out, L"Have SMBIOS table\r\n"); } |