VirtualBox

Ignore:
Timestamp:
Oct 29, 2015 4:30:44 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103777
Message:

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c

    r58459 r58466  
    11/** @file
    2   Support routines for memory allocation routines based 
     2  Support routines for memory allocation routines based
    33  on boot services for Dxe phase drivers.
    44
    55  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
    6   This program and the accompanying materials                         
    7   are licensed and made available under the terms and conditions of the BSD License         
    8   which accompanies this distribution.  The full text of the license may be found at       
    9   http://opensource.org/licenses/bsd-license.php.                                           
    10 
    11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
    12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
     6  This program and the accompanying materials
     7  are licensed and made available under the terms and conditions of the BSD License
     8  which accompanies this distribution.  The full text of the license may be found at
     9  http://opensource.org/licenses/bsd-license.php.
     10
     11  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     12  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1313
    1414**/
     
    3838VOID *
    3939InternalAllocatePages (
    40   IN EFI_MEMORY_TYPE  MemoryType, 
     40  IN EFI_MEMORY_TYPE  MemoryType,
    4141  IN UINTN            Pages
    4242  )
    4343{
    4444  EFI_STATUS            Status;
    45   EFI_PHYSICAL_ADDRESS  Memory; 
     45  EFI_PHYSICAL_ADDRESS  Memory;
    4646
    4747  if (Pages == 0) {
     
    130130  Allocation Library.  If it is not possible to free allocated pages, then this function will
    131131  perform no actions.
    132  
     132
    133133  If Buffer was not allocated with a page allocation function in the Memory Allocation Library,
    134134  then ASSERT().
    135135  If Pages is zero, then ASSERT().
    136  
     136
    137137  @param  Buffer                The pointer to the buffer of pages to free.
    138138  @param  Pages                 The number of 4 KB pages to free.
     
    173173VOID *
    174174InternalAllocateAlignedPages (
    175   IN EFI_MEMORY_TYPE  MemoryType, 
     175  IN EFI_MEMORY_TYPE  MemoryType,
    176176  IN UINTN            Pages,
    177177  IN UINTN            Alignment
     
    189189  //
    190190  ASSERT ((Alignment & (Alignment - 1)) == 0);
    191  
     191
    192192  if (Pages == 0) {
    193193    return NULL;
     
    203203    //
    204204    ASSERT (RealPages > Pages);
    205  
     205
    206206    Status         = gBS->AllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);
    207207    if (EFI_ERROR (Status)) {
     
    246246  returned.  If there is not enough memory at the specified alignment remaining to satisfy the
    247247  request, then NULL is returned.
    248  
     248
    249249  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    250250  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
     
    274274  returned.  If there is not enough memory at the specified alignment remaining to satisfy the
    275275  request, then NULL is returned.
    276  
     276
    277277  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    278278  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
     
    302302  returned.  If there is not enough memory at the specified alignment remaining to satisfy the
    303303  request, then NULL is returned.
    304  
     304
    305305  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    306306  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
     
    329329  Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer.  Buffer
    330330  must have been allocated on a previous call to the aligned page allocation services of the Memory
    331   Allocation Library.  If it is not possible to free allocated pages, then this function will 
     331  Allocation Library.  If it is not possible to free allocated pages, then this function will
    332332  perform no actions.
    333  
     333
    334334  If Buffer was not allocated with an aligned page allocation function in the Memory Allocation
    335335  Library, then ASSERT().
    336336  If Pages is zero, then ASSERT().
    337  
     337
    338338  @param  Buffer                The pointer to the buffer of pages to free.
    339339  @param  Pages                 The number of 4 KB pages to free.
     
    369369VOID *
    370370InternalAllocatePool (
    371   IN EFI_MEMORY_TYPE  MemoryType, 
     371  IN EFI_MEMORY_TYPE  MemoryType,
    372372  IN UINTN            AllocationSize
    373373  )
     
    462462VOID *
    463463InternalAllocateZeroPool (
    464   IN EFI_MEMORY_TYPE  PoolType, 
     464  IN EFI_MEMORY_TYPE  PoolType,
    465465  IN UINTN            AllocationSize
    466   ) 
     466  )
    467467{
    468468  VOID  *Memory;
     
    549549  is not enough memory remaining to satisfy the request, then NULL is returned.
    550550  If Buffer is NULL, then ASSERT().
    551   If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
     551  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
    552552
    553553  @param  PoolType              The type of pool to allocate.
     
    560560VOID *
    561561InternalAllocateCopyPool (
    562   IN EFI_MEMORY_TYPE  PoolType, 
     562  IN EFI_MEMORY_TYPE  PoolType,
    563563  IN UINTN            AllocationSize,
    564564  IN CONST VOID       *Buffer
    565   ) 
     565  )
    566566{
    567567  VOID  *Memory;
     
    575575  }
    576576  return Memory;
    577 } 
     577}
    578578
    579579/**
     
    584584  allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there
    585585  is not enough memory remaining to satisfy the request, then NULL is returned.
    586  
     586
    587587  If Buffer is NULL, then ASSERT().
    588   If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
     588  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
    589589
    590590  @param  AllocationSize        The number of bytes to allocate and zero.
     
    611611  allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there
    612612  is not enough memory remaining to satisfy the request, then NULL is returned.
    613  
     613
    614614  If Buffer is NULL, then ASSERT().
    615   If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
     615  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
    616616
    617617  @param  AllocationSize        The number of bytes to allocate and zero.
     
    638638  allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there
    639639  is not enough memory remaining to satisfy the request, then NULL is returned.
    640  
     640
    641641  If Buffer is NULL, then ASSERT().
    642   If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
     642  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
    643643
    644644  @param  AllocationSize        The number of bytes to allocate and zero.
     
    662662
    663663  Allocates and zeros the number bytes specified by NewSize from memory of the type
    664   specified by PoolType.  If OldBuffer is not NULL, then the smaller of OldSize and 
    665   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 
    666   OldBuffer is freed.  A pointer to the newly allocated buffer is returned. 
    667   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not 
     664  specified by PoolType.  If OldBuffer is not NULL, then the smaller of OldSize and
     665  NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
     666  OldBuffer is freed.  A pointer to the newly allocated buffer is returned.
     667  If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not
    668668  enough memory remaining to satisfy the request, then NULL is returned.
    669  
     669
    670670  If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
    671671  is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
     
    674674  @param  OldSize        The size, in bytes, of OldBuffer.
    675675  @param  NewSize        The size, in bytes, of the buffer to reallocate.
    676   @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an optional 
     676  @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an optional
    677677                         parameter that may be NULL.
    678678
     
    682682VOID *
    683683InternalReallocatePool (
    684   IN EFI_MEMORY_TYPE  PoolType, 
     684  IN EFI_MEMORY_TYPE  PoolType,
    685685  IN UINTN            OldSize,
    686686  IN UINTN            NewSize,
     
    702702
    703703  Allocates and zeros the number bytes specified by NewSize from memory of type
    704   EfiBootServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and 
    705   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 
    706   OldBuffer is freed.  A pointer to the newly allocated buffer is returned. 
    707   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not 
     704  EfiBootServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and
     705  NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
     706  OldBuffer is freed.  A pointer to the newly allocated buffer is returned.
     707  If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not
    708708  enough memory remaining to satisfy the request, then NULL is returned.
    709  
     709
    710710  If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
    711711  is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
     
    713713  @param  OldSize        The size, in bytes, of OldBuffer.
    714714  @param  NewSize        The size, in bytes, of the buffer to reallocate.
    715   @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an optional 
     715  @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an optional
    716716                         parameter that may be NULL.
    717717
     
    734734
    735735  Allocates and zeros the number bytes specified by NewSize from memory of type
    736   EfiRuntimeServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and 
    737   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 
    738   OldBuffer is freed.  A pointer to the newly allocated buffer is returned. 
    739   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not 
     736  EfiRuntimeServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and
     737  NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
     738  OldBuffer is freed.  A pointer to the newly allocated buffer is returned.
     739  If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not
    740740  enough memory remaining to satisfy the request, then NULL is returned.
    741741
     
    745745  @param  OldSize        The size, in bytes, of OldBuffer.
    746746  @param  NewSize        The size, in bytes, of the buffer to reallocate.
    747   @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an optional 
     747  @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an optional
    748748                         parameter that may be NULL.
    749749
     
    766766
    767767  Allocates and zeros the number bytes specified by NewSize from memory of type
    768   EfiReservedMemoryType.  If OldBuffer is not NULL, then the smaller of OldSize and 
    769   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 
    770   OldBuffer is freed.  A pointer to the newly allocated buffer is returned. 
    771   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not 
     768  EfiReservedMemoryType.  If OldBuffer is not NULL, then the smaller of OldSize and
     769  NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
     770  OldBuffer is freed.  A pointer to the newly allocated buffer is returned.
     771  If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not
    772772  enough memory remaining to satisfy the request, then NULL is returned.
    773773
     
    777777  @param  OldSize        The size, in bytes, of OldBuffer.
    778778  @param  NewSize        The size, in bytes, of the buffer to reallocate.
    779   @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an optional 
     779  @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an optional
    780780                         parameter that may be NULL.
    781781
     
    801801  pool allocation services of the Memory Allocation Library.  If it is not possible to free pool
    802802  resources, then this function will perform no actions.
    803  
     803
    804804  If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
    805805  then ASSERT().
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette