OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-sh/] [byteorder.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#ifndef __ASM_SH_BYTEORDER_H
2
#define __ASM_SH_BYTEORDER_H
3
 
4
/*
5
 * Copyright (C) 1999  Niibe Yutaka
6
 */
7
 
8
#include <asm/types.h>
9
 
10
static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
11
{
12
        __asm__("swap.b %0, %0\n\t"
13
                "swap.w %0, %0\n\t"
14
                "swap.b %0, %0"
15
                : "=r" (x)
16
                : "0" (x));
17
        return x;
18
}
19
 
20
static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
21
{
22
        __asm__("swap.b %0, %0"
23
                : "=r" (x)
24
                :  "0" (x));
25
        return x;
26
}
27
 
28
#define __arch__swab32(x) ___arch__swab32(x)
29
#define __arch__swab16(x) ___arch__swab16(x)
30
 
31
#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
32
#  define __BYTEORDER_HAS_U64__
33
#  define __SWAB_64_THRU_32__
34
#endif
35
 
36
#ifdef __LITTLE_ENDIAN__
37
#include <linux/byteorder/little_endian.h>
38
#else
39
#include <linux/byteorder/big_endian.h>
40
#endif
41
 
42
#endif /* __ASM_SH_BYTEORDER_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.