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