Rev 1702 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1702 | Rev 1780 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | #include <arch/types.h> |
38 | #include <arch/types.h> |
39 | #include <byteorder.h> |
39 | #include <byteorder.h> |
40 | 40 | ||
41 | #define BIG_ENDIAN |
41 | #define BIG_ENDIAN |
42 | 42 | ||
43 | static inline __u64 __u64_le2host(__u64 n) |
43 | static inline uint64_t uint64_t_le2host(uint64_t n) |
44 | { |
44 | { |
45 | return __u64_byteorder_swap(n); |
45 | return uint64_t_byteorder_swap(n); |
46 | } |
46 | } |
47 | 47 | ||
48 | 48 | ||
49 | /** Convert little-endian __native to host __native |
49 | /** Convert little-endian unative_t to host unative_t |
50 | * |
50 | * |
51 | * Convert little-endian __native parameter to host endianess. |
51 | * Convert little-endian unative_t parameter to host endianess. |
52 | * |
52 | * |
53 | * @param n Little-endian __native argument. |
53 | * @param n Little-endian unative_t argument. |
54 | * |
54 | * |
55 | * @return Result in host endianess. |
55 | * @return Result in host endianess. |
56 | * |
56 | * |
57 | */ |
57 | */ |
58 | static inline __native __native_le2host(__native n) |
58 | static inline unative_t unative_t_le2host(unative_t n) |
59 | { |
59 | { |
60 | __address v; |
60 | uintptr_t v; |
61 | 61 | ||
62 | asm volatile ( |
62 | asm volatile ( |
63 | "lwbrx %0, %1, %2\n" |
63 | "lwbrx %0, %1, %2\n" |
64 | : "=r" (v) |
64 | : "=r" (v) |
65 | : "i" (0), "r" (&n) |
65 | : "i" (0), "r" (&n) |