]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove dependency on PCI Root Bridge I/O Protocol. This library should only layer...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 7 Jan 2010 22:03:51 +0000 (22:03 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 7 Jan 2010 22:03:51 +0000 (22:03 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9690 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h
IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.inf
IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLib.c

index 23ce633b1d4b744fe0cfbfe517345440a771d97f..d22c91923a697f5266edd7771024b41609112c81 100644 (file)
@@ -4,7 +4,7 @@
   for implementation of IoLib library instance. It is included \r
   all source code of this library instance.\r
   \r
-  Copyright (c) 2006, Intel Corporation\r
+  Copyright (c) 2006 - 2010, Intel Corporation\r
   All rights reserved. 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
 \r
 #include <FrameworkDxe.h>\r
 \r
-\r
 #include <Protocol/CpuIo.h>\r
-#include <Protocol/PciRootBridgeIo.h>\r
-\r
 \r
 #include <Library/IoLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
index ff23d27ec950a827846ef1870975341994dfa954..3e8a54447afb8cfca99eca456675174d35c3ae18 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 # I/O Library implementation that uses the CPU I/O Protocol for I/O\r
 #  and MMIO operations.\r
-# Copyright (c) 2006, Intel Corporation.\r
+# Copyright (c) 2006 - 2010, Intel Corporation.\r
 #\r
 #  All rights reserved. This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -22,8 +22,6 @@
   MODULE_TYPE                    = DXE_DRIVER\r
   VERSION_STRING                 = 1.0\r
   LIBRARY_CLASS                  = IoLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
-  EFI_SPECIFICATION_VERSION      = 0x00020000\r
-\r
   CONSTRUCTOR                    = IoLibConstructor\r
 \r
 #\r
   IoHighLevel.c\r
   IoLib.c\r
 \r
-\r
 [Packages]\r
   MdePkg/MdePkg.dec\r
   IntelFrameworkPkg/IntelFrameworkPkg.dec\r
 \r
-\r
 [LibraryClasses]\r
   BaseLib\r
   DebugLib\r
@@ -51,7 +47,6 @@
 \r
 [Protocols]\r
   gEfiCpuIoProtocolGuid                         # PROTOCOL ALWAYS_CONSUMED\r
-  gEfiPciRootBridgeIoProtocolGuid               # PROTOCOL ALWAYS_CONSUMED\r
 \r
 [Depex]\r
-  gEfiCpuIoProtocolGuid OR gEfiPciRootBridgeIoProtocolGuid      
\ No newline at end of file
+  gEfiCpuIoProtocolGuid
\ No newline at end of file
index ff0e32329168f2191adb3e929d35580b22cb8271..c01555974f63f8f147901019ea2bd92c993e4476 100644 (file)
@@ -3,7 +3,7 @@
   The implementation of I/O operation for this library instance \r
   are based on EFI_CPU_IO_PROTOCOL.\r
   \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006-2010, Intel Corporation<BR>\r
   All rights reserved. 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
@@ -22,8 +22,7 @@
 //\r
 // Globle varible to cache pointer to CpuIo protocol.\r
 //\r
-EFI_CPU_IO_PROTOCOL              *mCpuIo = NULL;\r
-EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL  *mPciRootBridgeIo = NULL;\r
+EFI_CPU_IO_PROTOCOL  *mCpuIo = NULL;\r
 \r
 /**\r
   The constructor function caches the pointer to CpuIo protocol.\r
@@ -44,12 +43,9 @@ IoLibConstructor (
   IN      EFI_SYSTEM_TABLE          *SystemTable\r
   )\r
 {\r
-  EFI_STATUS                        Status;\r
+  EFI_STATUS  Status;\r
 \r
-  Status = gBS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID **) &mPciRootBridgeIo);\r
-  if (EFI_ERROR (Status)) {\r
-    Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, (VOID **) &mCpuIo);\r
-  }\r
+  Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, (VOID **) &mCpuIo);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   return Status;\r
@@ -72,18 +68,14 @@ IoLibConstructor (
 UINT64\r
 EFIAPI\r
 IoReadWorker (\r
-  IN      UINTN                     Port,\r
-  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width\r
+  IN      UINTN                      Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH  Width\r
   )\r
 {\r
   EFI_STATUS                        Status;\r
   UINT64                            Data;\r
 \r
-  if (mPciRootBridgeIo != NULL) {\r
-    Status = mPciRootBridgeIo->Io.Read (mPciRootBridgeIo, (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width, Port, 1, &Data);\r
-  } else {\r
-    Status = mCpuIo->Io.Read (mCpuIo, Width, Port, 1, &Data);\r
-  }\r
+  Status = mCpuIo->Io.Read (mCpuIo, Width, Port, 1, &Data);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   return Data;\r
@@ -107,18 +99,14 @@ IoReadWorker (
 UINT64\r
 EFIAPI\r
 IoWriteWorker (\r
-  IN      UINTN                     Port,\r
-  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
-  IN      UINT64                    Data\r
+  IN      UINTN                      Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH  Width,\r
+  IN      UINT64                     Data\r
   )\r
 {\r
-  EFI_STATUS                        Status;\r
+  EFI_STATUS  Status;\r
 \r
-  if (mPciRootBridgeIo != NULL) {\r
-    Status = mPciRootBridgeIo->Io.Write (mPciRootBridgeIo, (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width, Port, 1, &Data);\r
-  } else {\r
-    Status = mCpuIo->Io.Write (mCpuIo, Width, Port, 1, &Data);\r
-  }\r
+  Status = mCpuIo->Io.Write (mCpuIo, Width, Port, 1, &Data);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   return Data;\r
@@ -141,18 +129,14 @@ IoWriteWorker (
 UINT64\r
 EFIAPI\r
 MmioReadWorker (\r
-  IN      UINTN                     Address,\r
-  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width\r
+  IN      UINTN                      Address,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH  Width\r
   )\r
 {\r
-  EFI_STATUS                        Status;\r
-  UINT64                            Data;\r
+  EFI_STATUS  Status;\r
+  UINT64      Data;\r
 \r
-  if (mPciRootBridgeIo != NULL) {\r
-    Status = mPciRootBridgeIo->Mem.Read (mPciRootBridgeIo, (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width, Address, 1, &Data);\r
-  } else {\r
-    Status = mCpuIo->Mem.Read (mCpuIo, Width, Address, 1, &Data);\r
-  }\r
+  Status = mCpuIo->Mem.Read (mCpuIo, Width, Address, 1, &Data);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   return Data;\r
@@ -176,18 +160,14 @@ MmioReadWorker (
 UINT64\r
 EFIAPI\r
 MmioWriteWorker (\r
-  IN      UINTN                     Address,\r
-  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
-  IN      UINT64                    Data\r
+  IN      UINTN                      Address,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH  Width,\r
+  IN      UINT64                     Data\r
   )\r
 {\r
-  EFI_STATUS                        Status;\r
+  EFI_STATUS  Status;\r
 \r
-  if (mPciRootBridgeIo != NULL) {\r
-    Status = mPciRootBridgeIo->Mem.Write (mPciRootBridgeIo, (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width, Address, 1, &Data);\r
-  } else {\r
-    Status = mCpuIo->Mem.Write (mCpuIo, Width, Address, 1, &Data);\r
-  }\r
+  Status = mCpuIo->Mem.Write (mCpuIo, Width, Address, 1, &Data);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   return Data;\r