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