]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/DelayedDispatch.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Ppi / DelayedDispatch.h
1 /** @file
2 EFI Delayed Dispatch PPI as defined in the PI 1.7 Specification
3
4 Provide timed event service in PEI
5
6 Copyright (c) 2020, American Megatrends International LLC. All rights reserved.
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8 **/
9
10 #ifndef __DELAYED_DISPATCH_PPI_H__
11 #define __DELAYED_DISPATCH_PPI_H__
12
13 ///
14 /// Global ID for EFI_DELAYED_DISPATCH_PPI_GUID
15 ///
16 #define EFI_DELAYED_DISPATCH_PPI_GUID \
17 { \
18 0x869c711d, 0x649c, 0x44fe, { 0x8b, 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6} } \
19 }
20
21 /**
22 Delayed Dispatch function. This routine is called sometime after the required
23 delay. Upon return, if NewDelay is 0, the function is unregistered. If NewDelay
24 is not zero, this routine will be called again after the new delay period.
25
26 @param[in,out] Context Pointer to Context. Can be updated by routine.
27 @param[out] NewDelay The new delay in us. Leave at 0 to unregister callback.
28
29 **/
30
31 typedef
32 VOID
33 (EFIAPI *EFI_DELAYED_DISPATCH_FUNCTION)(
34 IN OUT UINT64 *Context,
35 OUT UINT32 *NewDelay
36 );
37
38 ///
39 /// The forward declaration for EFI_DELAYED_DISPATCH_PPI
40 ///
41
42 typedef struct _EFI_DELAYED_DISPATCH_PPI EFI_DELAYED_DISPATCH_PPI;
43
44 /**
45 Register a callback to be called after a minimum delay has occurred.
46
47 This service is the single member function of the EFI_DELAYED_DISPATCH_PPI
48
49 @param This Pointer to the EFI_DELAYED_DISPATCH_PPI instance
50 @param Function Function to call back
51 @param Context Context data
52 @param Delay Delay interval
53
54 @retval EFI_SUCCESS Function successfully loaded
55 @retval EFI_INVALID_PARAMETER One of the Arguments is not supported
56 @retval EFI_OUT_OF_RESOURCES No more entries
57
58 **/
59 typedef
60 EFI_STATUS
61 (EFIAPI *EFI_DELAYED_DISPATCH_REGISTER)(
62 IN EFI_DELAYED_DISPATCH_PPI *This,
63 IN EFI_DELAYED_DISPATCH_FUNCTION Function,
64 IN UINT64 Context,
65 OUT UINT32 Delay
66 );
67
68 ///
69 /// This PPI is a pointer to the Delayed Dispatch Service.
70 /// This service will be published by the Pei Foundation. The PEI Foundation
71 /// will use this service to relaunch a known function that requests a delayed
72 /// execution.
73 ///
74 struct _EFI_DELAYED_DISPATCH_PPI {
75 EFI_DELAYED_DISPATCH_REGISTER Register;
76 };
77
78 extern EFI_GUID gEfiPeiDelayedDispatchPpiGuid;
79
80 #endif