]> git.proxmox.com Git - mirror_edk2.git/commit - ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
ArmPkg/CompilerIntrinsicsLib: replace memcpy and memset with C code
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 11 Aug 2016 14:01:24 +0000 (16:01 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 1 Sep 2016 13:51:18 +0000 (14:51 +0100)
commita0cf6b8d93d7fab44f8bcb850ebbe696d0c3d4bd
treee7d35db10ee7a5f9cf2c16dd9c96381431666e9d
parent00afc8f82061677fedc86cb05e3b8c75a3c986ff
ArmPkg/CompilerIntrinsicsLib: replace memcpy and memset with C code

This replaces the various implementations of memset and memcpy,
including the ARM RTABI ones (__aeabi_mem[set|clr]_[|4|8]) with
a single C implementation for each. The ones we have are either not
very sophisticated (ARM), or they are too sophisticated (memcpy() on
AARCH64, which may perform unaligned accesses) or already coded in C
(memset on AArch64).

The Tianocore codebase mandates the explicit use of its SetMem() and
CopyMem() equivalents, of which various implementations exist for use
in different contexts (PEI, DXE). Few compiler generated references to
these functions should remain, and so our implementations in this BASE
library should be small and usable with the MMU off.

So replace them with a simple C implementation that builds correctly
on GCC/AARCH64, CLANG/AARCH64, GCC/ARM, CLANG/ARM and RVCT/ARM.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memcpy.S [deleted file]
ArmPkg/Library/CompilerIntrinsicsLib/AArch64/memset.c [deleted file]
ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S [deleted file]
ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm [deleted file]
ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy4.asm [deleted file]
ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.S [deleted file]
ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm [deleted file]
ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c [new file with mode: 0644]
ArmPkg/Library/CompilerIntrinsicsLib/memset.c [new file with mode: 0644]