Index: stand/common/gfx_fb.c =================================================================== --- stand/common/gfx_fb.c +++ stand/common/gfx_fb.c @@ -751,14 +751,13 @@ #if defined(EFI) EFI_STATUS status; EFI_GRAPHICS_OUTPUT *gop = gfx_state.tg_private; - extern int boot_services_gone; EFI_TPL tpl; /* * We assume Blt() does work, if not, we will need to build * exception list case by case. */ - if (gop != NULL && boot_services_gone == 0) { + if (gop != NULL && has_boot_services) { tpl = BS->RaiseTPL(TPL_NOTIFY); switch (BltOperation) { case GfxFbBltVideoFill: Index: stand/efi/include/efi.h =================================================================== --- stand/efi/include/efi.h +++ stand/efi/include/efi.h @@ -60,11 +60,13 @@ #include "efitcp.h" #include "efipoint.h" #include "efiuga.h" +#include /* * Global variables */ extern EFI_LOADED_IMAGE *boot_img; +extern bool has_boot_services; /* * FreeBSD UUID Index: stand/efi/libefi/efi_console.c =================================================================== --- stand/efi/libefi/efi_console.c +++ stand/efi/libefi/efi_console.c @@ -37,7 +37,6 @@ #include #include "bootstrap.h" -extern int boot_services_gone; extern EFI_GUID gop_guid; static EFI_GUID simple_input_ex_guid = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID; static SIMPLE_TEXT_OUTPUT_INTERFACE *conout; @@ -45,6 +44,8 @@ static EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *coninex; static bool efi_started; +bool has_boot_services = true; + static int mode; /* Does ConOut have serial console? */ static uint32_t utf8_left; @@ -177,7 +178,7 @@ teken_gfx_t *state = arg; UINTN col, row; - if (boot_services_gone) + if (!has_boot_services) return; row = p->tp_row; @@ -238,7 +239,7 @@ EFI_STATUS status; int idx; - if (boot_services_gone) + if (!has_boot_services) return; idx = p->tp_col + p->tp_row * state->tg_tp.tp_col; @@ -258,7 +259,7 @@ teken_gfx_t *state = arg; teken_pos_t p; - if (boot_services_gone) + if (!has_boot_services) return; if (state->tg_cursor_visible) @@ -313,7 +314,7 @@ int nrow, ncol, x, y; /* Has to be signed - >= 0 comparison */ bool scroll = false; - if (boot_services_gone) + if (!has_boot_services) return; /* @@ -369,7 +370,7 @@ { teken_gfx_t *state = arg; - if (boot_services_gone) + if (!has_boot_services) return; switch (cmd) { @@ -746,7 +747,7 @@ int t, i; EFI_STATUS status; - if (boot_services_gone) + if (!has_boot_services) return; switch (esc) { @@ -858,7 +859,7 @@ break; } #else - if (!boot_services_gone) + if (has_boot_services) efi_cons_rawputchar(c); #endif } Index: stand/efi/loader/bootinfo.c =================================================================== --- stand/efi/loader/bootinfo.c +++ stand/efi/loader/bootinfo.c @@ -399,7 +399,7 @@ break; status = BS->ExitBootServices(IH, efi_mapkey); if (!EFI_ERROR(status)) { - boot_services_gone = 1; + has_boot_services = false; break; } }