#include <Guid/AcpiVariableCompatibility.h>\r
#include <Guid/AcpiS3Context.h>\r
#include <Guid/Acpi.h>\r
+#include <Guid/EventGroup.h>\r
#include <Protocol/AcpiS3Save.h>\r
#include <Protocol/S3SaveState.h>\r
#include <Protocol/DxeSmmReadyToLock.h>\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Callback function executed when the EndOfDxe event group is signaled.\r
+\r
+ @param[in] Event Event whose notification function is being invoked.\r
+ @param[in] Context The pointer to the notification function's context, which\r
+ is implementation-dependent.\r
+**/\r
+VOID\r
+EFIAPI\r
+OnEndOfDxe (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ //\r
+ // Our S3Ready() function ignores both of its parameters, and always\r
+ // succeeds.\r
+ //\r
+ Status = S3Ready (\r
+ NULL, // This\r
+ NULL // LegacyMemoryAddress\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ //\r
+ // Close the event, deregistering the callback and freeing resources.\r
+ //\r
+ Status = gBS->CloseEvent (Event);\r
+ ASSERT_EFI_ERROR (Status);\r
+}\r
+\r
+\r
/**\r
The Driver Entry Point.\r
\r
)\r
{\r
EFI_STATUS Status;\r
+ EFI_EVENT EndOfDxeEvent;\r
\r
if (!QemuFwCfgS3Enabled()) {\r
return EFI_LOAD_ERROR;\r
NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r
+\r
+ Status = gBS->CreateEventEx (\r
+ EVT_NOTIFY_SIGNAL,\r
+ TPL_CALLBACK,\r
+ OnEndOfDxe,\r
+ NULL, /* NotifyContext */\r
+ &gEfiEndOfDxeEventGroupGuid,\r
+ &EndOfDxeEvent\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
return Status;\r
}\r
gEfiAcpiS3ContextGuid # ALWAYS_CONSUMED\r
gEfiAcpi20TableGuid # ALWAYS_CONSUMED System Table\r
gEfiAcpi10TableGuid # ALWAYS_CONSUMED System Table\r
+ gEfiEndOfDxeEventGroupGuid ## CONSUMES ## Event\r
\r
[Protocols]\r
gEfiAcpiS3SaveProtocolGuid # PROTOCOL ALWAYS_PRODUCED\r