mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
OvmfPkg: AcpiS3SaveDxe: drop EFI_ACPI_S3_SAVE_PROTOCOL
At this point, nothing in the OVMF build calls EFI_ACPI_S3_SAVE_PROTOCOL member functions; simplify the code by dropping this protocol interface. Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18038 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
9d7051b7a0
commit
ca82d563d2
@ -1,6 +1,9 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This is an implementation of the ACPI S3 Save protocol. This is defined in
|
This is a replacement for the ACPI S3 Save protocol.
|
||||||
S3 boot path specification 0.9.
|
|
||||||
|
The ACPI S3 Save protocol used to be defined in the S3 boot path
|
||||||
|
specification 0.9. Instead, the same functionality is now hooked to the
|
||||||
|
End-of-Dxe event.
|
||||||
|
|
||||||
Copyright (c) 2014-2015, Red Hat, Inc.<BR>
|
Copyright (c) 2014-2015, Red Hat, Inc.<BR>
|
||||||
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
|
||||||
@ -30,19 +33,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Guid/AcpiS3Context.h>
|
#include <Guid/AcpiS3Context.h>
|
||||||
#include <Guid/Acpi.h>
|
#include <Guid/Acpi.h>
|
||||||
#include <Guid/EventGroup.h>
|
#include <Guid/EventGroup.h>
|
||||||
#include <Protocol/AcpiS3Save.h>
|
|
||||||
#include <Protocol/LockBox.h>
|
#include <Protocol/LockBox.h>
|
||||||
#include <IndustryStandard/Acpi.h>
|
#include <IndustryStandard/Acpi.h>
|
||||||
|
|
||||||
#include "AcpiS3Save.h"
|
|
||||||
|
|
||||||
UINTN mLegacyRegionSize;
|
|
||||||
|
|
||||||
EFI_ACPI_S3_SAVE_PROTOCOL mS3Save = {
|
|
||||||
LegacyGetS3MemorySize,
|
|
||||||
S3Ready,
|
|
||||||
};
|
|
||||||
|
|
||||||
EFI_GUID mAcpiS3IdtrProfileGuid = {
|
EFI_GUID mAcpiS3IdtrProfileGuid = {
|
||||||
0xdea652b0, 0xd587, 0x4c54, { 0xb5, 0xb4, 0xc6, 0x82, 0xe7, 0xa0, 0xaa, 0x3d }
|
0xdea652b0, 0xd587, 0x4c54, { 0xb5, 0xb4, 0xc6, 0x82, 0xe7, 0xa0, 0xaa, 0x3d }
|
||||||
};
|
};
|
||||||
@ -384,53 +377,18 @@ S3CreateIdentityMappingPageTables (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Gets the buffer of legacy memory below 1 MB
|
|
||||||
This function is to get the buffer in legacy memory below 1MB that is required during S3 resume.
|
|
||||||
|
|
||||||
@param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.
|
|
||||||
@param Size The returned size of legacy memory below 1 MB.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS Size is successfully returned.
|
|
||||||
@retval EFI_INVALID_PARAMETER The pointer Size is NULL.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
LegacyGetS3MemorySize (
|
|
||||||
IN EFI_ACPI_S3_SAVE_PROTOCOL *This,
|
|
||||||
OUT UINTN *Size
|
|
||||||
)
|
|
||||||
{
|
|
||||||
ASSERT (FALSE);
|
|
||||||
|
|
||||||
if (Size == NULL) {
|
|
||||||
return EFI_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
|
|
||||||
*Size = mLegacyRegionSize;
|
|
||||||
return EFI_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Prepares all information that is needed in the S3 resume boot path.
|
Prepares all information that is needed in the S3 resume boot path.
|
||||||
|
|
||||||
Allocate the resources or prepare informations and save in ACPI variable set for S3 resume boot path
|
Allocate the resources or prepare informations and save in ACPI variable set for S3 resume boot path
|
||||||
|
|
||||||
@param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.
|
|
||||||
@param LegacyMemoryAddress The base address of legacy memory.
|
|
||||||
|
|
||||||
@retval EFI_NOT_FOUND Some necessary information cannot be found.
|
|
||||||
@retval EFI_SUCCESS All information was saved successfully.
|
@retval EFI_SUCCESS All information was saved successfully.
|
||||||
@retval EFI_OUT_OF_RESOURCES Resources were insufficient to save all the information.
|
|
||||||
@retval EFI_INVALID_PARAMETER The memory range is not located below 1 MB.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
S3Ready (
|
S3Ready (
|
||||||
IN EFI_ACPI_S3_SAVE_PROTOCOL *This,
|
VOID
|
||||||
IN VOID *LegacyMemoryAddress
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -442,17 +400,12 @@ S3Ready (
|
|||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "S3Ready!\n"));
|
DEBUG ((EFI_D_INFO, "S3Ready!\n"));
|
||||||
|
|
||||||
//
|
ASSERT (!AlreadyEntered);
|
||||||
// Platform may invoke AcpiS3Save->S3Save() before ExitPmAuth, because we need save S3 information there, while BDS ReadyToBoot may invoke it again.
|
|
||||||
// So if 2nd S3Save() is triggered later, we need ignore it.
|
|
||||||
//
|
|
||||||
if (AlreadyEntered) {
|
if (AlreadyEntered) {
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
AlreadyEntered = TRUE;
|
AlreadyEntered = TRUE;
|
||||||
|
|
||||||
ASSERT (LegacyMemoryAddress == NULL);
|
|
||||||
|
|
||||||
AcpiS3Context = AllocateMemoryBelow4G (EfiReservedMemoryType, sizeof(*AcpiS3Context));
|
AcpiS3Context = AllocateMemoryBelow4G (EfiReservedMemoryType, sizeof(*AcpiS3Context));
|
||||||
ASSERT (AcpiS3Context != NULL);
|
ASSERT (AcpiS3Context != NULL);
|
||||||
AcpiS3ContextBuffer = (EFI_PHYSICAL_ADDRESS)(UINTN)AcpiS3Context;
|
AcpiS3ContextBuffer = (EFI_PHYSICAL_ADDRESS)(UINTN)AcpiS3Context;
|
||||||
@ -539,13 +492,9 @@ OnEndOfDxe (
|
|||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Our S3Ready() function ignores both of its parameters, and always
|
// Our S3Ready() function always succeeds.
|
||||||
// succeeds.
|
|
||||||
//
|
//
|
||||||
Status = S3Ready (
|
Status = S3Ready ();
|
||||||
NULL, // This
|
|
||||||
NULL // LegacyMemoryAddress
|
|
||||||
);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -559,7 +508,8 @@ OnEndOfDxe (
|
|||||||
/**
|
/**
|
||||||
The Driver Entry Point.
|
The Driver Entry Point.
|
||||||
|
|
||||||
The function is the driver Entry point which will produce AcpiS3SaveProtocol.
|
The function is the driver Entry point that will register the End-of-Dxe
|
||||||
|
callback.
|
||||||
|
|
||||||
@param ImageHandle A handle for the image that is initializing this driver
|
@param ImageHandle A handle for the image that is initializing this driver
|
||||||
@param SystemTable A pointer to the EFI system table
|
@param SystemTable A pointer to the EFI system table
|
||||||
@ -571,7 +521,7 @@ OnEndOfDxe (
|
|||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
InstallAcpiS3Save (
|
InstallEndOfDxeCallback (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
)
|
)
|
||||||
@ -583,18 +533,8 @@ InstallAcpiS3Save (
|
|||||||
return EFI_LOAD_ERROR;
|
return EFI_LOAD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FeaturePcdGet(PcdPlatformCsmSupport)) {
|
|
||||||
//
|
|
||||||
// More memory for no CSM tip, because GDT need relocation
|
|
||||||
//
|
|
||||||
mLegacyRegionSize = 0x250;
|
|
||||||
} else {
|
|
||||||
mLegacyRegionSize = 0x100;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
&ImageHandle,
|
&ImageHandle,
|
||||||
&gEfiAcpiS3SaveProtocolGuid, &mS3Save,
|
|
||||||
&gEfiLockBoxProtocolGuid, NULL,
|
&gEfiLockBoxProtocolGuid, NULL,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
/** @file
|
|
||||||
This is an implementation of the ACPI S3 Save protocol. This is defined in
|
|
||||||
S3 boot path specification 0.9.
|
|
||||||
|
|
||||||
Copyright (c) 2006 - 2012, 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 _ACPI_S3_SAVE_H_
|
|
||||||
#define _ACPI_S3_SAVE_H_
|
|
||||||
|
|
||||||
/**
|
|
||||||
Gets the buffer of legacy memory below 1 MB
|
|
||||||
This function is to get the buffer in legacy memory below 1MB that is required during S3 resume.
|
|
||||||
|
|
||||||
@param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.
|
|
||||||
@param Size The returned size of legacy memory below 1 MB.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS Size is successfully returned.
|
|
||||||
@retval EFI_INVALID_PARAMETER The pointer Size is NULL.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
LegacyGetS3MemorySize (
|
|
||||||
IN EFI_ACPI_S3_SAVE_PROTOCOL * This,
|
|
||||||
OUT UINTN * Size
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Prepares all information that is needed in the S3 resume boot path.
|
|
||||||
|
|
||||||
Allocate the resources or prepare informations and save in ACPI variable set for S3 resume boot path
|
|
||||||
|
|
||||||
@param This A pointer to the EFI_ACPI_S3_SAVE_PROTOCOL instance.
|
|
||||||
@param LegacyMemoryAddress The base address of legacy memory.
|
|
||||||
|
|
||||||
@retval EFI_NOT_FOUND Some necessary information cannot be found.
|
|
||||||
@retval EFI_SUCCESS All information was saved successfully.
|
|
||||||
@retval EFI_OUT_OF_RESOURCES Resources were insufficient to save all the information.
|
|
||||||
@retval EFI_INVALID_PARAMETER The memory range is not located below 1 MB.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
S3Ready (
|
|
||||||
IN EFI_ACPI_S3_SAVE_PROTOCOL *This,
|
|
||||||
IN VOID *LegacyMemoryAddress
|
|
||||||
);
|
|
||||||
#endif
|
|
@ -1,7 +1,6 @@
|
|||||||
## @file
|
## @file
|
||||||
# Component description file for AcpiS3Save module.
|
# AcpiS3Save module installs EndOfDxe callback to prepare S3 boot data.
|
||||||
#
|
#
|
||||||
# This is an implementation of the ACPI S3 Save protocol.
|
|
||||||
# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials are
|
# This program and the accompanying materials are
|
||||||
@ -21,7 +20,7 @@
|
|||||||
MODULE_TYPE = DXE_DRIVER
|
MODULE_TYPE = DXE_DRIVER
|
||||||
VERSION_STRING = 1.0
|
VERSION_STRING = 1.0
|
||||||
|
|
||||||
ENTRY_POINT = InstallAcpiS3Save
|
ENTRY_POINT = InstallEndOfDxeCallback
|
||||||
|
|
||||||
#
|
#
|
||||||
# The following information is for reference only and not required by the build tools.
|
# The following information is for reference only and not required by the build tools.
|
||||||
@ -30,7 +29,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
[Sources]
|
[Sources]
|
||||||
AcpiS3Save.h
|
|
||||||
AcpiS3Save.c
|
AcpiS3Save.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
@ -61,14 +59,12 @@
|
|||||||
gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event
|
gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiAcpiS3SaveProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
|
||||||
gEfiLockBoxProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiLockBoxProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||||
gEfiLegacyBiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiLegacyBiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||||
gEfiLegacyRegion2ProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
|
gEfiLegacyRegion2ProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
|
||||||
gFrameworkEfiMpServiceProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
|
gFrameworkEfiMpServiceProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
|
||||||
|
|
||||||
[FeaturePcd]
|
[FeaturePcd]
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformCsmSupport ## CONSUMES
|
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode
|
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user