Only disable Debug Timer for x64 platforms in S3RestoreConfig2().

Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>





git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13684 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2012-08-28 02:37:45 +00:00
parent 2cd086a675
commit f5c941b177
1 changed files with 14 additions and 5 deletions

View File

@ -441,6 +441,12 @@ S3ResumeBootOs (
// //
AsmWriteIdtr (&PeiS3ResumeState->Idtr); AsmWriteIdtr (&PeiS3ResumeState->Idtr);
//
// NOTE: Because Debug Timer interrupt and system interrupts will be disabled
// in BootScriptExecuteDxe, the rest code in S3ResumeBootOs() cannot be halted
// by soft debugger.
//
PERF_END (NULL, "ScriptExec", NULL, 0); PERF_END (NULL, "ScriptExec", NULL, 0);
// //
@ -1009,11 +1015,6 @@ S3RestoreConfig2 (
DEBUG (( EFI_D_ERROR, "SMM S3 Return Stack Pointer = %x\n", SmmS3ResumeState->ReturnStackPointer)); DEBUG (( EFI_D_ERROR, "SMM S3 Return Stack Pointer = %x\n", SmmS3ResumeState->ReturnStackPointer));
DEBUG (( EFI_D_ERROR, "SMM S3 Smst = %x\n", SmmS3ResumeState->Smst)); DEBUG (( EFI_D_ERROR, "SMM S3 Smst = %x\n", SmmS3ResumeState->Smst));
//
// Disable interrupt of Debug timer.
//
SaveAndSetDebugTimerInterrupt (FALSE);
if (SmmS3ResumeState->Signature == SMM_S3_RESUME_SMM_32) { if (SmmS3ResumeState->Signature == SMM_S3_RESUME_SMM_32) {
SwitchStack ( SwitchStack (
(SWITCH_STACK_ENTRY_POINT)(UINTN)SmmS3ResumeState->SmmS3ResumeEntryPoint, (SWITCH_STACK_ENTRY_POINT)(UINTN)SmmS3ResumeState->SmmS3ResumeEntryPoint,
@ -1042,6 +1043,14 @@ S3RestoreConfig2 (
SetInterruptState (InterruptStatus); SetInterruptState (InterruptStatus);
AsmWriteCr3 ((UINTN)SmmS3ResumeState->SmmS3Cr3); AsmWriteCr3 ((UINTN)SmmS3ResumeState->SmmS3Cr3);
//
// Disable interrupt of Debug timer, since IDT table cannot work in long mode.
// NOTE: On x64 platforms, because DisablePaging64() will disable interrupts,
// the code in S3ResumeExecuteBootScript() cannot be halted by soft debugger.
//
SaveAndSetDebugTimerInterrupt (FALSE);
AsmEnablePaging64 ( AsmEnablePaging64 (
0x38, 0x38,
SmmS3ResumeState->SmmS3ResumeEntryPoint, SmmS3ResumeState->SmmS3ResumeEntryPoint,