mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/DxeMpInitLib: Support source debugging on AP function
The current DxeDebugAgentLib supports source debugging on AP function. This update is to update DxeMpInitLib to consume Debug Agent Library by DEBUG_AGENT_INIT_DXE_AP flag. Thus, we could source debugging AP function invoked by CPU MP Protocol. However, current SecPeiDebugAgentLib does not support source debugging on AP function invoked by CPU MP PPI. I have submitted one bugzilla to add this support at https://bugzilla.tianocore.org/show_bug.cgi?id=308. Cc: Feng Tian <feng.tian@intel.com> Cc: Kinney Michael D <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
parent
31d060d94e
commit
43c9fdcccd
|
@ -43,6 +43,7 @@
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
UefiCpuPkg/UefiCpuPkg.dec
|
UefiCpuPkg/UefiCpuPkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
|
@ -54,6 +55,7 @@
|
||||||
CpuLib
|
CpuLib
|
||||||
UefiCpuLib
|
UefiCpuLib
|
||||||
UefiBootServicesTableLib
|
UefiBootServicesTableLib
|
||||||
|
DebugAgentLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiEventExitBootServicesGuid ## CONSUMES ## Event
|
gEfiEventExitBootServicesGuid ## CONSUMES ## Event
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
#include <Library/DebugAgentLib.h>
|
||||||
|
|
||||||
#define AP_CHECK_INTERVAL (EFI_TIMER_PERIOD_MILLISECONDS (100))
|
#define AP_CHECK_INTERVAL (EFI_TIMER_PERIOD_MILLISECONDS (100))
|
||||||
#define AP_SAFE_STACK_SIZE 128
|
#define AP_SAFE_STACK_SIZE 128
|
||||||
|
@ -29,6 +30,21 @@ VOID *mReservedApLoopFunc = NULL;
|
||||||
UINTN mReservedTopOfApStack;
|
UINTN mReservedTopOfApStack;
|
||||||
volatile UINT32 mNumberToFinish = 0;
|
volatile UINT32 mNumberToFinish = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Enable Debug Agent to support source debugging on AP function.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EnableDebugAgent (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Initialize Debug Agent to support source level debug in DXE phase
|
||||||
|
//
|
||||||
|
InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_AP, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the pointer to CPU MP Data structure.
|
Get the pointer to CPU MP Data structure.
|
||||||
|
|
||||||
|
|
|
@ -539,6 +539,10 @@ ApWakeupFunction (
|
||||||
if (Procedure != NULL) {
|
if (Procedure != NULL) {
|
||||||
SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateBusy);
|
SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateBusy);
|
||||||
//
|
//
|
||||||
|
// Enable source debugging on AP function
|
||||||
|
//
|
||||||
|
EnableDebugAgent ();
|
||||||
|
//
|
||||||
// Invoke AP function here
|
// Invoke AP function here
|
||||||
//
|
//
|
||||||
Procedure (Parameter);
|
Procedure (Parameter);
|
||||||
|
|
|
@ -575,5 +575,14 @@ RestoreWakeupBuffer(
|
||||||
IN CPU_MP_DATA *CpuMpData
|
IN CPU_MP_DATA *CpuMpData
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Enable Debug Agent to support source debugging on AP function.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EnableDebugAgent (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,18 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR mMpInitLibNotifyList = {
|
||||||
CpuMpEndOfPeiCallback
|
CpuMpEndOfPeiCallback
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Enable Debug Agent to support source debugging on AP function.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EnableDebugAgent (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get pointer to CPU MP Data structure.
|
Get pointer to CPU MP Data structure.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue