Changeset f3ade6c in mainline for arch/ppc/include/byteorder.h


Ignore:
Timestamp:
2005-09-11T15:13:53Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2b3e0738
Parents:
61a9bbe
Message:

Avoid code duplication by creating generic byteorder.h.
Some naming changes in swap functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ppc/include/byteorder.h

    r61a9bbe rf3ade6c  
    3131
    3232#include <arch/types.h>
     33#include <byteorder.h>
     34
     35static inline __u64 __u64_le2host(__u64 n)
     36{
     37        return __u64_byteorder_swap(n);
     38}
     39
    3340
    3441/** Convert little-endian __native to host __native
     
    4148 *
    4249 */
    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 }
    54 static inline __native native_le2host(__native n)
     50static inline __native __native_le2host(__native n)
    5551{
    5652        __address v;
Note: See TracChangeset for help on using the changeset viewer.