TianoCore EDK2 master
Loading...
Searching...
No Matches
ThunkPpiToProtocolPei.c
1/*++ @file
2 UEFI/PI PEIM to abstract construction of firmware volume in a Unix environment.
3
4Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.
6SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10#include <PiPei.h>
11
12#include <Library/DebugLib.h>
14#include <Library/HobLib.h>
17
18#include <Ppi/EmuThunk.h>
19#include <Protocol/EmuThunk.h>
20
22EFIAPI
23PeiInitialzeThunkPpiToProtocolPei (
24 IN EFI_PEI_FILE_HANDLE FileHandle,
25 IN CONST EFI_PEI_SERVICES **PeiServices
26 )
27
28/*++
29
30Routine Description:
31
32 Perform a call-back into the SEC simulator to get Unix Stuff
33
34Arguments:
35
36 PeiServices - General purpose services available to every PEIM.
37
38Returns:
39
40 None
41
42**/
43{
44 EFI_STATUS Status;
45 EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;
46 EMU_THUNK_PPI *Thunk;
47 VOID *Ptr;
48
49 DEBUG ((DEBUG_ERROR, "Emu Thunk PEIM Loaded\n"));
50
51 Status = PeiServicesLocatePpi (
52 &gEmuThunkPpiGuid, // GUID
53 0, // INSTANCE
54 &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR
55 (VOID **)&Thunk // PPI
56 );
57 ASSERT_EFI_ERROR (Status);
58
59 Ptr = Thunk->Thunk ();
60
62 &gEmuThunkProtocolGuid, // Guid
63 &Ptr, // Buffer
64 sizeof (VOID *) // Sizeof Buffer
65 );
66 return Status;
67}
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
Definition: HobLib.c:375
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
VOID * EFI_PEI_FILE_HANDLE
Definition: PiPeiCis.h:26
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29