2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright (c) 2015, Joyent, Inc.
25 return (((in
& 0xff) << 8) | ((in
& 0xff00) >> 8));
31 return (((in
& 0xffUL
) << 24) |
32 (in
& 0xff00UL
) << 8 |
33 (in
& 0xff0000UL
) >> 8 |
34 ((in
& 0xff000000UL
) >> 24));
40 return (((in
& 0xffULL
) << 56) |
41 ((in
& 0xff00ULL
) << 40) |
42 ((in
& 0xff0000ULL
) << 24) |
43 ((in
& 0xff000000ULL
) << 8) |
44 ((in
& 0xff00000000ULL
) >> 8) |
45 ((in
& 0xff0000000000ULL
) >> 24) |
46 ((in
& 0xff000000000000ULL
) >> 40) |
47 ((in
& 0xff00000000000000ULL
) >> 56));
53 return (((in
& 0xff) << 8) | ((in
& 0xff00) >> 8));
59 return (((in
& 0xff) << 8) | ((in
& 0xff00) >> 8));
65 return (((in
& 0xffUL
) << 24) |
66 (in
& 0xff00UL
) << 8 |
67 (in
& 0xff0000UL
) >> 8 |
68 ((in
& 0xff000000UL
) >> 24));
74 return (((in
& 0xffUL
) << 24) |
75 (in
& 0xff00UL
) << 8 |
76 (in
& 0xff0000UL
) >> 8 |
77 ((in
& 0xff000000UL
) >> 24));
83 return (((in
& 0xffULL
) << 56) |
84 ((in
& 0xff00ULL
) << 40) |
85 ((in
& 0xff0000ULL
) << 24) |
86 ((in
& 0xff000000ULL
) << 8) |
87 ((in
& 0xff00000000ULL
) >> 8) |
88 ((in
& 0xff0000000000ULL
) >> 24) |
89 ((in
& 0xff000000000000ULL
) >> 40) |
90 ((in
& 0xff00000000000000ULL
) >> 56));
96 return (((in
& 0xffULL
) << 56) |
97 ((in
& 0xff00ULL
) << 40) |
98 ((in
& 0xff0000ULL
) << 24) |
99 ((in
& 0xff000000ULL
) << 8) |
100 ((in
& 0xff00000000ULL
) >> 8) |
101 ((in
& 0xff0000000000ULL
) >> 24) |
102 ((in
& 0xff000000000000ULL
) >> 40) |
103 ((in
& 0xff00000000000000ULL
) >> 56));
106 /* Anything to or from big-endian is a no-op */