1 /*++
2 
3 Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
4 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 _EFIDPC_H
26 #define _EFIDPC_H
27 
28 //
29 // DPC Protocol GUID value
30 //
31 #define EFI_DPC_PROTOCOL_GUID \
32     { 0x480f8ae9, 0xc46, 0x4aa9, {0xbc, 0x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6} }
33 
34 //
35 // Forward reference for pure ANSI compatability
36 //
37 typedef struct _EFI_DPC_PROTOCOL  EFI_DPC_PROTOCOL;
38 
39 
40 /**
41   Invoke a Deferred Procedure Call.
42 
43   @param  DpcContext           Pointer to the Deferred Procedure Call's context,
44                                which is implementation dependent.
45 
46 **/
47 typedef
48 VOID
49 (EFIAPI *EFI_DPC_PROCEDURE) (
50   IN VOID  *DpcContext
51   );
52 
53 /**
54   Add a Deferred Procedure Call to the end of the DPC queue.
55 
56   @param  This          Protocol instance pointer.
57   @param  DpcTpl        The EFI_TPL that the DPC should be invoked.
58   @param  DpcProcedure  Pointer to the DPC's function.
59   @param  DpcContext    Pointer to the DPC's context.  Passed to DpcProcedure
60                         when DpcProcedure is invoked.
61 
62   @retval EFI_SUCCESS            The DPC was queued.
63   @retval EFI_INVALID_PARAMETER  DpcTpl is not a valid EFI_TPL.
64   @retval EFI_INVALID_PARAMETER  DpcProcedure is NULL.
65   @retval EFI_OUT_OF_RESOURCES   There are not enough resources available to
66                                  add the DPC to the queue.
67 
68 **/
69 typedef
70 EFI_STATUS
71 (EFIAPI *EFI_DPC_QUEUE_DPC) (
72   IN EFI_DPC_PROTOCOL   *This,
73   IN EFI_TPL            DpcTpl,
74   IN EFI_DPC_PROCEDURE  DpcProcedure,
75   IN VOID               *DpcContext    OPTIONAL
76   );
77 
78 /**
79   Dispatch the queue of DPCs.  ALL DPCs that have been queued with a DpcTpl
80   value greater than or equal to the current TPL are invoked in the order that
81   they were queued.  DPCs with higher DpcTpl values are invoked before DPCs with
82   lower DpcTpl values.
83 
84   @param  This  Protocol instance pointer.
85 
86   @retval EFI_SUCCESS    One or more DPCs were invoked.
87   @retval EFI_NOT_FOUND  No DPCs were invoked.
88 
89 **/
90 typedef
91 EFI_STATUS
92 (EFIAPI *EFI_DPC_DISPATCH_DPC) (
93   IN EFI_DPC_PROTOCOL  *This
94   );
95 
96 //
97 // DPC Protocol structure
98 //
99 struct _EFI_DPC_PROTOCOL {
100   EFI_DPC_QUEUE_DPC     QueueDpc;
101   EFI_DPC_DISPATCH_DPC  DispatchDpc;
102 };
103 
104 //
105 // DPC Protocol GUID variable
106 //
107 extern EFI_GUID gEfiDpcProtocolGuid;
108 
109 #endif /* _EFIDPC_H */
110