2015-07-15 05:28:04 +02:00
|
|
|
/** @file
|
|
|
|
Definitions to install Multiple Processor PPI.
|
|
|
|
|
|
|
|
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _CPU_MP_PEI_H_
|
|
|
|
#define _CPU_MP_PEI_H_
|
|
|
|
|
|
|
|
#include <PiPei.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <Library/BaseLib.h>
|
2015-07-15 05:29:40 +02:00
|
|
|
#include <Library/HobLib.h>
|
2015-07-15 05:28:04 +02:00
|
|
|
#include <Library/PeimEntryPoint.h>
|
2015-07-15 05:36:51 +02:00
|
|
|
#include <Library/UefiCpuLib.h>
|
2015-07-15 05:28:04 +02:00
|
|
|
|
2015-07-15 05:37:25 +02:00
|
|
|
//
|
|
|
|
// AP reset code information
|
|
|
|
//
|
|
|
|
typedef struct {
|
|
|
|
UINT8 *RendezvousFunnelAddress;
|
|
|
|
UINTN PModeEntryOffset;
|
|
|
|
UINTN LModeEntryOffset;
|
|
|
|
UINTN RendezvousFunnelSize;
|
|
|
|
} MP_ASSEMBLY_ADDRESS_MAP;
|
|
|
|
|
2015-07-15 05:29:12 +02:00
|
|
|
#pragma pack(1)
|
2015-07-15 05:30:01 +02:00
|
|
|
|
2015-07-15 05:29:12 +02:00
|
|
|
typedef union {
|
|
|
|
struct {
|
|
|
|
UINT32 LimitLow : 16;
|
|
|
|
UINT32 BaseLow : 16;
|
|
|
|
UINT32 BaseMid : 8;
|
|
|
|
UINT32 Type : 4;
|
|
|
|
UINT32 System : 1;
|
|
|
|
UINT32 Dpl : 2;
|
|
|
|
UINT32 Present : 1;
|
|
|
|
UINT32 LimitHigh : 4;
|
|
|
|
UINT32 Software : 1;
|
|
|
|
UINT32 Reserved : 1;
|
|
|
|
UINT32 DefaultSize : 1;
|
|
|
|
UINT32 Granularity : 1;
|
|
|
|
UINT32 BaseHigh : 8;
|
|
|
|
} Bits;
|
|
|
|
UINT64 Uint64;
|
|
|
|
} IA32_GDT;
|
2015-07-15 05:30:01 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// MP CPU exchange information for AP reset code
|
|
|
|
//
|
|
|
|
typedef struct {
|
|
|
|
UINTN Lock;
|
|
|
|
UINTN StackStart;
|
|
|
|
UINTN StackSize;
|
|
|
|
UINTN CFunction;
|
|
|
|
IA32_DESCRIPTOR GdtrProfile;
|
|
|
|
IA32_DESCRIPTOR IdtrProfile;
|
|
|
|
UINTN BufferStart;
|
|
|
|
UINTN PmodeOffset;
|
|
|
|
UINTN NumApsExecuting;
|
|
|
|
UINTN LmodeOffset;
|
|
|
|
UINTN Cr3;
|
|
|
|
} MP_CPU_EXCHANGE_INFO;
|
|
|
|
|
2015-07-15 05:29:12 +02:00
|
|
|
#pragma pack()
|
2015-07-15 05:37:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Assembly code to get starting address and size of the rendezvous entry for APs.
|
|
|
|
Information for fixing a jump instruction in the code is also returned.
|
|
|
|
|
|
|
|
@param AddressMap Output buffer for address map information.
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
AsmGetAddressMap (
|
|
|
|
OUT MP_ASSEMBLY_ADDRESS_MAP *AddressMap
|
|
|
|
);
|
|
|
|
|
2015-07-15 05:29:12 +02:00
|
|
|
/**
|
|
|
|
Assembly code to load GDT table and update segment accordingly.
|
|
|
|
|
|
|
|
@param Gdtr Pointer to GDT descriptor
|
|
|
|
**/
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
AsmInitializeGdt (
|
|
|
|
IN IA32_DESCRIPTOR *Gdtr
|
|
|
|
);
|
2015-07-15 05:28:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|