]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/v850/bits/byteswap.h
Inital import
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / v850 / bits / byteswap.h
1 /*
2  * libc/sysdeps/linux/v850/bits/byteswap.h -- Macros to swap the order
3  *      of bytes in integer values
4  *
5  *  Copyright (C) 2001  NEC Corporation
6  *  Copyright (C) 2001  Miles Bader <miles@gnu.org>
7  *  Copyright (C) 1997,1998,2001  Free Software Foundation, Inc.
8  *
9  * This file is subject to the terms and conditions of the GNU Lesser
10  * General Public License.  See the file COPYING.LIB in the main
11  * directory of this archive for more details.
12  */
13
14 #ifndef _ASM_BITS_BYTESWAP_H
15 #define _ASM_BITS_BYTESWAP_H 1
16
17 #define __bswap_non_constant_16(x) \
18     (__extension__                                                            \
19      ({ unsigned long int __bswap_16_v;                                       \
20         __asm__ ("bsh %1, %0" : "=r" (__bswap_16_v) : "r" (x));               \
21         __bswap_16_v; }))
22
23 # define __bswap_non_constant_32(x) \
24     (__extension__                                                            \
25      ({ unsigned long int __bswap_32_v;                                       \
26         __asm__ ("bsw %1, %0" : "=r" (__bswap_32_v) : "r" (x));               \
27         __bswap_32_v; }))
28
29 #endif
30
31 #include <bits/byteswap-common.h>