]>
Commit | Line | Data |
---|---|---|
da58b0db | 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 | |
5 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r | |
6 | \r | |
7 | This program and the accompanying materials\r | |
8 | are licensed and made available under the terms and conditions\r | |
9 | of the BSD License which accompanies this distribution. The\r | |
10 | full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef _PEI_CAPSULE_PPI_H_\r | |
19 | #define _PEI_CAPSULE_PPI_H_\r | |
20 | \r | |
21 | ///\r | |
22 | /// Global ID for the PEI_CAPSULE_PPI.\r | |
23 | ///\r | |
24 | #define PEI_CAPSULE_PPI_GUID \\r | |
25 | { \\r | |
26 | 0x3acf33ee, 0xd892, 0x40f4, {0xa2, 0xfc, 0x38, 0x54, 0xd2, 0xe1, 0x32, 0x3d } \\r | |
27 | }\r | |
28 | \r | |
29 | ///\r | |
30 | /// Forward declaration for the PEI_CAPSULE_PPI.\r | |
31 | ///\r | |
32 | typedef struct _PEI_CAPSULE_PPI PEI_CAPSULE_PPI;\r | |
33 | \r | |
34 | /**\r | |
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 | |
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 | |
42 | On output, this variable will hold the base address \r | |
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 | |
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 | |
52 | \r | |
53 | **/\r | |
54 | typedef\r | |
55 | EFI_STATUS\r | |
56 | (EFIAPI *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 | |
63 | Determine if a capsule needs to be processed. \r | |
64 | The means by which the presence of a capsule is determined is platform\r | |
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 | |
67 | entries. If present, return EFI_SUCCESS, otherwise return EFI_NOT_FOUND.\r | |
68 | \r | |
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 *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 | |
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 | |
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 | |
94 | @param[in] CapsuleBase Address returned by the capsule coalesce function. \r | |
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 *PEI_CAPSULE_CREATE_STATE)(\r | |
105 | IN EFI_PEI_SERVICES **PeiServices,\r | |
106 | IN VOID *CapsuleBase,\r | |
107 | IN UINTN CapsuleSize \r | |
108 | );\r | |
109 | \r | |
110 | ///\r | |
111 | /// This PPI provides several services in PEI to work with the underlying\r | |
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 | |
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 _PEI_CAPSULE_PPI {\r | |
118 | PEI_CAPSULE_COALESCE Coalesce;\r | |
119 | PEI_CAPSULE_CHECK_CAPSULE_UPDATE CheckCapsuleUpdate;\r | |
120 | PEI_CAPSULE_CREATE_STATE CreateState;\r | |
121 | };\r | |
122 | \r | |
123 | extern EFI_GUID gPeiCapsulePpiGuid;\r | |
124 | \r | |
125 | #endif // #ifndef _PEI_CAPSULE_PPI_H_\r |