Changeset c55dd58 in mainline for kernel/arch/ppc64/include/byteorder.h
- Timestamp:
- 2006-11-30T15:37:16Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8c19cf28
- Parents:
- 058b021
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc64/include/byteorder.h
r058b021 rc55dd58 36 36 #define KERN_ppc64_BYTEORDER_H_ 37 37 38 #include <arch/types.h>39 38 #include <byteorder.h> 40 39 41 #define BIG_ENDIAN 40 #define uint32_t_le2host(n) uint64_t_byteorder_swap(n) 41 #define uint64_t_le2host(n) uint32_t_byteorder_swap(n) 42 42 43 static inline uint64_t uint64_t_le2host(uint64_t n) 44 { 45 return uint64_t_byteorder_swap(n); 46 } 47 48 49 /** Convert little-endian unative_t to host unative_t 50 * 51 * Convert little-endian unative_t parameter to host endianess. 52 * 53 * @param n Little-endian unative_t argument. 54 * 55 * @return Result in host endianess. 56 * 57 */ 58 static inline unative_t unative_t_le2host(unative_t n) 59 { 60 uintptr_t v; 61 62 asm volatile ( 63 "lwbrx %0, %1, %2\n" 64 : "=r" (v) 65 : "i" (0), "r" (&n) 66 ); 67 return v; 68 } 43 #define uint32_t_be2host(n) (n) 44 #define uint64_t_be2host(n) (n) 69 45 70 46 #endif
Note:
See TracChangeset
for help on using the changeset viewer.