X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=UefiCpuPkg%2FLibrary%2FMpInitLib%2FMpLib.h;h=49305ad6637bc6292a57b38c9fe059990f70a5a3;hb=9f91cb01c43e394f5368c6e9d16b58cbebf9ad9b;hp=e53deb449d977be7ef81a6ae1ad72eb56961dd77;hpb=4d3314f694881f4a4a53636515da144230f1d913;p=mirror_edk2.git diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpInitLib/MpLib.h index e53deb449d..49305ad663 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h @@ -112,9 +112,6 @@ typedef struct { volatile UINT32 *StartupApSignal; volatile UINTN ApFunction; volatile UINTN ApFunctionArgument; - UINT32 InitialApicId; - UINT32 ApicId; - UINT32 Health; BOOLEAN CpuHealthy; volatile CPU_STATE State; CPU_VOLATILE_REGISTERS VolatileRegisters; @@ -132,11 +129,14 @@ typedef struct { // we need to make sure the each fields offset same in different // architecture. // +#pragma pack (1) typedef struct { UINT32 InitialApicId; UINT32 ApicId; UINT32 Health; + UINT64 ApTopOfStack; } CPU_INFO_IN_HOB; +#pragma pack () // // AP reset code information including code address and size, @@ -174,6 +174,8 @@ typedef struct { UINTN DataSegment; UINTN EnableExecuteDisable; UINTN Cr3; + UINTN InitFlag; + CPU_INFO_IN_HOB *CpuInfo; CPU_MP_DATA *CpuMpData; } MP_CPU_EXCHANGE_INFO; @@ -198,7 +200,7 @@ struct _CPU_MP_DATA { UINTN WakeupBuffer; UINTN BackupBuffer; UINTN BackupBufferSize; - BOOLEAN EndOfPeiFlag; + BOOLEAN SaveRestoreFlag; volatile UINT32 StartCount; volatile UINT32 FinishedCount; @@ -216,6 +218,7 @@ struct _CPU_MP_DATA { AP_INIT_STATE InitFlag; BOOLEAN X2ApicEnable; BOOLEAN SwitchBspFlag; + UINTN NewBspNumber; CPU_EXCHANGE_ROLE_INFO BSPInfo; CPU_EXCHANGE_ROLE_INFO APInfo; MTRR_SETTINGS MtrrTable; @@ -247,7 +250,9 @@ VOID (EFIAPI * ASM_RELOCATE_AP_LOOP) ( IN BOOLEAN MwaitSupport, IN UINTN ApTargetCState, - IN UINTN PmCodeSegment + IN UINTN PmCodeSegment, + IN UINTN TopOfApStack, + IN UINTN NumberToFinish ); /** @@ -512,7 +517,7 @@ CheckAndUpdateApsStatus ( /** Detect whether specified processor can find matching microcode patch and load it. - @param[in] PeiCpuMpData Pointer to PEI CPU MP Data + @param[in] CpuMpData The pointer to CPU MP Data structure. **/ VOID MicrocodeDetect ( @@ -550,5 +555,25 @@ CpuMpEndOfPeiCallback ( IN VOID *Ppi ); +/** + Get available system memory below 1MB by specified size. + + @param[in] CpuMpData The pointer to CPU MP Data structure. +**/ +VOID +BackupAndPrepareWakeupBuffer( + IN CPU_MP_DATA *CpuMpData + ); + +/** + Restore wakeup buffer data. + + @param[in] CpuMpData The pointer to CPU MP Data structure. +**/ +VOID +RestoreWakeupBuffer( + IN CPU_MP_DATA *CpuMpData + ); + #endif