Rev 294 | Rev 338 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 294 | Rev 332 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | * @param n Little-endian __native argument. |
38 | * @param n Little-endian __native argument. |
39 | * |
39 | * |
40 | * @return Result in host endianess. |
40 | * @return Result in host endianess. |
41 | * |
41 | * |
42 | */ |
42 | */ |
- | 43 | static inline __u64 u64_le2host(__u64 n) |
|
- | 44 | { |
|
- | 45 | return ((n & 0xff) << 56) | |
|
- | 46 | ((n & 0xff00) << 40) | |
|
- | 47 | ((n & 0xff0000) << 24) | |
|
- | 48 | ((n & 0xff000000LL) << 8) | |
|
- | 49 | ((n & 0xff00000000LL) >>8) | |
|
- | 50 | ((n & 0xff0000000000LL) >> 24) | |
|
- | 51 | ((n & 0xff000000000000LL) >> 40) | |
|
- | 52 | ((n & 0xff00000000000000LL) >> 56); |
|
- | 53 | } |
|
43 | static inline __native native_le2host(__native n) |
54 | static inline __native native_le2host(__native n) |
44 | { |
55 | { |
45 | __address v; |
56 | __address v; |
46 | 57 | ||
47 | __asm__ volatile ("lwbrx %0, %1, %2\n" : "=r" (v) : "i" (0) , "r" (&n)); |
58 | __asm__ volatile ("lwbrx %0, %1, %2\n" : "=r" (v) : "i" (0) , "r" (&n)); |