]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Framework/PeiCis.h
8aad13a92bb32a5926ac4e409a3bdce2f69b654d
[mirror_edk2.git] / IntelFrameworkPkg / Include / Framework / PeiCis.h
1 /** @file
2 The Include file for definitions in the Intel Platform Innovation Framework for EFI
3 Pre-EFI Initialization Core Interface Specification (PEI CIS) Version 0.91.
4
5 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __PEICIS_H__
17 #define __PEICIS_H__
18
19 #include <Ppi/PciCfg.h>
20 //
21 // Framework PEI Specification Revision information
22 //
23 #define FRAMEWORK_PEI_SPECIFICATION_MAJOR_REVISION 0
24 #define FRAMEWORK_PEI_SPECIFICATION_MINOR_REVISION 91
25
26
27 //
28 // PEI services signature and Revision defined in Framework PEI spec
29 //
30 #define FRAMEWORK_PEI_SERVICES_SIGNATURE 0x5652455320494550ULL
31 #define FRAMEWORK_PEI_SERVICES_REVISION ((FRAMEWORK_PEI_SPECIFICATION_MAJOR_REVISION<<16) | (FRAMEWORK_PEI_SPECIFICATION_MINOR_REVISION))
32
33
34
35 typedef struct _FRAMEWORK_EFI_PEI_SERVICES FRAMEWORK_EFI_PEI_SERVICES;
36
37 /**
38 The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI
39 Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header.
40
41 @param FfsHeader The pointer to the FFS file header.
42 @param PeiServices Describes the list of possible PEI Services.
43
44 @return Status code
45
46 **/
47 typedef
48 EFI_STATUS
49 (EFIAPI *EFI_PEIM_ENTRY_POINT)(
50 IN EFI_FFS_FILE_HEADER *FfsHeader,
51 IN EFI_PEI_SERVICES **PeiServices
52 );
53
54 /**
55 This service abstracts the capability of the PEI
56 Foundation to discover instances of firmware volumes in the system.
57 Given the input file pointer, this service searches for the next
58 matching file in the Firmware File System (FFS) volume.
59
60 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
61 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware Volume (BFV).
62 @param FwVolHeader The pointer to the firmware volume header of the volume to return.
63
64 @retval EFI_SUCCESS The volume was found.
65 @retval EFI_NOT_FOUND The volume was not found.
66 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL
67
68 **/
69 typedef
70 EFI_STATUS
71 (EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME)(
72 IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
73 IN UINTN Instance,
74 IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
75 );
76
77 /**
78 This service abstracts the capability of the PEI
79 Foundation to discover instances of firmware files in the system.
80 Given the input file pointer, this service searches for the next matching
81 file in the Firmware File System (FFS) volume.
82
83 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
84 @param SearchType A filter to find files only of this type.
85 @param FwVolHeader The pointer to the firmware volume header of the volume to search. This parameter
86 must point to a valid FFS volume.
87 @param FileHeader The pointer to the current file from which to begin searching. Upon return this pointer will be
88 updated to reflect the file found.
89
90 @retval EFI_SUCCESS The file was found.
91 @retval EFI_NOT_FOUND The file was not found.
92 @retval EFI_NOT_FOUND The header checksum was not zero.
93
94 **/
95 typedef
96 EFI_STATUS
97 (EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE)(
98 IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
99 IN EFI_FV_FILETYPE SearchType,
100 IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
101 IN OUT EFI_FFS_FILE_HEADER **FileHeader
102 );
103
104 /**
105 Given the input file pointer, this service searches for the next
106 matching file in the Firmware File System (FFS) volume.
107
108 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
109 @param SectionType The value of the section type to find.
110 @param FfsFileHeader A pointer to the file header that contains the set of sections to be searched.
111 @param SectionData A pointer to the discovered section, if successful.
112
113 @retval EFI_SUCCESS The section was found.
114 @retval EFI_NOT_FOUND The section was not found.
115
116 **/
117 typedef
118 EFI_STATUS
119 (EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA)(
120 IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
121 IN EFI_SECTION_TYPE SectionType,
122 IN EFI_FFS_FILE_HEADER *FfsFileHeader,
123 IN OUT VOID **SectionData
124 );
125
126 ///
127 /// FRAMEWORK_EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI
128 /// Foundation. The table may be located in the temporary or permanent memory, depending upon the capabilities
129 /// and phase of execution of PEI.
130 ///
131 /// These services fall into various classes, including the following:
132 /// - Managing the boot mode.
133 /// - Allocating both early and permanent memory.
134 /// - Supporting the Firmware File System (FFS).
135 /// - Abstracting the PPI database abstraction.
136 /// - Creating Hand-Off Blocks (HOBs).
137 ///
138 struct _FRAMEWORK_EFI_PEI_SERVICES {
139 EFI_TABLE_HEADER Hdr;
140 //
141 // PPI Functions
142 //
143 EFI_PEI_INSTALL_PPI InstallPpi;
144 EFI_PEI_REINSTALL_PPI ReInstallPpi;
145 EFI_PEI_LOCATE_PPI LocatePpi;
146 EFI_PEI_NOTIFY_PPI NotifyPpi;
147 //
148 // Boot Mode Functions
149 //
150 EFI_PEI_GET_BOOT_MODE GetBootMode;
151 EFI_PEI_SET_BOOT_MODE SetBootMode;
152 //
153 // HOB Functions
154 //
155 EFI_PEI_GET_HOB_LIST GetHobList;
156 EFI_PEI_CREATE_HOB CreateHob;
157 //
158 // Firmware Volume Functions
159 //
160 EFI_PEI_FFS_FIND_NEXT_VOLUME FfsFindNextVolume;
161 EFI_PEI_FFS_FIND_NEXT_FILE FfsFindNextFile;
162 EFI_PEI_FFS_FIND_SECTION_DATA FfsFindSectionData;
163 //
164 // PEI Memory Functions
165 //
166 EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;
167 EFI_PEI_ALLOCATE_PAGES AllocatePages;
168 EFI_PEI_ALLOCATE_POOL AllocatePool;
169 EFI_PEI_COPY_MEM CopyMem;
170 EFI_PEI_SET_MEM SetMem;
171 //
172 // (the following interfaces are installed by publishing PEIM)
173 // Status Code
174 //
175 EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;
176 //
177 // Reset
178 //
179 EFI_PEI_RESET_SYSTEM ResetSystem;
180 ///
181 /// Inconsistent with specification here:
182 /// In Framework Spec, PeiCis0.91, CpuIo and PciCfg are NOT pointers.
183 ///
184
185 //
186 // I/O Abstractions
187 //
188 EFI_PEI_CPU_IO_PPI *CpuIo;
189 EFI_PEI_PCI_CFG_PPI *PciCfg;
190 };
191 ///
192 /// Enumeration of reset types defined in the Framework Specification PeiCis.
193 ///
194 typedef enum {
195 ///
196 /// Used to induce a system-wide reset. This sets all circuitry within the
197 /// system to its initial state. This type of reset is asynchronous to system
198 /// operation and operates withgout regard to cycle boundaries. EfiColdReset
199 /// is tantamount to a system power cycle.
200 ///
201 EfiPeiResetCold,
202 ///
203 /// Used to induce a system-wide initialization. The processors are set to their
204 /// initial state, and pending cycles are not corrupted. If the system does
205 /// not support this reset type, then an EfiResetCold must be performed.
206 ///
207 EfiPeiResetWarm,
208 } EFI_PEI_RESET_TYPE;
209
210 #endif
211