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