aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Peter S. Mazinger <ps.m@gmx.net>2011-04-21 21:20:55 +0200
committerGravatar Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>2014-09-23 09:54:35 +0200
commit92d99871dfa7f53fe37fe890a35502473398db6c (patch)
treef20c9fb3374384721f838269957cad94fca73c8b
parentf99df0f182498402a1f267b3f419a5bda864ad85 (diff)
downloaduClibc-92d99871dfa7f53fe37fe890a35502473398db6c.tar.gz
uClibc-92d99871dfa7f53fe37fe890a35502473398db6c.tar.bz2
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>
-rw-r--r--include/endian.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/endian.h b/include/endian.h
index 0ba738463..1e2fc938b 100644
--- 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. */