]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Framework/PeiCis.h
to fill the gap between Framework and code to fix the bug #202405, #202419, #202418...
[mirror_edk2.git] / IntelFrameworkPkg / Include / Framework / PeiCis.h
1 /** @file
2 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 - 2009, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. 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 <PiPei.h>
20 #include <Ppi/PciCfg.h>
21 //
22 // Framework PEI Specification Revision information
23 //
24 #define FRAMEWORK_PEI_SPECIFICATION_MAJOR_REVISION 0
25 #define FRAMEWORK_PEI_SPECIFICATION_MINOR_REVISION 91
26
27 ///
28 /// Inconsistent with specification here:
29 /// In Framework Spec, PeiCis0.91, FRAMEWORK_PEI_SERVICES_SIGNATURE is defined as 0x5652455320494550. But
30 /// to pass multiple tool chain, it is append a ULL.
31 ///
32 //
33 // PEI services signature and Revision defined in Framework PEI spec
34 //
35 #define FRAMEWORK_PEI_SERVICES_SIGNATURE 0x5652455320494550ULL
36 #define FRAMEWORK_PEI_SERVICES_REVISION ((FRAMEWORK_PEI_SPECIFICATION_MAJOR_REVISION<<16) | (FRAMEWORK_PEI_SPECIFICATION_MINOR_REVISION))
37
38
39
40 typedef struct _FRAMEWORK_EFI_PEI_SERVICES FRAMEWORK_EFI_PEI_SERVICES;
41
42 /**
43 The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI
44 Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header.
45
46 @param FfsHeader Pointer to the FFS file header.
47 @param PeiServices Describes the list of possible PEI Services.
48
49 @return Status code
50
51 **/
52 typedef
53 EFI_STATUS
54 (EFIAPI *EFI_PEIM_ENTRY_POINT)(
55 IN EFI_FFS_FILE_HEADER *FfsHeader,
56 IN EFI_PEI_SERVICES **PeiServices
57 );
58
59 /**
60 The purpose of the service is to abstract the capability of the PEI
61 Foundation to discover instances of firmware volumes in the system.
62 Given the input file pointer, this service searches for the next
63 matching file in the Firmware File System (FFS) volume.
64
65 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
66 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware Volume (BFV).
67 @param FwVolHeader Pointer to the firmware volume header of the volume to return.
68
69 @retval EFI_SUCCESS The volume was found.
70 @retval EFI_NOT_FOUND The volume was not found.
71 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL
72
73 **/
74 typedef
75 EFI_STATUS
76 (EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME)(
77 IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
78 IN UINTN Instance,
79 IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
80 );
81
82 /**
83 The purpose of the service is to abstract the capability of the PEI
84 Foundation to discover instances of firmware files in the system.
85 Given the input file pointer, this service searches for the next matching
86 file in the Firmware File System (FFS) volume.
87
88 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
89 @param SearchType A filter to find files only of this type.
90 @param FwVolHeader Pointer to the firmware volume header of the volume to search.This parameter
91 must point to a valid FFS volume.
92 @param FileHeader Pointer to the current file from which to begin searching.This pointer will be
93 updated upon return to reflect the file found.
94
95 @retval EFI_SUCCESS The file was found.
96 @retval EFI_NOT_FOUND The file was not found.
97 @retval EFI_NOT_FOUND The header checksum was not zero.
98
99 **/
100 typedef
101 EFI_STATUS
102 (EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE)(
103 IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
104 IN EFI_FV_FILETYPE SearchType,
105 IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
106 IN OUT EFI_FFS_FILE_HEADER **FileHeader
107 );
108
109 /**
110 Given the input file pointer, this service searches for the next
111 matching file in the Firmware File System (FFS) volume.
112
113 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
114 @param SectionType The value of the section type to find.
115 @param FfsFileHeader A pointer to the file header that contains the set of sections to be searched.
116 @param SectionData A pointer to the discovered section, if successful.
117
118 @retval EFI_SUCCESS The section was found.
119 @retval EFI_NOT_FOUND The section was not found.
120
121 **/
122 typedef
123 EFI_STATUS
124 (EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA)(
125 IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
126 IN EFI_SECTION_TYPE SectionType,
127 IN EFI_FFS_FILE_HEADER *FfsFileHeader,
128 IN OUT VOID **SectionData
129 );
130
131 ///
132 /// FRAMEWORK_EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI
133 /// Foundation. The table is located in the temporary or permanent memory, depending upon the capabilities
134 /// and phase of execution of PEI.
135 ///
136 /// These services fall into various classes, including the following:
137 /// - Managing the boot mode
138 /// - Allocating both early and permanent memory
139 /// - Supporting the Firmware File System (FFS)
140 /// - Abstracting the PPI database abstraction
141 /// - Creating Hand-Off Blocks (HOBs)
142 ///
143 struct _FRAMEWORK_EFI_PEI_SERVICES {
144 EFI_TABLE_HEADER Hdr;
145 //
146 // PPI Functions
147 //
148 EFI_PEI_INSTALL_PPI InstallPpi;
149 EFI_PEI_REINSTALL_PPI ReInstallPpi;
150 EFI_PEI_LOCATE_PPI LocatePpi;
151 EFI_PEI_NOTIFY_PPI NotifyPpi;
152 //
153 // Boot Mode Functions
154 //
155 EFI_PEI_GET_BOOT_MODE GetBootMode;
156 EFI_PEI_SET_BOOT_MODE SetBootMode;
157 //
158 // HOB Functions
159 //
160 EFI_PEI_GET_HOB_LIST GetHobList;
161 EFI_PEI_CREATE_HOB CreateHob;
162 //
163 // Firmware Volume Functions
164 //
165 EFI_PEI_FFS_FIND_NEXT_VOLUME FfsFindNextVolume;
166 EFI_PEI_FFS_FIND_NEXT_FILE FfsFindNextFile;
167 EFI_PEI_FFS_FIND_SECTION_DATA FfsFindSectionData;
168 //
169 // PEI Memory Functions
170 //
171 EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;
172 EFI_PEI_ALLOCATE_PAGES AllocatePages;
173 EFI_PEI_ALLOCATE_POOL AllocatePool;
174 EFI_PEI_COPY_MEM CopyMem;
175 EFI_PEI_SET_MEM SetMem;
176 //
177 // (the following interfaces are installed by publishing PEIM)
178 // Status Code
179 //
180 EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;
181 //
182 // Reset
183 //
184 EFI_PEI_RESET_SYSTEM ResetSystem;
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 Framework Spec 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