]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/Dpc.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / Dpc.h
1 /** @file
2
3 EFI Deferred Procedure Call Protocol.
4
5 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10
11 #ifndef __DPC_H__
12 #define __DPC_H__
13
14 //
15 // DPC Protocol GUID value
16 //
17 #define EFI_DPC_PROTOCOL_GUID \
18 { \
19 0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6 } \
20 }
21
22 //
23 // Forward reference for pure ANSI compatability
24 //
25 typedef struct _EFI_DPC_PROTOCOL EFI_DPC_PROTOCOL;
26
27
28 /**
29 Invoke a Deferred Procedure Call.
30
31 @param DpcContext The pointer to the Deferred Procedure Call's context,
32 which is implementation dependent.
33
34 **/
35 typedef
36 VOID
37 (EFIAPI *EFI_DPC_PROCEDURE)(
38 IN VOID *DpcContext
39 );
40
41 /**
42 Add a Deferred Procedure Call to the end of the DPC queue.
43
44 @param This The protocol instance pointer.
45 @param DpcTpl The EFI_TPL that the DPC should invoke.
46 @param DpcProcedure The pointer to the DPC's function.
47 @param DpcContext The pointer to the DPC's context. Passed to DpcProcedure
48 when DpcProcedure is invoked.
49
50 @retval EFI_SUCCESS The DPC was queued.
51 @retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL.
52 @retval EFI_INVALID_PARAMETER DpcProcedure is NULL.
53 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
54 add the DPC to the queue.
55
56 **/
57 typedef
58 EFI_STATUS
59 (EFIAPI *EFI_DPC_QUEUE_DPC)(
60 IN EFI_DPC_PROTOCOL *This,
61 IN EFI_TPL DpcTpl,
62 IN EFI_DPC_PROCEDURE DpcProcedure,
63 IN VOID *DpcContext OPTIONAL
64 );
65
66 /**
67 Dispatch the queue of DPCs.
68
69 DPCs with DpcTpl value greater than the current TPL value are queued, and then DPCs
70 with DpcTpl value lower than the current TPL value are queued. All DPCs in the first
71 group (higher DpcTpl values) are invoked before DPCs in the second group (lower DpcTpl values).
72
73 @param This Protocol instance pointer.
74
75 @retval EFI_SUCCESS One or more DPCs were invoked.
76 @retval EFI_NOT_FOUND No DPCs were invoked.
77
78 **/
79 typedef
80 EFI_STATUS
81 (EFIAPI *EFI_DPC_DISPATCH_DPC)(
82 IN EFI_DPC_PROTOCOL *This
83 );
84
85 ///
86 /// DPC Protocol structure.
87 ///
88 struct _EFI_DPC_PROTOCOL {
89 EFI_DPC_QUEUE_DPC QueueDpc;
90 EFI_DPC_DISPATCH_DPC DispatchDpc;
91 };
92
93 ///
94 /// DPC Protocol GUID variable.
95 ///
96 extern EFI_GUID gEfiDpcProtocolGuid;
97
98 #endif