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 <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
This commit is contained in:
Jordan Justen 2013-07-18 22:51:10 +00:00 committed by jljusten
parent e3d495e1b9
commit d52c2868b4
2 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Reset System Library functions for OVMF 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -17,6 +17,7 @@
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/IoLib.h> #include <Library/IoLib.h>
#include <Library/PcdLib.h>
#include <Library/TimerLib.h> #include <Library/TimerLib.h>
VOID VOID
@ -26,8 +27,8 @@ AcpiPmControl (
{ {
ASSERT (SuspendType < 6); ASSERT (SuspendType < 6);
IoAndThenOr16 (0x404, (UINT16) ~0x3c00, (UINT16) (SuspendType << 10)); IoBitFieldWrite16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, 10, 13, SuspendType);
IoOr16 (0x404, BIT13); IoOr16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, BIT13);
CpuDeadLoop (); CpuDeadLoop ();
} }

View File

@ -1,7 +1,7 @@
## @file ## @file
# Library instance for ResetSystem library class for OVMF # 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 # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
@ -31,8 +31,12 @@
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses] [LibraryClasses]
DebugLib DebugLib
IoLib IoLib
TimerLib TimerLib
[Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress