1 /* Copyright (C) 2001 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 Modified for use in uClibc (C) 2007 Axis Communications AB.
5 Minimal modifications: include path name and #undef of WORD_COPY_FWD/BWD
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If not,
19 see <http://www.gnu.org/licenses/>. */
21 #include "../generic/memcopy.h"
23 /* We override the word-copying macros, partly because misalignment in one
24 pointer isn't cause for a special function, partly because we want to
25 get rid of all the static functions in generic/memcopy.c; these macros
26 are only used in memmove.c since we have arch-specific mempcpy, memcpy and
30 #define OP_T_THRES OPSIZ
33 #define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes) \
36 unsigned long enddst_bp = dst_bp + nbytes - (nbytes % OPSIZ); \
37 nbytes_left = (nbytes % OPSIZ); \
38 while (dst_bp < (unsigned long) enddst_bp) \
40 op_t x = *(op_t *) src_bp; \
42 *(op_t *) dst_bp = x; \
48 #define WORD_COPY_BWD(dst_bp, src_bp, nbytes_left, nbytes) \
51 unsigned long enddst_bp = dst_bp - nbytes + (nbytes % OPSIZ); \
52 nbytes_left = (nbytes % OPSIZ); \
53 while (dst_bp > enddst_bp) \
57 x = *(op_t *) src_bp; \
59 *(op_t *) dst_bp = x; \