blob: f212d05565fe257f998ac1b91c36343a7da55711 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28#include <stddef.h>
29#include <string.h>
30
31void* __dso_handle = 0;
32
33/* Make this a weak symbol to avoid a multiple definition error when linking
34 * with libstdc++-v3. */
35int __attribute__((weak))
36__aeabi_atexit (void *object, void (*destructor) (void *), void *dso_handle)
37{
38 //return __cxa_atexit(destructor, object, dso_handle);
39 return 0;
40}
41
42
43void __aeabi_memcpy8(void *dest, const void *src, size_t n) {
44 memcpy(dest, src, n);
45}
46
47void __aeabi_memcpy4(void *dest, const void *src, size_t n) {
48 memcpy(dest, src, n);
49}
50
51void __aeabi_memcpy(void *dest, const void *src, size_t n) {
52 memcpy(dest, src, n);
53}
54
55
56void __aeabi_memmove8(void *dest, const void *src, size_t n) {
57 memmove(dest, src, n);
58}
59
60void __aeabi_memmove4(void *dest, const void *src, size_t n) {
61 memmove(dest, src, n);
62}
63
64void __aeabi_memmove(void *dest, const void *src, size_t n) {
65 memmove(dest, src, n);
66}
67
68/*
69 * __aeabi_memset has the order of its second and third arguments reversed.
70 * This allows __aeabi_memclr to tail-call __aeabi_memset
71 */
72
73void __aeabi_memset8(void *dest, size_t n, int c) {
74 memset(dest, c, n);
75}
76
77void __aeabi_memset4(void *dest, size_t n, int c) {
78 memset(dest, c, n);
79}
80
81void __aeabi_memset(void *dest, size_t n, int c) {
82 memset(dest, c, n);
83}
84
85
86void __aeabi_memclr8(void *dest, size_t n) {
87 __aeabi_memset8(dest, n, 0);
88}
89
90void __aeabi_memclr4(void *dest, size_t n) {
91 __aeabi_memset4(dest, n, 0);
92}
93
94void __aeabi_memclr(void *dest, size_t n) {
95 __aeabi_memset(dest, n, 0);
96}