TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeDebugAgentLib.c File Reference
#include "DxeDebugAgentLib.h"

Go to the source code of this file.

Functions

BOOLEAN MultiProcessorDebugSupport (VOID)
 
VOID InternalConstructorWorker (VOID)
 
RETURN_STATUS EFIAPI DxeDebugAgentLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
DEBUG_AGENT_MAILBOXGetMailboxFromConfigurationTable (VOID)
 
DEBUG_AGENT_MAILBOXGetMailboxFromHob (IN VOID *HobStart)
 
DEBUG_AGENT_MAILBOXGetMailboxPointer (VOID)
 
DEBUG_PORT_HANDLE GetDebugPortHandle (VOID)
 
VOID SetupDebugAgentEnvironment (IN DEBUG_AGENT_MAILBOX *Mailbox)
 
VOID EFIAPI InitializeDebugAgent (IN UINT32 InitFlag, IN VOID *Context OPTIONAL, IN DEBUG_AGENT_CONTINUE Function OPTIONAL)
 

Variables

DEBUG_AGENT_MAILBOX mMailbox
 
DEBUG_AGENT_MAILBOXmMailboxPointer = NULL
 
IA32_IDT_GATE_DESCRIPTOR mIdtEntryTable [33]
 
BOOLEAN mDxeCoreFlag = FALSE
 
BOOLEAN mMultiProcessorDebugSupport = FALSE
 
VOID * mSavedIdtTable = NULL
 
UINTN mSaveIdtTableSize = 0
 
BOOLEAN mDebugAgentInitialized = FALSE
 
BOOLEAN mSkipBreakpoint = FALSE
 

Detailed Description

Debug Agent library implementation for Dxe Core and Dxr modules.

Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DxeDebugAgentLib.c.

Function Documentation

◆ DxeDebugAgentLibConstructor()

RETURN_STATUS EFIAPI DxeDebugAgentLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Debug Agent constructor function.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
RETURN_SUCCESSWhen this function completed.

Definition at line 135 of file DxeDebugAgentLib.c.

◆ GetDebugPortHandle()

DEBUG_PORT_HANDLE GetDebugPortHandle ( VOID  )

Get debug port handle.

Returns
Debug port handle.

Definition at line 226 of file DxeDebugAgentLib.c.

◆ GetMailboxFromConfigurationTable()

DEBUG_AGENT_MAILBOX * GetMailboxFromConfigurationTable ( VOID  )

Get the pointer to Mailbox from the configuration table.

Returns
Pointer to Mailbox.

Definition at line 157 of file DxeDebugAgentLib.c.

◆ GetMailboxFromHob()

DEBUG_AGENT_MAILBOX * GetMailboxFromHob ( IN VOID *  HobStart)

Get the pointer to Mailbox from the GUIDed HOB.

Parameters
[in]HobStartThe starting HOB pointer to search from.
Returns
Pointer to Mailbox.

Definition at line 182 of file DxeDebugAgentLib.c.

◆ GetMailboxPointer()

DEBUG_AGENT_MAILBOX * GetMailboxPointer ( VOID  )

Get Debug Agent Mailbox pointer.

Returns
Mailbox pointer.

Definition at line 209 of file DxeDebugAgentLib.c.

◆ InitializeDebugAgent()

VOID EFIAPI InitializeDebugAgent ( IN UINT32  InitFlag,
IN VOID *Context  OPTIONAL,
IN DEBUG_AGENT_CONTINUE Function  OPTIONAL 
)

Initialize debug agent.

This function is used to set up debug environment for DXE phase.

If this function is called by DXE Core, Context must be the pointer to HOB list which will be used to get GUIDed HOB. It will enable interrupt to support break-in feature. If this function is called by DXE module, Context must be NULL. It will enable interrupt to support break-in feature.

Parameters
[in]InitFlagInit flag is used to decide initialize process.
[in]ContextContext needed according to InitFlag.
[in]FunctionContinue function called by debug agent library; it was optional.

Definition at line 351 of file DxeDebugAgentLib.c.

◆ InternalConstructorWorker()

VOID InternalConstructorWorker ( VOID  )

Internal constructor worker function.

It will register one callback function on EFI PCD Protocol. It will allocate the NVS memory to store Mailbox and install configuration table in system table to store its pointer.

Definition at line 45 of file DxeDebugAgentLib.c.

◆ MultiProcessorDebugSupport()

BOOLEAN MultiProcessorDebugSupport ( VOID  )

Check if debug agent support multi-processor.

Return values
TRUEMulti-processor is supported.
FALSEMulti-processor is not supported.

Definition at line 29 of file DxeDebugAgentLib.c.

◆ SetupDebugAgentEnvironment()

VOID SetupDebugAgentEnvironment ( IN DEBUG_AGENT_MAILBOX Mailbox)

Worker function to set up Debug Agent environment.

This function will set up IDT table and initialize the IDT entries and initialize CPU LOCAL APIC timer. It also tries to connect HOST if Debug Agent was not initialized before.

Parameters
[in]MailboxPointer to Mailbox.

Definition at line 244 of file DxeDebugAgentLib.c.

Variable Documentation

◆ mDebugAgentInitialized

BOOLEAN mDebugAgentInitialized = FALSE

Definition at line 18 of file DxeDebugAgentLib.c.

◆ mDxeCoreFlag

BOOLEAN mDxeCoreFlag = FALSE

Definition at line 14 of file DxeDebugAgentLib.c.

◆ mIdtEntryTable

IA32_IDT_GATE_DESCRIPTOR mIdtEntryTable[33]

Definition at line 13 of file DxeDebugAgentLib.c.

◆ mMailbox

Definition at line 11 of file DxeDebugAgentLib.c.

◆ mMailboxPointer

DEBUG_AGENT_MAILBOX* mMailboxPointer = NULL

Definition at line 12 of file DxeDebugAgentLib.c.

◆ mMultiProcessorDebugSupport

BOOLEAN mMultiProcessorDebugSupport = FALSE

Definition at line 15 of file DxeDebugAgentLib.c.

◆ mSavedIdtTable

VOID* mSavedIdtTable = NULL

Definition at line 16 of file DxeDebugAgentLib.c.

◆ mSaveIdtTableSize

UINTN mSaveIdtTableSize = 0

Definition at line 17 of file DxeDebugAgentLib.c.

◆ mSkipBreakpoint

BOOLEAN mSkipBreakpoint = FALSE

Definition at line 19 of file DxeDebugAgentLib.c.