File: newer-linux-headers.diff

package info (click to toggle)
dietlibc 0.34~cvs20160606-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,768 kB
  • sloc: ansic: 71,692; asm: 13,008; cpp: 1,860; makefile: 817; sh: 300; perl: 62
file content (55 lines) | stat: -rw-r--r-- 1,735 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Description: Support newer Linux headers
 Copy some definitions from /usr/include/linux/types.h to make
 applications using them not FTBFS.
From: Larry Doolittle <larry@doolittle.boa.org>
Author: mirabilos <tg@debian.org>
Bug-Debian: http://bugs.debian.org/883534

--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -4,4 +4,45 @@
 #include <asm/types.h>
 #include <asm/posix_types.h>
 
+/*
+ * Below are truly Linux-specific types that should never collide with
+ * any application/library that wants linux/types.h.
+ */
+
+#ifdef __CHECKER__
+#define __bitwise__ __attribute__((bitwise))
+#else
+#define __bitwise__
+#endif
+#define __bitwise __bitwise__
+
+typedef __u16 __bitwise __le16;
+typedef __u16 __bitwise __be16;
+typedef __u32 __bitwise __le32;
+typedef __u32 __bitwise __be32;
+typedef __u64 __bitwise __le64;
+typedef __u64 __bitwise __be64;
+
+typedef __u16 __bitwise __sum16;
+typedef __u32 __bitwise __wsum;
+
+/*
+ * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid
+ * common 32/64-bit compat problems.
+ * 64-bit values align to 4-byte boundaries on x86_32 (and possibly other
+ * architectures) and to 8-byte boundaries on 64-bit architectures.  The new
+ * aligned_64 type enforces 8-byte alignment so that structs containing
+ * aligned_64 values have the same alignment on 32-bit and 64-bit architectures.
+ * No conversions are necessary between 32-bit user-space and a 64-bit kernel.
+ */
+#define __aligned_u64 __u64 __attribute__((aligned(8)))
+#define __aligned_be64 __be64 __attribute__((aligned(8)))
+#define __aligned_le64 __le64 __attribute__((aligned(8)))
+
+#ifdef __CHECK_POLL
+typedef unsigned __bitwise __poll_t;
+#else
+typedef unsigned __poll_t;
+#endif
+
 #endif