@@ -3,4 +3,12 @@
#include <asm-generic/types.h>
+#ifdef __KERNEL__
+#if defined(CONFIG_X86_64) && !defined(__ASSEMBLY__) && !defined(_SETUP)
+#define HAVE_INT128
+typedef __int128 s128;
+typedef unsigned __int128 u128;
+#endif
+#endif
+
#endif /* _ASM_X86_TYPES_H */
@@ -127,6 +127,12 @@ typedef __s64 int64_t;
#define aligned_be64 __be64 __attribute__((aligned(8)))
#define aligned_le64 __le64 __attribute__((aligned(8)))
+#ifdef HAVE_INT128
+typedef u128 u_int128_t;
+typedef u128 uint128_t;
+typedef s128 int128_t;
+#endif
+
/**
* The type used for indexing onto a disc or disc partition.
*
@@ -199,6 +205,12 @@ typedef __u32 __bitwise __wsum;
#define __aligned_le64 __le64 __attribute__((aligned(8)))
#ifdef __KERNEL__
+
+#ifdef HAVE_INT128
+typedef u128 __bitwise __le128;
+typedef u128 __bitwise __be128;
+#endif
+
typedef unsigned __bitwise__ gfp_t;
typedef unsigned __bitwise__ fmode_t;
These types will initially be used for 128-bit I/O operations. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> --- I'm not sure whether there is any point in all the _t type aliases, but they're defined for all the other explicit-width types. Ben. arch/x86/include/asm/types.h | 8 ++++++++ include/linux/types.h | 12 ++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)