summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library/LockBoxLib/LockBoxLib.h
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2014-03-04 08:03:23 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-03-04 08:03:23 +0000
commit6a7cba79b7b6d58f79a01bf29c900cb3ca6b5187 (patch)
treee9b46938100fd90096639dc2963b205e117e28f4 /OvmfPkg/Library/LockBoxLib/LockBoxLib.h
parent5fb6fc0f0538af2927905090c26a72d4de4112a4 (diff)
downloadedk2-platforms-6a7cba79b7b6d58f79a01bf29c900cb3ca6b5187.tar.xz
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 <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> 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@15301 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/Library/LockBoxLib/LockBoxLib.h')
-rw-r--r--OvmfPkg/Library/LockBoxLib/LockBoxLib.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/OvmfPkg/Library/LockBoxLib/LockBoxLib.h b/OvmfPkg/Library/LockBoxLib/LockBoxLib.h
new file mode 100644
index 0000000000..5adb65fef2
--- /dev/null
+++ b/OvmfPkg/Library/LockBoxLib/LockBoxLib.h
@@ -0,0 +1,60 @@
+/** @file
+
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+
+ 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.
+
+**/
+
+#ifndef __LOCK_BOX_LIB_IMPL_H__
+#define __LOCK_BOX_LIB_IMPL_H__
+
+#pragma pack(1)
+
+typedef struct {
+ UINT32 Signature;
+ UINT32 SubPageBuffer;
+ UINT32 SubPageRemaining;
+} LOCK_BOX_GLOBAL;
+
+#define LOCK_BOX_GLOBAL_SIGNATURE SIGNATURE_32('L', 'B', 'G', 'S')
+
+extern LOCK_BOX_GLOBAL *mLockBoxGlobal;
+
+#pragma pack()
+
+/**
+ 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
+ );
+
+
+RETURN_STATUS
+EFIAPI
+LockBoxLibInitialize (
+ VOID
+ );
+
+
+#endif