Revision: 18034
http://sourceforge.net/p/edk2/code/18034
Author: jljusten
Date: 2015-07-26 08:02:07 +0000 (Sun, 26 Jul 2015)
Log Message:
-----------
OvmfPkg: AcpiS3SaveDxe: call S3Ready() at End-of-Dxe
Call S3Ready() whenever the first of the following occurs:
- a driver signals End-of-Dxe,
- a driver calls EFI_ACPI_S3_SAVE_PROTOCOL.S3Save().
S3Ready() already contains a static, function scope "latch" that causes it
to exit early when called for the second time or later.
(At the moment, the only platform in the edk2 tree that includes this
driver is OvmfPkg. That platform does not signal End-of-Dxe (yet).)
http://thread.gmane.org/gmane.comp.bios.tianocore.devel/16088/focus=16146
Suggested-by: Yao Jiewen <[email protected]>
Cc: Jordan Justen <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Modified Paths:
--------------
trunk/edk2/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
trunk/edk2/OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf
Modified: trunk/edk2/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c
===================================================================
--- trunk/edk2/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c 2015-07-26 08:02:02 UTC
(rev 18033)
+++ trunk/edk2/OvmfPkg/AcpiS3SaveDxe/AcpiS3Save.c 2015-07-26 08:02:07 UTC
(rev 18034)
@@ -29,6 +29,7 @@
#include <Guid/AcpiVariableCompatibility.h>
#include <Guid/AcpiS3Context.h>
#include <Guid/Acpi.h>
+#include <Guid/EventGroup.h>
#include <Protocol/AcpiS3Save.h>
#include <Protocol/S3SaveState.h>
#include <Protocol/DxeSmmReadyToLock.h>
@@ -571,6 +572,40 @@
}
/**
+ Callback function executed when the EndOfDxe event group is signaled.
+
+ @param[in] Event Event whose notification function is being invoked.
+ @param[in] Context The pointer to the notification function's context, which
+ is implementation-dependent.
+**/
+VOID
+EFIAPI
+OnEndOfDxe (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EFI_STATUS Status;
+
+ //
+ // Our S3Ready() function ignores both of its parameters, and always
+ // succeeds.
+ //
+ Status = S3Ready (
+ NULL, // This
+ NULL // LegacyMemoryAddress
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // Close the event, deregistering the callback and freeing resources.
+ //
+ Status = gBS->CloseEvent (Event);
+ ASSERT_EFI_ERROR (Status);
+}
+
+
+/**
The Driver Entry Point.
The function is the driver Entry point which will produce AcpiS3SaveProtocol.
@@ -591,6 +626,7 @@
)
{
EFI_STATUS Status;
+ EFI_EVENT EndOfDxeEvent;
if (!QemuFwCfgS3Enabled()) {
return EFI_LOAD_ERROR;
@@ -612,5 +648,15 @@
NULL
);
ASSERT_EFI_ERROR (Status);
+
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ OnEndOfDxe,
+ NULL, /* NotifyContext */
+ &gEfiEndOfDxeEventGroupGuid,
+ &EndOfDxeEvent
+ );
+ ASSERT_EFI_ERROR (Status);
return Status;
}
Modified: trunk/edk2/OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf
===================================================================
--- trunk/edk2/OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf 2015-07-26 08:02:02 UTC
(rev 18033)
+++ trunk/edk2/OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf 2015-07-26 08:02:07 UTC
(rev 18034)
@@ -58,6 +58,7 @@
gEfiAcpiS3ContextGuid # ALWAYS_CONSUMED
gEfiAcpi20TableGuid # ALWAYS_CONSUMED System Table
gEfiAcpi10TableGuid # ALWAYS_CONSUMED System Table
+ gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event
[Protocols]
gEfiAcpiS3SaveProtocolGuid # PROTOCOL ALWAYS_PRODUCED
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits