]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Revert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."
authoryuchenlin <yuchenlin@synology.com>
Fri, 2 Nov 2018 03:24:00 +0000 (11:24 +0800)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 6 Nov 2018 11:56:20 +0000 (12:56 +0100)
This reverts commit 05a5379458725234de8a05780fcb5da2c12680e4.

The VMWare SVGA display device implemented by Qemu (-vga vmware) uses
an I/O-type BAR which is laid out such that some register offsets are
not aligned to the read/write width with which they are expected to be
accessed. However, we reverted the initialization of VMWare SVGA device,
we don't need such unaligned I/O.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin <yuchenlin@synology.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c [deleted file]
OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c [deleted file]
OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h [deleted file]
OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c [deleted file]
OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c [deleted file]

index 895e6b8dbd4d69733f5a21292a3dfb9023fdf67c..e5575622dc6146b53bfa9ef107444c66f2fe5c90 100644 (file)
   Qemu.h\r
 \r
 [Sources.Ia32, Sources.X64]\r
-  UnalignedIoGcc.c    | GCC\r
-  UnalignedIoIcc.c    | INTEL\r
-  UnalignedIoMsc.c    | MSFT\r
   VbeShim.c\r
   VbeShim.h\r
 \r
-[Sources.EBC]\r
-  UnalignedIoUnsupported.c\r
-\r
 [Packages]\r
   MdePkg/MdePkg.dec\r
   MdeModulePkg/MdeModulePkg.dec\r
