ArmPkg/Library/CompilerIntrinsicsLib: Enable VS2017/ARM builds

Introduce CRT assembly replacements for __rt_sdiv, __rt_udiv,
__rt_udiv64, __rt_sdiv64, __rt_srsh (by reusing the RVCT code)
as well as memcpy and memset.
For MSFT compatibility, some of the code needs to be explicitly
forced to ARM, and the /oldit assembly flag needs to be added.
Also, while RVCT_ASM_EXPORT macro invocations have been removed,
the replacement code is designed to be as close as possible to
the one that would have been generated if using the macros.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
Pete Batard
2018-01-12 21:33:29 +08:00
committed by Liming Gao
parent 30939ff2bc
commit e58427e396
7 changed files with 185 additions and 32 deletions

View File

@@ -23,8 +23,12 @@
LIBRARY_CLASS = CompilerIntrinsicsLib
[Sources]
memcpy.c
memset.c
memcpy.c | RVCT
memcpy.c | GCC
memcpy_ms.c | MSFT
memset.c | RVCT
memset.c | GCC
memset_ms.c | MSFT
[Sources.ARM]
Arm/mullu.asm | RVCT
@@ -94,6 +98,10 @@
Arm/llsr.S | GCC
Arm/llsl.S | GCC
Arm/div.asm | MSFT
Arm/uldiv.asm | MSFT
Arm/ldivmod.asm | MSFT
Arm/llsr.asm | MSFT
[Packages]
MdePkg/MdePkg.dec
@@ -101,3 +109,7 @@
[LibraryClasses]
[BuildOptions]
MSFT:*_*_ARM_CC_FLAGS = /GL-
MSFT:*_*_ARM_ASM_FLAGS = /oldit
MSFT:*_*_AARCH64_CC_FLAGS = /GL-