aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-07-03 13:49:45 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-07-03 13:49:45 -0400
commit026477c1141b67e98e3bd8bdedb7d4b88a3ecd09 (patch)
tree2624a44924c625c367f3cebf937853b9da2de282 /include/linux
parent9f2fa466383ce100b90fe52cb4489d7a26bf72a9 (diff)
parent29454dde27d8e340bb1987bad9aa504af7081eba (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/atmdev.h4
-rw-r--r--include/linux/audit.h25
-rw-r--r--include/linux/compat_ioctl.h5
-rw-r--r--include/linux/cpu.h6
-rw-r--r--include/linux/cpufreq.h6
-rw-r--r--include/linux/devfs_fs.h41
-rw-r--r--include/linux/devfs_fs_kernel.h57
-rw-r--r--include/linux/dqblk_xfs.h4
-rw-r--r--include/linux/elf-em.h5
-rw-r--r--include/linux/err.h4
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/genhd.h2
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/interrupt.h63
-rw-r--r--include/linux/ioport.h27
-rw-r--r--include/linux/irq.h370
-rw-r--r--include/linux/isdn/tpam.h55
-rw-r--r--include/linux/key.h8
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mm.h6
-rw-r--r--include/linux/mmzone.h38
-rw-r--r--include/linux/net.h1
-rw-r--r--include/linux/netdevice.h27
-rw-r--r--include/linux/nfs_fs.h1
-rw-r--r--include/linux/page-flags.h149
-rw-r--r--include/linux/pagemap.h45
-rw-r--r--include/linux/pci.h13
-rw-r--r--include/linux/pci_ids.h3
-rw-r--r--include/linux/pnp.h7
-rw-r--r--include/linux/rcupdate.h24
-rw-r--r--include/linux/rtc.h4
-rw-r--r--include/linux/sched.h2
-rw-r--r--include/linux/security.h51
-rw-r--r--include/linux/serial_core.h1
-rw-r--r--include/linux/signal.h26
-rw-r--r--include/linux/skbuff.h13
-rw-r--r--include/linux/smp.h2
-rw-r--r--include/linux/sunrpc/svc.h4
-rw-r--r--include/linux/swap.h1
-rw-r--r--include/linux/tty_driver.h14
-rw-r--r--include/linux/types.h7
-rw-r--r--include/linux/udp.h2
-rw-r--r--include/linux/ufs_fs.h2
-rw-r--r--include/linux/vmstat.h215
45 files changed, 808 insertions, 539 deletions
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 1eb238affb12..41788a31c438 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -7,6 +7,7 @@
7#define LINUX_ATMDEV_H 7#define LINUX_ATMDEV_H
8 8
9 9
10#include <linux/device.h>
10#include <linux/atmapi.h> 11#include <linux/atmapi.h>
11#include <linux/atm.h> 12#include <linux/atm.h>
12#include <linux/atmioc.h> 13#include <linux/atmioc.h>
@@ -358,6 +359,7 @@ struct atm_dev {
358 struct proc_dir_entry *proc_entry; /* proc entry */ 359 struct proc_dir_entry *proc_entry; /* proc entry */
359 char *proc_name; /* proc entry name */ 360 char *proc_name; /* proc entry name */
360#endif 361#endif
362 struct class_device class_dev; /* sysfs class device */
361 struct list_head dev_list; /* linkage */ 363 struct list_head dev_list; /* linkage */
362}; 364};
363 365
@@ -459,7 +461,7 @@ static inline void atm_dev_put(struct atm_dev *dev)
459 BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags)); 461 BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags));
460 if (dev->ops->dev_close) 462 if (dev->ops->dev_close)
461 dev->ops->dev_close(dev); 463 dev->ops->dev_close(dev);
462 kfree(dev); 464 class_device_put(&dev->class_dev);
463 } 465 }
464} 466}
465 467
diff --git a/include/linux/audit.h b/include/linux/audit.h
index e051ff9c5b50..b27d7debc5a1 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -122,10 +122,17 @@
122/* Rule structure sizes -- if these change, different AUDIT_ADD and 122/* Rule structure sizes -- if these change, different AUDIT_ADD and
123 * AUDIT_LIST commands must be implemented. */ 123 * AUDIT_LIST commands must be implemented. */
124#define AUDIT_MAX_FIELDS 64 124#define AUDIT_MAX_FIELDS 64
125#define AUDIT_MAX_KEY_LEN 32
125#define AUDIT_BITMASK_SIZE 64 126#define AUDIT_BITMASK_SIZE 64
126#define AUDIT_WORD(nr) ((__u32)((nr)/32)) 127#define AUDIT_WORD(nr) ((__u32)((nr)/32))
127#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) 128#define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32))
128 129
130#define AUDIT_SYSCALL_CLASSES 16
131#define AUDIT_CLASS_DIR_WRITE 0
132#define AUDIT_CLASS_DIR_WRITE_32 1
133#define AUDIT_CLASS_CHATTR 2
134#define AUDIT_CLASS_CHATTR_32 3
135
129/* This bitmask is used to validate user input. It represents all bits that 136/* This bitmask is used to validate user input. It represents all bits that
130 * are currently used in an audit field constant understood by the kernel. 137 * are currently used in an audit field constant understood by the kernel.
131 * If you are adding a new #define AUDIT_<whatever>, please ensure that 138 * If you are adding a new #define AUDIT_<whatever>, please ensure that
@@ -150,12 +157,17 @@
150#define AUDIT_PERS 10 157#define AUDIT_PERS 10
151#define AUDIT_ARCH 11 158#define AUDIT_ARCH 11
152#define AUDIT_MSGTYPE 12 159#define AUDIT_MSGTYPE 12
153#define AUDIT_SE_USER 13 /* security label user */ 160#define AUDIT_SUBJ_USER 13 /* security label user */
154#define AUDIT_SE_ROLE 14 /* security label role */ 161#define AUDIT_SUBJ_ROLE 14 /* security label role */
155#define AUDIT_SE_TYPE 15 /* security label type */ 162#define AUDIT_SUBJ_TYPE 15 /* security label type */
156#define AUDIT_SE_SEN 16 /* security label sensitivity label */ 163#define AUDIT_SUBJ_SEN 16 /* security label sensitivity label */
157#define AUDIT_SE_CLR 17 /* security label clearance label */ 164#define AUDIT_SUBJ_CLR 17 /* security label clearance label */
158#define AUDIT_PPID 18 165#define AUDIT_PPID 18
166#define AUDIT_OBJ_USER 19
167#define AUDIT_OBJ_ROLE 20
168#define AUDIT_OBJ_TYPE 21
169#define AUDIT_OBJ_LEV_LOW 22
170#define AUDIT_OBJ_LEV_HIGH 23
159 171
160 /* These are ONLY useful when checking 172 /* These are ONLY useful when checking
161 * at syscall exit time (AUDIT_AT_EXIT). */ 173 * at syscall exit time (AUDIT_AT_EXIT). */
@@ -171,6 +183,8 @@
171#define AUDIT_ARG2 (AUDIT_ARG0+2) 183#define AUDIT_ARG2 (AUDIT_ARG0+2)
172#define AUDIT_ARG3 (AUDIT_ARG0+3) 184#define AUDIT_ARG3 (AUDIT_ARG0+3)
173 185
186#define AUDIT_FILTERKEY 210
187
174#define AUDIT_NEGATE 0x80000000 188#define AUDIT_NEGATE 0x80000000
175 189
176/* These are the supported operators. 190/* These are the supported operators.
@@ -299,6 +313,7 @@ struct mqstat;
299#define AUDITSC_SUCCESS 1 313#define AUDITSC_SUCCESS 1
300#define AUDITSC_FAILURE 2 314#define AUDITSC_FAILURE 2
301#define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS ) 315#define AUDITSC_RESULT(x) ( ((long)(x))<0?AUDITSC_FAILURE:AUDITSC_SUCCESS )
316extern int __init audit_register_class(int class, unsigned *list);
302#ifdef CONFIG_AUDITSYSCALL 317#ifdef CONFIG_AUDITSYSCALL
303/* These are defined in auditsc.c */ 318/* These are defined in auditsc.c */
304 /* Public API */ 319 /* Public API */
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index 917d62e41480..269d000bb2a3 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -567,11 +567,6 @@ COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER)
567COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST) 567COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST)
568COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST) 568COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST)
569COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT) 569COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)
570/* DEVFS */
571COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV)
572COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK)
573COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE)
574COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK)
575/* Raw devices */ 570/* Raw devices */
576COMPATIBLE_IOCTL(RAW_SETBIND) 571COMPATIBLE_IOCTL(RAW_SETBIND)
577COMPATIBLE_IOCTL(RAW_GETBIND) 572COMPATIBLE_IOCTL(RAW_GETBIND)
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index a3caf6866bae..44a11f1ccaf2 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -87,9 +87,9 @@ int cpu_down(unsigned int cpu);
87#define lock_cpu_hotplug() do { } while (0) 87#define lock_cpu_hotplug() do { } while (0)
88#define unlock_cpu_hotplug() do { } while (0) 88#define unlock_cpu_hotplug() do { } while (0)
89#define lock_cpu_hotplug_interruptible() 0 89#define lock_cpu_hotplug_interruptible() 0
90#define hotcpu_notifier(fn, pri) 90#define hotcpu_notifier(fn, pri) do { } while (0)
91#define register_hotcpu_notifier(nb) 91#define register_hotcpu_notifier(nb) do { } while (0)
92#define unregister_hotcpu_notifier(nb) 92#define unregister_hotcpu_notifier(nb) do { } while (0)
93 93
94/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ 94/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
95static inline int cpu_is_offline(int cpu) { return 0; } 95static inline int cpu_is_offline(int cpu) { return 0; }
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 466fbe9e4899..35e137636b0b 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -100,8 +100,10 @@ struct cpufreq_policy {
100#define CPUFREQ_INCOMPATIBLE (1) 100#define CPUFREQ_INCOMPATIBLE (1)
101#define CPUFREQ_NOTIFY (2) 101#define CPUFREQ_NOTIFY (2)
102 102
103#define CPUFREQ_SHARED_TYPE_ALL (0) /* All dependent CPUs should set freq */ 103#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
104#define CPUFREQ_SHARED_TYPE_ANY (1) /* Freq can be set from any dependent CPU */ 104#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */
105#define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */
106#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/
105 107
106/******************** cpufreq transition notifiers *******************/ 108/******************** cpufreq transition notifiers *******************/
107 109
diff --git a/include/linux/devfs_fs.h b/include/linux/devfs_fs.h
deleted file mode 100644
index de236f431877..000000000000
--- a/include/linux/devfs_fs.h
+++ /dev/null
@@ -1,41 +0,0 @@
1#ifndef _LINUX_DEVFS_FS_H
2#define _LINUX_DEVFS_FS_H
3
4#include <linux/ioctl.h>
5
6#define DEVFSD_PROTOCOL_REVISION_KERNEL 5
7
8#define DEVFSD_IOCTL_BASE 'd'
9
10/* These are the various ioctls */
11#define DEVFSDIOC_GET_PROTO_REV _IOR(DEVFSD_IOCTL_BASE, 0, int)
12#define DEVFSDIOC_SET_EVENT_MASK _IOW(DEVFSD_IOCTL_BASE, 2, int)
13#define DEVFSDIOC_RELEASE_EVENT_QUEUE _IOW(DEVFSD_IOCTL_BASE, 3, int)
14#define DEVFSDIOC_SET_DEBUG_MASK _IOW(DEVFSD_IOCTL_BASE, 4, int)
15
16#define DEVFSD_NOTIFY_REGISTERED 0
17#define DEVFSD_NOTIFY_UNREGISTERED 1
18#define DEVFSD_NOTIFY_ASYNC_OPEN 2
19#define DEVFSD_NOTIFY_CLOSE 3
20#define DEVFSD_NOTIFY_LOOKUP 4
21#define DEVFSD_NOTIFY_CHANGE 5
22#define DEVFSD_NOTIFY_CREATE 6
23#define DEVFSD_NOTIFY_DELETE 7
24
25#define DEVFS_PATHLEN 1024 /* Never change this otherwise the
26 binary interface will change */
27
28struct devfsd_notify_struct { /* Use native C types to ensure same types in kernel and user space */
29 unsigned int type; /* DEVFSD_NOTIFY_* value */
30 unsigned int mode; /* Mode of the inode or device entry */
31 unsigned int major; /* Major number of device entry */
32 unsigned int minor; /* Minor number of device entry */
33 unsigned int uid; /* Uid of process, inode or device entry */
34 unsigned int gid; /* Gid of process, inode or device entry */
35 unsigned int overrun_count; /* Number of lost events */
36 unsigned int namelen; /* Number of characters not including '\0' */
37 /* The device name MUST come last */
38 char devname[DEVFS_PATHLEN]; /* This will be '\0' terminated */
39};
40
41#endif /* _LINUX_DEVFS_FS_H */
diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
deleted file mode 100644
index 0d74a6f22abc..000000000000
--- a/include/linux/devfs_fs_kernel.h
+++ /dev/null
@@ -1,57 +0,0 @@
1#ifndef _LINUX_DEVFS_FS_KERNEL_H
2#define _LINUX_DEVFS_FS_KERNEL_H
3
4#include <linux/fs.h>
5#include <linux/spinlock.h>
6#include <linux/types.h>
7
8#include <asm/semaphore.h>
9
10#define DEVFS_SUPER_MAGIC 0x1373
11
12#ifdef CONFIG_DEVFS_FS
13extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
14 __attribute__ ((format(printf, 3, 4)));
15extern int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...)
16 __attribute__ ((format(printf, 3, 4)));
17extern int devfs_mk_symlink(const char *name, const char *link);
18extern int devfs_mk_dir(const char *fmt, ...)
19 __attribute__ ((format(printf, 1, 2)));
20extern void devfs_remove(const char *fmt, ...)
21 __attribute__ ((format(printf, 1, 2)));
22extern int devfs_register_tape(const char *name);
23extern void devfs_unregister_tape(int num);
24extern void mount_devfs_fs(void);
25#else /* CONFIG_DEVFS_FS */
26static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
27{
28 return 0;
29}
30static inline int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...)
31{
32 return 0;
33}
34static inline int devfs_mk_symlink(const char *name, const char *link)
35{
36 return 0;
37}
38static inline int devfs_mk_dir(const char *fmt, ...)
39{
40 return 0;
41}
42static inline void devfs_remove(const char *fmt, ...)
43{
44}
45static inline int devfs_register_tape(const char *name)
46{
47 return -1;
48}
49static inline void devfs_unregister_tape(int num)
50{
51}
52static inline void mount_devfs_fs(void)
53{
54 return;
55}
56#endif /* CONFIG_DEVFS_FS */
57#endif /* _LINUX_DEVFS_FS_KERNEL_H */
diff --git a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h
index 2fda1b2aabd9..527504c11c5e 100644
--- a/include/linux/dqblk_xfs.h
+++ b/include/linux/dqblk_xfs.h
@@ -125,14 +125,14 @@ typedef struct fs_disk_quota {
125 125
126/* 126/*
127 * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system. 127 * fs_quota_stat is the struct returned in Q_XGETQSTAT for a given file system.
128 * Provides a centralized way to get meta infomation about the quota subsystem. 128 * Provides a centralized way to get meta information about the quota subsystem.
129 * eg. space taken up for user and group quotas, number of dquots currently 129 * eg. space taken up for user and group quotas, number of dquots currently
130 * incore. 130 * incore.
131 */ 131 */
132#define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */ 132#define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */
133 133
134/* 134/*
135 * Some basic infomation about 'quota files'. 135 * Some basic information about 'quota files'.
136 */ 136 */
137typedef struct fs_qfilestat { 137typedef struct fs_qfilestat {
138 __u64 qfs_ino; /* inode number */ 138 __u64 qfs_ino; /* inode number */
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
index 114a96d25652..6a5796c81c90 100644
--- a/include/linux/elf-em.h
+++ b/include/linux/elf-em.h
@@ -11,7 +11,12 @@
11#define EM_486 6 /* Perhaps disused */ 11#define EM_486 6 /* Perhaps disused */
12#define EM_860 7 12#define EM_860 7
13#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */ 13#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
14 /* Next two are historical and binaries and
15 modules of these types will be rejected by
16 Linux. */
17#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */
14#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */ 18#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
19
15#define EM_PARISC 15 /* HPPA */ 20#define EM_PARISC 15 /* HPPA */
16#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ 21#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
17#define EM_PPC 20 /* PowerPC */ 22#define EM_PPC 20 /* PowerPC */
diff --git a/include/linux/err.h b/include/linux/err.h
index ff71d2af5da3..cd3b367f7445 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -13,7 +13,9 @@
13 * This should be a per-architecture thing, to allow different 13 * This should be a per-architecture thing, to allow different
14 * error and pointer decisions. 14 * error and pointer decisions.
15 */ 15 */
16#define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L) 16#define MAX_ERRNO 4095
17
18#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
17 19
18static inline void *ERR_PTR(long error) 20static inline void *ERR_PTR(long error)
19{ 21{
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 07a08e92bc73..ffefeeeeca93 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -380,7 +380,6 @@ struct fb_cursor {
380#include <linux/tty.h> 380#include <linux/tty.h>
381#include <linux/device.h> 381#include <linux/device.h>
382#include <linux/workqueue.h> 382#include <linux/workqueue.h>
383#include <linux/devfs_fs_kernel.h>
384#include <linux/notifier.h> 383#include <linux/notifier.h>
385#include <linux/list.h> 384#include <linux/list.h>
386#include <asm/io.h> 385#include <asm/io.h>
@@ -558,7 +557,7 @@ struct fb_pixmap {
558 * Frame buffer operations 557 * Frame buffer operations
559 * 558 *
560 * LOCKING NOTE: those functions must _ALL_ be called with the console 559 * LOCKING NOTE: those functions must _ALL_ be called with the console
561 * semaphore held, this is the only suitable locking mecanism we have 560 * semaphore held, this is the only suitable locking mechanism we have
562 * in 2.6. Some may be called at interrupt time at this point though. 561 * in 2.6. Some may be called at interrupt time at this point though.
563 */ 562 */
564 563
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 3498a0c68184..e4af57e87c17 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -112,8 +112,6 @@ struct gendisk {
112 sector_t capacity; 112 sector_t capacity;
113 113
114 int flags; 114 int flags;
115 char devfs_name[64]; /* devfs crap */
116 int number; /* more of the same */
117 struct device *driverfs_dev; 115 struct device *driverfs_dev;
118 struct kobject kobj; 116 struct kobject kobj;
119 struct kobject *holder_dir; 117 struct kobject *holder_dir;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 0c100168c0cf..285316c836b5 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -552,7 +552,6 @@ typedef struct ide_drive_s {
552 struct hd_driveid *id; /* drive model identification info */ 552 struct hd_driveid *id; /* drive model identification info */
553 struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ 553 struct proc_dir_entry *proc; /* /proc/ide/ directory entry */
554 struct ide_settings_s *settings;/* /proc/ide/ drive settings */ 554 struct ide_settings_s *settings;/* /proc/ide/ drive settings */
555 char devfs_name[64]; /* devfs crap */
556 555
557 struct hwif_s *hwif; /* actually (ide_hwif_t *) */ 556 struct hwif_s *hwif; /* actually (ide_hwif_t *) */
558 557
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 70741e170114..da3e0dbe61d4 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -14,6 +14,55 @@
14#include <asm/ptrace.h> 14#include <asm/ptrace.h>
15#include <asm/system.h> 15#include <asm/system.h>
16 16
17/*
18 * These correspond to the IORESOURCE_IRQ_* defines in
19 * linux/ioport.h to select the interrupt line behaviour. When
20 * requesting an interrupt without specifying a IRQF_TRIGGER, the
21 * setting should be assumed to be "as already configured", which
22 * may be as per machine or firmware initialisation.
23 */
24#define IRQF_TRIGGER_NONE 0x00000000
25#define IRQF_TRIGGER_RISING 0x00000001
26#define IRQF_TRIGGER_FALLING 0x00000002
27#define IRQF_TRIGGER_HIGH 0x00000004
28#define IRQF_TRIGGER_LOW 0x00000008
29#define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | \
30 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
31#define IRQF_TRIGGER_PROBE 0x00000010
32
33/*
34 * These flags used only by the kernel as part of the
35 * irq handling routines.
36 *
37 * IRQF_DISABLED - keep irqs disabled when calling the action handler
38 * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
39 * IRQF_SHARED - allow sharing the irq among several devices
40 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
41 * IRQF_TIMER - Flag to mark this interrupt as timer interrupt
42 */
43#define IRQF_DISABLED 0x00000020
44#define IRQF_SAMPLE_RANDOM 0x00000040
45#define IRQF_SHARED 0x00000080
46#define IRQF_PROBE_SHARED 0x00000100
47#define IRQF_TIMER 0x00000200
48#define IRQF_PERCPU 0x00000400
49
50/*
51 * Migration helpers. Scheduled for removal in 1/2007
52 * Do not use for new code !
53 */
54#define SA_INTERRUPT IRQF_DISABLED
55#define SA_SAMPLE_RANDOM IRQF_SAMPLE_RANDOM
56#define SA_SHIRQ IRQF_SHARED
57#define SA_PROBEIRQ IRQF_PROBE_SHARED
58#define SA_PERCPU IRQF_PERCPU
59
60#define SA_TRIGGER_LOW IRQF_TRIGGER_LOW
61#define SA_TRIGGER_HIGH IRQF_TRIGGER_HIGH
62#define SA_TRIGGER_FALLING IRQF_TRIGGER_FALLING
63#define SA_TRIGGER_RISING IRQF_TRIGGER_RISING
64#define SA_TRIGGER_MASK IRQF_TRIGGER_MASK
65
17struct irqaction { 66struct irqaction {
18 irqreturn_t (*handler)(int, void *, struct pt_regs *); 67 irqreturn_t (*handler)(int, void *, struct pt_regs *);
19 unsigned long flags; 68 unsigned long flags;
@@ -36,6 +85,20 @@ extern void free_irq(unsigned int, void *);
36extern void disable_irq_nosync(unsigned int irq); 85extern void disable_irq_nosync(unsigned int irq);
37extern void disable_irq(unsigned int irq); 86extern void disable_irq(unsigned int irq);
38extern void enable_irq(unsigned int irq); 87extern void enable_irq(unsigned int irq);
88
89/* IRQ wakeup (PM) control: */
90extern int set_irq_wake(unsigned int irq, unsigned int on);
91
92static inline int enable_irq_wake(unsigned int irq)
93{
94 return set_irq_wake(irq, 1);
95}
96
97static inline int disable_irq_wake(unsigned int irq)
98{
99 return set_irq_wake(irq, 0);
100}
101
39#endif 102#endif
40 103
41#ifndef __ARCH_SET_SOFTIRQ_PENDING 104#ifndef __ARCH_SET_SOFTIRQ_PENDING
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index edfc733b1575..87a9fc039b47 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -9,13 +9,15 @@
9#define _LINUX_IOPORT_H 9#define _LINUX_IOPORT_H
10 10
11#include <linux/compiler.h> 11#include <linux/compiler.h>
12#include <linux/types.h>
12/* 13/*
13 * Resources are tree-like, allowing 14 * Resources are tree-like, allowing
14 * nesting etc.. 15 * nesting etc..
15 */ 16 */
16struct resource { 17struct resource {
18 resource_size_t start;
19 resource_size_t end;
17 const char *name; 20 const char *name;
18 unsigned long start, end;
19 unsigned long flags; 21 unsigned long flags;
20 struct resource *parent, *sibling, *child; 22 struct resource *parent, *sibling, *child;
21}; 23};
@@ -96,14 +98,13 @@ extern struct resource * ____request_resource(struct resource *root, struct reso
96extern int release_resource(struct resource *new); 98extern int release_resource(struct resource *new);
97extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new); 99extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new);
98extern int allocate_resource(struct resource *root, struct resource *new, 100extern int allocate_resource(struct resource *root, struct resource *new,
99 unsigned long size, 101 resource_size_t size, resource_size_t min,
100 unsigned long min, unsigned long max, 102 resource_size_t max, resource_size_t align,
101 unsigned long align,
102 void (*alignf)(void *, struct resource *, 103 void (*alignf)(void *, struct resource *,
103 unsigned long, unsigned long), 104 resource_size_t, resource_size_t),
104 void *alignf_data); 105 void *alignf_data);
105int adjust_resource(struct resource *res, unsigned long start, 106int adjust_resource(struct resource *res, resource_size_t start,
106 unsigned long size); 107 resource_size_t size);
107 108
108/* get registered SYSTEM_RAM resources in specified area */ 109/* get registered SYSTEM_RAM resources in specified area */
109extern int find_next_system_ram(struct resource *res); 110extern int find_next_system_ram(struct resource *res);
@@ -113,17 +114,21 @@ extern int find_next_system_ram(struct resource *res);
113#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name)) 114#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name))
114#define rename_region(region, newname) do { (region)->name = (newname); } while (0) 115#define rename_region(region, newname) do { (region)->name = (newname); } while (0)
115 116
116extern struct resource * __request_region(struct resource *, unsigned long start, unsigned long n, const char *name); 117extern struct resource * __request_region(struct resource *,
118 resource_size_t start,
119 resource_size_t n, const char *name);
117 120
118/* Compatibility cruft */ 121/* Compatibility cruft */
119#define release_region(start,n) __release_region(&ioport_resource, (start), (n)) 122#define release_region(start,n) __release_region(&ioport_resource, (start), (n))
120#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n)) 123#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
121#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n)) 124#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
122 125
123extern int __check_region(struct resource *, unsigned long, unsigned long); 126extern int __check_region(struct resource *, resource_size_t, resource_size_t);
124extern void __release_region(struct resource *, unsigned long, unsigned long); 127extern void __release_region(struct resource *, resource_size_t,
128 resource_size_t);
125 129
126static inline int __deprecated check_region(unsigned long s, unsigned long n) 130static inline int __deprecated check_region(resource_size_t s,
131 resource_size_t n)
127{ 132{
128 return __check_region(&ioport_resource, s, n); 133 return __check_region(&ioport_resource, s, n);
129} 134}
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 676e00dfb21a..b48eae32dc61 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -1,5 +1,5 @@
1#ifndef __irq_h 1#ifndef _LINUX_IRQ_H
2#define __irq_h 2#define _LINUX_IRQ_H
3 3
4/* 4/*
5 * Please do not include this file in generic code. There is currently 5 * Please do not include this file in generic code. There is currently
@@ -11,7 +11,7 @@
11 11
12#include <linux/smp.h> 12#include <linux/smp.h>
13 13
14#if !defined(CONFIG_S390) 14#ifndef CONFIG_S390
15 15
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <linux/cache.h> 17#include <linux/cache.h>
@@ -24,84 +24,172 @@
24 24
25/* 25/*
26 * IRQ line status. 26 * IRQ line status.
27 *
28 * Bits 0-16 are reserved for the IRQF_* bits in linux/interrupt.h
29 *
30 * IRQ types
27 */ 31 */
28#define IRQ_INPROGRESS 1 /* IRQ handler active - do not enter! */ 32#define IRQ_TYPE_NONE 0x00000000 /* Default, unspecified type */
29#define IRQ_DISABLED 2 /* IRQ disabled - do not enter! */ 33#define IRQ_TYPE_EDGE_RISING 0x00000001 /* Edge rising type */
30#define IRQ_PENDING 4 /* IRQ pending - replay on enable */ 34#define IRQ_TYPE_EDGE_FALLING 0x00000002 /* Edge falling type */
31#define IRQ_REPLAY 8 /* IRQ has been replayed but not acked yet */ 35#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)
32#define IRQ_AUTODETECT 16 /* IRQ is being autodetected */ 36#define IRQ_TYPE_LEVEL_HIGH 0x00000004 /* Level high type */
33#define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ 37#define IRQ_TYPE_LEVEL_LOW 0x00000008 /* Level low type */
34#define IRQ_LEVEL 64 /* IRQ level triggered */ 38#define IRQ_TYPE_SENSE_MASK 0x0000000f /* Mask of the above */
35#define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ 39#define IRQ_TYPE_PROBE 0x00000010 /* Probing in progress */
36#if defined(ARCH_HAS_IRQ_PER_CPU) 40
37# define IRQ_PER_CPU 256 /* IRQ is per CPU */ 41/* Internal flags */
42#define IRQ_INPROGRESS 0x00010000 /* IRQ handler active - do not enter! */
43#define IRQ_DISABLED 0x00020000 /* IRQ disabled - do not enter! */
44#define IRQ_PENDING 0x00040000 /* IRQ pending - replay on enable */
45#define IRQ_REPLAY 0x00080000 /* IRQ has been replayed but not acked yet */
46#define IRQ_AUTODETECT 0x00100000 /* IRQ is being autodetected */
47#define IRQ_WAITING 0x00200000 /* IRQ not yet seen - for autodetection */
48#define IRQ_LEVEL 0x00400000 /* IRQ level triggered */
49#define IRQ_MASKED 0x00800000 /* IRQ masked - shouldn't be seen again */
50#ifdef CONFIG_IRQ_PER_CPU
51# define IRQ_PER_CPU 0x01000000 /* IRQ is per CPU */
38# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) 52# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
39#else 53#else
40# define CHECK_IRQ_PER_CPU(var) 0 54# define CHECK_IRQ_PER_CPU(var) 0
41#endif 55#endif
42 56
43/* 57#define IRQ_NOPROBE 0x02000000 /* IRQ is not valid for probing */
44 * Interrupt controller descriptor. This is all we need 58#define IRQ_NOREQUEST 0x04000000 /* IRQ cannot be requested */
45 * to describe about the low-level hardware. 59#define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */
60#define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */
61
62struct proc_dir_entry;
63
64/**
65 * struct irq_chip - hardware interrupt chip descriptor
66 *
67 * @name: name for /proc/interrupts
68 * @startup: start up the interrupt (defaults to ->enable if NULL)
69 * @shutdown: shut down the interrupt (defaults to ->disable if NULL)
70 * @enable: enable the interrupt (defaults to chip->unmask if NULL)
71 * @disable: disable the interrupt (defaults to chip->mask if NULL)
72 * @ack: start of a new interrupt
73 * @mask: mask an interrupt source
74 * @mask_ack: ack and mask an interrupt source
75 * @unmask: unmask an interrupt source
76 * @eoi: end of interrupt - chip level
77 * @end: end of interrupt - flow level
78 * @set_affinity: set the CPU affinity on SMP machines
79 * @retrigger: resend an IRQ to the CPU
80 * @set_type: set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ
81 * @set_wake: enable/disable power-management wake-on of an IRQ
82 *
83 * @release: release function solely used by UML
84 * @typename: obsoleted by name, kept as migration helper
46 */ 85 */
47struct hw_interrupt_type { 86struct irq_chip {
48 const char * typename; 87 const char *name;
49 unsigned int (*startup)(unsigned int irq); 88 unsigned int (*startup)(unsigned int irq);
50 void (*shutdown)(unsigned int irq); 89 void (*shutdown)(unsigned int irq);
51 void (*enable)(unsigned int irq); 90 void (*enable)(unsigned int irq);
52 void (*disable)(unsigned int irq); 91 void (*disable)(unsigned int irq);
53 void (*ack)(unsigned int irq); 92
54 void (*end)(unsigned int irq); 93 void (*ack)(unsigned int irq);
55 void (*set_affinity)(unsigned int irq, cpumask_t dest); 94 void (*mask)(unsigned int irq);
95 void (*mask_ack)(unsigned int irq);
96 void (*unmask)(unsigned int irq);
97 void (*eoi)(unsigned int irq);
98
99 void (*end)(unsigned int irq);
100 void (*set_affinity)(unsigned int irq, cpumask_t dest);
101 int (*retrigger)(unsigned int irq);
102 int (*set_type)(unsigned int irq, unsigned int flow_type);
103 int (*set_wake)(unsigned int irq, unsigned int on);
104
56 /* Currently used only by UML, might disappear one day.*/ 105 /* Currently used only by UML, might disappear one day.*/
57#ifdef CONFIG_IRQ_RELEASE_METHOD 106#ifdef CONFIG_IRQ_RELEASE_METHOD
58 void (*release)(unsigned int irq, void *dev_id); 107 void (*release)(unsigned int irq, void *dev_id);
59#endif 108#endif
109 /*
110 * For compatibility, ->typename is copied into ->name.
111 * Will disappear.
112 */
113 const char *typename;
60}; 114};
61 115
62typedef struct hw_interrupt_type hw_irq_controller; 116/**
63 117 * struct irq_desc - interrupt descriptor
64/* 118 *
65 * This is the "IRQ descriptor", which contains various information 119 * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()]
66 * about the irq, including what kind of hardware handling it has, 120 * @chip: low level interrupt hardware access
67 * whether it is disabled etc etc. 121 * @handler_data: per-IRQ data for the irq_chip methods
122 * @chip_data: platform-specific per-chip private data for the chip
123 * methods, to allow shared chip implementations
124 * @action: the irq action chain
125 * @status: status information
126 * @depth: disable-depth, for nested irq_disable() calls
127 * @irq_count: stats field to detect stalled irqs
128 * @irqs_unhandled: stats field for spurious unhandled interrupts
129 * @lock: locking for SMP
130 * @affinity: IRQ affinity on SMP
131 * @cpu: cpu index useful for balancing
132 * @pending_mask: pending rebalanced interrupts
133 * @move_irq: need to re-target IRQ destination
134 * @dir: /proc/irq/ procfs entry
135 * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP
68 * 136 *
69 * Pad this out to 32 bytes for cache and indexing reasons. 137 * Pad this out to 32 bytes for cache and indexing reasons.
70 */ 138 */
71typedef struct irq_desc { 139struct irq_desc {
72 hw_irq_controller *handler; 140 void fastcall (*handle_irq)(unsigned int irq,
73 void *handler_data; 141 struct irq_desc *desc,
74 struct irqaction *action; /* IRQ action list */ 142 struct pt_regs *regs);
75 unsigned int status; /* IRQ status */ 143 struct irq_chip *chip;
76 unsigned int depth; /* nested irq disables */ 144 void *handler_data;
77 unsigned int irq_count; /* For detecting broken interrupts */ 145 void *chip_data;
78 unsigned int irqs_unhandled; 146 struct irqaction *action; /* IRQ action list */
79 spinlock_t lock; 147 unsigned int status; /* IRQ status */
80#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) 148
81 unsigned int move_irq; /* Flag need to re-target intr dest*/ 149 unsigned int depth; /* nested irq disables */
150 unsigned int irq_count; /* For detecting broken IRQs */
151 unsigned int irqs_unhandled;
152 spinlock_t lock;
153#ifdef CONFIG_SMP
154 cpumask_t affinity;
155 unsigned int cpu;
156#endif
157#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
158 cpumask_t pending_mask;
159 unsigned int move_irq; /* need to re-target IRQ dest */
160#endif
161#ifdef CONFIG_PROC_FS
162 struct proc_dir_entry *dir;
82#endif 163#endif
83} ____cacheline_aligned irq_desc_t; 164} ____cacheline_aligned;
84 165
85extern irq_desc_t irq_desc [NR_IRQS]; 166extern struct irq_desc irq_desc[NR_IRQS];
86 167
87/* Return a pointer to the irq descriptor for IRQ. */ 168/*
88static inline irq_desc_t * 169 * Migration helpers for obsolete names, they will go away:
89irq_descp (int irq) 170 */
90{ 171#define hw_interrupt_type irq_chip
91 return irq_desc + irq; 172typedef struct irq_chip hw_irq_controller;
92} 173#define no_irq_type no_irq_chip
174typedef struct irq_desc irq_desc_t;
93 175
94#include <asm/hw_irq.h> /* the arch dependent stuff */ 176/*
177 * Pick up the arch-dependent methods:
178 */
179#include <asm/hw_irq.h>
95 180
96extern int setup_irq(unsigned int irq, struct irqaction * new); 181extern int setup_irq(unsigned int irq, struct irqaction *new);
97 182
98#ifdef CONFIG_GENERIC_HARDIRQS 183#ifdef CONFIG_GENERIC_HARDIRQS
99extern cpumask_t irq_affinity[NR_IRQS]; 184
185#ifndef handle_dynamic_tick
186# define handle_dynamic_tick(a) do { } while (0)
187#endif
100 188
101#ifdef CONFIG_SMP 189#ifdef CONFIG_SMP
102static inline void set_native_irq_info(int irq, cpumask_t mask) 190static inline void set_native_irq_info(int irq, cpumask_t mask)
103{ 191{
104 irq_affinity[irq] = mask; 192 irq_desc[irq].affinity = mask;
105} 193}
106#else 194#else
107static inline void set_native_irq_info(int irq, cpumask_t mask) 195static inline void set_native_irq_info(int irq, cpumask_t mask)
@@ -111,8 +199,7 @@ static inline void set_native_irq_info(int irq, cpumask_t mask)
111 199
112#ifdef CONFIG_SMP 200#ifdef CONFIG_SMP
113 201
114#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) 202#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
115extern cpumask_t pending_irq_cpumask[NR_IRQS];
116 203
117void set_pending_irq(unsigned int irq, cpumask_t mask); 204void set_pending_irq(unsigned int irq, cpumask_t mask);
118void move_native_irq(int irq); 205void move_native_irq(int irq);
@@ -133,7 +220,7 @@ static inline void set_irq_info(int irq, cpumask_t mask)
133{ 220{
134} 221}
135 222
136#else // CONFIG_PCI_MSI 223#else /* CONFIG_PCI_MSI */
137 224
138static inline void move_irq(int irq) 225static inline void move_irq(int irq)
139{ 226{
@@ -144,26 +231,36 @@ static inline void set_irq_info(int irq, cpumask_t mask)
144{ 231{
145 set_native_irq_info(irq, mask); 232 set_native_irq_info(irq, mask);
146} 233}
147#endif // CONFIG_PCI_MSI
148 234
149#else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE 235#endif /* CONFIG_PCI_MSI */
236
237#else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */
238
239static inline void move_irq(int irq)
240{
241}
242
243static inline void move_native_irq(int irq)
244{
245}
246
247static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
248{
249}
150 250
151#define move_irq(x)
152#define move_native_irq(x)
153#define set_pending_irq(x,y)
154static inline void set_irq_info(int irq, cpumask_t mask) 251static inline void set_irq_info(int irq, cpumask_t mask)
155{ 252{
156 set_native_irq_info(irq, mask); 253 set_native_irq_info(irq, mask);
157} 254}
158 255
159#endif // CONFIG_GENERIC_PENDING_IRQ 256#endif /* CONFIG_GENERIC_PENDING_IRQ */
160 257
161#else // CONFIG_SMP 258#else /* CONFIG_SMP */
162 259
163#define move_irq(x) 260#define move_irq(x)
164#define move_native_irq(x) 261#define move_native_irq(x)
165 262
166#endif // CONFIG_SMP 263#endif /* CONFIG_SMP */
167 264
168#ifdef CONFIG_IRQBALANCE 265#ifdef CONFIG_IRQBALANCE
169extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask); 266extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask);
@@ -173,32 +270,139 @@ static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask)
173} 270}
174#endif 271#endif
175 272
273#ifdef CONFIG_AUTO_IRQ_AFFINITY
274extern int select_smp_affinity(unsigned int irq);
275#else
276static inline int select_smp_affinity(unsigned int irq)
277{
278 return 1;
279}
280#endif
281
176extern int no_irq_affinity; 282extern int no_irq_affinity;
177extern int noirqdebug_setup(char *str);
178 283
179extern fastcall irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs, 284/* Handle irq action chains: */
180 struct irqaction *action); 285extern int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
286 struct irqaction *action);
287
288/*
289 * Built-in IRQ handlers for various IRQ types,
290 * callable via desc->chip->handle_irq()
291 */
292extern void fastcall
293handle_level_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs);
294extern void fastcall
295handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc,
296 struct pt_regs *regs);
297extern void fastcall
298handle_edge_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs);
299extern void fastcall
300handle_simple_irq(unsigned int irq, struct irq_desc *desc,
301 struct pt_regs *regs);
302extern void fastcall
303handle_percpu_irq(unsigned int irq, struct irq_desc *desc,
304 struct pt_regs *regs);
305extern void fastcall
306handle_bad_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs);
307
308/*
309 * Get a descriptive string for the highlevel handler, for
310 * /proc/interrupts output:
311 */
312extern const char *
313handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *,
314 struct pt_regs *));
315
316/*
317 * Monolithic do_IRQ implementation.
318 * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly)
319 */
181extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); 320extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
182extern void note_interrupt(unsigned int irq, irq_desc_t *desc,
183 int action_ret, struct pt_regs *regs);
184extern int can_request_irq(unsigned int irq, unsigned long irqflags);
185 321
322/*
323 * Architectures call this to let the generic IRQ layer
324 * handle an interrupt. If the descriptor is attached to an
325 * irqchip-style controller then we call the ->handle_irq() handler,
326 * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
327 */
328static inline void generic_handle_irq(unsigned int irq, struct pt_regs *regs)
329{
330 struct irq_desc *desc = irq_desc + irq;
331
332 if (likely(desc->handle_irq))
333 desc->handle_irq(irq, desc, regs);
334 else
335 __do_IRQ(irq, regs);
336}
337
338/* Handling of unhandled and spurious interrupts: */
339extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
340 int action_ret, struct pt_regs *regs);
341
342/* Resending of interrupts :*/
343void check_irq_resend(struct irq_desc *desc, unsigned int irq);
344
345/* Initialize /proc/irq/ */
186extern void init_irq_proc(void); 346extern void init_irq_proc(void);
187 347
188#ifdef CONFIG_AUTO_IRQ_AFFINITY 348/* Enable/disable irq debugging output: */
189extern int select_smp_affinity(unsigned int irq); 349extern int noirqdebug_setup(char *str);
190#else 350
191static inline int 351/* Checks whether the interrupt can be requested by request_irq(): */
192select_smp_affinity(unsigned int irq) 352extern int can_request_irq(unsigned int irq, unsigned long irqflags);
353
354/* Dummy irq-chip implementations: */
355extern struct irq_chip no_irq_chip;
356extern struct irq_chip dummy_irq_chip;
357
358extern void
359set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
360 void fastcall (*handle)(unsigned int,
361 struct irq_desc *,
362 struct pt_regs *));
363extern void
364__set_irq_handler(unsigned int irq,
365 void fastcall (*handle)(unsigned int, struct irq_desc *,
366 struct pt_regs *),
367 int is_chained);
368
369/*
370 * Set a highlevel flow handler for a given IRQ:
371 */
372static inline void
373set_irq_handler(unsigned int irq,
374 void fastcall (*handle)(unsigned int, struct irq_desc *,
375 struct pt_regs *))
193{ 376{
194 return 1; 377 __set_irq_handler(irq, handle, 0);
195} 378}
196#endif
197 379
198#endif 380/*
381 * Set a highlevel chained flow handler for a given IRQ.
382 * (a chained handler is automatically enabled and set to
383 * IRQ_NOREQUEST and IRQ_NOPROBE)
384 */
385static inline void
386set_irq_chained_handler(unsigned int irq,
387 void fastcall (*handle)(unsigned int, struct irq_desc *,
388 struct pt_regs *))
389{
390 __set_irq_handler(irq, handle, 1);
391}
199 392
200extern hw_irq_controller no_irq_type; /* needed in every arch ? */ 393/* Set/get chip/data for an IRQ: */
201 394
202#endif 395extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
396extern int set_irq_data(unsigned int irq, void *data);
397extern int set_irq_chip_data(unsigned int irq, void *data);
398extern int set_irq_type(unsigned int irq, unsigned int type);
399
400#define get_irq_chip(irq) (irq_desc[irq].chip)
401#define get_irq_chip_data(irq) (irq_desc[irq].chip_data)
402#define get_irq_data(irq) (irq_desc[irq].handler_data)
403
404#endif /* CONFIG_GENERIC_HARDIRQS */
405
406#endif /* !CONFIG_S390 */
203 407
204#endif /* __irq_h */ 408#endif /* _LINUX_IRQ_H */
diff --git a/include/linux/isdn/tpam.h b/include/linux/isdn/tpam.h
deleted file mode 100644
index d18dd0dc570d..000000000000
--- a/include/linux/isdn/tpam.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/* $Id: tpam.h,v 1.1.2.1 2001/06/08 08:23:46 kai Exp $
2 *
3 * Turbo PAM ISDN driver for Linux. (Kernel Driver)
4 *
5 * Copyright 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcôve
6 *
7 * For all support questions please contact: <support@auvertech.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 */
24
25#ifndef _TPAM_H_
26#define _TPAM_H_
27
28#include <linux/types.h>
29
30/* IOCTL commands */
31#define TPAM_CMD_DSPLOAD 0x0001
32#define TPAM_CMD_DSPSAVE 0x0002
33#define TPAM_CMD_DSPRUN 0x0003
34#define TPAM_CMD_LOOPMODEON 0x0004
35#define TPAM_CMD_LOOPMODEOFF 0x0005
36
37/* addresses of debug information zones on board */
38#define TPAM_TRAPAUDIT_REGISTER 0x005493e4
39#define TPAM_NCOAUDIT_REGISTER 0x00500000
40#define TPAM_MSGAUDIT_REGISTER 0x008E30F0
41
42/* length of debug information zones on board */
43#define TPAM_TRAPAUDIT_LENGTH 10000
44#define TPAM_NCOAUDIT_LENGTH 300000
45#define TPAM_NCOAUDIT_COUNT 30
46#define TPAM_MSGAUDIT_LENGTH 60000
47
48/* IOCTL load/save parameter */
49typedef struct tpam_dsp_ioctl {
50 __u32 address; /* address to load/save data */
51 __u32 data_len; /* size of data to be loaded/saved */
52 __u8 data[0]; /* data */
53} tpam_dsp_ioctl;
54
55#endif /* _TPAM_H_ */
diff --git a/include/linux/key.h b/include/linux/key.h
index e693e729bc92..169f05e4863e 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -177,7 +177,8 @@ struct key {
177/* 177/*
178 * kernel managed key type definition 178 * kernel managed key type definition
179 */ 179 */
180typedef int (*request_key_actor_t)(struct key *key, struct key *authkey, const char *op); 180typedef int (*request_key_actor_t)(struct key *key, struct key *authkey,
181 const char *op, void *aux);
181 182
182struct key_type { 183struct key_type {
183 /* name of the type */ 184 /* name of the type */
@@ -285,6 +286,11 @@ extern struct key *request_key(struct key_type *type,
285 const char *description, 286 const char *description,
286 const char *callout_info); 287 const char *callout_info);
287 288
289extern struct key *request_key_with_auxdata(struct key_type *type,
290 const char *description,
291 const char *callout_info,
292 void *aux);
293
288extern int key_validate(struct key *key); 294extern int key_validate(struct key *key);
289 295
290extern key_ref_t key_create_or_update(key_ref_t keyring, 296extern key_ref_t key_create_or_update(key_ref_t keyring,
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 2d229327959e..0503b2ed8bae 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -46,6 +46,8 @@ enum kobject_action {
46 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ 46 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */
47 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ 47 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */
48 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ 48 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */
49 KOBJ_UNDOCK = (__force kobject_action_t) 0x08, /* undocking */
50 KOBJ_DOCK = (__force kobject_action_t) 0x09, /* dock */
49}; 51};
50 52
51struct kobject { 53struct kobject {
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 5b584dafb5a6..b03cfb91e228 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -40,7 +40,6 @@ struct miscdevice {
40 struct list_head list; 40 struct list_head list;
41 struct device *dev; 41 struct device *dev;
42 struct class_device *class; 42 struct class_device *class;
43 char devfs_name[64];
44}; 43};
45 44
46extern int misc_register(struct miscdevice * misc); 45extern int misc_register(struct miscdevice * misc);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c41a1299b8cf..75179529e399 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -36,7 +36,6 @@ extern int sysctl_legacy_va_layout;
36#include <asm/page.h> 36#include <asm/page.h>
37#include <asm/pgtable.h> 37#include <asm/pgtable.h>
38#include <asm/processor.h> 38#include <asm/processor.h>
39#include <asm/atomic.h>
40 39
41#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) 40#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
42 41
@@ -515,6 +514,11 @@ static inline void set_page_links(struct page *page, unsigned long zone,
515 set_page_section(page, pfn_to_section_nr(pfn)); 514 set_page_section(page, pfn_to_section_nr(pfn));
516} 515}
517 516
517/*
518 * Some inline functions in vmstat.h depend on page_zone()
519 */
520#include <linux/vmstat.h>
521
518#ifndef CONFIG_DISCONTIGMEM 522#ifndef CONFIG_DISCONTIGMEM
519/* The array of struct pages - for discontigmem use pgdat->lmem_map */ 523/* The array of struct pages - for discontigmem use pgdat->lmem_map */
520extern struct page *mem_map; 524extern struct page *mem_map;
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index d6120fa69116..27e748eb72b0 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -46,6 +46,27 @@ struct zone_padding {
46#define ZONE_PADDING(name) 46#define ZONE_PADDING(name)
47#endif 47#endif
48 48
49enum zone_stat_item {
50 NR_ANON_PAGES, /* Mapped anonymous pages */
51 NR_FILE_MAPPED, /* pagecache pages mapped into pagetables.
52 only modified from process context */
53 NR_FILE_PAGES,
54 NR_SLAB, /* Pages used by slab allocator */
55 NR_PAGETABLE, /* used for pagetables */
56 NR_FILE_DIRTY,
57 NR_WRITEBACK,
58 NR_UNSTABLE_NFS, /* NFS unstable pages */
59 NR_BOUNCE,
60#ifdef CONFIG_NUMA
61 NUMA_HIT, /* allocated in intended node */
62 NUMA_MISS, /* allocated in non intended node */
63 NUMA_FOREIGN, /* was intended here, hit elsewhere */
64 NUMA_INTERLEAVE_HIT, /* interleaver preferred this zone */
65 NUMA_LOCAL, /* allocation from local node */
66 NUMA_OTHER, /* allocation from other node */
67#endif
68 NR_VM_ZONE_STAT_ITEMS };
69
49struct per_cpu_pages { 70struct per_cpu_pages {
50 int count; /* number of pages in the list */ 71 int count; /* number of pages in the list */
51 int high; /* high watermark, emptying needed */ 72 int high; /* high watermark, emptying needed */
@@ -55,13 +76,8 @@ struct per_cpu_pages {
55 76
56struct per_cpu_pageset { 77struct per_cpu_pageset {
57 struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ 78 struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */
58#ifdef CONFIG_NUMA 79#ifdef CONFIG_SMP
59 unsigned long numa_hit; /* allocated in intended node */ 80 s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS];
60 unsigned long numa_miss; /* allocated in non intended node */
61 unsigned long numa_foreign; /* was intended here, hit elsewhere */
62 unsigned long interleave_hit; /* interleaver prefered this zone */
63 unsigned long local_node; /* allocation from local node */
64 unsigned long other_node; /* allocation from other node */
65#endif 81#endif
66} ____cacheline_aligned_in_smp; 82} ____cacheline_aligned_in_smp;
67 83
@@ -165,12 +181,8 @@ struct zone {
165 /* A count of how many reclaimers are scanning this zone */ 181 /* A count of how many reclaimers are scanning this zone */
166 atomic_t reclaim_in_progress; 182 atomic_t reclaim_in_progress;
167 183
168 /* 184 /* Zone statistics */
169 * timestamp (in jiffies) of the last zone reclaim that did not 185 atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
170 * result in freeing of pages. This is used to avoid repeated scans
171 * if all memory in the zone is in use.
172 */
173 unsigned long last_unsuccessful_zone_reclaim;
174 186
175 /* 187 /*
176 * prev_priority holds the scanning priority for this zone. It is 188 * prev_priority holds the scanning priority for this zone. It is
diff --git a/include/linux/net.h b/include/linux/net.h
index 385e68f5bd93..b20c53c74413 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -61,6 +61,7 @@ typedef enum {
61#define SOCK_ASYNC_WAITDATA 1 61#define SOCK_ASYNC_WAITDATA 1
62#define SOCK_NOSPACE 2 62#define SOCK_NOSPACE 2
63#define SOCK_PASSCRED 3 63#define SOCK_PASSCRED 3
64#define SOCK_PASSSEC 4
64 65
65#ifndef ARCH_HAS_SOCKET_TYPES 66#ifndef ARCH_HAS_SOCKET_TYPES
66/** 67/**
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 03cd7551a7a1..85f99f60deea 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -313,8 +313,12 @@ struct net_device
313 313
314 /* Segmentation offload features */ 314 /* Segmentation offload features */
315#define NETIF_F_GSO_SHIFT 16 315#define NETIF_F_GSO_SHIFT 16
316#define NETIF_F_GSO_MASK 0xffff0000
316#define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT) 317#define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
317#define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT) 318#define NETIF_F_UFO (SKB_GSO_UDP << NETIF_F_GSO_SHIFT)
319#define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT)
320#define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
321#define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
318 322
319#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) 323#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
320#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) 324#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
@@ -543,7 +547,8 @@ struct packet_type {
543 struct net_device *, 547 struct net_device *,
544 struct packet_type *, 548 struct packet_type *,
545 struct net_device *); 549 struct net_device *);
546 struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg); 550 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
551 int features);
547 void *af_packet_priv; 552 void *af_packet_priv;
548 struct list_head list; 553 struct list_head list;
549}; 554};
@@ -968,7 +973,7 @@ extern int netdev_max_backlog;
968extern int weight_p; 973extern int weight_p;
969extern int netdev_set_master(struct net_device *dev, struct net_device *master); 974extern int netdev_set_master(struct net_device *dev, struct net_device *master);
970extern int skb_checksum_help(struct sk_buff *skb, int inward); 975extern int skb_checksum_help(struct sk_buff *skb, int inward);
971extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg); 976extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features);
972#ifdef CONFIG_BUG 977#ifdef CONFIG_BUG
973extern void netdev_rx_csum_fault(struct net_device *dev); 978extern void netdev_rx_csum_fault(struct net_device *dev);
974#else 979#else
@@ -988,11 +993,21 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
988 993
989extern void linkwatch_run_queue(void); 994extern void linkwatch_run_queue(void);
990 995
996static inline int net_gso_ok(int features, int gso_type)
997{
998 int feature = gso_type << NETIF_F_GSO_SHIFT;
999 return (features & feature) == feature;
1000}
1001
1002static inline int skb_gso_ok(struct sk_buff *skb, int features)
1003{
1004 return net_gso_ok(features, skb_shinfo(skb)->gso_size ?
1005 skb_shinfo(skb)->gso_type : 0);
1006}
1007
991static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) 1008static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
992{ 1009{
993 int feature = skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT; 1010 return !skb_gso_ok(skb, dev->features);
994 return skb_shinfo(skb)->gso_size &&
995 (dev->features & feature) != feature;
996} 1011}
997 1012
998#endif /* __KERNEL__ */ 1013#endif /* __KERNEL__ */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index d90b1bb37563..55ea853d57bc 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -9,7 +9,6 @@
9#ifndef _LINUX_NFS_FS_H 9#ifndef _LINUX_NFS_FS_H
10#define _LINUX_NFS_FS_H 10#define _LINUX_NFS_FS_H
11 11
12#include <linux/config.h>
13#include <linux/in.h> 12#include <linux/in.h>
14#include <linux/mm.h> 13#include <linux/mm.h>
15#include <linux/pagemap.h> 14#include <linux/pagemap.h>
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 0c076d58c676..5748642e9f36 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -5,12 +5,8 @@
5#ifndef PAGE_FLAGS_H 5#ifndef PAGE_FLAGS_H
6#define PAGE_FLAGS_H 6#define PAGE_FLAGS_H
7 7
8#include <linux/percpu.h>
9#include <linux/cache.h>
10#include <linux/types.h> 8#include <linux/types.h>
11 9
12#include <asm/pgtable.h>
13
14/* 10/*
15 * Various page->flags bits: 11 * Various page->flags bits:
16 * 12 *
@@ -103,134 +99,6 @@
103#endif 99#endif
104 100
105/* 101/*
106 * Global page accounting. One instance per CPU. Only unsigned longs are
107 * allowed.
108 *
109 * - Fields can be modified with xxx_page_state and xxx_page_state_zone at
110 * any time safely (which protects the instance from modification by
111 * interrupt.
112 * - The __xxx_page_state variants can be used safely when interrupts are
113 * disabled.
114 * - The __xxx_page_state variants can be used if the field is only
115 * modified from process context and protected from preemption, or only
116 * modified from interrupt context. In this case, the field should be
117 * commented here.
118 */
119struct page_state {
120 unsigned long nr_dirty; /* Dirty writeable pages */
121 unsigned long nr_writeback; /* Pages under writeback */
122 unsigned long nr_unstable; /* NFS unstable pages */
123 unsigned long nr_page_table_pages;/* Pages used for pagetables */
124 unsigned long nr_mapped; /* mapped into pagetables.
125 * only modified from process context */
126 unsigned long nr_slab; /* In slab */
127#define GET_PAGE_STATE_LAST nr_slab
128
129 /*
130 * The below are zeroed by get_page_state(). Use get_full_page_state()
131 * to add up all these.
132 */
133 unsigned long pgpgin; /* Disk reads */
134 unsigned long pgpgout; /* Disk writes */
135 unsigned long pswpin; /* swap reads */
136 unsigned long pswpout; /* swap writes */
137
138 unsigned long pgalloc_high; /* page allocations */
139 unsigned long pgalloc_normal;
140 unsigned long pgalloc_dma32;
141 unsigned long pgalloc_dma;
142
143 unsigned long pgfree; /* page freeings */
144 unsigned long pgactivate; /* pages moved inactive->active */
145 unsigned long pgdeactivate; /* pages moved active->inactive */
146
147 unsigned long pgfault; /* faults (major+minor) */
148 unsigned long pgmajfault; /* faults (major only) */
149
150 unsigned long pgrefill_high; /* inspected in refill_inactive_zone */
151 unsigned long pgrefill_normal;
152 unsigned long pgrefill_dma32;
153 unsigned long pgrefill_dma;
154
155 unsigned long pgsteal_high; /* total highmem pages reclaimed */
156 unsigned long pgsteal_normal;
157 unsigned long pgsteal_dma32;
158 unsigned long pgsteal_dma;
159
160 unsigned long pgscan_kswapd_high;/* total highmem pages scanned */
161 unsigned long pgscan_kswapd_normal;
162 unsigned long pgscan_kswapd_dma32;
163 unsigned long pgscan_kswapd_dma;
164
165 unsigned long pgscan_direct_high;/* total highmem pages scanned */
166 unsigned long pgscan_direct_normal;
167 unsigned long pgscan_direct_dma32;
168 unsigned long pgscan_direct_dma;
169
170 unsigned long pginodesteal; /* pages reclaimed via inode freeing */
171 unsigned long slabs_scanned; /* slab objects scanned */
172 unsigned long kswapd_steal; /* pages reclaimed by kswapd */
173 unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */
174 unsigned long pageoutrun; /* kswapd's calls to page reclaim */
175 unsigned long allocstall; /* direct reclaim calls */
176
177 unsigned long pgrotated; /* pages rotated to tail of the LRU */
178 unsigned long nr_bounce; /* pages for bounce buffers */
179};
180
181extern void get_page_state(struct page_state *ret);
182extern void get_page_state_node(struct page_state *ret, int node);
183extern void get_full_page_state(struct page_state *ret);
184extern unsigned long read_page_state_offset(unsigned long offset);
185extern void mod_page_state_offset(unsigned long offset, unsigned long delta);
186extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
187
188#define read_page_state(member) \
189 read_page_state_offset(offsetof(struct page_state, member))
190
191#define mod_page_state(member, delta) \
192 mod_page_state_offset(offsetof(struct page_state, member), (delta))
193
194#define __mod_page_state(member, delta) \
195 __mod_page_state_offset(offsetof(struct page_state, member), (delta))
196
197#define inc_page_state(member) mod_page_state(member, 1UL)
198#define dec_page_state(member) mod_page_state(member, 0UL - 1)
199#define add_page_state(member,delta) mod_page_state(member, (delta))
200#define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta))
201
202#define __inc_page_state(member) __mod_page_state(member, 1UL)
203#define __dec_page_state(member) __mod_page_state(member, 0UL - 1)
204#define __add_page_state(member,delta) __mod_page_state(member, (delta))
205#define __sub_page_state(member,delta) __mod_page_state(member, 0UL - (delta))
206
207#define page_state(member) (*__page_state(offsetof(struct page_state, member)))
208
209#define state_zone_offset(zone, member) \
210({ \
211 unsigned offset; \
212 if (is_highmem(zone)) \
213 offset = offsetof(struct page_state, member##_high); \
214 else if (is_normal(zone)) \
215 offset = offsetof(struct page_state, member##_normal); \
216 else if (is_dma32(zone)) \
217 offset = offsetof(struct page_state, member##_dma32); \
218 else \
219 offset = offsetof(struct page_state, member##_dma); \
220 offset; \
221})
222
223#define __mod_page_state_zone(zone, member, delta) \
224 do { \
225 __mod_page_state_offset(state_zone_offset(zone, member), (delta)); \
226 } while (0)
227
228#define mod_page_state_zone(zone, member, delta) \
229 do { \
230 mod_page_state_offset(state_zone_offset(zone, member), (delta)); \
231 } while (0)
232
233/*
234 * Manipulation of page state flags 102 * Manipulation of page state flags
235 */ 103 */
236#define PageLocked(page) \ 104#define PageLocked(page) \
@@ -254,7 +122,14 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
254#define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) 122#define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags)
255 123
256#define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) 124#define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags)
257#ifndef SetPageUptodate 125#ifdef CONFIG_S390
126#define SetPageUptodate(_page) \
127 do { \
128 struct page *__page = (_page); \
129 if (!test_and_set_bit(PG_uptodate, &__page->flags)) \
130 page_test_and_clear_dirty(_page); \
131 } while (0)
132#else
258#define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) 133#define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags)
259#endif 134#endif
260#define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) 135#define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags)
@@ -306,7 +181,7 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
306 do { \ 181 do { \
307 if (!test_and_set_bit(PG_writeback, \ 182 if (!test_and_set_bit(PG_writeback, \
308 &(page)->flags)) \ 183 &(page)->flags)) \
309 inc_page_state(nr_writeback); \ 184 inc_zone_page_state(page, NR_WRITEBACK); \
310 } while (0) 185 } while (0)
311#define TestSetPageWriteback(page) \ 186#define TestSetPageWriteback(page) \
312 ({ \ 187 ({ \
@@ -314,14 +189,14 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
314 ret = test_and_set_bit(PG_writeback, \ 189 ret = test_and_set_bit(PG_writeback, \
315 &(page)->flags); \ 190 &(page)->flags); \
316 if (!ret) \ 191 if (!ret) \
317 inc_page_state(nr_writeback); \ 192 inc_zone_page_state(page, NR_WRITEBACK); \
318 ret; \ 193 ret; \
319 }) 194 })
320#define ClearPageWriteback(page) \ 195#define ClearPageWriteback(page) \
321 do { \ 196 do { \
322 if (test_and_clear_bit(PG_writeback, \ 197 if (test_and_clear_bit(PG_writeback, \
323 &(page)->flags)) \ 198 &(page)->flags)) \
324 dec_page_state(nr_writeback); \ 199 dec_zone_page_state(page, NR_WRITEBACK); \
325 } while (0) 200 } while (0)
326#define TestClearPageWriteback(page) \ 201#define TestClearPageWriteback(page) \
327 ({ \ 202 ({ \
@@ -329,7 +204,7 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
329 ret = test_and_clear_bit(PG_writeback, \ 204 ret = test_and_clear_bit(PG_writeback, \
330 &(page)->flags); \ 205 &(page)->flags); \
331 if (ret) \ 206 if (ret) \
332 dec_page_state(nr_writeback); \ 207 dec_zone_page_state(page, NR_WRITEBACK); \
333 ret; \ 208 ret; \
334 }) 209 })
335 210
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 1245df7141aa..0a2f5d27f60e 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -113,51 +113,6 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
113extern void remove_from_page_cache(struct page *page); 113extern void remove_from_page_cache(struct page *page);
114extern void __remove_from_page_cache(struct page *page); 114extern void __remove_from_page_cache(struct page *page);
115 115
116extern atomic_t nr_pagecache;
117
118#ifdef CONFIG_SMP
119
120#define PAGECACHE_ACCT_THRESHOLD max(16, NR_CPUS * 2)
121DECLARE_PER_CPU(long, nr_pagecache_local);
122
123/*
124 * pagecache_acct implements approximate accounting for pagecache.
125 * vm_enough_memory() do not need high accuracy. Writers will keep
126 * an offset in their per-cpu arena and will spill that into the
127 * global count whenever the absolute value of the local count
128 * exceeds the counter's threshold.
129 *
130 * MUST be protected from preemption.
131 * current protection is mapping->page_lock.
132 */
133static inline void pagecache_acct(int count)
134{
135 long *local;
136
137 local = &__get_cpu_var(nr_pagecache_local);
138 *local += count;
139 if (*local > PAGECACHE_ACCT_THRESHOLD || *local < -PAGECACHE_ACCT_THRESHOLD) {
140 atomic_add(*local, &nr_pagecache);
141 *local = 0;
142 }
143}
144
145#else
146
147static inline void pagecache_acct(int count)
148{
149 atomic_add(count, &nr_pagecache);
150}
151#endif
152
153static inline unsigned long get_page_cache_size(void)
154{
155 int ret = atomic_read(&nr_pagecache);
156 if (unlikely(ret < 0))
157 ret = 0;
158 return ret;
159}
160
161/* 116/*
162 * Return byte-offset into filesystem object for page. 117 * Return byte-offset into filesystem object for page.
163 */ 118 */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 62a8c22f5f60..983fca251b25 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -404,8 +404,8 @@ int pcibios_enable_device(struct pci_dev *, int mask);
404char *pcibios_setup (char *str); 404char *pcibios_setup (char *str);
405 405
406/* Used only when drivers/pci/setup.c is used */ 406/* Used only when drivers/pci/setup.c is used */
407void pcibios_align_resource(void *, struct resource *, 407void pcibios_align_resource(void *, struct resource *, resource_size_t,
408 unsigned long, unsigned long); 408 resource_size_t);
409void pcibios_update_irq(struct pci_dev *, int irq); 409void pcibios_update_irq(struct pci_dev *, int irq);
410 410
411/* Generic PCI functions used internally */ 411/* Generic PCI functions used internally */
@@ -532,10 +532,10 @@ void pci_release_region(struct pci_dev *, int);
532 532
533/* drivers/pci/bus.c */ 533/* drivers/pci/bus.c */
534int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, 534int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
535 unsigned long size, unsigned long align, 535 resource_size_t size, resource_size_t align,
536 unsigned long min, unsigned int type_mask, 536 resource_size_t min, unsigned int type_mask,
537 void (*alignf)(void *, struct resource *, 537 void (*alignf)(void *, struct resource *,
538 unsigned long, unsigned long), 538 resource_size_t, resource_size_t),
539 void *alignf_data); 539 void *alignf_data);
540void pci_enable_bridges(struct pci_bus *bus); 540void pci_enable_bridges(struct pci_bus *bus);
541 541
@@ -730,7 +730,8 @@ static inline char *pci_name(struct pci_dev *pdev)
730 */ 730 */
731#ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER 731#ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER
732static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, 732static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
733 const struct resource *rsrc, u64 *start, u64 *end) 733 const struct resource *rsrc, resource_size_t *start,
734 resource_size_t *end)
734{ 735{
735 *start = rsrc->start; 736 *start = rsrc->start;
736 *end = rsrc->end; 737 *end = rsrc->end;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 9ae6b1a75366..685081c01342 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -728,7 +728,9 @@
728#define PCI_DEVICE_ID_TI_TVP4020 0x3d07 728#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
729#define PCI_DEVICE_ID_TI_4450 0x8011 729#define PCI_DEVICE_ID_TI_4450 0x8011
730#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 730#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031
731#define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034
731#define PCI_DEVICE_ID_TI_X515 0x8036 732#define PCI_DEVICE_ID_TI_X515 0x8036
733#define PCI_DEVICE_ID_TI_XX12 0x8039
732#define PCI_DEVICE_ID_TI_1130 0xac12 734#define PCI_DEVICE_ID_TI_1130 0xac12
733#define PCI_DEVICE_ID_TI_1031 0xac13 735#define PCI_DEVICE_ID_TI_1031 0xac13
734#define PCI_DEVICE_ID_TI_1131 0xac15 736#define PCI_DEVICE_ID_TI_1131 0xac15
@@ -1441,6 +1443,7 @@
1441#define PCI_DEVICE_ID_RICOH_RL5C475 0x0475 1443#define PCI_DEVICE_ID_RICOH_RL5C475 0x0475
1442#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 1444#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476
1443#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 1445#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478
1446#define PCI_DEVICE_ID_RICOH_R5C822 0x0822
1444 1447
1445#define PCI_VENDOR_ID_DLINK 0x1186 1448#define PCI_VENDOR_ID_DLINK 0x1186
1446#define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00 1449#define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 93b0959eb40f..ab8a8dd8d64c 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -389,7 +389,8 @@ int pnp_start_dev(struct pnp_dev *dev);
389int pnp_stop_dev(struct pnp_dev *dev); 389int pnp_stop_dev(struct pnp_dev *dev);
390int pnp_activate_dev(struct pnp_dev *dev); 390int pnp_activate_dev(struct pnp_dev *dev);
391int pnp_disable_dev(struct pnp_dev *dev); 391int pnp_disable_dev(struct pnp_dev *dev);
392void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size); 392void pnp_resource_change(struct resource *resource, resource_size_t start,
393 resource_size_t size);
393 394
394/* protocol helpers */ 395/* protocol helpers */
395int pnp_is_active(struct pnp_dev * dev); 396int pnp_is_active(struct pnp_dev * dev);
@@ -434,7 +435,9 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
434static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } 435static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
435static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } 436static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
436static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } 437static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
437static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { } 438static inline void pnp_resource_change(struct resource *resource,
439 resource_size_t start,
440 resource_size_t size) { }
438 441
439/* protocol helpers */ 442/* protocol helpers */
440static inline int pnp_is_active(struct pnp_dev * dev) { return 0; } 443static inline int pnp_is_active(struct pnp_dev * dev) { return 0; }
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 48dfe00070c7..b4ca73d65891 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -163,14 +163,22 @@ extern int rcu_needs_cpu(int cpu);
163 * 163 *
164 * It is illegal to block while in an RCU read-side critical section. 164 * It is illegal to block while in an RCU read-side critical section.
165 */ 165 */
166#define rcu_read_lock() preempt_disable() 166#define rcu_read_lock() \
167 do { \
168 preempt_disable(); \
169 __acquire(RCU); \
170 } while(0)
167 171
168/** 172/**
169 * rcu_read_unlock - marks the end of an RCU read-side critical section. 173 * rcu_read_unlock - marks the end of an RCU read-side critical section.
170 * 174 *
171 * See rcu_read_lock() for more information. 175 * See rcu_read_lock() for more information.
172 */ 176 */
173#define rcu_read_unlock() preempt_enable() 177#define rcu_read_unlock() \
178 do { \
179 __release(RCU); \
180 preempt_enable(); \
181 } while(0)
174 182
175/* 183/*
176 * So where is rcu_write_lock()? It does not exist, as there is no 184 * So where is rcu_write_lock()? It does not exist, as there is no
@@ -193,14 +201,22 @@ extern int rcu_needs_cpu(int cpu);
193 * can use just rcu_read_lock(). 201 * can use just rcu_read_lock().
194 * 202 *
195 */ 203 */
196#define rcu_read_lock_bh() local_bh_disable() 204#define rcu_read_lock_bh() \
205 do { \
206 local_bh_disable(); \
207 __acquire(RCU_BH); \
208 } while(0)
197 209
198/* 210/*
199 * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section 211 * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section
200 * 212 *
201 * See rcu_read_lock_bh() for more information. 213 * See rcu_read_lock_bh() for more information.
202 */ 214 */
203#define rcu_read_unlock_bh() local_bh_enable() 215#define rcu_read_unlock_bh() \
216 do { \
217 __release(RCU_BH); \
218 local_bh_enable(); \
219 } while(0)
204 220
205/** 221/**
206 * rcu_dereference - fetch an RCU-protected pointer in an 222 * rcu_dereference - fetch an RCU-protected pointer in an
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 36e2bf4b4315..5371e4e74595 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -34,8 +34,8 @@ struct rtc_time {
34 * alarm API. 34 * alarm API.
35 */ 35 */
36struct rtc_wkalrm { 36struct rtc_wkalrm {
37 unsigned char enabled; /* 0 = alarm disable, 1 = alarm disabled */ 37 unsigned char enabled; /* 0 = alarm disabled, 1 = alarm enabled */
38 unsigned char pending; /* 0 = alarm pending, 1 = alarm not pending */ 38 unsigned char pending; /* 0 = alarm not pending, 1 = alarm pending */
39 struct rtc_time time; /* time the alarm is set to */ 39 struct rtc_time time; /* time the alarm is set to */
40}; 40};
41 41
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 821f0481ebe1..aaf723308ed4 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1153,7 +1153,7 @@ extern int force_sig_info(int, struct siginfo *, struct task_struct *);
1153extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); 1153extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp);
1154extern int kill_pg_info(int, struct siginfo *, pid_t); 1154extern int kill_pg_info(int, struct siginfo *, pid_t);
1155extern int kill_proc_info(int, struct siginfo *, pid_t); 1155extern int kill_proc_info(int, struct siginfo *, pid_t);
1156extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t); 1156extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t, u32);
1157extern void do_notify_parent(struct task_struct *, int); 1157extern void do_notify_parent(struct task_struct *, int);
1158extern void force_sig(int, struct task_struct *); 1158extern void force_sig(int, struct task_struct *);
1159extern void force_sig_specific(int, struct task_struct *); 1159extern void force_sig_specific(int, struct task_struct *);
diff --git a/include/linux/security.h b/include/linux/security.h
index 51805806f974..f75303831d09 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -67,7 +67,7 @@ struct xfrm_state;
67struct xfrm_user_sec_ctx; 67struct xfrm_user_sec_ctx;
68 68
69extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 69extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
70extern int cap_netlink_recv(struct sk_buff *skb); 70extern int cap_netlink_recv(struct sk_buff *skb, int cap);
71 71
72/* 72/*
73 * Values used in the task_security_ops calls 73 * Values used in the task_security_ops calls
@@ -567,6 +567,9 @@ struct swap_info_struct;
567 * @p. 567 * @p.
568 * @p contains the task_struct for the process. 568 * @p contains the task_struct for the process.
569 * Return 0 if permission is granted. 569 * Return 0 if permission is granted.
570 * @task_getsecid:
571 * Retrieve the security identifier of the process @p.
572 * @p contains the task_struct for the process and place is into @secid.
570 * @task_setgroups: 573 * @task_setgroups:
571 * Check permission before setting the supplementary group set of the 574 * Check permission before setting the supplementary group set of the
572 * current process. 575 * current process.
@@ -582,6 +585,10 @@ struct swap_info_struct;
582 * @p contains the task_struct of process. 585 * @p contains the task_struct of process.
583 * @ioprio contains the new ioprio value 586 * @ioprio contains the new ioprio value
584 * Return 0 if permission is granted. 587 * Return 0 if permission is granted.
588 * @task_getioprio
589 * Check permission before getting the ioprio value of @p.
590 * @p contains the task_struct of process.
591 * Return 0 if permission is granted.
585 * @task_setrlimit: 592 * @task_setrlimit:
586 * Check permission before setting the resource limits of the current 593 * Check permission before setting the resource limits of the current
587 * process for @resource to @new_rlim. The old resource limit values can 594 * process for @resource to @new_rlim. The old resource limit values can
@@ -615,6 +622,7 @@ struct swap_info_struct;
615 * @p contains the task_struct for process. 622 * @p contains the task_struct for process.
616 * @info contains the signal information. 623 * @info contains the signal information.
617 * @sig contains the signal value. 624 * @sig contains the signal value.
625 * @secid contains the sid of the process where the signal originated
618 * Return 0 if permission is granted. 626 * Return 0 if permission is granted.
619 * @task_wait: 627 * @task_wait:
620 * Check permission before allowing a process to reap a child process @p 628 * Check permission before allowing a process to reap a child process @p
@@ -656,6 +664,7 @@ struct swap_info_struct;
656 * Check permission before processing the received netlink message in 664 * Check permission before processing the received netlink message in
657 * @skb. 665 * @skb.
658 * @skb contains the sk_buff structure for the netlink message. 666 * @skb contains the sk_buff structure for the netlink message.
667 * @cap indicates the capability required
659 * Return 0 if permission is granted. 668 * Return 0 if permission is granted.
660 * 669 *
661 * Security hooks for Unix domain networking. 670 * Security hooks for Unix domain networking.
@@ -1218,16 +1227,18 @@ struct security_operations {
1218 int (*task_setpgid) (struct task_struct * p, pid_t pgid); 1227 int (*task_setpgid) (struct task_struct * p, pid_t pgid);
1219 int (*task_getpgid) (struct task_struct * p); 1228 int (*task_getpgid) (struct task_struct * p);
1220 int (*task_getsid) (struct task_struct * p); 1229 int (*task_getsid) (struct task_struct * p);
1230 void (*task_getsecid) (struct task_struct * p, u32 * secid);
1221 int (*task_setgroups) (struct group_info *group_info); 1231 int (*task_setgroups) (struct group_info *group_info);
1222 int (*task_setnice) (struct task_struct * p, int nice); 1232 int (*task_setnice) (struct task_struct * p, int nice);
1223 int (*task_setioprio) (struct task_struct * p, int ioprio); 1233 int (*task_setioprio) (struct task_struct * p, int ioprio);
1234 int (*task_getioprio) (struct task_struct * p);
1224 int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim); 1235 int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim);
1225 int (*task_setscheduler) (struct task_struct * p, int policy, 1236 int (*task_setscheduler) (struct task_struct * p, int policy,
1226 struct sched_param * lp); 1237 struct sched_param * lp);
1227 int (*task_getscheduler) (struct task_struct * p); 1238 int (*task_getscheduler) (struct task_struct * p);
1228 int (*task_movememory) (struct task_struct * p); 1239 int (*task_movememory) (struct task_struct * p);
1229 int (*task_kill) (struct task_struct * p, 1240 int (*task_kill) (struct task_struct * p,
1230 struct siginfo * info, int sig); 1241 struct siginfo * info, int sig, u32 secid);
1231 int (*task_wait) (struct task_struct * p); 1242 int (*task_wait) (struct task_struct * p);
1232 int (*task_prctl) (int option, unsigned long arg2, 1243 int (*task_prctl) (int option, unsigned long arg2,
1233 unsigned long arg3, unsigned long arg4, 1244 unsigned long arg3, unsigned long arg4,
@@ -1266,7 +1277,7 @@ struct security_operations {
1266 struct sembuf * sops, unsigned nsops, int alter); 1277 struct sembuf * sops, unsigned nsops, int alter);
1267 1278
1268 int (*netlink_send) (struct sock * sk, struct sk_buff * skb); 1279 int (*netlink_send) (struct sock * sk, struct sk_buff * skb);
1269 int (*netlink_recv) (struct sk_buff * skb); 1280 int (*netlink_recv) (struct sk_buff * skb, int cap);
1270 1281
1271 /* allow module stacking */ 1282 /* allow module stacking */
1272 int (*register_security) (const char *name, 1283 int (*register_security) (const char *name,
@@ -1838,6 +1849,11 @@ static inline int security_task_getsid (struct task_struct *p)
1838 return security_ops->task_getsid (p); 1849 return security_ops->task_getsid (p);
1839} 1850}
1840 1851
1852static inline void security_task_getsecid (struct task_struct *p, u32 *secid)
1853{
1854 security_ops->task_getsecid (p, secid);
1855}
1856
1841static inline int security_task_setgroups (struct group_info *group_info) 1857static inline int security_task_setgroups (struct group_info *group_info)
1842{ 1858{
1843 return security_ops->task_setgroups (group_info); 1859 return security_ops->task_setgroups (group_info);
@@ -1853,6 +1869,11 @@ static inline int security_task_setioprio (struct task_struct *p, int ioprio)
1853 return security_ops->task_setioprio (p, ioprio); 1869 return security_ops->task_setioprio (p, ioprio);
1854} 1870}
1855 1871
1872static inline int security_task_getioprio (struct task_struct *p)
1873{
1874 return security_ops->task_getioprio (p);
1875}
1876
1856static inline int security_task_setrlimit (unsigned int resource, 1877static inline int security_task_setrlimit (unsigned int resource,
1857 struct rlimit *new_rlim) 1878 struct rlimit *new_rlim)
1858{ 1879{
@@ -1877,9 +1898,10 @@ static inline int security_task_movememory (struct task_struct *p)
1877} 1898}
1878 1899
1879static inline int security_task_kill (struct task_struct *p, 1900static inline int security_task_kill (struct task_struct *p,
1880 struct siginfo *info, int sig) 1901 struct siginfo *info, int sig,
1902 u32 secid)
1881{ 1903{
1882 return security_ops->task_kill (p, info, sig); 1904 return security_ops->task_kill (p, info, sig, secid);
1883} 1905}
1884 1906
1885static inline int security_task_wait (struct task_struct *p) 1907static inline int security_task_wait (struct task_struct *p)
@@ -2032,9 +2054,9 @@ static inline int security_netlink_send(struct sock *sk, struct sk_buff * skb)
2032 return security_ops->netlink_send(sk, skb); 2054 return security_ops->netlink_send(sk, skb);
2033} 2055}
2034 2056
2035static inline int security_netlink_recv(struct sk_buff * skb) 2057static inline int security_netlink_recv(struct sk_buff * skb, int cap)
2036{ 2058{
2037 return security_ops->netlink_recv(skb); 2059 return security_ops->netlink_recv(skb, cap);
2038} 2060}
2039 2061
2040/* prototypes */ 2062/* prototypes */
@@ -2490,6 +2512,9 @@ static inline int security_task_getsid (struct task_struct *p)
2490 return 0; 2512 return 0;
2491} 2513}
2492 2514
2515static inline void security_task_getsecid (struct task_struct *p, u32 *secid)
2516{ }
2517
2493static inline int security_task_setgroups (struct group_info *group_info) 2518static inline int security_task_setgroups (struct group_info *group_info)
2494{ 2519{
2495 return 0; 2520 return 0;
@@ -2505,6 +2530,11 @@ static inline int security_task_setioprio (struct task_struct *p, int ioprio)
2505 return 0; 2530 return 0;
2506} 2531}
2507 2532
2533static inline int security_task_getioprio (struct task_struct *p)
2534{
2535 return 0;
2536}
2537
2508static inline int security_task_setrlimit (unsigned int resource, 2538static inline int security_task_setrlimit (unsigned int resource,
2509 struct rlimit *new_rlim) 2539 struct rlimit *new_rlim)
2510{ 2540{
@@ -2529,7 +2559,8 @@ static inline int security_task_movememory (struct task_struct *p)
2529} 2559}
2530 2560
2531static inline int security_task_kill (struct task_struct *p, 2561static inline int security_task_kill (struct task_struct *p,
2532 struct siginfo *info, int sig) 2562 struct siginfo *info, int sig,
2563 u32 secid)
2533{ 2564{
2534 return 0; 2565 return 0;
2535} 2566}
@@ -2670,9 +2701,9 @@ static inline int security_netlink_send (struct sock *sk, struct sk_buff *skb)
2670 return cap_netlink_send (sk, skb); 2701 return cap_netlink_send (sk, skb);
2671} 2702}
2672 2703
2673static inline int security_netlink_recv (struct sk_buff *skb) 2704static inline int security_netlink_recv (struct sk_buff *skb, int cap)
2674{ 2705{
2675 return cap_netlink_recv (skb); 2706 return cap_netlink_recv (skb, cap);
2676} 2707}
2677 2708
2678static inline struct dentry *securityfs_create_dir(const char *name, 2709static inline struct dentry *securityfs_create_dir(const char *name,
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 951c4e858274..fc1104a2cfa9 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -336,7 +336,6 @@ struct uart_driver {
336 struct module *owner; 336 struct module *owner;
337 const char *driver_name; 337 const char *driver_name;
338 const char *dev_name; 338 const char *dev_name;
339 const char *devfs_name;
340 int major; 339 int major;
341 int minor; 340 int minor;
342 int nr; 341 int nr;
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 1e4ce7225eee..117135e33d67 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -9,32 +9,6 @@
9#include <linux/spinlock.h> 9#include <linux/spinlock.h>
10 10
11/* 11/*
12 * These values of sa_flags are used only by the kernel as part of the
13 * irq handling routines.
14 *
15 * SA_INTERRUPT is also used by the irq handling routines.
16 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
17 * SA_PROBEIRQ is set by callers when they expect sharing mismatches to occur
18 */
19#define SA_SAMPLE_RANDOM SA_RESTART
20#define SA_SHIRQ 0x04000000
21#define SA_PROBEIRQ 0x08000000
22
23/*
24 * As above, these correspond to the IORESOURCE_IRQ_* defines in
25 * linux/ioport.h to select the interrupt line behaviour. When
26 * requesting an interrupt without specifying a SA_TRIGGER, the
27 * setting should be assumed to be "as already configured", which
28 * may be as per machine or firmware initialisation.
29 */
30#define SA_TRIGGER_LOW 0x00000008
31#define SA_TRIGGER_HIGH 0x00000004
32#define SA_TRIGGER_FALLING 0x00000002
33#define SA_TRIGGER_RISING 0x00000001
34#define SA_TRIGGER_MASK (SA_TRIGGER_HIGH|SA_TRIGGER_LOW|\
35 SA_TRIGGER_RISING|SA_TRIGGER_FALLING)
36
37/*
38 * Real Time signals may be queued. 12 * Real Time signals may be queued.
39 */ 13 */
40 14
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 16eef03ce0eb..57d7d4965f9a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -171,7 +171,15 @@ enum {
171 171
172enum { 172enum {
173 SKB_GSO_TCPV4 = 1 << 0, 173 SKB_GSO_TCPV4 = 1 << 0,
174 SKB_GSO_UDPV4 = 1 << 1, 174 SKB_GSO_UDP = 1 << 1,
175
176 /* This indicates the skb is from an untrusted source. */
177 SKB_GSO_DODGY = 1 << 2,
178
179 /* This indicates the tcp segment has CWR set. */
180 SKB_GSO_TCP_ECN = 1 << 3,
181
182 SKB_GSO_TCPV6 = 1 << 4,
175}; 183};
176 184
177/** 185/**
@@ -1298,8 +1306,7 @@ extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
1298extern void skb_split(struct sk_buff *skb, 1306extern void skb_split(struct sk_buff *skb,
1299 struct sk_buff *skb1, const u32 len); 1307 struct sk_buff *skb1, const u32 len);
1300 1308
1301extern void skb_release_data(struct sk_buff *skb); 1309extern struct sk_buff *skb_segment(struct sk_buff *skb, int features);
1302extern struct sk_buff *skb_segment(struct sk_buff *skb, int sg);
1303 1310
1304static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, 1311static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
1305 int len, void *buffer) 1312 int len, void *buffer)
diff --git a/include/linux/smp.h b/include/linux/smp.h
index c93c3fe4308c..837e8bce1349 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -125,4 +125,6 @@ static inline void smp_send_reschedule(int cpu) { }
125#define put_cpu() preempt_enable() 125#define put_cpu() preempt_enable()
126#define put_cpu_no_resched() preempt_enable_no_resched() 126#define put_cpu_no_resched() preempt_enable_no_resched()
127 127
128void smp_setup_processor_id(void);
129
128#endif /* __LINUX_SMP_H */ 130#endif /* __LINUX_SMP_H */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 503564384545..7b27c09b5604 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -159,7 +159,9 @@ struct svc_rqst {
159 * determine what device number 159 * determine what device number
160 * to report (real or virtual) 160 * to report (real or virtual)
161 */ 161 */
162 162 int rq_sendfile_ok; /* turned off in gss privacy
163 * to prevent encrypting page
164 * cache pages */
163 wait_queue_head_t rq_wait; /* synchronization */ 165 wait_queue_head_t rq_wait; /* synchronization */
164}; 166};
165 167
diff --git a/include/linux/swap.h b/include/linux/swap.h
index c41e2d6d1acc..cf6ca6e377bd 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -189,7 +189,6 @@ extern long vm_total_pages;
189 189
190#ifdef CONFIG_NUMA 190#ifdef CONFIG_NUMA
191extern int zone_reclaim_mode; 191extern int zone_reclaim_mode;
192extern int zone_reclaim_interval;
193extern int zone_reclaim(struct zone *, gfp_t, unsigned int); 192extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
194#else 193#else
195#define zone_reclaim_mode 0 194#define zone_reclaim_mode 0
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index b368b296d035..58c961c9e170 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -157,7 +157,6 @@ struct tty_driver {
157 struct cdev cdev; 157 struct cdev cdev;
158 struct module *owner; 158 struct module *owner;
159 const char *driver_name; 159 const char *driver_name;
160 const char *devfs_name;
161 const char *name; 160 const char *name;
162 int name_base; /* offset of printed name */ 161 int name_base; /* offset of printed name */
163 int major; /* major device number */ 162 int major; /* major device number */
@@ -242,8 +241,15 @@ void tty_set_operations(struct tty_driver *driver, struct tty_operations *op);
242 * is also a promise, if the above case is true, not to signal 241 * is also a promise, if the above case is true, not to signal
243 * overruns, either.) 242 * overruns, either.)
244 * 243 *
245 * TTY_DRIVER_NO_DEVFS --- if set, do not create devfs entries. This 244 * TTY_DRIVER_DYNAMIC_DEV --- if set, the individual tty devices need
246 * is only used by tty_register_driver(). 245 * to be registered with a call to tty_register_driver() when the
246 * device is found in the system and unregistered with a call to
247 * tty_unregister_device() so the devices will be show up
248 * properly in sysfs. If not set, driver->num entries will be
249 * created by the tty core in sysfs when tty_register_driver() is
250 * called. This is to be used by drivers that have tty devices
251 * that can appear and disappear while the main tty driver is
252 * registered with the tty core.
247 * 253 *
248 * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead 254 * TTY_DRIVER_DEVPTS_MEM -- don't use the standard arrays, instead
249 * use dynamic memory keyed through the devpts filesystem. This 255 * use dynamic memory keyed through the devpts filesystem. This
@@ -252,7 +258,7 @@ void tty_set_operations(struct tty_driver *driver, struct tty_operations *op);
252#define TTY_DRIVER_INSTALLED 0x0001 258#define TTY_DRIVER_INSTALLED 0x0001
253#define TTY_DRIVER_RESET_TERMIOS 0x0002 259#define TTY_DRIVER_RESET_TERMIOS 0x0002
254#define TTY_DRIVER_REAL_RAW 0x0004 260#define TTY_DRIVER_REAL_RAW 0x0004
255#define TTY_DRIVER_NO_DEVFS 0x0008 261#define TTY_DRIVER_DYNAMIC_DEV 0x0008
256#define TTY_DRIVER_DEVPTS_MEM 0x0010 262#define TTY_DRIVER_DEVPTS_MEM 0x0010
257 263
258/* tty driver types */ 264/* tty driver types */
diff --git a/include/linux/types.h b/include/linux/types.h
index a5e46e783ffa..3f235660a3cd 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -177,8 +177,15 @@ typedef __u64 __bitwise __be64;
177 177
178#ifdef __KERNEL__ 178#ifdef __KERNEL__
179typedef unsigned __bitwise__ gfp_t; 179typedef unsigned __bitwise__ gfp_t;
180
181#ifdef CONFIG_RESOURCES_64BIT
182typedef u64 resource_size_t;
183#else
184typedef u32 resource_size_t;
180#endif 185#endif
181 186
187#endif /* __KERNEL__ */
188
182struct ustat { 189struct ustat {
183 __kernel_daddr_t f_tfree; 190 __kernel_daddr_t f_tfree;
184 __kernel_ino_t f_tinode; 191 __kernel_ino_t f_tinode;
diff --git a/include/linux/udp.h b/include/linux/udp.h
index bdd39be09406..90223f057d50 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -46,7 +46,7 @@ struct udp_sock {
46 unsigned int corkflag; /* Cork is required */ 46 unsigned int corkflag; /* Cork is required */
47 __u16 encap_type; /* Is this an Encapsulation socket? */ 47 __u16 encap_type; /* Is this an Encapsulation socket? */
48 /* 48 /*
49 * Following member retains the infomation to create a UDP header 49 * Following member retains the information to create a UDP header
50 * when the socket is uncorked. 50 * when the socket is uncorked.
51 */ 51 */
52 __u16 len; /* total length of pending frames */ 52 __u16 len; /* total length of pending frames */
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index e39b7cc43390..fc62887c5206 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -993,7 +993,7 @@ extern void ufs_panic (struct super_block *, const char *, const char *, ...) __
993extern struct inode_operations ufs_fast_symlink_inode_operations; 993extern struct inode_operations ufs_fast_symlink_inode_operations;
994 994
995/* truncate.c */ 995/* truncate.c */
996extern void ufs_truncate (struct inode *); 996extern int ufs_truncate (struct inode *, loff_t);
997 997
998static inline struct ufs_sb_info *UFS_SB(struct super_block *sb) 998static inline struct ufs_sb_info *UFS_SB(struct super_block *sb)
999{ 999{
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
new file mode 100644
index 000000000000..3e0daf54133e
--- /dev/null
+++ b/include/linux/vmstat.h
@@ -0,0 +1,215 @@
1#ifndef _LINUX_VMSTAT_H
2#define _LINUX_VMSTAT_H
3
4#include <linux/types.h>
5#include <linux/percpu.h>
6#include <linux/config.h>
7#include <linux/mmzone.h>
8#include <asm/atomic.h>
9
10#ifdef CONFIG_VM_EVENT_COUNTERS
11/*
12 * Light weight per cpu counter implementation.
13 *
14 * Counters should only be incremented and no critical kernel component
15 * should rely on the counter values.
16 *
17 * Counters are handled completely inline. On many platforms the code
18 * generated will simply be the increment of a global address.
19 */
20
21#define FOR_ALL_ZONES(x) x##_DMA, x##_DMA32, x##_NORMAL, x##_HIGH
22
23enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
24 FOR_ALL_ZONES(PGALLOC),
25 PGFREE, PGACTIVATE, PGDEACTIVATE,
26 PGFAULT, PGMAJFAULT,
27 FOR_ALL_ZONES(PGREFILL),
28 FOR_ALL_ZONES(PGSTEAL),
29 FOR_ALL_ZONES(PGSCAN_KSWAPD),
30 FOR_ALL_ZONES(PGSCAN_DIRECT),
31 PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL,
32 PAGEOUTRUN, ALLOCSTALL, PGROTATED,
33 NR_VM_EVENT_ITEMS
34};
35
36struct vm_event_state {
37 unsigned long event[NR_VM_EVENT_ITEMS];
38};
39
40DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
41
42static inline void __count_vm_event(enum vm_event_item item)
43{
44 __get_cpu_var(vm_event_states.event[item])++;
45}
46
47static inline void count_vm_event(enum vm_event_item item)
48{
49 get_cpu_var(vm_event_states.event[item])++;
50 put_cpu();
51}
52
53static inline void __count_vm_events(enum vm_event_item item, long delta)
54{
55 __get_cpu_var(vm_event_states.event[item]) += delta;
56}
57
58static inline void count_vm_events(enum vm_event_item item, long delta)
59{
60 get_cpu_var(vm_event_states.event[item])++;
61 put_cpu();
62}
63
64extern void all_vm_events(unsigned long *);
65extern void vm_events_fold_cpu(int cpu);
66
67#else
68
69/* Disable counters */
70#define get_cpu_vm_events(e) 0L
71#define count_vm_event(e) do { } while (0)
72#define count_vm_events(e,d) do { } while (0)
73#define __count_vm_event(e) do { } while (0)
74#define __count_vm_events(e,d) do { } while (0)
75#define vm_events_fold_cpu(x) do { } while (0)
76
77#endif /* CONFIG_VM_EVENT_COUNTERS */
78
79#define __count_zone_vm_events(item, zone, delta) \
80 __count_vm_events(item##_DMA + zone_idx(zone), delta)
81
82/*
83 * Zone based page accounting with per cpu differentials.
84 */
85extern atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
86
87static inline void zone_page_state_add(long x, struct zone *zone,
88 enum zone_stat_item item)
89{
90 atomic_long_add(x, &zone->vm_stat[item]);
91 atomic_long_add(x, &vm_stat[item]);
92}
93
94static inline unsigned long global_page_state(enum zone_stat_item item)
95{
96 long x = atomic_long_read(&vm_stat[item]);
97#ifdef CONFIG_SMP
98 if (x < 0)
99 x = 0;
100#endif
101 return x;
102}
103
104static inline unsigned long zone_page_state(struct zone *zone,
105 enum zone_stat_item item)
106{
107 long x = atomic_long_read(&zone->vm_stat[item]);
108#ifdef CONFIG_SMP
109 if (x < 0)
110 x = 0;
111#endif
112 return x;
113}
114
115#ifdef CONFIG_NUMA
116/*
117 * Determine the per node value of a stat item. This function
118 * is called frequently in a NUMA machine, so try to be as
119 * frugal as possible.
120 */
121static inline unsigned long node_page_state(int node,
122 enum zone_stat_item item)
123{
124 struct zone *zones = NODE_DATA(node)->node_zones;
125
126 return
127#ifndef CONFIG_DMA_IS_NORMAL
128#if !defined(CONFIG_DMA_IS_DMA32) && BITS_PER_LONG >= 64
129 zone_page_state(&zones[ZONE_DMA32], item) +
130#endif
131 zone_page_state(&zones[ZONE_NORMAL], item) +
132#endif
133#ifdef CONFIG_HIGHMEM
134 zone_page_state(&zones[ZONE_HIGHMEM], item) +
135#endif
136 zone_page_state(&zones[ZONE_DMA], item);
137}
138
139extern void zone_statistics(struct zonelist *, struct zone *);
140
141#else
142
143#define node_page_state(node, item) global_page_state(item)
144#define zone_statistics(_zl,_z) do { } while (0)
145
146#endif /* CONFIG_NUMA */
147
148#define __add_zone_page_state(__z, __i, __d) \
149 __mod_zone_page_state(__z, __i, __d)
150#define __sub_zone_page_state(__z, __i, __d) \
151 __mod_zone_page_state(__z, __i,-(__d))
152
153#define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d)
154#define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d))
155
156static inline void zap_zone_vm_stats(struct zone *zone)
157{
158 memset(zone->vm_stat, 0, sizeof(zone->vm_stat));
159}
160
161extern void inc_zone_state(struct zone *, enum zone_stat_item);
162
163#ifdef CONFIG_SMP
164void __mod_zone_page_state(struct zone *, enum zone_stat_item item, int);
165void __inc_zone_page_state(struct page *, enum zone_stat_item);
166void __dec_zone_page_state(struct page *, enum zone_stat_item);
167
168void mod_zone_page_state(struct zone *, enum zone_stat_item, int);
169void inc_zone_page_state(struct page *, enum zone_stat_item);
170void dec_zone_page_state(struct page *, enum zone_stat_item);
171
172extern void inc_zone_state(struct zone *, enum zone_stat_item);
173
174void refresh_cpu_vm_stats(int);
175void refresh_vm_stats(void);
176
177#else /* CONFIG_SMP */
178
179/*
180 * We do not maintain differentials in a single processor configuration.
181 * The functions directly modify the zone and global counters.
182 */
183static inline void __mod_zone_page_state(struct zone *zone,
184 enum zone_stat_item item, int delta)
185{
186 zone_page_state_add(delta, zone, item);
187}
188
189static inline void __inc_zone_page_state(struct page *page,
190 enum zone_stat_item item)
191{
192 atomic_long_inc(&page_zone(page)->vm_stat[item]);
193 atomic_long_inc(&vm_stat[item]);
194}
195
196static inline void __dec_zone_page_state(struct page *page,
197 enum zone_stat_item item)
198{
199 atomic_long_dec(&page_zone(page)->vm_stat[item]);
200 atomic_long_dec(&vm_stat[item]);
201}
202
203/*
204 * We only use atomic operations to update counters. So there is no need to
205 * disable interrupts.
206 */
207#define inc_zone_page_state __inc_zone_page_state
208#define dec_zone_page_state __dec_zone_page_state
209#define mod_zone_page_state __mod_zone_page_state
210
211static inline void refresh_cpu_vm_stats(int cpu) { }
212static inline void refresh_vm_stats(void) { }
213#endif
214
215#endif /* _LINUX_VMSTAT_H */