3 IoMmuDxe driver installs EDKII_IOMMU_PROTOCOL to provide the support for DMA
4 operations when SEV is enabled.
6 Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
8 This program and the accompanying materials are licensed and made available
9 under the terms and conditions of the BSD License which accompanies this
10 distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 #include <Library/BaseLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/BaseMemoryLib.h>
23 #include <Library/MemoryAllocationLib.h>
24 #include <Library/UefiBootServicesTableLib.h>
25 #include <Library/MemEncryptSevLib.h>
27 #include "AmdSevIoMmu.h"
32 IN EFI_HANDLE ImageHandle
,
33 IN EFI_SYSTEM_TABLE
*SystemTable
36 EFI_STATUS Status
= EFI_SUCCESS
;
37 EFI_HANDLE Handle
= NULL
;
40 // When SEV is enabled, install IoMmu protocol otherwise install the
41 // placeholder protocol so that other dependent module can run.
43 if (MemEncryptSevIsEnabled ()) {
44 AmdSevInstallIoMmuProtocol ();
46 Status
= gBS
->InstallMultipleProtocolInterfaces (
48 &gIoMmuAbsentProtocolGuid
,