2 Common header file for MP Initialize Library.
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 #include <Register/Cpuid.h>
21 #include <Register/Msr.h>
22 #include <Register/LocalApic.h>
23 #include <Register/Microcode.h>
25 #include <Library/MpInitLib.h>
26 #include <Library/BaseLib.h>
27 #include <Library/BaseMemoryLib.h>
28 #include <Library/MemoryAllocationLib.h>
29 #include <Library/DebugLib.h>
30 #include <Library/LocalApicLib.h>
31 #include <Library/CpuLib.h>
32 #include <Library/UefiCpuLib.h>
33 #include <Library/TimerLib.h>
34 #include <Library/SynchronizationLib.h>
35 #include <Library/MtrrLib.h>
36 #include <Library/HobLib.h>
42 // MP CPU exchange information for AP reset code
43 // This structure is required to be packed because fixed field offsets
44 // into this structure are used in assembly code in this module
51 IA32_DESCRIPTOR GdtrProfile
;
52 IA32_DESCRIPTOR IdtrProfile
;
55 UINTN NumApsExecuting
;
58 UINTN EnableExecuteDisable
;
60 } MP_CPU_EXCHANGE_INFO
;
64 Assembly code to place AP into safe loop mode.
66 Place AP into targeted C-State if MONITOR is supported, otherwise
67 place AP into hlt state.
68 Place AP in protected mode if the current is long mode. Due to AP maybe
69 wakeup by some hardware event. It could avoid accessing page table that
70 may not available during booting to OS.
72 @param[in] MwaitSupport TRUE indicates MONITOR is supported.
73 FALSE indicates MONITOR is not supported.
74 @param[in] ApTargetCState Target C-State value.
75 @param[in] PmCodeSegment Protected mode code segment value.
79 (EFIAPI
* ASM_RELOCATE_AP_LOOP
) (
80 IN BOOLEAN MwaitSupport
,
81 IN UINTN ApTargetCState
,
82 IN UINTN PmCodeSegment