Skip to content

Commit

Permalink
MdeModulePkg/Core/Dxe/DxeMain/DxeMain: Add late initialization for De…
Browse files Browse the repository at this point in the history
…bug Agent.

Adds a late initialize in DxeMain for the debug agent. This is required
for the debug agent to be able to setup events to handle image loads,
exit boot services, and other important callbacks.
  • Loading branch information
cfernald authored and apop5 committed Jun 27, 2024
1 parent bb2f962 commit 0d304cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,13 @@ DxeMain (
Status = CoreInitializeEventServices ();
ASSERT_EFI_ERROR (Status);

// MU_CHANGE [BEGIN]
// Give the debug agent a chance to initialize with events.

InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_CORE_LATE, HobStart, NULL);

// MU_CHANGE [END]

MemoryProfileInstallProtocol ();

CoreInitializeMemoryAttributesTable ();
Expand Down
2 changes: 2 additions & 0 deletions MdeModulePkg/Include/Library/DebugAgentLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define DEBUG_AGENT_INIT_DXE_LOAD 10
#define DEBUG_AGENT_INIT_DXE_UNLOAD 11
#define DEBUG_AGENT_INIT_THUNK_PEI_IA32TOX64 12
#define DEBUG_AGENT_INIT_REINITIALIZE 13 // MU_CHANGE
#define DEBUG_AGENT_INIT_DXE_CORE_LATE 14 // MU_CHANGE

//
// Context for DEBUG_AGENT_INIT_POSTMEM_SEC
Expand Down

0 comments on commit 0d304cd

Please sign in to comment.