aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-24 08:41:41 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-24 13:07:53 -0400
commit816724e65c72a90a44fbad0ef0b59b186c85fa90 (patch)
tree421fa29aedff988e392f92780637553e275d37a0 /include/linux
parent70ac4385a13f78bc478f26d317511893741b05bd (diff)
parentd384ea691fe4ea8c2dd5b9b8d9042eb181776f18 (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts: fs/nfs/inode.c fs/super.c Fix conflicts between patch 'NFS: Split fs/nfs/inode.c' and patch 'VFS: Permit filesystem to override root dentry on mount'
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h9
-rw-r--r--include/linux/ata.h37
-rw-r--r--include/linux/blkdev.h21
-rw-r--r--include/linux/blktrace_api.h6
-rw-r--r--include/linux/bootmem.h4
-rw-r--r--include/linux/cn_proc.h21
-rw-r--r--include/linux/coda_linux.h2
-rw-r--r--include/linux/coda_psdev.h2
-rw-r--r--include/linux/connector.h5
-rw-r--r--include/linux/cpufreq.h4
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/delay.h5
-rw-r--r--include/linux/device.h25
-rw-r--r--include/linux/efi.h1
-rw-r--r--include/linux/ethtool.h2
-rw-r--r--include/linux/fs.h42
-rw-r--r--include/linux/genalloc.h35
-rw-r--r--include/linux/hdlc.h2
-rw-r--r--include/linux/hugetlb.h8
-rw-r--r--include/linux/i2c-ocores.h19
-rw-r--r--include/linux/i2c.h4
-rw-r--r--include/linux/interrupt.h21
-rw-r--r--include/linux/io.h1
-rw-r--r--include/linux/ioc4.h5
-rw-r--r--include/linux/irq.h11
-rw-r--r--include/linux/irqreturn.h25
-rw-r--r--include/linux/isa.h28
-rw-r--r--include/linux/jbd.h8
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/kexec.h1
-rw-r--r--include/linux/key.h23
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/libata.h473
-rw-r--r--include/linux/list.h23
-rw-r--r--include/linux/m41t00.h50
-rw-r--r--include/linux/migrate.h20
-rw-r--r--include/linux/mm.h11
-rw-r--r--include/linux/mmzone.h12
-rw-r--r--include/linux/module.h2
-rw-r--r--include/linux/mount.h5
-rw-r--r--include/linux/netdevice.h24
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/page-flags.h14
-rw-r--r--include/linux/pagemap.h7
-rw-r--r--include/linux/pci.h4
-rw-r--r--include/linux/pci_ids.h25
-rw-r--r--include/linux/pci_regs.h1
-rw-r--r--include/linux/percpu_counter.h38
-rw-r--r--include/linux/prctl.h7
-rw-r--r--include/linux/ptrace.h4
-rw-r--r--include/linux/radix-tree.h5
-rw-r--r--include/linux/ramfs.h4
-rw-r--r--include/linux/rbtree.h4
-rw-r--r--include/linux/rcupdate.h3
-rw-r--r--include/linux/rmap.h1
-rw-r--r--include/linux/sched.h13
-rw-r--r--include/linux/security.h55
-rw-r--r--include/linux/serial_core.h4
-rw-r--r--include/linux/skbuff.h26
-rw-r--r--include/linux/slab.h50
-rw-r--r--include/linux/string.h1
-rw-r--r--include/linux/suspend.h1
-rw-r--r--include/linux/swap.h101
-rw-r--r--include/linux/swapops.h53
-rw-r--r--include/linux/syscalls.h10
-rw-r--r--include/linux/sysctl.h1
-rw-r--r--include/linux/sysdev.h18
-rw-r--r--include/linux/tcp.h2
-rw-r--r--include/linux/tty.h4
-rw-r--r--include/linux/uaccess.h22
-rw-r--r--include/linux/usb.h22
-rw-r--r--include/linux/usb/cdc.h (renamed from include/linux/usb_cdc.h)0
-rw-r--r--include/linux/usb/input.h (renamed from include/linux/usb_input.h)0
-rw-r--r--include/linux/usb/isp116x.h (renamed from include/linux/usb_isp116x.h)0
-rw-r--r--include/linux/usb/sl811.h (renamed from include/linux/usb_sl811.h)8
-rw-r--r--include/linux/vmalloc.h8
-rw-r--r--include/linux/writeback.h5
-rw-r--r--include/linux/zconf.h12
-rw-r--r--include/linux/zlib.h209
-rw-r--r--include/linux/zorro.h42
-rw-r--r--include/linux/zutil.h12
81 files changed, 1297 insertions, 506 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 1cf0b91d05bd..90d6df1551ed 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -37,6 +37,7 @@
37#include <acpi/acpi.h> 37#include <acpi/acpi.h>
38#include <acpi/acpi_bus.h> 38#include <acpi/acpi_bus.h>
39#include <acpi/acpi_drivers.h> 39#include <acpi/acpi_drivers.h>
40#include <acpi/acpi_numa.h>
40#include <asm/acpi.h> 41#include <asm/acpi.h>
41 42
42 43
@@ -407,10 +408,18 @@ void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
407void acpi_table_print_srat_entry (acpi_table_entry_header *srat); 408void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
408 409
409/* the following four functions are architecture-dependent */ 410/* the following four functions are architecture-dependent */
411#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
412#define NR_NODE_MEMBLKS MAX_NUMNODES
413#define acpi_numa_slit_init(slit) do {} while (0)
414#define acpi_numa_processor_affinity_init(pa) do {} while (0)
415#define acpi_numa_memory_affinity_init(ma) do {} while (0)
416#define acpi_numa_arch_fixup() do {} while (0)
417#else
410void acpi_numa_slit_init (struct acpi_table_slit *slit); 418void acpi_numa_slit_init (struct acpi_table_slit *slit);
411void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); 419void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa);
412void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); 420void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma);
413void acpi_numa_arch_fixup(void); 421void acpi_numa_arch_fixup(void);
422#endif
414 423
415#ifdef CONFIG_ACPI_HOTPLUG_CPU 424#ifdef CONFIG_ACPI_HOTPLUG_CPU
416/* Arch dependent functions for cpu hotplug support */ 425/* Arch dependent functions for cpu hotplug support */
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 312a2c0c64e6..3671af869696 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -97,6 +97,9 @@ enum {
97 ATA_DRQ = (1 << 3), /* data request i/o */ 97 ATA_DRQ = (1 << 3), /* data request i/o */
98 ATA_ERR = (1 << 0), /* have an error */ 98 ATA_ERR = (1 << 0), /* have an error */
99 ATA_SRST = (1 << 2), /* software reset */ 99 ATA_SRST = (1 << 2), /* software reset */
100 ATA_ICRC = (1 << 7), /* interface CRC error */
101 ATA_UNC = (1 << 6), /* uncorrectable media error */
102 ATA_IDNF = (1 << 4), /* ID not found */
100 ATA_ABORTED = (1 << 2), /* command aborted */ 103 ATA_ABORTED = (1 << 2), /* command aborted */
101 104
102 /* ATA command block registers */ 105 /* ATA command block registers */
@@ -130,6 +133,8 @@ enum {
130 ATA_CMD_WRITE = 0xCA, 133 ATA_CMD_WRITE = 0xCA,
131 ATA_CMD_WRITE_EXT = 0x35, 134 ATA_CMD_WRITE_EXT = 0x35,
132 ATA_CMD_WRITE_FUA_EXT = 0x3D, 135 ATA_CMD_WRITE_FUA_EXT = 0x3D,
136 ATA_CMD_FPDMA_READ = 0x60,
137 ATA_CMD_FPDMA_WRITE = 0x61,
133 ATA_CMD_PIO_READ = 0x20, 138 ATA_CMD_PIO_READ = 0x20,
134 ATA_CMD_PIO_READ_EXT = 0x24, 139 ATA_CMD_PIO_READ_EXT = 0x24,
135 ATA_CMD_PIO_WRITE = 0x30, 140 ATA_CMD_PIO_WRITE = 0x30,
@@ -148,6 +153,10 @@ enum {
148 ATA_CMD_INIT_DEV_PARAMS = 0x91, 153 ATA_CMD_INIT_DEV_PARAMS = 0x91,
149 ATA_CMD_READ_NATIVE_MAX = 0xF8, 154 ATA_CMD_READ_NATIVE_MAX = 0xF8,
150 ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, 155 ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
156 ATA_CMD_READ_LOG_EXT = 0x2f,
157
158 /* READ_LOG_EXT pages */
159 ATA_LOG_SATA_NCQ = 0x10,
151 160
152 /* SETFEATURES stuff */ 161 /* SETFEATURES stuff */
153 SETFEATURES_XFER = 0x03, 162 SETFEATURES_XFER = 0x03,
@@ -172,6 +181,9 @@ enum {
172 XFER_PIO_0 = 0x08, 181 XFER_PIO_0 = 0x08,
173 XFER_PIO_SLOW = 0x00, 182 XFER_PIO_SLOW = 0x00,
174 183
184 SETFEATURES_WC_ON = 0x02, /* Enable write cache */
185 SETFEATURES_WC_OFF = 0x82, /* Disable write cache */
186
175 /* ATAPI stuff */ 187 /* ATAPI stuff */
176 ATAPI_PKT_DMA = (1 << 0), 188 ATAPI_PKT_DMA = (1 << 0),
177 ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: 189 ATAPI_DMADIR = (1 << 2), /* ATAPI data dir:
@@ -192,6 +204,16 @@ enum {
192 SCR_ACTIVE = 3, 204 SCR_ACTIVE = 3,
193 SCR_NOTIFICATION = 4, 205 SCR_NOTIFICATION = 4,
194 206
207 /* SError bits */
208 SERR_DATA_RECOVERED = (1 << 0), /* recovered data error */
209 SERR_COMM_RECOVERED = (1 << 1), /* recovered comm failure */
210 SERR_DATA = (1 << 8), /* unrecovered data error */
211 SERR_PERSISTENT = (1 << 9), /* persistent data/comm error */
212 SERR_PROTOCOL = (1 << 10), /* protocol violation */
213 SERR_INTERNAL = (1 << 11), /* host internal error */
214 SERR_PHYRDY_CHG = (1 << 16), /* PHY RDY changed */
215 SERR_DEV_XCHG = (1 << 26), /* device exchanged */
216
195 /* struct ata_taskfile flags */ 217 /* struct ata_taskfile flags */
196 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */ 218 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
197 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ 219 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
@@ -199,6 +221,7 @@ enum {
199 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 221 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
200 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ 222 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
201 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ 223 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
224 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
202}; 225};
203 226
204enum ata_tf_protocols { 227enum ata_tf_protocols {
@@ -207,6 +230,7 @@ enum ata_tf_protocols {
207 ATA_PROT_NODATA, /* no data */ 230 ATA_PROT_NODATA, /* no data */
208 ATA_PROT_PIO, /* PIO single sector */ 231 ATA_PROT_PIO, /* PIO single sector */
209 ATA_PROT_DMA, /* DMA */ 232 ATA_PROT_DMA, /* DMA */
233 ATA_PROT_NCQ, /* NCQ */
210 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ 234 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/
211 ATA_PROT_ATAPI_NODATA, /* packet command, no data */ 235 ATA_PROT_ATAPI_NODATA, /* packet command, no data */
212 ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */ 236 ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */
@@ -262,6 +286,8 @@ struct ata_taskfile {
262#define ata_id_has_pm(id) ((id)[82] & (1 << 3)) 286#define ata_id_has_pm(id) ((id)[82] & (1 << 3))
263#define ata_id_has_lba(id) ((id)[49] & (1 << 9)) 287#define ata_id_has_lba(id) ((id)[49] & (1 << 9))
264#define ata_id_has_dma(id) ((id)[49] & (1 << 8)) 288#define ata_id_has_dma(id) ((id)[49] & (1 << 8))
289#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
290#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
265#define ata_id_removeable(id) ((id)[0] & (1 << 7)) 291#define ata_id_removeable(id) ((id)[0] & (1 << 7))
266#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) 292#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0))
267#define ata_id_u32(id,n) \ 293#define ata_id_u32(id,n) \
@@ -272,6 +298,8 @@ struct ata_taskfile {
272 ((u64) (id)[(n) + 1] << 16) | \ 298 ((u64) (id)[(n) + 1] << 16) | \
273 ((u64) (id)[(n) + 0]) ) 299 ((u64) (id)[(n) + 0]) )
274 300
301#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
302
275static inline unsigned int ata_id_major_version(const u16 *id) 303static inline unsigned int ata_id_major_version(const u16 *id)
276{ 304{
277 unsigned int mver; 305 unsigned int mver;
@@ -311,6 +339,15 @@ static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
311 (tf->protocol == ATA_PROT_ATAPI_DMA); 339 (tf->protocol == ATA_PROT_ATAPI_DMA);
312} 340}
313 341
342static inline int is_multi_taskfile(struct ata_taskfile *tf)
343{
344 return (tf->command == ATA_CMD_READ_MULTI) ||
345 (tf->command == ATA_CMD_WRITE_MULTI) ||
346 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
347 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
348 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
349}
350
314static inline int ata_ok(u8 status) 351static inline int ata_ok(u8 status)
315{ 352{
316 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) 353 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5d327313a9f7..aafe82788b4e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -151,11 +151,9 @@ struct request {
151 void *elevator_private; 151 void *elevator_private;
152 void *completion_data; 152 void *completion_data;
153 153
154 unsigned short ioprio;
155
156 int rq_status; /* should split this into a few status bits */ 154 int rq_status; /* should split this into a few status bits */
157 struct gendisk *rq_disk;
158 int errors; 155 int errors;
156 struct gendisk *rq_disk;
159 unsigned long start_time; 157 unsigned long start_time;
160 158
161 /* Number of scatter-gather DMA addr+len pairs after 159 /* Number of scatter-gather DMA addr+len pairs after
@@ -170,8 +168,9 @@ struct request {
170 */ 168 */
171 unsigned short nr_hw_segments; 169 unsigned short nr_hw_segments;
172 170
171 unsigned short ioprio;
172
173 int tag; 173 int tag;
174 char *buffer;
175 174
176 int ref_count; 175 int ref_count;
177 request_queue_t *q; 176 request_queue_t *q;
@@ -179,6 +178,7 @@ struct request {
179 178
180 struct completion *waiting; 179 struct completion *waiting;
181 void *special; 180 void *special;
181 char *buffer;
182 182
183 /* 183 /*
184 * when request is used as a packet command carrier 184 * when request is used as a packet command carrier
@@ -187,20 +187,14 @@ struct request {
187 unsigned char cmd[BLK_MAX_CDB]; 187 unsigned char cmd[BLK_MAX_CDB];
188 188
189 unsigned int data_len; 189 unsigned int data_len;
190 void *data;
191
192 unsigned int sense_len; 190 unsigned int sense_len;
191 void *data;
193 void *sense; 192 void *sense;
194 193
195 unsigned int timeout; 194 unsigned int timeout;
196 int retries; 195 int retries;
197 196
198 /* 197 /*
199 * For Power Management requests
200 */
201 struct request_pm_state *pm;
202
203 /*
204 * completion callback. end_io_data should be folded in with waiting 198 * completion callback. end_io_data should be folded in with waiting
205 */ 199 */
206 rq_end_io_fn *end_io; 200 rq_end_io_fn *end_io;
@@ -241,6 +235,7 @@ enum rq_flag_bits {
241 __REQ_PM_RESUME, /* resume request */ 235 __REQ_PM_RESUME, /* resume request */
242 __REQ_PM_SHUTDOWN, /* shutdown request */ 236 __REQ_PM_SHUTDOWN, /* shutdown request */
243 __REQ_ORDERED_COLOR, /* is before or after barrier */ 237 __REQ_ORDERED_COLOR, /* is before or after barrier */
238 __REQ_RW_SYNC, /* request is sync (O_DIRECT) */
244 __REQ_NR_BITS, /* stops here */ 239 __REQ_NR_BITS, /* stops here */
245}; 240};
246 241
@@ -270,6 +265,7 @@ enum rq_flag_bits {
270#define REQ_PM_RESUME (1 << __REQ_PM_RESUME) 265#define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
271#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) 266#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
272#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) 267#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
268#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
273 269
274/* 270/*
275 * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME 271 * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
@@ -438,9 +434,6 @@ struct request_queue
438 434
439#define RQ_INACTIVE (-1) 435#define RQ_INACTIVE (-1)
440#define RQ_ACTIVE 1 436#define RQ_ACTIVE 1
441#define RQ_SCSI_BUSY 0xffff
442#define RQ_SCSI_DONE 0xfffe
443#define RQ_SCSI_DISCONNECTING 0xffe0
444 437
445#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 438#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
446#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ 439#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index eb1a867ed245..a7e8cef73d15 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -90,9 +90,9 @@ struct blk_io_trace {
90 * The remap event 90 * The remap event
91 */ 91 */
92struct blk_io_trace_remap { 92struct blk_io_trace_remap {
93 u32 device; 93 __be32 device;
94 u32 __pad; 94 u32 __pad;
95 u64 sector; 95 __be64 sector;
96}; 96};
97 97
98enum { 98enum {
@@ -224,7 +224,7 @@ static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what,
224 struct bio *bio, unsigned int pdu) 224 struct bio *bio, unsigned int pdu)
225{ 225{
226 struct blk_trace *bt = q->blk_trace; 226 struct blk_trace *bt = q->blk_trace;
227 u64 rpdu = cpu_to_be64(pdu); 227 __be64 rpdu = cpu_to_be64(pdu);
228 228
229 if (likely(!bt)) 229 if (likely(!bt))
230 return; 230 return;
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index da2d107fe2cf..22866fa2d960 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -91,8 +91,8 @@ static inline void *alloc_remap(int nid, unsigned long size)
91} 91}
92#endif 92#endif
93 93
94extern unsigned long __initdata nr_kernel_pages; 94extern unsigned long nr_kernel_pages;
95extern unsigned long __initdata nr_all_pages; 95extern unsigned long nr_all_pages;
96 96
97extern void *__init alloc_large_system_hash(const char *tablename, 97extern void *__init alloc_large_system_hash(const char *tablename,
98 unsigned long bucketsize, 98 unsigned long bucketsize,
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index 1417de935057..dbb7769009be 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -3,31 +3,22 @@
3 * 3 *
4 * Copyright (C) Matt Helsley, IBM Corp. 2005 4 * Copyright (C) Matt Helsley, IBM Corp. 2005
5 * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin 5 * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
6 * Original copyright notice follows:
7 * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com> 6 * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
8 * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net> 7 * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify it
11 * it under the terms of the GNU General Public License as published by 10 * under the terms of version 2.1 of the GNU Lesser General Public License
12 * the Free Software Foundation; either version 2 of the License, or 11 * as published by the Free Software Foundation.
13 * (at your option) any later version.
14 * 12 *
15 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it would be useful, but
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 16 */
24 17
25#ifndef CN_PROC_H 18#ifndef CN_PROC_H
26#define CN_PROC_H 19#define CN_PROC_H
27 20
28#include <linux/types.h> 21#include <linux/types.h>
29#include <linux/time.h>
30#include <linux/connector.h>
31 22
32/* 23/*
33 * Userspace sends this enum to register with the kernel that it is listening 24 * Userspace sends this enum to register with the kernel that it is listening
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index b3ecf8f71d97..7b5c5df5cb69 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -36,7 +36,7 @@ extern const struct file_operations coda_ioctl_operations;
36 36
37/* operations shared over more than one file */ 37/* operations shared over more than one file */
38int coda_open(struct inode *i, struct file *f); 38int coda_open(struct inode *i, struct file *f);
39int coda_flush(struct file *f); 39int coda_flush(struct file *f, fl_owner_t id);
40int coda_release(struct inode *i, struct file *f); 40int coda_release(struct inode *i, struct file *f);
41int coda_permission(struct inode *inode, int mask, struct nameidata *nd); 41int coda_permission(struct inode *inode, int mask, struct nameidata *nd);
42int coda_revalidate_inode(struct dentry *); 42int coda_revalidate_inode(struct dentry *);
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index d539262a8f89..98f6c52c152b 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -70,7 +70,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
70 unsigned int cmd, struct PioctlData *data); 70 unsigned int cmd, struct PioctlData *data);
71int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); 71int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
72int venus_fsync(struct super_block *sb, struct CodaFid *fid); 72int venus_fsync(struct super_block *sb, struct CodaFid *fid);
73int venus_statfs(struct super_block *sb, struct kstatfs *sfs); 73int venus_statfs(struct dentry *dentry, struct kstatfs *sfs);
74 74
75 75
76/* messages between coda filesystem in kernel and Venus */ 76/* messages between coda filesystem in kernel and Venus */
diff --git a/include/linux/connector.h b/include/linux/connector.h
index ad1a22c1c42e..4c02119c6ab9 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -34,8 +34,11 @@
34#define CN_VAL_PROC 0x1 34#define CN_VAL_PROC 0x1
35#define CN_IDX_CIFS 0x2 35#define CN_IDX_CIFS 0x2
36#define CN_VAL_CIFS 0x1 36#define CN_VAL_CIFS 0x1
37#define CN_W1_IDX 0x3 /* w1 communication */
38#define CN_W1_VAL 0x1
37 39
38#define CN_NETLINK_USERS 1 40
41#define CN_NETLINK_USERS 4
39 42
40/* 43/*
41 * Maximum connector's message size. 44 * Maximum connector's message size.
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 5aa95011f7e6..466fbe9e4899 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -72,6 +72,8 @@ struct cpufreq_real_policy {
72 72
73struct cpufreq_policy { 73struct cpufreq_policy {
74 cpumask_t cpus; /* affected CPUs */ 74 cpumask_t cpus; /* affected CPUs */
75 unsigned int shared_type; /* ANY or ALL affected CPUs
76 should set cpufreq */
75 unsigned int cpu; /* cpu nr of registered CPU */ 77 unsigned int cpu; /* cpu nr of registered CPU */
76 struct cpufreq_cpuinfo cpuinfo;/* see above */ 78 struct cpufreq_cpuinfo cpuinfo;/* see above */
77 79
@@ -98,6 +100,8 @@ struct cpufreq_policy {
98#define CPUFREQ_INCOMPATIBLE (1) 100#define CPUFREQ_INCOMPATIBLE (1)
99#define CPUFREQ_NOTIFY (2) 101#define CPUFREQ_NOTIFY (2)
100 102
103#define CPUFREQ_SHARED_TYPE_ALL (0) /* All dependent CPUs should set freq */
104#define CPUFREQ_SHARED_TYPE_ANY (1) /* Freq can be set from any dependent CPU */
101 105
102/******************** cpufreq transition notifiers *******************/ 106/******************** cpufreq transition notifiers *******************/
103 107
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 836325ee0931..0dd1610a94a9 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -217,7 +217,6 @@ extern struct dentry * d_alloc_anon(struct inode *);
217extern struct dentry * d_splice_alias(struct inode *, struct dentry *); 217extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
218extern void shrink_dcache_sb(struct super_block *); 218extern void shrink_dcache_sb(struct super_block *);
219extern void shrink_dcache_parent(struct dentry *); 219extern void shrink_dcache_parent(struct dentry *);
220extern void shrink_dcache_anon(struct hlist_head *);
221extern int d_invalidate(struct dentry *); 220extern int d_invalidate(struct dentry *);
222 221
223/* only used at mount-time */ 222/* only used at mount-time */
diff --git a/include/linux/delay.h b/include/linux/delay.h
index acb74865b973..17ddb55430ae 100644
--- a/include/linux/delay.h
+++ b/include/linux/delay.h
@@ -25,10 +25,7 @@ extern unsigned long loops_per_jiffy;
25#define MAX_UDELAY_MS 5 25#define MAX_UDELAY_MS 5
26#endif 26#endif
27 27
28#ifdef notdef 28#ifndef mdelay
29#define mdelay(n) (\
30 {unsigned long __ms=(n); while (__ms--) udelay(1000);})
31#else
32#define mdelay(n) (\ 29#define mdelay(n) (\
33 (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \ 30 (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \
34 ({unsigned long __ms=(n); while (__ms--) udelay(1000);})) 31 ({unsigned long __ms=(n); while (__ms--) udelay(1000);}))
diff --git a/include/linux/device.h b/include/linux/device.h
index b2e5da2b637b..1e5f30da98bc 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -60,11 +60,6 @@ extern void bus_unregister(struct bus_type * bus);
60 60
61extern void bus_rescan_devices(struct bus_type * bus); 61extern void bus_rescan_devices(struct bus_type * bus);
62 62
63extern struct bus_type * get_bus(struct bus_type * bus);
64extern void put_bus(struct bus_type * bus);
65
66extern struct bus_type * find_bus(char * name);
67
68/* iterator helpers for buses */ 63/* iterator helpers for buses */
69 64
70int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, 65int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
@@ -147,6 +142,7 @@ struct class {
147 142
148 struct subsystem subsys; 143 struct subsystem subsys;
149 struct list_head children; 144 struct list_head children;
145 struct list_head devices;
150 struct list_head interfaces; 146 struct list_head interfaces;
151 struct semaphore sem; /* locks both the children and interfaces lists */ 147 struct semaphore sem; /* locks both the children and interfaces lists */
152 148
@@ -163,9 +159,6 @@ struct class {
163extern int class_register(struct class *); 159extern int class_register(struct class *);
164extern void class_unregister(struct class *); 160extern void class_unregister(struct class *);
165 161
166extern struct class * class_get(struct class *);
167extern void class_put(struct class *);
168
169 162
170struct class_attribute { 163struct class_attribute {
171 struct attribute attr; 164 struct attribute attr;
@@ -313,6 +306,7 @@ struct device {
313 struct kobject kobj; 306 struct kobject kobj;
314 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 307 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
315 struct device_attribute uevent_attr; 308 struct device_attribute uevent_attr;
309 struct device_attribute *devt_attr;
316 310
317 struct semaphore sem; /* semaphore to synchronize calls to 311 struct semaphore sem; /* semaphore to synchronize calls to
318 * its driver. 312 * its driver.
@@ -340,6 +334,11 @@ struct device {
340 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 334 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
341 override */ 335 override */
342 336
337 /* class_device migration path */
338 struct list_head node;
339 struct class *class; /* optional*/
340 dev_t devt; /* dev_t, creates the sysfs "dev" */
341
343 void (*release)(struct device * dev); 342 void (*release)(struct device * dev);
344}; 343};
345 344
@@ -381,6 +380,13 @@ extern int device_attach(struct device * dev);
381extern void driver_attach(struct device_driver * drv); 380extern void driver_attach(struct device_driver * drv);
382extern void device_reprobe(struct device *dev); 381extern void device_reprobe(struct device *dev);
383 382
383/*
384 * Easy functions for dynamically creating devices on the fly
385 */
386extern struct device *device_create(struct class *cls, struct device *parent,
387 dev_t devt, char *fmt, ...)
388 __attribute__((format(printf,4,5)));
389extern void device_destroy(struct class *cls, dev_t devt);
384 390
385/* 391/*
386 * Platform "fixup" functions - allow the platform to have their say 392 * Platform "fixup" functions - allow the platform to have their say
@@ -410,8 +416,9 @@ extern int firmware_register(struct subsystem *);
410extern void firmware_unregister(struct subsystem *); 416extern void firmware_unregister(struct subsystem *);
411 417
412/* debugging and troubleshooting/diagnostic helpers. */ 418/* debugging and troubleshooting/diagnostic helpers. */
419extern const char *dev_driver_string(struct device *dev);
413#define dev_printk(level, dev, format, arg...) \ 420#define dev_printk(level, dev, format, arg...) \
414 printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg) 421 printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
415 422
416#ifdef DEBUG 423#ifdef DEBUG
417#define dev_dbg(dev, format, arg...) \ 424#define dev_dbg(dev, format, arg...) \
diff --git a/include/linux/efi.h b/include/linux/efi.h
index e203613d3aec..66d621dbcb6c 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -294,6 +294,7 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos
294extern u64 efi_get_iobase (void); 294extern u64 efi_get_iobase (void);
295extern u32 efi_mem_type (unsigned long phys_addr); 295extern u32 efi_mem_type (unsigned long phys_addr);
296extern u64 efi_mem_attributes (unsigned long phys_addr); 296extern u64 efi_mem_attributes (unsigned long phys_addr);
297extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size);
297extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size, 298extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size,
298 u64 attr); 299 u64 attr);
299extern int __init efi_uart_console_only (void); 300extern int __init efi_uart_console_only (void);
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index cf2abeca92a0..c6310aef5ab0 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -411,6 +411,8 @@ struct ethtool_ops {
411#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ 411#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
412#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */ 412#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
413#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */ 413#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
414#define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */
415#define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */
414 416
415/* compatibility with older code */ 417/* compatibility with older code */
416#define SPARC_ETH_GSET ETHTOOL_GSET 418#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2d5a112e8404..2d8b348c1192 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -376,7 +376,8 @@ struct address_space_operations {
376 struct page* (*get_xip_page)(struct address_space *, sector_t, 376 struct page* (*get_xip_page)(struct address_space *, sector_t,
377 int); 377 int);
378 /* migrate the contents of a page to the specified target */ 378 /* migrate the contents of a page to the specified target */
379 int (*migratepage) (struct page *, struct page *); 379 int (*migratepage) (struct address_space *,
380 struct page *, struct page *);
380}; 381};
381 382
382struct backing_dev_info; 383struct backing_dev_info;
@@ -682,6 +683,7 @@ extern spinlock_t files_lock;
682#define FL_FLOCK 2 683#define FL_FLOCK 2
683#define FL_ACCESS 8 /* not trying to lock, just looking */ 684#define FL_ACCESS 8 /* not trying to lock, just looking */
684#define FL_LEASE 32 /* lease held on this file */ 685#define FL_LEASE 32 /* lease held on this file */
686#define FL_CLOSE 64 /* unlock on close */
685#define FL_SLEEP 128 /* A blocking lock */ 687#define FL_SLEEP 128 /* A blocking lock */
686 688
687/* 689/*
@@ -774,7 +776,6 @@ extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_l
774extern int posix_lock_file(struct file *, struct file_lock *); 776extern int posix_lock_file(struct file *, struct file_lock *);
775extern int posix_lock_file_wait(struct file *, struct file_lock *); 777extern int posix_lock_file_wait(struct file *, struct file_lock *);
776extern int posix_unblock_lock(struct file *, struct file_lock *); 778extern int posix_unblock_lock(struct file *, struct file_lock *);
777extern int posix_locks_deadlock(struct file_lock *, struct file_lock *);
778extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 779extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
779extern int __break_lease(struct inode *inode, unsigned int flags); 780extern int __break_lease(struct inode *inode, unsigned int flags);
780extern void lease_get_mtime(struct inode *, struct timespec *time); 781extern void lease_get_mtime(struct inode *, struct timespec *time);
@@ -782,7 +783,6 @@ extern int setlease(struct file *, long, struct file_lock **);
782extern int lease_modify(struct file_lock **, int); 783extern int lease_modify(struct file_lock **, int);
783extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 784extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
784extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 785extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
785extern void steal_locks(fl_owner_t from);
786 786
787struct fasync_struct { 787struct fasync_struct {
788 int magic; 788 int magic;
@@ -1025,7 +1025,7 @@ struct file_operations {
1025 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 1025 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1026 int (*mmap) (struct file *, struct vm_area_struct *); 1026 int (*mmap) (struct file *, struct vm_area_struct *);
1027 int (*open) (struct inode *, struct file *); 1027 int (*open) (struct inode *, struct file *);
1028 int (*flush) (struct file *); 1028 int (*flush) (struct file *, fl_owner_t id);
1029 int (*release) (struct inode *, struct file *); 1029 int (*release) (struct inode *, struct file *);
1030 int (*fsync) (struct file *, struct dentry *, int datasync); 1030 int (*fsync) (struct file *, struct dentry *, int datasync);
1031 int (*aio_fsync) (struct kiocb *, int datasync); 1031 int (*aio_fsync) (struct kiocb *, int datasync);
@@ -1097,7 +1097,7 @@ struct super_operations {
1097 int (*sync_fs)(struct super_block *sb, int wait); 1097 int (*sync_fs)(struct super_block *sb, int wait);
1098 void (*write_super_lockfs) (struct super_block *); 1098 void (*write_super_lockfs) (struct super_block *);
1099 void (*unlockfs) (struct super_block *); 1099 void (*unlockfs) (struct super_block *);
1100 int (*statfs) (struct super_block *, struct kstatfs *); 1100 int (*statfs) (struct dentry *, struct kstatfs *);
1101 int (*remount_fs) (struct super_block *, int *, char *); 1101 int (*remount_fs) (struct super_block *, int *, char *);
1102 void (*clear_inode) (struct inode *); 1102 void (*clear_inode) (struct inode *);
1103 void (*umount_begin) (struct vfsmount *, int); 1103 void (*umount_begin) (struct vfsmount *, int);
@@ -1270,23 +1270,26 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
1270struct file_system_type { 1270struct file_system_type {
1271 const char *name; 1271 const char *name;
1272 int fs_flags; 1272 int fs_flags;
1273 struct super_block *(*get_sb) (struct file_system_type *, int, 1273 int (*get_sb) (struct file_system_type *, int,
1274 const char *, void *); 1274 const char *, void *, struct vfsmount *);
1275 void (*kill_sb) (struct super_block *); 1275 void (*kill_sb) (struct super_block *);
1276 struct module *owner; 1276 struct module *owner;
1277 struct file_system_type * next; 1277 struct file_system_type * next;
1278 struct list_head fs_supers; 1278 struct list_head fs_supers;
1279}; 1279};
1280 1280
1281struct super_block *get_sb_bdev(struct file_system_type *fs_type, 1281extern int get_sb_bdev(struct file_system_type *fs_type,
1282 int flags, const char *dev_name, void *data, 1282 int flags, const char *dev_name, void *data,
1283 int (*fill_super)(struct super_block *, void *, int)); 1283 int (*fill_super)(struct super_block *, void *, int),
1284struct super_block *get_sb_single(struct file_system_type *fs_type, 1284 struct vfsmount *mnt);
1285extern int get_sb_single(struct file_system_type *fs_type,
1285 int flags, void *data, 1286 int flags, void *data,
1286 int (*fill_super)(struct super_block *, void *, int)); 1287 int (*fill_super)(struct super_block *, void *, int),
1287struct super_block *get_sb_nodev(struct file_system_type *fs_type, 1288 struct vfsmount *mnt);
1289extern int get_sb_nodev(struct file_system_type *fs_type,
1288 int flags, void *data, 1290 int flags, void *data,
1289 int (*fill_super)(struct super_block *, void *, int)); 1291 int (*fill_super)(struct super_block *, void *, int),
1292 struct vfsmount *mnt);
1290void generic_shutdown_super(struct super_block *sb); 1293void generic_shutdown_super(struct super_block *sb);
1291void kill_block_super(struct super_block *sb); 1294void kill_block_super(struct super_block *sb);
1292void kill_anon_super(struct super_block *sb); 1295void kill_anon_super(struct super_block *sb);
@@ -1297,8 +1300,10 @@ struct super_block *sget(struct file_system_type *type,
1297 int (*test)(struct super_block *,void *), 1300 int (*test)(struct super_block *,void *),
1298 int (*set)(struct super_block *,void *), 1301 int (*set)(struct super_block *,void *),
1299 void *data); 1302 void *data);
1300struct super_block *get_sb_pseudo(struct file_system_type *, char *, 1303extern int get_sb_pseudo(struct file_system_type *, char *,
1301 struct super_operations *ops, unsigned long); 1304 struct super_operations *ops, unsigned long,
1305 struct vfsmount *mnt);
1306extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1302int __put_super(struct super_block *sb); 1307int __put_super(struct super_block *sb);
1303int __put_super_and_need_restart(struct super_block *sb); 1308int __put_super_and_need_restart(struct super_block *sb);
1304void unnamed_dev_init(void); 1309void unnamed_dev_init(void);
@@ -1321,7 +1326,7 @@ extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
1321extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, 1326extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
1322 struct vfsmount *); 1327 struct vfsmount *);
1323 1328
1324extern int vfs_statfs(struct super_block *, struct kstatfs *); 1329extern int vfs_statfs(struct dentry *, struct kstatfs *);
1325 1330
1326/* /sys/fs */ 1331/* /sys/fs */
1327extern struct subsystem fs_subsys; 1332extern struct subsystem fs_subsys;
@@ -1742,7 +1747,7 @@ extern int dcache_dir_close(struct inode *, struct file *);
1742extern loff_t dcache_dir_lseek(struct file *, loff_t, int); 1747extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
1743extern int dcache_readdir(struct file *, void *, filldir_t); 1748extern int dcache_readdir(struct file *, void *, filldir_t);
1744extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); 1749extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
1745extern int simple_statfs(struct super_block *, struct kstatfs *); 1750extern int simple_statfs(struct dentry *, struct kstatfs *);
1746extern int simple_link(struct dentry *, struct inode *, struct dentry *); 1751extern int simple_link(struct dentry *, struct inode *, struct dentry *);
1747extern int simple_unlink(struct inode *, struct dentry *); 1752extern int simple_unlink(struct inode *, struct dentry *);
1748extern int simple_rmdir(struct inode *, struct dentry *); 1753extern int simple_rmdir(struct inode *, struct dentry *);
@@ -1768,7 +1773,8 @@ extern void simple_release_fs(struct vfsmount **mount, int *count);
1768extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); 1773extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
1769 1774
1770#ifdef CONFIG_MIGRATION 1775#ifdef CONFIG_MIGRATION
1771extern int buffer_migrate_page(struct page *, struct page *); 1776extern int buffer_migrate_page(struct address_space *,
1777 struct page *, struct page *);
1772#else 1778#else
1773#define buffer_migrate_page NULL 1779#define buffer_migrate_page NULL
1774#endif 1780#endif
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index 7fd0576a4454..690c42803d2e 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -4,37 +4,32 @@
4 * Uses for this includes on-device special memory, uncached memory 4 * Uses for this includes on-device special memory, uncached memory
5 * etc. 5 * etc.
6 * 6 *
7 * This code is based on the buddy allocator found in the sym53c8xx_2
8 * driver, adapted for general purpose use.
9 *
10 * This source code is licensed under the GNU General Public License, 7 * This source code is licensed under the GNU General Public License,
11 * Version 2. See the file COPYING for more details. 8 * Version 2. See the file COPYING for more details.
12 */ 9 */
13 10
14#include <linux/spinlock.h>
15 11
16#define ALLOC_MIN_SHIFT 5 /* 32 bytes minimum */
17/* 12/*
18 * Link between free memory chunks of a given size. 13 * General purpose special memory pool descriptor.
19 */ 14 */
20struct gen_pool_link { 15struct gen_pool {
21 struct gen_pool_link *next; 16 rwlock_t lock;
17 struct list_head chunks; /* list of chunks in this pool */
18 int min_alloc_order; /* minimum allocation order */
22}; 19};
23 20
24/* 21/*
25 * Memory pool descriptor. 22 * General purpose special memory pool chunk descriptor.
26 */ 23 */
27struct gen_pool { 24struct gen_pool_chunk {
28 spinlock_t lock; 25 spinlock_t lock;
29 unsigned long (*get_new_chunk)(struct gen_pool *); 26 struct list_head next_chunk; /* next chunk in pool */
30 struct gen_pool *next; 27 unsigned long start_addr; /* starting address of memory chunk */
31 struct gen_pool_link *h; 28 unsigned long end_addr; /* ending address of memory chunk */
32 unsigned long private; 29 unsigned long bits[0]; /* bitmap for allocating memory chunk */
33 int max_chunk_shift;
34}; 30};
35 31
36unsigned long gen_pool_alloc(struct gen_pool *poolp, int size); 32extern struct gen_pool *gen_pool_create(int, int);
37void gen_pool_free(struct gen_pool *mp, unsigned long ptr, int size); 33extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int);
38struct gen_pool *gen_pool_create(int nr_chunks, int max_chunk_shift, 34extern unsigned long gen_pool_alloc(struct gen_pool *, size_t);
39 unsigned long (*fp)(struct gen_pool *), 35extern void gen_pool_free(struct gen_pool *, unsigned long, size_t);
40 unsigned long data);
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index df695e9ae327..4513f9e40937 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -188,7 +188,7 @@ int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr);
188int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); 188int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
189 189
190/* Must be used by hardware driver on module startup/exit */ 190/* Must be used by hardware driver on module startup/exit */
191int register_hdlc_device(struct net_device *dev); 191#define register_hdlc_device(dev) register_netdev(dev)
192void unregister_hdlc_device(struct net_device *dev); 192void unregister_hdlc_device(struct net_device *dev);
193 193
194struct net_device *alloc_hdlcdev(void *priv); 194struct net_device *alloc_hdlcdev(void *priv);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 4c5e610fe442..c25a38d8f600 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -23,6 +23,8 @@ int hugetlb_report_node_meminfo(int, char *);
23unsigned long hugetlb_total_pages(void); 23unsigned long hugetlb_total_pages(void);
24int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, 24int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
25 unsigned long address, int write_access); 25 unsigned long address, int write_access);
26int hugetlb_reserve_pages(struct inode *inode, long from, long to);
27void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
26 28
27extern unsigned long max_huge_pages; 29extern unsigned long max_huge_pages;
28extern const unsigned long hugetlb_zero, hugetlb_infinity; 30extern const unsigned long hugetlb_zero, hugetlb_infinity;
@@ -139,8 +141,6 @@ struct hugetlbfs_sb_info {
139 141
140struct hugetlbfs_inode_info { 142struct hugetlbfs_inode_info {
141 struct shared_policy policy; 143 struct shared_policy policy;
142 /* Protected by the (global) hugetlb_lock */
143 unsigned long prereserved_hpages;
144 struct inode vfs_inode; 144 struct inode vfs_inode;
145}; 145};
146 146
@@ -157,10 +157,6 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
157extern const struct file_operations hugetlbfs_file_operations; 157extern const struct file_operations hugetlbfs_file_operations;
158extern struct vm_operations_struct hugetlb_vm_ops; 158extern struct vm_operations_struct hugetlb_vm_ops;
159struct file *hugetlb_zero_setup(size_t); 159struct file *hugetlb_zero_setup(size_t);
160int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info,
161 unsigned long atleast_hpages);
162void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info,
163 unsigned long atmost_hpages);
164int hugetlb_get_quota(struct address_space *mapping); 160int hugetlb_get_quota(struct address_space *mapping);
165void hugetlb_put_quota(struct address_space *mapping); 161void hugetlb_put_quota(struct address_space *mapping);
166 162
diff --git a/include/linux/i2c-ocores.h b/include/linux/i2c-ocores.h
new file mode 100644
index 000000000000..8ed591b0887e
--- /dev/null
+++ b/include/linux/i2c-ocores.h
@@ -0,0 +1,19 @@
1/*
2 * i2c-ocores.h - definitions for the i2c-ocores interface
3 *
4 * Peter Korsgaard <jacmet@sunsite.dk>
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#ifndef _LINUX_I2C_OCORES_H
12#define _LINUX_I2C_OCORES_H
13
14struct ocores_i2c_platform_data {
15 u32 regstep; /* distance between registers */
16 u32 clock_khz; /* input clock in kHz */
17};
18
19#endif /* _LINUX_I2C_OCORES_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 0510430e00db..526ddc8eecfb 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -97,13 +97,13 @@ extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
97 u8 command, u16 value); 97 u8 command, u16 value);
98extern s32 i2c_smbus_write_block_data(struct i2c_client * client, 98extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
99 u8 command, u8 length, 99 u8 command, u8 length,
100 u8 *values); 100 const u8 *values);
101/* Returns the number of read bytes */ 101/* Returns the number of read bytes */
102extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 102extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
103 u8 command, u8 *values); 103 u8 command, u8 *values);
104extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, 104extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
105 u8 command, u8 length, 105 u8 command, u8 length,
106 u8 *values); 106 const u8 *values);
107 107
108/* 108/*
109 * A driver is capable of handling one or more physical devices present on 109 * A driver is capable of handling one or more physical devices present on
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 9e0fefd7884a..70741e170114 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -7,32 +7,13 @@
7#include <linux/bitops.h> 7#include <linux/bitops.h>
8#include <linux/preempt.h> 8#include <linux/preempt.h>
9#include <linux/cpumask.h> 9#include <linux/cpumask.h>
10#include <linux/irqreturn.h>
10#include <linux/hardirq.h> 11#include <linux/hardirq.h>
11#include <linux/sched.h> 12#include <linux/sched.h>
12#include <asm/atomic.h> 13#include <asm/atomic.h>
13#include <asm/ptrace.h> 14#include <asm/ptrace.h>
14#include <asm/system.h> 15#include <asm/system.h>
15 16
16/*
17 * For 2.4.x compatibility, 2.4.x can use
18 *
19 * typedef void irqreturn_t;
20 * #define IRQ_NONE
21 * #define IRQ_HANDLED
22 * #define IRQ_RETVAL(x)
23 *
24 * To mix old-style and new-style irq handler returns.
25 *
26 * IRQ_NONE means we didn't handle it.
27 * IRQ_HANDLED means that we did have a valid interrupt and handled it.
28 * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled)
29 */
30typedef int irqreturn_t;
31
32#define IRQ_NONE (0)
33#define IRQ_HANDLED (1)
34#define IRQ_RETVAL(x) ((x) != 0)
35
36struct irqaction { 17struct irqaction {
37 irqreturn_t (*handler)(int, void *, struct pt_regs *); 18 irqreturn_t (*handler)(int, void *, struct pt_regs *);
38 unsigned long flags; 19 unsigned long flags;
diff --git a/include/linux/io.h b/include/linux/io.h
index 85533ec5aaa1..420e2fdf26f6 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -21,5 +21,6 @@
21#include <asm/io.h> 21#include <asm/io.h>
22 22
23void __iowrite32_copy(void __iomem *to, const void *from, size_t count); 23void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
24void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
24 25
25#endif /* _LINUX_IO_H */ 26#endif /* _LINUX_IO_H */
diff --git a/include/linux/ioc4.h b/include/linux/ioc4.h
index 3dd18b785ebd..de73a3289cc2 100644
--- a/include/linux/ioc4.h
+++ b/include/linux/ioc4.h
@@ -147,6 +147,10 @@ struct ioc4_misc_regs {
147#define IOC4_GPCR_EDGE_6 0x40 147#define IOC4_GPCR_EDGE_6 0x40
148#define IOC4_GPCR_EDGE_7 0x80 148#define IOC4_GPCR_EDGE_7 0x80
149 149
150#define IOC4_VARIANT_IO9 0x0900
151#define IOC4_VARIANT_PCI_RT 0x0901
152#define IOC4_VARIANT_IO10 0x1000
153
150/* One of these per IOC4 */ 154/* One of these per IOC4 */
151struct ioc4_driver_data { 155struct ioc4_driver_data {
152 struct list_head idd_list; 156 struct list_head idd_list;
@@ -156,6 +160,7 @@ struct ioc4_driver_data {
156 struct __iomem ioc4_misc_regs *idd_misc_regs; 160 struct __iomem ioc4_misc_regs *idd_misc_regs;
157 unsigned long count_period; 161 unsigned long count_period;
158 void *idd_serial_data; 162 void *idd_serial_data;
163 unsigned int idd_variant;
159}; 164};
160 165
161/* One per submodule */ 166/* One per submodule */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 42c9cd562860..676e00dfb21a 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -17,6 +17,7 @@
17#include <linux/cache.h> 17#include <linux/cache.h>
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/cpumask.h> 19#include <linux/cpumask.h>
20#include <linux/irqreturn.h>
20 21
21#include <asm/irq.h> 22#include <asm/irq.h>
22#include <asm/ptrace.h> 23#include <asm/ptrace.h>
@@ -164,10 +165,18 @@ static inline void set_irq_info(int irq, cpumask_t mask)
164 165
165#endif // CONFIG_SMP 166#endif // CONFIG_SMP
166 167
168#ifdef CONFIG_IRQBALANCE
169extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask);
170#else
171static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask)
172{
173}
174#endif
175
167extern int no_irq_affinity; 176extern int no_irq_affinity;
168extern int noirqdebug_setup(char *str); 177extern int noirqdebug_setup(char *str);
169 178
170extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs, 179extern fastcall irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
171 struct irqaction *action); 180 struct irqaction *action);
172extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); 181extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
173extern void note_interrupt(unsigned int irq, irq_desc_t *desc, 182extern void note_interrupt(unsigned int irq, irq_desc_t *desc,
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h
new file mode 100644
index 000000000000..881883c2009d
--- /dev/null
+++ b/include/linux/irqreturn.h
@@ -0,0 +1,25 @@
1/* irqreturn.h */
2#ifndef _LINUX_IRQRETURN_H
3#define _LINUX_IRQRETURN_H
4
5/*
6 * For 2.4.x compatibility, 2.4.x can use
7 *
8 * typedef void irqreturn_t;
9 * #define IRQ_NONE
10 * #define IRQ_HANDLED
11 * #define IRQ_RETVAL(x)
12 *
13 * To mix old-style and new-style irq handler returns.
14 *
15 * IRQ_NONE means we didn't handle it.
16 * IRQ_HANDLED means that we did have a valid interrupt and handled it.
17 * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled)
18 */
19typedef int irqreturn_t;
20
21#define IRQ_NONE (0)
22#define IRQ_HANDLED (1)
23#define IRQ_RETVAL(x) ((x) != 0)
24
25#endif
diff --git a/include/linux/isa.h b/include/linux/isa.h
new file mode 100644
index 000000000000..1b855335cb11
--- /dev/null
+++ b/include/linux/isa.h
@@ -0,0 +1,28 @@
1/*
2 * ISA bus.
3 */
4
5#ifndef __LINUX_ISA_H
6#define __LINUX_ISA_H
7
8#include <linux/device.h>
9#include <linux/kernel.h>
10
11struct isa_driver {
12 int (*match)(struct device *, unsigned int);
13 int (*probe)(struct device *, unsigned int);
14 int (*remove)(struct device *, unsigned int);
15 void (*shutdown)(struct device *, unsigned int);
16 int (*suspend)(struct device *, unsigned int, pm_message_t);
17 int (*resume)(struct device *, unsigned int);
18
19 struct device_driver driver;
20 struct device *devices;
21};
22
23#define to_isa_driver(x) container_of((x), struct isa_driver, driver)
24
25int isa_register_driver(struct isa_driver *, unsigned int);
26void isa_unregister_driver(struct isa_driver *);
27
28#endif /* __LINUX_ISA_H */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 6a425e370cb3..20eb34403d0c 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -501,6 +501,12 @@ struct transaction_s
501 struct journal_head *t_checkpoint_list; 501 struct journal_head *t_checkpoint_list;
502 502
503 /* 503 /*
504 * Doubly-linked circular list of all buffers submitted for IO while
505 * checkpointing. [j_list_lock]
506 */
507 struct journal_head *t_checkpoint_io_list;
508
509 /*
504 * Doubly-linked circular list of temporary buffers currently undergoing 510 * Doubly-linked circular list of temporary buffers currently undergoing
505 * IO in the log [j_list_lock] 511 * IO in the log [j_list_lock]
506 */ 512 */
@@ -849,7 +855,7 @@ extern void journal_commit_transaction(journal_t *);
849 855
850/* Checkpoint list management */ 856/* Checkpoint list management */
851int __journal_clean_checkpoint_list(journal_t *journal); 857int __journal_clean_checkpoint_list(journal_t *journal);
852void __journal_remove_checkpoint(struct journal_head *); 858int __journal_remove_checkpoint(struct journal_head *);
853void __journal_insert_checkpoint(struct journal_head *, transaction_t *); 859void __journal_insert_checkpoint(struct journal_head *, transaction_t *);
854 860
855/* Buffer IO */ 861/* Buffer IO */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f4fc576ed4c4..8c21aaa248b4 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -24,6 +24,9 @@ extern const char linux_banner[];
24#define LONG_MAX ((long)(~0UL>>1)) 24#define LONG_MAX ((long)(~0UL>>1))
25#define LONG_MIN (-LONG_MAX - 1) 25#define LONG_MIN (-LONG_MAX - 1)
26#define ULONG_MAX (~0UL) 26#define ULONG_MAX (~0UL)
27#define LLONG_MAX ((long long)(~0ULL>>1))
28#define LLONG_MIN (-LLONG_MAX - 1)
29#define ULLONG_MAX (~0ULL)
27 30
28#define STACK_MAGIC 0xdeadbeef 31#define STACK_MAGIC 0xdeadbeef
29 32
@@ -75,7 +78,7 @@ extern int cond_resched(void);
75# define might_sleep() do { might_resched(); } while (0) 78# define might_sleep() do { might_resched(); } while (0)
76#endif 79#endif
77 80
78#define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0) 81#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
79 82
80#define abs(x) ({ \ 83#define abs(x) ({ \
81 int __x = (x); \ 84 int __x = (x); \
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index cfb3410e32b1..6427949ddf99 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -106,6 +106,7 @@ extern struct page *kimage_alloc_control_pages(struct kimage *image,
106extern void crash_kexec(struct pt_regs *); 106extern void crash_kexec(struct pt_regs *);
107int kexec_should_crash(struct task_struct *); 107int kexec_should_crash(struct task_struct *);
108extern struct kimage *kexec_image; 108extern struct kimage *kexec_image;
109extern struct kimage *kexec_crash_image;
109 110
110#define KEXEC_ON_CRASH 0x00000001 111#define KEXEC_ON_CRASH 0x00000001
111#define KEXEC_ARCH_MASK 0xffff0000 112#define KEXEC_ARCH_MASK 0xffff0000
diff --git a/include/linux/key.h b/include/linux/key.h
index cbf464ad9589..e81ebf910d0b 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -205,6 +205,11 @@ struct key_type {
205 /* match a key against a description */ 205 /* match a key against a description */
206 int (*match)(const struct key *key, const void *desc); 206 int (*match)(const struct key *key, const void *desc);
207 207
208 /* clear some of the data from a key on revokation (optional)
209 * - the key's semaphore will be write-locked by the caller
210 */
211 void (*revoke)(struct key *key);
212
208 /* clear the data from a key (optional) */ 213 /* clear the data from a key (optional) */
209 void (*destroy)(struct key *key); 214 void (*destroy)(struct key *key);
210 215
@@ -241,8 +246,9 @@ extern void unregister_key_type(struct key_type *ktype);
241 246
242extern struct key *key_alloc(struct key_type *type, 247extern struct key *key_alloc(struct key_type *type,
243 const char *desc, 248 const char *desc,
244 uid_t uid, gid_t gid, key_perm_t perm, 249 uid_t uid, gid_t gid,
245 int not_in_quota); 250 struct task_struct *ctx,
251 key_perm_t perm, int not_in_quota);
246extern int key_payload_reserve(struct key *key, size_t datalen); 252extern int key_payload_reserve(struct key *key, size_t datalen);
247extern int key_instantiate_and_link(struct key *key, 253extern int key_instantiate_and_link(struct key *key,
248 const void *data, 254 const void *data,
@@ -292,7 +298,9 @@ extern int key_unlink(struct key *keyring,
292 struct key *key); 298 struct key *key);
293 299
294extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, 300extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
295 int not_in_quota, struct key *dest); 301 struct task_struct *ctx,
302 int not_in_quota,
303 struct key *dest);
296 304
297extern int keyring_clear(struct key *keyring); 305extern int keyring_clear(struct key *keyring);
298 306
@@ -313,7 +321,8 @@ extern void keyring_replace_payload(struct key *key, void *replacement);
313 * the userspace interface 321 * the userspace interface
314 */ 322 */
315extern struct key root_user_keyring, root_session_keyring; 323extern struct key root_user_keyring, root_session_keyring;
316extern int alloc_uid_keyring(struct user_struct *user); 324extern int alloc_uid_keyring(struct user_struct *user,
325 struct task_struct *ctx);
317extern void switch_uid_keyring(struct user_struct *new_user); 326extern void switch_uid_keyring(struct user_struct *new_user);
318extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); 327extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk);
319extern int copy_thread_group_keys(struct task_struct *tsk); 328extern int copy_thread_group_keys(struct task_struct *tsk);
@@ -342,7 +351,7 @@ extern void key_init(void);
342#define make_key_ref(k) ({ NULL; }) 351#define make_key_ref(k) ({ NULL; })
343#define key_ref_to_ptr(k) ({ NULL; }) 352#define key_ref_to_ptr(k) ({ NULL; })
344#define is_key_possessed(k) 0 353#define is_key_possessed(k) 0
345#define alloc_uid_keyring(u) 0 354#define alloc_uid_keyring(u,c) 0
346#define switch_uid_keyring(u) do { } while(0) 355#define switch_uid_keyring(u) do { } while(0)
347#define __install_session_keyring(t, k) ({ NULL; }) 356#define __install_session_keyring(t, k) ({ NULL; })
348#define copy_keys(f,t) 0 357#define copy_keys(f,t) 0
@@ -355,6 +364,10 @@ extern void key_init(void);
355#define key_fsgid_changed(t) do { } while(0) 364#define key_fsgid_changed(t) do { } while(0)
356#define key_init() do { } while(0) 365#define key_init() do { } while(0)
357 366
367/* Initial keyrings */
368extern struct key root_user_keyring;
369extern struct key root_session_keyring;
370
358#endif /* CONFIG_KEYS */ 371#endif /* CONFIG_KEYS */
359#endif /* __KERNEL__ */ 372#endif /* __KERNEL__ */
360#endif /* _LINUX_KEY_H */ 373#endif /* _LINUX_KEY_H */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index c187c53cecd0..2d229327959e 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -190,6 +190,8 @@ struct subsystem _varname##_subsys = { \
190 190
191/* The global /sys/kernel/ subsystem for people to chain off of */ 191/* The global /sys/kernel/ subsystem for people to chain off of */
192extern struct subsystem kernel_subsys; 192extern struct subsystem kernel_subsys;
193/* The global /sys/hypervisor/ subsystem */
194extern struct subsystem hypervisor_subsys;
193 195
194/** 196/**
195 * Helpers for setting the kset of registered objects. 197 * Helpers for setting the kset of registered objects.
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b80d2e7fa6d2..20b1cf527c60 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -33,6 +33,7 @@
33#include <asm/io.h> 33#include <asm/io.h>
34#include <linux/ata.h> 34#include <linux/ata.h>
35#include <linux/workqueue.h> 35#include <linux/workqueue.h>
36#include <scsi/scsi_host.h>
36 37
37/* 38/*
38 * compile-time options: to be removed as soon as all the drivers are 39 * compile-time options: to be removed as soon as all the drivers are
@@ -44,7 +45,6 @@
44#undef ATA_NDEBUG /* define to disable quick runtime checks */ 45#undef ATA_NDEBUG /* define to disable quick runtime checks */
45#undef ATA_ENABLE_PATA /* define to enable PATA support in some 46#undef ATA_ENABLE_PATA /* define to enable PATA support in some
46 * low-level drivers */ 47 * low-level drivers */
47#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
48 48
49 49
50/* note: prints function name for you */ 50/* note: prints function name for you */
@@ -108,8 +108,11 @@ enum {
108 LIBATA_MAX_PRD = ATA_MAX_PRD / 2, 108 LIBATA_MAX_PRD = ATA_MAX_PRD / 2,
109 ATA_MAX_PORTS = 8, 109 ATA_MAX_PORTS = 8,
110 ATA_DEF_QUEUE = 1, 110 ATA_DEF_QUEUE = 1,
111 ATA_MAX_QUEUE = 1, 111 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */
112 ATA_MAX_QUEUE = 32,
113 ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1,
112 ATA_MAX_SECTORS = 200, /* FIXME */ 114 ATA_MAX_SECTORS = 200, /* FIXME */
115 ATA_MAX_SECTORS_LBA48 = 65535,
113 ATA_MAX_BUS = 2, 116 ATA_MAX_BUS = 2,
114 ATA_DEF_BUSY_WAIT = 10000, 117 ATA_DEF_BUSY_WAIT = 10000,
115 ATA_SHORT_PAUSE = (HZ >> 6) + 1, 118 ATA_SHORT_PAUSE = (HZ >> 6) + 1,
@@ -120,9 +123,17 @@ enum {
120 ATA_SHT_USE_CLUSTERING = 1, 123 ATA_SHT_USE_CLUSTERING = 1,
121 124
122 /* struct ata_device stuff */ 125 /* struct ata_device stuff */
123 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ 126 ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */
124 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ 127 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */
125 ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */ 128 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */
129 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */
130 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
131
132 ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */
133 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,
134
135 ATA_DFLAG_DETACH = (1 << 16),
136 ATA_DFLAG_DETACHED = (1 << 17),
126 137
127 ATA_DEV_UNKNOWN = 0, /* unknown device */ 138 ATA_DEV_UNKNOWN = 0, /* unknown device */
128 ATA_DEV_ATA = 1, /* ATA device */ 139 ATA_DEV_ATA = 1, /* ATA device */
@@ -132,43 +143,57 @@ enum {
132 ATA_DEV_NONE = 5, /* no device */ 143 ATA_DEV_NONE = 5, /* no device */
133 144
134 /* struct ata_port flags */ 145 /* struct ata_port flags */
135 ATA_FLAG_SLAVE_POSS = (1 << 1), /* host supports slave dev */ 146 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */
136 /* (doesn't imply presence) */ 147 /* (doesn't imply presence) */
137 ATA_FLAG_PORT_DISABLED = (1 << 2), /* port is disabled, ignore it */ 148 ATA_FLAG_SATA = (1 << 1),
138 ATA_FLAG_SATA = (1 << 3), 149 ATA_FLAG_NO_LEGACY = (1 << 2), /* no legacy mode check */
139 ATA_FLAG_NO_LEGACY = (1 << 4), /* no legacy mode check */ 150 ATA_FLAG_MMIO = (1 << 3), /* use MMIO, not PIO */
140 ATA_FLAG_SRST = (1 << 5), /* (obsolete) use ATA SRST, not E.D.D. */ 151 ATA_FLAG_SRST = (1 << 4), /* (obsolete) use ATA SRST, not E.D.D. */
141 ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ 152 ATA_FLAG_SATA_RESET = (1 << 5), /* (obsolete) use COMRESET */
142 ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */ 153 ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */
143 ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ 154 ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */
144 ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once 155 ATA_FLAG_PIO_LBA48 = (1 << 8), /* Host DMA engine is LBA28 only */
145 * proper HSM is in place. */ 156 ATA_FLAG_PIO_POLLING = (1 << 9), /* use polling PIO if LLD
146 ATA_FLAG_DEBUGMSG = (1 << 10), 157 * doesn't handle PIO interrupts */
147 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ 158 ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */
148 159 ATA_FLAG_HRST_TO_RESUME = (1 << 11), /* hardreset to resume phy */
149 ATA_FLAG_SUSPENDED = (1 << 12), /* port is suspended */ 160 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H
150 161 * Register FIS clearing BSY */
151 ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ 162
152 ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ 163 ATA_FLAG_DEBUGMSG = (1 << 13),
153 164 ATA_FLAG_FLUSH_PORT_TASK = (1 << 14), /* flush port task */
154 ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* Flush port task */ 165
155 ATA_FLAG_IN_EH = (1 << 16), /* EH in progress */ 166 ATA_FLAG_EH_PENDING = (1 << 15), /* EH pending */
156 167 ATA_FLAG_EH_IN_PROGRESS = (1 << 16), /* EH in progress */
157 ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ 168 ATA_FLAG_FROZEN = (1 << 17), /* port is frozen */
158 ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ 169 ATA_FLAG_RECOVERED = (1 << 18), /* recovery action performed */
159 ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ 170 ATA_FLAG_LOADING = (1 << 19), /* boot/loading probe */
171 ATA_FLAG_UNLOADING = (1 << 20), /* module is unloading */
172 ATA_FLAG_SCSI_HOTPLUG = (1 << 21), /* SCSI hotplug scheduled */
173
174 ATA_FLAG_DISABLED = (1 << 22), /* port is disabled, ignore it */
175 ATA_FLAG_SUSPENDED = (1 << 23), /* port is suspended (power) */
176
177 /* bits 24:31 of ap->flags are reserved for LLDD specific flags */
178
179 /* struct ata_queued_cmd flags */
180 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
181 ATA_QCFLAG_SG = (1 << 1), /* have s/g table? */
182 ATA_QCFLAG_SINGLE = (1 << 2), /* no s/g, just a single buffer */
160 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, 183 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE,
161 ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ 184 ATA_QCFLAG_IO = (1 << 3), /* standard IO command */
185 ATA_QCFLAG_RESULT_TF = (1 << 4), /* result TF requested */
186
187 ATA_QCFLAG_FAILED = (1 << 16), /* cmd failed and is owned by EH */
188 ATA_QCFLAG_SENSE_VALID = (1 << 17), /* sense data valid */
189 ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */
162 190
163 /* host set flags */ 191 /* host set flags */
164 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ 192 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */
165 193
166 /* various lengths of time */ 194 /* various lengths of time */
167 ATA_TMOUT_PIO = 30 * HZ,
168 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 195 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
169 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 196 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
170 ATA_TMOUT_CDB = 30 * HZ,
171 ATA_TMOUT_CDB_QUICK = 5 * HZ,
172 ATA_TMOUT_INTERNAL = 30 * HZ, 197 ATA_TMOUT_INTERNAL = 30 * HZ,
173 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ, 198 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
174 199
@@ -207,21 +232,56 @@ enum {
207 /* size of buffer to pad xfers ending on unaligned boundaries */ 232 /* size of buffer to pad xfers ending on unaligned boundaries */
208 ATA_DMA_PAD_SZ = 4, 233 ATA_DMA_PAD_SZ = 4,
209 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE, 234 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE,
210 235
211 /* Masks for port functions */ 236 /* masks for port functions */
212 ATA_PORT_PRIMARY = (1 << 0), 237 ATA_PORT_PRIMARY = (1 << 0),
213 ATA_PORT_SECONDARY = (1 << 1), 238 ATA_PORT_SECONDARY = (1 << 1),
239
240 /* ering size */
241 ATA_ERING_SIZE = 32,
242
243 /* desc_len for ata_eh_info and context */
244 ATA_EH_DESC_LEN = 80,
245
246 /* reset / recovery action types */
247 ATA_EH_REVALIDATE = (1 << 0),
248 ATA_EH_SOFTRESET = (1 << 1),
249 ATA_EH_HARDRESET = (1 << 2),
250
251 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
252 ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE,
253
254 /* ata_eh_info->flags */
255 ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
256
257 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */
258
259 /* max repeat if error condition is still set after ->error_handler */
260 ATA_EH_MAX_REPEAT = 5,
261
262 /* how hard are we gonna try to probe/recover devices */
263 ATA_PROBE_MAX_TRIES = 3,
264 ATA_EH_RESET_TRIES = 3,
265 ATA_EH_DEV_TRIES = 3,
266
267 /* Drive spinup time (time from power-on to the first D2H FIS)
268 * in msecs - 8s currently. Failing to get ready in this time
269 * isn't critical. It will result in reset failure for
270 * controllers which can't wait for the first D2H FIS. libata
271 * will retry, so it just has to be long enough to spin up
272 * most devices.
273 */
274 ATA_SPINUP_WAIT = 8000,
214}; 275};
215 276
216enum hsm_task_states { 277enum hsm_task_states {
217 HSM_ST_UNKNOWN, 278 HSM_ST_UNKNOWN, /* state unknown */
218 HSM_ST_IDLE, 279 HSM_ST_IDLE, /* no command on going */
219 HSM_ST_POLL, 280 HSM_ST, /* (waiting the device to) transfer data */
220 HSM_ST_TMOUT, 281 HSM_ST_LAST, /* (waiting the device to) complete command */
221 HSM_ST, 282 HSM_ST_ERR, /* error */
222 HSM_ST_LAST, 283 HSM_ST_FIRST, /* (waiting the device to)
223 HSM_ST_LAST_POLL, 284 write CDB or first data block */
224 HSM_ST_ERR,
225}; 285};
226 286
227enum ata_completion_errors { 287enum ata_completion_errors {
@@ -244,9 +304,9 @@ struct ata_queued_cmd;
244 304
245/* typedefs */ 305/* typedefs */
246typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); 306typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
247typedef void (*ata_probeinit_fn_t)(struct ata_port *); 307typedef int (*ata_prereset_fn_t)(struct ata_port *ap);
248typedef int (*ata_reset_fn_t)(struct ata_port *, int, unsigned int *); 308typedef int (*ata_reset_fn_t)(struct ata_port *ap, unsigned int *classes);
249typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *); 309typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *classes);
250 310
251struct ata_ioports { 311struct ata_ioports {
252 unsigned long cmd_addr; 312 unsigned long cmd_addr;
@@ -297,7 +357,8 @@ struct ata_host_set {
297 unsigned long flags; 357 unsigned long flags;
298 int simplex_claimed; /* Keep seperate in case we 358 int simplex_claimed; /* Keep seperate in case we
299 ever need to do this locked */ 359 ever need to do this locked */
300 struct ata_port * ports[0]; 360 struct ata_host_set *next; /* for legacy mode */
361 struct ata_port *ports[0];
301}; 362};
302 363
303struct ata_queued_cmd { 364struct ata_queued_cmd {
@@ -336,7 +397,7 @@ struct ata_queued_cmd {
336 struct scatterlist *__sg; 397 struct scatterlist *__sg;
337 398
338 unsigned int err_mask; 399 unsigned int err_mask;
339 400 struct ata_taskfile result_tf;
340 ata_qc_cb_t complete_fn; 401 ata_qc_cb_t complete_fn;
341 402
342 void *private_data; 403 void *private_data;
@@ -348,12 +409,26 @@ struct ata_host_stats {
348 unsigned long rw_reqbuf; 409 unsigned long rw_reqbuf;
349}; 410};
350 411
412struct ata_ering_entry {
413 int is_io;
414 unsigned int err_mask;
415 u64 timestamp;
416};
417
418struct ata_ering {
419 int cursor;
420 struct ata_ering_entry ring[ATA_ERING_SIZE];
421};
422
351struct ata_device { 423struct ata_device {
352 u64 n_sectors; /* size of device, if ATA */ 424 struct ata_port *ap;
425 unsigned int devno; /* 0 or 1 */
353 unsigned long flags; /* ATA_DFLAG_xxx */ 426 unsigned long flags; /* ATA_DFLAG_xxx */
427 struct scsi_device *sdev; /* attached SCSI device */
428 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
429 u64 n_sectors; /* size of device, if ATA */
354 unsigned int class; /* ATA_DEV_xxx */ 430 unsigned int class; /* ATA_DEV_xxx */
355 unsigned int devno; /* 0 or 1 */ 431 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
356 u16 *id; /* IDENTIFY xxx DEVICE data */
357 u8 pio_mode; 432 u8 pio_mode;
358 u8 dma_mode; 433 u8 dma_mode;
359 u8 xfer_mode; 434 u8 xfer_mode;
@@ -373,11 +448,42 @@ struct ata_device {
373 u16 cylinders; /* Number of cylinders */ 448 u16 cylinders; /* Number of cylinders */
374 u16 heads; /* Number of heads */ 449 u16 heads; /* Number of heads */
375 u16 sectors; /* Number of sectors per track */ 450 u16 sectors; /* Number of sectors per track */
451
452 /* error history */
453 struct ata_ering ering;
454};
455
456/* Offset into struct ata_device. Fields above it are maintained
457 * acress device init. Fields below are zeroed.
458 */
459#define ATA_DEVICE_CLEAR_OFFSET offsetof(struct ata_device, n_sectors)
460
461struct ata_eh_info {
462 struct ata_device *dev; /* offending device */
463 u32 serror; /* SError from LLDD */
464 unsigned int err_mask; /* port-wide err_mask */
465 unsigned int action; /* ATA_EH_* action mask */
466 unsigned int dev_action[ATA_MAX_DEVICES]; /* dev EH action */
467 unsigned int flags; /* ATA_EHI_* flags */
468
469 unsigned long hotplug_timestamp;
470 unsigned int probe_mask;
471
472 char desc[ATA_EH_DESC_LEN];
473 int desc_len;
474};
475
476struct ata_eh_context {
477 struct ata_eh_info i;
478 int tries[ATA_MAX_DEVICES];
479 unsigned int classes[ATA_MAX_DEVICES];
480 unsigned int did_probe_mask;
376}; 481};
377 482
378struct ata_port { 483struct ata_port {
379 struct Scsi_Host *host; /* our co-allocated scsi host */ 484 struct Scsi_Host *host; /* our co-allocated scsi host */
380 const struct ata_port_operations *ops; 485 const struct ata_port_operations *ops;
486 spinlock_t *lock;
381 unsigned long flags; /* ATA_FLAG_xxx */ 487 unsigned long flags; /* ATA_FLAG_xxx */
382 unsigned int id; /* unique id req'd by scsi midlyr */ 488 unsigned int id; /* unique id req'd by scsi midlyr */
383 unsigned int port_no; /* unique port #; from zero */ 489 unsigned int port_no; /* unique port #; from zero */
@@ -397,26 +503,40 @@ struct ata_port {
397 unsigned int mwdma_mask; 503 unsigned int mwdma_mask;
398 unsigned int udma_mask; 504 unsigned int udma_mask;
399 unsigned int cbl; /* cable type; ATA_CBL_xxx */ 505 unsigned int cbl; /* cable type; ATA_CBL_xxx */
506 unsigned int hw_sata_spd_limit;
507 unsigned int sata_spd_limit; /* SATA PHY speed limit */
508
509 /* record runtime error info, protected by host_set lock */
510 struct ata_eh_info eh_info;
511 /* EH context owned by EH */
512 struct ata_eh_context eh_context;
400 513
401 struct ata_device device[ATA_MAX_DEVICES]; 514 struct ata_device device[ATA_MAX_DEVICES];
402 515
403 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE]; 516 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE];
404 unsigned long qactive; 517 unsigned long qc_allocated;
518 unsigned int qc_active;
519
405 unsigned int active_tag; 520 unsigned int active_tag;
521 u32 sactive;
406 522
407 struct ata_host_stats stats; 523 struct ata_host_stats stats;
408 struct ata_host_set *host_set; 524 struct ata_host_set *host_set;
409 struct device *dev; 525 struct device *dev;
410 526
411 struct work_struct port_task; 527 struct work_struct port_task;
528 struct work_struct hotplug_task;
529 struct work_struct scsi_rescan_task;
412 530
413 unsigned int hsm_task_state; 531 unsigned int hsm_task_state;
414 unsigned long pio_task_timeout;
415 532
416 u32 msg_enable; 533 u32 msg_enable;
417 struct list_head eh_done_q; 534 struct list_head eh_done_q;
535 wait_queue_head_t eh_wait_q;
418 536
419 void *private_data; 537 void *private_data;
538
539 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
420}; 540};
421 541
422struct ata_port_operations { 542struct ata_port_operations {
@@ -438,7 +558,6 @@ struct ata_port_operations {
438 558
439 void (*phy_reset) (struct ata_port *ap); /* obsolete */ 559 void (*phy_reset) (struct ata_port *ap); /* obsolete */
440 void (*set_mode) (struct ata_port *ap); 560 void (*set_mode) (struct ata_port *ap);
441 int (*probe_reset) (struct ata_port *ap, unsigned int *classes);
442 561
443 void (*post_set_mode) (struct ata_port *ap); 562 void (*post_set_mode) (struct ata_port *ap);
444 563
@@ -447,10 +566,20 @@ struct ata_port_operations {
447 void (*bmdma_setup) (struct ata_queued_cmd *qc); 566 void (*bmdma_setup) (struct ata_queued_cmd *qc);
448 void (*bmdma_start) (struct ata_queued_cmd *qc); 567 void (*bmdma_start) (struct ata_queued_cmd *qc);
449 568
569 void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int);
570
450 void (*qc_prep) (struct ata_queued_cmd *qc); 571 void (*qc_prep) (struct ata_queued_cmd *qc);
451 unsigned int (*qc_issue) (struct ata_queued_cmd *qc); 572 unsigned int (*qc_issue) (struct ata_queued_cmd *qc);
452 573
453 void (*eng_timeout) (struct ata_port *ap); 574 /* Error handlers. ->error_handler overrides ->eng_timeout and
575 * indicates that new-style EH is in place.
576 */
577 void (*eng_timeout) (struct ata_port *ap); /* obsolete */
578
579 void (*freeze) (struct ata_port *ap);
580 void (*thaw) (struct ata_port *ap);
581 void (*error_handler) (struct ata_port *ap);
582 void (*post_internal_cmd) (struct ata_queued_cmd *qc);
454 583
455 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); 584 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *);
456 void (*irq_clear) (struct ata_port *); 585 void (*irq_clear) (struct ata_port *);
@@ -492,22 +621,22 @@ struct ata_timing {
492 621
493#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) 622#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin)
494 623
624extern const unsigned long sata_deb_timing_boot[];
625extern const unsigned long sata_deb_timing_eh[];
626extern const unsigned long sata_deb_timing_before_fsrst[];
627
495extern void ata_port_probe(struct ata_port *); 628extern void ata_port_probe(struct ata_port *);
496extern void __sata_phy_reset(struct ata_port *ap); 629extern void __sata_phy_reset(struct ata_port *ap);
497extern void sata_phy_reset(struct ata_port *ap); 630extern void sata_phy_reset(struct ata_port *ap);
498extern void ata_bus_reset(struct ata_port *ap); 631extern void ata_bus_reset(struct ata_port *ap);
499extern int ata_drive_probe_reset(struct ata_port *ap, 632extern int sata_set_spd(struct ata_port *ap);
500 ata_probeinit_fn_t probeinit, 633extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param);
501 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 634extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param);
502 ata_postreset_fn_t postreset, unsigned int *classes); 635extern int ata_std_prereset(struct ata_port *ap);
503extern void ata_std_probeinit(struct ata_port *ap); 636extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
504extern int ata_std_softreset(struct ata_port *ap, int verbose, 637extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
505 unsigned int *classes);
506extern int sata_std_hardreset(struct ata_port *ap, int verbose,
507 unsigned int *class);
508extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 638extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
509extern int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev, 639extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
510 int post_reset);
511extern void ata_port_disable(struct ata_port *); 640extern void ata_port_disable(struct ata_port *);
512extern void ata_std_ports(struct ata_ioports *ioaddr); 641extern void ata_std_ports(struct ata_ioports *ioaddr);
513#ifdef CONFIG_PCI 642#ifdef CONFIG_PCI
@@ -519,24 +648,32 @@ extern int ata_pci_device_resume(struct pci_dev *pdev);
519extern int ata_pci_clear_simplex(struct pci_dev *pdev); 648extern int ata_pci_clear_simplex(struct pci_dev *pdev);
520#endif /* CONFIG_PCI */ 649#endif /* CONFIG_PCI */
521extern int ata_device_add(const struct ata_probe_ent *ent); 650extern int ata_device_add(const struct ata_probe_ent *ent);
651extern void ata_port_detach(struct ata_port *ap);
522extern void ata_host_set_remove(struct ata_host_set *host_set); 652extern void ata_host_set_remove(struct ata_host_set *host_set);
523extern int ata_scsi_detect(struct scsi_host_template *sht); 653extern int ata_scsi_detect(struct scsi_host_template *sht);
524extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 654extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
525extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 655extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
526extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
527extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
528extern int ata_scsi_release(struct Scsi_Host *host); 656extern int ata_scsi_release(struct Scsi_Host *host);
529extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 657extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
658extern int sata_scr_valid(struct ata_port *ap);
659extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val);
660extern int sata_scr_write(struct ata_port *ap, int reg, u32 val);
661extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val);
662extern int ata_port_online(struct ata_port *ap);
663extern int ata_port_offline(struct ata_port *ap);
530extern int ata_scsi_device_resume(struct scsi_device *); 664extern int ata_scsi_device_resume(struct scsi_device *);
531extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); 665extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
532extern int ata_device_resume(struct ata_port *, struct ata_device *); 666extern int ata_device_resume(struct ata_device *);
533extern int ata_device_suspend(struct ata_port *, struct ata_device *, pm_message_t state); 667extern int ata_device_suspend(struct ata_device *, pm_message_t state);
534extern int ata_ratelimit(void); 668extern int ata_ratelimit(void);
535extern unsigned int ata_busy_sleep(struct ata_port *ap, 669extern unsigned int ata_busy_sleep(struct ata_port *ap,
536 unsigned long timeout_pat, 670 unsigned long timeout_pat,
537 unsigned long timeout); 671 unsigned long timeout);
538extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), 672extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *),
539 void *data, unsigned long delay); 673 void *data, unsigned long delay);
674extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
675 unsigned long interval_msec,
676 unsigned long timeout_msec);
540 677
541/* 678/*
542 * Default driver ops implementations 679 * Default driver ops implementations
@@ -550,11 +687,16 @@ extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
550extern u8 ata_check_status(struct ata_port *ap); 687extern u8 ata_check_status(struct ata_port *ap);
551extern u8 ata_altstatus(struct ata_port *ap); 688extern u8 ata_altstatus(struct ata_port *ap);
552extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); 689extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
553extern int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes);
554extern int ata_port_start (struct ata_port *ap); 690extern int ata_port_start (struct ata_port *ap);
555extern void ata_port_stop (struct ata_port *ap); 691extern void ata_port_stop (struct ata_port *ap);
556extern void ata_host_stop (struct ata_host_set *host_set); 692extern void ata_host_stop (struct ata_host_set *host_set);
557extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); 693extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
694extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf,
695 unsigned int buflen, int write_data);
696extern void ata_pio_data_xfer(struct ata_device *adev, unsigned char *buf,
697 unsigned int buflen, int write_data);
698extern void ata_pio_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
699 unsigned int buflen, int write_data);
558extern void ata_qc_prep(struct ata_queued_cmd *qc); 700extern void ata_qc_prep(struct ata_queued_cmd *qc);
559extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 701extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
560extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); 702extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc);
@@ -572,17 +714,29 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc);
572extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 714extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
573extern u8 ata_bmdma_status(struct ata_port *ap); 715extern u8 ata_bmdma_status(struct ata_port *ap);
574extern void ata_bmdma_irq_clear(struct ata_port *ap); 716extern void ata_bmdma_irq_clear(struct ata_port *ap);
575extern void __ata_qc_complete(struct ata_queued_cmd *qc); 717extern void ata_bmdma_freeze(struct ata_port *ap);
576extern void ata_eng_timeout(struct ata_port *ap); 718extern void ata_bmdma_thaw(struct ata_port *ap);
577extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, 719extern void ata_bmdma_drive_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
578 struct scsi_cmnd *cmd, 720 ata_reset_fn_t softreset,
721 ata_reset_fn_t hardreset,
722 ata_postreset_fn_t postreset);
723extern void ata_bmdma_error_handler(struct ata_port *ap);
724extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc);
725extern int ata_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
726 u8 status, int in_wq);
727extern void ata_qc_complete(struct ata_queued_cmd *qc);
728extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active,
729 void (*finish_qc)(struct ata_queued_cmd *));
730extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
579 void (*done)(struct scsi_cmnd *)); 731 void (*done)(struct scsi_cmnd *));
580extern int ata_std_bios_param(struct scsi_device *sdev, 732extern int ata_std_bios_param(struct scsi_device *sdev,
581 struct block_device *bdev, 733 struct block_device *bdev,
582 sector_t capacity, int geom[]); 734 sector_t capacity, int geom[]);
583extern int ata_scsi_slave_config(struct scsi_device *sdev); 735extern int ata_scsi_slave_config(struct scsi_device *sdev);
584extern struct ata_device *ata_dev_pair(struct ata_port *ap, 736extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
585 struct ata_device *adev); 737extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
738 int queue_depth);
739extern struct ata_device *ata_dev_pair(struct ata_device *adev);
586 740
587/* 741/*
588 * Timing helpers 742 * Timing helpers
@@ -628,7 +782,64 @@ extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bit
628extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long); 782extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long);
629#endif /* CONFIG_PCI */ 783#endif /* CONFIG_PCI */
630 784
785/*
786 * EH
787 */
788extern void ata_eng_timeout(struct ata_port *ap);
789
790extern void ata_port_schedule_eh(struct ata_port *ap);
791extern int ata_port_abort(struct ata_port *ap);
792extern int ata_port_freeze(struct ata_port *ap);
793
794extern void ata_eh_freeze_port(struct ata_port *ap);
795extern void ata_eh_thaw_port(struct ata_port *ap);
796
797extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
798extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
799
800extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset,
801 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
802 ata_postreset_fn_t postreset);
803
804/*
805 * printk helpers
806 */
807#define ata_port_printk(ap, lv, fmt, args...) \
808 printk(lv"ata%u: "fmt, (ap)->id , ##args)
809
810#define ata_dev_printk(dev, lv, fmt, args...) \
811 printk(lv"ata%u.%02u: "fmt, (dev)->ap->id, (dev)->devno , ##args)
812
813/*
814 * ata_eh_info helpers
815 */
816#define ata_ehi_push_desc(ehi, fmt, args...) do { \
817 (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \
818 ATA_EH_DESC_LEN - (ehi)->desc_len, \
819 fmt , ##args); \
820} while (0)
821
822#define ata_ehi_clear_desc(ehi) do { \
823 (ehi)->desc[0] = '\0'; \
824 (ehi)->desc_len = 0; \
825} while (0)
826
827static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
828{
829 if (ehi->flags & ATA_EHI_HOTPLUGGED)
830 return;
831
832 ehi->flags |= ATA_EHI_HOTPLUGGED;
833 ehi->hotplug_timestamp = jiffies;
631 834
835 ehi->err_mask |= AC_ERR_ATA_BUS;
836 ehi->action |= ATA_EH_SOFTRESET;
837 ehi->probe_mask |= (1 << ATA_MAX_DEVICES) - 1;
838}
839
840/*
841 * qc helpers
842 */
632static inline int 843static inline int
633ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc) 844ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
634{ 845{
@@ -671,14 +882,39 @@ static inline unsigned int ata_tag_valid(unsigned int tag)
671 return (tag < ATA_MAX_QUEUE) ? 1 : 0; 882 return (tag < ATA_MAX_QUEUE) ? 1 : 0;
672} 883}
673 884
674static inline unsigned int ata_class_present(unsigned int class) 885static inline unsigned int ata_tag_internal(unsigned int tag)
886{
887 return tag == ATA_MAX_QUEUE - 1;
888}
889
890static inline unsigned int ata_class_enabled(unsigned int class)
675{ 891{
676 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; 892 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI;
677} 893}
678 894
679static inline unsigned int ata_dev_present(const struct ata_device *dev) 895static inline unsigned int ata_class_disabled(unsigned int class)
680{ 896{
681 return ata_class_present(dev->class); 897 return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP;
898}
899
900static inline unsigned int ata_class_absent(unsigned int class)
901{
902 return !ata_class_enabled(class) && !ata_class_disabled(class);
903}
904
905static inline unsigned int ata_dev_enabled(const struct ata_device *dev)
906{
907 return ata_class_enabled(dev->class);
908}
909
910static inline unsigned int ata_dev_disabled(const struct ata_device *dev)
911{
912 return ata_class_disabled(dev->class);
913}
914
915static inline unsigned int ata_dev_absent(const struct ata_device *dev)
916{
917 return ata_class_absent(dev->class);
682} 918}
683 919
684static inline u8 ata_chk_status(struct ata_port *ap) 920static inline u8 ata_chk_status(struct ata_port *ap)
@@ -759,20 +995,35 @@ static inline void ata_qc_set_polling(struct ata_queued_cmd *qc)
759 qc->tf.ctl |= ATA_NIEN; 995 qc->tf.ctl |= ATA_NIEN;
760} 996}
761 997
762static inline struct ata_queued_cmd *ata_qc_from_tag (struct ata_port *ap, 998static inline struct ata_queued_cmd *__ata_qc_from_tag(struct ata_port *ap,
763 unsigned int tag) 999 unsigned int tag)
764{ 1000{
765 if (likely(ata_tag_valid(tag))) 1001 if (likely(ata_tag_valid(tag)))
766 return &ap->qcmd[tag]; 1002 return &ap->qcmd[tag];
767 return NULL; 1003 return NULL;
768} 1004}
769 1005
770static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, unsigned int device) 1006static inline struct ata_queued_cmd *ata_qc_from_tag(struct ata_port *ap,
1007 unsigned int tag)
1008{
1009 struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
1010
1011 if (unlikely(!qc) || !ap->ops->error_handler)
1012 return qc;
1013
1014 if ((qc->flags & (ATA_QCFLAG_ACTIVE |
1015 ATA_QCFLAG_FAILED)) == ATA_QCFLAG_ACTIVE)
1016 return qc;
1017
1018 return NULL;
1019}
1020
1021static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
771{ 1022{
772 memset(tf, 0, sizeof(*tf)); 1023 memset(tf, 0, sizeof(*tf));
773 1024
774 tf->ctl = ap->ctl; 1025 tf->ctl = dev->ap->ctl;
775 if (device == 0) 1026 if (dev->devno == 0)
776 tf->device = ATA_DEVICE_OBS; 1027 tf->device = ATA_DEVICE_OBS;
777 else 1028 else
778 tf->device = ATA_DEVICE_OBS | ATA_DEV1; 1029 tf->device = ATA_DEVICE_OBS | ATA_DEV1;
@@ -787,26 +1038,11 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
787 qc->nbytes = qc->curbytes = 0; 1038 qc->nbytes = qc->curbytes = 0;
788 qc->err_mask = 0; 1039 qc->err_mask = 0;
789 1040
790 ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); 1041 ata_tf_init(qc->dev, &qc->tf);
791}
792
793/**
794 * ata_qc_complete - Complete an active ATA command
795 * @qc: Command to complete
796 * @err_mask: ATA Status register contents
797 *
798 * Indicate to the mid and upper layers that an ATA
799 * command has completed, with either an ok or not-ok status.
800 *
801 * LOCKING:
802 * spin_lock_irqsave(host_set lock)
803 */
804static inline void ata_qc_complete(struct ata_queued_cmd *qc)
805{
806 if (unlikely(qc->flags & ATA_QCFLAG_EH_SCHEDULED))
807 return;
808 1042
809 __ata_qc_complete(qc); 1043 /* init result_tf such that it indicates normal completion */
1044 qc->result_tf.command = ATA_DRDY;
1045 qc->result_tf.feature = 0;
810} 1046}
811 1047
812/** 1048/**
@@ -885,28 +1121,6 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
885 return status; 1121 return status;
886} 1122}
887 1123
888static inline u32 scr_read(struct ata_port *ap, unsigned int reg)
889{
890 return ap->ops->scr_read(ap, reg);
891}
892
893static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val)
894{
895 ap->ops->scr_write(ap, reg, val);
896}
897
898static inline void scr_write_flush(struct ata_port *ap, unsigned int reg,
899 u32 val)
900{
901 ap->ops->scr_write(ap, reg, val);
902 (void) ap->ops->scr_read(ap, reg);
903}
904
905static inline unsigned int sata_dev_present(struct ata_port *ap)
906{
907 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
908}
909
910static inline int ata_try_flush_cache(const struct ata_device *dev) 1124static inline int ata_try_flush_cache(const struct ata_device *dev)
911{ 1125{
912 return ata_id_wcache_enabled(dev->id) || 1126 return ata_id_wcache_enabled(dev->id) ||
@@ -916,7 +1130,7 @@ static inline int ata_try_flush_cache(const struct ata_device *dev)
916 1130
917static inline unsigned int ac_err_mask(u8 status) 1131static inline unsigned int ac_err_mask(u8 status)
918{ 1132{
919 if (status & ATA_BUSY) 1133 if (status & (ATA_BUSY | ATA_DRQ))
920 return AC_ERR_HSM; 1134 return AC_ERR_HSM;
921 if (status & (ATA_ERR | ATA_DF)) 1135 if (status & (ATA_ERR | ATA_DF))
922 return AC_ERR_DEV; 1136 return AC_ERR_DEV;
@@ -944,4 +1158,9 @@ static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
944 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma); 1158 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
945} 1159}
946 1160
1161static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
1162{
1163 return (struct ata_port *) &host->hostdata[0];
1164}
1165
947#endif /* __LINUX_LIBATA_H__ */ 1166#endif /* __LINUX_LIBATA_H__ */
diff --git a/include/linux/list.h b/include/linux/list.h
index 76f05718342c..a02642e4710a 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -197,12 +197,35 @@ static inline void list_del_rcu(struct list_head *entry)
197 entry->prev = LIST_POISON2; 197 entry->prev = LIST_POISON2;
198} 198}
199 199
200/**
201 * list_replace - replace old entry by new one
202 * @old : the element to be replaced
203 * @new : the new element to insert
204 * Note: if 'old' was empty, it will be overwritten.
205 */
206static inline void list_replace(struct list_head *old,
207 struct list_head *new)
208{
209 new->next = old->next;
210 new->next->prev = new;
211 new->prev = old->prev;
212 new->prev->next = new;
213}
214
215static inline void list_replace_init(struct list_head *old,
216 struct list_head *new)
217{
218 list_replace(old, new);
219 INIT_LIST_HEAD(old);
220}
221
200/* 222/*
201 * list_replace_rcu - replace old entry by new one 223 * list_replace_rcu - replace old entry by new one
202 * @old : the element to be replaced 224 * @old : the element to be replaced
203 * @new : the new element to insert 225 * @new : the new element to insert
204 * 226 *
205 * The old entry will be replaced with the new entry atomically. 227 * The old entry will be replaced with the new entry atomically.
228 * Note: 'old' should not be empty.
206 */ 229 */
207static inline void list_replace_rcu(struct list_head *old, 230static inline void list_replace_rcu(struct list_head *old,
208 struct list_head *new) 231 struct list_head *new)
diff --git a/include/linux/m41t00.h b/include/linux/m41t00.h
new file mode 100644
index 000000000000..b423360ca38e
--- /dev/null
+++ b/include/linux/m41t00.h
@@ -0,0 +1,50 @@
1/*
2 * Definitions for the ST M41T00 family of i2c rtc chips.
3 *
4 * Author: Mark A. Greer <mgreer@mvista.com>
5 *
6 * 2005, 2006 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#ifndef _M41T00_H
13#define _M41T00_H
14
15#define M41T00_DRV_NAME "m41t00"
16#define M41T00_I2C_ADDR 0x68
17
18#define M41T00_TYPE_M41T00 0
19#define M41T00_TYPE_M41T81 81
20#define M41T00_TYPE_M41T85 85
21
22struct m41t00_platform_data {
23 u8 type;
24 u8 i2c_addr;
25 u8 sqw_freq;
26};
27
28/* SQW output disabled, this is default value by power on */
29#define M41T00_SQW_DISABLE (0)
30
31#define M41T00_SQW_32KHZ (1<<4) /* 32.768 KHz */
32#define M41T00_SQW_8KHZ (2<<4) /* 8.192 KHz */
33#define M41T00_SQW_4KHZ (3<<4) /* 4.096 KHz */
34#define M41T00_SQW_2KHZ (4<<4) /* 2.048 KHz */
35#define M41T00_SQW_1KHZ (5<<4) /* 1.024 KHz */
36#define M41T00_SQW_512HZ (6<<4) /* 512 Hz */
37#define M41T00_SQW_256HZ (7<<4) /* 256 Hz */
38#define M41T00_SQW_128HZ (8<<4) /* 128 Hz */
39#define M41T00_SQW_64HZ (9<<4) /* 64 Hz */
40#define M41T00_SQW_32HZ (10<<4) /* 32 Hz */
41#define M41T00_SQW_16HZ (11<<4) /* 16 Hz */
42#define M41T00_SQW_8HZ (12<<4) /* 8 Hz */
43#define M41T00_SQW_4HZ (13<<4) /* 4 Hz */
44#define M41T00_SQW_2HZ (14<<4) /* 2 Hz */
45#define M41T00_SQW_1HZ (15<<4) /* 1 Hz */
46
47extern ulong m41t00_get_rtc_time(void);
48extern int m41t00_set_rtc_time(ulong nowtime);
49
50#endif /* _M41T00_H */
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 6789c4940c9c..5dba23a1c0d0 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -3,17 +3,17 @@
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5 5
6typedef struct page *new_page_t(struct page *, unsigned long private, int **);
7
6#ifdef CONFIG_MIGRATION 8#ifdef CONFIG_MIGRATION
7extern int isolate_lru_page(struct page *p, struct list_head *pagelist); 9extern int isolate_lru_page(struct page *p, struct list_head *pagelist);
8extern int putback_lru_pages(struct list_head *l); 10extern int putback_lru_pages(struct list_head *l);
9extern int migrate_page(struct page *, struct page *); 11extern int migrate_page(struct address_space *,
10extern void migrate_page_copy(struct page *, struct page *); 12 struct page *, struct page *);
11extern int migrate_page_remove_references(struct page *, struct page *, int); 13extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long);
12extern int migrate_pages(struct list_head *l, struct list_head *t, 14
13 struct list_head *moved, struct list_head *failed); 15extern int fail_migrate_page(struct address_space *,
14extern int migrate_pages_to(struct list_head *pagelist, 16 struct page *, struct page *);
15 struct vm_area_struct *vma, int dest);
16extern int fail_migrate_page(struct page *, struct page *);
17 17
18extern int migrate_prep(void); 18extern int migrate_prep(void);
19 19
@@ -22,8 +22,8 @@ extern int migrate_prep(void);
22static inline int isolate_lru_page(struct page *p, struct list_head *list) 22static inline int isolate_lru_page(struct page *p, struct list_head *list)
23 { return -ENOSYS; } 23 { return -ENOSYS; }
24static inline int putback_lru_pages(struct list_head *l) { return 0; } 24static inline int putback_lru_pages(struct list_head *l) { return 0; }
25static inline int migrate_pages(struct list_head *l, struct list_head *t, 25static inline int migrate_pages(struct list_head *l, new_page_t x,
26 struct list_head *moved, struct list_head *failed) { return -ENOSYS; } 26 unsigned long private) { return -ENOSYS; }
27 27
28static inline int migrate_pages_to(struct list_head *pagelist, 28static inline int migrate_pages_to(struct list_head *pagelist,
29 struct vm_area_struct *vma, int dest) { return 0; } 29 struct vm_area_struct *vma, int dest) { return 0; }
diff --git a/include/linux/mm.h b/include/linux/mm.h
index e2fa375e478e..3b09444121d9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -199,6 +199,10 @@ struct vm_operations_struct {
199 void (*close)(struct vm_area_struct * area); 199 void (*close)(struct vm_area_struct * area);
200 struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); 200 struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type);
201 int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); 201 int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock);
202
203 /* notification that a previously read-only page is about to become
204 * writable, if an error is returned it will cause a SIGBUS */
205 int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page);
202#ifdef CONFIG_NUMA 206#ifdef CONFIG_NUMA
203 int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); 207 int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new);
204 struct mempolicy *(*get_policy)(struct vm_area_struct *vma, 208 struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
@@ -465,10 +469,13 @@ static inline unsigned long page_zonenum(struct page *page)
465struct zone; 469struct zone;
466extern struct zone *zone_table[]; 470extern struct zone *zone_table[];
467 471
472static inline int page_zone_id(struct page *page)
473{
474 return (page->flags >> ZONETABLE_PGSHIFT) & ZONETABLE_MASK;
475}
468static inline struct zone *page_zone(struct page *page) 476static inline struct zone *page_zone(struct page *page)
469{ 477{
470 return zone_table[(page->flags >> ZONETABLE_PGSHIFT) & 478 return zone_table[page_zone_id(page)];
471 ZONETABLE_MASK];
472} 479}
473 480
474static inline unsigned long page_to_nid(struct page *page) 481static inline unsigned long page_to_nid(struct page *page)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 9742e3c16222..d6120fa69116 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -197,7 +197,7 @@ struct zone {
197 197
198 /* 198 /*
199 * wait_table -- the array holding the hash table 199 * wait_table -- the array holding the hash table
200 * wait_table_size -- the size of the hash table array 200 * wait_table_hash_nr_entries -- the size of the hash table array
201 * wait_table_bits -- wait_table_size == (1 << wait_table_bits) 201 * wait_table_bits -- wait_table_size == (1 << wait_table_bits)
202 * 202 *
203 * The purpose of all these is to keep track of the people 203 * The purpose of all these is to keep track of the people
@@ -220,7 +220,7 @@ struct zone {
220 * free_area_init_core() performs the initialization of them. 220 * free_area_init_core() performs the initialization of them.
221 */ 221 */
222 wait_queue_head_t * wait_table; 222 wait_queue_head_t * wait_table;
223 unsigned long wait_table_size; 223 unsigned long wait_table_hash_nr_entries;
224 unsigned long wait_table_bits; 224 unsigned long wait_table_bits;
225 225
226 /* 226 /*
@@ -333,6 +333,9 @@ void wakeup_kswapd(struct zone *zone, int order);
333int zone_watermark_ok(struct zone *z, int order, unsigned long mark, 333int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
334 int classzone_idx, int alloc_flags); 334 int classzone_idx, int alloc_flags);
335 335
336extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
337 unsigned long size);
338
336#ifdef CONFIG_HAVE_MEMORY_PRESENT 339#ifdef CONFIG_HAVE_MEMORY_PRESENT
337void memory_present(int nid, unsigned long start, unsigned long end); 340void memory_present(int nid, unsigned long start, unsigned long end);
338#else 341#else
@@ -506,6 +509,10 @@ struct mem_section {
506 * pages. However, it is stored with some other magic. 509 * pages. However, it is stored with some other magic.
507 * (see sparse.c::sparse_init_one_section()) 510 * (see sparse.c::sparse_init_one_section())
508 * 511 *
512 * Additionally during early boot we encode node id of
513 * the location of the section here to guide allocation.
514 * (see sparse.c::memory_present())
515 *
509 * Making it a UL at least makes someone do a cast 516 * Making it a UL at least makes someone do a cast
510 * before using it wrong. 517 * before using it wrong.
511 */ 518 */
@@ -545,6 +552,7 @@ extern int __section_nr(struct mem_section* ms);
545#define SECTION_HAS_MEM_MAP (1UL<<1) 552#define SECTION_HAS_MEM_MAP (1UL<<1)
546#define SECTION_MAP_LAST_BIT (1UL<<2) 553#define SECTION_MAP_LAST_BIT (1UL<<2)
547#define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1)) 554#define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1))
555#define SECTION_NID_SHIFT 2
548 556
549static inline struct page *__section_mem_map_addr(struct mem_section *section) 557static inline struct page *__section_mem_map_addr(struct mem_section *section)
550{ 558{
diff --git a/include/linux/module.h b/include/linux/module.h
index c2d89e037af0..2d366098eab5 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -105,6 +105,8 @@ extern struct module __this_module;
105 * "GPL and additional rights" [GNU Public License v2 rights and more] 105 * "GPL and additional rights" [GNU Public License v2 rights and more]
106 * "Dual BSD/GPL" [GNU Public License v2 106 * "Dual BSD/GPL" [GNU Public License v2
107 * or BSD license choice] 107 * or BSD license choice]
108 * "Dual MIT/GPL" [GNU Public License v2
109 * or MIT license choice]
108 * "Dual MPL/GPL" [GNU Public License v2 110 * "Dual MPL/GPL" [GNU Public License v2
109 * or Mozilla license choice] 111 * or Mozilla license choice]
110 * 112 *
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 9b4e0071b92e..403d1a97c512 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -17,6 +17,11 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20struct super_block;
21struct vfsmount;
22struct dentry;
23struct namespace;
24
20#define MNT_NOSUID 0x01 25#define MNT_NOSUID 0x01
21#define MNT_NODEV 0x02 26#define MNT_NODEV 0x02
22#define MNT_NOEXEC 0x04 27#define MNT_NOEXEC 0x04
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5e8e2d50429a..bc747e5d7138 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -232,6 +232,7 @@ enum netdev_state_t
232 __LINK_STATE_RX_SCHED, 232 __LINK_STATE_RX_SCHED,
233 __LINK_STATE_LINKWATCH_PENDING, 233 __LINK_STATE_LINKWATCH_PENDING,
234 __LINK_STATE_DORMANT, 234 __LINK_STATE_DORMANT,
235 __LINK_STATE_QDISC_RUNNING,
235}; 236};
236 237
237 238
@@ -307,9 +308,13 @@ struct net_device
307#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ 308#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
308#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ 309#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
309#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ 310#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
310#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ 311#define NETIF_F_GSO 2048 /* Enable software GSO. */
311#define NETIF_F_LLTX 4096 /* LockLess TX */ 312#define NETIF_F_LLTX 4096 /* LockLess TX */
312#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ 313
314 /* Segmentation offload features */
315#define NETIF_F_GSO_SHIFT 16
316#define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
317#define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT)
313 318
314#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) 319#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
315#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) 320#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
@@ -401,6 +406,9 @@ struct net_device
401 struct list_head qdisc_list; 406 struct list_head qdisc_list;
402 unsigned long tx_queue_len; /* Max frames per queue allowed */ 407 unsigned long tx_queue_len; /* Max frames per queue allowed */
403 408
409 /* Partially transmitted GSO packet. */
410 struct sk_buff *gso_skb;
411
404 /* ingress path synchronizer */ 412 /* ingress path synchronizer */
405 spinlock_t ingress_lock; 413 spinlock_t ingress_lock;
406 struct Qdisc *qdisc_ingress; 414 struct Qdisc *qdisc_ingress;
@@ -535,6 +543,7 @@ struct packet_type {
535 struct net_device *, 543 struct net_device *,
536 struct packet_type *, 544 struct packet_type *,
537 struct net_device *); 545 struct net_device *);
546 struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg);
538 void *af_packet_priv; 547 void *af_packet_priv;
539 struct list_head list; 548 struct list_head list;
540}; 549};
@@ -685,7 +694,8 @@ extern int dev_change_name(struct net_device *, char *);
685extern int dev_set_mtu(struct net_device *, int); 694extern int dev_set_mtu(struct net_device *, int);
686extern int dev_set_mac_address(struct net_device *, 695extern int dev_set_mac_address(struct net_device *,
687 struct sockaddr *); 696 struct sockaddr *);
688extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev); 697extern int dev_hard_start_xmit(struct sk_buff *skb,
698 struct net_device *dev);
689 699
690extern void dev_init(void); 700extern void dev_init(void);
691 701
@@ -959,6 +969,7 @@ extern int netdev_max_backlog;
959extern int weight_p; 969extern int weight_p;
960extern int netdev_set_master(struct net_device *dev, struct net_device *master); 970extern int netdev_set_master(struct net_device *dev, struct net_device *master);
961extern int skb_checksum_help(struct sk_buff *skb, int inward); 971extern int skb_checksum_help(struct sk_buff *skb, int inward);
972extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg);
962#ifdef CONFIG_BUG 973#ifdef CONFIG_BUG
963extern void netdev_rx_csum_fault(struct net_device *dev); 974extern void netdev_rx_csum_fault(struct net_device *dev);
964#else 975#else
@@ -978,6 +989,13 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
978 989
979extern void linkwatch_run_queue(void); 990extern void linkwatch_run_queue(void);
980 991
992static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
993{
994 int feature = skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT;
995 return skb_shinfo(skb)->gso_size &&
996 (dev->features & feature) != feature;
997}
998
981#endif /* __KERNEL__ */ 999#endif /* __KERNEL__ */
982 1000
983#endif /* _LINUX_DEV_H */ 1001#endif /* _LINUX_DEV_H */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 87b8a5703ebc..855b44668caa 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -5,7 +5,7 @@
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7#define NETLINK_ROUTE 0 /* Routing/device hook */ 7#define NETLINK_ROUTE 0 /* Routing/device hook */
8#define NETLINK_W1 1 /* 1-wire subsystem */ 8#define NETLINK_UNUSED 1 /* Unused number */
9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ 9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
10#define NETLINK_FIREWALL 3 /* Firewalling hook */ 10#define NETLINK_FIREWALL 3 /* Firewalling hook */
11#define NETLINK_INET_DIAG 4 /* INET socket monitoring */ 11#define NETLINK_INET_DIAG 4 /* INET socket monitoring */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index d276a4e2f825..0c076d58c676 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -7,6 +7,8 @@
7 7
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9#include <linux/cache.h> 9#include <linux/cache.h>
10#include <linux/types.h>
11
10#include <asm/pgtable.h> 12#include <asm/pgtable.h>
11 13
12/* 14/*
@@ -88,7 +90,17 @@
88#define PG_nosave_free 18 /* Free, should not be written */ 90#define PG_nosave_free 18 /* Free, should not be written */
89#define PG_buddy 19 /* Page is free, on buddy lists */ 91#define PG_buddy 19 /* Page is free, on buddy lists */
90 92
91#define PG_uncached 20 /* Page has been mapped as uncached */ 93
94#if (BITS_PER_LONG > 32)
95/*
96 * 64-bit-only flags build down from bit 31
97 *
98 * 32 bit -------------------------------| FIELDS | FLAGS |
99 * 64 bit | FIELDS | ?????? FLAGS |
100 * 63 32 0
101 */
102#define PG_uncached 31 /* Page has been mapped as uncached */
103#endif
92 104
93/* 105/*
94 * Global page accounting. One instance per CPU. Only unsigned longs are 106 * Global page accounting. One instance per CPU. Only unsigned longs are
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 7a1af574dedf..1245df7141aa 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -99,6 +99,13 @@ extern struct page * read_cache_page(struct address_space *mapping,
99extern int read_cache_pages(struct address_space *mapping, 99extern int read_cache_pages(struct address_space *mapping,
100 struct list_head *pages, filler_t *filler, void *data); 100 struct list_head *pages, filler_t *filler, void *data);
101 101
102static inline struct page *read_mapping_page(struct address_space *mapping,
103 unsigned long index, void *data)
104{
105 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
106 return read_cache_page(mapping, index, filler, data);
107}
108
102int add_to_page_cache(struct page *page, struct address_space *mapping, 109int add_to_page_cache(struct page *page, struct address_space *mapping,
103 unsigned long index, gfp_t gfp_mask); 110 unsigned long index, gfp_t gfp_mask);
104int add_to_page_cache_lru(struct page *page, struct address_space *mapping, 111int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 6c4bc773f7b7..62a8c22f5f60 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -162,6 +162,9 @@ struct pci_dev {
162 unsigned int is_busmaster:1; /* device is busmaster */ 162 unsigned int is_busmaster:1; /* device is busmaster */
163 unsigned int no_msi:1; /* device may not use msi */ 163 unsigned int no_msi:1; /* device may not use msi */
164 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ 164 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
165 unsigned int broken_parity_status:1; /* Device generates false positive parity */
166 unsigned int msi_enabled:1;
167 unsigned int msix_enabled:1;
165 168
166 u32 saved_config_space[16]; /* config space saved at suspend time */ 169 u32 saved_config_space[16]; /* config space saved at suspend time */
167 struct hlist_head saved_cap_space; 170 struct hlist_head saved_cap_space;
@@ -496,6 +499,7 @@ int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
496int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); 499int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
497void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); 500void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
498int pci_assign_resource(struct pci_dev *dev, int i); 501int pci_assign_resource(struct pci_dev *dev, int i);
502int pci_assign_resource_fixed(struct pci_dev *dev, int i);
499void pci_restore_bars(struct pci_dev *dev); 503void pci_restore_bars(struct pci_dev *dev);
500 504
501/* ROM control related routines */ 505/* ROM control related routines */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index bcfe9d4f56ae..c2fd2d19938b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -352,8 +352,11 @@
352#define PCI_DEVICE_ID_ATI_RS480 0x5950 352#define PCI_DEVICE_ID_ATI_RS480 0x5950
353/* ATI IXP Chipset */ 353/* ATI IXP Chipset */
354#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 354#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
355#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
356#define PCI_DEVICE_ID_ATI_IXP300_SMBUS 0x4363
355#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369 357#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369
356#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e 358#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e
359#define PCI_DEVICE_ID_ATI_IXP400_SMBUS 0x4372
357#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 360#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376
358#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 361#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
359#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a 362#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
@@ -848,7 +851,12 @@
848 851
849 852
850#define PCI_VENDOR_ID_QLOGIC 0x1077 853#define PCI_VENDOR_ID_QLOGIC 0x1077
854#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016
851#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 855#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
856#define PCI_DEVICE_ID_QLOGIC_ISP1080 0x1080
857#define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216
858#define PCI_DEVICE_ID_QLOGIC_ISP1240 0x1240
859#define PCI_DEVICE_ID_QLOGIC_ISP1280 0x1280
852#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 860#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100
853#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 861#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200
854#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 862#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300
@@ -1018,6 +1026,7 @@
1018#define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056 1026#define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056
1019#define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057 1027#define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057
1020#define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 1028#define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059
1029#define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d
1021#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 1030#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064
1022#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 1031#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065
1023#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066 1032#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066
@@ -1127,9 +1136,11 @@
1127#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 1136#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258
1128#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 1137#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259
1129#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B 1138#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B
1139#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SMBUS 0x0264
1130#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 1140#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
1131#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 1141#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
1132#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 1142#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
1143#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SMBUS 0x0368
1133#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E 1144#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E
1134#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E 1145#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E
1135#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F 1146#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F
@@ -1185,8 +1196,12 @@
1185#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1196#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1186#define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5 1197#define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5
1187#define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6 1198#define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6
1199#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7
1200#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE 0x03EC
1188#define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE 1201#define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE
1189#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF 1202#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF
1203#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6
1204#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7
1190#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 1205#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450
1191#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 1206#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
1192#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 1207#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
@@ -1244,6 +1259,7 @@
1244#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 1259#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259
1245#define PCI_DEVICE_ID_VIA_3269_0 0x0269 1260#define PCI_DEVICE_ID_VIA_3269_0 0x0269
1246#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 1261#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282
1262#define PCI_DEVICE_ID_VIA_3296_0 0x0296
1247#define PCI_DEVICE_ID_VIA_8363_0 0x0305 1263#define PCI_DEVICE_ID_VIA_8363_0 0x0305
1248#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314 1264#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314
1249#define PCI_DEVICE_ID_VIA_8371_0 0x0391 1265#define PCI_DEVICE_ID_VIA_8371_0 0x0391
@@ -1251,6 +1267,7 @@
1251#define PCI_DEVICE_ID_VIA_82C561 0x0561 1267#define PCI_DEVICE_ID_VIA_82C561 0x0561
1252#define PCI_DEVICE_ID_VIA_82C586_1 0x0571 1268#define PCI_DEVICE_ID_VIA_82C586_1 0x0571
1253#define PCI_DEVICE_ID_VIA_82C576 0x0576 1269#define PCI_DEVICE_ID_VIA_82C576 0x0576
1270#define PCI_DEVICE_ID_VIA_SATA_EIDE 0x0581
1254#define PCI_DEVICE_ID_VIA_82C586_0 0x0586 1271#define PCI_DEVICE_ID_VIA_82C586_0 0x0586
1255#define PCI_DEVICE_ID_VIA_82C596 0x0596 1272#define PCI_DEVICE_ID_VIA_82C596 0x0596
1256#define PCI_DEVICE_ID_VIA_82C597_0 0x0597 1273#define PCI_DEVICE_ID_VIA_82C597_0 0x0597
@@ -1291,10 +1308,11 @@
1291#define PCI_DEVICE_ID_VIA_8783_0 0x3208 1308#define PCI_DEVICE_ID_VIA_8783_0 0x3208
1292#define PCI_DEVICE_ID_VIA_8237 0x3227 1309#define PCI_DEVICE_ID_VIA_8237 0x3227
1293#define PCI_DEVICE_ID_VIA_8251 0x3287 1310#define PCI_DEVICE_ID_VIA_8251 0x3287
1294#define PCI_DEVICE_ID_VIA_3296_0 0x0296 1311#define PCI_DEVICE_ID_VIA_8237A 0x3337
1295#define PCI_DEVICE_ID_VIA_8231 0x8231 1312#define PCI_DEVICE_ID_VIA_8231 0x8231
1296#define PCI_DEVICE_ID_VIA_8231_4 0x8235 1313#define PCI_DEVICE_ID_VIA_8231_4 0x8235
1297#define PCI_DEVICE_ID_VIA_8365_1 0x8305 1314#define PCI_DEVICE_ID_VIA_8365_1 0x8305
1315#define PCI_DEVICE_ID_VIA_CX700 0x8324
1298#define PCI_DEVICE_ID_VIA_8371_1 0x8391 1316#define PCI_DEVICE_ID_VIA_8371_1 0x8391
1299#define PCI_DEVICE_ID_VIA_82C598_1 0x8598 1317#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
1300#define PCI_DEVICE_ID_VIA_838X_1 0xB188 1318#define PCI_DEVICE_ID_VIA_838X_1 0xB188
@@ -1946,6 +1964,7 @@
1946 1964
1947#define PCI_VENDOR_ID_MELLANOX 0x15b3 1965#define PCI_VENDOR_ID_MELLANOX 0x15b3
1948#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 1966#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44
1967#define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46
1949#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 1968#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278
1950#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 1969#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282
1951#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c 1970#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c
@@ -1969,6 +1988,9 @@
1969#define PCI_VENDOR_ID_NETCELL 0x169c 1988#define PCI_VENDOR_ID_NETCELL 0x169c
1970#define PCI_DEVICE_ID_REVOLUTION 0x0044 1989#define PCI_DEVICE_ID_REVOLUTION 0x0044
1971 1990
1991#define PCI_VENDOR_ID_VITESSE 0x1725
1992#define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174
1993
1972#define PCI_VENDOR_ID_LINKSYS 0x1737 1994#define PCI_VENDOR_ID_LINKSYS 0x1737
1973#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 1995#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
1974 1996
@@ -2148,6 +2170,7 @@
2148#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 2170#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815
2149#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e 2171#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
2150#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 2172#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
2173#define PCI_DEVICE_ID_INTEL_GD31244 0x3200
2151#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2174#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2152#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2175#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2153#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2176#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index d27a78b71297..6bce4a240364 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -197,6 +197,7 @@
197#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ 197#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
198#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ 198#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
199#define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ 199#define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */
200#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */
200#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ 201#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
201#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ 202#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
202#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ 203#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 66b5de404f22..f5aa593ccf32 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -10,13 +10,14 @@
10#include <linux/smp.h> 10#include <linux/smp.h>
11#include <linux/threads.h> 11#include <linux/threads.h>
12#include <linux/percpu.h> 12#include <linux/percpu.h>
13#include <linux/types.h>
13 14
14#ifdef CONFIG_SMP 15#ifdef CONFIG_SMP
15 16
16struct percpu_counter { 17struct percpu_counter {
17 spinlock_t lock; 18 spinlock_t lock;
18 long count; 19 s64 count;
19 long *counters; 20 s32 *counters;
20}; 21};
21 22
22#if NR_CPUS >= 16 23#if NR_CPUS >= 16
@@ -25,11 +26,11 @@ struct percpu_counter {
25#define FBC_BATCH (NR_CPUS*4) 26#define FBC_BATCH (NR_CPUS*4)
26#endif 27#endif
27 28
28static inline void percpu_counter_init(struct percpu_counter *fbc) 29static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount)
29{ 30{
30 spin_lock_init(&fbc->lock); 31 spin_lock_init(&fbc->lock);
31 fbc->count = 0; 32 fbc->count = amount;
32 fbc->counters = alloc_percpu(long); 33 fbc->counters = alloc_percpu(s32);
33} 34}
34 35
35static inline void percpu_counter_destroy(struct percpu_counter *fbc) 36static inline void percpu_counter_destroy(struct percpu_counter *fbc)
@@ -37,10 +38,10 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc)
37 free_percpu(fbc->counters); 38 free_percpu(fbc->counters);
38} 39}
39 40
40void percpu_counter_mod(struct percpu_counter *fbc, long amount); 41void percpu_counter_mod(struct percpu_counter *fbc, s32 amount);
41long percpu_counter_sum(struct percpu_counter *fbc); 42s64 percpu_counter_sum(struct percpu_counter *fbc);
42 43
43static inline long percpu_counter_read(struct percpu_counter *fbc) 44static inline s64 percpu_counter_read(struct percpu_counter *fbc)
44{ 45{
45 return fbc->count; 46 return fbc->count;
46} 47}
@@ -48,13 +49,14 @@ static inline long percpu_counter_read(struct percpu_counter *fbc)
48/* 49/*
49 * It is possible for the percpu_counter_read() to return a small negative 50 * It is possible for the percpu_counter_read() to return a small negative
50 * number for some counter which should never be negative. 51 * number for some counter which should never be negative.
52 *
51 */ 53 */
52static inline long percpu_counter_read_positive(struct percpu_counter *fbc) 54static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
53{ 55{
54 long ret = fbc->count; 56 s64 ret = fbc->count;
55 57
56 barrier(); /* Prevent reloads of fbc->count */ 58 barrier(); /* Prevent reloads of fbc->count */
57 if (ret > 0) 59 if (ret >= 0)
58 return ret; 60 return ret;
59 return 1; 61 return 1;
60} 62}
@@ -62,12 +64,12 @@ static inline long percpu_counter_read_positive(struct percpu_counter *fbc)
62#else 64#else
63 65
64struct percpu_counter { 66struct percpu_counter {
65 long count; 67 s64 count;
66}; 68};
67 69
68static inline void percpu_counter_init(struct percpu_counter *fbc) 70static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount)
69{ 71{
70 fbc->count = 0; 72 fbc->count = amount;
71} 73}
72 74
73static inline void percpu_counter_destroy(struct percpu_counter *fbc) 75static inline void percpu_counter_destroy(struct percpu_counter *fbc)
@@ -75,24 +77,24 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc)
75} 77}
76 78
77static inline void 79static inline void
78percpu_counter_mod(struct percpu_counter *fbc, long amount) 80percpu_counter_mod(struct percpu_counter *fbc, s32 amount)
79{ 81{
80 preempt_disable(); 82 preempt_disable();
81 fbc->count += amount; 83 fbc->count += amount;
82 preempt_enable(); 84 preempt_enable();
83} 85}
84 86
85static inline long percpu_counter_read(struct percpu_counter *fbc) 87static inline s64 percpu_counter_read(struct percpu_counter *fbc)
86{ 88{
87 return fbc->count; 89 return fbc->count;
88} 90}
89 91
90static inline long percpu_counter_read_positive(struct percpu_counter *fbc) 92static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
91{ 93{
92 return fbc->count; 94 return fbc->count;
93} 95}
94 96
95static inline long percpu_counter_sum(struct percpu_counter *fbc) 97static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
96{ 98{
97 return percpu_counter_read_positive(fbc); 99 return percpu_counter_read_positive(fbc);
98} 100}
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index bf022c43a18e..52a9be41250d 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -52,4 +52,11 @@
52#define PR_SET_NAME 15 /* Set process name */ 52#define PR_SET_NAME 15 /* Set process name */
53#define PR_GET_NAME 16 /* Get process name */ 53#define PR_GET_NAME 16 /* Get process name */
54 54
55/* Get/set process endian */
56#define PR_GET_ENDIAN 19
57#define PR_SET_ENDIAN 20
58# define PR_ENDIAN_BIG 0
59# define PR_ENDIAN_LITTLE 1 /* True little endian mode */
60# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
61
55#endif /* _LINUX_PRCTL_H */ 62#endif /* _LINUX_PRCTL_H */
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 0d36750fc0f1..ee918bc6e18c 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -51,6 +51,10 @@
51#ifdef __KERNEL__ 51#ifdef __KERNEL__
52/* 52/*
53 * Ptrace flags 53 * Ptrace flags
54 *
55 * The owner ship rules for task->ptrace which holds the ptrace
56 * flags is simple. When a task is running it owns it's task->ptrace
57 * flags. When the a task is stopped the ptracer owns task->ptrace.
54 */ 58 */
55 59
56#define PT_PTRACED 0x00000001 60#define PT_PTRACED 0x00000001
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index dd83cca28001..9158a68140c9 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -23,6 +23,9 @@
23#include <linux/preempt.h> 23#include <linux/preempt.h>
24#include <linux/types.h> 24#include <linux/types.h>
25 25
26#define RADIX_TREE_MAX_TAGS 2
27
28/* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */
26struct radix_tree_root { 29struct radix_tree_root {
27 unsigned int height; 30 unsigned int height;
28 gfp_t gfp_mask; 31 gfp_t gfp_mask;
@@ -45,8 +48,6 @@ do { \
45 (root)->rnode = NULL; \ 48 (root)->rnode = NULL; \
46} while (0) 49} while (0)
47 50
48#define RADIX_TREE_MAX_TAGS 2
49
50int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); 51int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
51void *radix_tree_lookup(struct radix_tree_root *, unsigned long); 52void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
52void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); 53void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 78ecfa28b1c2..00b340ba6612 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -2,8 +2,8 @@
2#define _LINUX_RAMFS_H 2#define _LINUX_RAMFS_H
3 3
4struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev); 4struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev);
5struct super_block *ramfs_get_sb(struct file_system_type *fs_type, 5extern int ramfs_get_sb(struct file_system_type *fs_type,
6 int flags, const char *dev_name, void *data); 6 int flags, const char *dev_name, void *data, struct vfsmount *mnt);
7 7
8#ifndef CONFIG_MMU 8#ifndef CONFIG_MMU
9extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, 9extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index f37006f21664..8d5382e62c08 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -132,6 +132,10 @@ static inline void rb_set_color(struct rb_node *rb, int color)
132#define RB_ROOT (struct rb_root) { NULL, } 132#define RB_ROOT (struct rb_root) { NULL, }
133#define rb_entry(ptr, type, member) container_of(ptr, type, member) 133#define rb_entry(ptr, type, member) container_of(ptr, type, member)
134 134
135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
136#define RB_EMPTY_NODE(node) (rb_parent(node) != node)
137#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
138
135extern void rb_insert_color(struct rb_node *, struct rb_root *); 139extern void rb_insert_color(struct rb_node *, struct rb_root *);
136extern void rb_erase(struct rb_node *, struct rb_root *); 140extern void rb_erase(struct rb_node *, struct rb_root *);
137 141
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 970284f571a6..6312758393b6 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -246,7 +246,7 @@ extern int rcu_needs_cpu(int cpu);
246 * softirq handlers will have completed, since in some kernels, these 246 * softirq handlers will have completed, since in some kernels, these
247 * handlers can run in process context, and can block. 247 * handlers can run in process context, and can block.
248 * 248 *
249 * This primitive provides the guarantees made by the (deprecated) 249 * This primitive provides the guarantees made by the (now removed)
250 * synchronize_kernel() API. In contrast, synchronize_rcu() only 250 * synchronize_kernel() API. In contrast, synchronize_rcu() only
251 * guarantees that rcu_read_lock() sections will have completed. 251 * guarantees that rcu_read_lock() sections will have completed.
252 * In "classic RCU", these two guarantees happen to be one and 252 * In "classic RCU", these two guarantees happen to be one and
@@ -264,7 +264,6 @@ extern void FASTCALL(call_rcu(struct rcu_head *head,
264 void (*func)(struct rcu_head *head))); 264 void (*func)(struct rcu_head *head)));
265extern void FASTCALL(call_rcu_bh(struct rcu_head *head, 265extern void FASTCALL(call_rcu_bh(struct rcu_head *head,
266 void (*func)(struct rcu_head *head))); 266 void (*func)(struct rcu_head *head)));
267extern __deprecated_for_modules void synchronize_kernel(void);
268extern void synchronize_rcu(void); 267extern void synchronize_rcu(void);
269void synchronize_idle(void); 268void synchronize_idle(void);
270extern void rcu_barrier(void); 269extern void rcu_barrier(void);
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 2d4c81a220db..bf97b0900014 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -91,7 +91,6 @@ static inline void page_dup_rmap(struct page *page)
91 */ 91 */
92int page_referenced(struct page *, int is_locked); 92int page_referenced(struct page *, int is_locked);
93int try_to_unmap(struct page *, int ignore_refs); 93int try_to_unmap(struct page *, int ignore_refs);
94void remove_from_swap(struct page *page);
95 94
96/* 95/*
97 * Called from mm/filemap_xip.c to unmap empty zero page 96 * Called from mm/filemap_xip.c to unmap empty zero page
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 267f15257040..38b4791e6a5d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -941,12 +941,11 @@ static inline void put_task_struct(struct task_struct *t)
941#define PF_KSWAPD 0x00040000 /* I am kswapd */ 941#define PF_KSWAPD 0x00040000 /* I am kswapd */
942#define PF_SWAPOFF 0x00080000 /* I am in swapoff */ 942#define PF_SWAPOFF 0x00080000 /* I am in swapoff */
943#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ 943#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */
944#define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ 944#define PF_BORROWED_MM 0x00200000 /* I am a kthread doing use_mm */
945#define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ 945#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */
946#define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ 946#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */
947#define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ 947#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */
948#define PF_SPREAD_PAGE 0x04000000 /* Spread page cache over cpuset */ 948#define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */
949#define PF_SPREAD_SLAB 0x08000000 /* Spread some slab caches over cpuset */
950#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ 949#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
951 950
952/* 951/*
@@ -1225,7 +1224,7 @@ static inline int thread_group_empty(task_t *p)
1225 (thread_group_leader(p) && !thread_group_empty(p)) 1224 (thread_group_leader(p) && !thread_group_empty(p))
1226 1225
1227/* 1226/*
1228 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring 1227 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
1229 * subscriptions and synchronises with wait4(). Also used in procfs. Also 1228 * subscriptions and synchronises with wait4(). Also used in procfs. Also
1230 * pins the final release of task.io_context. Also protects ->cpuset. 1229 * pins the final release of task.io_context. Also protects ->cpuset.
1231 * 1230 *
diff --git a/include/linux/security.h b/include/linux/security.h
index 4dfb1b84a9b3..d2c17bd91a29 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -171,9 +171,9 @@ struct swap_info_struct;
171 * Deallocate and clear the sb->s_security field. 171 * Deallocate and clear the sb->s_security field.
172 * @sb contains the super_block structure to be modified. 172 * @sb contains the super_block structure to be modified.
173 * @sb_statfs: 173 * @sb_statfs:
174 * Check permission before obtaining filesystem statistics for the @sb 174 * Check permission before obtaining filesystem statistics for the @mnt
175 * filesystem. 175 * mountpoint.
176 * @sb contains the super_block structure for the filesystem. 176 * @dentry is a handle on the superblock for the filesystem.
177 * Return 0 if permission is granted. 177 * Return 0 if permission is granted.
178 * @sb_mount: 178 * @sb_mount:
179 * Check permission before an object specified by @dev_name is mounted on 179 * Check permission before an object specified by @dev_name is mounted on
@@ -577,6 +577,11 @@ struct swap_info_struct;
577 * @p contains the task_struct of process. 577 * @p contains the task_struct of process.
578 * @nice contains the new nice value. 578 * @nice contains the new nice value.
579 * Return 0 if permission is granted. 579 * Return 0 if permission is granted.
580 * @task_setioprio
581 * Check permission before setting the ioprio value of @p to @ioprio.
582 * @p contains the task_struct of process.
583 * @ioprio contains the new ioprio value
584 * Return 0 if permission is granted.
580 * @task_setrlimit: 585 * @task_setrlimit:
581 * Check permission before setting the resource limits of the current 586 * Check permission before setting the resource limits of the current
582 * process for @resource to @new_rlim. The old resource limit values can 587 * process for @resource to @new_rlim. The old resource limit values can
@@ -596,6 +601,10 @@ struct swap_info_struct;
596 * @p. 601 * @p.
597 * @p contains the task_struct for process. 602 * @p contains the task_struct for process.
598 * Return 0 if permission is granted. 603 * Return 0 if permission is granted.
604 * @task_movememory
605 * Check permission before moving memory owned by process @p.
606 * @p contains the task_struct for process.
607 * Return 0 if permission is granted.
599 * @task_kill: 608 * @task_kill:
600 * Check permission before sending signal @sig to @p. @info can be NULL, 609 * Check permission before sending signal @sig to @p. @info can be NULL,
601 * the constant 1, or a pointer to a siginfo structure. If @info is 1 or 610 * the constant 1, or a pointer to a siginfo structure. If @info is 1 or
@@ -1127,7 +1136,7 @@ struct security_operations {
1127 int (*sb_copy_data)(struct file_system_type *type, 1136 int (*sb_copy_data)(struct file_system_type *type,
1128 void *orig, void *copy); 1137 void *orig, void *copy);
1129 int (*sb_kern_mount) (struct super_block *sb, void *data); 1138 int (*sb_kern_mount) (struct super_block *sb, void *data);
1130 int (*sb_statfs) (struct super_block * sb); 1139 int (*sb_statfs) (struct dentry *dentry);
1131 int (*sb_mount) (char *dev_name, struct nameidata * nd, 1140 int (*sb_mount) (char *dev_name, struct nameidata * nd,
1132 char *type, unsigned long flags, void *data); 1141 char *type, unsigned long flags, void *data);
1133 int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd); 1142 int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd);
@@ -1210,10 +1219,12 @@ struct security_operations {
1210 int (*task_getsid) (struct task_struct * p); 1219 int (*task_getsid) (struct task_struct * p);
1211 int (*task_setgroups) (struct group_info *group_info); 1220 int (*task_setgroups) (struct group_info *group_info);
1212 int (*task_setnice) (struct task_struct * p, int nice); 1221 int (*task_setnice) (struct task_struct * p, int nice);
1222 int (*task_setioprio) (struct task_struct * p, int ioprio);
1213 int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim); 1223 int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim);
1214 int (*task_setscheduler) (struct task_struct * p, int policy, 1224 int (*task_setscheduler) (struct task_struct * p, int policy,
1215 struct sched_param * lp); 1225 struct sched_param * lp);
1216 int (*task_getscheduler) (struct task_struct * p); 1226 int (*task_getscheduler) (struct task_struct * p);
1227 int (*task_movememory) (struct task_struct * p);
1217 int (*task_kill) (struct task_struct * p, 1228 int (*task_kill) (struct task_struct * p,
1218 struct siginfo * info, int sig); 1229 struct siginfo * info, int sig);
1219 int (*task_wait) (struct task_struct * p); 1230 int (*task_wait) (struct task_struct * p);
@@ -1313,7 +1324,7 @@ struct security_operations {
1313 1324
1314 /* key management security hooks */ 1325 /* key management security hooks */
1315#ifdef CONFIG_KEYS 1326#ifdef CONFIG_KEYS
1316 int (*key_alloc)(struct key *key); 1327 int (*key_alloc)(struct key *key, struct task_struct *tsk);
1317 void (*key_free)(struct key *key); 1328 void (*key_free)(struct key *key);
1318 int (*key_permission)(key_ref_t key_ref, 1329 int (*key_permission)(key_ref_t key_ref,
1319 struct task_struct *context, 1330 struct task_struct *context,
@@ -1450,9 +1461,9 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data)
1450 return security_ops->sb_kern_mount (sb, data); 1461 return security_ops->sb_kern_mount (sb, data);
1451} 1462}
1452 1463
1453static inline int security_sb_statfs (struct super_block *sb) 1464static inline int security_sb_statfs (struct dentry *dentry)
1454{ 1465{
1455 return security_ops->sb_statfs (sb); 1466 return security_ops->sb_statfs (dentry);
1456} 1467}
1457 1468
1458static inline int security_sb_mount (char *dev_name, struct nameidata *nd, 1469static inline int security_sb_mount (char *dev_name, struct nameidata *nd,
@@ -1836,6 +1847,11 @@ static inline int security_task_setnice (struct task_struct *p, int nice)
1836 return security_ops->task_setnice (p, nice); 1847 return security_ops->task_setnice (p, nice);
1837} 1848}
1838 1849
1850static inline int security_task_setioprio (struct task_struct *p, int ioprio)
1851{
1852 return security_ops->task_setioprio (p, ioprio);
1853}
1854
1839static inline int security_task_setrlimit (unsigned int resource, 1855static inline int security_task_setrlimit (unsigned int resource,
1840 struct rlimit *new_rlim) 1856 struct rlimit *new_rlim)
1841{ 1857{
@@ -1854,6 +1870,11 @@ static inline int security_task_getscheduler (struct task_struct *p)
1854 return security_ops->task_getscheduler (p); 1870 return security_ops->task_getscheduler (p);
1855} 1871}
1856 1872
1873static inline int security_task_movememory (struct task_struct *p)
1874{
1875 return security_ops->task_movememory (p);
1876}
1877
1857static inline int security_task_kill (struct task_struct *p, 1878static inline int security_task_kill (struct task_struct *p,
1858 struct siginfo *info, int sig) 1879 struct siginfo *info, int sig)
1859{ 1880{
@@ -2162,7 +2183,7 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data)
2162 return 0; 2183 return 0;
2163} 2184}
2164 2185
2165static inline int security_sb_statfs (struct super_block *sb) 2186static inline int security_sb_statfs (struct dentry *dentry)
2166{ 2187{
2167 return 0; 2188 return 0;
2168} 2189}
@@ -2478,6 +2499,11 @@ static inline int security_task_setnice (struct task_struct *p, int nice)
2478 return 0; 2499 return 0;
2479} 2500}
2480 2501
2502static inline int security_task_setioprio (struct task_struct *p, int ioprio)
2503{
2504 return 0;
2505}
2506
2481static inline int security_task_setrlimit (unsigned int resource, 2507static inline int security_task_setrlimit (unsigned int resource,
2482 struct rlimit *new_rlim) 2508 struct rlimit *new_rlim)
2483{ 2509{
@@ -2496,6 +2522,11 @@ static inline int security_task_getscheduler (struct task_struct *p)
2496 return 0; 2522 return 0;
2497} 2523}
2498 2524
2525static inline int security_task_movememory (struct task_struct *p)
2526{
2527 return 0;
2528}
2529
2499static inline int security_task_kill (struct task_struct *p, 2530static inline int security_task_kill (struct task_struct *p,
2500 struct siginfo *info, int sig) 2531 struct siginfo *info, int sig)
2501{ 2532{
@@ -3008,9 +3039,10 @@ static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid
3008 3039
3009#ifdef CONFIG_KEYS 3040#ifdef CONFIG_KEYS
3010#ifdef CONFIG_SECURITY 3041#ifdef CONFIG_SECURITY
3011static inline int security_key_alloc(struct key *key) 3042static inline int security_key_alloc(struct key *key,
3043 struct task_struct *tsk)
3012{ 3044{
3013 return security_ops->key_alloc(key); 3045 return security_ops->key_alloc(key, tsk);
3014} 3046}
3015 3047
3016static inline void security_key_free(struct key *key) 3048static inline void security_key_free(struct key *key)
@@ -3027,7 +3059,8 @@ static inline int security_key_permission(key_ref_t key_ref,
3027 3059
3028#else 3060#else
3029 3061
3030static inline int security_key_alloc(struct key *key) 3062static inline int security_key_alloc(struct key *key,
3063 struct task_struct *tsk)
3031{ 3064{
3032 return 0; 3065 return 0;
3033} 3066}
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 94b9286cf6bd..0ef50baa7da6 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -67,8 +67,8 @@
67/* Parisc type numbers. */ 67/* Parisc type numbers. */
68#define PORT_MUX 48 68#define PORT_MUX 48
69 69
70/* Atmel AT91RM9200 SoC */ 70/* Atmel AT91xxx SoC */
71#define PORT_AT91RM9200 49 71#define PORT_AT91 49
72 72
73/* Macintosh Zilog type numbers */ 73/* Macintosh Zilog type numbers */
74#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */ 74#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 66f8819f9568..16eef03ce0eb 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -134,9 +134,10 @@ struct skb_frag_struct {
134struct skb_shared_info { 134struct skb_shared_info {
135 atomic_t dataref; 135 atomic_t dataref;
136 unsigned short nr_frags; 136 unsigned short nr_frags;
137 unsigned short tso_size; 137 unsigned short gso_size;
138 unsigned short tso_segs; 138 /* Warning: this field is not always filled in (UFO)! */
139 unsigned short ufo_size; 139 unsigned short gso_segs;
140 unsigned short gso_type;
140 unsigned int ip6_frag_id; 141 unsigned int ip6_frag_id;
141 struct sk_buff *frag_list; 142 struct sk_buff *frag_list;
142 skb_frag_t frags[MAX_SKB_FRAGS]; 143 skb_frag_t frags[MAX_SKB_FRAGS];
@@ -168,6 +169,11 @@ enum {
168 SKB_FCLONE_CLONE, 169 SKB_FCLONE_CLONE,
169}; 170};
170 171
172enum {
173 SKB_GSO_TCPV4 = 1 << 0,
174 SKB_GSO_UDPV4 = 1 << 1,
175};
176
171/** 177/**
172 * struct sk_buff - socket buffer 178 * struct sk_buff - socket buffer
173 * @next: Next buffer in list 179 * @next: Next buffer in list
@@ -209,6 +215,8 @@ enum {
209 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 215 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
210 * @tc_index: Traffic control index 216 * @tc_index: Traffic control index
211 * @tc_verd: traffic control verdict 217 * @tc_verd: traffic control verdict
218 * @dma_cookie: a cookie to one of several possible DMA operations
219 * done by skb DMA functions
212 * @secmark: security marking 220 * @secmark: security marking
213 */ 221 */
214 222
@@ -345,7 +353,7 @@ extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
345extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, 353extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
346 int newheadroom, int newtailroom, 354 int newheadroom, int newtailroom,
347 gfp_t priority); 355 gfp_t priority);
348extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); 356extern int skb_pad(struct sk_buff *skb, int pad);
349#define dev_kfree_skb(a) kfree_skb(a) 357#define dev_kfree_skb(a) kfree_skb(a)
350extern void skb_over_panic(struct sk_buff *skb, int len, 358extern void skb_over_panic(struct sk_buff *skb, int len,
351 void *here); 359 void *here);
@@ -1122,16 +1130,15 @@ static inline int skb_cow(struct sk_buff *skb, unsigned int headroom)
1122 * 1130 *
1123 * Pads up a buffer to ensure the trailing bytes exist and are 1131 * Pads up a buffer to ensure the trailing bytes exist and are
1124 * blanked. If the buffer already contains sufficient data it 1132 * blanked. If the buffer already contains sufficient data it
1125 * is untouched. Returns the buffer, which may be a replacement 1133 * is untouched. Otherwise it is extended. Returns zero on
1126 * for the original, or NULL for out of memory - in which case 1134 * success. The skb is freed on error.
1127 * the original buffer is still freed.
1128 */ 1135 */
1129 1136
1130static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len) 1137static inline int skb_padto(struct sk_buff *skb, unsigned int len)
1131{ 1138{
1132 unsigned int size = skb->len; 1139 unsigned int size = skb->len;
1133 if (likely(size >= len)) 1140 if (likely(size >= len))
1134 return skb; 1141 return 0;
1135 return skb_pad(skb, len-size); 1142 return skb_pad(skb, len-size);
1136} 1143}
1137 1144
@@ -1292,6 +1299,7 @@ extern void skb_split(struct sk_buff *skb,
1292 struct sk_buff *skb1, const u32 len); 1299 struct sk_buff *skb1, const u32 len);
1293 1300
1294extern void skb_release_data(struct sk_buff *skb); 1301extern void skb_release_data(struct sk_buff *skb);
1302extern struct sk_buff *skb_segment(struct sk_buff *skb, int sg);
1295 1303
1296static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, 1304static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
1297 int len, void *buffer) 1305 int len, void *buffer)
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 9dc93163e065..45ad55b70d1c 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -86,6 +86,51 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
86 __kmalloc_track_caller(size, flags, __builtin_return_address(0)) 86 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
87#endif 87#endif
88 88
89/**
90 * kmalloc - allocate memory
91 * @size: how many bytes of memory are required.
92 * @flags: the type of memory to allocate.
93 *
94 * kmalloc is the normal method of allocating memory
95 * in the kernel.
96 *
97 * The @flags argument may be one of:
98 *
99 * %GFP_USER - Allocate memory on behalf of user. May sleep.
100 *
101 * %GFP_KERNEL - Allocate normal kernel ram. May sleep.
102 *
103 * %GFP_ATOMIC - Allocation will not sleep.
104 * For example, use this inside interrupt handlers.
105 *
106 * %GFP_HIGHUSER - Allocate pages from high memory.
107 *
108 * %GFP_NOIO - Do not do any I/O at all while trying to get memory.
109 *
110 * %GFP_NOFS - Do not make any fs calls while trying to get memory.
111 *
112 * Also it is possible to set different flags by OR'ing
113 * in one or more of the following additional @flags:
114 *
115 * %__GFP_COLD - Request cache-cold pages instead of
116 * trying to return cache-warm pages.
117 *
118 * %__GFP_DMA - Request memory from the DMA-capable zone.
119 *
120 * %__GFP_HIGH - This allocation has high priority and may use emergency pools.
121 *
122 * %__GFP_HIGHMEM - Allocated memory may be from highmem.
123 *
124 * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail
125 * (think twice before using).
126 *
127 * %__GFP_NORETRY - If memory is not immediately available,
128 * then give up at once.
129 *
130 * %__GFP_NOWARN - If allocation fails, don't issue any warnings.
131 *
132 * %__GFP_REPEAT - If allocation fails initially, try once more before failing.
133 */
89static inline void *kmalloc(size_t size, gfp_t flags) 134static inline void *kmalloc(size_t size, gfp_t flags)
90{ 135{
91 if (__builtin_constant_p(size)) { 136 if (__builtin_constant_p(size)) {
@@ -111,6 +156,11 @@ found:
111 156
112extern void *__kzalloc(size_t, gfp_t); 157extern void *__kzalloc(size_t, gfp_t);
113 158
159/**
160 * kzalloc - allocate memory. The memory is set to zero.
161 * @size: how many bytes of memory are required.
162 * @flags: the type of memory to allocate (see kmalloc).
163 */
114static inline void *kzalloc(size_t size, gfp_t flags) 164static inline void *kzalloc(size_t size, gfp_t flags)
115{ 165{
116 if (__builtin_constant_p(size)) { 166 if (__builtin_constant_p(size)) {
diff --git a/include/linux/string.h b/include/linux/string.h
index c61306da8c52..e4c755860316 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -56,6 +56,7 @@ extern char * strnchr(const char *, size_t, int);
56#ifndef __HAVE_ARCH_STRRCHR 56#ifndef __HAVE_ARCH_STRRCHR
57extern char * strrchr(const char *,int); 57extern char * strrchr(const char *,int);
58#endif 58#endif
59extern char * strstrip(char *);
59#ifndef __HAVE_ARCH_STRSTR 60#ifndef __HAVE_ARCH_STRSTR
60extern char * strstr(const char *,const char *); 61extern char * strstr(const char *,const char *);
61#endif 62#endif
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 96e31aa64cc7..e82cb10fb3ea 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -71,6 +71,7 @@ struct saved_context;
71void __save_processor_state(struct saved_context *ctxt); 71void __save_processor_state(struct saved_context *ctxt);
72void __restore_processor_state(struct saved_context *ctxt); 72void __restore_processor_state(struct saved_context *ctxt);
73unsigned long get_safe_page(gfp_t gfp_mask); 73unsigned long get_safe_page(gfp_t gfp_mask);
74int swsusp_add_arch_pages(unsigned long start, unsigned long end);
74 75
75/* 76/*
76 * XXX: We try to keep some more pages free so that I/O operations succeed 77 * XXX: We try to keep some more pages free so that I/O operations succeed
diff --git a/include/linux/swap.h b/include/linux/swap.h
index aca9bfae208f..dc3f3aa0c83e 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -28,7 +28,14 @@ static inline int current_is_kswapd(void)
28 * the type/offset into the pte as 5/27 as well. 28 * the type/offset into the pte as 5/27 as well.
29 */ 29 */
30#define MAX_SWAPFILES_SHIFT 5 30#define MAX_SWAPFILES_SHIFT 5
31#ifndef CONFIG_MIGRATION
31#define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) 32#define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT)
33#else
34/* Use last two entries for page migration swap entries */
35#define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2)
36#define SWP_MIGRATION_READ MAX_SWAPFILES
37#define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1)
38#endif
32 39
33/* 40/*
34 * Magic header for a swap area. The first part of the union is 41 * Magic header for a swap area. The first part of the union is
@@ -48,12 +55,14 @@ union swap_header {
48 char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */ 55 char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */
49 } magic; 56 } magic;
50 struct { 57 struct {
51 char bootbits[1024]; /* Space for disklabel etc. */ 58 char bootbits[1024]; /* Space for disklabel etc. */
52 unsigned int version; 59 __u32 version;
53 unsigned int last_page; 60 __u32 last_page;
54 unsigned int nr_badpages; 61 __u32 nr_badpages;
55 unsigned int padding[125]; 62 unsigned char sws_uuid[16];
56 unsigned int badpages[1]; 63 unsigned char sws_volume[16];
64 __u32 padding[117];
65 __u32 badpages[1];
57 } info; 66 } info;
58}; 67};
59 68
@@ -176,20 +185,7 @@ extern unsigned long try_to_free_pages(struct zone **, gfp_t);
176extern unsigned long shrink_all_memory(unsigned long nr_pages); 185extern unsigned long shrink_all_memory(unsigned long nr_pages);
177extern int vm_swappiness; 186extern int vm_swappiness;
178extern int remove_mapping(struct address_space *mapping, struct page *page); 187extern int remove_mapping(struct address_space *mapping, struct page *page);
179 188extern long vm_total_pages;
180/* possible outcome of pageout() */
181typedef enum {
182 /* failed to write page out, page is locked */
183 PAGE_KEEP,
184 /* move page to the active list, page is locked */
185 PAGE_ACTIVATE,
186 /* page has been sent to the disk successfully, page is unlocked */
187 PAGE_SUCCESS,
188 /* page is clean and locked */
189 PAGE_CLEAN,
190} pageout_t;
191
192extern pageout_t pageout(struct page *page, struct address_space *mapping);
193 189
194#ifdef CONFIG_NUMA 190#ifdef CONFIG_NUMA
195extern int zone_reclaim_mode; 191extern int zone_reclaim_mode;
@@ -250,7 +246,6 @@ extern int remove_exclusive_swap_page(struct page *);
250struct backing_dev_info; 246struct backing_dev_info;
251 247
252extern spinlock_t swap_lock; 248extern spinlock_t swap_lock;
253extern int remove_vma_swap(struct vm_area_struct *vma, struct page *page);
254 249
255/* linux/mm/thrash.c */ 250/* linux/mm/thrash.c */
256extern struct mm_struct * swap_token_mm; 251extern struct mm_struct * swap_token_mm;
@@ -288,18 +283,60 @@ static inline void disable_swap_token(void)
288#define free_pages_and_swap_cache(pages, nr) \ 283#define free_pages_and_swap_cache(pages, nr) \
289 release_pages((pages), (nr), 0); 284 release_pages((pages), (nr), 0);
290 285
291#define show_swap_cache_info() /*NOTHING*/ 286static inline void show_swap_cache_info(void)
292#define free_swap_and_cache(swp) /*NOTHING*/ 287{
293#define swap_duplicate(swp) /*NOTHING*/ 288}
294#define swap_free(swp) /*NOTHING*/ 289
295#define read_swap_cache_async(swp,vma,addr) NULL 290static inline void free_swap_and_cache(swp_entry_t swp)
296#define lookup_swap_cache(swp) NULL 291{
297#define valid_swaphandles(swp, off) 0 292}
293
294static inline int swap_duplicate(swp_entry_t swp)
295{
296 return 0;
297}
298
299static inline void swap_free(swp_entry_t swp)
300{
301}
302
303static inline struct page *read_swap_cache_async(swp_entry_t swp,
304 struct vm_area_struct *vma, unsigned long addr)
305{
306 return NULL;
307}
308
309static inline struct page *lookup_swap_cache(swp_entry_t swp)
310{
311 return NULL;
312}
313
314static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset)
315{
316 return 0;
317}
318
298#define can_share_swap_page(p) (page_mapcount(p) == 1) 319#define can_share_swap_page(p) (page_mapcount(p) == 1)
299#define move_to_swap_cache(p, swp) 1 320
300#define move_from_swap_cache(p, i, m) 1 321static inline int move_to_swap_cache(struct page *page, swp_entry_t entry)
301#define __delete_from_swap_cache(p) /*NOTHING*/ 322{
302#define delete_from_swap_cache(p) /*NOTHING*/ 323 return 1;
324}
325
326static inline int move_from_swap_cache(struct page *page, unsigned long index,
327 struct address_space *mapping)
328{
329 return 1;
330}
331
332static inline void __delete_from_swap_cache(struct page *page)
333{
334}
335
336static inline void delete_from_swap_cache(struct page *page)
337{
338}
339
303#define swap_token_default_timeout 0 340#define swap_token_default_timeout 0
304 341
305static inline int remove_exclusive_swap_page(struct page *p) 342static inline int remove_exclusive_swap_page(struct page *p)
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index 87b9d14c710d..ec639aa3a1d3 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -67,3 +67,56 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry)
67 BUG_ON(pte_file(__swp_entry_to_pte(arch_entry))); 67 BUG_ON(pte_file(__swp_entry_to_pte(arch_entry)));
68 return __swp_entry_to_pte(arch_entry); 68 return __swp_entry_to_pte(arch_entry);
69} 69}
70
71#ifdef CONFIG_MIGRATION
72static inline swp_entry_t make_migration_entry(struct page *page, int write)
73{
74 BUG_ON(!PageLocked(page));
75 return swp_entry(write ? SWP_MIGRATION_WRITE : SWP_MIGRATION_READ,
76 page_to_pfn(page));
77}
78
79static inline int is_migration_entry(swp_entry_t entry)
80{
81 return unlikely(swp_type(entry) == SWP_MIGRATION_READ ||
82 swp_type(entry) == SWP_MIGRATION_WRITE);
83}
84
85static inline int is_write_migration_entry(swp_entry_t entry)
86{
87 return unlikely(swp_type(entry) == SWP_MIGRATION_WRITE);
88}
89
90static inline struct page *migration_entry_to_page(swp_entry_t entry)
91{
92 struct page *p = pfn_to_page(swp_offset(entry));
93 /*
94 * Any use of migration entries may only occur while the
95 * corresponding page is locked
96 */
97 BUG_ON(!PageLocked(p));
98 return p;
99}
100
101static inline void make_migration_entry_read(swp_entry_t *entry)
102{
103 *entry = swp_entry(SWP_MIGRATION_READ, swp_offset(*entry));
104}
105
106extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
107 unsigned long address);
108#else
109
110#define make_migration_entry(page, write) swp_entry(0, 0)
111#define is_migration_entry(swp) 0
112#define migration_entry_to_page(swp) NULL
113static inline void make_migration_entry_read(swp_entry_t *entryp) { }
114static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
115 unsigned long address) { }
116static inline int is_write_migration_entry(swp_entry_t entry)
117{
118 return 0;
119}
120
121#endif
122
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index bd67a4413df7..33785b79d548 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -516,6 +516,16 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask,
516asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, 516asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
517 const unsigned long __user *from, 517 const unsigned long __user *from,
518 const unsigned long __user *to); 518 const unsigned long __user *to);
519asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
520 const void __user * __user *pages,
521 const int __user *nodes,
522 int __user *status,
523 int flags);
524asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
525 __u32 __user *pages,
526 const int __user *nodes,
527 int __user *status,
528 int flags);
519asmlinkage long sys_mbind(unsigned long start, unsigned long len, 529asmlinkage long sys_mbind(unsigned long start, unsigned long len,
520 unsigned long mode, 530 unsigned long mode,
521 unsigned long __user *nmask, 531 unsigned long __user *nmask,
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index cee944dbdcd4..c7132029af0f 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -186,6 +186,7 @@ enum
186 VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ 186 VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */
187 VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ 187 VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */
188 VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ 188 VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */
189 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
189}; 190};
190 191
191 192
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index 2a4b432e1176..166a2e58c287 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -37,11 +37,27 @@ struct sysdev_class {
37 struct kset kset; 37 struct kset kset;
38}; 38};
39 39
40struct sysdev_class_attribute {
41 struct attribute attr;
42 ssize_t (*show)(struct sysdev_class *, char *);
43 ssize_t (*store)(struct sysdev_class *, const char *, size_t);
44};
45
46#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
47struct sysdev_class_attribute attr_##_name = { \
48 .attr = {.name = __stringify(_name), .mode = _mode }, \
49 .show = _show, \
50 .store = _store, \
51};
52
40 53
41extern int sysdev_class_register(struct sysdev_class *); 54extern int sysdev_class_register(struct sysdev_class *);
42extern void sysdev_class_unregister(struct sysdev_class *); 55extern void sysdev_class_unregister(struct sysdev_class *);
43 56
44 57extern int sysdev_class_create_file(struct sysdev_class *,
58 struct sysdev_class_attribute *);
59extern void sysdev_class_remove_file(struct sysdev_class *,
60 struct sysdev_class_attribute *);
45/** 61/**
46 * Auxillary system device drivers. 62 * Auxillary system device drivers.
47 */ 63 */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 420a689c3fb4..8ebf497907f8 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -18,7 +18,6 @@
18#define _LINUX_TCP_H 18#define _LINUX_TCP_H
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/dmaengine.h>
22#include <asm/byteorder.h> 21#include <asm/byteorder.h>
23 22
24struct tcphdr { 23struct tcphdr {
@@ -161,6 +160,7 @@ struct tcp_info
161#ifdef __KERNEL__ 160#ifdef __KERNEL__
162 161
163#include <linux/skbuff.h> 162#include <linux/skbuff.h>
163#include <linux/dmaengine.h>
164#include <net/sock.h> 164#include <net/sock.h>
165#include <net/inet_connection_sock.h> 165#include <net/inet_connection_sock.h>
166#include <net/inet_timewait_sock.h> 166#include <net/inet_timewait_sock.h>
diff --git a/include/linux/tty.h b/include/linux/tty.h
index e898eeb94166..cb35ca50a0a6 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -290,7 +290,9 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
290extern int tty_unregister_ldisc(int disc); 290extern int tty_unregister_ldisc(int disc);
291extern int tty_register_driver(struct tty_driver *driver); 291extern int tty_register_driver(struct tty_driver *driver);
292extern int tty_unregister_driver(struct tty_driver *driver); 292extern int tty_unregister_driver(struct tty_driver *driver);
293extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); 293extern struct class_device *tty_register_device(struct tty_driver *driver,
294 unsigned index,
295 struct device *dev);
294extern void tty_unregister_device(struct tty_driver *driver, unsigned index); 296extern void tty_unregister_device(struct tty_driver *driver, unsigned index);
295extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, 297extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
296 int buflen); 298 int buflen);
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
new file mode 100644
index 000000000000..391e7ed1eb3f
--- /dev/null
+++ b/include/linux/uaccess.h
@@ -0,0 +1,22 @@
1#ifndef __LINUX_UACCESS_H__
2#define __LINUX_UACCESS_H__
3
4#include <asm/uaccess.h>
5
6#ifndef ARCH_HAS_NOCACHE_UACCESS
7
8static inline unsigned long __copy_from_user_inatomic_nocache(void *to,
9 const void __user *from, unsigned long n)
10{
11 return __copy_from_user_inatomic(to, from, n);
12}
13
14static inline unsigned long __copy_from_user_nocache(void *to,
15 const void __user *from, unsigned long n)
16{
17 return __copy_from_user(to, from, n);
18}
19
20#endif /* ARCH_HAS_NOCACHE_UACCESS */
21
22#endif /* __LINUX_UACCESS_H__ */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 1f492c0c7047..8dead32e7ebf 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -40,6 +40,8 @@ struct usb_driver;
40 * Devices may also have class-specific or vendor-specific descriptors. 40 * Devices may also have class-specific or vendor-specific descriptors.
41 */ 41 */
42 42
43struct ep_device;
44
43/** 45/**
44 * struct usb_host_endpoint - host-side endpoint descriptor and queue 46 * struct usb_host_endpoint - host-side endpoint descriptor and queue
45 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder 47 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
@@ -57,7 +59,7 @@ struct usb_host_endpoint {
57 struct usb_endpoint_descriptor desc; 59 struct usb_endpoint_descriptor desc;
58 struct list_head urb_list; 60 struct list_head urb_list;
59 void *hcpriv; 61 void *hcpriv;
60 struct kobject *kobj; /* For sysfs info */ 62 struct ep_device *ep_dev; /* For sysfs info */
61 63
62 unsigned char *extra; /* Extra descriptors */ 64 unsigned char *extra; /* Extra descriptors */
63 int extralen; 65 int extralen;
@@ -101,7 +103,8 @@ enum usb_interface_condition {
101 * @condition: binding state of the interface: not bound, binding 103 * @condition: binding state of the interface: not bound, binding
102 * (in probe()), bound to a driver, or unbinding (in disconnect()) 104 * (in probe()), bound to a driver, or unbinding (in disconnect())
103 * @dev: driver model's view of this device 105 * @dev: driver model's view of this device
104 * @class_dev: driver model's class view of this device. 106 * @usb_dev: if an interface is bound to the USB major, this will point
107 * to the sysfs representation for that device.
105 * 108 *
106 * USB device drivers attach to interfaces on a physical device. Each 109 * USB device drivers attach to interfaces on a physical device. Each
107 * interface encapsulates a single high level function, such as feeding 110 * interface encapsulates a single high level function, such as feeding
@@ -141,7 +144,7 @@ struct usb_interface {
141 * bound to */ 144 * bound to */
142 enum usb_interface_condition condition; /* state of binding */ 145 enum usb_interface_condition condition; /* state of binding */
143 struct device dev; /* interface specific device info */ 146 struct device dev; /* interface specific device info */
144 struct class_device *class_dev; 147 struct device *usb_dev; /* pointer to the usb class's device, if any */
145}; 148};
146#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 149#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
147#define interface_to_usbdev(intf) \ 150#define interface_to_usbdev(intf) \
@@ -358,7 +361,7 @@ struct usb_device {
358 char *serial; /* iSerialNumber string, if present */ 361 char *serial; /* iSerialNumber string, if present */
359 362
360 struct list_head filelist; 363 struct list_head filelist;
361 struct class_device *class_dev; 364 struct device *usbfs_dev;
362 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
363 366
364 /* 367 /*
@@ -386,6 +389,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
386 389
387/* USB port reset for device reinitialization */ 390/* USB port reset for device reinitialization */
388extern int usb_reset_device(struct usb_device *dev); 391extern int usb_reset_device(struct usb_device *dev);
392extern int usb_reset_composite_device(struct usb_device *dev,
393 struct usb_interface *iface);
389 394
390extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); 395extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
391 396
@@ -554,6 +559,10 @@ struct usb_dynids {
554 * do (or don't) show up otherwise in the filesystem. 559 * do (or don't) show up otherwise in the filesystem.
555 * @suspend: Called when the device is going to be suspended by the system. 560 * @suspend: Called when the device is going to be suspended by the system.
556 * @resume: Called when the device is being resumed by the system. 561 * @resume: Called when the device is being resumed by the system.
562 * @pre_reset: Called by usb_reset_composite_device() when the device
563 * is about to be reset.
564 * @post_reset: Called by usb_reset_composite_device() after the device
565 * has been reset.
557 * @id_table: USB drivers use ID table to support hotplugging. 566 * @id_table: USB drivers use ID table to support hotplugging.
558 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 567 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
559 * or your driver's probe function will never get called. 568 * or your driver's probe function will never get called.
@@ -592,6 +601,9 @@ struct usb_driver {
592 int (*suspend) (struct usb_interface *intf, pm_message_t message); 601 int (*suspend) (struct usb_interface *intf, pm_message_t message);
593 int (*resume) (struct usb_interface *intf); 602 int (*resume) (struct usb_interface *intf);
594 603
604 void (*pre_reset) (struct usb_interface *intf);
605 void (*post_reset) (struct usb_interface *intf);
606
595 const struct usb_device_id *id_table; 607 const struct usb_device_id *id_table;
596 608
597 struct usb_dynids dynids; 609 struct usb_dynids dynids;
@@ -1008,6 +1020,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
1008extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, 1020extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
1009 __u8 request, __u8 requesttype, __u16 value, __u16 index, 1021 __u8 request, __u8 requesttype, __u16 value, __u16 index,
1010 void *data, __u16 size, int timeout); 1022 void *data, __u16 size, int timeout);
1023extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe,
1024 void *data, int len, int *actual_length, int timeout);
1011extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, 1025extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
1012 void *data, int len, int *actual_length, 1026 void *data, int len, int *actual_length,
1013 int timeout); 1027 int timeout);
diff --git a/include/linux/usb_cdc.h b/include/linux/usb/cdc.h
index ba617c372455..ba617c372455 100644
--- a/include/linux/usb_cdc.h
+++ b/include/linux/usb/cdc.h
diff --git a/include/linux/usb_input.h b/include/linux/usb/input.h
index 716e0cc16043..716e0cc16043 100644
--- a/include/linux/usb_input.h
+++ b/include/linux/usb/input.h
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb/isp116x.h
index 436dd8a2b64a..436dd8a2b64a 100644
--- a/include/linux/usb_isp116x.h
+++ b/include/linux/usb/isp116x.h
diff --git a/include/linux/usb_sl811.h b/include/linux/usb/sl811.h
index 4f2d012d7309..397ee3b3d7f3 100644
--- a/include/linux/usb_sl811.h
+++ b/include/linux/usb/sl811.h
@@ -14,13 +14,13 @@ struct sl811_platform_data {
14 u8 power; 14 u8 power;
15 15
16 /* sl811 relies on an external source of VBUS current */ 16 /* sl811 relies on an external source of VBUS current */
17 void (*port_power)(struct device *dev, int is_on); 17 void (*port_power)(struct device *dev, int is_on);
18 18
19 /* pulse sl811 nRST (probably with a GPIO) */ 19 /* pulse sl811 nRST (probably with a GPIO) */
20 void (*reset)(struct device *dev); 20 void (*reset)(struct device *dev);
21 21
22 // some boards need something like these: 22 // some boards need something like these:
23 // int (*check_overcurrent)(struct device *dev); 23 // int (*check_overcurrent)(struct device *dev);
24 // void (*clock_enable)(struct device *dev, int is_on); 24 // void (*clock_enable)(struct device *dev, int is_on);
25}; 25};
26 26
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 1d5577b2b752..f6024ab4eff0 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -4,10 +4,13 @@
4#include <linux/spinlock.h> 4#include <linux/spinlock.h>
5#include <asm/page.h> /* pgprot_t */ 5#include <asm/page.h> /* pgprot_t */
6 6
7struct vm_area_struct;
8
7/* bits in vm_struct->flags */ 9/* bits in vm_struct->flags */
8#define VM_IOREMAP 0x00000001 /* ioremap() and friends */ 10#define VM_IOREMAP 0x00000001 /* ioremap() and friends */
9#define VM_ALLOC 0x00000002 /* vmalloc() */ 11#define VM_ALLOC 0x00000002 /* vmalloc() */
10#define VM_MAP 0x00000004 /* vmap()ed pages */ 12#define VM_MAP 0x00000004 /* vmap()ed pages */
13#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */
11/* bits [20..32] reserved for arch specific ioremap internals */ 14/* bits [20..32] reserved for arch specific ioremap internals */
12 15
13/* 16/*
@@ -32,9 +35,11 @@ struct vm_struct {
32 * Highlevel APIs for driver use 35 * Highlevel APIs for driver use
33 */ 36 */
34extern void *vmalloc(unsigned long size); 37extern void *vmalloc(unsigned long size);
38extern void *vmalloc_user(unsigned long size);
35extern void *vmalloc_node(unsigned long size, int node); 39extern void *vmalloc_node(unsigned long size, int node);
36extern void *vmalloc_exec(unsigned long size); 40extern void *vmalloc_exec(unsigned long size);
37extern void *vmalloc_32(unsigned long size); 41extern void *vmalloc_32(unsigned long size);
42extern void *vmalloc_32_user(unsigned long size);
38extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); 43extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
39extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, 44extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask,
40 pgprot_t prot); 45 pgprot_t prot);
@@ -45,6 +50,9 @@ extern void vfree(void *addr);
45extern void *vmap(struct page **pages, unsigned int count, 50extern void *vmap(struct page **pages, unsigned int count,
46 unsigned long flags, pgprot_t prot); 51 unsigned long flags, pgprot_t prot);
47extern void vunmap(void *addr); 52extern void vunmap(void *addr);
53
54extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
55 unsigned long pgoff);
48 56
49/* 57/*
50 * Lowlevel-APIs (not for driver use!) 58 * Lowlevel-APIs (not for driver use!)
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 56f92fcbe94a..9e38b566d0e7 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -50,14 +50,15 @@ struct writeback_control {
50 * a hint that the filesystem need only write out the pages inside that 50 * a hint that the filesystem need only write out the pages inside that
51 * byterange. The byte at `end' is included in the writeout request. 51 * byterange. The byte at `end' is included in the writeout request.
52 */ 52 */
53 loff_t start; 53 loff_t range_start;
54 loff_t end; 54 loff_t range_end;
55 55
56 unsigned nonblocking:1; /* Don't get stuck on request queues */ 56 unsigned nonblocking:1; /* Don't get stuck on request queues */
57 unsigned encountered_congestion:1; /* An output: a queue is full */ 57 unsigned encountered_congestion:1; /* An output: a queue is full */
58 unsigned for_kupdate:1; /* A kupdate writeback */ 58 unsigned for_kupdate:1; /* A kupdate writeback */
59 unsigned for_reclaim:1; /* Invoked from the page allocator */ 59 unsigned for_reclaim:1; /* Invoked from the page allocator */
60 unsigned for_writepages:1; /* This is a writepages() call */ 60 unsigned for_writepages:1; /* This is a writepages() call */
61 unsigned range_cyclic:1; /* range_start is cyclic */
61}; 62};
62 63
63/* 64/*
diff --git a/include/linux/zconf.h b/include/linux/zconf.h
index f1cfd66b9554..0beb75e38caa 100644
--- a/include/linux/zconf.h
+++ b/include/linux/zconf.h
@@ -35,6 +35,18 @@
35# define MAX_WBITS 15 /* 32K LZ77 window */ 35# define MAX_WBITS 15 /* 32K LZ77 window */
36#endif 36#endif
37 37
38/* default windowBits for decompression. MAX_WBITS is for compression only */
39#ifndef DEF_WBITS
40# define DEF_WBITS MAX_WBITS
41#endif
42
43/* default memLevel */
44#if MAX_MEM_LEVEL >= 8
45# define DEF_MEM_LEVEL 8
46#else
47# define DEF_MEM_LEVEL MAX_MEM_LEVEL
48#endif
49
38 /* Type declarations */ 50 /* Type declarations */
39 51
40typedef unsigned char Byte; /* 8 bits */ 52typedef unsigned char Byte; /* 8 bits */
diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index 4fa32f0d4df8..9e3192a7dc6f 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -1,7 +1,6 @@
1/* zlib.h -- interface of the 'zlib' general purpose compression library 1/* zlib.h -- interface of the 'zlib' general purpose compression library
2 version 1.1.3, July 9th, 1998
3 2
4 Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler 3 Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
5 4
6 This software is provided 'as-is', without any express or implied 5 This software is provided 'as-is', without any express or implied
7 warranty. In no event will the authors be held liable for any damages 6 warranty. In no event will the authors be held liable for any damages
@@ -24,7 +23,7 @@
24 23
25 24
26 The data format used by the zlib library is described by RFCs (Request for 25 The data format used by the zlib library is described by RFCs (Request for
27 Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt 26 Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
28 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). 27 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
29*/ 28*/
30 29
@@ -33,7 +32,22 @@
33 32
34#include <linux/zconf.h> 33#include <linux/zconf.h>
35 34
36#define ZLIB_VERSION "1.1.3" 35/* zlib deflate based on ZLIB_VERSION "1.1.3" */
36/* zlib inflate based on ZLIB_VERSION "1.2.3" */
37
38/*
39 This is a modified version of zlib for use inside the Linux kernel.
40 The main changes are to perform all memory allocation in advance.
41
42 Inflation Changes:
43 * Z_PACKET_FLUSH is added and used by ppp_deflate. Before returning
44 this checks there is no more input data available and the next data
45 is a STORED block. It also resets the mode to be read for the next
46 data, all as per PPP requirements.
47 * Addition of zlib_inflateIncomp which copies incompressible data into
48 the history window and adjusts the accoutning without calling
49 zlib_inflate itself to inflate the data.
50*/
37 51
38/* 52/*
39 The 'zlib' compression library provides in-memory compression and 53 The 'zlib' compression library provides in-memory compression and
@@ -48,9 +62,18 @@
48 application must provide more input and/or consume the output 62 application must provide more input and/or consume the output
49 (providing more output space) before each call. 63 (providing more output space) before each call.
50 64
65 The compressed data format used by default by the in-memory functions is
66 the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
67 around a deflate stream, which is itself documented in RFC 1951.
68
51 The library also supports reading and writing files in gzip (.gz) format 69 The library also supports reading and writing files in gzip (.gz) format
52 with an interface similar to that of stdio. 70 with an interface similar to that of stdio.
53 71
72 The zlib format was designed to be compact and fast for use in memory
73 and on communications channels. The gzip format was designed for single-
74 file compression on file systems, has a larger header than zlib to maintain
75 directory information, and uses a different, slower check method than zlib.
76
54 The library does not install any signal handler. The decoder checks 77 The library does not install any signal handler. The decoder checks
55 the consistency of the compressed data, so the library should never 78 the consistency of the compressed data, so the library should never
56 crash even in case of corrupted input. 79 crash even in case of corrupted input.
@@ -119,7 +142,8 @@ typedef z_stream *z_streamp;
119#define Z_SYNC_FLUSH 3 142#define Z_SYNC_FLUSH 3
120#define Z_FULL_FLUSH 4 143#define Z_FULL_FLUSH 4
121#define Z_FINISH 5 144#define Z_FINISH 5
122/* Allowed flush values; see deflate() below for details */ 145#define Z_BLOCK 6 /* Only for inflate at present */
146/* Allowed flush values; see deflate() and inflate() below for details */
123 147
124#define Z_OK 0 148#define Z_OK 0
125#define Z_STREAM_END 1 149#define Z_STREAM_END 1
@@ -155,13 +179,6 @@ typedef z_stream *z_streamp;
155 179
156 /* basic functions */ 180 /* basic functions */
157 181
158extern const char * zlib_zlibVersion (void);
159/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
160 If the first character differs, the library code actually used is
161 not compatible with the zlib.h header file used by the application.
162 This check is automatically made by deflateInit and inflateInit.
163 */
164
165extern int zlib_deflate_workspacesize (void); 182extern int zlib_deflate_workspacesize (void);
166/* 183/*
167 Returns the number of bytes that needs to be allocated for a per- 184 Returns the number of bytes that needs to be allocated for a per-
@@ -315,9 +332,9 @@ extern int zlib_inflateInit (z_streamp strm);
315extern int zlib_inflate (z_streamp strm, int flush); 332extern int zlib_inflate (z_streamp strm, int flush);
316/* 333/*
317 inflate decompresses as much data as possible, and stops when the input 334 inflate decompresses as much data as possible, and stops when the input
318 buffer becomes empty or the output buffer becomes full. It may some 335 buffer becomes empty or the output buffer becomes full. It may introduce
319 introduce some output latency (reading input without producing any output) 336 some output latency (reading input without producing any output) except when
320 except when forced to flush. 337 forced to flush.
321 338
322 The detailed semantics are as follows. inflate performs one or both of the 339 The detailed semantics are as follows. inflate performs one or both of the
323 following actions: 340 following actions:
@@ -341,11 +358,26 @@ extern int zlib_inflate (z_streamp strm, int flush);
341 must be called again after making room in the output buffer because there 358 must be called again after making room in the output buffer because there
342 might be more output pending. 359 might be more output pending.
343 360
344 If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much 361 The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
345 output as possible to the output buffer. The flushing behavior of inflate is 362 Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
346 not specified for values of the flush parameter other than Z_SYNC_FLUSH 363 output as possible to the output buffer. Z_BLOCK requests that inflate() stop
347 and Z_FINISH, but the current implementation actually flushes as much output 364 if and when it gets to the next deflate block boundary. When decoding the
348 as possible anyway. 365 zlib or gzip format, this will cause inflate() to return immediately after
366 the header and before the first block. When doing a raw inflate, inflate()
367 will go ahead and process the first block, and will return when it gets to
368 the end of that block, or when it runs out of data.
369
370 The Z_BLOCK option assists in appending to or combining deflate streams.
371 Also to assist in this, on return inflate() will set strm->data_type to the
372 number of unused bits in the last byte taken from strm->next_in, plus 64
373 if inflate() is currently decoding the last block in the deflate stream,
374 plus 128 if inflate() returned immediately after decoding an end-of-block
375 code or decoding the complete header up to just before the first byte of the
376 deflate stream. The end-of-block will not be indicated until all of the
377 uncompressed data from that block has been written to strm->next_out. The
378 number of unused bits may in general be greater than seven, except when
379 bit 7 of data_type is set, in which case the number of unused bits will be
380 less than eight.
349 381
350 inflate() should normally be called until it returns Z_STREAM_END or an 382 inflate() should normally be called until it returns Z_STREAM_END or an
351 error. However if all decompression is to be performed in a single step 383 error. However if all decompression is to be performed in a single step
@@ -355,29 +387,44 @@ extern int zlib_inflate (z_streamp strm, int flush);
355 uncompressed data. (The size of the uncompressed data may have been saved 387 uncompressed data. (The size of the uncompressed data may have been saved
356 by the compressor for this purpose.) The next operation on this stream must 388 by the compressor for this purpose.) The next operation on this stream must
357 be inflateEnd to deallocate the decompression state. The use of Z_FINISH 389 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
358 is never required, but can be used to inform inflate that a faster routine 390 is never required, but can be used to inform inflate that a faster approach
359 may be used for the single inflate() call. 391 may be used for the single inflate() call.
360 392
361 If a preset dictionary is needed at this point (see inflateSetDictionary 393 In this implementation, inflate() always flushes as much output as
362 below), inflate sets strm-adler to the adler32 checksum of the 394 possible to the output buffer, and always uses the faster approach on the
363 dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise 395 first call. So the only effect of the flush parameter in this implementation
364 it sets strm->adler to the adler32 checksum of all output produced 396 is on the return value of inflate(), as noted below, or when it returns early
365 so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or 397 because Z_BLOCK is used.
366 an error code as described below. At the end of the stream, inflate() 398
367 checks that its computed adler32 checksum is equal to that saved by the 399 If a preset dictionary is needed after this call (see inflateSetDictionary
368 compressor and returns Z_STREAM_END only if the checksum is correct. 400 below), inflate sets strm->adler to the adler32 checksum of the dictionary
401 chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
402 strm->adler to the adler32 checksum of all output produced so far (that is,
403 total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
404 below. At the end of the stream, inflate() checks that its computed adler32
405 checksum is equal to that saved by the compressor and returns Z_STREAM_END
406 only if the checksum is correct.
407
408 inflate() will decompress and check either zlib-wrapped or gzip-wrapped
409 deflate data. The header type is detected automatically. Any information
410 contained in the gzip header is not retained, so applications that need that
411 information should instead use raw inflate, see inflateInit2() below, or
412 inflateBack() and perform their own processing of the gzip header and
413 trailer.
369 414
370 inflate() returns Z_OK if some progress has been made (more input processed 415 inflate() returns Z_OK if some progress has been made (more input processed
371 or more output produced), Z_STREAM_END if the end of the compressed data has 416 or more output produced), Z_STREAM_END if the end of the compressed data has
372 been reached and all uncompressed output has been produced, Z_NEED_DICT if a 417 been reached and all uncompressed output has been produced, Z_NEED_DICT if a
373 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was 418 preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
374 corrupted (input stream not conforming to the zlib format or incorrect 419 corrupted (input stream not conforming to the zlib format or incorrect check
375 adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent 420 value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
376 (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not 421 if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
377 enough memory, Z_BUF_ERROR if no progress is possible or if there was not 422 Z_BUF_ERROR if no progress is possible or if there was not enough room in the
378 enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR 423 output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
379 case, the application may then call inflateSync to look for a good 424 inflate() can be called again with more input and more output space to
380 compression block. 425 continue decompressing. If Z_DATA_ERROR is returned, the application may then
426 call inflateSync() to look for a good compression block if a partial recovery
427 of the data is desired.
381*/ 428*/
382 429
383 430
@@ -547,16 +594,36 @@ extern int inflateInit2 (z_streamp strm, int windowBits);
547 The windowBits parameter is the base two logarithm of the maximum window 594 The windowBits parameter is the base two logarithm of the maximum window
548 size (the size of the history buffer). It should be in the range 8..15 for 595 size (the size of the history buffer). It should be in the range 8..15 for
549 this version of the library. The default value is 15 if inflateInit is used 596 this version of the library. The default value is 15 if inflateInit is used
550 instead. If a compressed stream with a larger window size is given as 597 instead. windowBits must be greater than or equal to the windowBits value
551 input, inflate() will return with the error code Z_DATA_ERROR instead of 598 provided to deflateInit2() while compressing, or it must be equal to 15 if
552 trying to allocate a larger window. 599 deflateInit2() was not used. If a compressed stream with a larger window
553 600 size is given as input, inflate() will return with the error code
554 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 601 Z_DATA_ERROR instead of trying to allocate a larger window.
555 memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative 602
556 memLevel). msg is set to null if there is no error message. inflateInit2 603 windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
557 does not perform any decompression apart from reading the zlib header if 604 determines the window size. inflate() will then process raw deflate data,
558 present: this will be done by inflate(). (So next_in and avail_in may be 605 not looking for a zlib or gzip header, not generating a check value, and not
559 modified, but next_out and avail_out are unchanged.) 606 looking for any check values for comparison at the end of the stream. This
607 is for use with other formats that use the deflate compressed data format
608 such as zip. Those formats provide their own check values. If a custom
609 format is developed using the raw deflate format for compressed data, it is
610 recommended that a check value such as an adler32 or a crc32 be applied to
611 the uncompressed data as is done in the zlib, gzip, and zip formats. For
612 most applications, the zlib format should be used as is. Note that comments
613 above on the use in deflateInit2() applies to the magnitude of windowBits.
614
615 windowBits can also be greater than 15 for optional gzip decoding. Add
616 32 to windowBits to enable zlib and gzip decoding with automatic header
617 detection, or add 16 to decode only the gzip format (the zlib format will
618 return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is
619 a crc32 instead of an adler32.
620
621 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
622 memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
623 is set to null if there is no error message. inflateInit2 does not perform
624 any decompression apart from reading the zlib header if present: this will
625 be done by inflate(). (So next_in and avail_in may be modified, but next_out
626 and avail_out are unchanged.)
560*/ 627*/
561 628
562extern int zlib_inflateSetDictionary (z_streamp strm, 629extern int zlib_inflateSetDictionary (z_streamp strm,
@@ -564,16 +631,19 @@ extern int zlib_inflateSetDictionary (z_streamp strm,
564 uInt dictLength); 631 uInt dictLength);
565/* 632/*
566 Initializes the decompression dictionary from the given uncompressed byte 633 Initializes the decompression dictionary from the given uncompressed byte
567 sequence. This function must be called immediately after a call of inflate 634 sequence. This function must be called immediately after a call of inflate,
568 if this call returned Z_NEED_DICT. The dictionary chosen by the compressor 635 if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
569 can be determined from the Adler32 value returned by this call of 636 can be determined from the adler32 value returned by that call of inflate.
570 inflate. The compressor and decompressor must use exactly the same 637 The compressor and decompressor must use exactly the same dictionary (see
571 dictionary (see deflateSetDictionary). 638 deflateSetDictionary). For raw inflate, this function can be called
639 immediately after inflateInit2() or inflateReset() and before any call of
640 inflate() to set the dictionary. The application must insure that the
641 dictionary that was used for compression is provided.
572 642
573 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a 643 inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
574 parameter is invalid (such as NULL dictionary) or the stream state is 644 parameter is invalid (such as NULL dictionary) or the stream state is
575 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the 645 inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
576 expected one (incorrect Adler32 value). inflateSetDictionary does not 646 expected one (incorrect adler32 value). inflateSetDictionary does not
577 perform any decompression: this will be done by subsequent calls of 647 perform any decompression: this will be done by subsequent calls of
578 inflate(). 648 inflate().
579*/ 649*/
@@ -614,40 +684,19 @@ extern int zlib_inflateIncomp (z_stream *strm);
614 containing the data at next_in (except that the data is not output). 684 containing the data at next_in (except that the data is not output).
615*/ 685*/
616 686
617 /* various hacks, don't look :) */
618
619/* deflateInit and inflateInit are macros to allow checking the zlib version
620 * and the compiler's view of z_stream:
621 */
622extern int zlib_deflateInit_ (z_streamp strm, int level,
623 const char *version, int stream_size);
624extern int zlib_inflateInit_ (z_streamp strm,
625 const char *version, int stream_size);
626extern int zlib_deflateInit2_ (z_streamp strm, int level, int method,
627 int windowBits, int memLevel,
628 int strategy, const char *version,
629 int stream_size);
630extern int zlib_inflateInit2_ (z_streamp strm, int windowBits,
631 const char *version, int stream_size);
632#define zlib_deflateInit(strm, level) \ 687#define zlib_deflateInit(strm, level) \
633 zlib_deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) 688 zlib_deflateInit2((strm), (level), Z_DEFLATED, MAX_WBITS, \
689 DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY)
634#define zlib_inflateInit(strm) \ 690#define zlib_inflateInit(strm) \
635 zlib_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) 691 zlib_inflateInit2((strm), DEF_WBITS)
636#define zlib_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
637 zlib_deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
638 (strategy), ZLIB_VERSION, sizeof(z_stream))
639#define zlib_inflateInit2(strm, windowBits) \
640 zlib_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
641 692
693extern int zlib_deflateInit2(z_streamp strm, int level, int method,
694 int windowBits, int memLevel,
695 int strategy);
696extern int zlib_inflateInit2(z_streamp strm, int windowBits);
642 697
643#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) 698#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
644 struct internal_state {int dummy;}; /* hack for buggy compilers */ 699 struct internal_state {int dummy;}; /* hack for buggy compilers */
645#endif 700#endif
646 701
647extern const char * zlib_zError (int err);
648#if 0
649extern int zlib_inflateSyncPoint (z_streamp z);
650#endif
651extern const uLong * zlib_get_crc_table (void);
652
653#endif /* _ZLIB_H */ 702#endif /* _ZLIB_H */
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index 2f135cf6eef1..913bfc226dda 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -11,8 +11,6 @@
11#ifndef _LINUX_ZORRO_H 11#ifndef _LINUX_ZORRO_H
12#define _LINUX_ZORRO_H 12#define _LINUX_ZORRO_H
13 13
14#ifndef __ASSEMBLY__
15
16#include <linux/device.h> 14#include <linux/device.h>
17 15
18 16
@@ -112,45 +110,6 @@ struct ConfigDev {
112 __u32 cd_Unused[4]; /* for whatever the driver wants */ 110 __u32 cd_Unused[4]; /* for whatever the driver wants */
113} __attribute__ ((packed)); 111} __attribute__ ((packed));
114 112
115#else /* __ASSEMBLY__ */
116
117LN_Succ = 0
118LN_Pred = LN_Succ+4
119LN_Type = LN_Pred+4
120LN_Pri = LN_Type+1
121LN_Name = LN_Pri+1
122LN_sizeof = LN_Name+4
123
124ER_Type = 0
125ER_Product = ER_Type+1
126ER_Flags = ER_Product+1
127ER_Reserved03 = ER_Flags+1
128ER_Manufacturer = ER_Reserved03+1
129ER_SerialNumber = ER_Manufacturer+2
130ER_InitDiagVec = ER_SerialNumber+4
131ER_Reserved0c = ER_InitDiagVec+2
132ER_Reserved0d = ER_Reserved0c+1
133ER_Reserved0e = ER_Reserved0d+1
134ER_Reserved0f = ER_Reserved0e+1
135ER_sizeof = ER_Reserved0f+1
136
137CD_Node = 0
138CD_Flags = CD_Node+LN_sizeof
139CD_Pad = CD_Flags+1
140CD_Rom = CD_Pad+1
141CD_BoardAddr = CD_Rom+ER_sizeof
142CD_BoardSize = CD_BoardAddr+4
143CD_SlotAddr = CD_BoardSize+4
144CD_SlotSize = CD_SlotAddr+2
145CD_Driver = CD_SlotSize+2
146CD_NextCD = CD_Driver+4
147CD_Unused = CD_NextCD+4
148CD_sizeof = CD_Unused+(4*4)
149
150#endif /* __ASSEMBLY__ */
151
152#ifndef __ASSEMBLY__
153
154#define ZORRO_NUM_AUTO 16 113#define ZORRO_NUM_AUTO 16
155 114
156#ifdef __KERNEL__ 115#ifdef __KERNEL__
@@ -290,7 +249,6 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128);
290#define Z2RAM_CHUNKSHIFT (16) 249#define Z2RAM_CHUNKSHIFT (16)
291 250
292 251
293#endif /* !__ASSEMBLY__ */
294#endif /* __KERNEL__ */ 252#endif /* __KERNEL__ */
295 253
296#endif /* _LINUX_ZORRO_H */ 254#endif /* _LINUX_ZORRO_H */
diff --git a/include/linux/zutil.h b/include/linux/zutil.h
index ee0c59cf2136..6adfa9a6ffe9 100644
--- a/include/linux/zutil.h
+++ b/include/linux/zutil.h
@@ -23,18 +23,6 @@ typedef unsigned long ulg;
23 23
24 /* common constants */ 24 /* common constants */
25 25
26#ifndef DEF_WBITS
27# define DEF_WBITS MAX_WBITS
28#endif
29/* default windowBits for decompression. MAX_WBITS is for compression only */
30
31#if MAX_MEM_LEVEL >= 8
32# define DEF_MEM_LEVEL 8
33#else
34# define DEF_MEM_LEVEL MAX_MEM_LEVEL
35#endif
36/* default memLevel */
37
38#define STORED_BLOCK 0 26#define STORED_BLOCK 0
39#define STATIC_TREES 1 27#define STATIC_TREES 1
40#define DYN_TREES 2 28#define DYN_TREES 2