summaryrefslogtreecommitdiff
path: root/UefiCpuPkg/Library/MpInitLib/MpLib.c
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-08-24 22:41:40 +0800
committerJeff Fan <jeff.fan@intel.com>2016-08-25 16:12:50 +0800
commit42c37b3b3322a597b62e14852bcb3030c86ea3c4 (patch)
tree22c1a407994f9c7c8b452289ed3dc5f6be02f71a /UefiCpuPkg/Library/MpInitLib/MpLib.c
parentb31c1ad11e640eaa18cc32ceb095bc1ae5328ffa (diff)
downloadedk2-platforms-42c37b3b3322a597b62e14852bcb3030c86ea3c4.tar.xz
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>
Diffstat (limited to 'UefiCpuPkg/Library/MpInitLib/MpLib.c')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index f0e9e46c52..c3fe72138f 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -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
+ );
+}