]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/CpuMpPei/CpuMpPei.h
UefiCpuPkg/CpuMpPei: Get AP reset code size and far jump information
[mirror_edk2.git] / UefiCpuPkg / CpuMpPei / CpuMpPei.h
CommitLineData
65e79f93
JF
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>
05e107f8 22#include <Library/HobLib.h>
65e79f93 23#include <Library/PeimEntryPoint.h>
46ba0f63 24#include <Library/UefiCpuLib.h>
65e79f93 25
8018cb15
JF
26//
27// AP reset code information
28//
29typedef struct {
30 UINT8 *RendezvousFunnelAddress;
31 UINTN PModeEntryOffset;
32 UINTN LModeEntryOffset;
33 UINTN RendezvousFunnelSize;
34} MP_ASSEMBLY_ADDRESS_MAP;
35
f9d30595 36#pragma pack(1)
a56f6f45 37
f9d30595
JF
38typedef 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;
a56f6f45
JF
56
57//
58// MP CPU exchange information for AP reset code
59//
60typedef 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
f9d30595 74#pragma pack()
8018cb15
JF
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**/
82VOID
83EFIAPI
84AsmGetAddressMap (
85 OUT MP_ASSEMBLY_ADDRESS_MAP *AddressMap
86 );
87
f9d30595
JF
88/**
89 Assembly code to load GDT table and update segment accordingly.
90
91 @param Gdtr Pointer to GDT descriptor
92**/
93VOID
94EFIAPI
95AsmInitializeGdt (
96 IN IA32_DESCRIPTOR *Gdtr
97 );
65e79f93
JF
98
99
100#endif