summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/PiDxeS3BootScriptLib
diff options
context:
space:
mode:
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-27 11:26:28 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-27 11:26:28 +0000
commit8e4585bb6cdd32d7586de48662cd0aba69cbea58 (patch)
tree1f1cb987f4ac989884ece2e469db9c55d3e39fae /MdeModulePkg/Library/PiDxeS3BootScriptLib
parentd03b313050ddeb4146e514e30178b50cfe91dd9c (diff)
downloadedk2-8e4585bb6cdd32d7586de48662cd0aba69cbea58.tar.gz
edk2-8e4585bb6cdd32d7586de48662cd0aba69cbea58.tar.bz2
edk2-8e4585bb6cdd32d7586de48662cd0aba69cbea58.zip
1. Add S3BootScriptDone Debug message when meeting S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE.
2. Add Label Opcode Debug message. 3. Align Debug message with code. 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@13966 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib')
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c49
1 files changed, 39 insertions, 10 deletions
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
index 766396d1d1..538cd1435c 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c
@@ -1,7 +1,7 @@
/** @file
Interpret and execute the S3 data in S3 boot script.
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -415,7 +415,7 @@ ScriptIoWrite (
IoWrite8 ((UINTN) OriginalAddress, *In.Uint8);
break;
case S3BootScriptWidthFillUint8:
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));
IoWrite8 ((UINTN) Address, *OriginalIn.Uint8);
break;
case S3BootScriptWidthUint16:
@@ -427,7 +427,7 @@ ScriptIoWrite (
IoWrite16 ((UINTN) OriginalAddress, *In.Uint16);
break;
case S3BootScriptWidthFillUint16:
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));
IoWrite16 ((UINTN) Address, *OriginalIn.Uint16);
break;
case S3BootScriptWidthUint32:
@@ -439,7 +439,7 @@ ScriptIoWrite (
IoWrite32 ((UINTN) OriginalAddress, *In.Uint32);
break;
case S3BootScriptWidthFillUint32:
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint32));
IoWrite32 ((UINTN) Address, *OriginalIn.Uint32);
break;
case S3BootScriptWidthUint64:
@@ -447,11 +447,11 @@ ScriptIoWrite (
IoWrite64 ((UINTN) Address, *In.Uint64);
break;
case S3BootScriptWidthFifoUint64:
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64));
IoWrite64 ((UINTN) OriginalAddress, *In.Uint64);
break;
case S3BootScriptWidthFillUint64:
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));
IoWrite64 ((UINTN) Address, *OriginalIn.Uint64);
break;
default:
@@ -621,7 +621,7 @@ ScriptMemoryWrite (
MmioWrite8 ((UINTN) OriginalAddress, *In.Uint8);
break;
case S3BootScriptWidthFillUint8:
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));
MmioWrite8 ((UINTN) Address, *OriginalIn.Uint8);
break;
case S3BootScriptWidthUint16:
@@ -633,7 +633,7 @@ ScriptMemoryWrite (
MmioWrite16 ((UINTN) OriginalAddress, *In.Uint16);
break;
case S3BootScriptWidthFillUint16:
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));
MmioWrite16 ((UINTN) Address, *OriginalIn.Uint16);
break;
case S3BootScriptWidthUint32:
@@ -645,7 +645,7 @@ ScriptMemoryWrite (
MmioWrite32 ((UINTN) OriginalAddress, *In.Uint32);
break;
case S3BootScriptWidthFillUint32:
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint32));
MmioWrite32 ((UINTN) Address, *OriginalIn.Uint32);
break;
case S3BootScriptWidthUint64:
@@ -657,7 +657,7 @@ ScriptMemoryWrite (
MmioWrite64 ((UINTN) OriginalAddress, *In.Uint64);
break;
case S3BootScriptWidthFillUint64:
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));
MmioWrite64 ((UINTN) Address, *OriginalIn.Uint64);
break;
default:
@@ -1212,6 +1212,33 @@ BootScriptExecuteInformation (
}
DEBUG ((EFI_D_INFO, "\n"));
}
+
+/**
+ Execute the boot script to interpret the Label information.
+
+ @param Script The pointer of node in boot script table
+
+**/
+VOID
+BootScriptExecuteLabel (
+ IN UINT8 *Script
+ )
+
+{
+ UINT32 Index;
+ EFI_BOOT_SCRIPT_INFORMATION Information;
+
+ CopyMem ((VOID*)&Information, (VOID*)Script, sizeof(Information));
+
+ DEBUG ((EFI_D_INFO, "BootScriptExecuteLabel - 0x%08x\n", (UINTN)Information.Information));
+
+ 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, "\n"));
+}
+
/**
calculate the mask value for 'and' and 'or' operation
@param ScriptHeader The pointer of header of node in boot script table
@@ -1690,6 +1717,7 @@ S3BootScriptExecute (
case S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE:
DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE\n"));
+ DEBUG ((EFI_D_INFO, "S3BootScriptDone - %r\n", EFI_SUCCESS));
return EFI_SUCCESS;
case EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE:
@@ -1742,6 +1770,7 @@ S3BootScriptExecute (
// For label
//
DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_LABEL_OPCODE\n"));
+ BootScriptExecuteLabel (Script);
break;
default:
DEBUG ((EFI_D_INFO, "S3BootScriptDone - %r\n", EFI_UNSUPPORTED));