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/configtable.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/configtable.c')
| -rw-r--r-- | lib/configtable.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/configtable.c b/lib/configtable.c index 194637ee..df047f0e 100644 --- a/lib/configtable.c +++ b/lib/configtable.c @@ -45,26 +45,26 @@ configtable_find_image(const EFI_DEVICE_PATH *DevicePath) int i; for (i = 0; i < entries; i++) { #ifdef DEBUG_CONFIG - Print(L"InfoSize = %d Action = %d\n", e->InfoSize, e->Action); + console_print(L"InfoSize = %d Action = %d\n", e->InfoSize, e->Action); /* print what we have for debugging */ UINT8 *d = (UINT8 *)e; // + sizeof(UINT32)*2; - Print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + console_print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); d += 16; - Print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + console_print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); d += 16; - Print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + console_print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); d += 16; - Print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + console_print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); d += 16; - Print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + console_print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); d += 16; - Print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", + console_print(L"Data: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]); #endif CHAR16 *name = (CHAR16 *)(e->Data); @@ -76,33 +76,33 @@ configtable_find_image(const EFI_DEVICE_PATH *DevicePath) if (name[0] == '\0' || (e->Data[1] == 0 && e->Data[3] == 0)) { skip = StrSize(name); #ifdef DEBUG_CONFIG - Print(L"FOUND NAME %s (%d)\n", name, skip); + console_print(L"FOUND NAME %s (%d)\n", name, skip); #endif } EFI_DEVICE_PATH *dp = (EFI_DEVICE_PATH *)(e->Data + skip), *dpn = dp; if (dp->Type == 0 || dp->Type > 6 || dp->SubType == 0 || ((unsigned)((dp->Length[1] << 8) + dp->Length[0]) > e->InfoSize)) { /* Parse error, table corrupt, bail */ - Print(L"Image Execution Information table corrupt\n"); + console_print(L"Image Execution Information table corrupt\n"); break; } UINTN Size; DevicePathInstance(&dpn, &Size); #ifdef DEBUG_CONFIG - Print(L"Path: %s\n", DevicePathToStr(dp)); - Print(L"Device Path Size %d\n", Size); + console_print(L"Path: %s\n", DevicePathToStr(dp)); + console_print(L"Device Path Size %d\n", Size); #endif if (Size > e->InfoSize) { /* parse error; the platform obviously has a * corrupted image table; bail */ - Print(L"Image Execution Information table corrupt\n"); + console_print(L"Image Execution Information table corrupt\n"); break; } if (CompareMem(dp, (void *)DevicePath, Size) == 0) { #ifdef DEBUG_CONFIG - Print(L"***FOUND\n"); + console_print(L"***FOUND\n"); console_get_keystroke(); #endif return e; @@ -111,7 +111,7 @@ configtable_find_image(const EFI_DEVICE_PATH *DevicePath) } #ifdef DEBUG_CONFIG - Print(L"***NOT FOUND\n"); + console_print(L"***NOT FOUND\n"); console_get_keystroke(); #endif @@ -134,7 +134,7 @@ configtable_image_is_forbidden(const EFI_DEVICE_PATH *DevicePath) || e->Action == EFI_IMAGE_EXECUTION_AUTH_SIG_FAILED)) { /* this means the images signing key is in dbx */ #ifdef DEBUG_CONFIG - Print(L"SIGNATURE IS IN DBX, FORBIDDING EXECUTION\n"); + console_print(L"SIGNATURE IS IN DBX, FORBIDDING EXECUTION\n"); #endif return 1; } |
