aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-v850/byteorder.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-v850/byteorder.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-v850/byteorder.h')
-rw-r--r--include/asm-v850/byteorder.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/asm-v850/byteorder.h b/include/asm-v850/byteorder.h
new file mode 100644
index 000000000000..a6f07530050e
--- /dev/null
+++ b/include/asm-v850/byteorder.h
@@ -0,0 +1,48 @@
1/*
2 * include/asm-v850/byteorder.h -- Endian id and conversion ops
3 *
4 * Copyright (C) 2001 NEC Corporation
5 * Copyright (C) 2001 Miles Bader <miles@gnu.org>
6 *
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.
10 *
11 * Written by Miles Bader <miles@gnu.org>
12 */
13
14#ifndef __V850_BYTEORDER_H__
15#define __V850_BYTEORDER_H__
16
17#include <asm/types.h>
18#include <linux/compiler.h>
19
20#ifdef __GNUC__
21
22static __inline__ __attribute_const__ __u32 ___arch__swab32 (__u32 word)
23{
24 __u32 res;
25 __asm__ ("bsw %1, %0" : "=r" (res) : "r" (word));
26 return res;
27}
28
29static __inline__ __attribute_const__ __u16 ___arch__swab16 (__u16 half_word)
30{
31 __u16 res;
32 __asm__ ("bsh %1, %0" : "=r" (res) : "r" (half_word));
33 return res;
34}
35
36#define __arch__swab32(x) ___arch__swab32(x)
37#define __arch__swab16(x) ___arch__swab16(x)
38
39#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
40# define __BYTEORDER_HAS_U64__
41# define __SWAB_64_THRU_32__
42#endif
43
44#endif /* __GNUC__ */
45
46#include <linux/byteorder/little_endian.h>
47
48#endif /* __V850_BYTEORDER_H__ */