]> git.proxmox.com Git - mirror_edk2.git/blame - InOsEmuPkg/ThunkPpiToProtocolPei/ThunkPpiToProtocolPei.c
Clarify the requirements for the Destination parameter of UnicodeStrToAsciiStr.
[mirror_edk2.git] / InOsEmuPkg / ThunkPpiToProtocolPei / ThunkPpiToProtocolPei.c
CommitLineData
949f388f 1/*++ @file\r
2 UEFI/PI PEIM to abstract construction of firmware volume in a Unix environment.\r
3\r
4Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
5Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.\r
6This program and the accompanying materials \r
7are licensed and made available under the terms and conditions of the BSD License \r
8which accompanies this distribution. The full text of the license may be found at \r
9http://opensource.org/licenses/bsd-license.php \r
10 \r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
13\r
14**/\r
15\r
16#include <PiPei.h>\r
17\r
18#include <Library/DebugLib.h>\r
19#include <Library/PeimEntryPoint.h>\r
20#include <Library/HobLib.h>\r
21#include <Library/PeiServicesLib.h>\r
22#include <Library/PeiServicesTablePointerLib.h>\r
23\r
24#include <Ppi/EmuThunk.h>\r
25#include <Protocol/EmuThunk.h>\r
26\r
27\r
28\r
29EFI_STATUS\r
30EFIAPI\r
31PeiInitialzeThunkPpiToProtocolPei (\r
32 IN EFI_PEI_FILE_HANDLE FileHandle,\r
33 IN CONST EFI_PEI_SERVICES **PeiServices\r
34 )\r
35/*++\r
36\r
37Routine Description:\r
38\r
39 Perform a call-back into the SEC simulator to get Unix Stuff\r
40\r
41Arguments:\r
42\r
43 PeiServices - General purpose services available to every PEIM.\r
44 \r
45Returns:\r
46\r
47 None\r
48\r
49**/\r
50{\r
51 EFI_STATUS Status;\r
52 EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;\r
53 EMU_THUNK_PPI *Thunk;\r
54 VOID *Ptr;\r
55\r
56 DEBUG ((EFI_D_ERROR, "Emu Thunk PEIM Loaded\n"));\r
57\r
58 Status = PeiServicesLocatePpi (\r
59 &gEmuThunkPpiGuid, // GUID\r
60 0, // INSTANCE\r
61 &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR\r
62 (VOID **)&Thunk // PPI\r
63 );\r
64 ASSERT_EFI_ERROR (Status);\r
65\r
66 Ptr = Thunk->Thunk ();\r
67\r
68 BuildGuidDataHob (\r
69 &gEmuThunkProtocolGuid, // Guid\r
70 &Ptr, // Buffer\r
71 sizeof (VOID *) // Sizeof Buffer\r
72 );\r
73 return Status;\r
74}\r