]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/Library/MpInitLib/MpLib.h
39ec5def5ba741334d0c75ec13c5b9c82269470c
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / MpLib.h
1 /** @file
2 Common header file for MP Initialize Library.
3
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
9
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.
12
13 **/
14
15 #ifndef _MP_LIB_H_
16 #define _MP_LIB_H_
17
18 #include <PiPei.h>
19
20 #include <Register/Cpuid.h>
21 #include <Register/Msr.h>
22 #include <Register/LocalApic.h>
23 #include <Register/Microcode.h>
24
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>
37
38
39 #pragma pack(1)
40
41 //
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
45 //
46 typedef struct {
47 UINTN Lock;
48 UINTN StackStart;
49 UINTN StackSize;
50 UINTN CFunction;
51 IA32_DESCRIPTOR GdtrProfile;
52 IA32_DESCRIPTOR IdtrProfile;
53 UINTN BufferStart;
54 UINTN ModeOffset;
55 UINTN NumApsExecuting;
56 UINTN CodeSegment;
57 UINTN DataSegment;
58 UINTN EnableExecuteDisable;
59 UINTN Cr3;
60 } MP_CPU_EXCHANGE_INFO;
61
62 #pragma pack()
63 /**
64 Assembly code to place AP into safe loop mode.
65
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.
71
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.
76 **/
77 typedef
78 VOID
79 (EFIAPI * ASM_RELOCATE_AP_LOOP) (
80 IN BOOLEAN MwaitSupport,
81 IN UINTN ApTargetCState,
82 IN UINTN PmCodeSegment
83 );
84 #endif
85