Revision: 14158
          http://edk2.svn.sourceforge.net/edk2/?rev=14158&view=rev
Author:   jljusten
Date:     2013-03-04 17:38:42 +0000 (Mon, 04 Mar 2013)
Log Message:
-----------
OvmfPkg: make sure ResetCold() and ResetWarm() never return

Also, add a small delay after the 0xCF9 hard reset request -- on qemu/kvm the
port access is translated to the qemu-internal system reset request by the CPU
thread, and it might progress some more before the IO thread acts upon the
system reset request.

MicroSecondDelay() is implemented by OvmfPkg's own AcpiTimerLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>

Modified Paths:
--------------
    trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
    trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf

Modified: trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
===================================================================
--- trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c  2013-03-04 
17:38:24 UTC (rev 14157)
+++ trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c  2013-03-04 
17:38:42 UTC (rev 14158)
@@ -17,6 +17,7 @@
 #include <Library/BaseLib.h>
 #include <Library/DebugLib.h>
 #include <Library/IoLib.h>
+#include <Library/TimerLib.h>
 
 VOID
 AcpiPmControl (
@@ -46,7 +47,10 @@
   )
 {
   IoWrite8 (0xCF9, BIT2 | BIT1); // 1st choice: PIIX3 RCR, RCPU|SRST
+  MicroSecondDelay (50);
+
   IoWrite8 (0x64, 0xfe);         // 2nd choice: keyboard controller
+  CpuDeadLoop ();
 }
 
 /**
@@ -63,6 +67,7 @@
   )
 {
   IoWrite8 (0x64, 0xfe);
+  CpuDeadLoop ();
 }
 
 /**

Modified: trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
===================================================================
--- trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf        
2013-03-04 17:38:24 UTC (rev 14157)
+++ trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf        
2013-03-04 17:38:42 UTC (rev 14158)
@@ -35,4 +35,4 @@
 [LibraryClasses]
   DebugLib
   IoLib
-
+  TimerLib

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to