Changeset c55dd58 in mainline
- Timestamp:
 - 2006-11-30T15:37:16Z (19 years ago)
 - Branches:
 - lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
 - Children:
 - 8c19cf28
 - Parents:
 - 058b021
 - Location:
 - kernel/arch
 - Files:
 - 
      
- 7 edited
 
- 
          
  amd64/include/byteorder.h (modified) (1 diff)
 - 
          
  ia32/include/byteorder.h (modified) (1 diff)
 - 
          
  ia64/include/byteorder.h (modified) (1 diff)
 - 
          
  mips32/include/byteorder.h (modified) (1 diff)
 - 
          
  ppc32/include/byteorder.h (modified) (1 diff)
 - 
          
  ppc64/include/byteorder.h (modified) (1 diff)
 - 
          
  sparc64/include/byteorder.h (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
kernel/arch/amd64/include/byteorder.h
r058b021 rc55dd58 36 36 #define KERN_amd64_BYTEORDER_H_ 37 37 38 #include <byteorder.h> 39 38 40 /* AMD64 is little-endian */ 39 #define u native_t_le2host(n) (n)41 #define uint32_t_le2host(n) (n) 40 42 #define uint64_t_le2host(n) (n) 43 44 #define uint32_t_be2host(n) uint64_t_byteorder_swap(n) 45 #define uint64_t_be2host(n) uint32_t_byteorder_swap(n) 41 46 42 47 #endif  - 
      
kernel/arch/ia32/include/byteorder.h
r058b021 rc55dd58 36 36 #define KERN_ia32_BYTEORDER_H_ 37 37 38 #include <byteorder.h> 39 38 40 /* IA-32 is little-endian */ 39 #define u native_t_le2host(n) (n)41 #define uint32_t_le2host(n) (n) 40 42 #define uint64_t_le2host(n) (n) 43 44 #define uint32_t_be2host(n) uint64_t_byteorder_swap(n) 45 #define uint64_t_be2host(n) uint32_t_byteorder_swap(n) 41 46 42 47 #endif  - 
      
kernel/arch/ia64/include/byteorder.h
r058b021 rc55dd58 36 36 #define KERN_ia64_BYTEORDER_H_ 37 37 38 #include <byteorder.h> 39 38 40 /* IA-64 is little-endian */ 39 #define u native_t_le2host(n) (n)41 #define uint32_t_le2host(n) (n) 40 42 #define uint64_t_le2host(n) (n) 43 44 #define uint32_t_be2host(n) uint64_t_byteorder_swap(n) 45 #define uint64_t_be2host(n) uint32_t_byteorder_swap(n) 41 46 42 47 #endif  - 
      
kernel/arch/mips32/include/byteorder.h
r058b021 rc55dd58 36 36 #define KERN_mips32_BYTEORDER_H_ 37 37 38 #include <arch/types.h>39 38 #include <byteorder.h> 40 39 41 40 #ifdef BIG_ENDIAN 42 static inline uint64_t uint64_t_le2host(uint64_t n)43 {44 return uint64_t_byteorder_swap(n);45 }46 41 47 static inline unative_t unative_t_le2host(unative_t n) 48 { 49 return uint32_t_byteorder_swap(n); 50 } 42 #define uint32_t_le2host(n) uint64_t_byteorder_swap(n) 43 #define uint64_t_le2host(n) uint32_t_byteorder_swap(n) 44 45 #define uint32_t_be2host(n) (n) 46 #define uint64_t_be2host(n) (n) 51 47 52 48 #else 53 # define unative_t_le2host(n) (n) 54 # define uint64_t_le2host(n) (n) 49 50 #define uint32_t_le2host(n) (n) 51 #define uint64_t_le2host(n) (n) 52 53 #define uint32_t_be2host(n) uint64_t_byteorder_swap(n) 54 #define uint64_t_be2host(n) uint32_t_byteorder_swap(n) 55 55 56 #endif 56 57  - 
      
kernel/arch/ppc32/include/byteorder.h
r058b021 rc55dd58 36 36 #define KERN_ppc32_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  - 
      
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  - 
      
kernel/arch/sparc64/include/byteorder.h
r058b021 rc55dd58 36 36 #define KERN_sparc64_BYTEORDER_H_ 37 37 38 #include <arch/types.h>39 38 #include <byteorder.h> 40 39 41 static inline uint64_t uint64_t_le2host(uint64_t n) 42 { 43 return uint64_t_byteorder_swap(n); 44 } 40 #define uint32_t_le2host(n) uint64_t_byteorder_swap(n) 41 #define uint64_t_le2host(n) uint32_t_byteorder_swap(n) 45 42 46 static inline unative_t unative_t_le2host(unative_t n) 47 { 48 return uint64_t_byteorder_swap(n); 49 } 43 #define uint32_t_be2host(n) (n) 44 #define uint64_t_be2host(n) (n) 50 45 51 46 #endif  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  