]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Include/Protocol/Dpc.h
NetworkPkg: Move Dpc.h from MdeModulePkg to NetworkPkg
[mirror_edk2.git] / NetworkPkg / Include / Protocol / Dpc.h
diff --git a/NetworkPkg/Include/Protocol/Dpc.h b/NetworkPkg/Include/Protocol/Dpc.h
new file mode 100644 (file)
index 0000000..1e1d0d3
--- /dev/null
@@ -0,0 +1,98 @@
+/** @file\r
+\r
+  EFI Deferred Procedure Call Protocol.\r
+\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+\r
+#ifndef __DPC_H__\r
+#define __DPC_H__\r
+\r
+//\r
+// DPC Protocol GUID value\r
+//\r
+#define EFI_DPC_PROTOCOL_GUID \\r
+    { \\r
+      0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6 } \\r
+    }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_DPC_PROTOCOL  EFI_DPC_PROTOCOL;\r
+\r
+\r
+/**\r
+  Invoke a Deferred Procedure Call.\r
+\r
+  @param  DpcContext           The pointer to the Deferred Procedure Call's context,\r
+                               which is implementation dependent.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_DPC_PROCEDURE)(\r
+  IN VOID  *DpcContext\r
+  );\r
+\r
+/**\r
+  Add a Deferred Procedure Call to the end of the DPC queue.\r
+\r
+  @param  This          The protocol instance pointer.\r
+  @param  DpcTpl        The EFI_TPL that the DPC should invoke.\r
+  @param  DpcProcedure  The pointer to the DPC's function.\r
+  @param  DpcContext    The pointer to the DPC's context.  Passed to DpcProcedure\r
+                        when DpcProcedure is invoked.\r
+\r
+  @retval EFI_SUCCESS            The DPC was queued.\r
+  @retval EFI_INVALID_PARAMETER  DpcTpl is not a valid EFI_TPL.\r
+  @retval EFI_INVALID_PARAMETER  DpcProcedure is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES   There are not enough resources available to\r
+                                 add the DPC to the queue.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DPC_QUEUE_DPC)(\r
+  IN EFI_DPC_PROTOCOL   *This,\r
+  IN EFI_TPL            DpcTpl,\r
+  IN EFI_DPC_PROCEDURE  DpcProcedure,\r
+  IN VOID               *DpcContext    OPTIONAL\r
+  );\r
+\r
+/**\r
+  Dispatch the queue of DPCs.\r
+\r
+  DPCs with DpcTpl value greater than the current TPL value are queued, and then DPCs\r
+  with DpcTpl value lower than the current TPL value are queued. All DPCs in the first\r
+  group (higher DpcTpl values) are invoked before DPCs in the second group (lower DpcTpl values).\r
+\r
+  @param  This  Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS    One or more DPCs were invoked.\r
+  @retval EFI_NOT_FOUND  No DPCs were invoked.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DPC_DISPATCH_DPC)(\r
+  IN EFI_DPC_PROTOCOL  *This\r
+  );\r
+\r
+///\r
+/// DPC Protocol structure.\r
+///\r
+struct _EFI_DPC_PROTOCOL {\r
+  EFI_DPC_QUEUE_DPC     QueueDpc;\r
+  EFI_DPC_DISPATCH_DPC  DispatchDpc;\r
+};\r
+\r
+///\r
+/// DPC Protocol GUID variable.\r
+///\r
+extern EFI_GUID gEfiDpcProtocolGuid;\r
+\r
+#endif\r