summaryrefslogtreecommitdiff
path: root/src/vm/arm/memcpy.S
blob: f5b2341c75509509ade4f734187fe4a8f69d40b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information. 
//

#include "unixasmmacros.inc"
#include "asmconstants.h"

.syntax unified
.thumb

//
// void *memcpy(void *dst, const void *src, size_t length)
//
// Copy a block of memory in a forward direction.
//

    LEAF_ENTRY FCallMemcpy, _TEXT
        cmp r2, #0
        
        beq LOCAL_LABEL(GC_POLL)
        
        ldr r3, [r0]
        ldr r3, [r1]
        
        push {lr}
        blx C_FUNC(memcpy)
        pop {lr}

LOCAL_LABEL(GC_POLL):
        ldr r0, =g_TrapReturningThreads
        ldr r0, [r0]
        cmp r0, #0
        it ne
        bne C_FUNC(FCallMemCpy_GCPoll)
        bx lr
    LEAF_END FCallMemcpy, _TEXT