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 | /**
|
---|
23 | Delayed Dispatch function. This routine is called sometime after the required
|
---|
24 | delay. Upon return, if NewDelay is 0, the function is unregistered. If NewDelay
|
---|
25 | is not zero, this routine will be called again after the new delay period.
|
---|
26 |
|
---|
27 | @param[in,out] Context Pointer to Context. Can be updated by routine.
|
---|
28 | @param[out] NewDelay The new delay in us. Leave at 0 to unregister callback.
|
---|
29 |
|
---|
30 | **/
|
---|
31 |
|
---|
32 | typedef
|
---|
33 | VOID
|
---|
34 | (EFIAPI *EFI_DELAYED_DISPATCH_FUNCTION) (
|
---|
35 | IN OUT UINT64 *Context,
|
---|
36 | OUT UINT32 *NewDelay
|
---|
37 | );
|
---|
38 |
|
---|
39 |
|
---|
40 | ///
|
---|
41 | /// The forward declaration for EFI_DELAYED_DISPATCH_PPI
|
---|
42 | ///
|
---|
43 |
|
---|
44 | typedef struct _EFI_DELAYED_DISPATCH_PPI EFI_DELAYED_DISPATCH_PPI;
|
---|
45 |
|
---|
46 |
|
---|
47 | /**
|
---|
48 | Register a callback to be called after a minimum delay has occurred.
|
---|
49 |
|
---|
50 | This service is the single member function of the EFI_DELAYED_DISPATCH_PPI
|
---|
51 |
|
---|
52 | @param This Pointer to the EFI_DELAYED_DISPATCH_PPI instance
|
---|
53 | @param Function Function to call back
|
---|
54 | @param Context Context data
|
---|
55 | @param Delay Delay interval
|
---|
56 |
|
---|
57 | @retval EFI_SUCCESS Function successfully loaded
|
---|
58 | @retval EFI_INVALID_PARAMETER One of the Arguments is not supported
|
---|
59 | @retval EFI_OUT_OF_RESOURCES No more entries
|
---|
60 |
|
---|
61 | **/
|
---|
62 | typedef
|
---|
63 | EFI_STATUS
|
---|
64 | (EFIAPI *EFI_DELAYED_DISPATCH_REGISTER)(
|
---|
65 | IN EFI_DELAYED_DISPATCH_PPI *This,
|
---|
66 | IN EFI_DELAYED_DISPATCH_FUNCTION Function,
|
---|
67 | IN UINT64 Context,
|
---|
68 | OUT UINT32 Delay
|
---|
69 | );
|
---|
70 |
|
---|
71 |
|
---|
72 | ///
|
---|
73 | /// This PPI is a pointer to the Delayed Dispatch Service.
|
---|
74 | /// This service will be published by the Pei Foundation. The PEI Foundation
|
---|
75 | /// will use this service to relaunch a known function that requests a delayed
|
---|
76 | /// execution.
|
---|
77 | ///
|
---|
78 | struct _EFI_DELAYED_DISPATCH_PPI {
|
---|
79 | EFI_DELAYED_DISPATCH_REGISTER Register;
|
---|
80 | };
|
---|
81 |
|
---|
82 |
|
---|
83 | extern EFI_GUID gEfiPeiDelayedDispatchPpiGuid;
|
---|
84 |
|
---|
85 | #endif
|
---|