# endif
#endif
+#if __GNUC_PREREQ(3,0) && defined(i386)
+/* || defined(__x86_64__)? */
+# define FAST_FUNC __attribute__((regparm(3)))
+#else
+# define FAST_FUNC
+#endif
+
/* ---- Endian Detection ------------------------------------ */
#if (defined __digital__ && defined __unix__)
#define SWAP_LE64(x) (x)
#endif
+/* ---- Unaligned access ------------------------------------ */
+
+/* parameter is supposed to be an uint32_t* ptr */
+#if defined(i386) || defined(__x86_64__) /* + other arches? */
+#define get_unaligned_u32p(u32p) (*(u32p))
+#else
+/* performs reasonably well (gcc usually inlines memcpy here) */
+#define get_unaligned_u32p(u32p) ({ uint32_t __t; memcpy(&__t, (u32p), 4); __t; })
+#endif
+
/* ---- Networking ------------------------------------------ */
+
#ifndef __APPLE__
# include <arpa/inet.h>
# ifndef __socklen_t_defined
#endif
/* ---- Compiler dependent settings ------------------------- */
+
#if (defined __digital__ && defined __unix__) || defined __APPLE__
# undef HAVE_MNTENT_H
# undef HAVE_SYS_STATFS_H
#endif
/*----- Kernel versioning ------------------------------------*/
+
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-/* ---- miscellaneous --------------------------------------- */
+/* ---- Miscellaneous --------------------------------------- */
#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 5 && \
!defined(__dietlibc__) && \
(defined __UCLIBC__ && __UCLIBC_MAJOR__ >= 0 && __UCLIBC_MINOR__ >= 9 && \
__UCLIBC_SUBLEVEL__ > 28 && !defined __ARCH_USE_MMU__)
#define BB_MMU 0
-#define BB_NOMMU 1
#define USE_FOR_NOMMU(...) __VA_ARGS__
#define USE_FOR_MMU(...)
#else
#define BB_MMU 1
-/* BB_NOMMU is not defined in this case! */
#define USE_FOR_NOMMU(...)
#define USE_FOR_MMU(...) __VA_ARGS__
#endif