Revision: 14492
          http://sourceforge.net/p/edk2/code/14492
Author:   jljusten
Date:     2013-07-18 22:51:10 +0000 (Thu, 18 Jul 2013)
Log Message:
-----------
OvmfPkg ResetSystemLib: Fix shutdown via UEFI runtime services

When the PM base address was moved from 0x400 to 0xb000, this
code was missed. This prevented shutdown's via the UEFI system
call from working. (For example, at the EFI shell prompt: reset -s)

We now use gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
which is currently set at 0xb000.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Laszlo Ersek <[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-07-18 
21:32:43 UTC (rev 14491)
+++ trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c  2013-07-18 
22:51:10 UTC (rev 14492)
@@ -1,7 +1,7 @@
 /** @file
   Reset System Library functions for OVMF
 
-  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -17,6 +17,7 @@
 #include <Library/BaseLib.h>
 #include <Library/DebugLib.h>
 #include <Library/IoLib.h>
+#include <Library/PcdLib.h>
 #include <Library/TimerLib.h>
 
 VOID
@@ -26,8 +27,8 @@
 {
   ASSERT (SuspendType < 6);
 
-  IoAndThenOr16 (0x404, (UINT16) ~0x3c00, (UINT16) (SuspendType << 10));
-  IoOr16 (0x404, BIT13);
+  IoBitFieldWrite16  (PcdGet16 (PcdAcpiPmBaseAddress) + 4, 10, 13, 
SuspendType);
+  IoOr16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, BIT13);
   CpuDeadLoop ();
 }
 

Modified: trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
===================================================================
--- trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf        
2013-07-18 21:32:43 UTC (rev 14491)
+++ trunk/edk2/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf        
2013-07-18 22:51:10 UTC (rev 14492)
@@ -1,7 +1,7 @@
 ## @file
 #  Library instance for ResetSystem library class for OVMF
 #
-#  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
 #  which accompanies this distribution.  The full text of the license may be 
found at
@@ -31,8 +31,12 @@
 
 [Packages]
   MdePkg/MdePkg.dec
+  OvmfPkg/OvmfPkg.dec
 
 [LibraryClasses]
   DebugLib
   IoLib
   TimerLib
+
+[Pcd]
+  gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
\ No newline at end of file

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


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to