]> git.proxmox.com Git - mirror_edk2.git/blame - IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c
IntelSiliconPkg: Add PlatformVTdInfoSamplePei.
[mirror_edk2.git] / IntelSiliconPkg / PlatformVTdInfoSamplePei / PlatformVTdInfoSamplePei.c
CommitLineData
53269009
JY
1/** @file\r
2 Platform VTd Info Sample PEI driver.\r
3\r
4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <PiPei.h>\r
16\r
17#include <Ppi/VTdInfo.h>\r
18\r
19#include <Library/PeiServicesLib.h>\r
20#include <Library/DebugLib.h>\r
21\r
22typedef struct {\r
23 UINT64 Revision;\r
24 UINT8 HostAddressWidth;\r
25 UINT8 Reserved[3];\r
26 UINT32 VTdEngineCount;\r
27 UINT64 VTdEngineAddress[2];\r
28} MY_VTD_INFO_PPI;\r
29\r
30MY_VTD_INFO_PPI mPlatformVTdSample = {\r
31 EDKII_VTD_INFO_PPI_REVISION,\r
32 0x26,\r
33 {0},\r
34 2,\r
35 {0xFED90000, 0xFED91000},\r
36};\r
37\r
38EFI_PEI_PPI_DESCRIPTOR mPlatformVTdInfoSampleDesc = {\r
39 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
40 &gEdkiiVTdInfoPpiGuid,\r
41 &mPlatformVTdSample\r
42};\r
43\r
44/**\r
45 Platform VTd Info sample driver.\r
46\r
47 @param[in] FileHandle Handle of the file being invoked.\r
48 @param[in] PeiServices Describes the list of possible PEI Services.\r
49\r
50 @retval EFI_SUCCESS if it completed successfully.\r
51**/\r
52EFI_STATUS\r
53EFIAPI\r
54PlatformVTdInfoSampleInitialize (\r
55 IN EFI_PEI_FILE_HANDLE FileHandle,\r
56 IN CONST EFI_PEI_SERVICES **PeiServices\r
57 )\r
58{\r
59 EFI_STATUS Status;\r
60\r
61 Status = PeiServicesInstallPpi (&mPlatformVTdInfoSampleDesc);\r
62 ASSERT_EFI_ERROR (Status);\r
63\r
64 return Status;\r
65}\r