aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc/patches-0.9.33.2/020-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/uClibc/patches-0.9.33.2/020-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch')
-rw-r--r--toolchain/uClibc/patches-0.9.33.2/020-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/toolchain/uClibc/patches-0.9.33.2/020-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch b/toolchain/uClibc/patches-0.9.33.2/020-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch
new file mode 100644
index 0000000000..720104195a
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.33.2/020-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch
@@ -0,0 +1,28 @@
+From: "Peter S. Mazinger" <ps.m@gmx.net>
+Date: Thu, 21 Apr 2011 21:20:55 +0200
+Subject: [PATCH] endian.h: add some handy macros to be used in syscalls
+
+Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+---
+
+--- a/include/endian.h
++++ b/include/endian.h
+@@ -55,6 +55,17 @@
+ # define __LONG_LONG_PAIR(HI, LO) HI, LO
+ #endif
+
++#ifdef _LIBC
++# ifndef __ASSEMBLER__
++# include <stdint.h>
++# define OFF_HI(offset) (offset >> 31)
++# define OFF_LO(offset) (offset)
++# define OFF64_HI(offset) (uint32_t)(offset >> 32)
++# define OFF64_LO(offset) (uint32_t)(offset & 0xffffffff)
++# define OFF_HI_LO(offset) __LONG_LONG_PAIR(OFF_HI(offset), OFF_LO(offset))
++# define OFF64_HI_LO(offset) __LONG_LONG_PAIR(OFF64_HI(offset), OFF64_LO(offset))
++# endif
++#endif
+
+ #ifdef __USE_BSD
+ /* Conversion interfaces. */