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>
39 // AP reset code information including code address and size,
40 // this structure will be shared be C code and assembly code.
41 // It is natural aligned by design.
44 UINT8
*RendezvousFunnelAddress
;
45 UINTN ModeEntryOffset
;
46 UINTN RendezvousFunnelSize
;
47 UINT8
*RelocateApLoopFuncAddress
;
48 UINTN RelocateApLoopFuncSize
;
49 } MP_ASSEMBLY_ADDRESS_MAP
;
54 // MP CPU exchange information for AP reset code
55 // This structure is required to be packed because fixed field offsets
56 // into this structure are used in assembly code in this module
63 IA32_DESCRIPTOR GdtrProfile
;
64 IA32_DESCRIPTOR IdtrProfile
;
67 UINTN NumApsExecuting
;
70 UINTN EnableExecuteDisable
;
72 } MP_CPU_EXCHANGE_INFO
;
76 Assembly code to place AP into safe loop mode.
78 Place AP into targeted C-State if MONITOR is supported, otherwise
79 place AP into hlt state.
80 Place AP in protected mode if the current is long mode. Due to AP maybe
81 wakeup by some hardware event. It could avoid accessing page table that
82 may not available during booting to OS.
84 @param[in] MwaitSupport TRUE indicates MONITOR is supported.
85 FALSE indicates MONITOR is not supported.
86 @param[in] ApTargetCState Target C-State value.
87 @param[in] PmCodeSegment Protected mode code segment value.
91 (EFIAPI
* ASM_RELOCATE_AP_LOOP
) (
92 IN BOOLEAN MwaitSupport
,
93 IN UINTN ApTargetCState
,
94 IN UINTN PmCodeSegment
98 Assembly code to get starting address and size of the rendezvous entry for APs.
99 Information for fixing a jump instruction in the code is also returned.
101 @param[out] AddressMap Output buffer for address map information.
106 OUT MP_ASSEMBLY_ADDRESS_MAP
*AddressMap