]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
OvmfPkg ResetSystemLib: Fix shutdown via UEFI runtime services
[mirror_edk2.git] / OvmfPkg / Library / ResetSystemLib / ResetSystemLib.c
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