]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Framework/PeiCis.h
bcaf54e9e9066266d256afff856fc28c11b1cb96
[mirror_edk2.git] / IntelFrameworkPkg / Include / Framework / PeiCis.h
1 /** @file
2 PI PEI master include file. This file should match the PI spec.
3
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 @par Revision Reference:
14 Version 1.0.
15
16 **/
17
18 #ifndef __PEICIS_H__
19 #define __PEICIS_H__
20
21 #include <PiPei.h>
22 #include <Ppi/PciCfg.h>
23
24 typedef struct _FRAMEWORK_EFI_PEI_SERVICES FRAMEWORK_EFI_PEI_SERVICES;
25
26 /**
27 The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI
28 Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header.
29
30 @param FfsHeader Pointer to the FFS file header.
31 @param PeiServices Describes the list of possible PEI Services.
32
33 @return Status code
34
35 **/
36 typedef
37 EFI_STATUS
38 (EFIAPI *EFI_PEIM_ENTRY_POINT)(
39 IN EFI_FFS_FILE_HEADER *FfsHeader,
40 IN EFI_PEI_SERVICES **PeiServices
41 );
42
43 /**
44 The purpose of the service is to abstract the capability of the PEI
45 Foundation to discover instances of firmware volumes in the system.
46 Given the input file pointer, this service searches for the next
47 matching file in the Firmware File System (FFS) volume.
48
49 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
50 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware Volume (BFV).
51 @param FwVolHeader Pointer to the firmware volume header of the volume to return.
52
53 @retval EFI_SUCCESS The volume was found.
54 @retval EFI_NOT_FOUND The volume was not found.
55 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL
56
57 **/
58 typedef
59 EFI_STATUS
60 (EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME)(
61 IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
62 IN UINTN Instance,
63 IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
64 );
65
66 /**
67 The purpose of the service is to abstract the capability of the PEI
68 Foundation to discover instances of firmware files in the system.
69 Given the input file pointer, this service searches for the next matching
70 file in the Firmware File System (FFS) volume.
71
72 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
73 @param SearchType A filter to find files only of this type.
74 @param FwVolHeader Pointer to the firmware volume header of the volume to search.This parameter
75 must point to a valid FFS volume.
76 @param FileHeader Pointer to the current file from which to begin searching.This pointer will be
77 updated upon return to reflect the file found.
78
79 @retval EFI_SUCCESS The file was found.
80 @retval EFI_NOT_FOUND The file was not found.
81 @retval EFI_NOT_FOUND The header checksum was not zero.
82
83 **/
84 typedef
85 EFI_STATUS
86 (EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE)(
87 IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
88 IN EFI_FV_FILETYPE SearchType,
89 IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
90 IN OUT EFI_FFS_FILE_HEADER **FileHeader
91 );
92
93 /**
94 Given the input file pointer, this service searches for the next
95 matching file in the Firmware File System (FFS) volume.
96
97 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
98 @param SectionType The value of the section type to find.
99 @param FfsFileHeader A pointer to the file header that contains the set of sections to be searched.
100 @param SectionData A pointer to the discovered section, if successful.
101
102 @retval EFI_SUCCESS The section was found.
103 @retval EFI_NOT_FOUND The section was not found.
104
105 **/
106 typedef
107 EFI_STATUS
108 (EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA)(
109 IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
110 IN EFI_SECTION_TYPE SectionType,
111 IN EFI_FFS_FILE_HEADER *FfsFileHeader,
112 IN OUT VOID **SectionData
113 );
114
115 struct _FRAMEWORK_EFI_PEI_SERVICES {
116 EFI_TABLE_HEADER Hdr;
117 //
118 // PPI Functions
119 //
120 EFI_PEI_INSTALL_PPI InstallPpi;
121 EFI_PEI_REINSTALL_PPI ReInstallPpi;
122 EFI_PEI_LOCATE_PPI LocatePpi;
123 EFI_PEI_NOTIFY_PPI NotifyPpi;
124 //
125 // Boot Mode Functions
126 //
127 EFI_PEI_GET_BOOT_MODE GetBootMode;
128 EFI_PEI_SET_BOOT_MODE SetBootMode;
129 //
130 // HOB Functions
131 //
132 EFI_PEI_GET_HOB_LIST GetHobList;
133 EFI_PEI_CREATE_HOB CreateHob;
134 //
135 // Firmware Volume Functions
136 //
137 EFI_PEI_FFS_FIND_NEXT_VOLUME FfsFindNextVolume;
138 EFI_PEI_FFS_FIND_NEXT_FILE FfsFindNextFile;
139 EFI_PEI_FFS_FIND_SECTION_DATA FfsFindSectionData;
140 //
141 // PEI Memory Functions
142 //
143 EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;
144 EFI_PEI_ALLOCATE_PAGES AllocatePages;
145 EFI_PEI_ALLOCATE_POOL AllocatePool;
146 EFI_PEI_COPY_MEM CopyMem;
147 EFI_PEI_SET_MEM SetMem;
148 //
149 // Status Code
150 //
151 EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;
152 //
153 // Reset
154 //
155 EFI_PEI_RESET_SYSTEM ResetSystem;
156 //
157 // (the following interfaces are installed by publishing PEIM)
158 //
159 // I/O Abstractions
160 //
161 EFI_PEI_CPU_IO_PPI *CpuIo;
162 EFI_PEI_PCI_CFG_PPI *PciCfg;
163 };
164
165 typedef struct {
166 UINTN BootFirmwareVolume;
167 UINTN SizeOfCacheAsRam;
168 EFI_PEI_PPI_DESCRIPTOR *DispatchTable;
169 } EFI_PEI_STARTUP_DESCRIPTOR;
170
171 #endif
172