@@ -6,7 +6,7 @@
*
*/
-#include <asm/types.h>
+#include <linux/types.h>
#include <linux/ioctl.h>
/* Architectural interrupt line count. */
@@ -1,13 +1,19 @@
#ifndef _ASM_X86_SWAB_H
#define _ASM_X86_SWAB_H
-#include <asm/types.h>
+#include <linux/types.h>
#include <linux/compiler.h>
+#ifdef __KERNEL__
+# ifdef CONFIG_X86_BSWAP
+# define __X86_BSWAP
+# endif /* CONFIG_X86_BSWAP */
+#endif /* __KERNEL__ */
+
static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
{
#ifdef __i386__
-# ifdef CONFIG_X86_BSWAP
+# ifdef __X86_BSWAP
asm("bswap %0" : "=r" (val) : "0" (val));
# else
asm("xchgb %b0,%h0\n\t" /* swap lower bytes */
@@ -37,7 +43,7 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 val)
__u64 u;
} v;
v.u = val;
-# ifdef CONFIG_X86_BSWAP
+# ifdef __X86_BSWAP
asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
: "=r" (v.s.a), "=r" (v.s.b)
: "0" (v.s.a), "1" (v.s.b));
@@ -59,7 +59,7 @@ struct acct
comp_t ac_majflt; /* Major Pagefaults */
comp_t ac_swaps; /* Number of Swaps */
/* m68k had no padding here. */
-#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
+#if !defined(__mc68000__) || !defined(__KERNEL__)
__u16 ac_ahz; /* AHZ */
#endif
__u32 ac_exitcode; /* Exitcode */
@@ -24,12 +24,7 @@
#ifndef _DVBAUDIO_H_
#define _DVBAUDIO_H_
-#ifdef __KERNEL__
#include <linux/types.h>
-#else
-#include <stdint.h>
-#endif
-
typedef enum {
AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
@@ -377,6 +377,7 @@ typedef struct elf64_note {
Elf64_Word n_type; /* Content type */
} Elf64_Nhdr;
+#ifdef __KERNEL__
#if ELF_CLASS == ELFCLASS32
extern Elf32_Dyn _DYNAMIC [];
@@ -404,5 +405,5 @@ static inline int elf_coredump_extra_notes_write(struct file *file,
extern int elf_coredump_extra_notes_size(void);
extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
#endif
-
+#endif /* __KERNEL__ */
#endif /* _LINUX_ELF_H */
@@ -12,15 +12,15 @@
#ifdef __KERNEL__
#include <asm/flat.h>
-#endif
-
-#define FLAT_VERSION 0x00000004L
#ifdef CONFIG_BINFMT_SHARED_FLAT
#define MAX_SHARED_LIBS (4)
#else
#define MAX_SHARED_LIBS (1)
#endif
+#endif /* __KERNEL__ */
+
+#define FLAT_VERSION 0x00000004L
/*
* To make everything easier to port and manage cross platform
@@ -791,6 +791,7 @@ dbg_hid(const char *fmt, ...)
__FILE__ , ## arg)
#endif /* HID_FF */
+#ifdef __KERNEL__
#ifdef CONFIG_HID_COMPAT
#define HID_COMPAT_LOAD_DRIVER(name) \
/* prototype to avoid sparse warning */ \
@@ -804,6 +805,7 @@ EXPORT_SYMBOL(hid_compat_##name)
extern void hid_compat_##name(void); \
hid_compat_##name(); \
} while (0)
+#endif /* __KERNEL__ */
#endif
@@ -130,6 +130,7 @@ typedef __s64 int64_t;
#define aligned_be64 __be64 __attribute__((aligned(8)))
#define aligned_le64 __le64 __attribute__((aligned(8)))
+#ifdef __KERNEL__
/**
* The type used for indexing onto a disc or disc partition.
*
@@ -145,6 +146,7 @@ typedef u64 blkcnt_t;
typedef unsigned long sector_t;
typedef unsigned long blkcnt_t;
#endif
+#endif /* __KERNEL__ */
/*
* The type of an index into the pagecache. Use a #define so asm/types.h
@@ -16,7 +16,13 @@
#include <linux/ioctl.h>
#include <linux/videodev2.h>
-#if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
+#ifndef __KERNEL__
+# define __V4L1_COMPAT_API /* Always provide definitions to user space */
+#elif defined(CONFIG_VIDEO_V4L1_COMPAT) /* __KERNEL__ */
+# define __V4L1_COMPAT_API
+#endif /* CONFIG_VIDEO_V4L1_COMPAT */
+
+#ifdef __V4L1_COMPAT_API
#define VID_TYPE_CAPTURE 1 /* Can capture */
#define VID_TYPE_TUNER 2 /* Can tune */
@@ -311,7 +317,7 @@ struct video_code
#define VID_PLAY_RESET 13
#define VID_PLAY_END_MARK 14
-#endif /* CONFIG_VIDEO_V4L1_COMPAT */
+#endif /* __V4L1_COMPAT_API */
#endif /* __LINUX_VIDEODEV_H */
@@ -1,7 +1,7 @@
#ifndef __linux_video_edid_h__
#define __linux_video_edid_h__
-#if !defined(__KERNEL__) || defined(CONFIG_X86)
+#if !defined(__KERNEL__) || defined(__i386__) || defined(__x86_64__)
struct edid_info {
unsigned char dummy[128];