summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-08-11 16:01:24 +0200
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-09-01 14:51:18 +0100
commita0cf6b8d93d7fab44f8bcb850ebbe696d0c3d4bd (patch)
treee7d35db10ee7a5f9cf2c16dd9c96381431666e9d /ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm
parent00afc8f82061677fedc86cb05e3b8c75a3c986ff (diff)
downloadedk2-a0cf6b8d93d7fab44f8bcb850ebbe696d0c3d4bd.tar.gz
edk2-a0cf6b8d93d7fab44f8bcb850ebbe696d0c3d4bd.tar.bz2
edk2-a0cf6b8d93d7fab44f8bcb850ebbe696d0c3d4bd.zip
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>
Diffstat (limited to 'ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm')
-rw-r--r--ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm50
1 files changed, 0 insertions, 50 deletions
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm
deleted file mode 100644
index bae3c1fada..0000000000
--- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memset.asm
+++ /dev/null
@@ -1,50 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-// Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
-//
-// This program and the accompanying materials
-// are licensed and made available under the terms and conditions of the BSD License
-// which accompanies this distribution. The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-//------------------------------------------------------------------------------
-
-
- EXPORT __aeabi_memset
- EXPORT __aeabi_memclr
- EXPORT __aeabi_memclr4
-
- AREA Memset, CODE, READONLY
-
-; void __aeabi_memclr4(void *dest, size_t n);
-; void __aeabi_memclr(void *dest, size_t n);
-__aeabi_memclr
-__aeabi_memclr4
- mov r2, #0
-
-;
-;VOID
-;EFIAPI
-;__aeabi_memset (
-; IN VOID *Destination,
-; IN UINT32 Size,
-; IN UINT32 Character
-; );
-;
-__aeabi_memset
- cmp r1, #0
- bxeq lr
- ; args = 0, pretend = 0, frame = 0
- ; frame_needed = 1, uses_anonymous_args = 0
-L10
- strb r2, [r0], #1
- subs r1, r1, #1
- ; While size is not 0
- bne L10
- bx lr
-
- END