]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/CpuMpPei/CpuMpPei.h
UefiCpuPkg/CpuMpPei: Get AP reset code size and far jump information
[mirror_edk2.git] / UefiCpuPkg / CpuMpPei / CpuMpPei.h
1 /** @file
2 Definitions to install Multiple Processor PPI.
3
4 Copyright (c) 2015, 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 _CPU_MP_PEI_H_
16 #define _CPU_MP_PEI_H_
17
18 #include <PiPei.h>
19
20
21 #include <Library/BaseLib.h>
22 #include <Library/HobLib.h>
23 #include <Library/PeimEntryPoint.h>
24 #include <Library/UefiCpuLib.h>
25
26 //
27 // AP reset code information
28 //
29 typedef struct {
30 UINT8 *RendezvousFunnelAddress;
31 UINTN PModeEntryOffset;
32 UINTN LModeEntryOffset;
33 UINTN RendezvousFunnelSize;
34 } MP_ASSEMBLY_ADDRESS_MAP;
35
36 #pragma pack(1)
37
38 typedef union {
39 struct {
40 UINT32 LimitLow : 16;
41 UINT32 BaseLow : 16;
42 UINT32 BaseMid : 8;
43 UINT32 Type : 4;
44 UINT32 System : 1;
45 UINT32 Dpl : 2;
46 UINT32 Present : 1;
47 UINT32 LimitHigh : 4;
48 UINT32 Software : 1;
49 UINT32 Reserved : 1;
50 UINT32 DefaultSize : 1;
51 UINT32 Granularity : 1;
52 UINT32 BaseHigh : 8;
53 } Bits;
54 UINT64 Uint64;
55 } IA32_GDT;
56
57 //
58 // MP CPU exchange information for AP reset code
59 //
60 typedef struct {
61 UINTN Lock;
62 UINTN StackStart;
63 UINTN StackSize;
64 UINTN CFunction;
65 IA32_DESCRIPTOR GdtrProfile;
66 IA32_DESCRIPTOR IdtrProfile;
67 UINTN BufferStart;
68 UINTN PmodeOffset;
69 UINTN NumApsExecuting;
70 UINTN LmodeOffset;
71 UINTN Cr3;
72 } MP_CPU_EXCHANGE_INFO;
73
74 #pragma pack()
75
76 /**
77 Assembly code to get starting address and size of the rendezvous entry for APs.
78 Information for fixing a jump instruction in the code is also returned.
79
80 @param AddressMap Output buffer for address map information.
81 **/
82 VOID
83 EFIAPI
84 AsmGetAddressMap (
85 OUT MP_ASSEMBLY_ADDRESS_MAP *AddressMap
86 );
87
88 /**
89 Assembly code to load GDT table and update segment accordingly.
90
91 @param Gdtr Pointer to GDT descriptor
92 **/
93 VOID
94 EFIAPI
95 AsmInitializeGdt (
96 IN IA32_DESCRIPTOR *Gdtr
97 );
98
99
100 #endif