Enhance DxeIpl module to support EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE ffs type,...
[mirror_edk2.git] / EdkModulePkg / Core / DxeIplX64Peim / DxeIpl.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 DxeIpl.h
15
16 Abstract:
17
18 --*/
19
20 #ifndef __PEI_DXEIPL_H__
21 #define __PEI_DXEIPL_H__
22
23 #define STACK_SIZE 0x20000
24 #define BSP_STORE_SIZE 0x4000
25
26 extern BOOLEAN gInMemory;
27
28 VOID
29 SwitchIplStacks (
30 VOID *EntryPoint,
31 UINTN Parameter1,
32 UINTN Parameter2,
33 VOID *NewStack,
34 VOID *NewBsp
35 )
36 ;
37
38 EFI_STATUS
39 PeiFindFile (
40 IN UINT8 Type,
41 IN UINT16 SectionType,
42 OUT EFI_GUID *FileName,
43 OUT VOID **Pe32Data
44 )
45 ;
46
47 EFI_STATUS
48 PeiLoadFile (
49 IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader,
50 IN VOID *Pe32Data,
51 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
52 OUT UINT64 *ImageSize,
53 OUT EFI_PHYSICAL_ADDRESS *EntryPoint
54 )
55 ;
56
57
58 EFI_STATUS
59 CreateArchSpecificHobs (
60 OUT EFI_PHYSICAL_ADDRESS *BspStore
61 )
62 ;
63
64 EFI_STATUS
65 GetImageReadFunction (
66 IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
67 )
68 ;
69
70 EFI_STATUS
71 PeiImageRead (
72 IN VOID *FileHandle,
73 IN UINTN FileOffset,
74 IN OUT UINTN *ReadSize,
75 OUT VOID *Buffer
76 )
77 ;
78
79 EFI_STATUS
80 EFIAPI
81 DxeIplLoadFile (
82 IN EFI_PEI_FV_FILE_LOADER_PPI *This,
83 IN EFI_FFS_FILE_HEADER *FfsHeader,
84 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
85 OUT UINT64 *ImageSize,
86 OUT EFI_PHYSICAL_ADDRESS *EntryPoint
87 );
88
89 EFI_STATUS
90 ShadowDxeIpl (
91 IN EFI_FFS_FILE_HEADER *DxeIpl,
92 IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader
93 );
94
95 EFI_STATUS
96 EFIAPI
97 DxeLoadCore (
98 IN EFI_DXE_IPL_PPI *This,
99 IN EFI_PEI_SERVICES **PeiServices,
100 IN EFI_PEI_HOB_POINTERS HobList
101 );
102
103 EFI_STATUS
104 PeiProcessFile (
105 IN UINT16 SectionType,
106 IN EFI_FFS_FILE_HEADER *FfsFileHeader,
107 OUT VOID **Pe32Data,
108 IN EFI_PEI_HOB_POINTERS *OrigHob
109 );
110
111 EFI_STATUS
112 EFIAPI
113 PeimInitializeDxeIpl (
114 IN EFI_FFS_FILE_HEADER *FfsHeader,
115 IN EFI_PEI_SERVICES **PeiServices
116 );
117
118 EFI_STATUS
119 PeiLoadPeImage (
120 IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeiEfiPeiPeCoffLoader,
121 IN VOID *Pe32Data,
122 IN EFI_MEMORY_TYPE MemoryType,
123 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
124 OUT UINT64 *ImageSize,
125 OUT EFI_PHYSICAL_ADDRESS *EntryPoint
126 )
127 ;
128
129 EFI_PHYSICAL_ADDRESS
130 CreateIdentityMappingPageTables (
131 IN UINT32 NumberOfProcessorPhysicalAddressBits
132 )
133 ;
134
135 VOID
136 ActivateLongMode (
137 IN EFI_PHYSICAL_ADDRESS PageTables,
138 IN EFI_PHYSICAL_ADDRESS HobStart,
139 IN EFI_PHYSICAL_ADDRESS Stack,
140 IN EFI_PHYSICAL_ADDRESS CodeEntryPoint1,
141 IN EFI_PHYSICAL_ADDRESS CodeEntryPoint2
142 );
143
144 VOID
145 LoadGo64Gdt();
146
147 #endif