]> git.proxmox.com Git - mirror_edk2.git/commit
MdePkg/BaseMemoryLib: widen aligned accesses to 32 or 64 bits
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 2 Sep 2016 07:26:23 +0000 (08:26 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 13 Sep 2016 15:28:15 +0000 (16:28 +0100)
commit01f688be90f59cd1ea92195bd238e8d97295fbf1
treecb1975178c707423e817a6b1005b4f0a6ff79ba9
parent94a3845be698ddeed9d126363c755bd3bb13dd17
MdePkg/BaseMemoryLib: widen aligned accesses to 32 or 64 bits

Since the default BaseMemoryLib should be callable from any context,
including ones where unaligned accesses are not allowed, it implements
InternalCopyMem() and InternalSetMem() using byte accesses only.
However, especially in a context where the MMU is off, such narrow
accesses may be disproportionately costly, and so if the size and
alignment of the access allow it, use 32-bit or even 64-bit loads and
stores (the latter may be beneficial even on a 32-bit architectures like
ARM, which has load pair/store pair instructions)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
MdePkg/Library/BaseMemoryLib/CopyMem.c
MdePkg/Library/BaseMemoryLib/SetMem.c