]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Add S3BootScriptDone Debug message when meeting S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE.
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Nov 2012 11:26:28 +0000 (11:26 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Nov 2012 11:26:28 +0000 (11:26 +0000)
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

MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptExecute.c

index 766396d1d1521015d441a80a9d8ec194aa4a7535..538cd1435c427f283625c5f2853da533a10d5119 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
@@ -415,7 +415,7 @@ ScriptIoWrite (
         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
@@ -427,7 +427,7 @@ ScriptIoWrite (
         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
@@ -439,7 +439,7 @@ ScriptIoWrite (
         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
@@ -447,11 +447,11 @@ ScriptIoWrite (
         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
@@ -621,7 +621,7 @@ ScriptMemoryWrite (
         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
@@ -633,7 +633,7 @@ ScriptMemoryWrite (
         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
@@ -645,7 +645,7 @@ ScriptMemoryWrite (
         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
@@ -657,7 +657,7 @@ ScriptMemoryWrite (
         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
@@ -1212,6 +1212,33 @@ BootScriptExecuteInformation (
   }\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
@@ -1690,6 +1717,7 @@ S3BootScriptExecute (
 \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
@@ -1742,6 +1770,7 @@ S3BootScriptExecute (
       // 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