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