]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/IoMmuDxe/IoMmuDxe.c
OvmfPkg/IoMmuDxe: Fix header guard macro
[mirror_edk2.git] / OvmfPkg / IoMmuDxe / IoMmuDxe.c
CommitLineData
f9d129e6
BS
1/** @file\r
2\r
3 IoMmuDxe driver installs EDKII_IOMMU_PROTOCOL to provide the support for DMA\r
4 operations when SEV is enabled.\r
5\r
6 Copyright (c) 2017, AMD Inc. All rights reserved.<BR>\r
7\r
8 This program and the accompanying materials\r
9 are licensed and made available under the terms and conditions of the BSD\r
10 License which accompanies this distribution. The full text of the license may\r
11 be found at http://opensource.org/licenses/bsd-license.php\r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16**/\r
17\r
18#include <PiDxe.h>\r
19\r
20#include <Library/BaseLib.h>\r
21#include <Library/DebugLib.h>\r
22#include <Library/BaseMemoryLib.h>\r
23#include <Library/MemoryAllocationLib.h>\r
24#include <Library/UefiBootServicesTableLib.h>\r
25#include <Library/MemEncryptSevLib.h>\r
26\r
27#include "AmdSevIoMmu.h"\r
28\r
29EFI_STATUS\r
30EFIAPI\r
31IoMmuDxeEntryPoint (\r
32 IN EFI_HANDLE ImageHandle,\r
33 IN EFI_SYSTEM_TABLE *SystemTable\r
34 )\r
35{\r
36 EFI_STATUS Status = EFI_SUCCESS;\r
37 EFI_HANDLE Handle = NULL;\r
38\r
39 //\r
40 // When SEV is enabled, install IoMmu protocol otherwise install the\r
41 // placeholder protocol so that other dependent module can run.\r
42 //\r
43 if (MemEncryptSevIsEnabled ()) {\r
44 AmdSevInstallIoMmuProtocol ();\r
45 } else {\r
46 Status = gBS->InstallMultipleProtocolInterfaces (\r
47 &Handle,\r
48 &gIoMmuAbsentProtocolGuid,\r
49 NULL, NULL);\r
50 }\r
51\r
52 return Status;\r
53}\r