3 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
4 Portions copyright (c) 2011, Apple Inc. All rights reserved.
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Library/DebugLib.h>
18 #include <Library/HobLib.h>
19 #include <Library/EmuThunkLib.h>
21 #include <Protocol/EmuThunk.h>
24 EMU_THUNK_PROTOCOL
*gEmuThunk
= NULL
;
28 The constructor function caches the pointer of EMU Thunk protocol.
30 @param ImageHandle The firmware allocated handle for the EFI image.
31 @param SystemTable A pointer to the EFI System Table.
33 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
38 DxeEmuLibConstructor (
39 IN EFI_HANDLE ImageHandle
,
40 IN EFI_SYSTEM_TABLE
*SystemTable
43 EFI_HOB_GUID_TYPE
*GuidHob
;
45 GuidHob
= GetFirstGuidHob (&gEmuThunkProtocolGuid
);
46 ASSERT (GuidHob
!= NULL
);
48 gEmuThunk
= (EMU_THUNK_PROTOCOL
*)(*(UINTN
*)(GET_GUID_HOB_DATA (GuidHob
)));
49 ASSERT (gEmuThunk
!= NULL
);