]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg ResetSystemLib: Fix shutdown via UEFI runtime services
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 18 Jul 2013 22:51:10 +0000 (22:51 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Jul 2013 22:51:10 +0000 (22:51 +0000)
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 <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14492 6f19259b-4bc3-4df7-8a09-765794883524

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

index d075fbef0a542ef1310518e6bc0c75c1ab481c7e..391d0533478c3d1165eea2eb9fca94edbf169770 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Reset System Library functions for OVMF\r
 \r
-  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -17,6 +17,7 @@
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/IoLib.h>\r
+#include <Library/PcdLib.h>\r
 #include <Library/TimerLib.h>\r
 \r
 VOID\r
@@ -26,8 +27,8 @@ AcpiPmControl (
 {\r
   ASSERT (SuspendType < 6);\r
 \r
-  IoAndThenOr16 (0x404, (UINT16) ~0x3c00, (UINT16) (SuspendType << 10));\r
-  IoOr16 (0x404, BIT13);\r
+  IoBitFieldWrite16  (PcdGet16 (PcdAcpiPmBaseAddress) + 4, 10, 13, SuspendType);\r
+  IoOr16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, BIT13);\r
   CpuDeadLoop ();\r
 }\r
 \r
index c4d8ce54bf475b76701326dbe0058cc3fe766ed9..b6a3ffe77254b011804c4abf663608e7b5b14ae0 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Library instance for ResetSystem library class for OVMF\r
 #\r
-#  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
+  OvmfPkg/OvmfPkg.dec\r
 \r
 [LibraryClasses]\r
   DebugLib\r
   IoLib\r
   TimerLib\r
+\r
+[Pcd]\r
+  gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
\ No newline at end of file