]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / XhciDxe / UsbHcMem.c
index 7c5261cca2114afb322adaece8e6917b2b6d978e..fd799884f6f1f92b77293585573416bc45d209f9 100644 (file)
@@ -2,14 +2,8 @@
 \r
   Routine procedures for memory allocate/free.\r
 \r
-Copyright (c) 2013 - 2016, 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) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -598,23 +592,23 @@ UsbHcFreeMem (
   return ;\r
 }\r
 \r
-/**  \r
+/**\r
   Allocates pages at a specified alignment that are suitable for an EfiPciIoOperationBusMasterCommonBuffer mapping.\r
-  \r
+\r
   If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r
 \r
   @param  PciIo                 The PciIo that can be used to access the host controller.\r
   @param  Pages                 The number of pages to allocate.\r
   @param  Alignment             The requested alignment of the allocation.  Must be a power of two.\r
   @param  HostAddress           The system memory address to map to the PCI controller.\r
-  @param  DeviceAddress         The resulting map address for the bus master PCI controller to \r
+  @param  DeviceAddress         The resulting map address for the bus master PCI controller to\r
                                 use to access the hosts HostAddress.\r
   @param  Mapping               A resulting value to pass to Unmap().\r
 \r
   @retval EFI_SUCCESS           Success to allocate aligned pages.\r
   @retval EFI_INVALID_PARAMETER Pages or Alignment is not valid.\r
   @retval EFI_OUT_OF_RESOURCES  Do not have enough resources to allocate memory.\r
-  \r
+\r
 \r
 **/\r
 EFI_STATUS\r
@@ -639,11 +633,11 @@ UsbHcAllocateAlignedPages (
   // Alignment must be a power of two or zero.\r
   //\r
   ASSERT ((Alignment & (Alignment - 1)) == 0);\r
-  \r
+\r
   if ((Alignment & (Alignment - 1)) != 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
\r
+\r
   if (Pages == 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -657,7 +651,7 @@ UsbHcAllocateAlignedPages (
     // Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.\r
     //\r
     ASSERT (RealPages > Pages);\r
\r
+\r
     Status = PciIo->AllocateBuffer (\r
                       PciIo,\r
                       AllocateAnyPages,\r
@@ -665,7 +659,7 @@ UsbHcAllocateAlignedPages (
                       Pages,\r
                       &Memory,\r
                       0\r
-                      );    \r
+                      );\r
     if (EFI_ERROR (Status)) {\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
@@ -719,7 +713,7 @@ UsbHcAllocateAlignedPages (
     Status = PciIo->FreeBuffer (PciIo, Pages, (VOID *) AlignedMemory);\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   *HostAddress = (VOID *) AlignedMemory;\r
 \r
   return EFI_SUCCESS;\r
@@ -727,7 +721,7 @@ UsbHcAllocateAlignedPages (
 \r
 /**\r
   Frees memory that was allocated with UsbHcAllocateAlignedPages().\r
-  \r
+\r
   @param  PciIo                 The PciIo that can be used to access the host controller.\r
   @param  HostAddress           The system memory address to map to the PCI controller.\r
   @param  Pages                 The number of 4 KB pages to free.\r
@@ -743,9 +737,9 @@ UsbHcFreeAlignedPages (
   )\r
 {\r
   EFI_STATUS      Status;\r
-  \r
+\r
   ASSERT (Pages != 0);\r
-  \r
+\r
   Status = PciIo->Unmap (PciIo, Mapping);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
@@ -753,6 +747,6 @@ UsbHcFreeAlignedPages (
                     PciIo,\r
                     Pages,\r
                     HostAddress\r
-                    );     \r
+                    );\r
   ASSERT_EFI_ERROR (Status);\r
 }\r