Skip to content

Commit

Permalink
Add late initialization for Debug Agent (#624)
Browse files Browse the repository at this point in the history
## Description

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.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

Tested on QEMU

## Integration Instructions

N/A
  • Loading branch information
cfernald committed Nov 16, 2023
1 parent a0e861f commit c064e72
Show file tree
Hide file tree
Showing 2 changed files with 8 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 @@ -471,6 +471,13 @@ DxeMain (
Status = CoreInitializeEventServices ();
ASSERT_EFI_ERROR (Status);

// MU_CHANGE: START
// 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
1 change: 1 addition & 0 deletions MdeModulePkg/Include/Library/DebugAgentLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define DEBUG_AGENT_INIT_DXE_UNLOAD 11
#define DEBUG_AGENT_INIT_THUNK_PEI_IA32TOX64 12
#define DEBUG_AGENT_INIT_REINITIALIZE 13 // MS_CHANGE
#define DEBUG_AGENT_INIT_DXE_CORE_LATE 14 // MU_CHANGE

//
// Context for DEBUG_AGENT_INIT_POSTMEM_SEC
Expand Down

0 comments on commit c064e72

Please sign in to comment.