diff --git a/OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c b/OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c
deleted file mode 100644 (file)
index 105d55d..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/** @file\r
-  Unaligned Port I/O. This file has compiler specifics for GCC as there is no\r
-  ANSI C standard for doing IO.\r
-\r
-  Based on IoLibGcc.c.\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials are licensed and made available\r
-  under the terms and conditions of the BSD License which accompanies this\r
-  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
-#include "UnalignedIoInternal.h"\r
-\r
-/**\r
-  Performs a 32-bit write to the specified, possibly unaligned I/O-type\r
-  address.\r
-\r
-  Writes the 32-bit I/O port specified by Port with the value specified by\r
-  Value and returns Value. This function must guarantee that all I/O read and\r
-  write operations are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port   I/O port address\r
-  @param[in]  Value  32-bit word to write\r
-\r
-  @return The value written to the I/O port.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoWrite32 (\r
-  IN      UINTN                     Port,\r
-  IN      UINT32                    Value\r
-  )\r
-{\r
-  __asm__ __volatile__ ( "outl %0, %1" : : "a" (Value), "d" ((UINT16)Port) );\r
-  return Value;\r
-}\r
-\r
-/**\r
-  Reads a 32-bit word from the specified, possibly unaligned I/O-type address.\r
-\r
-  Reads the 32-bit I/O port specified by Port. The 32-bit read value is\r
-  returned. This function must guarantee that all I/O read and write operations\r
-  are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port  The I/O port to read.\r
-\r
-  @return The value read.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoRead32 (\r
-  IN      UINTN                     Port\r
-  )\r
-{\r
-  UINT32 Data;\r
-  __asm__ __volatile__ ( "inl %1, %0" : "=a" (Data) : "d" ((UINT16)Port) );\r
-  return Data;\r
-}\r
-\r
diff --git a/OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c b/OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c
deleted file mode 100644 (file)
index 79f3e44..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/** @file\r
-  Unaligned port I/O. This file has compiler specifics for ICC as there\r
-  is no ANSI C standard for doing IO.\r
-\r
-  Based on IoLibIcc.c.\r
-\r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials are licensed and made available\r
-  under the terms and conditions of the BSD License which accompanies this\r
-  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
-#include "UnalignedIoInternal.h"\r
-\r
-/**\r
-  Performs a 32-bit write to the specified, possibly unaligned I/O-type\r
-  address.\r
-\r
-  Writes the 32-bit I/O port specified by Port with the value specified by\r
-  Value and returns Value. This function must guarantee that all I/O read and\r
-  write operations are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port   I/O port address\r
-  @param[in]  Value  32-bit word to write\r
-\r
-  @return The value written to the I/O port.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoWrite32 (\r
-  IN      UINTN                     Port,\r
-  IN      UINT32                    Value\r
-  )\r
-{\r
-  __asm {\r
-    mov eax, dword ptr [Value]\r
-    mov dx, word ptr [Port]\r
-    out dx, eax\r
-  }\r
-\r
-  return Value;\r
-}\r
-\r
-/**\r
-  Reads a 32-bit word from the specified, possibly unaligned I/O-type address.\r
-\r
-  Reads the 32-bit I/O port specified by Port. The 32-bit read value is\r
-  returned. This function must guarantee that all I/O read and write operations\r
-  are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port  The I/O port to read.\r
-\r
-  @return The value read.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoRead32 (\r
-  IN      UINTN                     Port\r
-  )\r
-{\r
-  UINT32 Data;\r
-\r
-  __asm {\r
-    mov dx, word ptr [Port]\r
-    in  eax, dx\r
-    mov dword ptr [Data], eax\r
-  }\r
-\r
-  return Data;\r
-}\r
diff --git a/OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h b/OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h
deleted file mode 100644 (file)
index 234de6c..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/** @file\r
-  Unaligned port I/O, with implementations for various x86 compilers and a\r
-  dummy for platforms which do not support unaligned port I/O.\r
-\r
-  Copyright (c) 2017, Phil Dennis-Jordan.<BR>\r
-  This program and the accompanying materials are licensed and made available\r
-  under the terms and conditions of the BSD License which accompanies this\r
-  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
-#ifndef _UNALIGNED_IO_INTERNAL_H_\r
-#define _UNALIGNED_IO_INTERNAL_H_\r
-\r
-/**\r
-  Performs a 32-bit write to the specified, possibly unaligned I/O-type address.\r
-\r
-  Writes the 32-bit I/O port specified by Port with the value specified by Value\r
-  and returns Value. This function must guarantee that all I/O read and write\r
-  operations are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port   I/O port address\r
-  @param[in]  Value  32-bit word to write\r
-\r
-  @return The value written to the I/O port.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoWrite32 (\r
-  IN      UINTN                     Port,\r
-  IN      UINT32                    Value\r
-  );\r
-\r
-/**\r
-  Reads a 32-bit word from the specified, possibly unaligned I/O-type address.\r
-\r
-  Reads the 32-bit I/O port specified by Port. The 32-bit read value is\r
-  returned. This function must guarantee that all I/O read and write operations\r
-  are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port  The I/O port to read.\r
-\r
-  @return The value read.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoRead32 (\r
-  IN      UINTN                     Port\r
-  );\r
-\r
-#endif\r
diff --git a/OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c b/OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c
deleted file mode 100644 (file)
index a466bae..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/** @file\r
-  Unaligned port I/O. This file has compiler specifics for Microsoft C as there\r
-  is no ANSI C standard for doing IO.\r
-\r
-  Based on IoLibMsc.c\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials are licensed and made available\r
-  under the terms and conditions of the BSD License which accompanies this\r
-  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
-#include "UnalignedIoInternal.h"\r
-\r
-unsigned long  _inpd (unsigned short port);\r
-unsigned long  _outpd (unsigned short port, unsigned long dataword );\r
-void          _ReadWriteBarrier (void);\r
-\r
-/**\r
-  Performs a 32-bit write to the specified, possibly unaligned I/O-type\r
-  address.\r
-\r
-  Writes the 32-bit I/O port specified by Port with the value specified by\r
-  Value and returns Value. This function must guarantee that all I/O read and\r
-  write operations are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port   I/O port address\r
-  @param[in]  Value  32-bit word to write\r
-\r
-  @return The value written to the I/O port.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoWrite32 (\r
-  IN      UINTN                     Port,\r
-  IN      UINT32                    Value\r
-  )\r
-{\r
-  _ReadWriteBarrier ();\r
-  _outpd ((UINT16)Port, Value);\r
-  _ReadWriteBarrier ();\r
-  return Value;\r
-}\r
-\r
-/**\r
-  Reads a 32-bit word from the specified, possibly unaligned I/O-type address.\r
-\r
-  Reads the 32-bit I/O port specified by Port. The 32-bit read value is\r
-  returned. This function must guarantee that all I/O read and write operations\r
-  are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port  The I/O port to read.\r
-\r
-  @return The value read.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoRead32 (\r
-  IN      UINTN                     Port\r
-  )\r
-{\r
-  UINT32                            Value;\r
-\r
-  _ReadWriteBarrier ();\r
-  Value = _inpd ((UINT16)Port);\r
-  _ReadWriteBarrier ();\r
-  return Value;\r
-}\r
diff --git a/OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c b/OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c
deleted file mode 100644 (file)
index 57560ab..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file\r
-  Unaligned port I/O dummy implementation for platforms which do not support it.\r
-\r
-  Copyright (c) 2017, Phil Dennis-Jordan.<BR>\r
-  This program and the accompanying materials are licensed and made available\r
-  under the terms and conditions of the BSD License which accompanies this\r
-  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
-#include <Library/DebugLib.h>\r
-#include "UnalignedIoInternal.h"\r
-\r
-/**\r
-  Performs a 32-bit write to the specified, possibly unaligned I/O-type\r
-  address.\r
-\r
-  Writes the 32-bit I/O port specified by Port with the value specified by\r
-  Value and returns Value. This function must guarantee that all I/O read and\r
-  write operations are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port   I/O port address\r
-  @param[in]  Value  32-bit word to write\r
-\r
-  @return The value written to the I/O port.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoWrite32 (\r
-  IN      UINTN                     Port,\r
-  IN      UINT32                    Value\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return Value;\r
-}\r
-\r
-/**\r
-  Reads a 32-bit word from the specified, possibly unaligned I/O-type address.\r
-\r
-  Reads the 32-bit I/O port specified by Port. The 32-bit read value is\r
-  returned. This function must guarantee that all I/O read and write operations\r
-  are serialized.\r
-\r
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().\r
-\r
-  @param[in]  Port  The I/O port to read.\r
-\r
-  @return The value read.\r
-\r
-**/\r
-UINT32\r
-UnalignedIoRead32 (\r
-  IN      UINTN                     Port\r
-  )\r
-{\r
-  ASSERT (FALSE);\r
-  return 0;\r
-}\r