]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Core/Dxe/Mem/Pool.c
MdeModulePkg: use correct granularity when allocating pool pages
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 6 Mar 2015 02:54:05 +0000 (02:54 +0000)
committerlgao4 <lgao4@Edk2>
Fri, 6 Mar 2015 02:54:05 +0000 (02:54 +0000)
commit7970100ccbd48e6f931b078cb8e615eabee26141
tree577ee21d8770d5cd6e28934a689bdec795dec65e
parent09f08c92b2c413b7c369daf65a70e739939fe87b
MdeModulePkg: use correct granularity when allocating pool pages

After fixing the sanity check on the alignment of the runtime regions
in SVN revision #16630 ("MdeModulePkg/DxeMain: Fix wrong sanity check
in CoreTerminateMemoryMap()"), it is no longer possible to define a
runtime allocation alignment that is different from the boot time
allocation alignment.

For instance, #defining the following in MdeModulePkg/Core/Dxe/Mem/Imem.h
will hit the ASSERT () in MdeModulePkg/Core/Dxe/Mem/Page.c:1798

  #define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT  (SIZE_64KB)
  #define DEFAULT_PAGE_ALLOCATION                     (EFI_PAGE_SIZE)

(which is needed for 64-bit ARM to adhere to the Server Base Boot
Requirements [SBBR], which stipulates that all runtime memory regions
should be naturally aligned multiples of 64 KB)

This patch fixes this use case by ensuring that the backing for the memory
pools is allocated in appropriate chunks for the memory type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17011 6f19259b-4bc3-4df7-8a09-765794883524
MdeModulePkg/Core/Dxe/Mem/Pool.c