]>
Commit | Line | Data |
---|---|---|
949f388f | 1 | /*++ @file\r |
2 | UEFI/PI PEIM to abstract construction of firmware volume in a Unix environment.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r | |
5 | Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.\r | |
e3ba31da | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
949f388f | 7 | \r |
8 | **/\r | |
9 | \r | |
10 | #include <PiPei.h>\r | |
11 | \r | |
12 | #include <Library/DebugLib.h>\r | |
13 | #include <Library/PeimEntryPoint.h>\r | |
14 | #include <Library/HobLib.h>\r | |
15 | #include <Library/PeiServicesLib.h>\r | |
16 | #include <Library/PeiServicesTablePointerLib.h>\r | |
17 | \r | |
18 | #include <Ppi/EmuThunk.h>\r | |
19 | #include <Protocol/EmuThunk.h>\r | |
20 | \r | |
21 | \r | |
22 | \r | |
23 | EFI_STATUS\r | |
24 | EFIAPI\r | |
25 | PeiInitialzeThunkPpiToProtocolPei (\r | |
26 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
27 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
28 | )\r | |
29 | /*++\r | |
30 | \r | |
31 | Routine Description:\r | |
32 | \r | |
33 | Perform a call-back into the SEC simulator to get Unix Stuff\r | |
34 | \r | |
35 | Arguments:\r | |
36 | \r | |
37 | PeiServices - General purpose services available to every PEIM.\r | |
d18d8a1d | 38 | \r |
949f388f | 39 | Returns:\r |
40 | \r | |
41 | None\r | |
42 | \r | |
43 | **/\r | |
44 | {\r | |
45 | EFI_STATUS Status;\r | |
46 | EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;\r | |
47 | EMU_THUNK_PPI *Thunk;\r | |
48 | VOID *Ptr;\r | |
49 | \r | |
50 | DEBUG ((EFI_D_ERROR, "Emu Thunk PEIM Loaded\n"));\r | |
51 | \r | |
52 | Status = PeiServicesLocatePpi (\r | |
53 | &gEmuThunkPpiGuid, // GUID\r | |
54 | 0, // INSTANCE\r | |
55 | &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR\r | |
56 | (VOID **)&Thunk // PPI\r | |
57 | );\r | |
58 | ASSERT_EFI_ERROR (Status);\r | |
59 | \r | |
60 | Ptr = Thunk->Thunk ();\r | |
61 | \r | |
62 | BuildGuidDataHob (\r | |
63 | &gEmuThunkProtocolGuid, // Guid\r | |
64 | &Ptr, // Buffer\r | |
65 | sizeof (VOID *) // Sizeof Buffer\r | |
66 | );\r | |
67 | return Status;\r | |
68 | }\r |