UefiCpuPkg MpInitLib: Save/restore original WakeupBuffer for DxeMpLib
Current code always allocates/frees < 1MB WakeupBuffer for DxeMpLib
until ExitBootService, but the allocation may be failed at late
phase of the boot.
This patch is to always save/restore original WakeupBuffer for
DxeMpLib, it is aligned with the solution for PeiMpLib at
9293d6e42e
, then AllocateResetVector()
and FreeResetVector() will be common and moved to MpLib.c.
Only difference is GetWakeupBuffer() that will be in PeiMpLib or
DxeMpLib respectively.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
@ -201,7 +201,6 @@ struct _CPU_MP_DATA {
|
||||
UINTN WakeupBuffer;
|
||||
UINTN BackupBuffer;
|
||||
UINTN BackupBufferSize;
|
||||
BOOLEAN SaveRestoreFlag;
|
||||
|
||||
volatile UINT32 StartCount;
|
||||
volatile UINT32 FinishedCount;
|
||||
@ -310,24 +309,18 @@ SaveCpuMpData (
|
||||
IN CPU_MP_DATA *CpuMpData
|
||||
);
|
||||
|
||||
/**
|
||||
Allocate reset vector buffer.
|
||||
|
||||
@param[in, out] CpuMpData The pointer to CPU MP Data structure.
|
||||
**/
|
||||
VOID
|
||||
AllocateResetVector (
|
||||
IN OUT CPU_MP_DATA *CpuMpData
|
||||
);
|
||||
|
||||
/**
|
||||
Free AP reset vector buffer.
|
||||
Get available system memory below 1MB by specified size.
|
||||
|
||||
@param[in] CpuMpData The pointer to CPU MP Data structure.
|
||||
@param[in] WakeupBufferSize Wakeup buffer size required
|
||||
|
||||
@retval other Return wakeup buffer address below 1MB.
|
||||
@retval -1 Cannot find free memory below 1MB.
|
||||
**/
|
||||
VOID
|
||||
FreeResetVector (
|
||||
IN CPU_MP_DATA *CpuMpData
|
||||
UINTN
|
||||
GetWakeupBuffer (
|
||||
IN UINTN WakeupBufferSize
|
||||
);
|
||||
|
||||
/**
|
||||
@ -542,26 +535,6 @@ IsMwaitSupport (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
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
|
||||
);
|
||||
|
||||
/**
|
||||
Enable Debug Agent to support source debugging on AP function.
|
||||
|
||||
|
Reference in New Issue
Block a user