diff options
| author | Hans de Goede <hdegoede@redhat.com> | 2018-03-12 16:03:38 +0100 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2018-03-12 18:00:41 -0400 |
| commit | 1fe31ee1b4ebf2f177d512d0301e11de0689a275 (patch) | |
| tree | 50f082d81f6cab93b9394328c40f005e79e0f256 /lib/simple_file.c | |
| parent | d3b7ba1b09e64c0c17afc48270e38c364ded2cb0 (diff) | |
| download | efi-boot-shim-1fe31ee1b4ebf2f177d512d0301e11de0689a275.tar.gz efi-boot-shim-1fe31ee1b4ebf2f177d512d0301e11de0689a275.zip | |
console: Add console_print and console_print_at helpers
This is a preparation commit for removing the setup_console(1) calls from
MokManager and shim so that we don't force the EFI console to switch to
text-mode.
This commit replaces all direct calls to Print / PrintAt with calls to
the new helpers (no functional changes) so that we can delay calling
setup_console(1) till the first Print call in a follow-up patch.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'lib/simple_file.c')
| -rw-r--r-- | lib/simple_file.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/simple_file.c b/lib/simple_file.c index 8b2324c0..3bf92ed8 100644 --- a/lib/simple_file.c +++ b/lib/simple_file.c @@ -19,14 +19,14 @@ simple_file_open_by_handle(EFI_HANDLE device, CHAR16 *name, EFI_FILE **file, UIN efi_status = gBS->HandleProtocol(device, &EFI_SIMPLE_FILE_SYSTEM_GUID, (void **)&drive); if (EFI_ERROR(efi_status)) { - Print(L"Unable to find simple file protocol (%d)\n", - efi_status); + console_print(L"Unable to find simple file protocol (%d)\n", + efi_status); goto error; } efi_status = drive->OpenVolume(drive, &root); if (EFI_ERROR(efi_status)) { - Print(L"Failed to open drive volume (%d)\n", efi_status); + console_print(L"Failed to open drive volume (%d)\n", efi_status); goto error; } @@ -52,7 +52,7 @@ simple_file_open(EFI_HANDLE image, CHAR16 *name, EFI_FILE **file, UINT64 mode) efi_status = generate_path(name, li, &loadpath, &PathName); if (EFI_ERROR(efi_status)) { - Print(L"Unable to generate load path for %s\n", name); + console_print(L"Unable to generate load path for %s\n", name); return efi_status; } @@ -77,11 +77,11 @@ simple_dir_read_all_by_handle(EFI_HANDLE image, EFI_FILE *file, CHAR16* name, EF efi_status = file->GetInfo(file, &EFI_FILE_INFO_GUID, &size, fi); if (EFI_ERROR(efi_status)) { - Print(L"Failed to get file info\n"); + console_print(L"Failed to get file info\n"); goto out; } if ((fi->Attribute & EFI_FILE_DIRECTORY) == 0) { - Print(L"Not a directory %s\n", name); + console_print(L"Not a directory %s\n", name); efi_status = EFI_INVALID_PARAMETER; goto out; } @@ -127,7 +127,7 @@ simple_dir_read_all(EFI_HANDLE image, CHAR16 *name, EFI_FILE_INFO **entries, efi_status = simple_file_open(image, name, &file, EFI_FILE_MODE_READ); if (EFI_ERROR(efi_status)) { - Print(L"failed to open file %s: %d\n", name, efi_status); + console_print(L"failed to open file %s: %d\n", name, efi_status); return efi_status; } @@ -146,7 +146,7 @@ simple_file_read_all(EFI_FILE *file, UINTN *size, void **buffer) efi_status = file->GetInfo(file, &EFI_FILE_INFO_GUID, size, fi); if (EFI_ERROR(efi_status)) { - Print(L"Failed to get file info\n"); + console_print(L"Failed to get file info\n"); return efi_status; } @@ -154,7 +154,7 @@ simple_file_read_all(EFI_FILE *file, UINTN *size, void **buffer) *buffer = AllocatePool(*size); if (!*buffer) { - Print(L"Failed to allocate buffer of size %d\n", *size); + console_print(L"Failed to allocate buffer of size %d\n", *size); return EFI_OUT_OF_RESOURCES; } @@ -323,7 +323,7 @@ simple_dir_filter(EFI_HANDLE image, CHAR16 *name, CHAR16 *filter, if (next->Attribute & EFI_FILE_DIRECTORY) { (*result)[(*count)] = PoolPrint(L"%s/", next->FileName); if (!(*result)[(*count)]) { - Print(L"Failed to allocate buffer"); + console_print(L"Failed to allocate buffer"); return EFI_OUT_OF_RESOURCES; } (*count)++; @@ -336,7 +336,7 @@ simple_dir_filter(EFI_HANDLE image, CHAR16 *name, CHAR16 *filter, if (StrCmp(&next->FileName[len - offs], filterarr[c]) == 0) { (*result)[(*count)] = StrDuplicate(next->FileName); if (!(*result)[(*count)]) { - Print(L"Failed to allocate buffer"); + console_print(L"Failed to allocate buffer"); return EFI_OUT_OF_RESOURCES; } (*count)++; |
