diff options
author | Gustavo Zacarias <gustavo@zacarias.com.ar> | 2011-01-27 11:21:28 -0300 |
---|---|---|
committer | Peter Korsgaard <jacmet@sunsite.dk> | 2011-01-31 21:00:52 +0100 |
commit | 95aacf0cf02d537fcccd1d187b4c69abbb08e1b8 (patch) | |
tree | 8d163b3b469b2a65921dcce4cd632813d8cd4fb6 /toolchain/uClibc | |
parent | 2e77770e615819b8ec969e4e39160d4185f89d0c (diff) |
uclibc: add BSD endian conversions routines for 0.9.31
Add BSD endian conversion routines (backport from 0.9.32 / git).
Required to use a modern udev.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'toolchain/uClibc')
-rw-r--r-- | toolchain/uClibc/uClibc-0.9.31-add-bsd-endian-conversions.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/toolchain/uClibc/uClibc-0.9.31-add-bsd-endian-conversions.patch b/toolchain/uClibc/uClibc-0.9.31-add-bsd-endian-conversions.patch new file mode 100644 index 000000000..652d7c9f1 --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.31-add-bsd-endian-conversions.patch @@ -0,0 +1,64 @@ +From c6d6237819037168a6923ac080e348e54615422c Mon Sep 17 00:00:00 2001 +From: Vladimir Zapolskiy <vzapolskiy@gmail.com> +Date: Tue, 1 Jun 2010 23:22:57 +0400 +Subject: [PATCH] endian.h: add BSD convertions between big/little-endian byte order + +This patch adds support for convertion of values between host and +big-/little-endian byte order. + +Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com> +Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> +--- + include/endian.h | 38 ++++++++++++++++++++++++++++++++++++++ + 1 files changed, 38 insertions(+), 0 deletions(-) + +diff --git a/include/endian.h b/include/endian.h +index 2f7bce1..0ba7384 100644 +--- a/include/endian.h ++++ b/include/endian.h +@@ -55,4 +55,42 @@ + # define __LONG_LONG_PAIR(HI, LO) HI, LO + #endif + ++ ++#ifdef __USE_BSD ++/* Conversion interfaces. */ ++# include <byteswap.h> ++ ++# if __BYTE_ORDER == __LITTLE_ENDIAN ++# define htobe16(x) __bswap_16 (x) ++# define htole16(x) (x) ++# define be16toh(x) __bswap_16 (x) ++# define le16toh(x) (x) ++ ++# define htobe32(x) __bswap_32 (x) ++# define htole32(x) (x) ++# define be32toh(x) __bswap_32 (x) ++# define le32toh(x) (x) ++ ++# define htobe64(x) __bswap_64 (x) ++# define htole64(x) (x) ++# define be64toh(x) __bswap_64 (x) ++# define le64toh(x) (x) ++# else ++# define htobe16(x) (x) ++# define htole16(x) __bswap_16 (x) ++# define be16toh(x) (x) ++# define le16toh(x) __bswap_16 (x) ++ ++# define htobe32(x) (x) ++# define htole32(x) __bswap_32 (x) ++# define be32toh(x) (x) ++# define le32toh(x) __bswap_32 (x) ++ ++# define htobe64(x) (x) ++# define htole64(x) __bswap_64 (x) ++# define be64toh(x) (x) ++# define le64toh(x) __bswap_64 (x) ++# endif ++#endif ++ + #endif /* endian.h */ +-- +1.7.3.4 + |