]> git.proxmox.com Git - mirror_edk2.git/blob - EmulatorPkg/Win/Host/WinHost.h
991da1c15bd4d4eb5a14b2883504833fd5595fd8
[mirror_edk2.git] / EmulatorPkg / Win / Host / WinHost.h
1 /**@file
2
3 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
4 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
13 Module Name:
14 WinHost.h
15
16 Abstract:
17 Include file for Windows Host
18
19 **/
20 #ifndef _HOST_H_
21 #define _HOST_H_
22
23 #include <stdio.h>
24 #include <time.h>
25 #include "WinInclude.h"
26
27 #include <PiPei.h>
28 #include <IndustryStandard/PeImage.h>
29 #include <Guid/FileInfo.h>
30 #include <Guid/FileSystemInfo.h>
31 #include <Guid/FileSystemVolumeLabelInfo.h>
32 #include <Ppi/EmuThunk.h>
33 #include <Protocol/EmuThunk.h>
34 #include <Protocol/SimpleFileSystem.h>
35
36 #include <Protocol/EmuBlockIo.h>
37 #include <Protocol/BlockIo.h>
38
39 #include <Library/BaseLib.h>
40 #include <Library/PeCoffLib.h>
41 #include <Library/DebugLib.h>
42 #include <Library/MemoryAllocationLib.h>
43 #include <Library/ThunkPpiList.h>
44 #include <Library/ThunkProtocolList.h>
45 #include <Library/PcdLib.h>
46 #include <Library/PrintLib.h>
47 #include <Library/BaseMemoryLib.h>
48 #include <Library/PeiServicesLib.h>
49 #include <Library/PeCoffExtraActionLib.h>
50
51
52 #define TEMPORARY_RAM_SIZE 0x20000
53
54 typedef struct {
55 VOID *Address;
56 UINTN Size;
57 } NT_FD_INFO;
58
59 typedef struct {
60 EFI_PHYSICAL_ADDRESS Memory;
61 UINT64 Size;
62 } NT_SYSTEM_MEMORY;
63
64 RETURN_STATUS
65 EFIAPI
66 SecPeCoffGetEntryPoint (
67 IN VOID *Pe32Data,
68 IN OUT VOID **EntryPoint
69 );
70
71 VOID
72 SecLoadSecCore (
73 IN UINTN TemporaryRam,
74 IN UINTN TemporaryRamSize,
75 IN VOID *BootFirmwareVolumeBase,
76 IN UINTN BootFirmwareVolumeSize,
77 IN VOID *SecCorePe32File
78 )
79 /*++
80
81 Routine Description:
82 This is the service to load the SEC Core from the Firmware Volume
83
84 Arguments:
85 TemporaryRam - Memory to use for SEC.
86 TemporaryRamSize - Size of Memory to use for SEC
87 BootFirmwareVolumeBase - Start of the Boot FV
88 SecCorePe32File - SEC Core PE32
89
90 Returns:
91 Success means control is transfered and thus we should never return
92
93 --*/
94 ;
95
96 EFI_STATUS
97 EFIAPI
98 SecWinNtFdAddress (
99 IN UINTN Index,
100 IN OUT EFI_PHYSICAL_ADDRESS *FdBase,
101 IN OUT UINT64 *FdSize
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
123 EFI_STATUS
124 EFIAPI
125 SecImageRead (
126 IN VOID *FileHandle,
127 IN UINTN FileOffset,
128 IN OUT UINTN *ReadSize,
129 OUT VOID *Buffer
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 Routine Description:
159
160 TODO: Add function description
161
162 Arguments:
163
164 Ascii - TODO: add argument description
165 StrLen - TODO: add argument description
166
167 Returns:
168
169 TODO: add return values
170
171 --*/
172 ;
173
174 UINTN
175 CountSeparatorsInString (
176 IN CONST CHAR16 *String,
177 IN CHAR16 Separator
178 )
179 /*++
180
181 Routine Description:
182
183 TODO: Add function description
184
185 Arguments:
186
187 String - TODO: add argument description
188 Separator - TODO: add argument description
189
190 Returns:
191
192 TODO: add return values
193
194 --*/
195 ;
196
197 BOOLEAN
198 EfiSystemMemoryRange (
199 IN VOID *MemoryAddress
200 );
201 VOID
202 SecInitializeThunk (
203 VOID
204 );
205 extern EMU_THUNK_PROTOCOL gEmuThunkProtocol;
206 extern EMU_IO_THUNK_PROTOCOL mWinNtWndThunkIo;
207 extern EMU_IO_THUNK_PROTOCOL mWinNtFileSystemThunkIo;
208 extern EMU_IO_THUNK_PROTOCOL mWinNtBlockIoThunkIo;
209 #endif