30,7 → 30,14 |
#define __ppc_BYTEORDER_H__ |
|
#include <arch/types.h> |
#include <byteorder.h> |
|
static inline __u64 __u64_le2host(__u64 n) |
{ |
return __u64_byteorder_swap(n); |
} |
|
|
/** Convert little-endian __native to host __native |
* |
* Convert little-endian __native parameter to host endianess. |
40,19 → 47,8 |
* @return Result in host endianess. |
* |
*/ |
static inline __u64 u64_le2host(__u64 n) |
static inline __native __native_le2host(__native n) |
{ |
return ((n & 0xff) << 56) | |
((n & 0xff00) << 40) | |
((n & 0xff0000) << 24) | |
((n & 0xff000000LL) << 8) | |
((n & 0xff00000000LL) >>8) | |
((n & 0xff0000000000LL) >> 24) | |
((n & 0xff000000000000LL) >> 40) | |
((n & 0xff00000000000000LL) >> 56); |
} |
static inline __native native_le2host(__native n) |
{ |
__address v; |
|
__asm__ volatile ("lwbrx %0, %1, %2\n" : "=r" (v) : "i" (0) , "r" (&n)); |