From 6a7cba79b7b6d58f79a01bf29c900cb3ca6b5187 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Tue, 4 Mar 2014 08:03:23 +0000 Subject: OvmfPkg: implement LockBoxLib The S3 suspend/resume infrastructure depends on the LockBox library class. The edk2 tree currently contains Null and SMM instances. The Null instance is useless, and the SMM instance would require SMM emulation by including the SMM core and adding several new drivers, which is deemed too complex. Hence add a simple LockBoxLib instance for OVMF. jordan.l.justen@intel.com: * use PCDs instead of EmuNvramLib - clear memory in PlatformPei on non S3 boots * allocate NVS memory and store a pointer to that memory - reduces memory use at fixed locations Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jordan Justen 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@15301 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/Library/LockBoxLib/LockBoxBase.c | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 OvmfPkg/Library/LockBoxLib/LockBoxBase.c (limited to 'OvmfPkg/Library/LockBoxLib/LockBoxBase.c') diff --git a/OvmfPkg/Library/LockBoxLib/LockBoxBase.c b/OvmfPkg/Library/LockBoxLib/LockBoxBase.c new file mode 100644 index 0000000000..8f367701f3 --- /dev/null +++ b/OvmfPkg/Library/LockBoxLib/LockBoxBase.c @@ -0,0 +1,42 @@ +/** @file + + Copyright (c) 2006 - 2014, 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 + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + +#include +#include + +/** + Allocates a buffer of type EfiACPIMemoryNVS. + + Allocates the number bytes specified by AllocationSize of type + EfiACPIMemoryNVS and returns a pointer to the allocated buffer. + If AllocationSize is 0, then a valid buffer of 0 size is + returned. If there is not enough memory remaining to satisfy + the request, then NULL is returned. + + @param AllocationSize The number of bytes to allocate. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateAcpiNvsPool ( + IN UINTN AllocationSize + ) +{ + ASSERT_EFI_ERROR (RETURN_UNSUPPORTED); + return NULL; +} -- cgit v1.2.3