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

Subversion Repositories or1k

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

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

Line No. Rev Author Line
1 1276 phoenix
/* $Id: byteorder.h,v 1.1.1.1 2004-04-15 03:01:04 phoenix Exp $ */
2
#ifndef _SPARC64_BYTEORDER_H
3
#define _SPARC64_BYTEORDER_H
4
 
5
#include <asm/types.h>
6
#include <asm/asi.h>
7
 
8
#ifdef __GNUC__
9
 
10
static __inline__ __u16 ___arch__swab16p(__u16 *addr)
11
{
12
        __u16 ret;
13
 
14
        __asm__ __volatile__ ("lduha [%1] %2, %0"
15
                              : "=r" (ret)
16
                              : "r" (addr), "i" (ASI_PL));
17
        return ret;
18
}
19
 
20
static __inline__ __u32 ___arch__swab32p(__u32 *addr)
21
{
22
        __u32 ret;
23
 
24
        __asm__ __volatile__ ("lduwa [%1] %2, %0"
25
                              : "=r" (ret)
26
                              : "r" (addr), "i" (ASI_PL));
27
        return ret;
28
}
29
 
30
static __inline__ __u64 ___arch__swab64p(__u64 *addr)
31
{
32
        __u64 ret;
33
 
34
        __asm__ __volatile__ ("ldxa [%1] %2, %0"
35
                              : "=r" (ret)
36
                              : "r" (addr), "i" (ASI_PL));
37
        return ret;
38
}
39
 
40
#define __arch__swab16p(x) ___arch__swab16p(x)
41
#define __arch__swab32p(x) ___arch__swab32p(x)
42
#define __arch__swab64p(x) ___arch__swab64p(x)
43
 
44
#define __BYTEORDER_HAS_U64__
45
 
46
#endif /* __GNUC__ */
47
 
48
#include <linux/byteorder/big_endian.h>
49
 
50
#endif /* _SPARC64_BYTEORDER_H */

powered by: WebSVN 2.1.0

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