/** @file\r
Interpret and execute the S3 data in S3 boot script. \r
\r
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
IoWrite8 ((UINTN) OriginalAddress, *In.Uint8);\r
break; \r
case S3BootScriptWidthFillUint8:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));\r
IoWrite8 ((UINTN) Address, *OriginalIn.Uint8);\r
break;\r
case S3BootScriptWidthUint16:\r
IoWrite16 ((UINTN) OriginalAddress, *In.Uint16);\r
break; \r
case S3BootScriptWidthFillUint16:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));\r
IoWrite16 ((UINTN) Address, *OriginalIn.Uint16);\r
break;\r
case S3BootScriptWidthUint32:\r
IoWrite32 ((UINTN) OriginalAddress, *In.Uint32);\r
break;\r
case S3BootScriptWidthFillUint32:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint32));\r
IoWrite32 ((UINTN) Address, *OriginalIn.Uint32);\r
break;\r
case S3BootScriptWidthUint64:\r
IoWrite64 ((UINTN) Address, *In.Uint64);\r
break; \r
case S3BootScriptWidthFifoUint64:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFifoUint64 - 0x%08x (0x%016lx)\n", (UINTN)OriginalAddress, *In.Uint64));\r
IoWrite64 ((UINTN) OriginalAddress, *In.Uint64);\r
break; \r
case S3BootScriptWidthFillUint64:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));\r
IoWrite64 ((UINTN) Address, *OriginalIn.Uint64);\r
break;\r
default:\r
MmioWrite8 ((UINTN) OriginalAddress, *In.Uint8);\r
break; \r
case S3BootScriptWidthFillUint8:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*In.Uint8));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint8 - 0x%08x (0x%02x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint8));\r
MmioWrite8 ((UINTN) Address, *OriginalIn.Uint8);\r
break;\r
case S3BootScriptWidthUint16:\r
MmioWrite16 ((UINTN) OriginalAddress, *In.Uint16);\r
break; \r
case S3BootScriptWidthFillUint16:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*In.Uint16));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint16 - 0x%08x (0x%04x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint16));\r
MmioWrite16 ((UINTN) Address, *OriginalIn.Uint16);\r
break;\r
case S3BootScriptWidthUint32:\r
MmioWrite32 ((UINTN) OriginalAddress, *In.Uint32);\r
break; \r
case S3BootScriptWidthFillUint32:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*In.Uint32));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint32 - 0x%08x (0x%08x)\n", (UINTN)Address, (UINTN)*OriginalIn.Uint32));\r
MmioWrite32 ((UINTN) Address, *OriginalIn.Uint32);\r
break;\r
case S3BootScriptWidthUint64:\r
MmioWrite64 ((UINTN) OriginalAddress, *In.Uint64);\r
break; \r
case S3BootScriptWidthFillUint64:\r
- DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *In.Uint64));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptWidthFillUint64 - 0x%08x (0x%016lx)\n", (UINTN)Address, *OriginalIn.Uint64));\r
MmioWrite64 ((UINTN) Address, *OriginalIn.Uint64);\r
break;\r
default:\r
}\r
DEBUG ((EFI_D_INFO, "\n"));\r
}\r
+\r
+/**\r
+ Execute the boot script to interpret the Label information. \r
+\r
+ @param Script The pointer of node in boot script table \r
+ \r
+**/\r
+VOID\r
+BootScriptExecuteLabel (\r
+ IN UINT8 *Script\r
+ )\r
+\r
+{\r
+ UINT32 Index;\r
+ EFI_BOOT_SCRIPT_INFORMATION Information;\r
+\r
+ CopyMem ((VOID*)&Information, (VOID*)Script, sizeof(Information));\r
+\r
+ DEBUG ((EFI_D_INFO, "BootScriptExecuteLabel - 0x%08x\n", (UINTN)Information.Information));\r
+\r
+ DEBUG ((EFI_D_INFO, "BootScriptLabel: "));\r
+ for (Index = 0; Index < Information.InformationLength; Index++) {\r
+ DEBUG ((EFI_D_INFO, "%02x ", *(UINT8 *)(UINTN)(Information.Information + Index)));\r
+ }\r
+ DEBUG ((EFI_D_INFO, "\n"));\r
+}\r
+\r
/**\r
calculate the mask value for 'and' and 'or' operation\r
@param ScriptHeader The pointer of header of node in boot script table \r
\r
case S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE:\r
DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE\n"));\r
+ DEBUG ((EFI_D_INFO, "S3BootScriptDone - %r\n", EFI_SUCCESS));\r
return EFI_SUCCESS;\r
\r
case EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE:\r
// For label\r
//\r
DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_LABEL_OPCODE\n"));\r
+ BootScriptExecuteLabel (Script);\r
break;\r
default:\r
DEBUG ((EFI_D_INFO, "S3BootScriptDone - %r\n", EFI_UNSUPPORTED));\r