mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / strings / bmove_upp.c
blobf411029fefa27d14999ae0f3fb928444edfc9e82
1 /* Copyright (c) 2000, 2001, 2007 MySQL AB
2 Use is subject to license terms.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 /* File : bmove.c
19 Author : Michael widenius
20 Updated: 1987-03-20
21 Defines: bmove_upp()
23 bmove_upp(dst, src, len) moves exactly "len" bytes from the source
24 "src-len" to the destination "dst-len" counting downwards.
27 #include <my_global.h>
28 #include "m_string.h"
30 #if defined(MC68000) && defined(DS90)
32 /* 0 <= len <= 65535 */
33 void bmove_upp(byte *dst, const byte *src,uint len)
35 asm(" movl 12(a7),d0 ");
36 asm(" subql #1,d0 ");
37 asm(" blt .L5 ");
38 asm(" movl 4(a7),a1 ");
39 asm(" movl 8(a7),a0 ");
40 asm(".L4: movb -(a0),-(a1) ");
41 asm(" dbf d0,.L4 ");
42 asm(".L5: ");
44 #else
46 void bmove_upp(register uchar *dst, register const uchar *src,
47 register size_t len)
49 while (len-- != 0) *--dst = *--src;
52 #endif