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