]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/IoMmuDxe/IoMmuDxe.c
OvmfPkg/PlatformDxe: list "Platform.h" in the INF file
[mirror_edk2.git] / OvmfPkg / IoMmuDxe / IoMmuDxe.c
1 /** @file
2
3 IoMmuDxe driver installs EDKII_IOMMU_PROTOCOL to provide the support for DMA
4 operations when SEV is enabled.
5
6 Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
7
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
12
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.
15
16 **/
17
18 #include "AmdSevIoMmu.h"
19
20 EFI_STATUS
21 EFIAPI
22 IoMmuDxeEntryPoint (
23 IN EFI_HANDLE ImageHandle,
24 IN EFI_SYSTEM_TABLE *SystemTable
25 )
26 {
27 EFI_STATUS Status;
28 EFI_HANDLE Handle;
29
30 //
31 // When SEV is enabled, install IoMmu protocol otherwise install the
32 // placeholder protocol so that other dependent module can run.
33 //
34 if (MemEncryptSevIsEnabled ()) {
35 Status = AmdSevInstallIoMmuProtocol ();
36 } else {
37 Handle = NULL;
38
39 Status = gBS->InstallMultipleProtocolInterfaces (
40 &Handle,
41 &gIoMmuAbsentProtocolGuid,
42 NULL, NULL);
43 }
44
45 return Status;
46 }