]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelSiliconPkg: Add PlatformVTdInfoSamplePei.
authorJiewen Yao <jiewen.yao@intel.com>
Wed, 6 Sep 2017 12:40:24 +0000 (20:40 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Sat, 16 Sep 2017 01:18:11 +0000 (09:18 +0800)
This is a sample driver to produce VTD_INFO PPI.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c [new file with mode: 0644]
IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf [new file with mode: 0644]
IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.uni [new file with mode: 0644]
IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePeiExtra.uni [new file with mode: 0644]

diff --git a/IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c b/IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c
new file mode 100644 (file)
index 0000000..c79398f
--- /dev/null
@@ -0,0 +1,65 @@
+/** @file\r
+  Platform VTd Info Sample PEI driver.\r
+\r
+  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <PiPei.h>\r
+\r
+#include <Ppi/VTdInfo.h>\r
+\r
+#include <Library/PeiServicesLib.h>\r
+#include <Library/DebugLib.h>\r
+\r
+typedef struct {\r
+  UINT64                                  Revision;\r
+  UINT8                                   HostAddressWidth;\r
+  UINT8                                   Reserved[3];\r
+  UINT32                                  VTdEngineCount;\r
+  UINT64                                  VTdEngineAddress[2];\r
+} MY_VTD_INFO_PPI;\r
+\r
+MY_VTD_INFO_PPI  mPlatformVTdSample = {\r
+  EDKII_VTD_INFO_PPI_REVISION,\r
+  0x26,\r
+  {0},\r
+  2,\r
+  {0xFED90000, 0xFED91000},\r
+};\r
+\r
+EFI_PEI_PPI_DESCRIPTOR mPlatformVTdInfoSampleDesc = {\r
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
+  &gEdkiiVTdInfoPpiGuid,\r
+  &mPlatformVTdSample\r
+};\r
+\r
+/**\r
+  Platform VTd Info sample driver.\r
+\r
+  @param[in] FileHandle  Handle of the file being invoked.\r
+  @param[in] PeiServices Describes the list of possible PEI Services.\r
+\r
+  @retval EFI_SUCCESS if it completed successfully.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PlatformVTdInfoSampleInitialize (\r
+  IN       EFI_PEI_FILE_HANDLE  FileHandle,\r
+  IN CONST EFI_PEI_SERVICES     **PeiServices\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  Status = PeiServicesInstallPpi (&mPlatformVTdInfoSampleDesc);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return Status;\r
+}\r
diff --git a/IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf b/IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf
new file mode 100644 (file)
index 0000000..fe12821
--- /dev/null
@@ -0,0 +1,51 @@
+## @file\r
+# Platform VTd Info Sample PEI driver.\r
+#\r
+# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution.  The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+##\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = PlatformVTdInfoSamplePei\r
+  MODULE_UNI_FILE                = PlatformVTdInfoSamplePei.uni\r
+  FILE_GUID                      = 839EB770-5C64-4EED-A6D5-EC515B2B2B23\r
+  MODULE_TYPE                    = PEIM\r
+  VERSION_STRING                 = 1.0\r
+  ENTRY_POINT                    = PlatformVTdInfoSampleInitialize\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+#\r
+\r
+[Sources]\r
+  PlatformVTdInfoSamplePei.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  IntelSiliconPkg/IntelSiliconPkg.dec\r
+\r
+[LibraryClasses]\r
+  PeimEntryPoint\r
+  PeiServicesLib\r
+\r
+[Ppis]\r
+  gEdkiiVTdInfoPpiGuid         ## PRODUCES\r
+\r
+[Depex]\r
+  gEfiPeiMemoryDiscoveredPpiGuid\r
+\r
+[UserExtensions.TianoCore."ExtraFiles"]\r
+  PlatformVTdInfoSamplePeiExtra.uni\r
+\r
diff --git a/IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.uni b/IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.uni
new file mode 100644 (file)
index 0000000..36f9183
--- /dev/null
@@ -0,0 +1,20 @@
+// /** @file\r
+// PlatformVTdInfoSamplePei Module Localized Abstract and Description Content\r
+//\r
+// Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+//\r
+// This program and the accompanying materials are\r
+// licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution.  The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//\r
+// **/\r
+\r
+\r
+#string STR_MODULE_ABSTRACT             #language en-US "Platform VTd Info PEI Driver."\r
+\r
+#string STR_MODULE_DESCRIPTION          #language en-US "This driver provides sample on how to produce Platform VTd Info PPI."\r
+\r
diff --git a/IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePeiExtra.uni b/IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePeiExtra.uni
new file mode 100644 (file)
index 0000000..df6345f
--- /dev/null
@@ -0,0 +1,20 @@
+// /** @file\r
+// PlatformVTdInfoSamplePei Localized Strings and Content\r
+//\r
+// Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+//\r
+// This program and the accompanying materials are\r
+// licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution.  The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+//\r
+// **/\r
+\r
+#string STR_PROPERTIES_MODULE_NAME\r
+#language en-US\r
+"Platform VTd Info Sample PEI Driver"\r
+\r
+\r