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
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.
17 Include file for Windows API based SEC
25 #include <WinNtPeim.h>
26 #include <Library/BaseLib.h>
27 #include <Library/PeCoffLib.h>
28 #include <Ppi/NtPeiLoadFile.h>
29 #include <Ppi/NtAutoscan.h>
30 #include <Ppi/NtThunk.h>
31 #include <Ppi/StatusCode.h>
32 #include <Ppi/NtFwh.h>
33 #include <Ppi/TemporaryRamSupport.h>
34 #include <Library/PcdLib.h>
35 #include <Library/DebugLib.h>
36 #include <Library/PrintLib.h>
37 #include <Library/BaseMemoryLib.h>
38 #include <Library/ReportStatusCodeLib.h>
40 #include <IndustryStandard/PeImage.h>
43 #define STACK_SIZE 0x20000
46 EFI_PHYSICAL_ADDRESS Address
;
51 EFI_PHYSICAL_ADDRESS Memory
;
55 #define MAX_PDB_NAME_TO_MOD_HANDLE_ARRAY_SIZE 0x100
60 } PDB_NAME_TO_MOD_HANDLE
;
68 VOID
*Pe32Data
, // TODO: add IN/OUT modifier to Pe32Data
69 EFI_PHYSICAL_ADDRESS
*ImageAddress
, // TODO: add IN/OUT modifier to ImageAddress
70 UINT64
*ImageSize
, // TODO: add IN/OUT modifier to ImageSize
71 EFI_PHYSICAL_ADDRESS
*EntryPoint
// TODO: add IN/OUT modifier to EntryPoint
77 TODO: Add function description
81 Pe32Data - TODO: add argument description
82 ImageAddress - TODO: add argument description
83 ImageSize - TODO: add argument description
84 EntryPoint - TODO: add argument description
88 TODO: add return values
97 OUT EFI_PHYSICAL_ADDRESS
*MemoryBase
,
98 OUT UINT64
*MemorySize
104 TODO: Add function description
108 Index - TODO: add argument description
109 MemoryBase - TODO: add argument description
110 MemorySize - TODO: add argument description
114 TODO: add return values
121 SecWinNtWinNtThunkAddress (
128 TODO: Add function description
132 InterfaceSize - TODO: add argument description
133 InterfaceBase - TODO: add argument description
137 TODO: add return values
144 SecWinNtWinNtFwhAddress (
145 IN OUT UINT64
*FwhSize
,
146 IN OUT EFI_PHYSICAL_ADDRESS
*FwhBase
152 TODO: Add function description
156 FwhSize - TODO: add argument description
157 FwhBase - TODO: add argument description
161 TODO: add return values
168 SecPeiReportStatusCode (
169 IN CONST EFI_PEI_SERVICES
**PeiServices
,
170 IN EFI_STATUS_CODE_TYPE CodeType
,
171 IN EFI_STATUS_CODE_VALUE Value
,
173 IN CONST EFI_GUID
* CallerId
,
174 IN CONST EFI_STATUS_CODE_DATA
* Data OPTIONAL
180 TODO: Add function description
184 PeiServices - TODO: add argument description
185 CodeType - TODO: add argument description
186 Value - TODO: add argument description
187 Instance - TODO: add argument description
188 CallerId - TODO: add argument description
189 Data - TODO: add argument description
193 TODO: add return values
209 TODO: Add function description
213 Argc - TODO: add argument description
214 Argv - TODO: add argument description
215 Envp - TODO: add argument description
219 TODO: add return values
228 DWORD CreationDispostion
,
229 EFI_PHYSICAL_ADDRESS
*BaseAddress
,
236 TODO: Add function description
240 FileName - TODO: add argument description
241 MapSize - TODO: add argument description
242 CreationDispostion - TODO: add argument description
243 BaseAddress - TODO: add argument description
244 Length - TODO: add argument description
248 TODO: add return values
255 IN UINTN LargestRegion
,
256 IN UINTN LargestRegionSize
,
257 IN UINTN BootFirmwareVolumeBase
,
264 TODO: Add function description
268 LargestRegion - TODO: add argument description
269 LargestRegionSize - TODO: add argument description
270 BootFirmwareVolumeBase - TODO: add argument description
271 PeiCoreFile - TODO: add argument description
275 TODO: add return values
283 IN EFI_PHYSICAL_ADDRESS
*ImageAddress
,
284 IN UINT64
*ImageSize
,
285 IN EFI_PHYSICAL_ADDRESS
*EntryPoint
291 TODO: Add function description
295 Pe32Data - TODO: add argument description
296 ImageAddress - TODO: add argument description
297 ImageSize - TODO: add argument description
298 EntryPoint - TODO: add argument description
302 TODO: add return values
309 IN EFI_FIRMWARE_VOLUME_HEADER
*FwVolHeader
,
316 TODO: Add function description
320 FwVolHeader - TODO: add argument description
321 Pe32Data - TODO: add argument description
325 TODO: add return values
332 IN EFI_FV_FILETYPE SearchType
,
333 IN EFI_FIRMWARE_VOLUME_HEADER
*FwVolHeader
,
334 IN OUT EFI_FFS_FILE_HEADER
**FileHeader
340 TODO: Add function description
344 SearchType - TODO: add argument description
345 FwVolHeader - TODO: add argument description
346 FileHeader - TODO: add argument description
350 TODO: add return values
356 SecFfsFindSectionData (
357 IN EFI_SECTION_TYPE SectionType
,
358 IN EFI_FFS_FILE_HEADER
*FfsFileHeader
,
359 IN OUT VOID
**SectionData
365 TODO: Add function description
369 SectionType - TODO: add argument description
370 FfsFileHeader - TODO: add argument description
371 SectionData - TODO: add argument description
375 TODO: add return values
382 SecWinNtPeCoffLoaderLoadAsDll (
383 IN CHAR8
*PdbFileName
,
384 IN VOID
**ImageEntryPoint
,
391 TODO: Add function description
395 PdbFileName - TODO: add argument description
396 ImageEntryPoint - TODO: add argument description
397 ModHandle - TODO: add argument description
401 TODO: add return values
408 SecWinNtPeCoffLoaderFreeLibrary (
415 TODO: Add function description
419 ModHandle - TODO: add argument description
423 TODO: add return values
432 IN OUT EFI_PHYSICAL_ADDRESS
*FdBase
,
433 IN OUT UINT64
*FdSize
439 TODO: Add function description
443 Index - TODO: add argument description
444 FdBase - TODO: add argument description
445 FdSize - TODO: add argument description
449 TODO: add return values
455 GetImageReadFunction (
456 IN PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
,
457 IN EFI_PHYSICAL_ADDRESS
*TopOfMemory
463 TODO: Add function description
467 ImageContext - TODO: add argument description
468 TopOfMemory - TODO: add argument description
472 TODO: add return values
482 IN OUT UINTN
*ReadSize
,
489 TODO: Add function description
493 FileHandle - TODO: add argument description
494 FileOffset - TODO: add argument description
495 ReadSize - TODO: add argument description
496 Buffer - TODO: add argument description
500 TODO: add return values
508 IN UINTN
*StrLen OPTIONAL
514 TODO: Add function description
518 Ascii - TODO: add argument description
519 StrLen - TODO: add argument description
523 TODO: add return values
529 CountSeperatorsInString (
530 IN CONST CHAR16
*String
,
537 TODO: Add function description
541 String - TODO: add argument description
542 Seperator - TODO: add argument description
546 TODO: add return values
553 SecTemporaryRamSupport (
554 IN CONST EFI_PEI_SERVICES
**PeiServices
,
555 IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase
,
556 IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase
,
561 extern EFI_WIN_NT_THUNK_PROTOCOL
*gWinNt
;