2 * include/asm-v850/byteorder.h -- Endian id and conversion ops
4 * Copyright (C) 2001 NEC Corporation
5 * Copyright (C) 2001 Miles Bader <miles@gnu.org>
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this
9 * archive for more details.
11 * Written by Miles Bader <miles@gnu.org>
14 #ifndef __V850_BYTEORDER_H__
15 #define __V850_BYTEORDER_H__
17 #include <asm/types.h>
18 #include <linux/compiler.h>
22 static __inline__ __attribute_const__ __u32 ___arch__swab32 (__u32 word)
25 __asm__ ("bsw %1, %0" : "=r" (res) : "r" (word));
29 static __inline__ __attribute_const__ __u16 ___arch__swab16 (__u16 half_word)
32 __asm__ ("bsh %1, %0" : "=r" (res) : "r" (half_word));
36 #define __arch__swab32(x) ___arch__swab32(x)
37 #define __arch__swab16(x) ___arch__swab16(x)
39 #if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
40 # define __BYTEORDER_HAS_U64__
41 # define __SWAB_64_THRU_32__
46 #include <linux/byteorder/little_endian.h>
48 #endif /* __V850_BYTEORDER_H__ */