VirtualBox

Ignore:
Timestamp:
Oct 29, 2015 4:30:44 AM (9 years ago)
Author:
vboxsync
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:
3 edited

Legend:

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

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

    r58459 r58466  
    11/** @file
    2   Support routines for memory allocation routines based 
     2  Support routines for memory allocation routines based
    33  on SMM Services Table services for SMM phase drivers.
    4  
     4
    55  The PI System Management Mode Core Interface Specification only allows the use
    6   of EfiRuntimeServicesCode and EfiRuntimeServicesData memory types for memory 
    7   allocations through the SMM Services Table.  The functions in the Memory 
     6  of EfiRuntimeServicesCode and EfiRuntimeServicesData memory types for memory
     7  allocations through the SMM Services Table.  The functions in the Memory
    88  Allocation Library use EfiBootServicesData as the default memory allocation
    9   type.  For this SMM specific instance of the Memory Allocation Library, 
     9  type.  For this SMM specific instance of the Memory Allocation Library,
    1010  EfiRuntimeServicesData is used as the default memory type for all allocations.
    11   In addition, allocation for the Reserved memory types are not supported and 
     11  In addition, allocation for the Reserved memory types are not supported and
    1212  will always return NULL.
    1313
    1414  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
    15   This program and the accompanying materials                         
    16   are licensed and made available under the terms and conditions of the BSD License         
    17   which accompanies this distribution.  The full text of the license may be found at       
    18   http://opensource.org/licenses/bsd-license.php.                                           
    19 
    20   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
    21   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
     15  This program and the accompanying materials
     16  are licensed and made available under the terms and conditions of the BSD License
     17  which accompanies this distribution.  The full text of the license may be found at
     18  http://opensource.org/licenses/bsd-license.php.
     19
     20  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     21  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    2222
    2323**/
     
    3737/**
    3838  The constructor function caches SMRAM ranges that are present in the system.
    39    
     39
    4040  It will ASSERT() if SMM Access2 Protocol doesn't exist.
    4141  It will ASSERT() if SMRAM ranges can't be got.
    42   It will ASSERT() if Resource can't be allocated for cache SMRAM range. 
     42  It will ASSERT() if Resource can't be allocated for cache SMRAM range.
    4343  It will always return EFI_SUCCESS.
    4444
     
    6464  //
    6565  Status = gBS->LocateProtocol (
    66                   &gEfiSmmAccess2ProtocolGuid, 
    67                   NULL, 
     66                  &gEfiSmmAccess2ProtocolGuid,
     67                  NULL,
    6868                  (VOID **)&SmmAccess
    6969                  );
     
    8989
    9090/**
    91   If SMM driver exits with an error, it must call this routine 
     91  If SMM driver exits with an error, it must call this routine
    9292  to free the allocated resource before the exiting.
    9393
     
    126126
    127127  for (Index = 0; Index < mSmramRangeCount; Index ++) {
    128     if (((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer >= mSmramRanges[Index].CpuStart) && 
     128    if (((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer >= mSmramRanges[Index].CpuStart) &&
    129129        ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer < (mSmramRanges[Index].CpuStart + mSmramRanges[Index].PhysicalSize))) {
    130130      return TRUE;
     
    138138  Allocates one or more 4KB pages of a certain memory type.
    139139
    140   Allocates the number of 4KB pages of a certain memory type and returns a pointer 
    141   to the allocated buffer.  The buffer returned is aligned on a 4KB boundary.  If 
    142   Pages is 0, then NULL is returned.   If there is not enough memory remaining to 
     140  Allocates the number of 4KB pages of a certain memory type and returns a pointer
     141  to the allocated buffer.  The buffer returned is aligned on a 4KB boundary.  If
     142  Pages is 0, then NULL is returned.   If there is not enough memory remaining to
    143143  satisfy the request, then NULL is returned.
    144144
     
    151151VOID *
    152152InternalAllocatePages (
    153   IN EFI_MEMORY_TYPE  MemoryType, 
     153  IN EFI_MEMORY_TYPE  MemoryType,
    154154  IN UINTN            Pages
    155155  )
    156156{
    157157  EFI_STATUS            Status;
    158   EFI_PHYSICAL_ADDRESS  Memory; 
     158  EFI_PHYSICAL_ADDRESS  Memory;
    159159
    160160  if (Pages == 0) {
     
    172172  Allocates one or more 4KB pages of type EfiBootServicesData.
    173173
    174   Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer 
    175   to the allocated buffer.  The buffer returned is aligned on a 4KB boundary.  If 
    176   Pages is 0, then NULL is returned.  If there is not enough memory remaining to 
     174  Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer
     175  to the allocated buffer.  The buffer returned is aligned on a 4KB boundary.  If
     176  Pages is 0, then NULL is returned.  If there is not enough memory remaining to
    177177  satisfy the request, then NULL is returned.
    178178
     
    194194  Allocates one or more 4KB pages of type EfiRuntimeServicesData.
    195195
    196   Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a 
    197   pointer to the allocated buffer.  The buffer returned is aligned on a 4KB boundary. 
    198   If Pages is 0, then NULL is returned.  If there is not enough memory remaining 
     196  Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a
     197  pointer to the allocated buffer.  The buffer returned is aligned on a 4KB boundary.
     198  If Pages is 0, then NULL is returned.  If there is not enough memory remaining
    199199  to satisfy the request, then NULL is returned.
    200200
     
    216216  Allocates one or more 4KB pages of type EfiReservedMemoryType.
    217217
    218   Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a 
    219   pointer to the allocated buffer.  The buffer returned is aligned on a 4KB boundary. 
    220   If Pages is 0, then NULL is returned.  If there is not enough memory remaining 
     218  Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a
     219  pointer to the allocated buffer.  The buffer returned is aligned on a 4KB boundary.
     220  If Pages is 0, then NULL is returned.  If there is not enough memory remaining
    221221  to satisfy the request, then NULL is returned.
    222222
     
    239239  functions in the Memory Allocation Library.
    240240
    241   Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. 
    242   Buffer must have been allocated on a previous call to the page allocation services 
    243   of the Memory Allocation Library.  If it is not possible to free allocated pages, 
     241  Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer.
     242  Buffer must have been allocated on a previous call to the page allocation services
     243  of the Memory Allocation Library.  If it is not possible to free allocated pages,
    244244  then this function will perform no actions.
    245  
    246   If Buffer was not allocated with a page allocation function in the Memory Allocation 
     245
     246  If Buffer was not allocated with a page allocation function in the Memory Allocation
    247247  Library, then ASSERT().
    248248  If Pages is zero, then ASSERT().
    249  
     249
    250250  @param  Buffer                The pointer to the buffer of pages to free.
    251251  @param  Pages                 The number of 4 KB pages to free.
     
    281281  Allocates one or more 4KB pages of a certain memory type at a specified alignment.
    282282
    283   Allocates the number of 4KB pages specified by Pages of a certain memory type 
    284   with an alignment specified by Alignment.  The allocated buffer is returned. 
    285   If Pages is 0, then NULL is returned. If there is not enough memory at the 
     283  Allocates the number of 4KB pages specified by Pages of a certain memory type
     284  with an alignment specified by Alignment.  The allocated buffer is returned.
     285  If Pages is 0, then NULL is returned. If there is not enough memory at the
    286286  specified alignment remaining to satisfy the request, then NULL is returned.
    287287  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
     
    290290  @param  MemoryType            The type of memory to allocate.
    291291  @param  Pages                 The number of 4 KB pages to allocate.
    292   @param  Alignment             The requested alignment of the allocation. 
     292  @param  Alignment             The requested alignment of the allocation.
    293293                                Must be a power of two.
    294294                                If Alignment is zero, then byte alignment is used.
     
    299299VOID *
    300300InternalAllocateAlignedPages (
    301   IN EFI_MEMORY_TYPE  MemoryType, 
     301  IN EFI_MEMORY_TYPE  MemoryType,
    302302  IN UINTN            Pages,
    303303  IN UINTN            Alignment
     
    315315  //
    316316  ASSERT ((Alignment & (Alignment - 1)) == 0);
    317  
     317
    318318  if (Pages == 0) {
    319319    return NULL;
     
    329329    //
    330330    ASSERT (RealPages > Pages);
    331  
     331
    332332    Status         = gSmst->SmmAllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);
    333333    if (EFI_ERROR (Status)) {
     
    368368  Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
    369369
    370   Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData 
    371   with an alignment specified by Alignment.  The allocated buffer is returned. 
    372   If Pages is 0, then NULL is returned.  If there is not enough memory at the 
     370  Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData
     371  with an alignment specified by Alignment.  The allocated buffer is returned.
     372  If Pages is 0, then NULL is returned.  If there is not enough memory at the
    373373  specified alignment remaining to satisfy the request, then NULL is returned.
    374  
     374
    375375  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    376376  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
    377377
    378378  @param  Pages                 The number of 4 KB pages to allocate.
    379   @param  Alignment             The requested alignment of the allocation. 
     379  @param  Alignment             The requested alignment of the allocation.
    380380                                Must be a power of two.
    381381                                If Alignment is zero, then byte alignment is used.
     
    397397  Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment.
    398398
    399   Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData 
    400   with an alignment specified by Alignment.  The allocated buffer is returned. 
    401   If Pages is 0, then NULL is returned.  If there is not enough memory at the 
     399  Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData
     400  with an alignment specified by Alignment.  The allocated buffer is returned.
     401  If Pages is 0, then NULL is returned.  If there is not enough memory at the
    402402  specified alignment remaining to satisfy the request, then NULL is returned.
    403  
     403
    404404  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    405405  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
    406406
    407407  @param  Pages                 The number of 4 KB pages to allocate.
    408   @param  Alignment             The requested alignment of the allocation. 
     408  @param  Alignment             The requested alignment of the allocation.
    409409                                Must be a power of two.
    410410                                If Alignment is zero, then byte alignment is used.
     
    426426  Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
    427427
    428   Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType 
    429   with an alignment specified by Alignment.  The allocated buffer is returned. 
    430   If Pages is 0, then NULL is returned.  If there is not enough memory at the 
     428  Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType
     429  with an alignment specified by Alignment.  The allocated buffer is returned.
     430  If Pages is 0, then NULL is returned.  If there is not enough memory at the
    431431  specified alignment remaining to satisfy the request, then NULL is returned.
    432  
     432
    433433  If Alignment is not a power of two and Alignment is not zero, then ASSERT().
    434434  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
    435435
    436436  @param  Pages                 The number of 4 KB pages to allocate.
    437   @param  Alignment             The requested alignment of the allocation. 
     437  @param  Alignment             The requested alignment of the allocation.
    438438                                Must be a power of two.
    439439                                If Alignment is zero, then byte alignment is used.
     
    456456  allocation functions in the Memory Allocation Library.
    457457
    458   Frees the number of 4KB pages specified by Pages from the buffer specified by 
    459   Buffer.  Buffer must have been allocated on a previous call to the aligned page 
    460   allocation services of the Memory Allocation Library.  If it is not possible to 
     458  Frees the number of 4KB pages specified by Pages from the buffer specified by
     459  Buffer.  Buffer must have been allocated on a previous call to the aligned page
     460  allocation services of the Memory Allocation Library.  If it is not possible to
    461461  free allocated pages, then this function will perform no actions.
    462  
    463   If Buffer was not allocated with an aligned page allocation function in the 
     462
     463  If Buffer was not allocated with an aligned page allocation function in the
    464464  Memory Allocation Library, then ASSERT().
    465465  If Pages is zero, then ASSERT().
    466  
     466
    467467  @param  Buffer                The pointer to the buffer of pages to free.
    468468  @param  Pages                 The number of 4 KB pages to free.
     
    498498  Allocates a buffer of a certain pool type.
    499499
    500   Allocates the number bytes specified by AllocationSize of a certain pool type 
    501   and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a 
    502   valid buffer of 0 size is returned.  If there is not enough memory remaining to 
     500  Allocates the number bytes specified by AllocationSize of a certain pool type
     501  and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a
     502  valid buffer of 0 size is returned.  If there is not enough memory remaining to
    503503  satisfy the request, then NULL is returned.
    504504
     
    511511VOID *
    512512InternalAllocatePool (
    513   IN EFI_MEMORY_TYPE  MemoryType, 
     513  IN EFI_MEMORY_TYPE  MemoryType,
    514514  IN UINTN            AllocationSize
    515515  )
     
    528528  Allocates a buffer of type EfiBootServicesData.
    529529
    530   Allocates the number bytes specified by AllocationSize of type EfiBootServicesData 
    531   and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a 
    532   valid buffer of 0 size is returned.  If there is not enough memory remaining to 
     530  Allocates the number bytes specified by AllocationSize of type EfiBootServicesData
     531  and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a
     532  valid buffer of 0 size is returned.  If there is not enough memory remaining to
    533533  satisfy the request, then NULL is returned.
    534534
     
    550550  Allocates a buffer of type EfiRuntimeServicesData.
    551551
    552   Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData 
    553   and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a 
    554   valid buffer of 0 size is returned.  If there is not enough memory remaining to 
     552  Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData
     553  and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a
     554  valid buffer of 0 size is returned.  If there is not enough memory remaining to
    555555  satisfy the request, then NULL is returned.
    556556
     
    572572  Allocates a buffer of type EfiReservedMemoryType.
    573573
    574   Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType 
    575   and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a 
    576   valid buffer of 0 size is returned.  If there is not enough memory remaining to 
     574  Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType
     575  and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a
     576  valid buffer of 0 size is returned.  If there is not enough memory remaining to
    577577  satisfy the request, then NULL is returned.
    578578
     
    594594  Allocates and zeros a buffer of a certain pool type.
    595595
    596   Allocates the number bytes specified by AllocationSize of a certain pool type, 
    597   clears the buffer with zeros, and returns a pointer to the allocated buffer. 
    598   If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there is 
     596  Allocates the number bytes specified by AllocationSize of a certain pool type,
     597  clears the buffer with zeros, and returns a pointer to the allocated buffer.
     598  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there is
    599599  not enough memory remaining to satisfy the request, then NULL is returned.
    600600
     
    607607VOID *
    608608InternalAllocateZeroPool (
    609   IN EFI_MEMORY_TYPE  PoolType, 
     609  IN EFI_MEMORY_TYPE  PoolType,
    610610  IN UINTN            AllocationSize
    611   ) 
     611  )
    612612{
    613613  VOID  *Memory;
     
    623623  Allocates and zeros a buffer of type EfiBootServicesData.
    624624
    625   Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, 
    626   clears the buffer with zeros, and returns a pointer to the allocated buffer. 
    627   If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there is 
     625  Allocates the number bytes specified by AllocationSize of type EfiBootServicesData,
     626  clears the buffer with zeros, and returns a pointer to the allocated buffer.
     627  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there is
    628628  not enough memory remaining to satisfy the request, then NULL is returned.
    629629
     
    645645  Allocates and zeros a buffer of type EfiRuntimeServicesData.
    646646
    647   Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, 
    648   clears the buffer with zeros, and returns a pointer to the allocated buffer. 
    649   If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there is 
     647  Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData,
     648  clears the buffer with zeros, and returns a pointer to the allocated buffer.
     649  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there is
    650650  not enough memory remaining to satisfy the request, then NULL is returned.
    651651
     
    667667  Allocates and zeros a buffer of type EfiReservedMemoryType.
    668668
    669   Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, 
    670   clears the   buffer with zeros, and returns a pointer to the allocated buffer. 
    671   If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there is 
     669  Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType,
     670  clears the   buffer with zeros, and returns a pointer to the allocated buffer.
     671  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there is
    672672  not enough memory remaining to satisfy the request, then NULL is returned.
    673673
     
    689689  Copies a buffer to an allocated buffer of a certain pool type.
    690690
    691   Allocates the number bytes specified by AllocationSize of a certain pool type, 
    692   copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 
    693   a pointer to the allocated buffer.  If AllocationSize is 0, then a valid buffer 
    694   of 0 size is returned.  If there is not enough memory remaining to satisfy the 
     691  Allocates the number bytes specified by AllocationSize of a certain pool type,
     692  copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns
     693  a pointer to the allocated buffer.  If AllocationSize is 0, then a valid buffer
     694  of 0 size is returned.  If there is not enough memory remaining to satisfy the
    695695  request, then NULL is returned. If Buffer is NULL, then ASSERT().
    696   If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
     696  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
    697697
    698698  @param  PoolType              The type of pool to allocate.
     
    705705VOID *
    706706InternalAllocateCopyPool (
    707   IN EFI_MEMORY_TYPE  PoolType, 
     707  IN EFI_MEMORY_TYPE  PoolType,
    708708  IN UINTN            AllocationSize,
    709709  IN CONST VOID       *Buffer
    710   ) 
     710  )
    711711{
    712712  VOID  *Memory;
     
    720720  }
    721721  return Memory;
    722 } 
     722}
    723723
    724724/**
    725725  Copies a buffer to an allocated buffer of type EfiBootServicesData.
    726726
    727   Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, 
    728   copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 
    729   a pointer to the allocated buffer.  If AllocationSize is 0, then a valid buffer 
    730   of 0 size is returned.  If there is not enough memory remaining to satisfy the 
     727  Allocates the number bytes specified by AllocationSize of type EfiBootServicesData,
     728  copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns
     729  a pointer to the allocated buffer.  If AllocationSize is 0, then a valid buffer
     730  of 0 size is returned.  If there is not enough memory remaining to satisfy the
    731731  request, then NULL is returned.
    732  
     732
    733733  If Buffer is NULL, then ASSERT().
    734   If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
     734  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
    735735
    736736  @param  AllocationSize        The number of bytes to allocate and zero.
     
    753753  Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
    754754
    755   Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, 
    756   copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 
    757   a pointer to the allocated buffer.  If AllocationSize is 0, then a valid buffer 
    758   of 0 size is returned.  If there is not enough memory remaining to satisfy the 
     755  Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData,
     756  copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns
     757  a pointer to the allocated buffer.  If AllocationSize is 0, then a valid buffer
     758  of 0 size is returned.  If there is not enough memory remaining to satisfy the
    759759  request, then NULL is returned.
    760  
     760
    761761  If Buffer is NULL, then ASSERT().
    762   If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
     762  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
    763763
    764764  @param  AllocationSize        The number of bytes to allocate and zero.
     
    781781  Copies a buffer to an allocated buffer of type EfiReservedMemoryType.
    782782
    783   Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, 
    784   copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns 
    785   a pointer to the allocated buffer.  If AllocationSize is 0, then a valid buffer 
    786   of 0 size is returned.  If there is not enough memory remaining to satisfy the 
     783  Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType,
     784  copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns
     785  a pointer to the allocated buffer.  If AllocationSize is 0, then a valid buffer
     786  of 0 size is returned.  If there is not enough memory remaining to satisfy the
    787787  request, then NULL is returned.
    788  
     788
    789789  If Buffer is NULL, then ASSERT().
    790   If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 
     790  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
    791791
    792792  @param  AllocationSize        The number of bytes to allocate and zero.
     
    810810
    811811  Allocates and zeros the number bytes specified by NewSize from memory of the type
    812   specified by PoolType.  If OldBuffer is not NULL, then the smaller of OldSize and 
    813   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 
    814   OldBuffer is freed.  A pointer to the newly allocated buffer is returned. 
    815   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not 
     812  specified by PoolType.  If OldBuffer is not NULL, then the smaller of OldSize and
     813  NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
     814  OldBuffer is freed.  A pointer to the newly allocated buffer is returned.
     815  If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not
    816816  enough memory remaining to satisfy the request, then NULL is returned.
    817  
    818   If the allocation of the new buffer is successful and the smaller of NewSize 
     817
     818  If the allocation of the new buffer is successful and the smaller of NewSize
    819819  and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
    820820
     
    822822  @param  OldSize        The size, in bytes, of OldBuffer.
    823823  @param  NewSize        The size, in bytes, of the buffer to reallocate.
    824   @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an 
     824  @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an
    825825                         optional parameter that may be NULL.
    826826
     
    830830VOID *
    831831InternalReallocatePool (
    832   IN EFI_MEMORY_TYPE  PoolType, 
     832  IN EFI_MEMORY_TYPE  PoolType,
    833833  IN UINTN            OldSize,
    834834  IN UINTN            NewSize,
     
    850850
    851851  Allocates and zeros the number bytes specified by NewSize from memory of type
    852   EfiBootServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and 
    853   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 
    854   OldBuffer is freed.  A pointer to the newly allocated buffer is returned. 
    855   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not 
     852  EfiBootServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and
     853  NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
     854  OldBuffer is freed.  A pointer to the newly allocated buffer is returned.
     855  If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not
    856856  enough memory remaining to satisfy the request, then NULL is returned.
    857  
    858   If the allocation of the new buffer is successful and the smaller of NewSize 
     857
     858  If the allocation of the new buffer is successful and the smaller of NewSize
    859859  and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
    860860
    861861  @param  OldSize        The size, in bytes, of OldBuffer.
    862862  @param  NewSize        The size, in bytes, of the buffer to reallocate.
    863   @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an 
     863  @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an
    864864                         optional parameter that may be NULL.
    865865
     
    882882
    883883  Allocates and zeros the number bytes specified by NewSize from memory of type
    884   EfiRuntimeServicesData.  If OldBuffer is not NULL, then the smaller of OldSize 
    885   and NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 
    886   OldBuffer is freed.  A pointer to the newly allocated buffer is returned. 
    887   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not 
     884  EfiRuntimeServicesData.  If OldBuffer is not NULL, then the smaller of OldSize
     885  and NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
     886  OldBuffer is freed.  A pointer to the newly allocated buffer is returned.
     887  If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not
    888888  enough memory remaining to satisfy the request, then NULL is returned.
    889889
    890   If the allocation of the new buffer is successful and the smaller of NewSize 
     890  If the allocation of the new buffer is successful and the smaller of NewSize
    891891  and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
    892892
    893893  @param  OldSize        The size, in bytes, of OldBuffer.
    894894  @param  NewSize        The size, in bytes, of the buffer to reallocate.
    895   @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an 
     895  @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an
    896896                         optional parameter that may be NULL.
    897897
     
    914914
    915915  Allocates and zeros the number bytes specified by NewSize from memory of type
    916   EfiReservedMemoryType.  If OldBuffer is not NULL, then the smaller of OldSize 
    917   and NewSize bytes are copied from OldBuffer to the newly allocated buffer, and 
    918   OldBuffer is freed.  A pointer to the newly allocated buffer is returned. 
    919   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not 
     916  EfiReservedMemoryType.  If OldBuffer is not NULL, then the smaller of OldSize
     917  and NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
     918  OldBuffer is freed.  A pointer to the newly allocated buffer is returned.
     919  If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not
    920920  enough memory remaining to satisfy the request, then NULL is returned.
    921921
    922   If the allocation of the new buffer is successful and the smaller of NewSize 
     922  If the allocation of the new buffer is successful and the smaller of NewSize
    923923  and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
    924924
    925925  @param  OldSize        The size, in bytes, of OldBuffer.
    926926  @param  NewSize        The size, in bytes, of the buffer to reallocate.
    927   @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an 
     927  @param  OldBuffer      The buffer to copy to the allocated buffer.  This is an
    928928                         optional parameter that may be NULL.
    929929
     
    943943
    944944/**
    945   Frees a buffer that was previously allocated with one of the pool allocation 
     945  Frees a buffer that was previously allocated with one of the pool allocation
    946946  functions in the Memory Allocation Library.
    947947
    948   Frees the buffer specified by Buffer.  Buffer must have been allocated on a 
    949   previous call to the pool allocation services of the Memory Allocation Library. 
    950   If it is not possible to free pool resources, then this function will perform 
     948  Frees the buffer specified by Buffer.  Buffer must have been allocated on a
     949  previous call to the pool allocation services of the Memory Allocation Library.
     950  If it is not possible to free pool resources, then this function will perform
    951951  no actions.
    952  
    953   If Buffer was not allocated with a pool allocation function in the Memory 
     952
     953  If Buffer was not allocated with a pool allocation function in the Memory
    954954  Allocation Library, then ASSERT().
    955955
  • trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf

    r58459 r58466  
    22# Instance of Memory Allocation Library using SMM Services Table.
    33#
    4 # Memory Allocation Library that uses services from the SMM Services Table to 
     4# Memory Allocation Library that uses services from the SMM Services Table to
    55# allocate and free memory.
    66#
     
    2323  VERSION_STRING                 = 1.0
    2424  PI_SPECIFICATION_VERSION       = 0x0001000A
    25   LIBRARY_CLASS                  = MemoryAllocationLib|DXE_SMM_DRIVER 
     25  LIBRARY_CLASS                  = MemoryAllocationLib|DXE_SMM_DRIVER
    2626  CONSTRUCTOR                    = SmmMemoryAllocationLibConstructor
    2727  DESTRUCTOR                     = SmmMemoryAllocationLibDestructor
     
    4444
    4545[Protocols]
    46   gEfiSmmAccess2ProtocolGuid    ## CONSUMES 
     46  gEfiSmmAccess2ProtocolGuid    ## CONSUMES
    4747
    4848[Depex]
Note: See TracChangeset for help on using the changeset viewer.

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