xref: /netbsd-src/common/lib/libc/arch/i386/gen/byte_swap_4.S (revision 19ef5b5b0bcb90f63509df6e78769de1b57c2758)
1*19ef5b5bSuebayasi/*	$NetBSD: byte_swap_4.S,v 1.4 2014/05/23 03:17:31 uebayasi Exp $	*/
237c9f0a6Schristos
337c9f0a6Schristos/*-
437c9f0a6Schristos * Copyright (c) 1990 The Regents of the University of California.
537c9f0a6Schristos * All rights reserved.
637c9f0a6Schristos *
737c9f0a6Schristos * This code is derived from software contributed to Berkeley by
837c9f0a6Schristos * William Jolitz.
937c9f0a6Schristos *
1037c9f0a6Schristos * Redistribution and use in source and binary forms, with or without
1137c9f0a6Schristos * modification, are permitted provided that the following conditions
1237c9f0a6Schristos * are met:
1337c9f0a6Schristos * 1. Redistributions of source code must retain the above copyright
1437c9f0a6Schristos *    notice, this list of conditions and the following disclaimer.
1537c9f0a6Schristos * 2. Redistributions in binary form must reproduce the above copyright
1637c9f0a6Schristos *    notice, this list of conditions and the following disclaimer in the
1737c9f0a6Schristos *    documentation and/or other materials provided with the distribution.
1837c9f0a6Schristos * 3. Neither the name of the University nor the names of its contributors
1937c9f0a6Schristos *    may be used to endorse or promote products derived from this software
2037c9f0a6Schristos *    without specific prior written permission.
2137c9f0a6Schristos *
2237c9f0a6Schristos * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2337c9f0a6Schristos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2437c9f0a6Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2537c9f0a6Schristos * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2637c9f0a6Schristos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2737c9f0a6Schristos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2837c9f0a6Schristos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2937c9f0a6Schristos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3037c9f0a6Schristos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3137c9f0a6Schristos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3237c9f0a6Schristos * SUCH DAMAGE.
3337c9f0a6Schristos *
3437c9f0a6Schristos *	from: @(#)htonl.s	5.3 (Berkeley) 12/17/90
3537c9f0a6Schristos */
3637c9f0a6Schristos
3737c9f0a6Schristos#include <machine/asm.h>
3837c9f0a6Schristos#if defined(LIBC_SCCS)
39*19ef5b5bSuebayasi	RCSID("$NetBSD: byte_swap_4.S,v 1.4 2014/05/23 03:17:31 uebayasi Exp $")
4037c9f0a6Schristos#endif
4137c9f0a6Schristos
42a30f264fSyamt#if defined(_KERNEL) || defined(_STANDALONE)
43a30f264fSyamt_ENTRY(_C_LABEL(bswap32))
44a30f264fSyamt#else /* defined(_KERNEL) || defined(_STANDALONE) */
4537c9f0a6Schristos_ENTRY(_C_LABEL(__bswap32))
46a30f264fSyamt#endif /* defined(_KERNEL) || defined(_STANDALONE) */
4737c9f0a6Schristos_ENTRY(_C_LABEL(ntohl))
4837c9f0a6Schristos_ENTRY(_C_LABEL(htonl))
4937c9f0a6Schristos_PROF_PROLOGUE
5037c9f0a6Schristos	movl	4(%esp),%eax
510df165c0Sad	bswap	%eax
5237c9f0a6Schristos	ret
53*19ef5b5bSuebayasi#if defined(_KERNEL) || defined(_STANDALONE)
54*19ef5b5bSuebayasiEND(_C_LABEL(bswap32))
55*19ef5b5bSuebayasi#else /* defined(_KERNEL) || defined(_STANDALONE) */
56*19ef5b5bSuebayasiEND(_C_LABEL(__bswap32))
57*19ef5b5bSuebayasi#endif /* defined(_KERNEL) || defined(_STANDALONE) */
58*19ef5b5bSuebayasiEND(_C_LABEL(ntohl))
59*19ef5b5bSuebayasiEND(_C_LABEL(htonl))
60