]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: Sec: Fix SOURCE_DEBUG_ENABLE ASSERT()
authorMichael Kinney <michael.d.kinney@intel.com>
Fri, 16 Oct 2015 16:48:24 +0000 (16:48 +0000)
committerlersek <lersek@Edk2>
Fri, 16 Oct 2015 16:48:24 +0000 (16:48 +0000)
The update to the LocalApicLib instances to make sure the Local APIC is
initialized before use (SVN r18595 / git commit 6d72ff7d9daf) generates an
ASSERT() when SOURCE_DEBUG_ENABLE is enabled for OVMF.

The fix is to initialize the Local APIC Timer and mask it before
initializing the DebugAgent.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: rewrap code comment, rewrap commit msg, add precise
 commit ref]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18622 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/Sec/SecMain.c
OvmfPkg/Sec/SecMain.inf

index b7df549f31007afbe3a0cb72e04b5dfaf639632e..4f87059e1755f463b805be924cca732c5180bd8b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Main SEC phase code.  Transitions to PEI.\r
 \r
-  Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2008 - 2015, 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 of the BSD License\r
@@ -28,6 +28,7 @@
 #include <Library/PeCoffGetEntryPointLib.h>\r
 #include <Library/PeCoffExtraActionLib.h>\r
 #include <Library/ExtractGuidedSectionLib.h>\r
+#include <Library/LocalApicLib.h>\r
 \r
 #include <Ppi/TemporaryRamSupport.h>\r
 \r
@@ -767,6 +768,14 @@ SecCoreStartupWithStack (
   //\r
   IoWrite8 (0x21, 0xff);\r
   IoWrite8 (0xA1, 0xff);\r
+\r
+  //\r
+  // Initialize Local APIC Timer hardware and disable Local APIC Timer\r
+  // interrupts before initializing the Debug Agent and the debug timer is\r
+  // enabled.\r
+  //\r
+  InitializeApicTimer (0, MAX_UINT32, TRUE, 5);\r
+  DisableApicTimerInterrupt ();\r
   \r
   //\r
   // Initialize Debug Agent to support source level debug in SEC/PEI phases before memory ready.\r
index fce99fb74c6c9c982c9c15d6e8da77903016145a..2f78f3c851ad9c928d4e1e93c0314272f539ec0d 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  SEC Driver\r
 #\r
-#  Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2008 - 2015, 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 of the BSD License\r
@@ -55,6 +55,7 @@
   PeCoffGetEntryPointLib\r
   PeCoffExtraActionLib\r
   ExtractGuidedSectionLib\r
+  LocalApicLib\r
 \r
 [Ppis]\r
   gEfiTemporaryRamSupportPpiGuid                # PPI ALWAYS_PRODUCED\r