diff options
author | Tom Rini <trini@konsulko.com> | 2018-12-03 17:52:40 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-12-03 17:52:40 -0500 |
commit | f388e3bed7318efe97058b673801dda6f563d319 (patch) | |
tree | ed391f6b8cfad1bc53dabeb7239ffcc716a8ca4e /lib/efi_loader/helloworld.c | |
parent | ec0d0d8742df12a4c0d3e8382b77c0672cd4aab6 (diff) | |
parent | 1a82b3413cb577cd52cf8a1dc22dd306e4ce0772 (diff) |
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot
Patch queue for efi - 2018-12-03
This release is fully packed with lots of glorious improvements in UEFI
land again!
- Make PE images more standards compliant
- Improve sandbox support
- Improve correctness
- Fix RISC-V execution on virt model
- Honor board defined top of ram (fixes a few boards)
- Imply DM USB access when distro boot is available
- Code cleanups
Diffstat (limited to 'lib/efi_loader/helloworld.c')
-rw-r--r-- | lib/efi_loader/helloworld.c | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c index 3b8de5b4ea7..2905479e658 100644 --- a/lib/efi_loader/helloworld.c +++ b/lib/efi_loader/helloworld.c @@ -17,6 +17,16 @@ 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 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; @@ -31,12 +41,12 @@ static int hw_memcmp(const void *buf1, const void *buf2, size_t length) return 0; } -/* - * Entry point of the EFI application. +/** + * efi_main() - entry point of the EFI application. * - * @handle handle of the loaded image - * @systable system table - * @return status code + * @handle: handle of the loaded image + * @systable: system table + * @return: status code */ efi_status_t EFIAPI efi_main(efi_handle_t handle, struct efi_system_table *systable) @@ -48,7 +58,8 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle, efi_uintn_t i; u16 rev[] = L"0.0.0"; - con_out->output_string(con_out, L"Hello, world!\n"); + /* UEFI requires CR LF */ + con_out->output_string(con_out, L"Hello, world!\r\n"); /* Print the revision number */ rev[0] = (systable->hdr.revision >> 16) + '0'; @@ -65,27 +76,30 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle, con_out->output_string(con_out, L"Running on UEFI "); con_out->output_string(con_out, rev); - con_out->output_string(con_out, L"\n"); + con_out->output_string(con_out, L"\r\n"); /* Get the loaded image protocol */ ret = boottime->handle_protocol(handle, &loaded_image_guid, (void **)&loaded_image); if (ret != EFI_SUCCESS) { - con_out->output_string(con_out, - L"Cannot open loaded image protocol\n"); + con_out->output_string + (con_out, L"Cannot open loaded image protocol\r\n"); goto out; } /* Find configuration tables */ for (i = 0; i < systable->nr_tables; ++i) { if (!hw_memcmp(&systable->tables[i].guid, &fdt_guid, sizeof(efi_guid_t))) - con_out->output_string(con_out, L"Have device tree\n"); + 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))) - con_out->output_string(con_out, L"Have ACPI 2.0 table\n"); + 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))) - con_out->output_string(con_out, L"Have SMBIOS table\n"); + con_out->output_string + (con_out, L"Have SMBIOS table\r\n"); } /* Output the load options */ con_out->output_string(con_out, L"Load options: "); @@ -94,7 +108,7 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle, (u16 *)loaded_image->load_options); else con_out->output_string(con_out, L"<none>"); - con_out->output_string(con_out, L"\n"); + con_out->output_string(con_out, L"\r\n"); out: boottime->exit(handle, ret, 0, NULL); |