diff --git a/httpboot.c b/httpboot.c index e4657c1..058704f 100644 --- a/httpboot.c +++ b/httpboot.c @@ -38,8 +38,6 @@ #include "Ip4Config2.h" #include "Ip6Config.h" -extern UINT8 in_protocol; - #define perror(fmt, ...) ({ \ UINTN __perror_ret = 0; \ if (!in_protocol) \ diff --git a/include/console.h b/include/console.h index e9cf285..6481a3d 100644 --- a/include/console.h +++ b/include/console.h @@ -93,4 +93,8 @@ extern EFI_STATUS print_crypto_errors(EFI_STATUS rc, char *file, const char *fun extern VOID msleep(unsigned long msecs); +/* This is used in various things to determine if we should print to the + * console */ +extern UINT8 in_protocol; + #endif /* _SHIM_LIB_CONSOLE_H */ diff --git a/lib/console.c b/lib/console.c index cd8d1de..0f50851 100644 --- a/lib/console.c +++ b/lib/console.c @@ -489,3 +489,7 @@ msleep(unsigned long msecs) { uefi_call_wrapper(BS->Stall, 1, msecs); } + +/* This is used in various things to determine if we should print to the + * console */ +UINT8 in_protocol = 0; diff --git a/shim.c b/shim.c index c6ad2cd..aec9f8f 100644 --- a/shim.c +++ b/shim.c @@ -62,7 +62,6 @@ static EFI_STATUS (EFIAPI *entry_point) (EFI_HANDLE image_handle, EFI_SYSTEM_TAB static CHAR16 *second_stage; static void *load_options; static UINT32 load_options_size; -static UINT8 in_protocol; #define perror(fmt, ...) ({ \ UINTN __perror_ret = 0; \ diff --git a/tpm.c b/tpm.c index 05b3c6f..dbbafbf 100644 --- a/tpm.c +++ b/tpm.c @@ -4,8 +4,7 @@ #include #include "tpm.h" - -extern UINT8 in_protocol; +#include "console.h" #define perror(fmt, ...) ({ \ UINTN __perror_ret = 0; \