Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111132619
D31814.id95952.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D31814.id95952.diff
View Options
Index: stand/common/gfx_fb.c
===================================================================
--- stand/common/gfx_fb.c
+++ stand/common/gfx_fb.c
@@ -751,14 +751,16 @@
#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.
+ * We assume Blt() does work, if not, we will need to build exception
+ * list case by case. We only have boot services during part of our
+ * exectution. Once terminate boot services, these operations cannot be
+ * done as they are provided by protocols that disappear when exit
+ * boot services.
*/
- if (gop != NULL && boot_services_gone == 0) {
+ if (gop != NULL && boot_services_active) {
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 <sys/types.h>
/*
* Global variables
*/
extern EFI_LOADED_IMAGE *boot_img;
+extern bool boot_services_active;
/*
* FreeBSD UUID
Index: stand/efi/libefi/efi_console.c
===================================================================
--- stand/efi/libefi/efi_console.c
+++ stand/efi/libefi/efi_console.c
@@ -37,14 +37,15 @@
#include <framebuffer.h>
#include "bootstrap.h"
-extern int boot_services_gone;
extern EFI_GUID gop_guid;
+
+bool boot_services_active = true; /* boot services active first thing in main */
+
static EFI_GUID simple_input_ex_guid = EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID;
static SIMPLE_TEXT_OUTPUT_INTERFACE *conout;
static SIMPLE_INPUT_INTERFACE *conin;
static EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *coninex;
static bool efi_started;
-
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 (!boot_services_active)
return;
row = p->tp_row;
@@ -238,7 +239,7 @@
EFI_STATUS status;
int idx;
- if (boot_services_gone)
+ if (!boot_services_active)
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 (!boot_services_active)
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 (!boot_services_active)
return;
/*
@@ -369,7 +370,7 @@
{
teken_gfx_t *state = arg;
- if (boot_services_gone)
+ if (!boot_services_active)
return;
switch (cmd) {
@@ -739,6 +740,8 @@
static void
efi_term_emu(int c)
{
+ if (!boot_services_active)
+ return;
#ifdef TERM_EMU
static int ansi_col[] = {
0, 4, 2, 6, 1, 5, 3, 7
@@ -746,9 +749,6 @@
int t, i;
EFI_STATUS status;
- if (boot_services_gone)
- return;
-
switch (esc) {
case 0:
switch (c) {
@@ -858,8 +858,7 @@
break;
}
#else
- if (!boot_services_gone)
- efi_cons_rawputchar(c);
+ efi_cons_rawputchar(c);
#endif
}
Index: stand/efi/loader/bootinfo.c
===================================================================
--- stand/efi/loader/bootinfo.c
+++ stand/efi/loader/bootinfo.c
@@ -65,8 +65,6 @@
extern EFI_SYSTEM_TABLE *ST;
-int boot_services_gone;
-
static int
bi_getboothowto(char *kargs)
{
@@ -399,7 +397,7 @@
break;
status = BS->ExitBootServices(IH, efi_mapkey);
if (!EFI_ERROR(status)) {
- boot_services_gone = 1;
+ boot_services_active = false;
break;
}
}
Index: stand/efi/loader/copy.c
===================================================================
--- stand/efi/loader/copy.c
+++ stand/efi/loader/copy.c
@@ -42,8 +42,6 @@
#define M(x) ((x) * 1024 * 1024)
#define G(x) (1UL * (x) * 1024 * 1024 * 1024)
-extern int boot_services_gone;
-
#if defined(__i386__) || defined(__amd64__)
#include <machine/cpufunc.h>
#include <machine/specialreg.h>
@@ -370,7 +368,7 @@
if (end + staging_slop <= staging_end)
return (true);
- if (boot_services_gone) {
+ if (!boot_services_active) {
if (end <= staging_end)
return (true);
panic("efi_check_space: cannot expand staging area "
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 28, 9:02 PM (13 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16891521
Default Alt Text
D31814.id95952.diff (4 KB)
Attached To
Mode
D31814: efi: switch boot_services_gone to boot_services_active
Attached
Detach File
Event Timeline
Log In to Comment