]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/Library/MpInitLib/MpLib.h
UefiCpuPkg/MpInitLib: Add AsmRelocateApLoop() assembly code
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / MpLib.h
CommitLineData
3e8ad6bd
JF
1/** @file\r
2 Common header file for MP Initialize Library.\r
3\r
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _MP_LIB_H_\r
16#define _MP_LIB_H_\r
17\r
18#include <PiPei.h>\r
19\r
20#include <Register/Cpuid.h>\r
21#include <Register/Msr.h>\r
22#include <Register/LocalApic.h>\r
23#include <Register/Microcode.h>\r
24\r
25#include <Library/MpInitLib.h>\r
26#include <Library/BaseLib.h>\r
27#include <Library/BaseMemoryLib.h>\r
28#include <Library/MemoryAllocationLib.h>\r
29#include <Library/DebugLib.h>\r
30#include <Library/LocalApicLib.h>\r
31#include <Library/CpuLib.h>\r
32#include <Library/UefiCpuLib.h>\r
33#include <Library/TimerLib.h>\r
34#include <Library/SynchronizationLib.h>\r
35#include <Library/MtrrLib.h>\r
36#include <Library/HobLib.h>\r
37\r
38\r
d94e5f67
JF
39#pragma pack(1)\r
40\r
41//\r
42// MP CPU exchange information for AP reset code\r
43// This structure is required to be packed because fixed field offsets\r
44// into this structure are used in assembly code in this module\r
45//\r
46typedef struct {\r
47 UINTN Lock;\r
48 UINTN StackStart;\r
49 UINTN StackSize;\r
50 UINTN CFunction;\r
51 IA32_DESCRIPTOR GdtrProfile;\r
52 IA32_DESCRIPTOR IdtrProfile;\r
53 UINTN BufferStart;\r
54 UINTN ModeOffset;\r
55 UINTN NumApsExecuting;\r
56 UINTN CodeSegment;\r
57 UINTN DataSegment;\r
5c66d125 58 UINTN EnableExecuteDisable;\r
d94e5f67 59 UINTN Cr3;\r
d94e5f67
JF
60} MP_CPU_EXCHANGE_INFO;\r
61\r
62#pragma pack()\r
76157021
JF
63/**\r
64 Assembly code to place AP into safe loop mode.\r
65\r
66 Place AP into targeted C-State if MONITOR is supported, otherwise\r
67 place AP into hlt state.\r
68 Place AP in protected mode if the current is long mode. Due to AP maybe\r
69 wakeup by some hardware event. It could avoid accessing page table that\r
70 may not available during booting to OS.\r
71\r
72 @param[in] MwaitSupport TRUE indicates MONITOR is supported.\r
73 FALSE indicates MONITOR is not supported.\r
74 @param[in] ApTargetCState Target C-State value.\r
75 @param[in] PmCodeSegment Protected mode code segment value.\r
76**/\r
77typedef\r
78VOID\r
79(EFIAPI * ASM_RELOCATE_AP_LOOP) (\r
80 IN BOOLEAN MwaitSupport,\r
81 IN UINTN ApTargetCState,\r
82 IN UINTN PmCodeSegment\r
83 );\r
3e8ad6bd
JF
84#endif\r
85\r