summaryrefslogtreecommitdiff
path: root/2.6.27
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-10-26 10:48:29 +0000
committerMike Frysinger <vapier@gentoo.org>2008-10-26 10:48:29 +0000
commit977141febc4b1342ca5494ef975ec390145a4d1e (patch)
tree3266a7e5817c3ff26ef342b1f981d3f4c73d1cb0 /2.6.27
parentremove s6_addr* defines to stop clobbering glibc #225505 (diff)
downloadlinux-headers-patches-977141febc4b1342ca5494ef975ec390145a4d1e.tar.gz
linux-headers-patches-977141febc4b1342ca5494ef975ec390145a4d1e.tar.bz2
linux-headers-patches-977141febc4b1342ca5494ef975ec390145a4d1e.zip
initial 2.6.27 patchset based on last 2.6.26 patchset
Diffstat (limited to '2.6.27')
-rw-r--r--2.6.27/0001-linux-timex.h-cleanup-for-userspace.patch115
-rw-r--r--2.6.27/03_all_linux-export-aligned-64bits.patch32
-rw-r--r--2.6.27/05_all_no-glibc-ifdefs.patch24
-rw-r--r--2.6.27/07_all_pull-libc-headers-asm.patch24
-rw-r--r--2.6.27/07_all_pull-libc-headers-linux.patch342
-rw-r--r--2.6.27/09_all_include-other-linux-headers.patch590
6 files changed, 1127 insertions, 0 deletions
diff --git a/2.6.27/0001-linux-timex.h-cleanup-for-userspace.patch b/2.6.27/0001-linux-timex.h-cleanup-for-userspace.patch
new file mode 100644
index 0000000..ea509b4
--- /dev/null
+++ b/2.6.27/0001-linux-timex.h-cleanup-for-userspace.patch
@@ -0,0 +1,115 @@
+From 148ba13b19b2d99db59aacb1e936157e9c6358b8 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 26 Oct 2008 06:31:48 -0400
+Subject: [PATCH] linux/timex.h: cleanup for userspace
+
+Move all the kernel-specific defines and includes into the __KERNEL__
+section so that they don't get leaked into userspace.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ include/linux/timex.h | 73 +++++++++++++++++++++++++------------------------
+ 1 files changed, 37 insertions(+), 36 deletions(-)
+
+diff --git a/include/linux/timex.h b/include/linux/timex.h
+index 9007313..4bbbab5 100644
+--- a/include/linux/timex.h
++++ b/include/linux/timex.h
+@@ -53,47 +53,11 @@
+ #ifndef _LINUX_TIMEX_H
+ #define _LINUX_TIMEX_H
+
+-#include <linux/compiler.h>
+ #include <linux/time.h>
+
+-#include <asm/param.h>
+-
+ #define NTP_API 4 /* NTP API version */
+
+ /*
+- * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
+- * for a slightly underdamped convergence characteristic. SHIFT_KH
+- * establishes the damping of the FLL and is chosen by wisdom and black
+- * art.
+- *
+- * MAXTC establishes the maximum time constant of the PLL. With the
+- * SHIFT_KG and SHIFT_KF values given and a time constant range from
+- * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
+- * respectively.
+- */
+-#define SHIFT_PLL 4 /* PLL frequency factor (shift) */
+-#define SHIFT_FLL 2 /* FLL frequency factor (shift) */
+-#define MAXTC 10 /* maximum time constant (shift) */
+-
+-/*
+- * SHIFT_USEC defines the scaling (shift) of the time_freq and
+- * time_tolerance variables, which represent the current frequency
+- * offset and maximum frequency tolerance.
+- */
+-#define SHIFT_USEC 16 /* frequency offset scale (shift) */
+-#define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
+-#define PPM_SCALE_INV_SHIFT 19
+-#define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \
+- PPM_SCALE + 1)
+-
+-#define MAXPHASE 500000000l /* max phase error (ns) */
+-#define MAXFREQ 500000 /* max frequency error (ns/s) */
+-#define MAXFREQ_SCALED ((s64)MAXFREQ << NTP_SCALE_SHIFT)
+-#define MINSEC 256 /* min interval between updates (s) */
+-#define MAXSEC 2048 /* max interval between updates (s) */
+-#define NTP_PHASE_LIMIT ((MAXPHASE / NSEC_PER_USEC) << 5) /* beyond max. dispersion */
+-
+-/*
+ * syscall interface - used (mainly by NTP daemon)
+ * to discipline kernel clock oscillator
+ */
+@@ -199,9 +163,46 @@ struct timex {
+ #define TIME_BAD TIME_ERROR /* bw compat */
+
+ #ifdef __KERNEL__
++#include <linux/compiler.h>
++#include <linux/types.h>
++
++#include <asm/param.h>
+ #include <asm/timex.h>
+
+ /*
++ * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen
++ * for a slightly underdamped convergence characteristic. SHIFT_KH
++ * establishes the damping of the FLL and is chosen by wisdom and black
++ * art.
++ *
++ * MAXTC establishes the maximum time constant of the PLL. With the
++ * SHIFT_KG and SHIFT_KF values given and a time constant range from
++ * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours,
++ * respectively.
++ */
++#define SHIFT_PLL 4 /* PLL frequency factor (shift) */
++#define SHIFT_FLL 2 /* FLL frequency factor (shift) */
++#define MAXTC 10 /* maximum time constant (shift) */
++
++/*
++ * SHIFT_USEC defines the scaling (shift) of the time_freq and
++ * time_tolerance variables, which represent the current frequency
++ * offset and maximum frequency tolerance.
++ */
++#define SHIFT_USEC 16 /* frequency offset scale (shift) */
++#define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC))
++#define PPM_SCALE_INV_SHIFT 19
++#define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \
++ PPM_SCALE + 1)
++
++#define MAXPHASE 500000000l /* max phase error (ns) */
++#define MAXFREQ 500000 /* max frequency error (ns/s) */
++#define MAXFREQ_SCALED ((s64)MAXFREQ << NTP_SCALE_SHIFT)
++#define MINSEC 256 /* min interval between updates (s) */
++#define MAXSEC 2048 /* max interval between updates (s) */
++#define NTP_PHASE_LIMIT ((MAXPHASE / NSEC_PER_USEC) << 5) /* beyond max. dispersion */
++
++/*
+ * kernel variables
+ * Note: maximum error = NTP synch distance = dispersion + delay / 2;
+ * estimated error = NTP dispersion.
+--
+1.6.0.2
+
diff --git a/2.6.27/03_all_linux-export-aligned-64bits.patch b/2.6.27/03_all_linux-export-aligned-64bits.patch
new file mode 100644
index 0000000..31fddd5
--- /dev/null
+++ b/2.6.27/03_all_linux-export-aligned-64bits.patch
@@ -0,0 +1,32 @@
+http://bugs.gentoo.org/204448
+
+some headers rely on these aligned_* macros and they dont conflict with normal
+userspace / libc types, so always export them regardless of the define
+__KERNEL_STRICT_NAMES
+
+--- include/linux/types.h
++++ include/linux/types.h
+@@ -125,11 +125,6 @@
+ typedef __s64 int64_t;
+ #endif
+
+-/* this is a special 64bit data type that is 8-byte aligned */
+-#define aligned_u64 __u64 __attribute__((aligned(8)))
+-#define aligned_be64 __be64 __attribute__((aligned(8)))
+-#define aligned_le64 __le64 __attribute__((aligned(8)))
+-
+ /**
+ * The type used for indexing onto a disc or disc partition.
+ *
+@@ -161,6 +156,11 @@
+
+ #endif /* __KERNEL_STRICT_NAMES */
+
++/* this is a special 64bit data type that is 8-byte aligned */
++#define aligned_u64 __u64 __attribute__((aligned(8)))
++#define aligned_be64 __be64 __attribute__((aligned(8)))
++#define aligned_le64 __le64 __attribute__((aligned(8)))
++
+ /*
+ * Below are truly Linux-specific types that should never collide with
+ * any application/library that wants linux/types.h.
diff --git a/2.6.27/05_all_no-glibc-ifdefs.patch b/2.6.27/05_all_no-glibc-ifdefs.patch
new file mode 100644
index 0000000..0fd1350
--- /dev/null
+++ b/2.6.27/05_all_no-glibc-ifdefs.patch
@@ -0,0 +1,24 @@
+only check KERNEL so we dont assume libc == glibc
+
+--- a/include/linux/socket.h
++++ b/include/linux/socket.h
+@@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage {
+ /* _SS_MAXSIZE value minus size of ss_family */
+ } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */
+
+-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
++#ifdef __KERNEL__
+
+ #include <asm/socket.h> /* arch-dependent defines */
+ #include <linux/sockios.h> /* the SIOCxxx I/O controls */
+--- a/include/linux/stat.h
++++ b/include/linux/stat.h
+@@ -7,7 +7,7 @@
+
+ #endif
+
+-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
++#ifdef __KERNEL__
+
+ #define S_IFMT 00170000
+ #define S_IFSOCK 0140000
diff --git a/2.6.27/07_all_pull-libc-headers-asm.patch b/2.6.27/07_all_pull-libc-headers-asm.patch
new file mode 100644
index 0000000..d11bc55
--- /dev/null
+++ b/2.6.27/07_all_pull-libc-headers-asm.patch
@@ -0,0 +1,24 @@
+pull in the libc versions of these headers so that the proper
+userspace defines/typedefs are utilized
+
+--- a/include/asm-generic/siginfo.h
++++ b/include/asm-generic/siginfo.h
+@@ -1,6 +1,10 @@
+ #ifndef _ASM_GENERIC_SIGINFO_H
+ #define _ASM_GENERIC_SIGINFO_H
+
++#ifndef __KERNEL__
++# include <signal.h>
++#else
++
+ #include <linux/compiler.h>
+ #include <linux/types.h>
+
+@@ -267,7 +271,6 @@ typedef struct sigevent {
+ #define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+ #define sigev_notify_thread_id _sigev_un._tid
+
+-#ifdef __KERNEL__
+
+ struct siginfo;
+ void do_schedule_next_timer(struct siginfo *info);
diff --git a/2.6.27/07_all_pull-libc-headers-linux.patch b/2.6.27/07_all_pull-libc-headers-linux.patch
new file mode 100644
index 0000000..0849dcf
--- /dev/null
+++ b/2.6.27/07_all_pull-libc-headers-linux.patch
@@ -0,0 +1,342 @@
+pull in the libc versions of these headers so that the proper userspace
+defines/typedefs are utilized.
+
+the trouble here is that some of the linux/ headers define structs that the
+libc net/ headers define (like the if.h header). we cannot simply say
+"your program should not include linux/if.h when using net/if.h" because some
+of the other linux/ headers may correctly be utilized with net/if.h but they
+correctly include linux/if.h. we also cannot say "just use the linux/ headers
+and not the libc net/ headers" because the libc headers include more
+definitions than its kernel equivalent.
+
+since there is no obvious (at least to me) answer here, we hack the linux/
+headers to simply pull in userspace headers and ignore the linux/ ones
+completely. this seems to give a proper clean userspace experience.
+
+--- a/include/linux/types.h
++++ b/include/linux/types.h
+@@ -8,6 +8,7 @@
+
+ #endif
+
++#include <sys/types.h>
+ #include <linux/posix_types.h>
+ #include <asm/types.h>
+
+--- a/include/linux/socket.h
++++ b/include/linux/socket.h
+@@ -303,4 +303,9 @@ extern int put_cmsg(struct msghdr*, int
+
+ #endif
+ #endif /* not kernel and not glibc */
++
++#ifndef __KERNEL__
++# include <sys/socket.h>
++#endif
++
+ #endif /* _LINUX_SOCKET_H */
+--- a/include/linux/stat.h
++++ b/include/linux/stat.h
+@@ -74,4 +74,8 @@ struct kstat {
+
+ #endif
+
++#ifndef __KERNEL__
++# include <sys/stat.h>
++#endif
++
+ #endif
+--- a/include/linux/time.h
++++ b/include/linux/time.h
+@@ -1,3 +1,9 @@
++#ifndef _LINUX_TIME_H
++# include <time.h>
++# include <sys/time.h>
++# define _LINUX_TIME_H
++#endif
++
+ #ifndef _LINUX_TIME_H
+ #define _LINUX_TIME_H
+
+--- a/include/linux/if.h
++++ b/include/linux/if.h
+@@ -19,6 +19,8 @@
+ #ifndef _LINUX_IF_H
+ #define _LINUX_IF_H
+
++#include <net/if.h>
++
+ #include <linux/types.h> /* for "__kernel_caddr_t" et al */
+ #include <linux/socket.h> /* for "struct sockaddr" et al */
+ #include <linux/compiler.h> /* for "__user" et al */
+@@ -119,7 +121,7 @@ enum {
+ * being very small might be worth keeping for clean configuration.
+ */
+
+-struct ifmap
++struct kernel_ifmap
+ {
+ unsigned long mem_start;
+ unsigned long mem_end;
+@@ -155,7 +157,7 @@ struct if_settings
+ * remainder may be interface specific.
+ */
+
+-struct ifreq
++struct kernel_ifreq
+ {
+ #define IFHWADDRLEN 6
+ union
+@@ -205,7 +207,7 @@ struct ifreq
+ * must know all networks accessible).
+ */
+
+-struct ifconf
++struct kernel_ifconf
+ {
+ int ifc_len; /* size of buffer */
+ union
+--- a/include/linux/ip.h
++++ b/include/linux/ip.h
+@@ -16,6 +16,7 @@
+ */
+ #ifndef _LINUX_IP_H
+ #define _LINUX_IP_H
++#include <netinet/ip.h>
+ #include <linux/types.h>
+ #include <asm/byteorder.h>
+
+@@ -82,7 +83,7 @@
+
+ #define IPV4_BEET_PHMAXLEN 8
+
+-struct iphdr {
++struct kernel_iphdr {
+ #if defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 ihl:4,
+ version:4;
+--- a/include/linux/cdrom.h
++++ b/include/linux/cdrom.h
+@@ -11,6 +11,10 @@
+ #ifndef _LINUX_CDROM_H
+ #define _LINUX_CDROM_H
+
++#ifndef __KERNEL__
++# include <limits.h>
++#endif
++
+ #include <asm/byteorder.h>
+
+ /*******************************************************
+--- a/include/linux/in6.h
++++ b/include/linux/in6.h
+@@ -21,13 +21,15 @@
+ #ifndef _LINUX_IN6_H
+ #define _LINUX_IN6_H
+
++#include <netinet/in.h>
++
+ #include <linux/types.h>
+
+ /*
+ * IPv6 address structure
+ */
+
+-struct in6_addr
++struct kernel_in6_addr
+ {
+ union
+ {
+@@ -35,9 +37,6 @@ struct in6_addr
+ __be16 u6_addr16[8];
+ __be32 u6_addr32[4];
+ } in6_u;
+-#define s6_addr in6_u.u6_addr8
+-#define s6_addr16 in6_u.u6_addr16
+-#define s6_addr32 in6_u.u6_addr32
+ };
+
+ /* IPv6 Wildcard Address (::) and Loopback Address (::1) defined in RFC2553
+@@ -57,7 +59,7 @@ extern const struct in6_addr in6addr_linklocal_allrouters;
+ extern const struct in6_addr in6addr_loopback;
+ #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+
+-struct sockaddr_in6 {
++struct kernel_sockaddr_in6 {
+ unsigned short int sin6_family; /* AF_INET6 */
+ __be16 sin6_port; /* Transport layer port # */
+ __be32 sin6_flowinfo; /* IPv6 flow information */
+@@ -65,7 +67,7 @@ struct sockaddr_in6 {
+ __u32 sin6_scope_id; /* scope id (new in RFC2553) */
+ };
+
+-struct ipv6_mreq {
++struct kernel_ipv6_mreq {
+ /* IPv6 multicast address of group */
+ struct in6_addr ipv6mr_multiaddr;
+
+--- a/include/linux/in.h
++++ b/include/linux/in.h
+@@ -18,42 +18,88 @@
+ #ifndef _LINUX_IN_H
+ #define _LINUX_IN_H
+
++#include <netinet/in.h>
++
+ #include <linux/types.h>
+ #include <linux/socket.h>
+
+ /* Standard well-defined IP protocols. */
+ enum {
++#ifndef IPPROTO_IP
+ IPPROTO_IP = 0, /* Dummy protocol for TCP */
++#endif
++#ifndef IPPROTO_ICMP
+ IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
++#endif
++#ifndef IPPROTO_IGMP
+ IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
++#endif
++#ifndef IPPROTO_IPIP
+ IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
++#endif
++#ifndef IPPROTO_TCP
+ IPPROTO_TCP = 6, /* Transmission Control Protocol */
++#endif
++#ifndef IPPROTO_EGP
+ IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
++#endif
++#ifndef IPPROTO_PUP
+ IPPROTO_PUP = 12, /* PUP protocol */
++#endif
++#ifndef IPPROTO_UDP
+ IPPROTO_UDP = 17, /* User Datagram Protocol */
++#endif
++#ifndef IPPROTO_IDP
+ IPPROTO_IDP = 22, /* XNS IDP protocol */
++#endif
++#ifndef IPPROTO_DCCP
+ IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
++#endif
++#ifndef IPPROTO_RSVP
+ IPPROTO_RSVP = 46, /* RSVP protocol */
++#endif
++#ifndef IPPROTO_GRE
+ IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
++#endif
+
++#ifndef IPPROTO_IPV6
+ IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
++#endif
+
++#ifndef IPPROTO_ESP
+ IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
++#endif
++#ifndef IPPROTO_AH
+ IPPROTO_AH = 51, /* Authentication Header protocol */
++#endif
++#ifndef IPPROTO_BEETPH
+ IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
++#endif
++#ifndef IPPROTO_PIM
+ IPPROTO_PIM = 103, /* Protocol Independent Multicast */
++#endif
+
++#ifndef IPPROTO_COMP
+ IPPROTO_COMP = 108, /* Compression Header protocol */
++#endif
++#ifndef IPPROTO_SCTP
+ IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
++#endif
++#ifndef IPPROTO_UDPLITE
+ IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
++#endif
+
++#ifndef IPPROTO_RAW
+ IPPROTO_RAW = 255, /* Raw IP packets */
++#endif
++#if 0
+ IPPROTO_MAX
++#endif
+ };
+
+
+ /* Internet address. */
+-struct in_addr {
++struct kernel_in_addr {
+ __be32 s_addr;
+ };
+
+@@ -112,26 +158,26 @@ struct in_addr {
+
+ /* Request struct for multicast socket ops */
+
+-struct ip_mreq
++struct kernel_ip_mreq
+ {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_interface; /* local IP address of interface */
+ };
+
+-struct ip_mreqn
++struct kernel_ip_mreqn
+ {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_address; /* local IP address of interface */
+ int imr_ifindex; /* Interface index */
+ };
+
+-struct ip_mreq_source {
++struct kernel_ip_mreq_source {
+ __be32 imr_multiaddr;
+ __be32 imr_interface;
+ __be32 imr_sourceaddr;
+ };
+
+-struct ip_msfilter {
++struct kernel_ip_msfilter {
+ __be32 imsf_multiaddr;
+ __be32 imsf_interface;
+ __u32 imsf_fmode;
+@@ -143,20 +189,20 @@ struct ip_msfilter {
+ (sizeof(struct ip_msfilter) - sizeof(__u32) \
+ + (numsrc) * sizeof(__u32))
+
+-struct group_req
++struct kernel_group_req
+ {
+ __u32 gr_interface; /* interface index */
+ struct __kernel_sockaddr_storage gr_group; /* group address */
+ };
+
+-struct group_source_req
++struct kernel_group_source_req
+ {
+ __u32 gsr_interface; /* interface index */
+ struct __kernel_sockaddr_storage gsr_group; /* group address */
+ struct __kernel_sockaddr_storage gsr_source; /* source address */
+ };
+
+-struct group_filter
++struct kernel_group_filter
+ {
+ __u32 gf_interface; /* interface index */
+ struct __kernel_sockaddr_storage gf_group; /* multicast address */
+@@ -169,7 +215,7 @@ struct group_filter
+ (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
+ + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
+
+-struct in_pktinfo
++struct kernel_in_pktinfo
+ {
+ int ipi_ifindex;
+ struct in_addr ipi_spec_dst;
+@@ -178,7 +224,7 @@ struct in_pktinfo
+
+ /* Structure describing an Internet (IP) socket address. */
+ #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
+-struct sockaddr_in {
++struct kernel_sockaddr_in {
+ sa_family_t sin_family; /* Address family */
+ __be16 sin_port; /* Port number */
+ struct in_addr sin_addr; /* Internet address */
diff --git a/2.6.27/09_all_include-other-linux-headers.patch b/2.6.27/09_all_include-other-linux-headers.patch
new file mode 100644
index 0000000..30cfef5
--- /dev/null
+++ b/2.6.27/09_all_include-other-linux-headers.patch
@@ -0,0 +1,590 @@
+diff --git a/include/linux/atalk.h b/include/linux/atalk.h
+index 75b8bac..c0b7727 100644
+--- a/include/linux/atalk.h
++++ b/include/linux/atalk.h
+@@ -2,6 +2,7 @@
+ #define __LINUX_ATALK_H__
+
+ #include <asm/byteorder.h>
++#include <linux/socket.h>
+
+ /*
+ * AppleTalk networking structures
+diff --git a/include/linux/atm_zatm.h b/include/linux/atm_zatm.h
+index 10f0fa2..ca03fef 100644
+--- a/include/linux/atm_zatm.h
++++ b/include/linux/atm_zatm.h
+@@ -12,6 +12,7 @@
+ * sys/types.h for struct timeval
+ */
+
++#include <linux/time.h>
+ #include <linux/atmapi.h>
+ #include <linux/atmioc.h>
+
+diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h
+index c21e597..9a5c539 100644
+--- a/include/linux/auto_fs.h
++++ b/include/linux/auto_fs.h
+@@ -16,10 +16,10 @@
+
+ #ifdef __KERNEL__
+ #include <linux/fs.h>
+-#include <linux/limits.h>
+ #include <asm/types.h>
+ #endif /* __KERNEL__ */
+
++#include <linux/limits.h>
+ #include <linux/ioctl.h>
+
+ /* This file describes autofs v3 */
+diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h
+index 0a6bc52..ce9c79c 100644
+--- a/include/linux/auto_fs4.h
++++ b/include/linux/auto_fs4.h
+@@ -11,6 +11,8 @@
+ #ifndef _LINUX_AUTO_FS4_H
+ #define _LINUX_AUTO_FS4_H
+
++#include <linux/types.h>
++
+ /* Include common v3 definitions */
+ #include <linux/auto_fs.h>
+
+diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h
+index 8ed6dfd..2ca3e8f 100644
+--- a/include/linux/bfs_fs.h
++++ b/include/linux/bfs_fs.h
+@@ -6,6 +6,8 @@
+ #ifndef _LINUX_BFS_FS_H
+ #define _LINUX_BFS_FS_H
+
++#include <linux/types.h>
++
+ #define BFS_BSIZE_BITS 9
+ #define BFS_BSIZE (1<<BFS_BSIZE_BITS)
+
+diff --git a/include/linux/cm4000_cs.h b/include/linux/cm4000_cs.h
+index 605ebe2..8d95b2f 100644
+--- a/include/linux/cm4000_cs.h
++++ b/include/linux/cm4000_cs.h
+@@ -1,6 +1,9 @@
+ #ifndef _CM4000_H_
+ #define _CM4000_H_
+
++#include <linux/types.h>
++#include <linux/ioctl.h>
++
+ #define MAX_ATR 33
+
+ #define CM4000_MAX_DEV 4
+diff --git a/include/linux/dn.h b/include/linux/dn.h
+index 10b6a6f..9a13dd6 100644
+--- a/include/linux/dn.h
++++ b/include/linux/dn.h
+@@ -7,6 +7,9 @@
+
+ */
+
++#include <linux/ioctl.h>
++#include <linux/types.h>
++
+ /*
+ * DNPROTO_NSP can't be the same as SOL_SOCKET,
+ * so increment each by one (compared to ULTRIX)
+diff --git a/include/linux/efs_fs_sb.h b/include/linux/efs_fs_sb.h
+index ff1945e..a742b29 100644
+--- a/include/linux/efs_fs_sb.h
++++ b/include/linux/efs_fs_sb.h
+@@ -10,6 +10,7 @@
+ #define __EFS_FS_SB_H__
+
+ #include <linux/magic.h>
++#include <linux/types.h>
+
+ /* EFS superblock magic numbers */
+ #define EFS_MAGIC 0x072959
+diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
+index 9631ddd..2d5484e 100644
+--- a/include/linux/elfcore.h
++++ b/include/linux/elfcore.h
+@@ -20,7 +20,6 @@ struct elf_siginfo
+ typedef elf_greg_t greg_t;
+ typedef elf_gregset_t gregset_t;
+ typedef elf_fpregset_t fpregset_t;
+-typedef elf_fpxregset_t fpxregset_t;
+ #define NGREG ELF_NGREG
+ #endif
+
+diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
+index 92f8d4f..ceb1454 100644
+--- a/include/linux/errqueue.h
++++ b/include/linux/errqueue.h
+@@ -1,6 +1,8 @@
+ #ifndef _LINUX_ERRQUEUE_H
+ #define _LINUX_ERRQUEUE_H 1
+
++#include <linux/types.h>
++
+ struct sock_extended_err
+ {
+ __u32 ee_errno;
+diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
+index 8b7e4c1..e707cb5 100644
+--- a/include/linux/gfs2_ondisk.h
++++ b/include/linux/gfs2_ondisk.h
+@@ -10,6 +10,8 @@
+ #ifndef __GFS2_ONDISK_DOT_H__
+ #define __GFS2_ONDISK_DOT_H__
+
++#include <linux/types.h>
++
+ #define GFS2_MAGIC 0x01161970
+ #define GFS2_BASIC_BLOCK 512
+ #define GFS2_BASIC_BLOCK_SHIFT 9
+diff --git a/include/linux/hdlc/ioctl.h b/include/linux/hdlc/ioctl.h
+index 5839723..09dc723 100644
+--- a/include/linux/hdlc/ioctl.h
++++ b/include/linux/hdlc/ioctl.h
+@@ -1,6 +1,7 @@
+ #ifndef __HDLC_IOCTL_H__
+ #define __HDLC_IOCTL_H__
+
++#include <linux/if.h>
+
+ #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
+
+diff --git a/include/linux/hiddev.h b/include/linux/hiddev.h
+index acbdae6..3b35f72 100644
+--- a/include/linux/hiddev.h
++++ b/include/linux/hiddev.h
+@@ -29,6 +29,8 @@
+ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
+ */
+
++#include <linux/types.h>
++
+ /*
+ * The event structure itself
+ */
+diff --git a/include/linux/if_fc.h b/include/linux/if_fc.h
+index 376a34e..6ed7f1b 100644
+--- a/include/linux/if_fc.h
++++ b/include/linux/if_fc.h
+@@ -20,6 +20,7 @@
+ #ifndef _LINUX_IF_FC_H
+ #define _LINUX_IF_FC_H
+
++#include <linux/types.h>
+
+ #define FC_ALEN 6 /* Octets in one ethernet addr */
+ #define FC_HLEN (sizeof(struct fch_hdr)+sizeof(struct fcllc))
+diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
+index 768372f..b8d05b8 100644
+--- a/include/linux/if_ppp.h
++++ b/include/linux/if_ppp.h
+@@ -36,6 +36,9 @@
+ #define _IF_PPP_H_
+
+ #include <linux/compiler.h>
++#include <linux/if.h>
++#include <linux/ppp_defs.h>
++#include <linux/types.h>
+
+ /*
+ * Packet sizes
+diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
+index c6b13ff..a71510a 100644
+--- a/include/linux/ppp_defs.h
++++ b/include/linux/ppp_defs.h
+@@ -42,6 +42,8 @@
+ #ifndef _PPP_DEFS_H_
+ #define _PPP_DEFS_H_
+
++#include <linux/types.h>
++
+ /*
+ * The basic PPP frame.
+ */
+diff --git a/include/linux/if_strip.h b/include/linux/if_strip.h
+index fb5c5c9..6526a62 100644
+--- a/include/linux/if_strip.h
++++ b/include/linux/if_strip.h
+@@ -18,6 +18,8 @@
+ #ifndef __LINUX_STRIP_H
+ #define __LINUX_STRIP_H
+
++#include <linux/types.h>
++
+ typedef struct {
+ __u8 c[6];
+ } MetricomAddress;
+diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
+index 660b501..3331fc4 100644
+--- a/include/linux/if_tunnel.h
++++ b/include/linux/if_tunnel.h
+@@ -2,6 +2,9 @@
+ #define _IF_TUNNEL_H_
+
+ #include <linux/types.h>
++#include <asm/byteorder.h>
++#include <linux/if.h>
++#include <linux/ip.h>
+
+ #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
+ #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
+diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
+index 6e8bc54..bc8c490 100644
+--- a/include/linux/inet_diag.h
++++ b/include/linux/inet_diag.h
+@@ -1,6 +1,8 @@
+ #ifndef _INET_DIAG_H_
+ #define _INET_DIAG_H_ 1
+
++#include <linux/types.h>
++
+ /* Just some random number */
+ #define TCPDIAG_GETSOCK 18
+ #define DCCPDIAG_GETSOCK 19
+diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h
+index b323ff5..d5865f0 100644
+--- a/include/linux/ipv6_route.h
++++ b/include/linux/ipv6_route.h
+@@ -13,6 +13,8 @@
+ #ifndef _LINUX_IPV6_ROUTE_H
+ #define _LINUX_IPV6_ROUTE_H
+
++#include <linux/in6.h>
++
+ #define RTF_DEFAULT 0x00010000 /* default - learned via ND */
+ #define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
+ fallback, no routers on link */
+diff --git a/include/linux/ipx.h b/include/linux/ipx.h
+index eb19b4e..22d379f 100644
+--- a/include/linux/ipx.h
++++ b/include/linux/ipx.h
+@@ -2,6 +2,7 @@
+ #define _IPX_H_
+ #include <linux/sockios.h>
+ #include <linux/socket.h>
++#include <linux/types.h>
+ #define IPX_NODE_LEN 6
+ #define IPX_MTU 576
+
+diff --git a/include/linux/irda.h b/include/linux/irda.h
+index 09d8f10..b41984f 100644
+--- a/include/linux/irda.h
++++ b/include/linux/irda.h
+@@ -31,6 +31,9 @@
+ * this one, or preferably to include <net/irda/irda.h> instead.
+ * Jean II */
+
++#include <linux/types.h>
++#include <linux/socket.h>
++
+ /* Hint bit positions for first hint byte */
+ #define HINT_PNP 0x01
+ #define HINT_PDA 0x02
+diff --git a/include/linux/llc.h b/include/linux/llc.h
+index 09f2e6d..f3a34ca 100644
+--- a/include/linux/llc.h
++++ b/include/linux/llc.h
+@@ -12,6 +12,10 @@
+ *
+ * See the GNU General Public License for more details.
+ */
++
++#include <linux/if.h>
++#include <linux/socket.h>
++
+ #define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
+ struct sockaddr_llc {
+ sa_family_t sllc_family; /* AF_LLC */
+diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h
+index 916e8f7..bb33d11 100644
+--- a/include/linux/minix_fs.h
++++ b/include/linux/minix_fs.h
+@@ -2,6 +2,7 @@
+ #define _LINUX_MINIX_FS_H
+
+ #include <linux/magic.h>
++#include <linux/types.h>
+
+ /*
+ * The minix filesystem constants/structures
+diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
+index 022edfa..175741c 100644
+--- a/include/linux/netfilter/x_tables.h
++++ b/include/linux/netfilter/x_tables.h
+@@ -1,6 +1,8 @@
+ #ifndef _X_TABLES_H
+ #define _X_TABLES_H
+
++#include <linux/types.h>
++
+ #define XT_FUNCTION_MAXNAMELEN 30
+ #define XT_TABLE_MAXNAMELEN 32
+
+diff --git a/include/linux/netrom.h b/include/linux/netrom.h
+index 6939b32..af7313c 100644
+--- a/include/linux/netrom.h
++++ b/include/linux/netrom.h
+@@ -7,6 +7,8 @@
+ #ifndef NETROM_KERNEL_H
+ #define NETROM_KERNEL_H
+
++#include <linux/ax25.h>
++
+ #define NETROM_MTU 236
+
+ #define NETROM_T1 1
+diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
+index 15a9f3b..91a1c24 100644
+--- a/include/linux/nfs_idmap.h
++++ b/include/linux/nfs_idmap.h
+@@ -37,6 +37,8 @@
+ #ifndef NFS_IDMAP_H
+ #define NFS_IDMAP_H
+
++#include <linux/types.h>
++
+ /* XXX from bits/utmp.h */
+ #define IDMAP_NAMESZ 128
+
+diff --git a/include/linux/nubus.h b/include/linux/nubus.h
+index 870e66a..72c8774 100644
+--- a/include/linux/nubus.h
++++ b/include/linux/nubus.h
+@@ -12,6 +12,8 @@
+ #ifndef LINUX_NUBUS_H
+ #define LINUX_NUBUS_H
+
++#include <linux/types.h>
++
+ #ifdef __KERNEL__
+ #include <asm/nubus.h>
+ #endif
+diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
+index c3f01b3..762f048 100644
+--- a/include/linux/pkt_cls.h
++++ b/include/linux/pkt_cls.h
+@@ -2,6 +2,7 @@
+ #define __LINUX_PKT_CLS_H
+
+ #include <linux/pkt_sched.h>
++#include <linux/types.h>
+
+ /* I think i could have done better macros ; for now this is stolen from
+ * some arch/mips code - jhs
+diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
+index d10f353..2169d79 100644
+--- a/include/linux/pkt_sched.h
++++ b/include/linux/pkt_sched.h
+@@ -1,6 +1,8 @@
+ #ifndef __LINUX_PKT_SCHED_H
+ #define __LINUX_PKT_SCHED_H
+
++#include <linux/types.h>
++
+ /* Logical priority bands not depending on specific packet scheduler.
+ Every scheduler will map them to real traffic classes, if it has
+ no more precise mechanism to classify packets.
+diff --git a/include/linux/random.h b/include/linux/random.h
+index 01ad710..57195d0 100644
+--- a/include/linux/random.h
++++ b/include/linux/random.h
+@@ -8,6 +8,7 @@
+ #define _LINUX_RANDOM_H
+
+ #include <linux/ioctl.h>
++#include <linux/types.h>
+
+ /* ioctl()'s for the random number generator */
+
+diff --git a/include/linux/romfs_fs.h b/include/linux/romfs_fs.h
+index e20bbf9..1404f8d 100644
+--- a/include/linux/romfs_fs.h
++++ b/include/linux/romfs_fs.h
+@@ -1,6 +1,8 @@
+ #ifndef __LINUX_ROMFS_FS_H
+ #define __LINUX_ROMFS_FS_H
+
++#include <linux/types.h>
++
+ /* The basic structures of the romfs filesystem */
+
+ #define ROMBSIZE BLOCK_SIZE
+diff --git a/include/linux/rose.h b/include/linux/rose.h
+index c7b4b18..5bcbba1 100644
+--- a/include/linux/rose.h
++++ b/include/linux/rose.h
+@@ -7,6 +7,9 @@
+ #ifndef ROSE_KERNEL_H
+ #define ROSE_KERNEL_H
+
++#include <linux/socket.h>
++#include <linux/ax25.h>
++
+ #define ROSE_MTU 251
+
+ #define ROSE_MAX_DIGIS 6
+diff --git a/include/linux/scc.h b/include/linux/scc.h
+index 3495bd9..d5916e5 100644
+--- a/include/linux/scc.h
++++ b/include/linux/scc.h
+@@ -3,6 +3,7 @@
+ #ifndef _SCC_H
+ #define _SCC_H
+
++#include <linux/sockios.h>
+
+ /* selection of hardware types */
+
+diff --git a/include/linux/selinux_netlink.h b/include/linux/selinux_netlink.h
+index bbf489d..faf9675 100644
+--- a/include/linux/selinux_netlink.h
++++ b/include/linux/selinux_netlink.h
+@@ -12,6 +12,8 @@
+ #ifndef _LINUX_SELINUX_NETLINK_H
+ #define _LINUX_SELINUX_NETLINK_H
+
++#include <linux/types.h>
++
+ /* Message types. */
+ #define SELNL_MSG_BASE 0x10
+ enum {
+diff --git a/include/linux/synclink.h b/include/linux/synclink.h
+index c8b0426..ba59b6d 100644
+--- a/include/linux/synclink.h
++++ b/include/linux/synclink.h
+@@ -11,6 +11,9 @@
+
+ #ifndef _SYNCLINK_H_
+ #define _SYNCLINK_H_
++
++#include <linux/types.h>
++
+ #define SYNCLINK_H_VERSION 3.6
+
+ #define BOOLEAN int
+diff --git a/include/linux/un.h b/include/linux/un.h
+index 45561c5..77371f5 100644
+--- a/include/linux/un.h
++++ b/include/linux/un.h
+@@ -1,6 +1,8 @@
+ #ifndef _LINUX_UN_H
+ #define _LINUX_UN_H
+
++#include <linux/socket.h>
++
+ #define UNIX_PATH_MAX 108
+
+ struct sockaddr_un {
+diff --git a/include/linux/video_decoder.h b/include/linux/video_decoder.h
+index 121e26d..e26c0c8 100644
+--- a/include/linux/video_decoder.h
++++ b/include/linux/video_decoder.h
+@@ -1,6 +1,8 @@
+ #ifndef _LINUX_VIDEO_DECODER_H
+ #define _LINUX_VIDEO_DECODER_H
+
++#include <linux/types.h>
++
+ #define HAVE_VIDEO_DECODER 1
+
+ struct video_decoder_capability { /* this name is too long */
+diff --git a/include/linux/video_encoder.h b/include/linux/video_encoder.h
+index 4b0e690..b7b6423 100644
+--- a/include/linux/video_encoder.h
++++ b/include/linux/video_encoder.h
+@@ -1,6 +1,8 @@
+ #ifndef _LINUX_VIDEO_ENCODER_H
+ #define _LINUX_VIDEO_ENCODER_H
+
++#include <linux/types.h>
++
+ struct video_encoder_capability { /* this name is too long */
+ __u32 flags;
+ #define VIDEO_ENCODER_PAL 1 /* can encode PAL signal */
+diff --git a/include/linux/x25.h b/include/linux/x25.h
+index d035e4e..00dcc34 100644
+--- a/include/linux/x25.h
++++ b/include/linux/x25.h
+@@ -12,6 +12,7 @@
+ #define X25_KERNEL_H
+
+ #include <linux/types.h>
++#include <linux/socket.h>
+
+ #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
+ #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
+diff --git a/include/linux/times.h b/include/linux/times.h
+index e2d3020..813446f 100644
+--- a/include/linux/times.h
++++ b/include/linux/times.h
+@@ -2,6 +2,7 @@
+ #define _LINUX_TIMES_H
+
+ #include <linux/types.h>
++#include <linux/time.h>
+
+ struct tms {
+ clock_t tms_utime;
+diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
+index 153d755..0f9cac0 100644
+--- a/include/linux/ext2_fs.h
++++ b/include/linux/ext2_fs.h
+@@ -18,6 +18,7 @@
+
+ #include <linux/types.h>
+ #include <linux/magic.h>
++#include <linux/fs.h>
+
+ /*
+ * The second extended filesystem constants/structures
+diff --git a/include/linux/isdn_divertif.h b/include/linux/isdn_divertif.h
+index 0e7e44c..ec61201 100644
+--- a/include/linux/isdn_divertif.h
++++ b/include/linux/isdn_divertif.h
+@@ -10,6 +10,7 @@
+ *
+ */
+
++#include <linux/types.h>
+
+ /***********************************************************/
+ /* magic value is also used to control version information */
+diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
+index 8bcddcc..a84b922 100644
+--- a/include/linux/nfsd/syscall.h
++++ b/include/linux/nfsd/syscall.h
+@@ -10,10 +10,8 @@
+ #define NFSD_SYSCALL_H
+
+ #include <asm/types.h>
+-#ifdef __KERNEL__
+-# include <linux/types.h>
+-# include <linux/in.h>
+-#endif
++#include <linux/types.h>
++#include <linux/in.h>
+ #include <linux/posix_types.h>
+ #include <linux/nfsd/const.h>
+ #include <linux/nfsd/export.h>
+diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
+index a7d6a22..223c09d 100644
+--- a/include/linux/if_pppol2tp.h
++++ b/include/linux/if_pppol2tp.h
+@@ -15,11 +15,8 @@
+ #ifndef __LINUX_IF_PPPOL2TP_H
+ #define __LINUX_IF_PPPOL2TP_H
+
+-#include <asm/types.h>
+-
+-#ifdef __KERNEL__
++#include <linux/types.h>
+ #include <linux/in.h>
+-#endif
+
+ /* Structure used to connect() the socket to a particular tunnel UDP
+ * socket.