summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
diff options
context:
space:
mode:
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-29 09:41:51 +0400
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-29 09:41:51 +0400
commit93b21ade8864d28c3cde3a93feb1ddac5b8f8469 (patch)
treedc6611155dca3aabd801aee355f0313b06d3a8c0 /MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
parentbcb7667258cf5df2db41f00ba7314f52d9ae79e1 (diff)
downloadedk2-93b21ade8864d28c3cde3a93feb1ddac5b8f8469.tar.xz
Fix the issue that S3BootScriptLabel() does not work to insert label when the specified position is not at the end of table.
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13979 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c')
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
index 538cd1435c..01ca7df7ce 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
@@ -1201,14 +1201,16 @@ BootScriptExecuteInformation (
{
UINT32 Index;
EFI_BOOT_SCRIPT_INFORMATION Information;
+ UINT8 *InformationData;
- CopyMem ((VOID*)&Information, (VOID*)Script, sizeof(Information));
+ CopyMem ((VOID*)&Information, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_INFORMATION));
- DEBUG ((EFI_D_INFO, "BootScriptExecuteInformation - 0x%08x\n", (UINTN)Information.Information));
+ InformationData = Script + sizeof (EFI_BOOT_SCRIPT_INFORMATION);
+ DEBUG ((EFI_D_INFO, "BootScriptExecuteInformation - 0x%08x\n", (UINTN) InformationData));
DEBUG ((EFI_D_INFO, "BootScriptInformation: "));
for (Index = 0; Index < Information.InformationLength; Index++) {
- DEBUG ((EFI_D_INFO, "%02x ", *(UINT8 *)(UINTN)(Information.Information + Index)));
+ DEBUG ((EFI_D_INFO, "%02x ", InformationData[Index]));
}
DEBUG ((EFI_D_INFO, "\n"));
}
@@ -1227,14 +1229,16 @@ BootScriptExecuteLabel (
{
UINT32 Index;
EFI_BOOT_SCRIPT_INFORMATION Information;
+ UINT8 *InformationData;
- CopyMem ((VOID*)&Information, (VOID*)Script, sizeof(Information));
+ CopyMem ((VOID*)&Information, (VOID*)Script, sizeof(EFI_BOOT_SCRIPT_INFORMATION));
- DEBUG ((EFI_D_INFO, "BootScriptExecuteLabel - 0x%08x\n", (UINTN)Information.Information));
+ InformationData = Script + sizeof (EFI_BOOT_SCRIPT_INFORMATION);
+ DEBUG ((EFI_D_INFO, "BootScriptExecuteLabel - 0x%08x\n", (UINTN) InformationData));
DEBUG ((EFI_D_INFO, "BootScriptLabel: "));
for (Index = 0; Index < Information.InformationLength; Index++) {
- DEBUG ((EFI_D_INFO, "%02x ", *(UINT8 *)(UINTN)(Information.Information + Index)));
+ DEBUG ((EFI_D_INFO, "%02x ", InformationData[Index]));
}
DEBUG ((EFI_D_INFO, "\n"));
}