summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Include/Protocol/Dpc.h
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-11-20 05:42:23 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-11-20 05:42:23 +0000
commit36ee91ca3661d3d020a7841aacbf858d885c4728 (patch)
tree418e7a4d4a84d86a78d4b260acab20877be5bd45 /MdeModulePkg/Include/Protocol/Dpc.h
parent04e12c21476db29e8f92030ed00122fa4e1e56cc (diff)
downloadedk2-36ee91ca3661d3d020a7841aacbf858d885c4728.zip
edk2-36ee91ca3661d3d020a7841aacbf858d885c4728.tar.gz
edk2-36ee91ca3661d3d020a7841aacbf858d885c4728.tar.bz2
1. Add DPC protocol and DpcLib library in MdeModulePkg.
2. Add DpcDxe module and DxeDpcLib module in MdeModulePkg 3. Port network stack module to use DPC. 4. Use MIN, and MAX defined in MdePkg to replace NET_MIN and NET_MAX. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4307 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Include/Protocol/Dpc.h')
-rw-r--r--MdeModulePkg/Include/Protocol/Dpc.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/MdeModulePkg/Include/Protocol/Dpc.h b/MdeModulePkg/Include/Protocol/Dpc.h
new file mode 100644
index 0000000..d20c16a
--- /dev/null
+++ b/MdeModulePkg/Include/Protocol/Dpc.h
@@ -0,0 +1,111 @@
+/*++
+
+Copyright (c) 2007, Intel Corporation
+All rights reserved. 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.
+
+Module Name:
+
+ Dpc.h
+
+Abstract:
+
+ EFI Deferred Procedure Call Protocol
+
+Revision History
+
+--*/
+
+
+#ifndef __DPC_H__
+#define __DPC_H__
+
+//
+// DPC Protocol GUID value
+//
+#define EFI_DPC_PROTOCOL_GUID \
+ { \
+ 0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6 } \
+ }
+
+//
+// Forward reference for pure ANSI compatability
+//
+typedef struct _EFI_DPC_PROTOCOL EFI_DPC_PROTOCOL;
+
+
+/**
+ Invoke a Deferred Procedure Call.
+
+ @param DpcContext Pointer to the Deferred Procedure Call's context,
+ which is implementation dependent.
+
+**/
+typedef
+VOID
+(EFIAPI *EFI_DPC_PROCEDURE) (
+ IN VOID *DpcContext
+ );
+
+/**
+ Add a Deferred Procedure Call to the end of the DPC queue.
+
+ @param This Protocol instance pointer.
+ @param DpcTpl The EFI_TPL that the DPC should be invoked.
+ @param DpcProcedure Pointer to the DPC's function.
+ @param DpcContext Pointer to the DPC's context. Passed to DpcProcedure
+ when DpcProcedure is invoked.
+
+ @retval EFI_SUCCESS The DPC was queued.
+ @retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL.
+ @retval EFI_INVALID_PARAMETER DpcProcedure is NULL.
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
+ add the DPC to the queue.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DPC_QUEUE_DPC) (
+ IN EFI_DPC_PROTOCOL *This,
+ IN EFI_TPL DpcTpl,
+ IN EFI_DPC_PROCEDURE DpcProcedure,
+ IN VOID *DpcContext OPTIONAL
+ );
+
+/**
+ Dispatch the queue of DPCs. ALL DPCs that have been queued with a DpcTpl
+ value greater than or equal to the current TPL are invoked in the order that
+ they were queued. DPCs with higher DpcTpl values are invoked before DPCs with
+ lower DpcTpl values.
+
+ @param This Protocol instance pointer.
+
+ @retval EFI_SUCCESS One or more DPCs were invoked.
+ @retval EFI_NOT_FOUND No DPCs were invoked.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DPC_DISPATCH_DPC) (
+ IN EFI_DPC_PROTOCOL *This
+ );
+
+//
+// DPC Protocol structure
+//
+typedef struct _EFI_DPC_PROTOCOL {
+ EFI_DPC_QUEUE_DPC QueueDpc;
+ EFI_DPC_DISPATCH_DPC DispatchDpc;
+};
+
+//
+// DPC Protocol GUID variable
+//
+extern EFI_GUID gEfiDpcProtocolGuid;
+
+#endif