020-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch 866 B

12345678910111213141516171819202122232425262728
  1. From: "Peter S. Mazinger" <ps.m@gmx.net>
  2. Date: Thu, 21 Apr 2011 21:20:55 +0200
  3. Subject: [PATCH] endian.h: add some handy macros to be used in syscalls
  4. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
  5. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
  6. ---
  7. --- a/include/endian.h
  8. +++ b/include/endian.h
  9. @@ -55,6 +55,17 @@
  10. # define __LONG_LONG_PAIR(HI, LO) HI, LO
  11. #endif
  12. +#ifdef _LIBC
  13. +# ifndef __ASSEMBLER__
  14. +# include <stdint.h>
  15. +# define OFF_HI(offset) (offset >> 31)
  16. +# define OFF_LO(offset) (offset)
  17. +# define OFF64_HI(offset) (uint32_t)(offset >> 32)
  18. +# define OFF64_LO(offset) (uint32_t)(offset & 0xffffffff)
  19. +# define OFF_HI_LO(offset) __LONG_LONG_PAIR(OFF_HI(offset), OFF_LO(offset))
  20. +# define OFF64_HI_LO(offset) __LONG_LONG_PAIR(OFF64_HI(offset), OFF64_LO(offset))
  21. +# endif
  22. +#endif
  23. #ifdef __USE_BSD
  24. /* Conversion interfaces. */