X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=UefiCpuPkg%2FCpuMpPei%2FCpuMpPei.h;h=afbcb6e5790a2cbe205669efb7cdbcc1cd2ade34;hb=9bedfb2f5b23c68c600770a9f853092d01eab6d4;hp=19e649eb82caa815a1b488808bce194e38518784;hpb=ea0f431cec51247658901a4f65ae76d6bbdd96e9;p=mirror_edk2.git diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.h b/UefiCpuPkg/CpuMpPei/CpuMpPei.h index 19e649eb82..afbcb6e579 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.h +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.h @@ -1,7 +1,7 @@ /** @file Definitions to install Multiple Processor PPI. - Copyright (c) 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
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 @@ -21,7 +21,9 @@ #include #include #include +#include +#include #include #include @@ -37,6 +39,8 @@ #include #include #include +#include +#include #include "Microcode.h" @@ -49,6 +53,14 @@ typedef enum { CpuStateDisabled } CPU_STATE; +#define WAKEUP_AP_SIGNAL SIGNATURE_32 ('S', 'T', 'A', 'P') + +typedef enum { + ApInHltLoop = 1, + ApInMwaitLoop = 2, + ApInRunLoop = 3 +} AP_LOOP_MODE; + // // AP reset code information // @@ -71,7 +83,7 @@ typedef struct { typedef struct _PEI_CPU_MP_DATA PEI_CPU_MP_DATA; -#pragma pack() +#pragma pack(1) typedef union { struct { @@ -94,6 +106,8 @@ typedef union { // // MP CPU exchange information for AP reset code +// This structure is required to be packed because fixed field offsets +// into this structure are used in assembly code in this module // typedef struct { UINTN Lock; @@ -113,16 +127,31 @@ typedef struct { #pragma pack() typedef struct { + UINTN Cr0; + UINTN Cr3; + UINTN Cr4; + UINTN Dr0; + UINTN Dr1; + UINTN Dr2; + UINTN Dr3; + UINTN Dr6; + UINTN Dr7; +} CPU_VOLATILE_REGISTERS; + +typedef struct { + volatile UINT32 *StartupApSignal; UINT32 ApicId; EFI_HEALTH_FLAGS Health; CPU_STATE State; BOOLEAN CpuHealthy; + CPU_VOLATILE_REGISTERS VolatileRegisters; } PEI_CPU_DATA; // // PEI CPU MP Data save in memory // struct _PEI_CPU_MP_DATA { + SPIN_LOCK MpLock; UINT32 CpuCount; UINT32 BspNumber; UINTN Buffer; @@ -136,9 +165,12 @@ struct _PEI_CPU_MP_DATA { volatile UINT32 FinishedCount; BOOLEAN EndOfPeiFlag; BOOLEAN InitFlag; + BOOLEAN X2ApicEnable; CPU_EXCHANGE_ROLE_INFO BSPInfo; CPU_EXCHANGE_ROLE_INFO APInfo; MTRR_SETTINGS MtrrTable; + UINT8 ApLoopMode; + UINT8 ApTargetCState; PEI_CPU_DATA *CpuData; volatile MP_CPU_EXCHANGE_INFO *MpCpuExchangeInfo; }; @@ -168,16 +200,6 @@ AsmInitializeGdt ( IN IA32_DESCRIPTOR *Gdtr ); -/** - Assembly code to do CLI-HALT loop. - -**/ -VOID -EFIAPI -AsmCliHltLoop ( - VOID - ); - /** Get available system memory below 1MB by specified size. @@ -225,7 +247,7 @@ CpuMpEndOfPeiCallback ( @param PeiCpuMpData Pointer to PEI CPU MP Data @param Broadcast TRUE: Send broadcast IPI to all APs FALSE: Send IPI to AP by ApicId - @param ApicId Apic ID for the processor to be waked + @param ProcessorNumber The handle number of specified processor @param Procedure The function to be invoked by AP @param ProcedureArgument The argument to be passed into AP function **/ @@ -233,7 +255,7 @@ VOID WakeUpAP ( IN PEI_CPU_MP_DATA *PeiCpuMpData, IN BOOLEAN Broadcast, - IN UINT32 ApicId, + IN UINTN ProcessorNumber, IN EFI_AP_PROCEDURE Procedure, OPTIONAL IN VOID *ProcedureArgument OPTIONAL );