xref: /openbsd-src/lib/libc/arch/arm/string/bcopy.S (revision 42d2c2455ee0051f8622220356dbb4ba4f195b14)
1*42d2c245Sguenther/*	$OpenBSD: bcopy.S,v 1.7 2022/05/24 17:15:23 guenther Exp $	*/
2d987040fSdrahn/*	$NetBSD: bcopy.S,v 1.2 2001/07/16 05:50:06 matt Exp $	*/
3d987040fSdrahn
4d987040fSdrahn/*-
5d987040fSdrahn * Copyright (c) 1997 The NetBSD Foundation, Inc.
6d987040fSdrahn * All rights reserved.
7d987040fSdrahn *
8d987040fSdrahn * This code is derived from software contributed to The NetBSD Foundation
9d987040fSdrahn * by Neil A. Carson and Mark Brinicombe
10d987040fSdrahn *
11d987040fSdrahn * Redistribution and use in source and binary forms, with or without
12d987040fSdrahn * modification, are permitted provided that the following conditions
13d987040fSdrahn * are met:
14d987040fSdrahn * 1. Redistributions of source code must retain the above copyright
15d987040fSdrahn *    notice, this list of conditions and the following disclaimer.
16d987040fSdrahn * 2. Redistributions in binary form must reproduce the above copyright
17d987040fSdrahn *    notice, this list of conditions and the following disclaimer in the
18d987040fSdrahn *    documentation and/or other materials provided with the distribution.
19d987040fSdrahn *
20d987040fSdrahn * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21d987040fSdrahn * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22d987040fSdrahn * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23d987040fSdrahn * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24d987040fSdrahn * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25d987040fSdrahn * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26d987040fSdrahn * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27d987040fSdrahn * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28d987040fSdrahn * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29d987040fSdrahn * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30d987040fSdrahn * POSSIBILITY OF SUCH DAMAGE.
31d987040fSdrahn */
32d987040fSdrahn
3338848718Sguenther#include "DEFS.h"
34d987040fSdrahn
35d987040fSdrahn/* bcopy = memcpy/memmove with arguments reversed. */
36d987040fSdrahn
37*42d2c245SguentherENTRY_NB(bcopy)
38d987040fSdrahn	/* switch the source and destination registers */
39d987040fSdrahn	eor     r0, r1, r0
40d987040fSdrahn	eor     r1, r0, r1
41d987040fSdrahn	eor     r0, r1, r0
428ead0783Sguenther	b	_memcpy
439b9d2a55SguentherEND_WEAK(bcopy)
44