]>
Commit | Line | Data |
---|---|---|
3c859dfe RN |
1 | /**@file\r |
2 | \r | |
7bee2498 | 3 | Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>\r |
bb78cfbe | 4 | (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r |
e3ba31da | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
3c859dfe RN |
6 | \r |
7 | \r | |
8 | Module Name:\r | |
9 | WinHost.h\r | |
10 | \r | |
11 | Abstract:\r | |
12 | Include file for Windows Host\r | |
13 | \r | |
14 | **/\r | |
a550d468 | 15 | \r |
3c859dfe RN |
16 | #ifndef _HOST_H_\r |
17 | #define _HOST_H_\r | |
18 | \r | |
19 | #include <stdio.h>\r | |
20 | #include <time.h>\r | |
21 | #include "WinInclude.h"\r | |
22 | \r | |
23 | #include <PiPei.h>\r | |
24 | #include <IndustryStandard/PeImage.h>\r | |
56502bf1 RN |
25 | #include <Guid/FileInfo.h>\r |
26 | #include <Guid/FileSystemInfo.h>\r | |
27 | #include <Guid/FileSystemVolumeLabelInfo.h>\r | |
3c859dfe | 28 | #include <Ppi/EmuThunk.h>\r |
7bee2498 | 29 | #include <Ppi/Reset2.h>\r |
3c859dfe | 30 | #include <Protocol/EmuThunk.h>\r |
56502bf1 | 31 | #include <Protocol/SimpleFileSystem.h>\r |
3c859dfe | 32 | \r |
8f819697 RN |
33 | #include <Protocol/EmuBlockIo.h>\r |
34 | #include <Protocol/BlockIo.h>\r | |
bb78cfbe | 35 | #include <Protocol/EmuSnp.h>\r |
3c859dfe RN |
36 | \r |
37 | #include <Library/BaseLib.h>\r | |
38 | #include <Library/PeCoffLib.h>\r | |
39 | #include <Library/DebugLib.h>\r | |
40 | #include <Library/MemoryAllocationLib.h>\r | |
41 | #include <Library/ThunkPpiList.h>\r | |
42 | #include <Library/ThunkProtocolList.h>\r | |
43 | #include <Library/PcdLib.h>\r | |
44 | #include <Library/PrintLib.h>\r | |
45 | #include <Library/BaseMemoryLib.h>\r | |
46 | #include <Library/PeiServicesLib.h>\r | |
47 | #include <Library/PeCoffExtraActionLib.h>\r | |
bb78cfbe | 48 | #include <Library/NetLib.h>\r |
3c859dfe | 49 | \r |
a550d468 | 50 | #define TEMPORARY_RAM_SIZE 0x20000\r |
3c859dfe RN |
51 | \r |
52 | typedef struct {\r | |
a550d468 MK |
53 | VOID *Address;\r |
54 | UINTN Size;\r | |
3c859dfe RN |
55 | } NT_FD_INFO;\r |
56 | \r | |
57 | typedef struct {\r | |
a550d468 MK |
58 | EFI_PHYSICAL_ADDRESS Memory;\r |
59 | UINT64 Size;\r | |
3c859dfe RN |
60 | } NT_SYSTEM_MEMORY;\r |
61 | \r | |
62 | RETURN_STATUS\r | |
63 | EFIAPI\r | |
64 | SecPeCoffGetEntryPoint (\r | |
65 | IN VOID *Pe32Data,\r | |
66 | IN OUT VOID **EntryPoint\r | |
a550d468 | 67 | );\r |
3c859dfe RN |
68 | \r |
69 | VOID\r | |
70 | SecLoadSecCore (\r | |
a550d468 MK |
71 | IN UINTN TemporaryRam,\r |
72 | IN UINTN TemporaryRamSize,\r | |
73 | IN VOID *BootFirmwareVolumeBase,\r | |
74 | IN UINTN BootFirmwareVolumeSize,\r | |
75 | IN VOID *SecCorePe32File\r | |
76 | )\r | |
77 | \r | |
3c859dfe RN |
78 | /*++\r |
79 | \r | |
80 | Routine Description:\r | |
81 | This is the service to load the SEC Core from the Firmware Volume\r | |
82 | \r | |
83 | Arguments:\r | |
84 | TemporaryRam - Memory to use for SEC.\r | |
85 | TemporaryRamSize - Size of Memory to use for SEC\r | |
86 | BootFirmwareVolumeBase - Start of the Boot FV\r | |
87 | SecCorePe32File - SEC Core PE32\r | |
88 | \r | |
89 | Returns:\r | |
3d6b7fd3 | 90 | Success means control is transferred and thus we should never return\r |
3c859dfe RN |
91 | \r |
92 | --*/\r | |
93 | ;\r | |
94 | \r | |
95 | EFI_STATUS\r | |
96 | EFIAPI\r | |
97 | SecWinNtFdAddress (\r | |
98 | IN UINTN Index,\r | |
99 | IN OUT EFI_PHYSICAL_ADDRESS *FdBase,\r | |
100 | IN OUT UINT64 *FdSize\r | |
101 | )\r | |
a550d468 | 102 | \r |
3c859dfe RN |
103 | /*++\r |
104 | \r | |
105 | Routine Description:\r | |
106 | \r | |
107 | TODO: Add function description\r | |
108 | \r | |
109 | Arguments:\r | |
110 | \r | |
111 | Index - TODO: add argument description\r | |
112 | FdBase - TODO: add argument description\r | |
113 | FdSize - TODO: add argument description\r | |
114 | \r | |
115 | Returns:\r | |
116 | \r | |
117 | TODO: add return values\r | |
118 | \r | |
119 | --*/\r | |
120 | ;\r | |
121 | \r | |
3c859dfe RN |
122 | EFI_STATUS\r |
123 | EFIAPI\r | |
124 | SecImageRead (\r | |
a550d468 MK |
125 | IN VOID *FileHandle,\r |
126 | IN UINTN FileOffset,\r | |
127 | IN OUT UINTN *ReadSize,\r | |
128 | OUT VOID *Buffer\r | |
3c859dfe | 129 | )\r |
a550d468 | 130 | \r |
3c859dfe RN |
131 | /*++\r |
132 | \r | |
133 | Routine Description:\r | |
134 | \r | |
135 | TODO: Add function description\r | |
136 | \r | |
137 | Arguments:\r | |
138 | \r | |
139 | FileHandle - TODO: add argument description\r | |
140 | FileOffset - TODO: add argument description\r | |
141 | ReadSize - TODO: add argument description\r | |
142 | Buffer - TODO: add argument description\r | |
143 | \r | |
144 | Returns:\r | |
145 | \r | |
146 | TODO: add return values\r | |
147 | \r | |
148 | --*/\r | |
149 | ;\r | |
150 | \r | |
151 | CHAR16 *\r | |
152 | AsciiToUnicode (\r | |
a550d468 MK |
153 | IN CHAR8 *Ascii,\r |
154 | IN UINTN *StrLen OPTIONAL\r | |
3c859dfe | 155 | )\r |
a550d468 | 156 | \r |
3c859dfe RN |
157 | /*++\r |
158 | \r | |
159 | Routine Description:\r | |
160 | \r | |
161 | TODO: Add function description\r | |
162 | \r | |
163 | Arguments:\r | |
164 | \r | |
165 | Ascii - TODO: add argument description\r | |
166 | StrLen - TODO: add argument description\r | |
167 | \r | |
168 | Returns:\r | |
169 | \r | |
170 | TODO: add return values\r | |
171 | \r | |
172 | --*/\r | |
173 | ;\r | |
174 | \r | |
175 | UINTN\r | |
176 | CountSeparatorsInString (\r | |
a550d468 MK |
177 | IN CONST CHAR16 *String,\r |
178 | IN CHAR16 Separator\r | |
3c859dfe | 179 | )\r |
a550d468 | 180 | \r |
3c859dfe RN |
181 | /*++\r |
182 | \r | |
183 | Routine Description:\r | |
184 | \r | |
185 | TODO: Add function description\r | |
186 | \r | |
187 | Arguments:\r | |
188 | \r | |
189 | String - TODO: add argument description\r | |
190 | Separator - TODO: add argument description\r | |
191 | \r | |
192 | Returns:\r | |
193 | \r | |
194 | TODO: add return values\r | |
195 | \r | |
196 | --*/\r | |
197 | ;\r | |
198 | \r | |
199 | BOOLEAN\r | |
200 | EfiSystemMemoryRange (\r | |
a550d468 | 201 | IN VOID *MemoryAddress\r |
3c859dfe | 202 | );\r |
a550d468 | 203 | \r |
3c859dfe RN |
204 | VOID\r |
205 | SecInitializeThunk (\r | |
206 | VOID\r | |
a550d468 MK |
207 | );\r |
208 | \r | |
209 | extern EMU_THUNK_PROTOCOL gEmuThunkProtocol;\r | |
210 | extern EMU_IO_THUNK_PROTOCOL mWinNtWndThunkIo;\r | |
211 | extern EMU_IO_THUNK_PROTOCOL mWinNtFileSystemThunkIo;\r | |
212 | extern EMU_IO_THUNK_PROTOCOL mWinNtBlockIoThunkIo;\r | |
213 | extern EMU_IO_THUNK_PROTOCOL mWinNtSnpThunkIo;\r | |
bb78cfbe | 214 | \r |
79e4f2a5 | 215 | #endif\r |