]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/DeviceIoOnPciRootBridgeIoThunk/DeviceIoOnPciRootBridgeIoThunk.c
BaseTools: Use absolute import in BPDG
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / DeviceIoOnPciRootBridgeIoThunk / DeviceIoOnPciRootBridgeIoThunk.c
index 91e6d23eadd0148ffb8aefaea04c13a2809a5176..da55e12178938b8a8addb4be5fc7be98ede4778d 100644 (file)
@@ -7,13 +7,13 @@ drivers/apps that may have used Device I/O.
 Device I/O is on list of deprecated protocols for UEFI 2.0 and later.\r
 This module module layers Device I/O on top of PCI Root Bridge I/O (Segment 0)\r
  Use if:\r
-   There are no R8.x modules present that produces Device I/O\r
+   There are no EDK modules present that produces Device I/O\r
    EFI drivers included that consume Device I/O\r
    Platform required to support EFI drivers that consume Device I/O\r
    Platform required to support EFI applications that consume Device I/O\r
 \r
-Copyright (c) 2008 Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2008 - 2012, 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
@@ -389,6 +389,15 @@ DEVICE_IO_PRIVATE_DATA gDeviceIoPrivateDataTemplate = {
   255   // SubordinateBus\r
 };\r
 \r
+/**\r
+  This notification function is invoked when an instance of the\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL is produced. It installs another instance of the\r
+  EFI_DEVICE_IO_PROTOCOL on the same handle.\r
+\r
+  @param  Event                 The event that occured\r
+  @param  Context               Context of event. Not used in this nofication function.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 PciRootBridgeIoNotificationEvent (\r
@@ -749,7 +758,7 @@ DeviceIoPciRead (
 \r
   Private = DEVICE_IO_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (Width < 0 || Width >= MMIO_COPY_UINT8) {\r
+  if ((UINT32)Width >= MMIO_COPY_UINT8) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -796,7 +805,7 @@ DeviceIoPciWrite (
 \r
   Private = DEVICE_IO_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (Width < 0 || Width >= MMIO_COPY_UINT8) {\r
+  if ((UINT32)Width >= MMIO_COPY_UINT8) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -889,7 +898,7 @@ AppendPciDevicePath (
               return ReturnDevicePath;\r
             }\r
           }\r
-          if (ThisFunc == 0 && !(PciPtr->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION)) {\r
+          if (ThisFunc == 0 && ((PciPtr->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION) != HEADER_TYPE_MULTI_FUNCTION)) {\r
             //\r
             // Skip sub functions, this is not a multi function device\r
             //\r
@@ -1020,7 +1029,7 @@ DeviceIoMap (
 \r
   Private = DEVICE_IO_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  if (Operation < 0 || Operation > EfiBusMasterCommonBuffer) {\r
+  if ((UINT32)Operation > EfiBusMasterCommonBuffer) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -1114,7 +1123,7 @@ DeviceIoAllocateBuffer (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if ((Type >= MaxAllocateType) || (Type < AllocateAnyPages)) {\r
+  if ((UINT32)Type >= MaxAllocateType) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r