\r
#include <Library/UefiLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DebugAgentLib.h>\r
\r
#define AP_CHECK_INTERVAL (EFI_TIMER_PERIOD_MILLISECONDS (100))\r
#define AP_SAFE_STACK_SIZE 128\r
UINTN mReservedTopOfApStack;\r
volatile UINT32 mNumberToFinish = 0;\r
\r
+/**\r
+ Enable Debug Agent to support source debugging on AP function.\r
+\r
+**/\r
+VOID\r
+EnableDebugAgent (\r
+ VOID\r
+ )\r
+{\r
+ //\r
+ // Initialize Debug Agent to support source level debug in DXE phase\r
+ //\r
+ InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_AP, NULL, NULL);\r
+}\r
+\r
/**\r
Get the pointer to CPU MP Data structure.\r
\r
EFI_EVENT is defined in CreateEvent() in\r
the Unified Extensible Firmware Interface\r
Specification.\r
- @param[in] TimeoutInMicrosecsond Indicates the time limit in microseconds for\r
+ @param[in] TimeoutInMicroseconds Indicates the time limit in microseconds for\r
APs to return from Procedure, either for\r
blocking or non-blocking mode. Zero means\r
infinity. If the timeout expires before\r
EFI_EVENT is defined in CreateEvent() in\r
the Unified Extensible Firmware Interface\r
Specification.\r
- @param[in] TimeoutInMicrosecsond Indicates the time limit in microseconds for\r
+ @param[in] TimeoutInMicroseconds Indicates the time limit in microseconds for\r
this AP to finish this Procedure, either for\r
blocking or non-blocking mode. Zero means\r
infinity. If the timeout expires before\r
)\r
{\r
EFI_STATUS Status;\r
- BOOLEAN OldInterruptState;\r
\r
- //\r
- // Before send both BSP and AP to a procedure to exchange their roles,\r
- // interrupt must be disabled. This is because during the exchange role\r
- // process, 2 CPU may use 1 stack. If interrupt happens, the stack will\r
- // be corrupted, since interrupt return address will be pushed to stack\r
- // by hardware.\r
- //\r
- OldInterruptState = SaveAndDisableInterrupts ();\r
-\r
- //\r
- // Mask LINT0 & LINT1 for the old BSP\r
- //\r
- DisableLvtInterrupts ();\r
\r
Status = SwitchBSPWorker (ProcessorNumber, EnableOldBSP);\r
\r
- //\r
- // Restore interrupt state.\r
- //\r
- SetInterruptState (OldInterruptState);\r
-\r
return Status;\r
}\r
\r