]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
BaseTools: Library hashing fix and optimization for --hash feature
[mirror_edk2.git] / PcAtChipsetPkg / IsaAcpiDxe / PcatIsaAcpi.c
index d82e2c4641b5ff081a9bdc7d9830c50144518e42..035bfaf0f16d43a7960790c7e5776036c602631d 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   EFI PCAT ISA ACPI Driver for a Generic PC Platform\r
 \r
-Copyright (c) 2006 - 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
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -42,8 +36,8 @@ PcatIsaAcpiDriverEntryPoint (
   )\r
 {\r
   return EfiLibInstallDriverBindingComponentName2 (\r
-           ImageHandle, \r
-           SystemTable, \r
+           ImageHandle,\r
+           SystemTable,\r
            &gPcatIsaAcpiDriverBinding,\r
            ImageHandle,\r
            &gPcatIsaAcpiComponentName,\r
@@ -54,7 +48,7 @@ PcatIsaAcpiDriverEntryPoint (
 /**\r
   ControllerDriver Protocol Method\r
 \r
-  @param This                 Driver Binding protocol instance pointer.   \r
+  @param This                 Driver Binding protocol instance pointer.\r
   @param Controller           Handle of device to test.\r
   @param RemainingDevicePath  Optional parameter use to pick a specific child\r
                               device to start.\r
@@ -80,10 +74,10 @@ PcatIsaAcpiDriverBindingSupported (
 \r
   //\r
   // Get PciIo protocol instance\r
-  //              \r
+  //\r
   Status = gBS->OpenProtocol (\r
-                  Controller,  \r
-                  &gEfiPciIoProtocolGuid, \r
+                  Controller,\r
+                  &gEfiPciIoProtocolGuid,\r
                   (VOID**)&PciIo,\r
                   This->DriverBindingHandle,\r
                   Controller,\r
@@ -97,7 +91,7 @@ PcatIsaAcpiDriverBindingSupported (
                     PciIo,\r
                     EfiPciIoWidthUint32,\r
                     0,\r
-                    sizeof(Pci) / sizeof(UINT32), \r
+                    sizeof(Pci) / sizeof(UINT32),\r
                     &Pci);\r
 \r
   if (!EFI_ERROR (Status)) {\r
@@ -109,23 +103,23 @@ PcatIsaAcpiDriverBindingSupported (
         //\r
         if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA) {\r
           Status = EFI_SUCCESS;\r
-        } \r
+        }\r
 \r
         //\r
         // See if this is an Intel PCI to ISA bridge in Positive Decode Mode\r
         //\r
-        if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE && \r
+        if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE &&\r
             Pci.Hdr.VendorId     == 0x8086                          ) {\r
           //\r
-          // See if this is on Function #0 to avoid false positives on \r
-          // PCI_CLASS_BRIDGE_OTHER that has the same value as \r
+          // See if this is on Function #0 to avoid false positives on\r
+          // PCI_CLASS_BRIDGE_OTHER that has the same value as\r
           // PCI_CLASS_BRIDGE_ISA_PDECODE\r
           //\r
           Status = PciIo->GetLocation (\r
-                            PciIo, \r
-                            &SegmentNumber, \r
-                            &BusNumber, \r
-                            &DeviceNumber, \r
+                            PciIo,\r
+                            &SegmentNumber,\r
+                            &BusNumber,\r
+                            &DeviceNumber,\r
                             &FunctionNumber\r
                             );\r
           if (!EFI_ERROR (Status) && FunctionNumber == 0) {\r
@@ -134,17 +128,17 @@ PcatIsaAcpiDriverBindingSupported (
             Status = EFI_UNSUPPORTED;\r
           }\r
         }\r
-      } \r
+      }\r
     }\r
   }\r
 \r
   gBS->CloseProtocol (\r
-         Controller,       \r
-         &gEfiPciIoProtocolGuid, \r
-         This->DriverBindingHandle,   \r
-         Controller   \r
+         Controller,\r
+         &gEfiPciIoProtocolGuid,\r
+         This->DriverBindingHandle,\r
+         Controller\r
          );\r
-  \r
+\r
   return Status;\r
 }\r
 \r
@@ -178,17 +172,18 @@ PcatIsaAcpiDriverBindingStart (
   Enabled = FALSE;\r
   Supports = 0;\r
   PcatIsaAcpiDev = NULL;\r
+  OriginalAttributes = 0;\r
   //\r
   // Open the PCI I/O Protocol Interface\r
   //\r
   PciIo = NULL;\r
   Status = gBS->OpenProtocol (\r
-                  Controller,       \r
-                  &gEfiPciIoProtocolGuid, \r
+                  Controller,\r
+                  &gEfiPciIoProtocolGuid,\r
                   (VOID**)&PciIo,\r
-                  This->DriverBindingHandle,   \r
-                  Controller,   \r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER \r
+                  This->DriverBindingHandle,\r
+                  Controller,\r
+                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
                   );\r
   if (EFI_ERROR (Status)) {\r
     goto Done;\r
@@ -224,10 +219,10 @@ PcatIsaAcpiDriverBindingStart (
   }\r
 \r
   Status = PciIo->Attributes (\r
-                    PciIo, \r
-                    EfiPciIoAttributeOperationEnable, \r
-                    EFI_PCI_DEVICE_ENABLE | Supports | EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO, \r
-                    NULL \r
+                    PciIo,\r
+                    EfiPciIoAttributeOperationEnable,\r
+                    EFI_PCI_DEVICE_ENABLE | Supports | EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO,\r
+                    NULL\r
                     );\r
   if (EFI_ERROR (Status)) {\r
     goto Done;\r
@@ -259,7 +254,7 @@ PcatIsaAcpiDriverBindingStart (
   // Initialize PcatIsaAcpiDeviceList\r
   //\r
   InitializePcatIsaAcpiDeviceList ();\r
-  \r
+\r
   //\r
   // IsaAcpi interface\r
   //\r
@@ -271,7 +266,7 @@ PcatIsaAcpiDriverBindingStart (
   (PcatIsaAcpiDev->IsaAcpi).EnableDevice     = IsaEnableDevice;\r
   (PcatIsaAcpiDev->IsaAcpi).InitDevice       = IsaInitDevice;\r
   (PcatIsaAcpiDev->IsaAcpi).InterfaceInit    = IsaInterfaceInit;\r
-    \r
+\r
   //\r
   // Install the ISA ACPI Protocol interface\r
   //\r
@@ -285,16 +280,16 @@ Done:
   if (EFI_ERROR (Status)) {\r
     if (PciIo != NULL && Enabled) {\r
       PciIo->Attributes (\r
-               PciIo, \r
+               PciIo,\r
                EfiPciIoAttributeOperationSet,\r
                OriginalAttributes,\r
-               NULL \r
+               NULL\r
                );\r
     }\r
     gBS->CloseProtocol (\r
-           Controller, \r
-           &gEfiPciIoProtocolGuid, \r
-           This->DriverBindingHandle, \r
+           Controller,\r
+           &gEfiPciIoProtocolGuid,\r
+           This->DriverBindingHandle,\r
            Controller\r
            );\r
     if (PcatIsaAcpiDev != NULL) {\r
@@ -302,7 +297,7 @@ Done:
     }\r
     return Status;\r
   }\r
-          \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -333,16 +328,16 @@ PcatIsaAcpiDriverBindingStop (
   EFI_STATUS             Status;\r
   EFI_ISA_ACPI_PROTOCOL  *IsaAcpi;\r
   PCAT_ISA_ACPI_DEV      *PcatIsaAcpiDev;\r
-  \r
+\r
   //\r
   // Get the ISA ACPI Protocol Interface\r
-  // \r
+  //\r
   Status = gBS->OpenProtocol (\r
-                  Controller, \r
-                  &gEfiIsaAcpiProtocolGuid, \r
+                  Controller,\r
+                  &gEfiIsaAcpiProtocolGuid,\r
                   (VOID**)&IsaAcpi,\r
-                  This->DriverBindingHandle,   \r
-                  Controller,   \r
+                  This->DriverBindingHandle,\r
+                  Controller,\r
                   EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                   );\r
   if (EFI_ERROR (Status)) {\r
@@ -379,13 +374,13 @@ PcatIsaAcpiDriverBindingStop (
   }\r
 \r
   gBS->CloseProtocol (\r
-         Controller, \r
-         &gEfiPciIoProtocolGuid, \r
-         This->DriverBindingHandle, \r
+         Controller,\r
+         &gEfiPciIoProtocolGuid,\r
+         This->DriverBindingHandle,\r
          Controller\r
          );\r
-  \r
+\r
   gBS->FreePool (PcatIsaAcpiDev);\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r