]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Ppi/Capsule.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / Ppi / Capsule.h
... / ...
CommitLineData
1/** @file\r
2 Defines the APIs that enable PEI services to work with\r
3 the underlying capsule capabilities of the platform.\r
4\r
5Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials are licensed and made available under\r
7the terms and conditions of the BSD License that accompanies this distribution.\r
8The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php.\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14 @par Revision Reference:\r
15 This PPI is introduced in PI Version 1.4.\r
16\r
17**/\r
18\r
19#ifndef _PEI_CAPSULE_PPI_H_\r
20#define _PEI_CAPSULE_PPI_H_\r
21\r
22///\r
23/// Global ID for the EFI_PEI_CAPSULE_PPI.\r
24///\r
25#define EFI_PEI_CAPSULE_PPI_GUID \\r
26 { \\r
27 0x3acf33ee, 0xd892, 0x40f4, {0xa2, 0xfc, 0x38, 0x54, 0xd2, 0xe1, 0x32, 0x3d } \\r
28 }\r
29\r
30///\r
31/// Forward declaration for the EFI_PEI_CAPSULE_PPI.\r
32///\r
33typedef struct _EFI_PEI_CAPSULE_PPI EFI_PEI_CAPSULE_PPI;\r
34\r
35///\r
36/// Keep name backwards compatible before PI Version 1.4\r
37///\r
38typedef struct _EFI_PEI_CAPSULE_PPI PEI_CAPSULE_PPI;\r
39\r
40/**\r
41 Upon determining that there is a capsule to operate on, this service\r
42 will use a series of EFI_CAPSULE_BLOCK_DESCRIPTOR entries to determine\r
43 the current location of the various capsule fragments and coalesce them\r
44 into a contiguous region of system memory.\r
45\r
46 @param[in] PeiServices Pointer to the PEI Services Table.\r
47 @param[out] MemoryBase Pointer to the base of a block of memory into which the buffers will be coalesced.\r
48 On output, this variable will hold the base address\r
49 of a coalesced capsule.\r
50 @param[out] MemorySize Size of the memory region pointed to by MemoryBase.\r
51 On output, this variable will contain the size of the\r
52 coalesced capsule.\r
53\r
54 @retval EFI_NOT_FOUND If: boot modecould not be determined, or the\r
55 boot mode is not flash-update, or the capsule descriptors were not found.\r
56 @retval EFI_BUFFER_TOO_SMALL The capsule could not be coalesced in the provided memory region.\r
57 @retval EFI_SUCCESS There was no capsule, or the capsule was processed successfully.\r
58\r
59**/\r
60typedef\r
61EFI_STATUS\r
62(EFIAPI *EFI_PEI_CAPSULE_COALESCE)(\r
63 IN EFI_PEI_SERVICES **PeiServices,\r
64 IN OUT VOID **MemoryBase,\r
65 IN OUT UINTN *MemSize\r
66 );\r
67\r
68/**\r
69 Determine if a capsule needs to be processed.\r
70 The means by which the presence of a capsule is determined is platform\r
71 specific. For example, an implementation could be driven by the presence\r
72 of a Capsule EFI Variable containing a list of EFI_CAPSULE_BLOCK_DESCRIPTOR\r
73 entries. If present, return EFI_SUCCESS, otherwise return EFI_NOT_FOUND.\r
74\r
75 @param[in] PeiServices Pointer to the PEI Services Table.\r
76\r
77 @retval EFI_SUCCESS If a capsule is available.\r
78 @retval EFI_NOT_FOUND No capsule detected.\r
79\r
80**/\r
81typedef\r
82EFI_STATUS\r
83(EFIAPI *EFI_PEI_CAPSULE_CHECK_CAPSULE_UPDATE)(\r
84 IN EFI_PEI_SERVICES **PeiServices\r
85 );\r
86\r
87/**\r
88 The Capsule PPI service that gets called after memory is available. The\r
89 capsule coalesce function, which must be called first, returns a base\r
90 address and size. Once the memory init PEIM has discovered memory,\r
91 it should call this function and pass in the base address and size\r
92 returned by the Coalesce() function. Then this function can create a\r
93 capsule HOB and return.\r
94\r
95 @par Notes:\r
96 This function assumes it will not be called until the\r
97 actual capsule update.\r
98\r
99 @param[in] PeiServices Pointer to the PEI Services Table.\r
100 @param[in] CapsuleBase Address returned by the capsule coalesce function.\r
101 @param[in] CapsuleSize Value returned by the capsule coalesce function.\r
102\r
103 @retval EFI_VOLUME_CORRUPTED CapsuleBase does not appear to point to a\r
104 coalesced capsule.\r
105 @retval EFI_SUCCESS Capsule HOB was created successfully.\r
106\r
107**/\r
108typedef\r
109EFI_STATUS\r
110(EFIAPI *EFI_PEI_CAPSULE_CREATE_STATE)(\r
111 IN EFI_PEI_SERVICES **PeiServices,\r
112 IN VOID *CapsuleBase,\r
113 IN UINTN CapsuleSize\r
114 );\r
115\r
116///\r
117/// This PPI provides several services in PEI to work with the underlying\r
118/// capsule capabilities of the platform. These services include the ability\r
119/// for PEI to coalesce a capsule from a scattered set of memory locations\r
120/// into a contiguous space in memory, detect if a capsule is present for\r
121/// processing, and once memory is available, create a HOB for the capsule.\r
122///\r
123struct _EFI_PEI_CAPSULE_PPI {\r
124 EFI_PEI_CAPSULE_COALESCE Coalesce;\r
125 EFI_PEI_CAPSULE_CHECK_CAPSULE_UPDATE CheckCapsuleUpdate;\r
126 EFI_PEI_CAPSULE_CREATE_STATE CreateState;\r
127};\r
128\r
129///\r
130/// Keep name backwards compatible before PI Version 1.4\r
131///\r
132extern EFI_GUID gPeiCapsulePpiGuid;\r
133\r
134extern EFI_GUID gEfiPeiCapsulePpiGuid;\r
135\r
136#endif // #ifndef _PEI_CAPSULE_PPI_H_\r