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