]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Ppi/DelayedDispatch.h
MdePkg: Added header file for Delayed Dispatch PPI
[mirror_edk2.git] / MdePkg / Include / Ppi / DelayedDispatch.h
diff --git a/MdePkg/Include/Ppi/DelayedDispatch.h b/MdePkg/Include/Ppi/DelayedDispatch.h
new file mode 100644 (file)
index 0000000..195c5a3
--- /dev/null
@@ -0,0 +1,85 @@
+/** @file\r
+    EFI Delayed Dispatch PPI as defined in the PI 1.7 Specification\r
+\r
+    Provide timed event service in PEI\r
+\r
+    Copyright (c) 2020, American Megatrends International LLC. All rights reserved.\r
+    SPDX-License-Identifier: BSD-2-Clause-Patent\r
+**/\r
+\r
+#ifndef __DELAYED_DISPATCH_PPI_H__\r
+#define __DELAYED_DISPATCH_PPI_H__\r
+\r
+///\r
+/// Global ID for EFI_DELAYED_DISPATCH_PPI_GUID\r
+///\r
+#define EFI_DELAYED_DISPATCH_PPI_GUID \\r
+  { \\r
+    0x869c711d, 0x649c, 0x44fe, { 0x8b, 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6} } \\r
+  }\r
+\r
+\r
+/**\r
+  Delayed Dispatch function.  This routine is called sometime after the required\r
+  delay.  Upon return, if NewDelay is 0, the function is unregistered.  If NewDelay\r
+  is not zero, this routine will be called again after the new delay period.\r
+\r
+  @param[in,out] Context         Pointer to Context. Can be updated by routine.\r
+  @param[out]    NewDelay        The new delay in us.  Leave at 0 to unregister callback.\r
+\r
+**/\r
+\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_DELAYED_DISPATCH_FUNCTION) (\r
+  IN OUT UINT64 *Context,\r
+     OUT UINT32 *NewDelay\r
+  );\r
+\r
+\r
+///\r
+/// The forward declaration for EFI_DELAYED_DISPATCH_PPI\r
+///\r
+\r
+typedef  struct _EFI_DELAYED_DISPATCH_PPI  EFI_DELAYED_DISPATCH_PPI;\r
+\r
+\r
+/**\r
+Register a callback to be called after a minimum delay has occurred.\r
+\r
+This service is the single member function of the EFI_DELAYED_DISPATCH_PPI\r
+\r
+  @param This           Pointer to the EFI_DELAYED_DISPATCH_PPI instance\r
+  @param Function       Function to call back\r
+  @param Context        Context data\r
+  @param Delay          Delay interval\r
+\r
+  @retval EFI_SUCCESS               Function successfully loaded\r
+  @retval EFI_INVALID_PARAMETER     One of the Arguments is not supported\r
+  @retval EFI_OUT_OF_RESOURCES      No more entries\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DELAYED_DISPATCH_REGISTER)(\r
+  IN  EFI_DELAYED_DISPATCH_PPI      *This,\r
+  IN  EFI_DELAYED_DISPATCH_FUNCTION  Function,\r
+  IN  UINT64                     Context,\r
+  OUT UINT32                     Delay\r
+  );\r
+\r
+\r
+///\r
+/// This PPI is a pointer to the Delayed Dispatch Service.\r
+/// This service will be published by the Pei Foundation. The PEI Foundation\r
+/// will use this service to relaunch a known function that requests a delayed\r
+/// execution.\r
+///\r
+struct _EFI_DELAYED_DISPATCH_PPI {\r
+  EFI_DELAYED_DISPATCH_REGISTER      Register;\r
+};\r
+\r
+\r
+extern EFI_GUID gEfiPeiDelayedDispatchPpiGuid;\r
+\r
+#endif\r