From 93b21ade8864d28c3cde3a93feb1ddac5b8f8469 Mon Sep 17 00:00:00 2001 From: lzeng14 Date: Thu, 29 Nov 2012 05:41:51 +0000 Subject: 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 Reviewed-by: Jiewen Yao git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13979 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/PiDxeS3BootScriptLib/BootScriptExecute.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c') 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")); } -- cgit v1.2.3