]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/DeviceRecoveryModule.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Ppi / DeviceRecoveryModule.h
1 /** @file
2 This file declares the Device Recovery Module PPI.
3
4 The interface of this PPI does the following:
5 - Reports the number of recovery DXE capsules that exist on the associated device(s)
6 - Finds the requested firmware binary capsule
7 - Loads that capsule into memory
8
9 A device can be either a group of devices, such as a block device, or an individual device.
10 The module determines the internal search order, with capsule number 1 as the highest load
11 priority and number N as the lowest priority.
12
13 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
14 SPDX-License-Identifier: BSD-2-Clause-Patent
15
16 @par Revision Reference:
17 This PPI is defined in UEFI Platform Initialization Specification 1.2 Volume 1:
18 Pre-EFI Initialization Core Interface
19
20 **/
21
22 #ifndef _PEI_DEVICE_RECOVERY_MODULE_PPI_H_
23 #define _PEI_DEVICE_RECOVERY_MODULE_PPI_H_
24
25 #define EFI_PEI_DEVICE_RECOVERY_MODULE_PPI_GUID \
26 { \
27 0x0DE2CE25, 0x446A, 0x45a7, {0xBF, 0xC9, 0x37, 0xDA, 0x26, 0x34, 0x4B, 0x37 } \
28 }
29
30 typedef struct _EFI_PEI_DEVICE_RECOVERY_MODULE_PPI EFI_PEI_DEVICE_RECOVERY_MODULE_PPI;
31
32 /**
33 Returns the number of DXE capsules residing on the device.
34
35 This function searches for DXE capsules from the associated device and returns
36 the number and maximum size in bytes of the capsules discovered. Entry 1 is
37 assumed to be the highest load priority and entry N is assumed to be the lowest
38 priority.
39
40 @param[in] PeiServices General-purpose services that are available
41 to every PEIM
42 @param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI
43 instance.
44 @param[out] NumberRecoveryCapsules Pointer to a caller-allocated UINTN. On
45 output, *NumberRecoveryCapsules contains
46 the number of recovery capsule images
47 available for retrieval from this PEIM
48 instance.
49
50 @retval EFI_SUCCESS One or more capsules were discovered.
51 @retval EFI_DEVICE_ERROR A device error occurred.
52 @retval EFI_NOT_FOUND A recovery DXE capsule cannot be found.
53
54 **/
55 typedef
56 EFI_STATUS
57 (EFIAPI *EFI_PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE)(
58 IN EFI_PEI_SERVICES **PeiServices,
59 IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
60 OUT UINTN *NumberRecoveryCapsules
61 );
62
63 /**
64 Returns the size and type of the requested recovery capsule.
65
66 This function gets the size and type of the capsule specified by CapsuleInstance.
67
68 @param[in] PeiServices General-purpose services that are available to every PEIM
69 @param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI
70 instance.
71 @param[in] CapsuleInstance Specifies for which capsule instance to retrieve
72 the information. This parameter must be between
73 one and the value returned by GetNumberRecoveryCapsules()
74 in NumberRecoveryCapsules.
75 @param[out] Size A pointer to a caller-allocated UINTN in which
76 the size of the requested recovery module is
77 returned.
78 @param[out] CapsuleType A pointer to a caller-allocated EFI_GUID in which
79 the type of the requested recovery capsule is
80 returned. The semantic meaning of the value
81 returned is defined by the implementation.
82
83 @retval EFI_SUCCESS One or more capsules were discovered.
84 @retval EFI_DEVICE_ERROR A device error occurred.
85 @retval EFI_NOT_FOUND A recovery DXE capsule cannot be found.
86
87 **/
88 typedef
89 EFI_STATUS
90 (EFIAPI *EFI_PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO)(
91 IN EFI_PEI_SERVICES **PeiServices,
92 IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
93 IN UINTN CapsuleInstance,
94 OUT UINTN *Size,
95 OUT EFI_GUID *CapsuleType
96 );
97
98 /**
99 Loads a DXE capsule from some media into memory.
100
101 This function, by whatever mechanism, retrieves a DXE capsule from some device
102 and loads it into memory. Note that the published interface is device neutral.
103
104 @param[in] PeiServices General-purpose services that are available
105 to every PEIM
106 @param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI
107 instance.
108 @param[in] CapsuleInstance Specifies which capsule instance to retrieve.
109 @param[out] Buffer Specifies a caller-allocated buffer in which
110 the requested recovery capsule will be returned.
111
112 @retval EFI_SUCCESS The capsule was loaded correctly.
113 @retval EFI_DEVICE_ERROR A device error occurred.
114 @retval EFI_NOT_FOUND A requested recovery DXE capsule cannot be found.
115
116 **/
117 typedef
118 EFI_STATUS
119 (EFIAPI *EFI_PEI_DEVICE_LOAD_RECOVERY_CAPSULE)(
120 IN EFI_PEI_SERVICES **PeiServices,
121 IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
122 IN UINTN CapsuleInstance,
123 OUT VOID *Buffer
124 );
125
126 ///
127 /// Presents a standard interface to EFI_PEI_DEVICE_RECOVERY_MODULE_PPI,
128 /// regardless of the underlying device(s).
129 ///
130 struct _EFI_PEI_DEVICE_RECOVERY_MODULE_PPI {
131 EFI_PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE GetNumberRecoveryCapsules; ///< Returns the number of DXE capsules residing on the device.
132 EFI_PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO GetRecoveryCapsuleInfo; ///< Returns the size and type of the requested recovery capsule.
133 EFI_PEI_DEVICE_LOAD_RECOVERY_CAPSULE LoadRecoveryCapsule; ///< Loads a DXE capsule from some media into memory.
134 };
135
136 extern EFI_GUID gEfiPeiDeviceRecoveryModulePpiGuid;
137
138 #endif /* _PEI_DEVICE_RECOVERY_MODULE_PPI_H_ */