From 64d14edfeb3f0dd31506bec1244a8d53f08789cc Mon Sep 17 00:00:00 2001 From: jljusten Date: Mon, 29 Aug 2011 22:17:27 +0000 Subject: MdeModulePkg: Add PiDxeS3BootScriptLib Signed-off-by: jljusten Reviewed-by: mdkinney Reviewed-by: rsun3 Reviewed-by: jyao1 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12224 6f19259b-4bc3-4df7-8a09-765794883524 --- .../PiDxeS3BootScriptLib/InternalBootScriptLib.h | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h') diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h b/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h new file mode 100644 index 0000000000..babd12e43c --- /dev/null +++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h @@ -0,0 +1,102 @@ +/** @file + Support for S3 boot script lib. This file defined some internal macro and internal + data structure + + Copyright (c) 2006 - 2011, 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. + +**/ +#ifndef __INTERNAL_BOOT_SCRIPT_LIB__ +#define __INTERNAL_BOOT_SCRIPT_LIB__ + +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "BootScriptInternalFormat.h" + +#define MAX_IO_ADDRESS 0xFFFF + +#define PCI_ADDRESS_ENCODE(A) (UINTN)PCI_LIB_ADDRESS( \ + (((A)& 0xff000000) >> 24), (((A) &0x00ff0000) >> 16), (((A) & 0xff00) >> 8), ((RShiftU64 ((A), 32) & 0xfff) | ((A)& 0xff)) \ + ) + + + +typedef union { + UINT8 volatile *Buf; + UINT8 volatile *Uint8; + UINT16 volatile *Uint16; + UINT32 volatile *Uint32; + UINT64 volatile *Uint64; + UINTN volatile Uint; +} PTR; + + +// Minimum and maximum length for SMBus bus block protocols defined in SMBus spec 2.0. +// +#define MIN_SMBUS_BLOCK_LEN 1 +#define MAX_SMBUS_BLOCK_LEN 32 + +// +// The boot script private data. +// +typedef struct { + UINT8 *TableBase; + UINT32 TableLength; // Record the actual memory length + UINT16 TableMemoryPageNumber; // Record the page number Allocated for the table + BOOLEAN AtRuntime; // Record if current state is after SmmReadyToLock + BOOLEAN InSmm; // Record if this library is in SMM. +} SCRIPT_TABLE_PRIVATE_DATA; + +typedef +EFI_STATUS +(EFIAPI *DISPATCH_ENTRYPOINT_FUNC) ( + IN EFI_HANDLE ImageHandle, + IN VOID *Context + ); + +extern SCRIPT_TABLE_PRIVATE_DATA *mS3BootScriptTablePtr; + +// +// Define Opcode for Label which is implementation specific and no standard spec define. +// +#define S3_BOOT_SCRIPT_LIB_LABEL_OPCODE 0xFE + +/// +/// The opcode indicate the start of the boot script table. +/// +#define S3_BOOT_SCRIPT_LIB_TABLE_OPCODE 0xAA +/// +/// The opcode indicate the end of the boot script table. +/// +#define S3_BOOT_SCRIPT_LIB_TERMINATE_OPCODE 0xFF + + +#endif //__INTERNAL_BOOT_SCRIPT_LIB__ + -- cgit v1.2.3