]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: make sure ResetCold() and ResetWarm() never return
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 4 Mar 2013 17:38:42 +0000 (17:38 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 4 Mar 2013 17:38:42 +0000 (17:38 +0000)
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 <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14158 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf

index 85af7f12508169c363a3f1267dc290eab77adf91..d075fbef0a542ef1310518e6bc0c75c1ab481c7e 100644 (file)
@@ -17,6 +17,7 @@
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/IoLib.h>\r
+#include <Library/TimerLib.h>\r
 \r
 VOID\r
 AcpiPmControl (\r
@@ -46,7 +47,10 @@ ResetCold (
   )\r
 {\r
   IoWrite8 (0xCF9, BIT2 | BIT1); // 1st choice: PIIX3 RCR, RCPU|SRST\r
+  MicroSecondDelay (50);\r
+\r
   IoWrite8 (0x64, 0xfe);         // 2nd choice: keyboard controller\r
+  CpuDeadLoop ();\r
 }\r
 \r
 /**\r
@@ -63,6 +67,7 @@ ResetWarm (
   )\r
 {\r
   IoWrite8 (0x64, 0xfe);\r
+  CpuDeadLoop ();\r
 }\r
 \r
 /**\r
index 0694b4dd3c600b0a1df6fc9850d3cc8222d3e2f2..c4d8ce54bf475b76701326dbe0058cc3fe766ed9 100644 (file)
@@ -35,4 +35,4 @@
 [LibraryClasses]\r
   DebugLib\r
   IoLib\r
-\r
+  TimerLib\r