]>
Commit | Line | Data |
---|---|---|
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 are licensed and made available\r | |
9 | under the terms and conditions of the BSD License which accompanies this\r | |
10 | distribution. The full text of the license may be found at\r | |
11 | 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 "AmdSevIoMmu.h"\r | |
19 | \r | |
20 | EFI_STATUS\r | |
21 | EFIAPI\r | |
22 | IoMmuDxeEntryPoint (\r | |
23 | IN EFI_HANDLE ImageHandle,\r | |
24 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
25 | )\r | |
26 | {\r | |
27 | EFI_STATUS Status;\r | |
28 | EFI_HANDLE Handle;\r | |
29 | \r | |
30 | //\r | |
31 | // When SEV is enabled, install IoMmu protocol otherwise install the\r | |
32 | // placeholder protocol so that other dependent module can run.\r | |
33 | //\r | |
34 | if (MemEncryptSevIsEnabled ()) {\r | |
35 | Status = AmdSevInstallIoMmuProtocol ();\r | |
36 | } else {\r | |
37 | Handle = NULL;\r | |
38 | \r | |
39 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
40 | &Handle,\r | |
41 | &gIoMmuAbsentProtocolGuid,\r | |
42 | NULL, NULL);\r | |
43 | }\r | |
44 | \r | |
45 | return Status;\r | |
46 | }\r |