]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg, ArmVirtualizationPkg: clean up XenHypercallLib names
authorLaszlo Ersek <lersek@redhat.com>
Tue, 3 Mar 2015 08:13:09 +0000 (08:13 +0000)
committerlersek <lersek@Edk2>
Tue, 3 Mar 2015 08:13:09 +0000 (08:13 +0000)
Perform the following renames in order to stick with edk2 tradition more
closely:

  XenHypercallLibArm, XenHypercallLibIntel  ->  XenHypercallLib
  XenHypercallIntel                         ->  X86XenHypercall

In addition, we unify the INF files.

This patch modifies ArmVirtualizationPkg and OvmfPkg at once, in order to
keep both bisectable (client code shouldn't break).

Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16998 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationXen.dsc
OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c [new file with mode: 0644]
OvmfPkg/Library/XenHypercallLib/XenHypercallIntel.c [deleted file]
OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf [new file with mode: 0644]
OvmfPkg/Library/XenHypercallLib/XenHypercallLibArm.inf [deleted file]
OvmfPkg/Library/XenHypercallLib/XenHypercallLibIntel.inf [deleted file]
OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgX64.dsc

index 9cc926c382189958ec0c927a1d1a85739822f888..b24d0969e021521eac77e1a7ed7f07668859a9f5 100644 (file)
@@ -33,7 +33,7 @@
 [LibraryClasses]\r
   SerialPortLib|OvmfPkg/Library/XenConsoleSerialPortLib/XenConsoleSerialPortLib.inf\r
   RealTimeClockLib|ArmPlatformPkg/ArmVirtualizationPkg/Library/XenRealTimeClockLib/XenRealTimeClockLib.inf\r
 [LibraryClasses]\r
   SerialPortLib|OvmfPkg/Library/XenConsoleSerialPortLib/XenConsoleSerialPortLib.inf\r
   RealTimeClockLib|ArmPlatformPkg/ArmVirtualizationPkg/Library/XenRealTimeClockLib/XenRealTimeClockLib.inf\r
-  XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLibArm.inf\r
+  XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf\r
 \r
 [LibraryClasses.AARCH64]\r
   ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64Lib.inf\r
 \r
 [LibraryClasses.AARCH64]\r
   ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64Lib.inf\r
diff --git a/OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c b/OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c
new file mode 100644 (file)
index 0000000..7ee1f2f
--- /dev/null
@@ -0,0 +1,77 @@
+/** @file\r
+  Xen Hypercall Library implementation for Intel architecture\r
+\r
+Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under\r
+the terms and conditions of the BSD License that accompanies this distribution.\r
+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 <PiDxe.h>\r
+#include <Library/HobLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Guid/XenInfo.h>\r
+\r
+STATIC VOID    *HyperPage;\r
+\r
+//\r
+// Interface exposed by the ASM implementation of the core hypercall\r
+//\r
+INTN\r
+EFIAPI\r
+__XenHypercall2 (\r
+  IN     VOID *HypercallAddr,\r
+  IN OUT INTN Arg1,\r
+  IN OUT INTN Arg2\r
+  );\r
+\r
+/**\r
+  Library constructor: retrieves the Hyperpage address\r
+  from the gEfiXenInfoGuid HOB\r
+**/\r
+\r
+RETURN_STATUS\r
+EFIAPI\r
+XenHypercallLibInit (\r
+  VOID\r
+  )\r
+{\r
+  EFI_HOB_GUID_TYPE   *GuidHob;\r
+  EFI_XEN_INFO        *XenInfo;\r
+\r
+  GuidHob = GetFirstGuidHob (&gEfiXenInfoGuid);\r
+  if (GuidHob == NULL) {\r
+    return RETURN_NOT_FOUND;\r
+  }\r
+  XenInfo = (EFI_XEN_INFO *) GET_GUID_HOB_DATA (GuidHob);\r
+  HyperPage = XenInfo->HyperPages;\r
+  return RETURN_SUCCESS;\r
+}\r
+\r
+/**\r
+  This function will put the two arguments in the right place (registers) and\r
+  invoke the hypercall identified by HypercallID.\r
+\r
+  @param HypercallID    The symbolic ID of the hypercall to be invoked\r
+  @param Arg1           First argument.\r
+  @param Arg2           Second argument.\r
+\r
+  @return   Return 0 if success otherwise it return an errno.\r
+**/\r
+INTN\r
+EFIAPI\r
+XenHypercall2 (\r
+  IN     UINTN  HypercallID,\r
+  IN OUT INTN   Arg1,\r
+  IN OUT INTN   Arg2\r
+  )\r
+{\r
+  ASSERT (HyperPage != NULL);\r
+\r
+  return __XenHypercall2 ((UINT8*)HyperPage + HypercallID * 32, Arg1, Arg2);\r
+}\r
diff --git a/OvmfPkg/Library/XenHypercallLib/XenHypercallIntel.c b/OvmfPkg/Library/XenHypercallLib/XenHypercallIntel.c
deleted file mode 100644 (file)
index fc52823..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/** @file\r
-  Xen Hypercall Library implementation for Intel architecture\r
-\r
-Copyright (c) 2014, Linaro Ltd. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under\r
-the terms and conditions of the BSD License that accompanies this distribution.\r
-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 <PiDxe.h>\r
-#include <Library/HobLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Guid/XenInfo.h>\r
-\r
-STATIC VOID    *HyperPage;\r
-\r
-//\r
-// Interface exposed by the ASM implementation of the core hypercall\r
-//\r
-INTN\r
-EFIAPI\r
-__XenHypercall2 (\r
-  IN     VOID *HypercallAddr,\r
-  IN OUT INTN Arg1,\r
-  IN OUT INTN Arg2\r
-  );\r
-\r
-/**\r
-  Library constructor: retrieves the Hyperpage address\r
-  from the gEfiXenInfoGuid HOB\r
-**/\r
-\r
-RETURN_STATUS\r
-EFIAPI\r
-XenHypercallLibIntelInit (\r
-  VOID\r
-  )\r
-{\r
-  EFI_HOB_GUID_TYPE   *GuidHob;\r
-  EFI_XEN_INFO        *XenInfo;\r
-\r
-  GuidHob = GetFirstGuidHob (&gEfiXenInfoGuid);\r
-  if (GuidHob == NULL) {\r
-    return RETURN_NOT_FOUND;\r
-  }\r
-  XenInfo = (EFI_XEN_INFO *) GET_GUID_HOB_DATA (GuidHob);\r
-  HyperPage = XenInfo->HyperPages;\r
-  return RETURN_SUCCESS;\r
-}\r
-\r
-/**\r
-  This function will put the two arguments in the right place (registers) and\r
-  invoke the hypercall identified by HypercallID.\r
-\r
-  @param HypercallID    The symbolic ID of the hypercall to be invoked\r
-  @param Arg1           First argument.\r
-  @param Arg2           Second argument.\r
-\r
-  @return   Return 0 if success otherwise it return an errno.\r
-**/\r
-INTN\r
-EFIAPI\r
-XenHypercall2 (\r
-  IN     UINTN  HypercallID,\r
-  IN OUT INTN   Arg1,\r
-  IN OUT INTN   Arg2\r
-  )\r
-{\r
-  ASSERT (HyperPage != NULL);\r
-\r
-  return __XenHypercall2 ((UINT8*)HyperPage + HypercallID * 32, Arg1, Arg2);\r
-}\r
diff --git a/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf b/OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf
new file mode 100644 (file)
index 0000000..efc26fe
--- /dev/null
@@ -0,0 +1,63 @@
+## @file\r
+#  Xen Hypercall abstraction lib for Intel and ARM architectures\r
+#\r
+#  Copyright (c) 2014, Linaro Ltd. 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                      = XenHypercallLib\r
+  FILE_GUID                      = B5EE9A32-CA5A-49A8-82E3-ADA4CCB77C7C\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+\r
+[Defines.IA32, Defines.X64]\r
+  LIBRARY_CLASS                  = XenHypercallLib|DXE_DRIVER UEFI_DRIVER\r
+  CONSTRUCTOR                    = XenHypercallLibInit\r
+\r
+[Defines.ARM, Defines.AARCH64]\r
+  LIBRARY_CLASS                  = XenHypercallLib\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64\r
+#\r
+\r
+[Sources.IA32, Sources.X64]\r
+  X86XenHypercall.c\r
+\r
+[Sources.IA32]\r
+  Ia32/hypercall.nasm\r
+\r
+[Sources.X64]\r
+  X64/hypercall.nasm\r
+\r
+[Sources.ARM]\r
+  Arm/Hypercall.S\r
+\r
+[Sources.AARCH64]\r
+  Aarch64/Hypercall.S\r
+\r
+[Sources]\r
+  XenHypercall.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  OvmfPkg/OvmfPkg.dec\r
+\r
+[LibraryClasses.IA32, LibraryClasses.X64]\r
+  BaseLib\r
+  HobLib\r
+  DebugLib\r
+\r
+[Guids.IA32, Guids.X64]\r
+  gEfiXenInfoGuid\r
diff --git a/OvmfPkg/Library/XenHypercallLib/XenHypercallLibArm.inf b/OvmfPkg/Library/XenHypercallLib/XenHypercallLibArm.inf
deleted file mode 100644 (file)
index 9cbbeb5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-## @file\r
-#  Xen Hypercall abstraction lib for ARM architecture\r
-#\r
-#  Copyright (c) 2014, Linaro Ltd. 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                      = XenHypercallLibArm\r
-  FILE_GUID                      = 9607AC2E-FCB9-499B-9475-612282019568\r
-  MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = XenHypercallLib\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = ARM AARCH64\r
-#\r
-\r
-[Sources.ARM]\r
-  Arm/Hypercall.S\r
-\r
-[Sources.AARCH64]\r
-  Aarch64/Hypercall.S\r
-\r
-[Sources]\r
-  XenHypercall.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  OvmfPkg/OvmfPkg.dec\r
diff --git a/OvmfPkg/Library/XenHypercallLib/XenHypercallLibIntel.inf b/OvmfPkg/Library/XenHypercallLib/XenHypercallLibIntel.inf
deleted file mode 100644 (file)
index 2afd608..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-## @file\r
-#  Xen Hypercall abstraction lib for Intel architecture\r
-#\r
-#  Copyright (c) 2014, Linaro Ltd. 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                      = XenHypercallLibIntel\r
-  FILE_GUID                      = B5EE9A32-CA5A-49A8-82E3-ADA4CCB77C7C\r
-  MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = XenHypercallLib|DXE_DRIVER UEFI_DRIVER\r
-  CONSTRUCTOR                    = XenHypercallLibIntelInit\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64\r
-#\r
-\r
-[Sources]\r
-  XenHypercallIntel.c\r
-\r
-[Sources.IA32]\r
-  Ia32/hypercall.nasm\r
-\r
-[Sources.X64]\r
-  X64/hypercall.nasm\r
-\r
-[Sources]\r
-  XenHypercall.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  OvmfPkg/OvmfPkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  HobLib\r
-  DebugLib\r
-\r
-[Guids]\r
-  gEfiXenInfoGuid\r
index 8c880613851d66fb1173655de1267c751e94a17c..1f43f7d31f737e9138a68c363f9956819fe3b419 100644 (file)
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
-  XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLibIntel.inf\r
+  XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf\r
 \r
 [LibraryClasses.common]\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
 \r
 [LibraryClasses.common]\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
index ff32ecefd07ba88fdb2e4a65e6d0b98e54565ae4..21393ebb52ba6b95b073442a58b4b3a35230fb47 100644 (file)
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
-  XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLibIntel.inf\r
+  XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf\r
 \r
 [LibraryClasses.common]\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
 \r
 [LibraryClasses.common]\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
index 8bac6dc313f0b4682271010bc73fcbf5dc9ffb24..25a3ee52ed56cd3741fc63d24522a6a38fdff03f 100644 (file)
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
   S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
   SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
   OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf\r
-  XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLibIntel.inf\r
+  XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf\r
 \r
 [LibraryClasses.common]\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
 \r
 [LibraryClasses.common]\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r