2010-01-26 02:15:26 +01:00
|
|
|
/** @file
|
|
|
|
Header file for S3 Boot Script Saver thunk driver.
|
|
|
|
|
2014-11-12 04:30:11 +01:00
|
|
|
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
|
2010-04-24 11:48:54 +02:00
|
|
|
This program and the accompanying materials
|
2010-01-26 02:15:26 +01:00
|
|
|
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 __BOOT_SCRIPT_SAVE_ON_S3_SAVE_STATE_H__
|
|
|
|
#define __BOOT_SCRIPT_SAVE_ON_S3_SAVE_STATE_H__
|
|
|
|
#include <FrameworkDxe.h>
|
|
|
|
|
|
|
|
#include <Protocol/BootScriptSave.h>
|
|
|
|
#include <Protocol/S3SaveState.h>
|
|
|
|
|
|
|
|
#include <Library/BaseLib.h>
|
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/UefiBootServicesTableLib.h>
|
2010-12-22 05:26:08 +01:00
|
|
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
2010-01-26 02:15:26 +01:00
|
|
|
#include <Library/SmbusLib.h>
|
2010-12-22 05:26:08 +01:00
|
|
|
#include <Library/PeCoffLib.h>
|
|
|
|
#include <Library/PcdLib.h>
|
|
|
|
#include <Library/MemoryAllocationLib.h>
|
|
|
|
#include <Library/DxeServicesLib.h>
|
|
|
|
#include <Library/CacheMaintenanceLib.h>
|
2014-11-12 04:30:11 +01:00
|
|
|
#include <Library/BaseMemoryLib.h>
|
|
|
|
#include <Library/DevicePathLib.h>
|
|
|
|
#include <Library/UefiLib.h>
|
2010-12-22 05:26:08 +01:00
|
|
|
|
|
|
|
#include <Guid/BootScriptThunkData.h>
|
2014-11-12 04:30:11 +01:00
|
|
|
#include <Guid/MemoryProfile.h>
|
2010-12-22 05:26:08 +01:00
|
|
|
|
2010-01-26 02:15:26 +01:00
|
|
|
#include <IndustryStandard/SmBus.h>
|
|
|
|
|
2010-12-22 05:26:08 +01:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
|
|
|
(EFIAPI *DISPATCH_ENTRYPOINT_FUNC) (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN VOID *Context
|
|
|
|
);
|
|
|
|
|
2010-01-26 02:15:26 +01:00
|
|
|
/**
|
|
|
|
Adds a record into a specified Framework boot script table.
|
|
|
|
|
|
|
|
This function is used to store a boot script record into a given boot
|
|
|
|
script table. If the table specified by TableName is nonexistent in the
|
|
|
|
system, a new table will automatically be created and then the script record
|
|
|
|
will be added into the new table. A boot script table can add new script records
|
|
|
|
until EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is called. Currently, the only
|
|
|
|
meaningful table name is EFI_ACPI_S3_RESUME_SCRIPT_TABLE. This function is
|
|
|
|
responsible for allocating necessary memory for the script.
|
|
|
|
|
|
|
|
This function has a variable parameter list. The exact parameter list depends on
|
|
|
|
the OpCode that is passed into the function. If an unsupported OpCode or illegal
|
|
|
|
parameter list is passed in, this function returns EFI_INVALID_PARAMETER.
|
|
|
|
If there are not enough resources available for storing more scripts, this function returns
|
|
|
|
EFI_OUT_OF_RESOURCES.
|
|
|
|
|
|
|
|
@param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.
|
|
|
|
@param TableName Name of the script table. Currently, the only meaningful value is
|
|
|
|
EFI_ACPI_S3_RESUME_SCRIPT_TABLE.
|
|
|
|
@param OpCode The operation code (opcode) number.
|
2010-03-01 04:26:19 +01:00
|
|
|
@param ... Argument list that is specific to each opcode.
|
2010-01-26 02:15:26 +01:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The operation succeeded. A record was added into the
|
|
|
|
specified script table.
|
|
|
|
@retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
|
|
|
|
If the opcode is unknow or not supported because of the PCD
|
|
|
|
Feature Flags.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
BootScriptWrite (
|
|
|
|
IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,
|
|
|
|
IN UINT16 TableName,
|
|
|
|
IN UINT16 OpCode,
|
|
|
|
...
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Closes the specified script table.
|
|
|
|
|
|
|
|
This function closes the specified boot script table and returns the base address
|
|
|
|
of the table. It allocates a new pool to duplicate all the boot scripts in the specified
|
|
|
|
table. Once this function is called, the specified table will be destroyed after it is
|
|
|
|
copied into the allocated pool. As a result, any attempts to add a script record into a
|
|
|
|
closed table will cause a new table to be created. The base address of the allocated pool
|
|
|
|
will be returned in Address. After using the boot script table, the caller is responsible
|
|
|
|
for freeing the pool that is allocated by this function. If the boot script table,
|
|
|
|
such as EFI_ACPI_S3_RESUME_SCRIPT_TABLE, is required to be stored in a nonperturbed
|
|
|
|
memory region, the caller should copy the table into the nonperturbed memory region by itself.
|
|
|
|
|
|
|
|
@param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.
|
|
|
|
@param TableName Name of the script table. Currently, the only meaningful value is
|
|
|
|
EFI_ACPI_S3_RESUME_SCRIPT_TABLE.
|
|
|
|
@param Address A pointer to the physical address where the table begins.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The table was successfully returned.
|
|
|
|
@retval EFI_NOT_FOUND The specified table was not created previously.
|
|
|
|
@retval EFI_OUT_OF_RESOURCE Memory is insufficient to hold the reorganized boot script table.
|
|
|
|
@retval EFI_UNSUPPORTED the table type is not EFI_ACPI_S3_RESUME_SCRIPT_TABLE
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
BootScriptCloseTable (
|
|
|
|
IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,
|
|
|
|
IN UINT16 TableName,
|
|
|
|
OUT EFI_PHYSICAL_ADDRESS *Address
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|