)\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
UINTN CallerNumber;\r
CPU_STATE State;\r
MSR_IA32_APIC_BASE_REGISTER ApicBaseMsr;\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
CpuMpData = GetCpuMpData ();\r
\r
//\r
CpuMpData->BspNumber = (UINT32) ProcessorNumber;\r
\r
+ //\r
+ // Restore interrupt state.\r
+ //\r
+ SetInterruptState (OldInterruptState);\r
+\r
+\r
return EFI_SUCCESS;\r
}\r
\r