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
This commit is contained in:
lzeng14 2012-11-27 11:26:28 +00:00
parent d03b313050
commit 8e4585bb6c
1 changed files with 39 additions and 10 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Interpret and execute the S3 data in S3 boot script. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions are licensed and made available under the terms and conditions
@ -415,7 +415,7 @@ ScriptIoWrite (
IoWrite8 ((UINTN) OriginalAddress, *In.Uint8); IoWrite8 ((UINTN) OriginalAddress, *In.Uint8);
break; break;
case S3BootScriptWidthFillUint8: 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); IoWrite8 ((UINTN) Address, *OriginalIn.Uint8);
break; break;
case S3BootScriptWidthUint16: case S3BootScriptWidthUint16:
@ -427,7 +427,7 @@ ScriptIoWrite (
IoWrite16 ((UINTN) OriginalAddress, *In.Uint16); IoWrite16 ((UINTN) OriginalAddress, *In.Uint16);
break; break;
case S3BootScriptWidthFillUint16: 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); IoWrite16 ((UINTN) Address, *OriginalIn.Uint16);
break; break;
case S3BootScriptWidthUint32: case S3BootScriptWidthUint32:
@ -439,7 +439,7 @@ ScriptIoWrite (
IoWrite32 ((UINTN) OriginalAddress, *In.Uint32); IoWrite32 ((UINTN) OriginalAddress, *In.Uint32);
break; break;
case S3BootScriptWidthFillUint32: 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); IoWrite32 ((UINTN) Address, *OriginalIn.Uint32);
break; break;
case S3BootScriptWidthUint64: case S3BootScriptWidthUint64:
@ -447,11 +447,11 @@ ScriptIoWrite (
IoWrite64 ((UINTN) Address, *In.Uint64); IoWrite64 ((UINTN) Address, *In.Uint64);
break; break;
case S3BootScriptWidthFifoUint64: 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); IoWrite64 ((UINTN) OriginalAddress, *In.Uint64);
break; break;
case S3BootScriptWidthFillUint64: 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); IoWrite64 ((UINTN) Address, *OriginalIn.Uint64);
break; break;
default: default:
@ -621,7 +621,7 @@ ScriptMemoryWrite (
MmioWrite8 ((UINTN) OriginalAddress, *In.Uint8); MmioWrite8 ((UINTN) OriginalAddress, *In.Uint8);
break; break;
case S3BootScriptWidthFillUint8: 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); MmioWrite8 ((UINTN) Address, *OriginalIn.Uint8);
break; break;
case S3BootScriptWidthUint16: case S3BootScriptWidthUint16:
@ -633,7 +633,7 @@ ScriptMemoryWrite (
MmioWrite16 ((UINTN) OriginalAddress, *In.Uint16); MmioWrite16 ((UINTN) OriginalAddress, *In.Uint16);
break; break;
case S3BootScriptWidthFillUint16: 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); MmioWrite16 ((UINTN) Address, *OriginalIn.Uint16);
break; break;
case S3BootScriptWidthUint32: case S3BootScriptWidthUint32:
@ -645,7 +645,7 @@ ScriptMemoryWrite (
MmioWrite32 ((UINTN) OriginalAddress, *In.Uint32); MmioWrite32 ((UINTN) OriginalAddress, *In.Uint32);
break; break;
case S3BootScriptWidthFillUint32: 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); MmioWrite32 ((UINTN) Address, *OriginalIn.Uint32);
break; break;
case S3BootScriptWidthUint64: case S3BootScriptWidthUint64:
@ -657,7 +657,7 @@ ScriptMemoryWrite (
MmioWrite64 ((UINTN) OriginalAddress, *In.Uint64); MmioWrite64 ((UINTN) OriginalAddress, *In.Uint64);
break; break;
case S3BootScriptWidthFillUint64: 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); MmioWrite64 ((UINTN) Address, *OriginalIn.Uint64);
break; break;
default: default:
@ -1212,6 +1212,33 @@ BootScriptExecuteInformation (
} }
DEBUG ((EFI_D_INFO, "\n")); 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 calculate the mask value for 'and' and 'or' operation
@param ScriptHeader The pointer of header of node in boot script table @param ScriptHeader The pointer of header of node in boot script table
@ -1690,6 +1717,7 @@ S3BootScriptExecute (
case S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE: case S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE:
DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE\n")); DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE\n"));
DEBUG ((EFI_D_INFO, "S3BootScriptDone - %r\n", EFI_SUCCESS));
return EFI_SUCCESS; return EFI_SUCCESS;
case EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE: case EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE:
@ -1742,6 +1770,7 @@ S3BootScriptExecute (
// For label // For label
// //
DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_LABEL_OPCODE\n")); DEBUG ((EFI_D_INFO, "S3_BOOT_SCRIPT_LIB_LABEL_OPCODE\n"));
BootScriptExecuteLabel (Script);
break; break;
default: default:
DEBUG ((EFI_D_INFO, "S3BootScriptDone - %r\n", EFI_UNSUPPORTED)); DEBUG ((EFI_D_INFO, "S3BootScriptDone - %r\n", EFI_UNSUPPORTED));