UefiCpuPkg/MpInitLib: Move two functions location

Just move BackupAndPrepareWakeupBuffer() and RestoreWakeupBuffer() from
PeiMpLib.c to MpLib.c.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
Jeff Fan 2016-08-24 22:41:40 +08:00
parent b31c1ad11e
commit 42c37b3b33
3 changed files with 59 additions and 39 deletions

View File

@ -2012,3 +2012,42 @@ GetCpuMpDataFromGuidedHob (
}
return CpuMpData;
}
/**
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
)
{
CopyMem (
(VOID *) CpuMpData->BackupBuffer,
(VOID *) CpuMpData->WakeupBuffer,
CpuMpData->BackupBufferSize
);
CopyMem (
(VOID *) CpuMpData->WakeupBuffer,
(VOID *) CpuMpData->AddressMap.RendezvousFunnelAddress,
CpuMpData->AddressMap.RendezvousFunnelSize
);
}
/**
Restore wakeup buffer data.
@param[in] CpuMpData The pointer to CPU MP Data structure.
**/
VOID
RestoreWakeupBuffer(
IN CPU_MP_DATA *CpuMpData
)
{
CopyMem (
(VOID *) CpuMpData->WakeupBuffer,
(VOID *) CpuMpData->BackupBuffer,
CpuMpData->BackupBufferSize
);
}

View File

@ -550,5 +550,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

View File

@ -64,45 +64,6 @@ SaveCpuMpData (
);
}
/**
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
)
{
CopyMem (
(VOID *) CpuMpData->BackupBuffer,
(VOID *) CpuMpData->WakeupBuffer,
CpuMpData->BackupBufferSize
);
CopyMem (
(VOID *) CpuMpData->WakeupBuffer,
(VOID *) CpuMpData->AddressMap.RendezvousFunnelAddress,
CpuMpData->AddressMap.RendezvousFunnelSize
);
}
/**
Restore wakeup buffer data.
@param[in] CpuMpData The pointer to CPU MP Data structure.
**/
VOID
RestoreWakeupBuffer(
IN CPU_MP_DATA *CpuMpData
)
{
CopyMem (
(VOID *) CpuMpData->WakeupBuffer,
(VOID *) CpuMpData->BackupBuffer,
CpuMpData->BackupBufferSize
);
}
/**
Notify function on End Of PEI PPI.