OpenCanopy: Statically construct GOP content to match pointer context
@@ -48,7 +48,9 @@ GuiOutputConstruct (
VOID
)
{
- GUI_OUTPUT_CONTEXT *Context;
+ // TODO: alloc on the fly?
+ STATIC GUI_OUTPUT_CONTEXT Context;
+
EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop;
Gop = InternalGuiOutputLocateGop();
@@ -56,13 +58,8 @@ GuiOutputConstruct (
return NULL;
}
- Context = AllocatePool (sizeof (*Context));
- if (Context == NULL) {
- return NULL;
- }
-
- Context->Gop = Gop;
- return Context;
+ Context.Gop = Gop;
+ return &Context;
}
EFI_STATUS
@@ -108,5 +105,5 @@ GuiOutputDestruct (
)
{
ASSERT (Context != NULL);
- FreePool (Context);
+ ZeroMem (Context, sizeof (*Context));
}
