xref: /openbsd-src/sys/lib/libkern/arch/arm/bcopy.S (revision 8162193374858e8d7dceca506657f13b21b8be44)
1*81621933Sguenther/*	$OpenBSD: bcopy.S,v 1.5 2022/12/08 01:25:45 guenther Exp $	*/
27c0511a1Sdrahn/*	$NetBSD: bcopy.S,v 1.2 2001/07/16 05:50:06 matt Exp $	*/
37c0511a1Sdrahn
47c0511a1Sdrahn/*-
57c0511a1Sdrahn * Copyright (c) 1997 The NetBSD Foundation, Inc.
67c0511a1Sdrahn * All rights reserved.
77c0511a1Sdrahn *
87c0511a1Sdrahn * This code is derived from software contributed to The NetBSD Foundation
97c0511a1Sdrahn * by Neil A. Carson and Mark Brinicombe
107c0511a1Sdrahn *
117c0511a1Sdrahn * Redistribution and use in source and binary forms, with or without
127c0511a1Sdrahn * modification, are permitted provided that the following conditions
137c0511a1Sdrahn * are met:
147c0511a1Sdrahn * 1. Redistributions of source code must retain the above copyright
157c0511a1Sdrahn *    notice, this list of conditions and the following disclaimer.
167c0511a1Sdrahn * 2. Redistributions in binary form must reproduce the above copyright
177c0511a1Sdrahn *    notice, this list of conditions and the following disclaimer in the
187c0511a1Sdrahn *    documentation and/or other materials provided with the distribution.
197c0511a1Sdrahn *
207c0511a1Sdrahn * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
217c0511a1Sdrahn * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
227c0511a1Sdrahn * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
237c0511a1Sdrahn * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
247c0511a1Sdrahn * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
257c0511a1Sdrahn * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
267c0511a1Sdrahn * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
277c0511a1Sdrahn * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
287c0511a1Sdrahn * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
297c0511a1Sdrahn * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
307c0511a1Sdrahn * POSSIBILITY OF SUCH DAMAGE.
317c0511a1Sdrahn */
327c0511a1Sdrahn
337c0511a1Sdrahn#include <machine/asm.h>
347c0511a1Sdrahn
357c0511a1Sdrahn/* bcopy = memcpy/memmove with arguments reversed. */
367c0511a1Sdrahn
377c0511a1SdrahnENTRY(bcopy)
387c0511a1Sdrahn	/* switch the source and destination registers */
397c0511a1Sdrahn	eor     r0, r1, r0
407c0511a1Sdrahn	eor     r1, r0, r1
417c0511a1Sdrahn	eor     r0, r1, r0
42*81621933Sguenther	b	PIC_SYM(memmove, PLT)
43