aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/ioctl.h75
-rw-r--r--include/asm-arm26/ioctl.h75
-rw-r--r--include/asm-cris/ioctl.h84
-rw-r--r--include/asm-frv/ioctl.h81
-rw-r--r--include/asm-generic/ioctl.h80
-rw-r--r--include/asm-h8300/ioctl.h81
-rw-r--r--include/asm-i386/ioctl.h86
-rw-r--r--include/asm-i386/kexec.h47
-rw-r--r--include/asm-i386/kprobes.h9
-rw-r--r--include/asm-ia64/ioctl.h78
-rw-r--r--include/asm-ia64/kprobes.h14
-rw-r--r--include/asm-m32r/ioctl.h79
-rw-r--r--include/asm-m68k/ioctl.h81
-rw-r--r--include/asm-m68knommu/ioctl.h2
-rw-r--r--include/asm-powerpc/kexec.h9
-rw-r--r--include/asm-powerpc/kprobes.h14
-rw-r--r--include/asm-s390/ioctl.h89
-rw-r--r--include/asm-s390/kexec.h5
-rw-r--r--include/asm-sh/ioctl.h76
-rw-r--r--include/asm-sh64/io.h8
-rw-r--r--include/asm-sh64/ioctl.h84
-rw-r--r--include/asm-sh64/mmu_context.h2
-rw-r--r--include/asm-sh64/pgalloc.h14
-rw-r--r--include/asm-sh64/pgtable.h24
-rw-r--r--include/asm-sh64/processor.h4
-rw-r--r--include/asm-sh64/system.h4
-rw-r--r--include/asm-sh64/tlbflush.h2
-rw-r--r--include/asm-sh64/uaccess.h2
-rw-r--r--include/asm-sparc64/kprobes.h10
-rw-r--r--include/asm-um/processor-generic.h1
-rw-r--r--include/asm-v850/ioctl.h81
-rw-r--r--include/asm-x86_64/e820.h1
-rw-r--r--include/asm-x86_64/ioctl.h76
-rw-r--r--include/asm-x86_64/kexec.h37
-rw-r--r--include/asm-x86_64/kprobes.h4
-rw-r--r--include/asm-xtensa/ioctl.h84
-rw-r--r--include/linux/calc64.h49
-rw-r--r--include/linux/compat_ioctl.h8
-rw-r--r--include/linux/fs.h17
-rw-r--r--include/linux/hrtimer.h143
-rw-r--r--include/linux/isicom.h59
-rw-r--r--include/linux/jiffies.h18
-rw-r--r--include/linux/kbd_kern.h2
-rw-r--r--include/linux/kernel.h4
-rw-r--r--include/linux/kexec.h4
-rw-r--r--include/linux/kprobes.h3
-rw-r--r--include/linux/ktime.h284
-rw-r--r--include/linux/list.h14
-rw-r--r--include/linux/mount.h8
-rw-r--r--include/linux/namei.h2
-rw-r--r--include/linux/pci_ids.h14
-rw-r--r--include/linux/posix-timers.h90
-rw-r--r--include/linux/rio_drv.h4
-rw-r--r--include/linux/sched.h9
-rw-r--r--include/linux/screen_info.h3
-rw-r--r--include/linux/time.h186
-rw-r--r--include/linux/timer.h2
-rw-r--r--include/linux/tty.h25
-rw-r--r--include/linux/tty_flip.h20
-rw-r--r--include/linux/tty_ldisc.h9
-rw-r--r--include/linux/xattr.h19
-rw-r--r--include/linux/zlib.h11
-rw-r--r--include/sound/core.h3
-rw-r--r--include/video/kyro.h1
-rw-r--r--include/video/neomagic.h1
-rw-r--r--include/video/newport.h5
-rw-r--r--include/video/sstfb.h1
-rw-r--r--include/video/tdfx.h86
68 files changed, 1010 insertions, 1597 deletions
diff --git a/include/asm-arm/ioctl.h b/include/asm-arm/ioctl.h
index 2cbb7d0e9dc6..b279fe06dfe5 100644
--- a/include/asm-arm/ioctl.h
+++ b/include/asm-arm/ioctl.h
@@ -1,74 +1 @@
1/* #include <asm-generic/ioctl.h>
2 * linux/ioctl.h for Linux by H.H. Bergman.
3 */
4
5#ifndef _ASMARM_IOCTL_H
6#define _ASMARM_IOCTL_H
7
8/* ioctl command encoding: 32 bits total, command in lower 16 bits,
9 * size of the parameter structure in the lower 14 bits of the
10 * upper 16 bits.
11 * Encoding the size of the parameter structure in the ioctl request
12 * is useful for catching programs compiled with old versions
13 * and to avoid overwriting user space outside the user buffer area.
14 * The highest 2 bits are reserved for indicating the ``access mode''.
15 * NOTE: This limits the max parameter size to 16kB -1 !
16 */
17
18/*
19 * The following is for compatibility across the various Linux
20 * platforms. The i386 ioctl numbering scheme doesn't really enforce
21 * a type field. De facto, however, the top 8 bits of the lower 16
22 * bits are indeed used as a type field, so we might just as well make
23 * this explicit here. Please be sure to use the decoding macros
24 * below from now on.
25 */
26#define _IOC_NRBITS 8
27#define _IOC_TYPEBITS 8
28#define _IOC_SIZEBITS 14
29#define _IOC_DIRBITS 2
30
31#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
32#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
33#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
34#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
35
36#define _IOC_NRSHIFT 0
37#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
38#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
39#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
40
41/*
42 * Direction bits.
43 */
44#define _IOC_NONE 0U
45#define _IOC_WRITE 1U
46#define _IOC_READ 2U
47
48#define _IOC(dir,type,nr,size) \
49 (((dir) << _IOC_DIRSHIFT) | \
50 ((type) << _IOC_TYPESHIFT) | \
51 ((nr) << _IOC_NRSHIFT) | \
52 ((size) << _IOC_SIZESHIFT))
53
54/* used to create numbers */
55#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
56#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
57#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
58#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
59
60/* used to decode ioctl numbers.. */
61#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
62#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
63#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
64#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
65
66/* ...and for the drivers/sound files... */
67
68#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
69#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
70#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
71#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
72#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
73
74#endif /* _ASMARM_IOCTL_H */
diff --git a/include/asm-arm26/ioctl.h b/include/asm-arm26/ioctl.h
index 2cbb7d0e9dc6..b279fe06dfe5 100644
--- a/include/asm-arm26/ioctl.h
+++ b/include/asm-arm26/ioctl.h
@@ -1,74 +1 @@
1/* #include <asm-generic/ioctl.h>
2 * linux/ioctl.h for Linux by H.H. Bergman.
3 */
4
5#ifndef _ASMARM_IOCTL_H
6#define _ASMARM_IOCTL_H
7
8/* ioctl command encoding: 32 bits total, command in lower 16 bits,
9 * size of the parameter structure in the lower 14 bits of the
10 * upper 16 bits.
11 * Encoding the size of the parameter structure in the ioctl request
12 * is useful for catching programs compiled with old versions
13 * and to avoid overwriting user space outside the user buffer area.
14 * The highest 2 bits are reserved for indicating the ``access mode''.
15 * NOTE: This limits the max parameter size to 16kB -1 !
16 */
17
18/*
19 * The following is for compatibility across the various Linux
20 * platforms. The i386 ioctl numbering scheme doesn't really enforce
21 * a type field. De facto, however, the top 8 bits of the lower 16
22 * bits are indeed used as a type field, so we might just as well make
23 * this explicit here. Please be sure to use the decoding macros
24 * below from now on.
25 */
26#define _IOC_NRBITS 8
27#define _IOC_TYPEBITS 8
28#define _IOC_SIZEBITS 14
29#define _IOC_DIRBITS 2
30
31#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
32#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
33#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
34#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
35
36#define _IOC_NRSHIFT 0
37#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
38#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
39#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
40
41/*
42 * Direction bits.
43 */
44#define _IOC_NONE 0U
45#define _IOC_WRITE 1U
46#define _IOC_READ 2U
47
48#define _IOC(dir,type,nr,size) \
49 (((dir) << _IOC_DIRSHIFT) | \
50 ((type) << _IOC_TYPESHIFT) | \
51 ((nr) << _IOC_NRSHIFT) | \
52 ((size) << _IOC_SIZESHIFT))
53
54/* used to create numbers */
55#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
56#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
57#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
58#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
59
60/* used to decode ioctl numbers.. */
61#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
62#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
63#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
64#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
65
66/* ...and for the drivers/sound files... */
67
68#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
69#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
70#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
71#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
72#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
73
74#endif /* _ASMARM_IOCTL_H */
diff --git a/include/asm-cris/ioctl.h b/include/asm-cris/ioctl.h
index be2d8f667a38..b279fe06dfe5 100644
--- a/include/asm-cris/ioctl.h
+++ b/include/asm-cris/ioctl.h
@@ -1,83 +1 @@
1/* #include <asm-generic/ioctl.h>
2 * linux/ioctl.h for Linux by H.H. Bergman.
3 *
4 * This is the same as the i386 version.
5 */
6
7#ifndef _ASMCRIS_IOCTL_H
8#define _ASMCRIS_IOCTL_H
9
10/* ioctl command encoding: 32 bits total, command in lower 16 bits,
11 * size of the parameter structure in the lower 14 bits of the
12 * upper 16 bits.
13 * Encoding the size of the parameter structure in the ioctl request
14 * is useful for catching programs compiled with old versions
15 * and to avoid overwriting user space outside the user buffer area.
16 * The highest 2 bits are reserved for indicating the ``access mode''.
17 * NOTE: This limits the max parameter size to 16kB -1 !
18 */
19
20/*
21 * The following is for compatibility across the various Linux
22 * platforms. The i386 ioctl numbering scheme doesn't really enforce
23 * a type field. De facto, however, the top 8 bits of the lower 16
24 * bits are indeed used as a type field, so we might just as well make
25 * this explicit here. Please be sure to use the decoding macros
26 * below from now on.
27 */
28#define _IOC_NRBITS 8
29#define _IOC_TYPEBITS 8
30#define _IOC_SIZEBITS 14
31#define _IOC_DIRBITS 2
32
33#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
34#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
35#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
36#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
37
38#define _IOC_NRSHIFT 0
39#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
40#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
41#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
42
43/*
44 * Direction bits.
45 */
46#define _IOC_NONE 0U
47#define _IOC_WRITE 1U
48#define _IOC_READ 2U
49
50#define _IOC(dir,type,nr,size) \
51 (((dir) << _IOC_DIRSHIFT) | \
52 ((type) << _IOC_TYPESHIFT) | \
53 ((nr) << _IOC_NRSHIFT) | \
54 ((size) << _IOC_SIZESHIFT))
55
56/* provoke compile error for invalid uses of size argument */
57extern int __invalid_size_argument_for_IOC;
58#define _IOC_TYPECHECK(t) \
59 ((sizeof(t) == sizeof(t[1]) && \
60 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
61 sizeof(t) : __invalid_size_argument_for_IOC)
62
63/* used to create numbers */
64#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
65#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
66#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
67#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
68
69/* used to decode ioctl numbers.. */
70#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
71#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
72#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
73#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
74
75/* ...and for the drivers/sound files... */
76
77#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
78#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
79#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
80#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
81#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
82
83#endif /* _ASMCRIS_IOCTL_H */
diff --git a/include/asm-frv/ioctl.h b/include/asm-frv/ioctl.h
index 8aee76905545..b279fe06dfe5 100644
--- a/include/asm-frv/ioctl.h
+++ b/include/asm-frv/ioctl.h
@@ -1,80 +1 @@
1/* #include <asm-generic/ioctl.h>
2 * linux/ioctl.h for Linux by H.H. Bergman.
3 */
4
5#ifndef _ASM_IOCTL_H
6#define _ASM_IOCTL_H
7
8/* ioctl command encoding: 32 bits total, command in lower 16 bits,
9 * size of the parameter structure in the lower 14 bits of the
10 * upper 16 bits.
11 * Encoding the size of the parameter structure in the ioctl request
12 * is useful for catching programs compiled with old versions
13 * and to avoid overwriting user space outside the user buffer area.
14 * The highest 2 bits are reserved for indicating the ``access mode''.
15 * NOTE: This limits the max parameter size to 16kB -1 !
16 */
17
18/*
19 * I don't really have any idea about what this should look like, so
20 * for the time being, this is heavily based on the PC definitions.
21 */
22
23/*
24 * The following is for compatibility across the various Linux
25 * platforms. The i386 ioctl numbering scheme doesn't really enforce
26 * a type field. De facto, however, the top 8 bits of the lower 16
27 * bits are indeed used as a type field, so we might just as well make
28 * this explicit here. Please be sure to use the decoding macros
29 * below from now on.
30 */
31#define _IOC_NRBITS 8
32#define _IOC_TYPEBITS 8
33#define _IOC_SIZEBITS 14
34#define _IOC_DIRBITS 2
35
36#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
37#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
38#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
39#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
40
41#define _IOC_NRSHIFT 0
42#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
43#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
44#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
45
46/*
47 * Direction bits.
48 */
49#define _IOC_NONE 0U
50#define _IOC_WRITE 1U
51#define _IOC_READ 2U
52
53#define _IOC(dir,type,nr,size) \
54 (((dir) << _IOC_DIRSHIFT) | \
55 ((type) << _IOC_TYPESHIFT) | \
56 ((nr) << _IOC_NRSHIFT) | \
57 ((size) << _IOC_SIZESHIFT))
58
59/* used to create numbers */
60#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
61#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
62#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
63#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
64
65/* used to decode ioctl numbers.. */
66#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
67#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
68#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
69#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
70
71/* ...and for the drivers/sound files... */
72
73#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
74#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
75#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
76#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
77#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
78
79#endif /* _ASM_IOCTL_H */
80
diff --git a/include/asm-generic/ioctl.h b/include/asm-generic/ioctl.h
new file mode 100644
index 000000000000..cd027298beb1
--- /dev/null
+++ b/include/asm-generic/ioctl.h
@@ -0,0 +1,80 @@
1#ifndef _ASM_GENERIC_IOCTL_H
2#define _ASM_GENERIC_IOCTL_H
3
4/* ioctl command encoding: 32 bits total, command in lower 16 bits,
5 * size of the parameter structure in the lower 14 bits of the
6 * upper 16 bits.
7 * Encoding the size of the parameter structure in the ioctl request
8 * is useful for catching programs compiled with old versions
9 * and to avoid overwriting user space outside the user buffer area.
10 * The highest 2 bits are reserved for indicating the ``access mode''.
11 * NOTE: This limits the max parameter size to 16kB -1 !
12 */
13
14/*
15 * The following is for compatibility across the various Linux
16 * platforms. The generic ioctl numbering scheme doesn't really enforce
17 * a type field. De facto, however, the top 8 bits of the lower 16
18 * bits are indeed used as a type field, so we might just as well make
19 * this explicit here. Please be sure to use the decoding macros
20 * below from now on.
21 */
22#define _IOC_NRBITS 8
23#define _IOC_TYPEBITS 8
24#define _IOC_SIZEBITS 14
25#define _IOC_DIRBITS 2
26
27#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
28#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
29#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
30#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
31
32#define _IOC_NRSHIFT 0
33#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
34#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
35#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
36
37/*
38 * Direction bits.
39 */
40#define _IOC_NONE 0U
41#define _IOC_WRITE 1U
42#define _IOC_READ 2U
43
44#define _IOC(dir,type,nr,size) \
45 (((dir) << _IOC_DIRSHIFT) | \
46 ((type) << _IOC_TYPESHIFT) | \
47 ((nr) << _IOC_NRSHIFT) | \
48 ((size) << _IOC_SIZESHIFT))
49
50/* provoke compile error for invalid uses of size argument */
51extern unsigned int __invalid_size_argument_for_IOC;
52#define _IOC_TYPECHECK(t) \
53 ((sizeof(t) == sizeof(t[1]) && \
54 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
55 sizeof(t) : __invalid_size_argument_for_IOC)
56
57/* used to create numbers */
58#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
59#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
60#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
61#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
62#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
63#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
64#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
65
66/* used to decode ioctl numbers.. */
67#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
68#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
69#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
70#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
71
72/* ...and for the drivers/sound files... */
73
74#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
75#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
76#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
77#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
78#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
79
80#endif /* _ASM_GENERIC_IOCTL_H */
diff --git a/include/asm-h8300/ioctl.h b/include/asm-h8300/ioctl.h
index 031c623478b3..b279fe06dfe5 100644
--- a/include/asm-h8300/ioctl.h
+++ b/include/asm-h8300/ioctl.h
@@ -1,80 +1 @@
1/* $Id: ioctl.h,v 1.1 2002/11/19 02:09:26 gerg Exp $ #include <asm-generic/ioctl.h>
2 *
3 * linux/ioctl.h for Linux by H.H. Bergman.
4 */
5
6#ifndef _H8300_IOCTL_H
7#define _H8300_IOCTL_H
8
9/* ioctl command encoding: 32 bits total, command in lower 16 bits,
10 * size of the parameter structure in the lower 14 bits of the
11 * upper 16 bits.
12 * Encoding the size of the parameter structure in the ioctl request
13 * is useful for catching programs compiled with old versions
14 * and to avoid overwriting user space outside the user buffer area.
15 * The highest 2 bits are reserved for indicating the ``access mode''.
16 * NOTE: This limits the max parameter size to 16kB -1 !
17 */
18
19/*
20 * I don't really have any idea about what this should look like, so
21 * for the time being, this is heavily based on the PC definitions.
22 */
23
24/*
25 * The following is for compatibility across the various Linux
26 * platforms. The i386 ioctl numbering scheme doesn't really enforce
27 * a type field. De facto, however, the top 8 bits of the lower 16
28 * bits are indeed used as a type field, so we might just as well make
29 * this explicit here. Please be sure to use the decoding macros
30 * below from now on.
31 */
32#define _IOC_NRBITS 8
33#define _IOC_TYPEBITS 8
34#define _IOC_SIZEBITS 14
35#define _IOC_DIRBITS 2
36
37#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
38#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
39#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
40#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
41
42#define _IOC_NRSHIFT 0
43#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
44#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
45#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
46
47/*
48 * Direction bits.
49 */
50#define _IOC_NONE 0U
51#define _IOC_WRITE 1U
52#define _IOC_READ 2U
53
54#define _IOC(dir,type,nr,size) \
55 (((dir) << _IOC_DIRSHIFT) | \
56 ((type) << _IOC_TYPESHIFT) | \
57 ((nr) << _IOC_NRSHIFT) | \
58 ((size) << _IOC_SIZESHIFT))
59
60/* used to create numbers */
61#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
62#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
63#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
64#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
65
66/* used to decode ioctl numbers.. */
67#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
68#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
69#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
70#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
71
72/* ...and for the drivers/sound files... */
73
74#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
75#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
76#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
77#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
78#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
79
80#endif /* _H8300_IOCTL_H */
diff --git a/include/asm-i386/ioctl.h b/include/asm-i386/ioctl.h
index 543f7843d553..b279fe06dfe5 100644
--- a/include/asm-i386/ioctl.h
+++ b/include/asm-i386/ioctl.h
@@ -1,85 +1 @@
1/* $Id: ioctl.h,v 1.5 1993/07/19 21:53:50 root Exp root $ #include <asm-generic/ioctl.h>
2 *
3 * linux/ioctl.h for Linux by H.H. Bergman.
4 */
5
6#ifndef _ASMI386_IOCTL_H
7#define _ASMI386_IOCTL_H
8
9/* ioctl command encoding: 32 bits total, command in lower 16 bits,
10 * size of the parameter structure in the lower 14 bits of the
11 * upper 16 bits.
12 * Encoding the size of the parameter structure in the ioctl request
13 * is useful for catching programs compiled with old versions
14 * and to avoid overwriting user space outside the user buffer area.
15 * The highest 2 bits are reserved for indicating the ``access mode''.
16 * NOTE: This limits the max parameter size to 16kB -1 !
17 */
18
19/*
20 * The following is for compatibility across the various Linux
21 * platforms. The i386 ioctl numbering scheme doesn't really enforce
22 * a type field. De facto, however, the top 8 bits of the lower 16
23 * bits are indeed used as a type field, so we might just as well make
24 * this explicit here. Please be sure to use the decoding macros
25 * below from now on.
26 */
27#define _IOC_NRBITS 8
28#define _IOC_TYPEBITS 8
29#define _IOC_SIZEBITS 14
30#define _IOC_DIRBITS 2
31
32#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
33#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
34#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
35#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
36
37#define _IOC_NRSHIFT 0
38#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
39#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
40#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
41
42/*
43 * Direction bits.
44 */
45#define _IOC_NONE 0U
46#define _IOC_WRITE 1U
47#define _IOC_READ 2U
48
49#define _IOC(dir,type,nr,size) \
50 (((dir) << _IOC_DIRSHIFT) | \
51 ((type) << _IOC_TYPESHIFT) | \
52 ((nr) << _IOC_NRSHIFT) | \
53 ((size) << _IOC_SIZESHIFT))
54
55/* provoke compile error for invalid uses of size argument */
56extern unsigned int __invalid_size_argument_for_IOC;
57#define _IOC_TYPECHECK(t) \
58 ((sizeof(t) == sizeof(t[1]) && \
59 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
60 sizeof(t) : __invalid_size_argument_for_IOC)
61
62/* used to create numbers */
63#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
64#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
65#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
66#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
67#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
68#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
69#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
70
71/* used to decode ioctl numbers.. */
72#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
73#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
74#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
75#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
76
77/* ...and for the drivers/sound files... */
78
79#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
80#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
81#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
82#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
83#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
84
85#endif /* _ASMI386_IOCTL_H */
diff --git a/include/asm-i386/kexec.h b/include/asm-i386/kexec.h
index 6ed2a03e37b3..53f0e06672dc 100644
--- a/include/asm-i386/kexec.h
+++ b/include/asm-i386/kexec.h
@@ -2,6 +2,8 @@
2#define _I386_KEXEC_H 2#define _I386_KEXEC_H
3 3
4#include <asm/fixmap.h> 4#include <asm/fixmap.h>
5#include <asm/ptrace.h>
6#include <asm/string.h>
5 7
6/* 8/*
7 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. 9 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
@@ -26,8 +28,49 @@
26#define KEXEC_ARCH KEXEC_ARCH_386 28#define KEXEC_ARCH KEXEC_ARCH_386
27 29
28#define MAX_NOTE_BYTES 1024 30#define MAX_NOTE_BYTES 1024
29typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
30 31
31extern note_buf_t crash_notes[]; 32/* CPU does not save ss and esp on stack if execution is already
33 * running in kernel mode at the time of NMI occurrence. This code
34 * fixes it.
35 */
36static inline void crash_fixup_ss_esp(struct pt_regs *newregs,
37 struct pt_regs *oldregs)
38{
39 memcpy(newregs, oldregs, sizeof(*newregs));
40 newregs->esp = (unsigned long)&(oldregs->esp);
41 __asm__ __volatile__(
42 "xorl %%eax, %%eax\n\t"
43 "movw %%ss, %%ax\n\t"
44 :"=a"(newregs->xss));
45}
46
47/*
48 * This function is responsible for capturing register states if coming
49 * via panic otherwise just fix up the ss and esp if coming via kernel
50 * mode exception.
51 */
52static inline void crash_setup_regs(struct pt_regs *newregs,
53 struct pt_regs *oldregs)
54{
55 if (oldregs)
56 crash_fixup_ss_esp(newregs, oldregs);
57 else {
58 __asm__ __volatile__("movl %%ebx,%0" : "=m"(newregs->ebx));
59 __asm__ __volatile__("movl %%ecx,%0" : "=m"(newregs->ecx));
60 __asm__ __volatile__("movl %%edx,%0" : "=m"(newregs->edx));
61 __asm__ __volatile__("movl %%esi,%0" : "=m"(newregs->esi));
62 __asm__ __volatile__("movl %%edi,%0" : "=m"(newregs->edi));
63 __asm__ __volatile__("movl %%ebp,%0" : "=m"(newregs->ebp));
64 __asm__ __volatile__("movl %%eax,%0" : "=m"(newregs->eax));
65 __asm__ __volatile__("movl %%esp,%0" : "=m"(newregs->esp));
66 __asm__ __volatile__("movw %%ss, %%ax;" :"=a"(newregs->xss));
67 __asm__ __volatile__("movw %%cs, %%ax;" :"=a"(newregs->xcs));
68 __asm__ __volatile__("movw %%ds, %%ax;" :"=a"(newregs->xds));
69 __asm__ __volatile__("movw %%es, %%ax;" :"=a"(newregs->xes));
70 __asm__ __volatile__("pushfl; popl %0" :"=m"(newregs->eflags));
71
72 newregs->eip = (unsigned long)current_text_addr();
73 }
74}
32 75
33#endif /* _I386_KEXEC_H */ 76#endif /* _I386_KEXEC_H */
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h
index ca916a892877..27cac050a60e 100644
--- a/include/asm-i386/kprobes.h
+++ b/include/asm-i386/kprobes.h
@@ -40,6 +40,7 @@ typedef u8 kprobe_opcode_t;
40 40
41#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 41#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
42#define ARCH_SUPPORTS_KRETPROBES 42#define ARCH_SUPPORTS_KRETPROBES
43#define arch_remove_kprobe(p) do {} while (0)
43 44
44void kretprobe_trampoline(void); 45void kretprobe_trampoline(void);
45 46
@@ -76,14 +77,6 @@ static inline void restore_interrupts(struct pt_regs *regs)
76 local_irq_enable(); 77 local_irq_enable();
77} 78}
78 79
79#ifdef CONFIG_KPROBES
80extern int kprobe_exceptions_notify(struct notifier_block *self, 80extern int kprobe_exceptions_notify(struct notifier_block *self,
81 unsigned long val, void *data); 81 unsigned long val, void *data);
82#else /* !CONFIG_KPROBES */
83static inline int kprobe_exceptions_notify(struct notifier_block *self,
84 unsigned long val, void *data)
85{
86 return 0;
87}
88#endif
89#endif /* _ASM_KPROBES_H */ 82#endif /* _ASM_KPROBES_H */
diff --git a/include/asm-ia64/ioctl.h b/include/asm-ia64/ioctl.h
index be9cc2403d2a..b279fe06dfe5 100644
--- a/include/asm-ia64/ioctl.h
+++ b/include/asm-ia64/ioctl.h
@@ -1,77 +1 @@
1#ifndef _ASM_IA64_IOCTL_H #include <asm-generic/ioctl.h>
2#define _ASM_IA64_IOCTL_H
3
4/*
5 * Based on <asm-i386/ioctl.h>.
6 *
7 * Modified 1998, 1999
8 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
9 */
10
11/* ioctl command encoding: 32 bits total, command in lower 16 bits,
12 * size of the parameter structure in the lower 14 bits of the
13 * upper 16 bits.
14 * Encoding the size of the parameter structure in the ioctl request
15 * is useful for catching programs compiled with old versions
16 * and to avoid overwriting user space outside the user buffer area.
17 * The highest 2 bits are reserved for indicating the ``access mode''.
18 * NOTE: This limits the max parameter size to 16kB -1 !
19 */
20
21/*
22 * The following is for compatibility across the various Linux
23 * platforms. The ia64 ioctl numbering scheme doesn't really enforce
24 * a type field. De facto, however, the top 8 bits of the lower 16
25 * bits are indeed used as a type field, so we might just as well make
26 * this explicit here. Please be sure to use the decoding macros
27 * below from now on.
28 */
29#define _IOC_NRBITS 8
30#define _IOC_TYPEBITS 8
31#define _IOC_SIZEBITS 14
32#define _IOC_DIRBITS 2
33
34#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
35#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
36#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
37#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
38
39#define _IOC_NRSHIFT 0
40#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
41#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
42#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
43
44/*
45 * Direction bits.
46 */
47#define _IOC_NONE 0U
48#define _IOC_WRITE 1U
49#define _IOC_READ 2U
50
51#define _IOC(dir,type,nr,size) \
52 (((dir) << _IOC_DIRSHIFT) | \
53 ((type) << _IOC_TYPESHIFT) | \
54 ((nr) << _IOC_NRSHIFT) | \
55 ((size) << _IOC_SIZESHIFT))
56
57/* used to create numbers */
58#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
59#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
60#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
61#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
62
63/* used to decode ioctl numbers.. */
64#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
65#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
66#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
67#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
68
69/* ...and for the drivers/sound files... */
70
71#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
72#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
73#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
74#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
75#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
76
77#endif /* _ASM_IA64_IOCTL_H */
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 592abb000e29..a74b68104559 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -89,6 +89,7 @@ struct kprobe_ctlblk {
89#define IP_RELATIVE_PREDICT_OPCODE (7) 89#define IP_RELATIVE_PREDICT_OPCODE (7)
90#define LONG_BRANCH_OPCODE (0xC) 90#define LONG_BRANCH_OPCODE (0xC)
91#define LONG_CALL_OPCODE (0xD) 91#define LONG_CALL_OPCODE (0xD)
92#define arch_remove_kprobe(p) do {} while (0)
92 93
93typedef struct kprobe_opcode { 94typedef struct kprobe_opcode {
94 bundle_t bundle; 95 bundle_t bundle;
@@ -110,12 +111,6 @@ struct arch_specific_insn {
110 unsigned short target_br_reg; 111 unsigned short target_br_reg;
111}; 112};
112 113
113/* ia64 does not need this */
114static inline void arch_copy_kprobe(struct kprobe *p)
115{
116}
117
118#ifdef CONFIG_KPROBES
119extern int kprobe_exceptions_notify(struct notifier_block *self, 114extern int kprobe_exceptions_notify(struct notifier_block *self,
120 unsigned long val, void *data); 115 unsigned long val, void *data);
121 116
@@ -124,11 +119,4 @@ static inline void jprobe_return(void)
124{ 119{
125} 120}
126 121
127#else /* !CONFIG_KPROBES */
128static inline int kprobe_exceptions_notify(struct notifier_block *self,
129 unsigned long val, void *data)
130{
131 return 0;
132}
133#endif
134#endif /* _ASM_KPROBES_H */ 122#endif /* _ASM_KPROBES_H */
diff --git a/include/asm-m32r/ioctl.h b/include/asm-m32r/ioctl.h
index 87d8f7db6af1..b279fe06dfe5 100644
--- a/include/asm-m32r/ioctl.h
+++ b/include/asm-m32r/ioctl.h
@@ -1,78 +1 @@
1#ifndef _ASM_M32R_IOCTL_H #include <asm-generic/ioctl.h>
2#define _ASM_M32R_IOCTL_H
3
4/* $Id$ */
5
6/* orig : i386 2.4.18 */
7
8/*
9 * linux/ioctl.h for Linux by H.H. Bergman.
10 */
11
12/* ioctl command encoding: 32 bits total, command in lower 16 bits,
13 * size of the parameter structure in the lower 14 bits of the
14 * upper 16 bits.
15 * Encoding the size of the parameter structure in the ioctl request
16 * is useful for catching programs compiled with old versions
17 * and to avoid overwriting user space outside the user buffer area.
18 * The highest 2 bits are reserved for indicating the ``access mode''.
19 * NOTE: This limits the max parameter size to 16kB -1 !
20 */
21
22/*
23 * The following is for compatibility across the various Linux
24 * platforms. The i386 ioctl numbering scheme doesn't really enforce
25 * a type field. De facto, however, the top 8 bits of the lower 16
26 * bits are indeed used as a type field, so we might just as well make
27 * this explicit here. Please be sure to use the decoding macros
28 * below from now on.
29 */
30#define _IOC_NRBITS 8
31#define _IOC_TYPEBITS 8
32#define _IOC_SIZEBITS 14
33#define _IOC_DIRBITS 2
34
35#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
36#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
37#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
38#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
39
40#define _IOC_NRSHIFT 0
41#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
42#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
43#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
44
45/*
46 * Direction bits.
47 */
48#define _IOC_NONE 0U
49#define _IOC_WRITE 1U
50#define _IOC_READ 2U
51
52#define _IOC(dir,type,nr,size) \
53 (((dir) << _IOC_DIRSHIFT) | \
54 ((type) << _IOC_TYPESHIFT) | \
55 ((nr) << _IOC_NRSHIFT) | \
56 ((size) << _IOC_SIZESHIFT))
57
58/* used to create numbers */
59#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
60#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
61#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
62#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
63
64/* used to decode ioctl numbers.. */
65#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
66#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
67#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
68#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
69
70/* ...and for the drivers/sound files... */
71
72#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
73#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
74#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
75#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
76#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
77
78#endif /* _ASM_M32R_IOCTL_H */
diff --git a/include/asm-m68k/ioctl.h b/include/asm-m68k/ioctl.h
index fd68914ab292..b279fe06dfe5 100644
--- a/include/asm-m68k/ioctl.h
+++ b/include/asm-m68k/ioctl.h
@@ -1,80 +1 @@
1/* $Id: ioctl.h,v 1.3 1997/04/16 15:10:07 jes Exp $ #include <asm-generic/ioctl.h>
2 *
3 * linux/ioctl.h for Linux by H.H. Bergman.
4 */
5
6#ifndef _M68K_IOCTL_H
7#define _M68K_IOCTL_H
8
9/* ioctl command encoding: 32 bits total, command in lower 16 bits,
10 * size of the parameter structure in the lower 14 bits of the
11 * upper 16 bits.
12 * Encoding the size of the parameter structure in the ioctl request
13 * is useful for catching programs compiled with old versions
14 * and to avoid overwriting user space outside the user buffer area.
15 * The highest 2 bits are reserved for indicating the ``access mode''.
16 * NOTE: This limits the max parameter size to 16kB -1 !
17 */
18
19/*
20 * I don't really have any idea about what this should look like, so
21 * for the time being, this is heavily based on the PC definitions.
22 */
23
24/*
25 * The following is for compatibility across the various Linux
26 * platforms. The i386 ioctl numbering scheme doesn't really enforce
27 * a type field. De facto, however, the top 8 bits of the lower 16
28 * bits are indeed used as a type field, so we might just as well make
29 * this explicit here. Please be sure to use the decoding macros
30 * below from now on.
31 */
32#define _IOC_NRBITS 8
33#define _IOC_TYPEBITS 8
34#define _IOC_SIZEBITS 14
35#define _IOC_DIRBITS 2
36
37#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
38#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
39#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
40#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
41
42#define _IOC_NRSHIFT 0
43#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
44#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
45#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
46
47/*
48 * Direction bits.
49 */
50#define _IOC_NONE 0U
51#define _IOC_WRITE 1U
52#define _IOC_READ 2U
53
54#define _IOC(dir,type,nr,size) \
55 (((dir) << _IOC_DIRSHIFT) | \
56 ((type) << _IOC_TYPESHIFT) | \
57 ((nr) << _IOC_NRSHIFT) | \
58 ((size) << _IOC_SIZESHIFT))
59
60/* used to create numbers */
61#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
62#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
63#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
64#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
65
66/* used to decode ioctl numbers.. */
67#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
68#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
69#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
70#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
71
72/* ...and for the drivers/sound files... */
73
74#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
75#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
76#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
77#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
78#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
79
80#endif /* _M68K_IOCTL_H */
diff --git a/include/asm-m68knommu/ioctl.h b/include/asm-m68knommu/ioctl.h
index cff72f33350f..b279fe06dfe5 100644
--- a/include/asm-m68knommu/ioctl.h
+++ b/include/asm-m68knommu/ioctl.h
@@ -1 +1 @@
#include <asm-m68k/ioctl.h> #include <asm-generic/ioctl.h>
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h
index 4263af3cadfd..fffdf690b840 100644
--- a/include/asm-powerpc/kexec.h
+++ b/include/asm-powerpc/kexec.h
@@ -38,9 +38,6 @@
38#ifdef CONFIG_KEXEC 38#ifdef CONFIG_KEXEC
39 39
40#define MAX_NOTE_BYTES 1024 40#define MAX_NOTE_BYTES 1024
41typedef u32 note_buf_t[MAX_NOTE_BYTES / sizeof(u32)];
42
43extern note_buf_t crash_notes[];
44 41
45#ifdef __powerpc64__ 42#ifdef __powerpc64__
46extern void kexec_smp_wait(void); /* get and clear naca physid, wait for 43extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
@@ -58,6 +55,12 @@ extern void default_machine_crash_shutdown(struct pt_regs *regs);
58 55
59#endif /* !CONFIG_KEXEC */ 56#endif /* !CONFIG_KEXEC */
60 57
58/*
59 * Provide a dummy definition to avoid build failures. Will remain
60 * empty till crash dump support is enabled.
61 */
62static inline void crash_setup_regs(struct pt_regs *newregs,
63 struct pt_regs *oldregs) { }
61#endif /* ! __ASSEMBLY__ */ 64#endif /* ! __ASSEMBLY__ */
62#endif /* __KERNEL__ */ 65#endif /* __KERNEL__ */
63#endif /* _ASM_POWERPC_KEXEC_H */ 66#endif /* _ASM_POWERPC_KEXEC_H */
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 0654f79b06df..f466bc804f41 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -30,7 +30,10 @@
30#include <linux/ptrace.h> 30#include <linux/ptrace.h>
31#include <linux/percpu.h> 31#include <linux/percpu.h>
32 32
33#define __ARCH_WANT_KPROBES_INSN_SLOT
34
33struct pt_regs; 35struct pt_regs;
36struct kprobe;
34 37
35typedef unsigned int kprobe_opcode_t; 38typedef unsigned int kprobe_opcode_t;
36#define BREAKPOINT_INSTRUCTION 0x7fe00008 /* trap */ 39#define BREAKPOINT_INSTRUCTION 0x7fe00008 /* trap */
@@ -48,6 +51,7 @@ typedef unsigned int kprobe_opcode_t;
48 51
49#define ARCH_SUPPORTS_KRETPROBES 52#define ARCH_SUPPORTS_KRETPROBES
50void kretprobe_trampoline(void); 53void kretprobe_trampoline(void);
54extern void arch_remove_kprobe(struct kprobe *p);
51 55
52/* Architecture specific copy of original instruction */ 56/* Architecture specific copy of original instruction */
53struct arch_specific_insn { 57struct arch_specific_insn {
@@ -69,15 +73,7 @@ struct kprobe_ctlblk {
69 struct prev_kprobe prev_kprobe; 73 struct prev_kprobe prev_kprobe;
70}; 74};
71 75
72#ifdef CONFIG_KPROBES
73extern int kprobe_exceptions_notify(struct notifier_block *self, 76extern int kprobe_exceptions_notify(struct notifier_block *self,
74 unsigned long val, void *data); 77 unsigned long val, void *data);
75#else /* !CONFIG_KPROBES */
76static inline int kprobe_exceptions_notify(struct notifier_block *self,
77 unsigned long val, void *data)
78{
79 return 0;
80}
81#endif
82#endif /* __KERNEL__ */ 78#endif /* __KERNEL__ */
83#endif /* _ASM_POWERPC_KPROBES_H */ 79#endif /* _ASM_POWERPC_KPROBES_H */
diff --git a/include/asm-s390/ioctl.h b/include/asm-s390/ioctl.h
index df7394345ac4..b279fe06dfe5 100644
--- a/include/asm-s390/ioctl.h
+++ b/include/asm-s390/ioctl.h
@@ -1,88 +1 @@
1/* #include <asm-generic/ioctl.h>
2 * include/asm-s390/ioctl.h
3 *
4 * S390 version
5 *
6 * Derived from "include/asm-i386/ioctl.h"
7 */
8
9#ifndef _S390_IOCTL_H
10#define _S390_IOCTL_H
11
12/* ioctl command encoding: 32 bits total, command in lower 16 bits,
13 * size of the parameter structure in the lower 14 bits of the
14 * upper 16 bits.
15 * Encoding the size of the parameter structure in the ioctl request
16 * is useful for catching programs compiled with old versions
17 * and to avoid overwriting user space outside the user buffer area.
18 * The highest 2 bits are reserved for indicating the ``access mode''.
19 * NOTE: This limits the max parameter size to 16kB -1 !
20 */
21
22/*
23 * The following is for compatibility across the various Linux
24 * platforms. The i386 ioctl numbering scheme doesn't really enforce
25 * a type field. De facto, however, the top 8 bits of the lower 16
26 * bits are indeed used as a type field, so we might just as well make
27 * this explicit here. Please be sure to use the decoding macros
28 * below from now on.
29 */
30#define _IOC_NRBITS 8
31#define _IOC_TYPEBITS 8
32#define _IOC_SIZEBITS 14
33#define _IOC_DIRBITS 2
34
35#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
36#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
37#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
38#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
39
40#define _IOC_NRSHIFT 0
41#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
42#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
43#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
44
45/*
46 * Direction bits.
47 */
48#define _IOC_NONE 0U
49#define _IOC_WRITE 1U
50#define _IOC_READ 2U
51
52#define _IOC(dir,type,nr,size) \
53 (((dir) << _IOC_DIRSHIFT) | \
54 ((type) << _IOC_TYPESHIFT) | \
55 ((nr) << _IOC_NRSHIFT) | \
56 ((size) << _IOC_SIZESHIFT))
57
58/* provoke compile error for invalid uses of size argument */
59extern unsigned long __invalid_size_argument_for_IOC;
60#define _IOC_TYPECHECK(t) \
61 ((sizeof(t) == sizeof(t[1]) && \
62 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
63 sizeof(t) : __invalid_size_argument_for_IOC)
64
65/* used to create numbers */
66#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
67#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
68#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
69#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
70#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
71#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
72#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
73
74/* used to decode ioctl numbers.. */
75#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
76#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
77#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
78#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
79
80/* ...and for the drivers/sound files... */
81
82#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
83#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
84#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
85#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
86#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
87
88#endif /* _S390_IOCTL_H */
diff --git a/include/asm-s390/kexec.h b/include/asm-s390/kexec.h
index 54cf7d9f251c..ce28ddda0f50 100644
--- a/include/asm-s390/kexec.h
+++ b/include/asm-s390/kexec.h
@@ -35,8 +35,9 @@
35#define KEXEC_ARCH KEXEC_ARCH_S390 35#define KEXEC_ARCH KEXEC_ARCH_S390
36 36
37#define MAX_NOTE_BYTES 1024 37#define MAX_NOTE_BYTES 1024
38typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
39 38
40extern note_buf_t crash_notes[]; 39/* Provide a dummy definition to avoid build failures. */
40static inline void crash_setup_regs(struct pt_regs *newregs,
41 struct pt_regs *oldregs) { }
41 42
42#endif /*_S390_KEXEC_H */ 43#endif /*_S390_KEXEC_H */
diff --git a/include/asm-sh/ioctl.h b/include/asm-sh/ioctl.h
index 524700e84acd..b279fe06dfe5 100644
--- a/include/asm-sh/ioctl.h
+++ b/include/asm-sh/ioctl.h
@@ -1,75 +1 @@
1/* $Id: ioctl.h,v 1.1.1.1 2001/10/15 20:45:09 mrbrown Exp $ #include <asm-generic/ioctl.h>
2 *
3 * linux/ioctl.h for Linux by H.H. Bergman.
4 */
5
6#ifndef __ASM_SH_IOCTL_H
7#define __ASM_SH_IOCTL_H
8
9/* ioctl command encoding: 32 bits total, command in lower 16 bits,
10 * size of the parameter structure in the lower 14 bits of the
11 * upper 16 bits.
12 * Encoding the size of the parameter structure in the ioctl request
13 * is useful for catching programs compiled with old versions
14 * and to avoid overwriting user space outside the user buffer area.
15 * The highest 2 bits are reserved for indicating the ``access mode''.
16 * NOTE: This limits the max parameter size to 16kB -1 !
17 */
18
19/*
20 * The following is for compatibility across the various Linux
21 * platforms. The i386 ioctl numbering scheme doesn't really enforce
22 * a type field. De facto, however, the top 8 bits of the lower 16
23 * bits are indeed used as a type field, so we might just as well make
24 * this explicit here. Please be sure to use the decoding macros
25 * below from now on.
26 */
27#define _IOC_NRBITS 8
28#define _IOC_TYPEBITS 8
29#define _IOC_SIZEBITS 14
30#define _IOC_DIRBITS 2
31
32#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
33#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
34#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
35#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
36
37#define _IOC_NRSHIFT 0
38#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
39#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
40#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
41
42/*
43 * Direction bits.
44 */
45#define _IOC_NONE 0U
46#define _IOC_WRITE 1U
47#define _IOC_READ 2U
48
49#define _IOC(dir,type,nr,size) \
50 (((dir) << _IOC_DIRSHIFT) | \
51 ((type) << _IOC_TYPESHIFT) | \
52 ((nr) << _IOC_NRSHIFT) | \
53 ((size) << _IOC_SIZESHIFT))
54
55/* used to create numbers */
56#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
57#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
58#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
59#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
60
61/* used to decode ioctl numbers.. */
62#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
63#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
64#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
65#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
66
67/* ...and for the drivers/sound files... */
68
69#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
70#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
71#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
72#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
73#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
74
75#endif /* __ASM_SH_IOCTL_H */
diff --git a/include/asm-sh64/io.h b/include/asm-sh64/io.h
index cfafaa73b2b0..dee4f77929a4 100644
--- a/include/asm-sh64/io.h
+++ b/include/asm-sh64/io.h
@@ -143,12 +143,12 @@ extern unsigned long pciio_virt;
143 * Change virtual addresses to physical addresses and vv. 143 * Change virtual addresses to physical addresses and vv.
144 * These are trivial on the 1:1 Linux/SuperH mapping 144 * These are trivial on the 1:1 Linux/SuperH mapping
145 */ 145 */
146extern __inline__ unsigned long virt_to_phys(volatile void * address) 146static inline unsigned long virt_to_phys(volatile void * address)
147{ 147{
148 return __pa(address); 148 return __pa(address);
149} 149}
150 150
151extern __inline__ void * phys_to_virt(unsigned long address) 151static inline void * phys_to_virt(unsigned long address)
152{ 152{
153 return __va(address); 153 return __va(address);
154} 154}
@@ -156,12 +156,12 @@ extern __inline__ void * phys_to_virt(unsigned long address)
156extern void * __ioremap(unsigned long phys_addr, unsigned long size, 156extern void * __ioremap(unsigned long phys_addr, unsigned long size,
157 unsigned long flags); 157 unsigned long flags);
158 158
159extern __inline__ void * ioremap(unsigned long phys_addr, unsigned long size) 159static inline void * ioremap(unsigned long phys_addr, unsigned long size)
160{ 160{
161 return __ioremap(phys_addr, size, 1); 161 return __ioremap(phys_addr, size, 1);
162} 162}
163 163
164extern __inline__ void * ioremap_nocache (unsigned long phys_addr, unsigned long size) 164static inline void * ioremap_nocache (unsigned long phys_addr, unsigned long size)
165{ 165{
166 return __ioremap(phys_addr, size, 0); 166 return __ioremap(phys_addr, size, 0);
167} 167}
diff --git a/include/asm-sh64/ioctl.h b/include/asm-sh64/ioctl.h
index c089a6fb78e0..b279fe06dfe5 100644
--- a/include/asm-sh64/ioctl.h
+++ b/include/asm-sh64/ioctl.h
@@ -1,83 +1 @@
1#ifndef __ASM_SH64_IOCTL_H #include <asm-generic/ioctl.h>
2#define __ASM_SH64_IOCTL_H
3
4/*
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * include/asm-sh64/ioctl.h
10 *
11 * Copyright (C) 2000, 2001 Paolo Alberelli
12 *
13 * linux/ioctl.h for Linux by H.H. Bergman.
14 *
15 */
16
17/* ioctl command encoding: 32 bits total, command in lower 16 bits,
18 * size of the parameter structure in the lower 14 bits of the
19 * upper 16 bits.
20 * Encoding the size of the parameter structure in the ioctl request
21 * is useful for catching programs compiled with old versions
22 * and to avoid overwriting user space outside the user buffer area.
23 * The highest 2 bits are reserved for indicating the ``access mode''.
24 * NOTE: This limits the max parameter size to 16kB -1 !
25 */
26
27/*
28 * The following is for compatibility across the various Linux
29 * platforms. The i386 ioctl numbering scheme doesn't really enforce
30 * a type field. De facto, however, the top 8 bits of the lower 16
31 * bits are indeed used as a type field, so we might just as well make
32 * this explicit here. Please be sure to use the decoding macros
33 * below from now on.
34 */
35#define _IOC_NRBITS 8
36#define _IOC_TYPEBITS 8
37#define _IOC_SIZEBITS 14
38#define _IOC_DIRBITS 2
39
40#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
41#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
42#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
43#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
44
45#define _IOC_NRSHIFT 0
46#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
47#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
48#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
49
50/*
51 * Direction bits.
52 */
53#define _IOC_NONE 0U
54#define _IOC_WRITE 1U
55#define _IOC_READ 2U
56
57#define _IOC(dir,type,nr,size) \
58 (((dir) << _IOC_DIRSHIFT) | \
59 ((type) << _IOC_TYPESHIFT) | \
60 ((nr) << _IOC_NRSHIFT) | \
61 ((size) << _IOC_SIZESHIFT))
62
63/* used to create numbers */
64#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
65#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
66#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
67#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
68
69/* used to decode ioctl numbers.. */
70#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
71#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
72#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
73#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
74
75/* ...and for the drivers/sound files... */
76
77#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
78#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
79#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
80#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
81#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
82
83#endif /* __ASM_SH64_IOCTL_H */
diff --git a/include/asm-sh64/mmu_context.h b/include/asm-sh64/mmu_context.h
index f062e1513272..991cfda4cdf6 100644
--- a/include/asm-sh64/mmu_context.h
+++ b/include/asm-sh64/mmu_context.h
@@ -50,7 +50,7 @@ extern pgd_t *mmu_pdtp_cache;
50 */ 50 */
51#define MMU_VPN_MASK 0xfffff000 51#define MMU_VPN_MASK 0xfffff000
52 52
53extern __inline__ void 53static inline void
54get_new_mmu_context(struct mm_struct *mm) 54get_new_mmu_context(struct mm_struct *mm)
55{ 55{
56 extern void flush_tlb_all(void); 56 extern void flush_tlb_all(void);
diff --git a/include/asm-sh64/pgalloc.h b/include/asm-sh64/pgalloc.h
index b25f5df5535c..678251ac1db8 100644
--- a/include/asm-sh64/pgalloc.h
+++ b/include/asm-sh64/pgalloc.h
@@ -38,14 +38,14 @@ static inline void pgd_init(unsigned long page)
38 * if any. 38 * if any.
39 */ 39 */
40 40
41extern __inline__ pgd_t *get_pgd_slow(void) 41static inline pgd_t *get_pgd_slow(void)
42{ 42{
43 unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); 43 unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t));
44 pgd_t *ret = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL); 44 pgd_t *ret = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL);
45 return ret; 45 return ret;
46} 46}
47 47
48extern __inline__ pgd_t *get_pgd_fast(void) 48static inline pgd_t *get_pgd_fast(void)
49{ 49{
50 unsigned long *ret; 50 unsigned long *ret;
51 51
@@ -62,14 +62,14 @@ extern __inline__ pgd_t *get_pgd_fast(void)
62 return (pgd_t *)ret; 62 return (pgd_t *)ret;
63} 63}
64 64
65extern __inline__ void free_pgd_fast(pgd_t *pgd) 65static inline void free_pgd_fast(pgd_t *pgd)
66{ 66{
67 *(unsigned long *)pgd = (unsigned long) pgd_quicklist; 67 *(unsigned long *)pgd = (unsigned long) pgd_quicklist;
68 pgd_quicklist = (unsigned long *) pgd; 68 pgd_quicklist = (unsigned long *) pgd;
69 pgtable_cache_size++; 69 pgtable_cache_size++;
70} 70}
71 71
72extern __inline__ void free_pgd_slow(pgd_t *pgd) 72static inline void free_pgd_slow(pgd_t *pgd)
73{ 73{
74 kfree((void *)pgd); 74 kfree((void *)pgd);
75} 75}
@@ -77,7 +77,7 @@ extern __inline__ void free_pgd_slow(pgd_t *pgd)
77extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted); 77extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted);
78extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long address_preadjusted); 78extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long address_preadjusted);
79 79
80extern __inline__ pte_t *get_pte_fast(void) 80static inline pte_t *get_pte_fast(void)
81{ 81{
82 unsigned long *ret; 82 unsigned long *ret;
83 83
@@ -89,7 +89,7 @@ extern __inline__ pte_t *get_pte_fast(void)
89 return (pte_t *)ret; 89 return (pte_t *)ret;
90} 90}
91 91
92extern __inline__ void free_pte_fast(pte_t *pte) 92static inline void free_pte_fast(pte_t *pte)
93{ 93{
94 *(unsigned long *)pte = (unsigned long) pte_quicklist; 94 *(unsigned long *)pte = (unsigned long) pte_quicklist;
95 pte_quicklist = (unsigned long *) pte; 95 pte_quicklist = (unsigned long *) pte;
@@ -167,7 +167,7 @@ static __inline__ void pmd_free(pmd_t *pmd)
167 167
168extern int do_check_pgt_cache(int, int); 168extern int do_check_pgt_cache(int, int);
169 169
170extern inline void set_pgdir(unsigned long address, pgd_t entry) 170static inline void set_pgdir(unsigned long address, pgd_t entry)
171{ 171{
172 struct task_struct * p; 172 struct task_struct * p;
173 pgd_t *pgd; 173 pgd_t *pgd;
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h
index a1906a772df9..57af6b3eb271 100644
--- a/include/asm-sh64/pgtable.h
+++ b/include/asm-sh64/pgtable.h
@@ -421,18 +421,18 @@ static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; }
421static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 421static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
422static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; } 422static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_WRITE; }
423 423
424extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_READ)); return pte; } 424static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_READ)); return pte; }
425extern inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; } 425static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_WRITE)); return pte; }
426extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_EXECUTE)); return pte; } 426static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_EXECUTE)); return pte; }
427extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } 427static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
428extern inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } 428static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
429 429
430extern inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_READ)); return pte; } 430static inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_READ)); return pte; }
431extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; } 431static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_WRITE)); return pte; }
432extern inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE)); return pte; } 432static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_EXECUTE)); return pte; }
433extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } 433static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
434extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } 434static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
435extern inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; } 435static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_SZHUGE)); return pte; }
436 436
437 437
438/* 438/*
@@ -456,7 +456,7 @@ extern inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _
456#define mk_pte_phys(physpage, pgprot) \ 456#define mk_pte_phys(physpage, pgprot) \
457({ pte_t __pte; set_pte(&__pte, __pte(physpage | pgprot_val(pgprot))); __pte; }) 457({ pte_t __pte; set_pte(&__pte, __pte(physpage | pgprot_val(pgprot))); __pte; })
458 458
459extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 459static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
460{ set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } 460{ set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; }
461 461
462typedef pte_t *pte_addr_t; 462typedef pte_t *pte_addr_t;
diff --git a/include/asm-sh64/processor.h b/include/asm-sh64/processor.h
index a51bd41e6fbc..1bf252dad824 100644
--- a/include/asm-sh64/processor.h
+++ b/include/asm-sh64/processor.h
@@ -228,7 +228,7 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
228 * FPU lazy state save handling. 228 * FPU lazy state save handling.
229 */ 229 */
230 230
231extern __inline__ void release_fpu(void) 231static inline void release_fpu(void)
232{ 232{
233 unsigned long long __dummy; 233 unsigned long long __dummy;
234 234
@@ -240,7 +240,7 @@ extern __inline__ void release_fpu(void)
240 : "r" (SR_FD)); 240 : "r" (SR_FD));
241} 241}
242 242
243extern __inline__ void grab_fpu(void) 243static inline void grab_fpu(void)
244{ 244{
245 unsigned long long __dummy; 245 unsigned long long __dummy;
246 246
diff --git a/include/asm-sh64/system.h b/include/asm-sh64/system.h
index 42510e496eb5..3002e988180c 100644
--- a/include/asm-sh64/system.h
+++ b/include/asm-sh64/system.h
@@ -132,7 +132,7 @@ static __inline__ void local_irq_disable(void)
132 (flags != 0); \ 132 (flags != 0); \
133}) 133})
134 134
135extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val) 135static inline unsigned long xchg_u32(volatile int * m, unsigned long val)
136{ 136{
137 unsigned long flags, retval; 137 unsigned long flags, retval;
138 138
@@ -143,7 +143,7 @@ extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val)
143 return retval; 143 return retval;
144} 144}
145 145
146extern __inline__ unsigned long xchg_u8(volatile unsigned char * m, unsigned long val) 146static inline unsigned long xchg_u8(volatile unsigned char * m, unsigned long val)
147{ 147{
148 unsigned long flags, retval; 148 unsigned long flags, retval;
149 149
diff --git a/include/asm-sh64/tlbflush.h b/include/asm-sh64/tlbflush.h
index 15c0719eecc3..e45beadc29ee 100644
--- a/include/asm-sh64/tlbflush.h
+++ b/include/asm-sh64/tlbflush.h
@@ -20,7 +20,7 @@ extern void flush_tlb_mm(struct mm_struct *mm);
20extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, 20extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
21 unsigned long end); 21 unsigned long end);
22extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page); 22extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long page);
23extern inline void flush_tlb_pgtables(struct mm_struct *mm, 23static inline void flush_tlb_pgtables(struct mm_struct *mm,
24 unsigned long start, unsigned long end) 24 unsigned long start, unsigned long end)
25{ 25{
26} 26}
diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h
index 56aa3cf0f273..f4936d8fa617 100644
--- a/include/asm-sh64/uaccess.h
+++ b/include/asm-sh64/uaccess.h
@@ -287,7 +287,7 @@ __sfu_res = __strncpy_from_user((unsigned long) (dest), __sfu_src, __sfu_count);
287 */ 287 */
288extern long __strnlen_user(const char *__s, long __n); 288extern long __strnlen_user(const char *__s, long __n);
289 289
290extern __inline__ long strnlen_user(const char *s, long n) 290static inline long strnlen_user(const char *s, long n)
291{ 291{
292 if (!__addr_ok(s)) 292 if (!__addr_ok(s))
293 return 0; 293 return 0;
diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h
index 7ba845320f5c..e4efe652b54b 100644
--- a/include/asm-sparc64/kprobes.h
+++ b/include/asm-sparc64/kprobes.h
@@ -12,6 +12,7 @@ typedef u32 kprobe_opcode_t;
12#define MAX_INSN_SIZE 2 12#define MAX_INSN_SIZE 2
13 13
14#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 14#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
15#define arch_remove_kprobe(p) do {} while (0)
15 16
16/* Architecture specific copy of original instruction*/ 17/* Architecture specific copy of original instruction*/
17struct arch_specific_insn { 18struct arch_specific_insn {
@@ -38,15 +39,6 @@ struct kprobe_ctlblk {
38 struct prev_kprobe prev_kprobe; 39 struct prev_kprobe prev_kprobe;
39}; 40};
40 41
41#ifdef CONFIG_KPROBES
42extern int kprobe_exceptions_notify(struct notifier_block *self, 42extern int kprobe_exceptions_notify(struct notifier_block *self,
43 unsigned long val, void *data); 43 unsigned long val, void *data);
44#else /* !CONFIG_KPROBES */
45static inline int kprobe_exceptions_notify(struct notifier_block *self,
46 unsigned long val, void *data)
47{
48 return 0;
49}
50#endif
51
52#endif /* _SPARC64_KPROBES_H */ 44#endif /* _SPARC64_KPROBES_H */
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index 075771c371f6..da07a69ce82a 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -89,7 +89,6 @@ extern struct task_struct *alloc_task_struct(void);
89 89
90extern void release_thread(struct task_struct *); 90extern void release_thread(struct task_struct *);
91extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); 91extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
92extern void dump_thread(struct pt_regs *regs, struct user *u);
93 92
94static inline void prepare_to_copy(struct task_struct *tsk) 93static inline void prepare_to_copy(struct task_struct *tsk)
95{ 94{
diff --git a/include/asm-v850/ioctl.h b/include/asm-v850/ioctl.h
index 1765df6c7b87..b279fe06dfe5 100644
--- a/include/asm-v850/ioctl.h
+++ b/include/asm-v850/ioctl.h
@@ -1,80 +1 @@
1/* $Id: ioctl.h,v 1.1 2002/09/28 14:58:41 gerg Exp $ #include <asm-generic/ioctl.h>
2 *
3 * linux/ioctl.h for Linux by H.H. Bergman.
4 */
5
6#ifndef _V850_IOCTL_H
7#define _V850_IOCTL_H
8
9/* ioctl command encoding: 32 bits total, command in lower 16 bits,
10 * size of the parameter structure in the lower 14 bits of the
11 * upper 16 bits.
12 * Encoding the size of the parameter structure in the ioctl request
13 * is useful for catching programs compiled with old versions
14 * and to avoid overwriting user space outside the user buffer area.
15 * The highest 2 bits are reserved for indicating the ``access mode''.
16 * NOTE: This limits the max parameter size to 16kB -1 !
17 */
18
19/*
20 * I don't really have any idea about what this should look like, so
21 * for the time being, this is heavily based on the PC definitions.
22 */
23
24/*
25 * The following is for compatibility across the various Linux
26 * platforms. The i386 ioctl numbering scheme doesn't really enforce
27 * a type field. De facto, however, the top 8 bits of the lower 16
28 * bits are indeed used as a type field, so we might just as well make
29 * this explicit here. Please be sure to use the decoding macros
30 * below from now on.
31 */
32#define _IOC_NRBITS 8
33#define _IOC_TYPEBITS 8
34#define _IOC_SIZEBITS 14
35#define _IOC_DIRBITS 2
36
37#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
38#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
39#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
40#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
41
42#define _IOC_NRSHIFT 0
43#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
44#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
45#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
46
47/*
48 * Direction bits.
49 */
50#define _IOC_NONE 0U
51#define _IOC_WRITE 1U
52#define _IOC_READ 2U
53
54#define _IOC(dir,type,nr,size) \
55 (((dir) << _IOC_DIRSHIFT) | \
56 ((type) << _IOC_TYPESHIFT) | \
57 ((nr) << _IOC_NRSHIFT) | \
58 ((size) << _IOC_SIZESHIFT))
59
60/* used to create numbers */
61#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
62#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
63#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
64#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
65
66/* used to decode ioctl numbers.. */
67#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
68#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
69#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
70#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
71
72/* ...and for the drivers/sound files... */
73
74#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
75#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
76#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
77#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
78#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
79
80#endif /* __V850_IOCTL_H__ */
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h
index e682edc24a68..8dcc32665240 100644
--- a/include/asm-x86_64/e820.h
+++ b/include/asm-x86_64/e820.h
@@ -55,6 +55,7 @@ extern unsigned long e820_hole_size(unsigned long start_pfn,
55 unsigned long end_pfn); 55 unsigned long end_pfn);
56 56
57extern void __init parse_memopt(char *p, char **end); 57extern void __init parse_memopt(char *p, char **end);
58extern void __init parse_memmapopt(char *p, char **end);
58 59
59extern struct e820map e820; 60extern struct e820map e820;
60#endif/*!__ASSEMBLY__*/ 61#endif/*!__ASSEMBLY__*/
diff --git a/include/asm-x86_64/ioctl.h b/include/asm-x86_64/ioctl.h
index 609b663b6bf4..b279fe06dfe5 100644
--- a/include/asm-x86_64/ioctl.h
+++ b/include/asm-x86_64/ioctl.h
@@ -1,75 +1 @@
1/* $Id: ioctl.h,v 1.2 2001/07/04 09:08:13 ak Exp $ #include <asm-generic/ioctl.h>
2 *
3 * linux/ioctl.h for Linux by H.H. Bergman.
4 */
5
6#ifndef _ASMX8664_IOCTL_H
7#define _ASMX8664_IOCTL_H
8
9/* ioctl command encoding: 32 bits total, command in lower 16 bits,
10 * size of the parameter structure in the lower 14 bits of the
11 * upper 16 bits.
12 * Encoding the size of the parameter structure in the ioctl request
13 * is useful for catching programs compiled with old versions
14 * and to avoid overwriting user space outside the user buffer area.
15 * The highest 2 bits are reserved for indicating the ``access mode''.
16 * NOTE: This limits the max parameter size to 16kB -1 !
17 */
18
19/*
20 * The following is for compatibility across the various Linux
21 * platforms. The i386 ioctl numbering scheme doesn't really enforce
22 * a type field. De facto, however, the top 8 bits of the lower 16
23 * bits are indeed used as a type field, so we might just as well make
24 * this explicit here. Please be sure to use the decoding macros
25 * below from now on.
26 */
27#define _IOC_NRBITS 8
28#define _IOC_TYPEBITS 8
29#define _IOC_SIZEBITS 14
30#define _IOC_DIRBITS 2
31
32#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
33#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
34#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
35#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
36
37#define _IOC_NRSHIFT 0
38#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
39#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
40#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
41
42/*
43 * Direction bits.
44 */
45#define _IOC_NONE 0U
46#define _IOC_WRITE 1U
47#define _IOC_READ 2U
48
49#define _IOC(dir,type,nr,size) \
50 (((dir) << _IOC_DIRSHIFT) | \
51 ((type) << _IOC_TYPESHIFT) | \
52 ((nr) << _IOC_NRSHIFT) | \
53 ((size) << _IOC_SIZESHIFT))
54
55/* used to create numbers */
56#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
57#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
58#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
59#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
60
61/* used to decode ioctl numbers.. */
62#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
63#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
64#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
65#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
66
67/* ...and for the drivers/sound files... */
68
69#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
70#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
71#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
72#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
73#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
74
75#endif /* _ASMX8664_IOCTL_H */
diff --git a/include/asm-x86_64/kexec.h b/include/asm-x86_64/kexec.h
index 42d2ff15c592..ae28cd44bcd3 100644
--- a/include/asm-x86_64/kexec.h
+++ b/include/asm-x86_64/kexec.h
@@ -3,6 +3,7 @@
3 3
4#include <asm/page.h> 4#include <asm/page.h>
5#include <asm/proto.h> 5#include <asm/proto.h>
6#include <asm/ptrace.h>
6 7
7/* 8/*
8 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. 9 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
@@ -26,8 +27,40 @@
26#define KEXEC_ARCH KEXEC_ARCH_X86_64 27#define KEXEC_ARCH KEXEC_ARCH_X86_64
27 28
28#define MAX_NOTE_BYTES 1024 29#define MAX_NOTE_BYTES 1024
29typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
30 30
31extern note_buf_t crash_notes[]; 31/*
32 * Saving the registers of the cpu on which panic occured in
33 * crash_kexec to save a valid sp. The registers of other cpus
34 * will be saved in machine_crash_shutdown while shooting down them.
35 */
36
37static inline void crash_setup_regs(struct pt_regs *newregs,
38 struct pt_regs *oldregs)
39{
40 if (oldregs)
41 memcpy(newregs, oldregs, sizeof(*newregs));
42 else {
43 __asm__ __volatile__("movq %%rbx,%0" : "=m"(newregs->rbx));
44 __asm__ __volatile__("movq %%rcx,%0" : "=m"(newregs->rcx));
45 __asm__ __volatile__("movq %%rdx,%0" : "=m"(newregs->rdx));
46 __asm__ __volatile__("movq %%rsi,%0" : "=m"(newregs->rsi));
47 __asm__ __volatile__("movq %%rdi,%0" : "=m"(newregs->rdi));
48 __asm__ __volatile__("movq %%rbp,%0" : "=m"(newregs->rbp));
49 __asm__ __volatile__("movq %%rax,%0" : "=m"(newregs->rax));
50 __asm__ __volatile__("movq %%rsp,%0" : "=m"(newregs->rsp));
51 __asm__ __volatile__("movq %%r8,%0" : "=m"(newregs->r8));
52 __asm__ __volatile__("movq %%r9,%0" : "=m"(newregs->r9));
53 __asm__ __volatile__("movq %%r10,%0" : "=m"(newregs->r10));
54 __asm__ __volatile__("movq %%r11,%0" : "=m"(newregs->r11));
55 __asm__ __volatile__("movq %%r12,%0" : "=m"(newregs->r12));
56 __asm__ __volatile__("movq %%r13,%0" : "=m"(newregs->r13));
57 __asm__ __volatile__("movq %%r14,%0" : "=m"(newregs->r14));
58 __asm__ __volatile__("movq %%r15,%0" : "=m"(newregs->r15));
59 __asm__ __volatile__("movl %%ss, %%eax;" :"=a"(newregs->ss));
60 __asm__ __volatile__("movl %%cs, %%eax;" :"=a"(newregs->cs));
61 __asm__ __volatile__("pushfq; popq %0" :"=m"(newregs->eflags));
32 62
63 newregs->rip = (unsigned long)current_text_addr();
64 }
65}
33#endif /* _X86_64_KEXEC_H */ 66#endif /* _X86_64_KEXEC_H */
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h
index 4dd7a7e148d4..98a1e95ddb98 100644
--- a/include/asm-x86_64/kprobes.h
+++ b/include/asm-x86_64/kprobes.h
@@ -27,7 +27,10 @@
27#include <linux/ptrace.h> 27#include <linux/ptrace.h>
28#include <linux/percpu.h> 28#include <linux/percpu.h>
29 29
30#define __ARCH_WANT_KPROBES_INSN_SLOT
31
30struct pt_regs; 32struct pt_regs;
33struct kprobe;
31 34
32typedef u8 kprobe_opcode_t; 35typedef u8 kprobe_opcode_t;
33#define BREAKPOINT_INSTRUCTION 0xcc 36#define BREAKPOINT_INSTRUCTION 0xcc
@@ -42,6 +45,7 @@ typedef u8 kprobe_opcode_t;
42#define ARCH_SUPPORTS_KRETPROBES 45#define ARCH_SUPPORTS_KRETPROBES
43 46
44void kretprobe_trampoline(void); 47void kretprobe_trampoline(void);
48extern void arch_remove_kprobe(struct kprobe *p);
45 49
46/* Architecture specific copy of original instruction*/ 50/* Architecture specific copy of original instruction*/
47struct arch_specific_insn { 51struct arch_specific_insn {
diff --git a/include/asm-xtensa/ioctl.h b/include/asm-xtensa/ioctl.h
index 856c605d62b1..b279fe06dfe5 100644
--- a/include/asm-xtensa/ioctl.h
+++ b/include/asm-xtensa/ioctl.h
@@ -1,83 +1 @@
1/* #include <asm-generic/ioctl.h>
2 * include/asm-xtensa/ioctl.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 *
10 * Derived from "include/asm-i386/ioctl.h"
11 */
12
13#ifndef _XTENSA_IOCTL_H
14#define _XTENSA_IOCTL_H
15
16
17/* ioctl command encoding: 32 bits total, command in lower 16 bits,
18 * size of the parameter structure in the lower 14 bits of the
19 * upper 16 bits.
20 * Encoding the size of the parameter structure in the ioctl request
21 * is useful for catching programs compiled with old versions
22 * and to avoid overwriting user space outside the user buffer area.
23 * The highest 2 bits are reserved for indicating the ``access mode''.
24 * NOTE: This limits the max parameter size to 16kB -1 !
25 */
26
27/*
28 * The following is for compatibility across the various Linux
29 * platforms. The i386 ioctl numbering scheme doesn't really enforce
30 * a type field. De facto, however, the top 8 bits of the lower 16
31 * bits are indeed used as a type field, so we might just as well make
32 * this explicit here. Please be sure to use the decoding macros
33 * below from now on.
34 */
35#define _IOC_NRBITS 8
36#define _IOC_TYPEBITS 8
37#define _IOC_SIZEBITS 14
38#define _IOC_DIRBITS 2
39
40#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
41#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
42#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
43#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
44
45#define _IOC_NRSHIFT 0
46#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
47#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
48#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
49
50/*
51 * Direction bits.
52 */
53#define _IOC_NONE 0U
54#define _IOC_WRITE 1U
55#define _IOC_READ 2U
56
57#define _IOC(dir,type,nr,size) \
58 (((dir) << _IOC_DIRSHIFT) | \
59 ((type) << _IOC_TYPESHIFT) | \
60 ((nr) << _IOC_NRSHIFT) | \
61 ((size) << _IOC_SIZESHIFT))
62
63/* used to create numbers */
64#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
65#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
66#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
67#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
68
69/* used to decode ioctl numbers.. */
70#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
71#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
72#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
73#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
74
75/* ...and for the drivers/sound files... */
76
77#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
78#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
79#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
80#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
81#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
82
83#endif
diff --git a/include/linux/calc64.h b/include/linux/calc64.h
new file mode 100644
index 000000000000..ebf4b8f38d88
--- /dev/null
+++ b/include/linux/calc64.h
@@ -0,0 +1,49 @@
1#ifndef _LINUX_CALC64_H
2#define _LINUX_CALC64_H
3
4#include <linux/types.h>
5#include <asm/div64.h>
6
7/*
8 * This is a generic macro which is used when the architecture
9 * specific div64.h does not provide a optimized one.
10 *
11 * The 64bit dividend is divided by the divisor (data type long), the
12 * result is returned and the remainder stored in the variable
13 * referenced by remainder (data type long *). In contrast to the
14 * do_div macro the dividend is kept intact.
15 */
16#ifndef div_long_long_rem
17#define div_long_long_rem(dividend, divisor, remainder) \
18 do_div_llr((dividend), divisor, remainder)
19
20static inline unsigned long do_div_llr(const long long dividend,
21 const long divisor, long *remainder)
22{
23 u64 result = dividend;
24
25 *(remainder) = do_div(result, divisor);
26 return (unsigned long) result;
27}
28#endif
29
30/*
31 * Sign aware variation of the above. On some architectures a
32 * negative dividend leads to an divide overflow exception, which
33 * is avoided by the sign check.
34 */
35static inline long div_long_long_rem_signed(const long long dividend,
36 const long divisor, long *remainder)
37{
38 long res;
39
40 if (unlikely(dividend < 0)) {
41 res = -div_long_long_rem(-dividend, divisor, remainder);
42 *remainder = -(*remainder);
43 } else
44 res = div_long_long_rem(dividend, divisor, remainder);
45
46 return res;
47}
48
49#endif
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index 339878952f12..8fad50f8e389 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -2,14 +2,6 @@
2 * compatible types passed or none at all... Please include 2 * compatible types passed or none at all... Please include
3 * only stuff that is compatible on *all architectures*. 3 * only stuff that is compatible on *all architectures*.
4 */ 4 */
5#ifndef COMPATIBLE_IOCTL /* pointer to compatible structure or no argument */
6#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl)
7#endif
8
9#ifndef ULONG_IOCTL /* argument is an unsigned long integer, not a pointer */
10#define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl)
11#endif
12
13 5
14COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */ 6COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
15COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */ 7COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 92ae3e2067b0..d1e370d25f7b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -114,8 +114,7 @@ extern int dir_notify_enable;
114/* 114/*
115 * Superblock flags that can be altered by MS_REMOUNT 115 * Superblock flags that can be altered by MS_REMOUNT
116 */ 116 */
117#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|\ 117#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK)
118 MS_NODIRATIME)
119 118
120/* 119/*
121 * Old magic mount flag and mask 120 * Old magic mount flag and mask
@@ -161,8 +160,6 @@ extern int dir_notify_enable;
161#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) 160#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
162#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) 161#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
163#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) 162#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
164#define IS_NOATIME(inode) (__IS_FLG(inode, MS_NOATIME) || ((inode)->i_flags & S_NOATIME))
165#define IS_NODIRATIME(inode) __IS_FLG(inode, MS_NODIRATIME)
166#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL) 163#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
167 164
168#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) 165#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
@@ -235,9 +232,6 @@ struct kstatfs;
235struct vm_area_struct; 232struct vm_area_struct;
236struct vfsmount; 233struct vfsmount;
237 234
238/* Used to be a macro which just called the function, now just a function */
239extern void update_atime (struct inode *);
240
241extern void __init inode_init(unsigned long); 235extern void __init inode_init(unsigned long);
242extern void __init inode_init_early(void); 236extern void __init inode_init_early(void);
243extern void __init mnt_init(unsigned long); 237extern void __init mnt_init(unsigned long);
@@ -1118,12 +1112,7 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1118 __mark_inode_dirty(inode, I_DIRTY_SYNC); 1112 __mark_inode_dirty(inode, I_DIRTY_SYNC);
1119} 1113}
1120 1114
1121static inline void touch_atime(struct vfsmount *mnt, struct dentry *dentry) 1115extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
1122{
1123 /* per-mountpoint checks will go here */
1124 update_atime(dentry->d_inode);
1125}
1126
1127static inline void file_accessed(struct file *file) 1116static inline void file_accessed(struct file *file)
1128{ 1117{
1129 if (!(file->f_flags & O_NOATIME)) 1118 if (!(file->f_flags & O_NOATIME))
@@ -1716,7 +1705,7 @@ extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const vo
1716extern int inode_change_ok(struct inode *, struct iattr *); 1705extern int inode_change_ok(struct inode *, struct iattr *);
1717extern int __must_check inode_setattr(struct inode *, struct iattr *); 1706extern int __must_check inode_setattr(struct inode *, struct iattr *);
1718 1707
1719extern void inode_update_time(struct inode *inode, int ctime_too); 1708extern void file_update_time(struct file *file);
1720 1709
1721static inline ino_t parent_ino(struct dentry *dentry) 1710static inline ino_t parent_ino(struct dentry *dentry)
1722{ 1711{
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
new file mode 100644
index 000000000000..cf5cfdf8d613
--- /dev/null
+++ b/include/linux/hrtimer.h
@@ -0,0 +1,143 @@
1/*
2 * include/linux/hrtimer.h
3 *
4 * hrtimers - High-resolution kernel timers
5 *
6 * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de>
7 * Copyright(C) 2005, Red Hat, Inc., Ingo Molnar
8 *
9 * data type definitions, declarations, prototypes
10 *
11 * Started by: Thomas Gleixner and Ingo Molnar
12 *
13 * For licencing details see kernel-base/COPYING
14 */
15#ifndef _LINUX_HRTIMER_H
16#define _LINUX_HRTIMER_H
17
18#include <linux/rbtree.h>
19#include <linux/ktime.h>
20#include <linux/init.h>
21#include <linux/list.h>
22#include <linux/wait.h>
23
24/*
25 * Mode arguments of xxx_hrtimer functions:
26 */
27enum hrtimer_mode {
28 HRTIMER_ABS, /* Time value is absolute */
29 HRTIMER_REL, /* Time value is relative to now */
30};
31
32enum hrtimer_restart {
33 HRTIMER_NORESTART,
34 HRTIMER_RESTART,
35};
36
37/*
38 * Timer states:
39 */
40enum hrtimer_state {
41 HRTIMER_INACTIVE, /* Timer is inactive */
42 HRTIMER_EXPIRED, /* Timer is expired */
43 HRTIMER_PENDING, /* Timer is pending */
44};
45
46struct hrtimer_base;
47
48/**
49 * struct hrtimer - the basic hrtimer structure
50 *
51 * @node: red black tree node for time ordered insertion
52 * @list: list head for easier access to the time ordered list,
53 * without walking the red black tree.
54 * @expires: the absolute expiry time in the hrtimers internal
55 * representation. The time is related to the clock on
56 * which the timer is based.
57 * @state: state of the timer
58 * @function: timer expiry callback function
59 * @data: argument for the callback function
60 * @base: pointer to the timer base (per cpu and per clock)
61 *
62 * The hrtimer structure must be initialized by init_hrtimer_#CLOCKTYPE()
63 */
64struct hrtimer {
65 struct rb_node node;
66 struct list_head list;
67 ktime_t expires;
68 enum hrtimer_state state;
69 int (*function)(void *);
70 void *data;
71 struct hrtimer_base *base;
72};
73
74/**
75 * struct hrtimer_base - the timer base for a specific clock
76 *
77 * @index: clock type index for per_cpu support when moving a timer
78 * to a base on another cpu.
79 * @lock: lock protecting the base and associated timers
80 * @active: red black tree root node for the active timers
81 * @pending: list of pending timers for simple time ordered access
82 * @resolution: the resolution of the clock, in nanoseconds
83 * @get_time: function to retrieve the current time of the clock
84 * @curr_timer: the timer which is executing a callback right now
85 */
86struct hrtimer_base {
87 clockid_t index;
88 spinlock_t lock;
89 struct rb_root active;
90 struct list_head pending;
91 unsigned long resolution;
92 ktime_t (*get_time)(void);
93 struct hrtimer *curr_timer;
94};
95
96/*
97 * clock_was_set() is a NOP for non- high-resolution systems. The
98 * time-sorted order guarantees that a timer does not expire early and
99 * is expired in the next softirq when the clock was advanced.
100 */
101#define clock_was_set() do { } while (0)
102
103/* Exported timer functions: */
104
105/* Initialize timers: */
106extern void hrtimer_init(struct hrtimer *timer, const clockid_t which_clock);
107extern void hrtimer_rebase(struct hrtimer *timer, const clockid_t which_clock);
108
109
110/* Basic timer operations: */
111extern int hrtimer_start(struct hrtimer *timer, ktime_t tim,
112 const enum hrtimer_mode mode);
113extern int hrtimer_cancel(struct hrtimer *timer);
114extern int hrtimer_try_to_cancel(struct hrtimer *timer);
115
116#define hrtimer_restart(timer) hrtimer_start((timer), (timer)->expires, HRTIMER_ABS)
117
118/* Query timers: */
119extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
120extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);
121
122static inline int hrtimer_active(const struct hrtimer *timer)
123{
124 return timer->state == HRTIMER_PENDING;
125}
126
127/* Forward a hrtimer so it expires after now: */
128extern unsigned long hrtimer_forward(struct hrtimer *timer,
129 const ktime_t interval);
130
131/* Precise sleep: */
132extern long hrtimer_nanosleep(struct timespec *rqtp,
133 struct timespec __user *rmtp,
134 const enum hrtimer_mode mode,
135 const clockid_t clockid);
136
137/* Soft interrupt function to run the hrtimer queues: */
138extern void hrtimer_run_queues(void);
139
140/* Bootup initialization: */
141extern void __init hrtimers_init(void);
142
143#endif
diff --git a/include/linux/isicom.h b/include/linux/isicom.h
index 7c6eae7f6ed7..45b3d48f0978 100644
--- a/include/linux/isicom.h
+++ b/include/linux/isicom.h
@@ -4,47 +4,12 @@
4/*#define ISICOM_DEBUG*/ 4/*#define ISICOM_DEBUG*/
5/*#define ISICOM_DEBUG_DTR_RTS*/ 5/*#define ISICOM_DEBUG_DTR_RTS*/
6 6
7
8/*
9 * Firmware Loader definitions ...
10 */
11
12#define __MultiTech ('M'<<8)
13#define MIOCTL_LOAD_FIRMWARE (__MultiTech | 0x01)
14#define MIOCTL_READ_FIRMWARE (__MultiTech | 0x02)
15#define MIOCTL_XFER_CTRL (__MultiTech | 0x03)
16#define MIOCTL_RESET_CARD (__MultiTech | 0x04)
17
18#define DATA_SIZE 16
19
20typedef struct {
21 unsigned short exec_segment;
22 unsigned short exec_addr;
23} exec_record;
24
25typedef struct {
26 int board; /* Board to load */
27 unsigned short addr;
28 unsigned short count;
29} bin_header;
30
31typedef struct {
32 int board; /* Board to load */
33 unsigned short addr;
34 unsigned short count;
35 unsigned short segment;
36 unsigned char bin_data[DATA_SIZE];
37} bin_frame;
38
39#ifdef __KERNEL__ 7#ifdef __KERNEL__
40 8
41#define YES 1 9#define YES 1
42#define NO 0 10#define NO 0
43 11
44#define ISILOAD_MISC_MINOR 155 /* /dev/isctl */ 12/*
45#define ISILOAD_NAME "ISILoad"
46
47/*
48 * ISICOM Driver definitions ... 13 * ISICOM Driver definitions ...
49 * 14 *
50 */ 15 */
@@ -55,8 +20,8 @@ typedef struct {
55 * PCI definitions 20 * PCI definitions
56 */ 21 */
57 22
58 #define DEVID_COUNT 9 23#define DEVID_COUNT 9
59 #define VENDOR_ID 0x10b5 24#define VENDOR_ID 0x10b5
60 25
61/* 26/*
62 * These are now officially allocated numbers 27 * These are now officially allocated numbers
@@ -66,9 +31,9 @@ typedef struct {
66#define ISICOM_CMAJOR 113 /* callout */ 31#define ISICOM_CMAJOR 113 /* callout */
67#define ISICOM_MAGIC (('M' << 8) | 'T') 32#define ISICOM_MAGIC (('M' << 8) | 'T')
68 33
69#define WAKEUP_CHARS 256 /* hard coded for now */ 34#define WAKEUP_CHARS 256 /* hard coded for now */
70#define TX_SIZE 254 35#define TX_SIZE 254
71 36
72#define BOARD_COUNT 4 37#define BOARD_COUNT 4
73#define PORT_COUNT (BOARD_COUNT*16) 38#define PORT_COUNT (BOARD_COUNT*16)
74 39
@@ -98,18 +63,15 @@ typedef struct {
98#define ISICOM_INITIATE_XONXOFF 0x04 63#define ISICOM_INITIATE_XONXOFF 0x04
99#define ISICOM_RESPOND_XONXOFF 0x08 64#define ISICOM_RESPOND_XONXOFF 0x08
100 65
101#define InterruptTheCard(base) (outw(0,(base)+0xc))
102#define ClearInterrupt(base) (inw((base)+0x0a))
103
104#define BOARD(line) (((line) >> 4) & 0x3) 66#define BOARD(line) (((line) >> 4) & 0x3)
105 67
106 /* isi kill queue bitmap */ 68 /* isi kill queue bitmap */
107 69
108#define ISICOM_KILLTX 0x01 70#define ISICOM_KILLTX 0x01
109#define ISICOM_KILLRX 0x02 71#define ISICOM_KILLRX 0x02
110 72
111 /* isi_board status bitmap */ 73 /* isi_board status bitmap */
112 74
113#define FIRMWARE_LOADED 0x0001 75#define FIRMWARE_LOADED 0x0001
114#define BOARD_ACTIVE 0x0002 76#define BOARD_ACTIVE 0x0002
115 77
@@ -123,9 +85,8 @@ typedef struct {
123#define ISI_RTS 0x0200 85#define ISI_RTS 0x0200
124 86
125 87
126#define ISI_TXOK 0x0001 88#define ISI_TXOK 0x0001
127 89
128#endif /* __KERNEL__ */ 90#endif /* __KERNEL__ */
129 91
130#endif /* ISICOM_H */ 92#endif /* ISICOM_H */
131
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 6acfdbba734b..99905e180532 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -1,21 +1,12 @@
1#ifndef _LINUX_JIFFIES_H 1#ifndef _LINUX_JIFFIES_H
2#define _LINUX_JIFFIES_H 2#define _LINUX_JIFFIES_H
3 3
4#include <linux/calc64.h>
4#include <linux/kernel.h> 5#include <linux/kernel.h>
5#include <linux/types.h> 6#include <linux/types.h>
6#include <linux/time.h> 7#include <linux/time.h>
7#include <linux/timex.h> 8#include <linux/timex.h>
8#include <asm/param.h> /* for HZ */ 9#include <asm/param.h> /* for HZ */
9#include <asm/div64.h>
10
11#ifndef div_long_long_rem
12#define div_long_long_rem(dividend,divisor,remainder) \
13({ \
14 u64 result = dividend; \
15 *remainder = do_div(result,divisor); \
16 result; \
17})
18#endif
19 10
20/* 11/*
21 * The following defines establish the engineering parameters of the PLL 12 * The following defines establish the engineering parameters of the PLL
@@ -373,8 +364,11 @@ jiffies_to_timeval(const unsigned long jiffies, struct timeval *value)
373 * one divide. 364 * one divide.
374 */ 365 */
375 u64 nsec = (u64)jiffies * TICK_NSEC; 366 u64 nsec = (u64)jiffies * TICK_NSEC;
376 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); 367 long tv_usec;
377 value->tv_usec /= NSEC_PER_USEC; 368
369 value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &tv_usec);
370 tv_usec /= NSEC_PER_USEC;
371 value->tv_usec = tv_usec;
378} 372}
379 373
380/* 374/*
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index 7428198111eb..45f625d7d0b2 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -151,7 +151,7 @@ extern unsigned int keymap_count;
151 151
152static inline void con_schedule_flip(struct tty_struct *t) 152static inline void con_schedule_flip(struct tty_struct *t)
153{ 153{
154 schedule_work(&t->flip.work); 154 schedule_work(&t->buf.work);
155} 155}
156 156
157#endif 157#endif
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d0e6ca3b00ef..e6ee2d95da7a 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -47,6 +47,8 @@ extern int console_printk[];
47#define default_console_loglevel (console_printk[3]) 47#define default_console_loglevel (console_printk[3])
48 48
49struct completion; 49struct completion;
50struct pt_regs;
51struct user;
50 52
51/** 53/**
52 * might_sleep - annotation for functions that can sleep 54 * might_sleep - annotation for functions that can sleep
@@ -123,6 +125,8 @@ extern int __kernel_text_address(unsigned long addr);
123extern int kernel_text_address(unsigned long addr); 125extern int kernel_text_address(unsigned long addr);
124extern int session_of_pgrp(int pgrp); 126extern int session_of_pgrp(int pgrp);
125 127
128extern void dump_thread(struct pt_regs *regs, struct user *dump);
129
126#ifdef CONFIG_PRINTK 130#ifdef CONFIG_PRINTK
127asmlinkage int vprintk(const char *fmt, va_list args) 131asmlinkage int vprintk(const char *fmt, va_list args)
128 __attribute__ ((format (printf, 1, 0))); 132 __attribute__ ((format (printf, 1, 0)));
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index c8468472aec0..94abc07cb164 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -41,7 +41,7 @@ typedef unsigned long kimage_entry_t;
41#define IND_DONE 0x4 41#define IND_DONE 0x4
42#define IND_SOURCE 0x8 42#define IND_SOURCE 0x8
43 43
44#define KEXEC_SEGMENT_MAX 8 44#define KEXEC_SEGMENT_MAX 16
45struct kexec_segment { 45struct kexec_segment {
46 void __user *buf; 46 void __user *buf;
47 size_t bufsz; 47 size_t bufsz;
@@ -125,6 +125,8 @@ extern struct kimage *kexec_image;
125/* Location of a reserved region to hold the crash kernel. 125/* Location of a reserved region to hold the crash kernel.
126 */ 126 */
127extern struct resource crashk_res; 127extern struct resource crashk_res;
128typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
129extern note_buf_t *crash_notes;
128 130
129#else /* !CONFIG_KEXEC */ 131#else /* !CONFIG_KEXEC */
130struct pt_regs; 132struct pt_regs;
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index c03f2dc933de..10005bc92a31 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -149,11 +149,10 @@ struct kretprobe_instance {
149}; 149};
150 150
151extern spinlock_t kretprobe_lock; 151extern spinlock_t kretprobe_lock;
152extern struct semaphore kprobe_mutex;
152extern int arch_prepare_kprobe(struct kprobe *p); 153extern int arch_prepare_kprobe(struct kprobe *p);
153extern void arch_copy_kprobe(struct kprobe *p);
154extern void arch_arm_kprobe(struct kprobe *p); 154extern void arch_arm_kprobe(struct kprobe *p);
155extern void arch_disarm_kprobe(struct kprobe *p); 155extern void arch_disarm_kprobe(struct kprobe *p);
156extern void arch_remove_kprobe(struct kprobe *p);
157extern int arch_init_kprobes(void); 156extern int arch_init_kprobes(void);
158extern void show_registers(struct pt_regs *regs); 157extern void show_registers(struct pt_regs *regs);
159extern kprobe_opcode_t *get_insn_slot(void); 158extern kprobe_opcode_t *get_insn_slot(void);
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
new file mode 100644
index 000000000000..222a047cc145
--- /dev/null
+++ b/include/linux/ktime.h
@@ -0,0 +1,284 @@
1/*
2 * include/linux/ktime.h
3 *
4 * ktime_t - nanosecond-resolution time format.
5 *
6 * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de>
7 * Copyright(C) 2005, Red Hat, Inc., Ingo Molnar
8 *
9 * data type definitions, declarations, prototypes and macros.
10 *
11 * Started by: Thomas Gleixner and Ingo Molnar
12 *
13 * For licencing details see kernel-base/COPYING
14 */
15#ifndef _LINUX_KTIME_H
16#define _LINUX_KTIME_H
17
18#include <linux/time.h>
19#include <linux/jiffies.h>
20
21/*
22 * ktime_t:
23 *
24 * On 64-bit CPUs a single 64-bit variable is used to store the hrtimers
25 * internal representation of time values in scalar nanoseconds. The
26 * design plays out best on 64-bit CPUs, where most conversions are
27 * NOPs and most arithmetic ktime_t operations are plain arithmetic
28 * operations.
29 *
30 * On 32-bit CPUs an optimized representation of the timespec structure
31 * is used to avoid expensive conversions from and to timespecs. The
32 * endian-aware order of the tv struct members is choosen to allow
33 * mathematical operations on the tv64 member of the union too, which
34 * for certain operations produces better code.
35 *
36 * For architectures with efficient support for 64/32-bit conversions the
37 * plain scalar nanosecond based representation can be selected by the
38 * config switch CONFIG_KTIME_SCALAR.
39 */
40typedef union {
41 s64 tv64;
42#if BITS_PER_LONG != 64 && !defined(CONFIG_KTIME_SCALAR)
43 struct {
44# ifdef __BIG_ENDIAN
45 s32 sec, nsec;
46# else
47 s32 nsec, sec;
48# endif
49 } tv;
50#endif
51} ktime_t;
52
53#define KTIME_MAX (~((u64)1 << 63))
54
55/*
56 * ktime_t definitions when using the 64-bit scalar representation:
57 */
58
59#if (BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)
60
61/* Define a ktime_t variable and initialize it to zero: */
62#define DEFINE_KTIME(kt) ktime_t kt = { .tv64 = 0 }
63
64/**
65 * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value
66 *
67 * @secs: seconds to set
68 * @nsecs: nanoseconds to set
69 *
70 * Return the ktime_t representation of the value
71 */
72static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
73{
74 return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs };
75}
76
77/* Subtract two ktime_t variables. rem = lhs -rhs: */
78#define ktime_sub(lhs, rhs) \
79 ({ (ktime_t){ .tv64 = (lhs).tv64 - (rhs).tv64 }; })
80
81/* Add two ktime_t variables. res = lhs + rhs: */
82#define ktime_add(lhs, rhs) \
83 ({ (ktime_t){ .tv64 = (lhs).tv64 + (rhs).tv64 }; })
84
85/*
86 * Add a ktime_t variable and a scalar nanosecond value.
87 * res = kt + nsval:
88 */
89#define ktime_add_ns(kt, nsval) \
90 ({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; })
91
92/* convert a timespec to ktime_t format: */
93#define timespec_to_ktime(ts) ktime_set((ts).tv_sec, (ts).tv_nsec)
94
95/* convert a timeval to ktime_t format: */
96#define timeval_to_ktime(tv) ktime_set((tv).tv_sec, (tv).tv_usec * 1000)
97
98/* Map the ktime_t to timespec conversion to ns_to_timespec function */
99#define ktime_to_timespec(kt) ns_to_timespec((kt).tv64)
100
101/* Map the ktime_t to timeval conversion to ns_to_timeval function */
102#define ktime_to_timeval(kt) ns_to_timeval((kt).tv64)
103
104/* Map the ktime_t to clock_t conversion to the inline in jiffies.h: */
105#define ktime_to_clock_t(kt) nsec_to_clock_t((kt).tv64)
106
107/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */
108#define ktime_to_ns(kt) ((kt).tv64)
109
110#else
111
112/*
113 * Helper macros/inlines to get the ktime_t math right in the timespec
114 * representation. The macros are sometimes ugly - their actual use is
115 * pretty okay-ish, given the circumstances. We do all this for
116 * performance reasons. The pure scalar nsec_t based code was nice and
117 * simple, but created too many 64-bit / 32-bit conversions and divisions.
118 *
119 * Be especially aware that negative values are represented in a way
120 * that the tv.sec field is negative and the tv.nsec field is greater
121 * or equal to zero but less than nanoseconds per second. This is the
122 * same representation which is used by timespecs.
123 *
124 * tv.sec < 0 and 0 >= tv.nsec < NSEC_PER_SEC
125 */
126
127/* Define a ktime_t variable and initialize it to zero: */
128#define DEFINE_KTIME(kt) ktime_t kt = { .tv64 = 0 }
129
130/* Set a ktime_t variable to a value in sec/nsec representation: */
131static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
132{
133 return (ktime_t) { .tv = { .sec = secs, .nsec = nsecs } };
134}
135
136/**
137 * ktime_sub - subtract two ktime_t variables
138 *
139 * @lhs: minuend
140 * @rhs: subtrahend
141 *
142 * Returns the remainder of the substraction
143 */
144static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
145{
146 ktime_t res;
147
148 res.tv64 = lhs.tv64 - rhs.tv64;
149 if (res.tv.nsec < 0)
150 res.tv.nsec += NSEC_PER_SEC;
151
152 return res;
153}
154
155/**
156 * ktime_add - add two ktime_t variables
157 *
158 * @add1: addend1
159 * @add2: addend2
160 *
161 * Returns the sum of addend1 and addend2
162 */
163static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
164{
165 ktime_t res;
166
167 res.tv64 = add1.tv64 + add2.tv64;
168 /*
169 * performance trick: the (u32) -NSEC gives 0x00000000Fxxxxxxx
170 * so we subtract NSEC_PER_SEC and add 1 to the upper 32 bit.
171 *
172 * it's equivalent to:
173 * tv.nsec -= NSEC_PER_SEC
174 * tv.sec ++;
175 */
176 if (res.tv.nsec >= NSEC_PER_SEC)
177 res.tv64 += (u32)-NSEC_PER_SEC;
178
179 return res;
180}
181
182/**
183 * ktime_add_ns - Add a scalar nanoseconds value to a ktime_t variable
184 *
185 * @kt: addend
186 * @nsec: the scalar nsec value to add
187 *
188 * Returns the sum of kt and nsec in ktime_t format
189 */
190extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
191
192/**
193 * timespec_to_ktime - convert a timespec to ktime_t format
194 *
195 * @ts: the timespec variable to convert
196 *
197 * Returns a ktime_t variable with the converted timespec value
198 */
199static inline ktime_t timespec_to_ktime(const struct timespec ts)
200{
201 return (ktime_t) { .tv = { .sec = (s32)ts.tv_sec,
202 .nsec = (s32)ts.tv_nsec } };
203}
204
205/**
206 * timeval_to_ktime - convert a timeval to ktime_t format
207 *
208 * @tv: the timeval variable to convert
209 *
210 * Returns a ktime_t variable with the converted timeval value
211 */
212static inline ktime_t timeval_to_ktime(const struct timeval tv)
213{
214 return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec,
215 .nsec = (s32)tv.tv_usec * 1000 } };
216}
217
218/**
219 * ktime_to_timespec - convert a ktime_t variable to timespec format
220 *
221 * @kt: the ktime_t variable to convert
222 *
223 * Returns the timespec representation of the ktime value
224 */
225static inline struct timespec ktime_to_timespec(const ktime_t kt)
226{
227 return (struct timespec) { .tv_sec = (time_t) kt.tv.sec,
228 .tv_nsec = (long) kt.tv.nsec };
229}
230
231/**
232 * ktime_to_timeval - convert a ktime_t variable to timeval format
233 *
234 * @kt: the ktime_t variable to convert
235 *
236 * Returns the timeval representation of the ktime value
237 */
238static inline struct timeval ktime_to_timeval(const ktime_t kt)
239{
240 return (struct timeval) {
241 .tv_sec = (time_t) kt.tv.sec,
242 .tv_usec = (suseconds_t) (kt.tv.nsec / NSEC_PER_USEC) };
243}
244
245/**
246 * ktime_to_clock_t - convert a ktime_t variable to clock_t format
247 * @kt: the ktime_t variable to convert
248 *
249 * Returns a clock_t variable with the converted value
250 */
251static inline clock_t ktime_to_clock_t(const ktime_t kt)
252{
253 return nsec_to_clock_t( (u64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec);
254}
255
256/**
257 * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds
258 * @kt: the ktime_t variable to convert
259 *
260 * Returns the scalar nanoseconds representation of kt
261 */
262static inline u64 ktime_to_ns(const ktime_t kt)
263{
264 return (u64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec;
265}
266
267#endif
268
269/*
270 * The resolution of the clocks. The resolution value is returned in
271 * the clock_getres() system call to give application programmers an
272 * idea of the (in)accuracy of timers. Timer values are rounded up to
273 * this resolution values.
274 */
275#define KTIME_REALTIME_RES (NSEC_PER_SEC/HZ)
276#define KTIME_MONOTONIC_RES (NSEC_PER_SEC/HZ)
277
278/* Get the monotonic time in timespec format: */
279extern void ktime_get_ts(struct timespec *ts);
280
281/* Get the real (wall-) time in timespec format: */
282#define ktime_get_real_ts(ts) getnstimeofday(ts)
283
284#endif
diff --git a/include/linux/list.h b/include/linux/list.h
index 8e3388284530..945daa1f13dd 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -436,6 +436,20 @@ static inline void list_splice_init(struct list_head *list,
436 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 436 pos = n, n = list_entry(n->member.next, typeof(*n), member))
437 437
438/** 438/**
439 * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against
440 * removal of list entry
441 * @pos: the type * to use as a loop counter.
442 * @n: another type * to use as temporary storage
443 * @head: the head for your list.
444 * @member: the name of the list_struct within the struct.
445 */
446#define list_for_each_entry_safe_reverse(pos, n, head, member) \
447 for (pos = list_entry((head)->prev, typeof(*pos), member), \
448 n = list_entry(pos->member.prev, typeof(*pos), member); \
449 &pos->member != (head); \
450 pos = n, n = list_entry(n->member.prev, typeof(*n), member))
451
452/**
439 * list_for_each_rcu - iterate over an rcu-protected list 453 * list_for_each_rcu - iterate over an rcu-protected list
440 * @pos: the &struct list_head to use as a loop counter. 454 * @pos: the &struct list_head to use as a loop counter.
441 * @head: the head for your list. 455 * @head: the head for your list.
diff --git a/include/linux/mount.h b/include/linux/mount.h
index b98a709f1794..b7472ae91fa4 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -20,10 +20,12 @@
20#define MNT_NOSUID 0x01 20#define MNT_NOSUID 0x01
21#define MNT_NODEV 0x02 21#define MNT_NODEV 0x02
22#define MNT_NOEXEC 0x04 22#define MNT_NOEXEC 0x04
23#define MNT_SHARED 0x10 /* if the vfsmount is a shared mount */ 23#define MNT_NOATIME 0x08
24#define MNT_UNBINDABLE 0x20 /* if the vfsmount is a unbindable mount */ 24#define MNT_NODIRATIME 0x10
25 25
26#define MNT_PNODE_MASK (MNT_SHARED | MNT_UNBINDABLE) 26#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */
27#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */
28#define MNT_PNODE_MASK 0x3000 /* propogation flag mask */
27 29
28struct vfsmount { 30struct vfsmount {
29 struct list_head mnt_hash; 31 struct list_head mnt_hash;
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 455660eafba9..b699e427c00c 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -74,7 +74,7 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
74extern void release_open_intent(struct nameidata *); 74extern void release_open_intent(struct nameidata *);
75 75
76extern struct dentry * lookup_one_len(const char *, struct dentry *, int); 76extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
77extern struct dentry * lookup_hash(struct nameidata *); 77extern __deprecated_for_modules struct dentry * lookup_hash(struct nameidata *);
78 78
79extern int follow_down(struct vfsmount **, struct dentry **); 79extern int follow_down(struct vfsmount **, struct dentry **);
80extern int follow_up(struct vfsmount **, struct dentry **); 80extern int follow_up(struct vfsmount **, struct dentry **);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c3caa93efb10..f55c98a68aa9 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -377,6 +377,7 @@
377#define PCI_DEVICE_ID_NS_87560_USB 0x0012 377#define PCI_DEVICE_ID_NS_87560_USB 0x0012
378#define PCI_DEVICE_ID_NS_83815 0x0020 378#define PCI_DEVICE_ID_NS_83815 0x0020
379#define PCI_DEVICE_ID_NS_83820 0x0022 379#define PCI_DEVICE_ID_NS_83820 0x0022
380#define PCI_DEVICE_ID_NS_CS5535_ISA 0x002b
380#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d 381#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
381#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e 382#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e
382#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f 383#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f
@@ -500,6 +501,14 @@
500#define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d 501#define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d
501#define PCI_DEVICE_ID_AMD_8151_0 0x7454 502#define PCI_DEVICE_ID_AMD_8151_0 0x7454
502#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 503#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450
504#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090
505#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091
506#define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093
507#define PCI_DEVICE_ID_AMD_CS5536_OHC 0x2094
508#define PCI_DEVICE_ID_AMD_CS5536_EHC 0x2095
509#define PCI_DEVICE_ID_AMD_CS5536_UDC 0x2096
510#define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097
511#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
503 512
504#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A 513#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
505 514
@@ -1041,6 +1050,11 @@
1041#define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6 1050#define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6
1042#define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea 1051#define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea
1043#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee 1052#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee
1053#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_ALT1 0x00f0
1054#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT1 0x00f1
1055#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT2 0x00f2
1056#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6200_ALT1 0x00f3
1057#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_GT 0x00f9
1044#define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100 1058#define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100
1045#define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101 1059#define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101
1046#define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103 1060#define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index f942e2bad8e3..54faf5236da0 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -42,7 +42,7 @@ struct k_itimer {
42 timer_t it_id; /* timer id */ 42 timer_t it_id; /* timer id */
43 int it_overrun; /* overrun on pending signal */ 43 int it_overrun; /* overrun on pending signal */
44 int it_overrun_last; /* overrun on last delivered signal */ 44 int it_overrun_last; /* overrun on last delivered signal */
45 int it_requeue_pending; /* waiting to requeue this timer */ 45 int it_requeue_pending; /* waiting to requeue this timer */
46#define REQUEUE_PENDING 1 46#define REQUEUE_PENDING 1
47 int it_sigev_notify; /* notify word of sigevent struct */ 47 int it_sigev_notify; /* notify word of sigevent struct */
48 int it_sigev_signo; /* signo word of sigevent struct */ 48 int it_sigev_signo; /* signo word of sigevent struct */
@@ -51,10 +51,8 @@ struct k_itimer {
51 struct sigqueue *sigq; /* signal queue entry. */ 51 struct sigqueue *sigq; /* signal queue entry. */
52 union { 52 union {
53 struct { 53 struct {
54 struct timer_list timer; 54 struct hrtimer timer;
55 struct list_head abs_timer_entry; /* clock abs_timer_list */ 55 ktime_t interval;
56 struct timespec wall_to_prev; /* wall_to_monotonic used when set */
57 unsigned long incr; /* interval in jiffies */
58 } real; 56 } real;
59 struct cpu_timer_list cpu; 57 struct cpu_timer_list cpu;
60 struct { 58 struct {
@@ -66,18 +64,14 @@ struct k_itimer {
66 } it; 64 } it;
67}; 65};
68 66
69struct k_clock_abs {
70 struct list_head list;
71 spinlock_t lock;
72};
73struct k_clock { 67struct k_clock {
74 int res; /* in nano seconds */ 68 int res; /* in nanoseconds */
75 int (*clock_getres) (clockid_t which_clock, struct timespec *tp); 69 int (*clock_getres) (const clockid_t which_clock, struct timespec *tp);
76 struct k_clock_abs *abs_struct; 70 int (*clock_set) (const clockid_t which_clock, struct timespec * tp);
77 int (*clock_set) (clockid_t which_clock, struct timespec * tp); 71 int (*clock_get) (const clockid_t which_clock, struct timespec * tp);
78 int (*clock_get) (clockid_t which_clock, struct timespec * tp);
79 int (*timer_create) (struct k_itimer *timer); 72 int (*timer_create) (struct k_itimer *timer);
80 int (*nsleep) (clockid_t which_clock, int flags, struct timespec *); 73 int (*nsleep) (const clockid_t which_clock, int flags,
74 struct timespec *, struct timespec __user *);
81 int (*timer_set) (struct k_itimer * timr, int flags, 75 int (*timer_set) (struct k_itimer * timr, int flags,
82 struct itimerspec * new_setting, 76 struct itimerspec * new_setting,
83 struct itimerspec * old_setting); 77 struct itimerspec * old_setting);
@@ -87,53 +81,35 @@ struct k_clock {
87 struct itimerspec * cur_setting); 81 struct itimerspec * cur_setting);
88}; 82};
89 83
90void register_posix_clock(clockid_t clock_id, struct k_clock *new_clock); 84void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock);
91 85
92/* Error handlers for timer_create, nanosleep and settime */ 86/* error handlers for timer_create, nanosleep and settime */
93int do_posix_clock_notimer_create(struct k_itimer *timer); 87int do_posix_clock_notimer_create(struct k_itimer *timer);
94int do_posix_clock_nonanosleep(clockid_t, int flags, struct timespec *); 88int do_posix_clock_nonanosleep(const clockid_t, int flags, struct timespec *,
95int do_posix_clock_nosettime(clockid_t, struct timespec *tp); 89 struct timespec __user *);
90int do_posix_clock_nosettime(const clockid_t, struct timespec *tp);
96 91
97/* function to call to trigger timer event */ 92/* function to call to trigger timer event */
98int posix_timer_event(struct k_itimer *timr, int si_private); 93int posix_timer_event(struct k_itimer *timr, int si_private);
99 94
100struct now_struct { 95int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts);
101 unsigned long jiffies; 96int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts);
102}; 97int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts);
103 98int posix_cpu_timer_create(struct k_itimer *timer);
104#define posix_get_now(now) (now)->jiffies = jiffies; 99int posix_cpu_nsleep(const clockid_t which_clock, int flags,
105#define posix_time_before(timer, now) \ 100 struct timespec *rqtp, struct timespec __user *rmtp);
106 time_before((timer)->expires, (now)->jiffies) 101int posix_cpu_timer_set(struct k_itimer *timer, int flags,
107 102 struct itimerspec *new, struct itimerspec *old);
108#define posix_bump_timer(timr, now) \ 103int posix_cpu_timer_del(struct k_itimer *timer);
109 do { \ 104void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp);
110 long delta, orun; \ 105
111 delta = now.jiffies - (timr)->it.real.timer.expires; \ 106void posix_cpu_timer_schedule(struct k_itimer *timer);
112 if (delta >= 0) { \ 107
113 orun = 1 + (delta / (timr)->it.real.incr); \ 108void run_posix_cpu_timers(struct task_struct *task);
114 (timr)->it.real.timer.expires += \ 109void posix_cpu_timers_exit(struct task_struct *task);
115 orun * (timr)->it.real.incr; \ 110void posix_cpu_timers_exit_group(struct task_struct *task);
116 (timr)->it_overrun += orun; \ 111
117 } \ 112void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx,
118 }while (0) 113 cputime_t *newval, cputime_t *oldval);
119
120int posix_cpu_clock_getres(clockid_t which_clock, struct timespec *);
121int posix_cpu_clock_get(clockid_t which_clock, struct timespec *);
122int posix_cpu_clock_set(clockid_t which_clock, const struct timespec *tp);
123int posix_cpu_timer_create(struct k_itimer *);
124int posix_cpu_nsleep(clockid_t, int, struct timespec *);
125int posix_cpu_timer_set(struct k_itimer *, int,
126 struct itimerspec *, struct itimerspec *);
127int posix_cpu_timer_del(struct k_itimer *);
128void posix_cpu_timer_get(struct k_itimer *, struct itimerspec *);
129
130void posix_cpu_timer_schedule(struct k_itimer *);
131
132void run_posix_cpu_timers(struct task_struct *);
133void posix_cpu_timers_exit(struct task_struct *);
134void posix_cpu_timers_exit_group(struct task_struct *);
135
136void set_process_cpu_timer(struct task_struct *, unsigned int,
137 cputime_t *, cputime_t *);
138 114
139#endif 115#endif
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
index 157d7e3236b5..f54772d0e7f8 100644
--- a/include/linux/rio_drv.h
+++ b/include/linux/rio_drv.h
@@ -337,8 +337,8 @@ static inline void rio_init_dbell_res(struct resource *res, u16 start, u16 end)
337 337
338/** 338/**
339 * RIO_DEVICE - macro used to describe a specific RIO device 339 * RIO_DEVICE - macro used to describe a specific RIO device
340 * @vid: the 16 bit RIO vendor ID 340 * @dev: the 16 bit RIO device ID
341 * @did: the 16 bit RIO device ID 341 * @ven: the 16 bit RIO vendor ID
342 * 342 *
343 * This macro is used to create a struct rio_device_id that matches a 343 * This macro is used to create a struct rio_device_id that matches a
344 * specific device. The assembly vendor and assembly device fields 344 * specific device. The assembly vendor and assembly device fields
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 85b53f87c703..c4ee35dd18ae 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -105,6 +105,7 @@ extern unsigned long nr_iowait(void);
105#include <linux/param.h> 105#include <linux/param.h>
106#include <linux/resource.h> 106#include <linux/resource.h>
107#include <linux/timer.h> 107#include <linux/timer.h>
108#include <linux/hrtimer.h>
108 109
109#include <asm/processor.h> 110#include <asm/processor.h>
110 111
@@ -398,8 +399,8 @@ struct signal_struct {
398 struct list_head posix_timers; 399 struct list_head posix_timers;
399 400
400 /* ITIMER_REAL timer for the process */ 401 /* ITIMER_REAL timer for the process */
401 struct timer_list real_timer; 402 struct hrtimer real_timer;
402 unsigned long it_real_value, it_real_incr; 403 ktime_t it_real_incr;
403 404
404 /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ 405 /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */
405 cputime_t it_prof_expires, it_virt_expires; 406 cputime_t it_prof_expires, it_virt_expires;
@@ -1389,12 +1390,8 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm)
1389extern long sched_setaffinity(pid_t pid, cpumask_t new_mask); 1390extern long sched_setaffinity(pid_t pid, cpumask_t new_mask);
1390extern long sched_getaffinity(pid_t pid, cpumask_t *mask); 1391extern long sched_getaffinity(pid_t pid, cpumask_t *mask);
1391 1392
1392#ifdef CONFIG_MAGIC_SYSRQ
1393
1394extern void normalize_rt_tasks(void); 1393extern void normalize_rt_tasks(void);
1395 1394
1396#endif
1397
1398#ifdef CONFIG_PM 1395#ifdef CONFIG_PM
1399/* 1396/*
1400 * Check if a process has been frozen 1397 * Check if a process has been frozen
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index 76850b75b3f6..6336987dae62 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -41,8 +41,7 @@ struct screen_info {
41 u16 vesapm_off; /* 0x30 */ 41 u16 vesapm_off; /* 0x30 */
42 u16 pages; /* 0x32 */ 42 u16 pages; /* 0x32 */
43 u16 vesa_attributes; /* 0x34 */ 43 u16 vesa_attributes; /* 0x34 */
44 u32 capabilities; /* 0x36 */ 44 /* 0x36 -- 0x3f reserved for future expansion */
45 /* 0x3a -- 0x3f reserved for future expansion */
46}; 45};
47 46
48extern struct screen_info screen_info; 47extern struct screen_info screen_info;
diff --git a/include/linux/time.h b/include/linux/time.h
index 797ccd813bb0..f2aca7ec6325 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -4,7 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7#include <linux/seqlock.h> 7# include <linux/seqlock.h>
8#endif 8#endif
9 9
10#ifndef _STRUCT_TIMESPEC 10#ifndef _STRUCT_TIMESPEC
@@ -13,7 +13,7 @@ struct timespec {
13 time_t tv_sec; /* seconds */ 13 time_t tv_sec; /* seconds */
14 long tv_nsec; /* nanoseconds */ 14 long tv_nsec; /* nanoseconds */
15}; 15};
16#endif /* _STRUCT_TIMESPEC */ 16#endif
17 17
18struct timeval { 18struct timeval {
19 time_t tv_sec; /* seconds */ 19 time_t tv_sec; /* seconds */
@@ -27,93 +27,103 @@ struct timezone {
27 27
28#ifdef __KERNEL__ 28#ifdef __KERNEL__
29 29
30/* Parameters used to convert the timespec values */ 30/* Parameters used to convert the timespec values: */
31#define MSEC_PER_SEC (1000L) 31#define MSEC_PER_SEC 1000L
32#define USEC_PER_SEC (1000000L) 32#define USEC_PER_SEC 1000000L
33#define NSEC_PER_SEC (1000000000L) 33#define NSEC_PER_SEC 1000000000L
34#define NSEC_PER_USEC (1000L) 34#define NSEC_PER_USEC 1000L
35 35
36static __inline__ int timespec_equal(struct timespec *a, struct timespec *b) 36static __inline__ int timespec_equal(struct timespec *a, struct timespec *b)
37{ 37{
38 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); 38 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
39} 39}
40 40
41/* Converts Gregorian date to seconds since 1970-01-01 00:00:00. 41extern unsigned long mktime(const unsigned int year, const unsigned int mon,
42 * Assumes input in normal date format, i.e. 1980-12-31 23:59:59 42 const unsigned int day, const unsigned int hour,
43 * => year=1980, mon=12, day=31, hour=23, min=59, sec=59. 43 const unsigned int min, const unsigned int sec);
44 * 44
45 * [For the Julian calendar (which was used in Russia before 1917, 45extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec);
46 * Britain & colonies before 1752, anywhere else before 1582, 46
47 * and is still in use by some communities) leave out the 47/*
48 * -year/100+year/400 terms, and add 10.] 48 * Returns true if the timespec is norm, false if denorm:
49 *
50 * This algorithm was first published by Gauss (I think).
51 *
52 * WARNING: this function will overflow on 2106-02-07 06:28:16 on
53 * machines were long is 32-bit! (However, as time_t is signed, we
54 * will already get problems at other places on 2038-01-19 03:14:08)
55 */ 49 */
56static inline unsigned long 50#define timespec_valid(ts) \
57mktime (unsigned int year, unsigned int mon, 51 (((ts)->tv_sec >= 0) && (((unsigned) (ts)->tv_nsec) < NSEC_PER_SEC))
58 unsigned int day, unsigned int hour, 52
59 unsigned int min, unsigned int sec) 53/*
60{ 54 * 64-bit nanosec type. Large enough to span 292+ years in nanosecond
61 if (0 >= (int) (mon -= 2)) { /* 1..12 -> 11,12,1..10 */ 55 * resolution. Ought to be enough for a while.
62 mon += 12; /* Puts Feb last since it has leap day */ 56 */
63 year -= 1; 57typedef s64 nsec_t;
64 }
65
66 return (((
67 (unsigned long) (year/4 - year/100 + year/400 + 367*mon/12 + day) +
68 year*365 - 719499
69 )*24 + hour /* now have hours */
70 )*60 + min /* now have minutes */
71 )*60 + sec; /* finally seconds */
72}
73 58
74extern struct timespec xtime; 59extern struct timespec xtime;
75extern struct timespec wall_to_monotonic; 60extern struct timespec wall_to_monotonic;
76extern seqlock_t xtime_lock; 61extern seqlock_t xtime_lock;
77 62
78static inline unsigned long get_seconds(void) 63static inline unsigned long get_seconds(void)
79{ 64{
80 return xtime.tv_sec; 65 return xtime.tv_sec;
81} 66}
82 67
83struct timespec current_kernel_time(void); 68struct timespec current_kernel_time(void);
84 69
85#define CURRENT_TIME (current_kernel_time()) 70#define CURRENT_TIME (current_kernel_time())
86#define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 }) 71#define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 })
87 72
88extern void do_gettimeofday(struct timeval *tv); 73extern void do_gettimeofday(struct timeval *tv);
89extern int do_settimeofday(struct timespec *tv); 74extern int do_settimeofday(struct timespec *tv);
90extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); 75extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz);
91extern void clock_was_set(void); // call when ever the clock is set 76#define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
92extern int do_posix_clock_monotonic_gettime(struct timespec *tp); 77extern long do_utimes(char __user *filename, struct timeval *times);
93extern long do_utimes(char __user * filename, struct timeval * times);
94struct itimerval; 78struct itimerval;
95extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); 79extern int do_setitimer(int which, struct itimerval *value,
80 struct itimerval *ovalue);
96extern int do_getitimer(int which, struct itimerval *value); 81extern int do_getitimer(int which, struct itimerval *value);
97extern void getnstimeofday (struct timespec *tv); 82extern void getnstimeofday(struct timespec *tv);
98extern void getnstimestamp(struct timespec *ts);
99 83
100extern struct timespec timespec_trunc(struct timespec t, unsigned gran); 84extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
101 85
102static inline void 86/**
103set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) 87 * timespec_to_ns - Convert timespec to nanoseconds
88 * @ts: pointer to the timespec variable to be converted
89 *
90 * Returns the scalar nanosecond representation of the timespec
91 * parameter.
92 */
93static inline nsec_t timespec_to_ns(const struct timespec *ts)
104{ 94{
105 while (nsec >= NSEC_PER_SEC) { 95 return ((nsec_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
106 nsec -= NSEC_PER_SEC;
107 ++sec;
108 }
109 while (nsec < 0) {
110 nsec += NSEC_PER_SEC;
111 --sec;
112 }
113 ts->tv_sec = sec;
114 ts->tv_nsec = nsec;
115} 96}
116 97
98/**
99 * timeval_to_ns - Convert timeval to nanoseconds
100 * @ts: pointer to the timeval variable to be converted
101 *
102 * Returns the scalar nanosecond representation of the timeval
103 * parameter.
104 */
105static inline nsec_t timeval_to_ns(const struct timeval *tv)
106{
107 return ((nsec_t) tv->tv_sec * NSEC_PER_SEC) +
108 tv->tv_usec * NSEC_PER_USEC;
109}
110
111/**
112 * ns_to_timespec - Convert nanoseconds to timespec
113 * @nsec: the nanoseconds value to be converted
114 *
115 * Returns the timespec representation of the nsec parameter.
116 */
117extern struct timespec ns_to_timespec(const nsec_t nsec);
118
119/**
120 * ns_to_timeval - Convert nanoseconds to timeval
121 * @nsec: the nanoseconds value to be converted
122 *
123 * Returns the timeval representation of the nsec parameter.
124 */
125extern struct timeval ns_to_timeval(const nsec_t nsec);
126
117#endif /* __KERNEL__ */ 127#endif /* __KERNEL__ */
118 128
119#define NFDBITS __NFDBITS 129#define NFDBITS __NFDBITS
@@ -126,49 +136,41 @@ set_normalized_timespec (struct timespec *ts, time_t sec, long nsec)
126 136
127/* 137/*
128 * Names of the interval timers, and structure 138 * Names of the interval timers, and structure
129 * defining a timer setting. 139 * defining a timer setting:
130 */ 140 */
131#define ITIMER_REAL 0 141#define ITIMER_REAL 0
132#define ITIMER_VIRTUAL 1 142#define ITIMER_VIRTUAL 1
133#define ITIMER_PROF 2 143#define ITIMER_PROF 2
134 144
135struct itimerspec { 145struct itimerspec {
136 struct timespec it_interval; /* timer period */ 146 struct timespec it_interval; /* timer period */
137 struct timespec it_value; /* timer expiration */ 147 struct timespec it_value; /* timer expiration */
138}; 148};
139 149
140struct itimerval { 150struct itimerval {
141 struct timeval it_interval; /* timer interval */ 151 struct timeval it_interval; /* timer interval */
142 struct timeval it_value; /* current value */ 152 struct timeval it_value; /* current value */
143}; 153};
144 154
145
146/* 155/*
147 * The IDs of the various system clocks (for POSIX.1b interval timers). 156 * The IDs of the various system clocks (for POSIX.1b interval timers):
148 */ 157 */
149#define CLOCK_REALTIME 0 158#define CLOCK_REALTIME 0
150#define CLOCK_MONOTONIC 1 159#define CLOCK_MONOTONIC 1
151#define CLOCK_PROCESS_CPUTIME_ID 2 160#define CLOCK_PROCESS_CPUTIME_ID 2
152#define CLOCK_THREAD_CPUTIME_ID 3 161#define CLOCK_THREAD_CPUTIME_ID 3
153#define CLOCK_REALTIME_HR 4
154#define CLOCK_MONOTONIC_HR 5
155 162
156/* 163/*
157 * The IDs of various hardware clocks 164 * The IDs of various hardware clocks:
158 */ 165 */
159 166#define CLOCK_SGI_CYCLE 10
160 167#define MAX_CLOCKS 16
161#define CLOCK_SGI_CYCLE 10 168#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
162#define MAX_CLOCKS 16 169#define CLOCKS_MONO CLOCK_MONOTONIC
163#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC | \
164 CLOCK_REALTIME_HR | CLOCK_MONOTONIC_HR)
165#define CLOCKS_MONO (CLOCK_MONOTONIC & CLOCK_MONOTONIC_HR)
166 170
167/* 171/*
168 * The various flags for setting POSIX.1b interval timers. 172 * The various flags for setting POSIX.1b interval timers:
169 */ 173 */
170 174#define TIMER_ABSTIME 0x01
171#define TIMER_ABSTIME 0x01
172
173 175
174#endif 176#endif
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 72f3a7781106..9b9877fd2505 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -96,6 +96,6 @@ static inline void add_timer(struct timer_list *timer)
96 96
97extern void init_timers(void); 97extern void init_timers(void);
98extern void run_local_timers(void); 98extern void run_local_timers(void);
99extern void it_real_fn(unsigned long); 99extern int it_real_fn(void *);
100 100
101#endif 101#endif
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 57449704a47b..3787102e4b12 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -51,16 +51,22 @@
51 */ 51 */
52#define TTY_FLIPBUF_SIZE 512 52#define TTY_FLIPBUF_SIZE 512
53 53
54struct tty_flip_buffer { 54struct tty_buffer {
55 struct tty_buffer *next;
56 char *char_buf_ptr;
57 unsigned char *flag_buf_ptr;
58 int used;
59 int size;
60 /* Data points here */
61 unsigned long data[0];
62};
63
64struct tty_bufhead {
55 struct work_struct work; 65 struct work_struct work;
56 struct semaphore pty_sem; 66 struct semaphore pty_sem;
57 char *char_buf_ptr; 67 struct tty_buffer *head; /* Queue head */
58 unsigned char *flag_buf_ptr; 68 struct tty_buffer *tail; /* Active buffer */
59 int count; 69 struct tty_buffer *free; /* Free queue head */
60 int buf_num;
61 unsigned char char_buf[2*TTY_FLIPBUF_SIZE];
62 char flag_buf[2*TTY_FLIPBUF_SIZE];
63 unsigned char slop[4]; /* N.B. bug overwrites buffer by 1 */
64}; 70};
65/* 71/*
66 * The pty uses char_buf and flag_buf as a contiguous buffer 72 * The pty uses char_buf and flag_buf as a contiguous buffer
@@ -186,10 +192,11 @@ struct tty_struct {
186 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; 192 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1;
187 unsigned char low_latency:1, warned:1; 193 unsigned char low_latency:1, warned:1;
188 unsigned char ctrl_status; 194 unsigned char ctrl_status;
195 unsigned int receive_room; /* Bytes free for queue */
189 196
190 struct tty_struct *link; 197 struct tty_struct *link;
191 struct fasync_struct *fasync; 198 struct fasync_struct *fasync;
192 struct tty_flip_buffer flip; 199 struct tty_bufhead buf;
193 int max_flip_cnt; 200 int max_flip_cnt;
194 int alt_speed; /* For magic substitution of 38400 bps */ 201 int alt_speed; /* For magic substitution of 38400 bps */
195 wait_queue_head_t write_wait; 202 wait_queue_head_t write_wait;
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index abe9bfcf226c..be1400e82482 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -1,25 +1,33 @@
1#ifndef _LINUX_TTY_FLIP_H 1#ifndef _LINUX_TTY_FLIP_H
2#define _LINUX_TTY_FLIP_H 2#define _LINUX_TTY_FLIP_H
3 3
4extern int tty_buffer_request_room(struct tty_struct *tty, size_t size);
5extern int tty_insert_flip_string(struct tty_struct *tty, unsigned char *chars, size_t size);
6extern int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *chars, char *flags, size_t size);
7extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size);
8extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size);
9
4#ifdef INCLUDE_INLINE_FUNCS 10#ifdef INCLUDE_INLINE_FUNCS
5#define _INLINE_ extern 11#define _INLINE_ extern
6#else 12#else
7#define _INLINE_ static __inline__ 13#define _INLINE_ static __inline__
8#endif 14#endif
9 15
10_INLINE_ void tty_insert_flip_char(struct tty_struct *tty, 16_INLINE_ int tty_insert_flip_char(struct tty_struct *tty,
11 unsigned char ch, char flag) 17 unsigned char ch, char flag)
12{ 18{
13 if (tty->flip.count < TTY_FLIPBUF_SIZE) { 19 struct tty_buffer *tb = tty->buf.tail;
14 tty->flip.count++; 20 if (tb && tb->used < tb->size) {
15 *tty->flip.flag_buf_ptr++ = flag; 21 tb->flag_buf_ptr[tb->used] = flag;
16 *tty->flip.char_buf_ptr++ = ch; 22 tb->char_buf_ptr[tb->used++] = ch;
23 return 1;
17 } 24 }
25 return tty_insert_flip_string_flags(tty, &ch, &flag, 1);
18} 26}
19 27
20_INLINE_ void tty_schedule_flip(struct tty_struct *tty) 28_INLINE_ void tty_schedule_flip(struct tty_struct *tty)
21{ 29{
22 schedule_delayed_work(&tty->flip.work, 1); 30 schedule_delayed_work(&tty->buf.work, 1);
23} 31}
24 32
25#undef _INLINE_ 33#undef _INLINE_
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 6066afde5ce4..83c6e6c10ebb 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -81,14 +81,6 @@
81 * pointer of flag bytes which indicate whether a character was 81 * pointer of flag bytes which indicate whether a character was
82 * received with a parity error, etc. 82 * received with a parity error, etc.
83 * 83 *
84 * int (*receive_room)(struct tty_struct *);
85 *
86 * This function is called by the low-level tty driver to
87 * determine how many characters the line discpline can accept.
88 * The low-level driver must not send more characters than was
89 * indicated by receive_room, or the line discpline may drop
90 * those characters.
91 *
92 * void (*write_wakeup)(struct tty_struct *); 84 * void (*write_wakeup)(struct tty_struct *);
93 * 85 *
94 * This function is called by the low-level tty driver to signal 86 * This function is called by the low-level tty driver to signal
@@ -136,7 +128,6 @@ struct tty_ldisc {
136 */ 128 */
137 void (*receive_buf)(struct tty_struct *, const unsigned char *cp, 129 void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
138 char *fp, int count); 130 char *fp, int count);
139 int (*receive_room)(struct tty_struct *);
140 void (*write_wakeup)(struct tty_struct *); 131 void (*write_wakeup)(struct tty_struct *);
141 132
142 struct module *owner; 133 struct module *owner;
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index 23f9c61d9546..cda8a96e2fa0 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -13,7 +13,22 @@
13#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ 13#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
14#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ 14#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
15 15
16/* Namespaces */
17#define XATTR_OS2_PREFIX "os2."
18#define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1)
19
16#define XATTR_SECURITY_PREFIX "security." 20#define XATTR_SECURITY_PREFIX "security."
21#define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1)
22
23#define XATTR_SYSTEM_PREFIX "system."
24#define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1)
25
26#define XATTR_TRUSTED_PREFIX "trusted."
27#define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1)
28
29#define XATTR_USER_PREFIX "user."
30#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
31
17 32
18struct xattr_handler { 33struct xattr_handler {
19 char *prefix; 34 char *prefix;
@@ -25,6 +40,10 @@ struct xattr_handler {
25 size_t size, int flags); 40 size_t size, int flags);
26}; 41};
27 42
43ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t);
44int vfs_setxattr(struct dentry *, char *, void *, size_t, int);
45int vfs_removexattr(struct dentry *, char *);
46
28ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size); 47ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size);
29ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size); 48ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);
30int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags); 49int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags);
diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index 74f7b78c22d2..4fa32f0d4df8 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -442,9 +442,11 @@ extern int deflateInit2 (z_streamp strm,
442 not perform any compression: this will be done by deflate(). 442 not perform any compression: this will be done by deflate().
443*/ 443*/
444 444
445#if 0
445extern int zlib_deflateSetDictionary (z_streamp strm, 446extern int zlib_deflateSetDictionary (z_streamp strm,
446 const Byte *dictionary, 447 const Byte *dictionary,
447 uInt dictLength); 448 uInt dictLength);
449#endif
448/* 450/*
449 Initializes the compression dictionary from the given byte sequence 451 Initializes the compression dictionary from the given byte sequence
450 without producing any compressed output. This function must be called 452 without producing any compressed output. This function must be called
@@ -478,7 +480,10 @@ extern int zlib_deflateSetDictionary (z_streamp strm,
478 perform any compression: this will be done by deflate(). 480 perform any compression: this will be done by deflate().
479*/ 481*/
480 482
483#if 0
481extern int zlib_deflateCopy (z_streamp dest, z_streamp source); 484extern int zlib_deflateCopy (z_streamp dest, z_streamp source);
485#endif
486
482/* 487/*
483 Sets the destination stream as a complete copy of the source stream. 488 Sets the destination stream as a complete copy of the source stream.
484 489
@@ -511,7 +516,9 @@ static inline unsigned long deflateBound(unsigned long s)
511 return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11; 516 return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11;
512} 517}
513 518
519#if 0
514extern int zlib_deflateParams (z_streamp strm, int level, int strategy); 520extern int zlib_deflateParams (z_streamp strm, int level, int strategy);
521#endif
515/* 522/*
516 Dynamically update the compression level and compression strategy. The 523 Dynamically update the compression level and compression strategy. The
517 interpretation of level and strategy is as in deflateInit2. This can be 524 interpretation of level and strategy is as in deflateInit2. This can be
@@ -571,7 +578,9 @@ extern int zlib_inflateSetDictionary (z_streamp strm,
571 inflate(). 578 inflate().
572*/ 579*/
573 580
581#if 0
574extern int zlib_inflateSync (z_streamp strm); 582extern int zlib_inflateSync (z_streamp strm);
583#endif
575/* 584/*
576 Skips invalid compressed data until a full flush point (see above the 585 Skips invalid compressed data until a full flush point (see above the
577 description of deflate with Z_FULL_FLUSH) can be found, or until all 586 description of deflate with Z_FULL_FLUSH) can be found, or until all
@@ -636,7 +645,9 @@ extern int zlib_inflateInit2_ (z_streamp strm, int windowBits,
636#endif 645#endif
637 646
638extern const char * zlib_zError (int err); 647extern const char * zlib_zError (int err);
648#if 0
639extern int zlib_inflateSyncPoint (z_streamp z); 649extern int zlib_inflateSyncPoint (z_streamp z);
650#endif
640extern const uLong * zlib_get_crc_table (void); 651extern const uLong * zlib_get_crc_table (void);
641 652
642#endif /* _ZLIB_H */ 653#endif /* _ZLIB_H */
diff --git a/include/sound/core.h b/include/sound/core.h
index 90ac6132ea3b..3093e3ddcf36 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -317,7 +317,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
317#ifdef CONFIG_SND_VERBOSE_PRINTK 317#ifdef CONFIG_SND_VERBOSE_PRINTK
318/** 318/**
319 * snd_printd - debug printk 319 * snd_printd - debug printk
320 * @format: format string 320 * @fmt: format string
321 * 321 *
322 * Compiled only when Works like snd_printk() for debugging purpose. 322 * Compiled only when Works like snd_printk() for debugging purpose.
323 * Ignored when CONFIG_SND_DEBUG is not set. 323 * Ignored when CONFIG_SND_DEBUG is not set.
@@ -331,7 +331,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
331/** 331/**
332 * snd_assert - run-time assertion macro 332 * snd_assert - run-time assertion macro
333 * @expr: expression 333 * @expr: expression
334 * @args...: the action
335 * 334 *
336 * This macro checks the expression in run-time and invokes the commands 335 * This macro checks the expression in run-time and invokes the commands
337 * given in the rest arguments if the assertion is failed. 336 * given in the rest arguments if the assertion is failed.
diff --git a/include/video/kyro.h b/include/video/kyro.h
index 1bed37cfa68c..dba7de2ee4a8 100644
--- a/include/video/kyro.h
+++ b/include/video/kyro.h
@@ -15,6 +15,7 @@
15struct kyrofb_info { 15struct kyrofb_info {
16 void __iomem *regbase; 16 void __iomem *regbase;
17 17
18 u32 palette[16];
18 u32 HTot; /* Hor Total Time */ 19 u32 HTot; /* Hor Total Time */
19 u32 HFP; /* Hor Front Porch */ 20 u32 HFP; /* Hor Front Porch */
20 u32 HST; /* Hor Sync Time */ 21 u32 HST; /* Hor Sync Time */
diff --git a/include/video/neomagic.h b/include/video/neomagic.h
index bdaee70868dd..1d69049bd4c1 100644
--- a/include/video/neomagic.h
+++ b/include/video/neomagic.h
@@ -196,6 +196,7 @@ struct neofb_par {
196 int internal_display; 196 int internal_display;
197 int external_display; 197 int external_display;
198 int libretto; 198 int libretto;
199 u32 palette[16];
199}; 200};
200 201
201typedef struct { 202typedef struct {
diff --git a/include/video/newport.h b/include/video/newport.h
index 812dac5b55f4..1f5ebeaa818f 100644
--- a/include/video/newport.h
+++ b/include/video/newport.h
@@ -382,7 +382,8 @@ typedef struct {
382#define VC2_IREG_CONTROL 0x10 382#define VC2_IREG_CONTROL 0x10
383#define VC2_IREG_CONFIG 0x20 383#define VC2_IREG_CONFIG 0x20
384 384
385extern __inline__ void newport_vc2_set(struct newport_regs *regs, unsigned char vc2ireg, 385static inline void newport_vc2_set(struct newport_regs *regs,
386 unsigned char vc2ireg,
386 unsigned short val) 387 unsigned short val)
387{ 388{
388 regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W3 | 389 regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W3 |
@@ -390,7 +391,7 @@ extern __inline__ void newport_vc2_set(struct newport_regs *regs, unsigned char
390 regs->set.dcbdata0.byword = (vc2ireg << 24) | (val << 8); 391 regs->set.dcbdata0.byword = (vc2ireg << 24) | (val << 8);
391} 392}
392 393
393extern __inline__ unsigned short newport_vc2_get(struct newport_regs *regs, 394static inline unsigned short newport_vc2_get(struct newport_regs *regs,
394 unsigned char vc2ireg) 395 unsigned char vc2ireg)
395{ 396{
396 regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W1 | 397 regs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_INDEX | NPORT_DMODE_W1 |
diff --git a/include/video/sstfb.h b/include/video/sstfb.h
index 0d77b5205372..3570f9c9b111 100644
--- a/include/video/sstfb.h
+++ b/include/video/sstfb.h
@@ -334,6 +334,7 @@ struct sst_spec {
334}; 334};
335 335
336struct sstfb_par { 336struct sstfb_par {
337 u32 palette[16];
337 unsigned int yDim; 338 unsigned int yDim;
338 unsigned int hSyncOn; /* hsync_len */ 339 unsigned int hSyncOn; /* hsync_len */
339 unsigned int hSyncOff; /* left_margin + xres + right_margin */ 340 unsigned int hSyncOff; /* left_margin + xres + right_margin */
diff --git a/include/video/tdfx.h b/include/video/tdfx.h
index 04237676b17c..c1cc94ba3fdd 100644
--- a/include/video/tdfx.h
+++ b/include/video/tdfx.h
@@ -140,52 +140,52 @@
140#ifdef __KERNEL__ 140#ifdef __KERNEL__
141 141
142struct banshee_reg { 142struct banshee_reg {
143 /* VGA rubbish */ 143 /* VGA rubbish */
144 unsigned char att[21]; 144 unsigned char att[21];
145 unsigned char crt[25]; 145 unsigned char crt[25];
146 unsigned char gra[ 9]; 146 unsigned char gra[ 9];
147 unsigned char misc[1]; 147 unsigned char misc[1];
148 unsigned char seq[ 5]; 148 unsigned char seq[ 5];
149 149
150 /* Banshee extensions */ 150 /* Banshee extensions */
151 unsigned char ext[2]; 151 unsigned char ext[2];
152 unsigned long vidcfg; 152 unsigned long vidcfg;
153 unsigned long vidpll; 153 unsigned long vidpll;
154 unsigned long mempll; 154 unsigned long mempll;
155 unsigned long gfxpll; 155 unsigned long gfxpll;
156 unsigned long dacmode; 156 unsigned long dacmode;
157 unsigned long vgainit0; 157 unsigned long vgainit0;
158 unsigned long vgainit1; 158 unsigned long vgainit1;
159 unsigned long screensize; 159 unsigned long screensize;
160 unsigned long stride; 160 unsigned long stride;
161 unsigned long cursloc; 161 unsigned long cursloc;
162 unsigned long curspataddr; 162 unsigned long curspataddr;
163 unsigned long cursc0; 163 unsigned long cursc0;
164 unsigned long cursc1; 164 unsigned long cursc1;
165 unsigned long startaddr; 165 unsigned long startaddr;
166 unsigned long clip0min; 166 unsigned long clip0min;
167 unsigned long clip0max; 167 unsigned long clip0max;
168 unsigned long clip1min; 168 unsigned long clip1min;
169 unsigned long clip1max; 169 unsigned long clip1max;
170 unsigned long srcbase; 170 unsigned long srcbase;
171 unsigned long dstbase; 171 unsigned long dstbase;
172 unsigned long miscinit0; 172 unsigned long miscinit0;
173}; 173};
174 174
175struct tdfx_par { 175struct tdfx_par {
176 u32 max_pixclock; 176 u32 max_pixclock;
177 177 u32 palette[16];
178 void __iomem *regbase_virt; 178 void __iomem *regbase_virt;
179 unsigned long iobase; 179 unsigned long iobase;
180 u32 baseline; 180 u32 baseline;
181 181
182 struct { 182 struct {
183 int w,u,d; 183 int w,u,d;
184 unsigned long enable,disable; 184 unsigned long enable,disable;
185 struct timer_list timer; 185 struct timer_list timer;
186 } hwcursor; 186 } hwcursor;
187 187
188 spinlock_t DAClock; 188 spinlock_t DAClock;
189}; 189};
190 190
191#endif /* __KERNEL__ */ 191#endif /* __KERNEL__ */