]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/Dpc.h
1. Add DPC protocol and DpcLib library in MdeModulePkg.
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / Dpc.h
1 /*++
2
3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Dpc.h
15
16 Abstract:
17
18 EFI Deferred Procedure Call Protocol
19
20 Revision History
21
22 --*/
23
24
25 #ifndef __DPC_H__
26 #define __DPC_H__
27
28 //
29 // DPC Protocol GUID value
30 //
31 #define EFI_DPC_PROTOCOL_GUID \
32 { \
33 0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6 } \
34 }
35
36 //
37 // Forward reference for pure ANSI compatability
38 //
39 typedef struct _EFI_DPC_PROTOCOL EFI_DPC_PROTOCOL;
40
41
42 /**
43 Invoke a Deferred Procedure Call.
44
45 @param DpcContext Pointer to the Deferred Procedure Call's context,
46 which is implementation dependent.
47
48 **/
49 typedef
50 VOID
51 (EFIAPI *EFI_DPC_PROCEDURE) (
52 IN VOID *DpcContext
53 );
54
55 /**
56 Add a Deferred Procedure Call to the end of the DPC queue.
57
58 @param This Protocol instance pointer.
59 @param DpcTpl The EFI_TPL that the DPC should be invoked.
60 @param DpcProcedure Pointer to the DPC's function.
61 @param DpcContext Pointer to the DPC's context. Passed to DpcProcedure
62 when DpcProcedure is invoked.
63
64 @retval EFI_SUCCESS The DPC was queued.
65 @retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL.
66 @retval EFI_INVALID_PARAMETER DpcProcedure is NULL.
67 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
68 add the DPC to the queue.
69
70 **/
71 typedef
72 EFI_STATUS
73 (EFIAPI *EFI_DPC_QUEUE_DPC) (
74 IN EFI_DPC_PROTOCOL *This,
75 IN EFI_TPL DpcTpl,
76 IN EFI_DPC_PROCEDURE DpcProcedure,
77 IN VOID *DpcContext OPTIONAL
78 );
79
80 /**
81 Dispatch the queue of DPCs. ALL DPCs that have been queued with a DpcTpl
82 value greater than or equal to the current TPL are invoked in the order that
83 they were queued. DPCs with higher DpcTpl values are invoked before DPCs with
84 lower DpcTpl values.
85
86 @param This Protocol instance pointer.
87
88 @retval EFI_SUCCESS One or more DPCs were invoked.
89 @retval EFI_NOT_FOUND No DPCs were invoked.
90
91 **/
92 typedef
93 EFI_STATUS
94 (EFIAPI *EFI_DPC_DISPATCH_DPC) (
95 IN EFI_DPC_PROTOCOL *This
96 );
97
98 //
99 // DPC Protocol structure
100 //
101 typedef struct _EFI_DPC_PROTOCOL {
102 EFI_DPC_QUEUE_DPC QueueDpc;
103 EFI_DPC_DISPATCH_DPC DispatchDpc;
104 };
105
106 //
107 // DPC Protocol GUID variable
108 //
109 extern EFI_GUID gEfiDpcProtocolGuid;
110
111 #endif