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