bswap32.S revision 1.3
11.3Smatt/*	$NetBSD: bswap32.S,v 1.3 2013/07/16 20:49:41 matt Exp $	*/
21.1Schristos
31.1Schristos/*
41.1Schristos * Copyright (C) 1996 Scott Reynolds.  All rights reserved.
51.1Schristos *
61.1Schristos * Redistribution and use in source and binary forms, with or without
71.1Schristos * modification, are permitted provided that the following conditions
81.1Schristos * are met:
91.1Schristos * 1. Redistributions of source code must retain the above copyright
101.1Schristos *    notice, this list of conditions and the following disclaimer.
111.1Schristos * 2. Redistributions in binary form must reproduce the above copyright
121.1Schristos *    notice, this list of conditions and the following disclaimer in the
131.1Schristos *    documentation and/or other materials provided with the distribution.
141.1Schristos * 3. The name of the author may not be used to endorse or promote products
151.1Schristos *    derived from this software without specific prior written permission
161.1Schristos *
171.1Schristos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
181.1Schristos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
191.1Schristos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
201.1Schristos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
211.1Schristos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
221.1Schristos * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231.1Schristos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241.1Schristos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251.1Schristos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
261.1Schristos * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271.1Schristos */
281.1Schristos
291.1Schristos#include <machine/asm.h>
301.1Schristos
311.2She#if defined(_KERNEL) || defined(_STANDALONE)
321.2She_ENTRY(_C_LABEL(bswap32))
331.2She#else /* defined(_KERNEL) || defined(_STANDALONE) */
341.2She_ENTRY(_C_LABEL(__bswap32))
351.2She#endif /* defined(_KERNEL) || defined(_STANDALONE) */
361.3Smatt	movl	4(%sp),%d0
371.1Schristos	rolw	#8,%d0
381.1Schristos	swap	%d0
391.1Schristos	rolw	#8,%d0
401.1Schristos	rts
41