]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/WinNtThunkPPIToProtocolPei/WinNtThunkPPIToProtocol.c
Nt32Pkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Nt32Pkg / WinNtThunkPPIToProtocolPei / WinNtThunkPPIToProtocol.c
1 /**@file
2
3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
5
6 Module Name:
7
8 WinNtStuff.c
9
10 Abstract:
11
12 Tiano PEIM to abstract construction of firmware volume in a Windows NT environment.
13
14 Revision History
15
16 **/
17
18 //
19 // The package level header files this module uses
20 //
21 #include <PiPei.h>
22 #include <WinNtPeim.h>
23 //
24 // The protocols, PPI and GUID defintions for this module
25 //
26 #include <Protocol/WinNtThunk.h>
27 #include <Ppi/NtThunk.h>
28 //
29 // The Library classes this module consumes
30 //
31 #include <Library/DebugLib.h>
32 #include <Library/PeimEntryPoint.h>
33 #include <Library/HobLib.h>
34
35 EFI_STATUS
36 EFIAPI
37 PeimInitializeWinNtThunkPPIToProtocolPeim (
38 IN EFI_FFS_FILE_HEADER *FfsHeader,
39 IN EFI_PEI_SERVICES **PeiServices
40 )
41 /*++
42
43 Routine Description:
44
45 Perform a call-back into the SEC simulator to get NT Stuff
46
47 Arguments:
48
49 PeiServices - General purpose services available to every PEIM.
50
51 Returns:
52
53 None
54
55 --*/
56 // TODO: FfsHeader - add argument and description to function comment
57 {
58 EFI_STATUS Status;
59 EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;
60 PEI_NT_THUNK_PPI *PeiNtService;
61 VOID *Ptr;
62
63 DEBUG ((EFI_D_ERROR, "NT 32 WinNT Stuff PEIM Loaded\n"));
64
65 Status = (**PeiServices).LocatePpi (
66 (const EFI_PEI_SERVICES **)PeiServices,
67 &gPeiNtThunkPpiGuid, // GUID
68 0, // INSTANCE
69 &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR
70 (VOID**)&PeiNtService // PPI
71 );
72 ASSERT_EFI_ERROR (Status);
73
74 Ptr = PeiNtService->NtThunk ();
75
76 BuildGuidDataHob (
77 &gEfiWinNtThunkProtocolGuid, // Guid
78 &Ptr, // Buffer
79 sizeof (VOID *) // Sizeof Buffer
80 );
81 return Status;
82 }