From d52c2868b4676b5743e235d1a666b920f27022d9 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Thu, 18 Jul 2013 22:51:10 +0000 Subject: [PATCH] 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 Reviewed-by: Laszlo Ersek git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14492 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c | 7 ++++--- OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c index d075fbef0a..391d053347 100644 --- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c +++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c @@ -1,7 +1,7 @@ /** @file Reset System Library functions for OVMF - Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
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 #include #include +#include #include VOID @@ -26,8 +27,8 @@ AcpiPmControl ( { 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 (); } diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf index c4d8ce54bf..b6a3ffe772 100644 --- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf +++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf @@ -1,7 +1,7 @@ ## @file # Library instance for ResetSystem library class for OVMF # -# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
# 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 -- 2.39.2