aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild4
-rw-r--r--include/linux/a.out.h8
-rw-r--r--include/linux/ac97_codec.h7
-rw-r--r--include/linux/acct.h4
-rw-r--r--include/linux/async_tx.h13
-rw-r--r--include/linux/ata_platform.h (renamed from include/linux/pata_platform.h)13
-rw-r--r--include/linux/bootmem.h17
-rw-r--r--include/linux/cgroup.h16
-rw-r--r--include/linux/cgroup_subsys.h5
-rw-r--r--include/linux/compat.h8
-rw-r--r--include/linux/cpuidle.h2
-rw-r--r--include/linux/dmaengine.h29
-rw-r--r--include/linux/ds1wm.h1
-rw-r--r--include/linux/efs_fs.h2
-rw-r--r--include/linux/elf.h2
-rw-r--r--include/linux/elfcore.h4
-rw-r--r--include/linux/err.h13
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/ext4_fs.h2
-rw-r--r--include/linux/fs.h31
-rw-r--r--include/linux/fsnotify.h22
-rw-r--r--include/linux/hash.h42
-rw-r--r--include/linux/hayesesp.h4
-rw-r--r--include/linux/hdlc.h25
-rw-r--r--include/linux/i2c/pca953x.h (renamed from include/linux/i2c/pca9539.h)2
-rw-r--r--include/linux/if_vlan.h7
-rw-r--r--include/linux/init.h1
-rw-r--r--include/linux/interrupt.h2
-rw-r--r--include/linux/isdn.h1
-rw-r--r--include/linux/isicom.h2
-rw-r--r--include/linux/istallion.h1
-rw-r--r--include/linux/jbd.h3
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/kexec.h12
-rw-r--r--include/linux/kprobes.h3
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/log2.h16
-rw-r--r--include/linux/loop.h1
-rw-r--r--include/linux/lp.h4
-rw-r--r--include/linux/memcontrol.h190
-rw-r--r--include/linux/mfd/asic3.h497
-rw-r--r--include/linux/mm_types.h6
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/percpu.h2
-rw-r--r--include/linux/pkt_cls.h1
-rw-r--r--include/linux/pnp.h1
-rw-r--r--include/linux/ptrace.h35
-rw-r--r--include/linux/qnx4_fs.h1
-rw-r--r--include/linux/raid/bitmap.h3
-rw-r--r--include/linux/raid/md_k.h23
-rw-r--r--include/linux/rcupdate.h11
-rw-r--r--include/linux/res_counter.h127
-rw-r--r--include/linux/rmap.h5
-rw-r--r--include/linux/sched.h3
-rw-r--r--include/linux/serial167.h14
-rw-r--r--include/linux/shm.h8
-rw-r--r--include/linux/signal.h2
-rw-r--r--include/linux/sm501.h2
-rw-r--r--include/linux/ssb/ssb.h9
-rw-r--r--include/linux/stallion.h1
-rw-r--r--include/linux/swap.h4
-rw-r--r--include/linux/timex.h2
-rw-r--r--include/linux/tty.h8
-rw-r--r--include/linux/vt_kern.h1
-rw-r--r--include/linux/w1-gpio.h23
65 files changed, 1152 insertions, 163 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 93631229fd5c..2ebf068ba504 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -18,7 +18,6 @@ header-y += usb/
18 18
19header-y += affs_hardblocks.h 19header-y += affs_hardblocks.h
20header-y += aio_abi.h 20header-y += aio_abi.h
21header-y += a.out.h
22header-y += arcfb.h 21header-y += arcfb.h
23header-y += atmapi.h 22header-y += atmapi.h
24header-y += atmbr2684.h 23header-y += atmbr2684.h
@@ -60,7 +59,6 @@ header-y += dqblk_v2.h
60header-y += dqblk_xfs.h 59header-y += dqblk_xfs.h
61header-y += efs_fs_sb.h 60header-y += efs_fs_sb.h
62header-y += elf-fdpic.h 61header-y += elf-fdpic.h
63header-y += elf.h
64header-y += elf-em.h 62header-y += elf-em.h
65header-y += fadvise.h 63header-y += fadvise.h
66header-y += fd.h 64header-y += fd.h
@@ -190,6 +188,7 @@ unifdef-y += dccp.h
190unifdef-y += dirent.h 188unifdef-y += dirent.h
191unifdef-y += dlm.h 189unifdef-y += dlm.h
192unifdef-y += edd.h 190unifdef-y += edd.h
191unifdef-y += elf.h
193unifdef-y += elfcore.h 192unifdef-y += elfcore.h
194unifdef-y += errno.h 193unifdef-y += errno.h
195unifdef-y += errqueue.h 194unifdef-y += errqueue.h
@@ -344,7 +343,6 @@ unifdef-y += uinput.h
344unifdef-y += uio.h 343unifdef-y += uio.h
345unifdef-y += unistd.h 344unifdef-y += unistd.h
346unifdef-y += usbdevice_fs.h 345unifdef-y += usbdevice_fs.h
347unifdef-y += user.h
348unifdef-y += utsname.h 346unifdef-y += utsname.h
349unifdef-y += videodev2.h 347unifdef-y += videodev2.h
350unifdef-y += videodev.h 348unifdef-y += videodev.h
diff --git a/include/linux/a.out.h b/include/linux/a.out.h
index f913cc3e1b0d..82cd918f2ab7 100644
--- a/include/linux/a.out.h
+++ b/include/linux/a.out.h
@@ -128,12 +128,20 @@ enum machine_type {
128#endif 128#endif
129 129
130#ifdef linux 130#ifdef linux
131#ifdef __KERNEL__
131#include <asm/page.h> 132#include <asm/page.h>
133#else
134#include <unistd.h>
135#endif
132#if defined(__i386__) || defined(__mc68000__) 136#if defined(__i386__) || defined(__mc68000__)
133#define SEGMENT_SIZE 1024 137#define SEGMENT_SIZE 1024
134#else 138#else
135#ifndef SEGMENT_SIZE 139#ifndef SEGMENT_SIZE
140#ifdef __KERNEL__
136#define SEGMENT_SIZE PAGE_SIZE 141#define SEGMENT_SIZE PAGE_SIZE
142#else
143#define SEGMENT_SIZE getpagesize()
144#endif
137#endif 145#endif
138#endif 146#endif
139#endif 147#endif
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h
index 22eb9367235a..0260c3e79fdd 100644
--- a/include/linux/ac97_codec.h
+++ b/include/linux/ac97_codec.h
@@ -326,11 +326,7 @@ struct ac97_ops
326#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */ 326#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */
327}; 327};
328 328
329extern int ac97_read_proc (char *page_out, char **start, off_t off,
330 int count, int *eof, void *data);
331extern int ac97_probe_codec(struct ac97_codec *); 329extern int ac97_probe_codec(struct ac97_codec *);
332extern unsigned int ac97_set_adc_rate(struct ac97_codec *codec, unsigned int rate);
333extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate);
334 330
335extern struct ac97_codec *ac97_alloc_codec(void); 331extern struct ac97_codec *ac97_alloc_codec(void);
336extern void ac97_release_codec(struct ac97_codec *codec); 332extern void ac97_release_codec(struct ac97_codec *codec);
@@ -363,7 +359,4 @@ struct ac97_quirk {
363 int type; /* quirk type above */ 359 int type; /* quirk type above */
364}; 360};
365 361
366struct pci_dev;
367extern int ac97_tune_hardware(struct pci_dev *pdev, struct ac97_quirk *quirk, int override);
368
369#endif /* _AC97_CODEC_H_ */ 362#endif /* _AC97_CODEC_H_ */
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 302eb727ecb8..e8cae54e8d88 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -173,7 +173,11 @@ typedef struct acct acct_t;
173static inline u32 jiffies_to_AHZ(unsigned long x) 173static inline u32 jiffies_to_AHZ(unsigned long x)
174{ 174{
175#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 175#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0
176# if HZ < AHZ
177 return x * (AHZ / HZ);
178# else
176 return x / (HZ / AHZ); 179 return x / (HZ / AHZ);
180# endif
177#else 181#else
178 u64 tmp = (u64)x * TICK_NSEC; 182 u64 tmp = (u64)x * TICK_NSEC;
179 do_div(tmp, (NSEC_PER_SEC / AHZ)); 183 do_div(tmp, (NSEC_PER_SEC / AHZ));
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h
index bdca3f1b3213..eb640f0acfac 100644
--- a/include/linux/async_tx.h
+++ b/include/linux/async_tx.h
@@ -47,7 +47,6 @@ struct dma_chan_ref {
47 * address is an implied source, whereas the asynchronous case it must be listed 47 * address is an implied source, whereas the asynchronous case it must be listed
48 * as a source. The destination address must be the first address in the source 48 * as a source. The destination address must be the first address in the source
49 * array. 49 * array.
50 * @ASYNC_TX_ASSUME_COHERENT: skip cache maintenance operations
51 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a 50 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
52 * dependency chain 51 * dependency chain
53 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. 52 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
@@ -55,7 +54,6 @@ struct dma_chan_ref {
55enum async_tx_flags { 54enum async_tx_flags {
56 ASYNC_TX_XOR_ZERO_DST = (1 << 0), 55 ASYNC_TX_XOR_ZERO_DST = (1 << 0),
57 ASYNC_TX_XOR_DROP_DST = (1 << 1), 56 ASYNC_TX_XOR_DROP_DST = (1 << 1),
58 ASYNC_TX_ASSUME_COHERENT = (1 << 2),
59 ASYNC_TX_ACK = (1 << 3), 57 ASYNC_TX_ACK = (1 << 3),
60 ASYNC_TX_DEP_ACK = (1 << 4), 58 ASYNC_TX_DEP_ACK = (1 << 4),
61}; 59};
@@ -64,9 +62,15 @@ enum async_tx_flags {
64void async_tx_issue_pending_all(void); 62void async_tx_issue_pending_all(void);
65enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); 63enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
66void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx); 64void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx);
65#ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL
66#include <asm/async_tx.h>
67#else
68#define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \
69 __async_tx_find_channel(dep, type)
67struct dma_chan * 70struct dma_chan *
68async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, 71__async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
69 enum dma_transaction_type tx_type); 72 enum dma_transaction_type tx_type);
73#endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */
70#else 74#else
71static inline void async_tx_issue_pending_all(void) 75static inline void async_tx_issue_pending_all(void)
72{ 76{
@@ -88,7 +92,8 @@ async_tx_run_dependencies(struct dma_async_tx_descriptor *tx,
88 92
89static inline struct dma_chan * 93static inline struct dma_chan *
90async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, 94async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
91 enum dma_transaction_type tx_type) 95 enum dma_transaction_type tx_type, struct page **dst, int dst_count,
96 struct page **src, int src_count, size_t len)
92{ 97{
93 return NULL; 98 return NULL;
94} 99}
diff --git a/include/linux/pata_platform.h b/include/linux/ata_platform.h
index 6a7a92db294c..b856a2a590d9 100644
--- a/include/linux/pata_platform.h
+++ b/include/linux/ata_platform.h
@@ -1,5 +1,5 @@
1#ifndef __LINUX_PATA_PLATFORM_H 1#ifndef __LINUX_ATA_PLATFORM_H
2#define __LINUX_PATA_PLATFORM_H 2#define __LINUX_ATA_PLATFORM_H
3 3
4struct pata_platform_info { 4struct pata_platform_info {
5 /* 5 /*
@@ -24,4 +24,11 @@ extern int __devinit __pata_platform_probe(struct device *dev,
24 24
25extern int __devexit __pata_platform_remove(struct device *dev); 25extern int __devexit __pata_platform_remove(struct device *dev);
26 26
27#endif /* __LINUX_PATA_PLATFORM_H */ 27/*
28 * Marvell SATA private data
29 */
30struct mv_sata_platform_data {
31 int n_ports; /* number of sata ports */
32};
33
34#endif /* __LINUX_ATA_PLATFORM_H */
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 0365ec9fc0c9..4e4e340592fb 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -60,8 +60,20 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata,
60 unsigned long goal, 60 unsigned long goal,
61 unsigned long limit); 61 unsigned long limit);
62 62
63/*
64 * flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
65 * the architecture-specific code should honor this)
66 */
67#define BOOTMEM_DEFAULT 0
68#define BOOTMEM_EXCLUSIVE (1<<0)
69
63#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 70#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
64extern void reserve_bootmem(unsigned long addr, unsigned long size); 71/*
72 * If flags is 0, then the return value is always 0 (success). If
73 * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the
74 * memory already was reserved.
75 */
76extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags);
65#define alloc_bootmem(x) \ 77#define alloc_bootmem(x) \
66 __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) 78 __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
67#define alloc_bootmem_low(x) \ 79#define alloc_bootmem_low(x) \
@@ -84,7 +96,8 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
84 unsigned long endpfn); 96 unsigned long endpfn);
85extern void reserve_bootmem_node(pg_data_t *pgdat, 97extern void reserve_bootmem_node(pg_data_t *pgdat,
86 unsigned long physaddr, 98 unsigned long physaddr,
87 unsigned long size); 99 unsigned long size,
100 int flags);
88extern void free_bootmem_node(pg_data_t *pgdat, 101extern void free_bootmem_node(pg_data_t *pgdat,
89 unsigned long addr, 102 unsigned long addr,
90 unsigned long size); 103 unsigned long size);
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 87479328d46d..ff9055fc3d2a 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -14,6 +14,7 @@
14#include <linux/nodemask.h> 14#include <linux/nodemask.h>
15#include <linux/rcupdate.h> 15#include <linux/rcupdate.h>
16#include <linux/cgroupstats.h> 16#include <linux/cgroupstats.h>
17#include <linux/prio_heap.h>
17 18
18#ifdef CONFIG_CGROUPS 19#ifdef CONFIG_CGROUPS
19 20
@@ -207,6 +208,14 @@ struct cftype {
207 int (*release) (struct inode *inode, struct file *file); 208 int (*release) (struct inode *inode, struct file *file);
208}; 209};
209 210
211struct cgroup_scanner {
212 struct cgroup *cg;
213 int (*test_task)(struct task_struct *p, struct cgroup_scanner *scan);
214 void (*process_task)(struct task_struct *p,
215 struct cgroup_scanner *scan);
216 struct ptr_heap *heap;
217};
218
210/* Add a new file to the given cgroup directory. Should only be 219/* Add a new file to the given cgroup directory. Should only be
211 * called by subsystems from within a populate() method */ 220 * called by subsystems from within a populate() method */
212int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, 221int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys,
@@ -233,6 +242,7 @@ int cgroup_is_descendant(const struct cgroup *cont);
233struct cgroup_subsys { 242struct cgroup_subsys {
234 struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, 243 struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss,
235 struct cgroup *cont); 244 struct cgroup *cont);
245 void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cont);
236 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); 246 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont);
237 int (*can_attach)(struct cgroup_subsys *ss, 247 int (*can_attach)(struct cgroup_subsys *ss,
238 struct cgroup *cont, struct task_struct *tsk); 248 struct cgroup *cont, struct task_struct *tsk);
@@ -298,11 +308,17 @@ struct cgroup_iter {
298 * returns NULL or until you want to end the iteration 308 * returns NULL or until you want to end the iteration
299 * 309 *
300 * 3) call cgroup_iter_end() to destroy the iterator. 310 * 3) call cgroup_iter_end() to destroy the iterator.
311 *
312 * Or, call cgroup_scan_tasks() to iterate through every task in a cpuset.
313 * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task()
314 * callback, but not while calling the process_task() callback.
301 */ 315 */
302void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); 316void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it);
303struct task_struct *cgroup_iter_next(struct cgroup *cont, 317struct task_struct *cgroup_iter_next(struct cgroup *cont,
304 struct cgroup_iter *it); 318 struct cgroup_iter *it);
305void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); 319void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it);
320int cgroup_scan_tasks(struct cgroup_scanner *scan);
321int cgroup_attach_task(struct cgroup *, struct task_struct *);
306 322
307#else /* !CONFIG_CGROUPS */ 323#else /* !CONFIG_CGROUPS */
308 324
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index 9ec43186ba80..228235c5ae53 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -37,3 +37,8 @@ SUBSYS(cpuacct)
37 37
38/* */ 38/* */
39 39
40#ifdef CONFIG_CGROUP_MEM_CONT
41SUBSYS(mem_cgroup)
42#endif
43
44/* */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index ae0a483bef9b..a671dbff7a1f 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -257,16 +257,8 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
257/* 257/*
258 * epoll (fs/eventpoll.c) compat bits follow ... 258 * epoll (fs/eventpoll.c) compat bits follow ...
259 */ 259 */
260#ifndef CONFIG_HAS_COMPAT_EPOLL_EVENT
261struct epoll_event; 260struct epoll_event;
262#define compat_epoll_event epoll_event 261#define compat_epoll_event epoll_event
263#else
264asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
265 struct compat_epoll_event __user *event);
266asmlinkage long compat_sys_epoll_wait(int epfd,
267 struct compat_epoll_event __user *events,
268 int maxevents, int timeout);
269#endif
270asmlinkage long compat_sys_epoll_pwait(int epfd, 262asmlinkage long compat_sys_epoll_pwait(int epfd,
271 struct compat_epoll_event __user *events, 263 struct compat_epoll_event __user *events,
272 int maxevents, int timeout, 264 int maxevents, int timeout,
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index c4e00161a247..b0fd85ab9efb 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -79,7 +79,7 @@ struct cpuidle_state_kobj {
79}; 79};
80 80
81struct cpuidle_device { 81struct cpuidle_device {
82 int enabled:1; 82 unsigned int enabled:1;
83 unsigned int cpu; 83 unsigned int cpu;
84 84
85 int last_residency; 85 int last_residency;
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 5c84bf897593..acbb364674ff 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -95,6 +95,15 @@ enum dma_transaction_type {
95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1) 95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1)
96 96
97/** 97/**
98 * enum dma_prep_flags - DMA flags to augment operation preparation
99 * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
100 * this transaction
101 */
102enum dma_prep_flags {
103 DMA_PREP_INTERRUPT = (1 << 0),
104};
105
106/**
98 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. 107 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t.
99 * See linux/cpumask.h 108 * See linux/cpumask.h
100 */ 109 */
@@ -209,8 +218,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param);
209 * descriptors 218 * descriptors
210 * @chan: target channel for this operation 219 * @chan: target channel for this operation
211 * @tx_submit: set the prepared descriptor(s) to be executed by the engine 220 * @tx_submit: set the prepared descriptor(s) to be executed by the engine
212 * @tx_set_dest: set a destination address in a hardware descriptor
213 * @tx_set_src: set a source address in a hardware descriptor
214 * @callback: routine to call after this operation is complete 221 * @callback: routine to call after this operation is complete
215 * @callback_param: general parameter to pass to the callback routine 222 * @callback_param: general parameter to pass to the callback routine
216 * ---async_tx api specific fields--- 223 * ---async_tx api specific fields---
@@ -227,10 +234,6 @@ struct dma_async_tx_descriptor {
227 struct list_head tx_list; 234 struct list_head tx_list;
228 struct dma_chan *chan; 235 struct dma_chan *chan;
229 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); 236 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
230 void (*tx_set_dest)(dma_addr_t addr,
231 struct dma_async_tx_descriptor *tx, int index);
232 void (*tx_set_src)(dma_addr_t addr,
233 struct dma_async_tx_descriptor *tx, int index);
234 dma_async_tx_callback callback; 237 dma_async_tx_callback callback;
235 void *callback_param; 238 void *callback_param;
236 struct list_head depend_list; 239 struct list_head depend_list;
@@ -279,15 +282,17 @@ struct dma_device {
279 void (*device_free_chan_resources)(struct dma_chan *chan); 282 void (*device_free_chan_resources)(struct dma_chan *chan);
280 283
281 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( 284 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)(
282 struct dma_chan *chan, size_t len, int int_en); 285 struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
286 size_t len, unsigned long flags);
283 struct dma_async_tx_descriptor *(*device_prep_dma_xor)( 287 struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
284 struct dma_chan *chan, unsigned int src_cnt, size_t len, 288 struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
285 int int_en); 289 unsigned int src_cnt, size_t len, unsigned long flags);
286 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( 290 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)(
287 struct dma_chan *chan, unsigned int src_cnt, size_t len, 291 struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt,
288 u32 *result, int int_en); 292 size_t len, u32 *result, unsigned long flags);
289 struct dma_async_tx_descriptor *(*device_prep_dma_memset)( 293 struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
290 struct dma_chan *chan, int value, size_t len, int int_en); 294 struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
295 unsigned long flags);
291 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( 296 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
292 struct dma_chan *chan); 297 struct dma_chan *chan);
293 298
diff --git a/include/linux/ds1wm.h b/include/linux/ds1wm.h
index 31f6e3c427fb..d3c65e48a2e7 100644
--- a/include/linux/ds1wm.h
+++ b/include/linux/ds1wm.h
@@ -6,6 +6,7 @@ struct ds1wm_platform_data {
6 * e.g. on h5xxx and h2200 this is 2 6 * e.g. on h5xxx and h2200 this is 2
7 * (registers aligned to 4-byte boundaries), 7 * (registers aligned to 4-byte boundaries),
8 * while on hx4700 this is 1 */ 8 * while on hx4700 this is 1 */
9 int active_high;
9 void (*enable)(struct platform_device *pdev); 10 void (*enable)(struct platform_device *pdev);
10 void (*disable)(struct platform_device *pdev); 11 void (*disable)(struct platform_device *pdev);
11}; 12};
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index dd57fe523e97..a695d63a07af 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -41,7 +41,7 @@ extern const struct inode_operations efs_dir_inode_operations;
41extern const struct file_operations efs_dir_operations; 41extern const struct file_operations efs_dir_operations;
42extern const struct address_space_operations efs_symlink_aops; 42extern const struct address_space_operations efs_symlink_aops;
43 43
44extern void efs_read_inode(struct inode *); 44extern struct inode *efs_iget(struct super_block *, unsigned long);
45extern efs_block_t efs_map_block(struct inode *, efs_block_t); 45extern efs_block_t efs_map_block(struct inode *, efs_block_t);
46extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); 46extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int);
47 47
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 30eb6fbd5323..bad1b16ec49a 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -3,7 +3,9 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/elf-em.h> 5#include <linux/elf-em.h>
6#ifdef __KERNEL__
6#include <asm/elf.h> 7#include <asm/elf.h>
8#endif
7 9
8struct file; 10struct file;
9 11
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 9631dddae348..5ca54d77079f 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -4,7 +4,9 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/signal.h> 5#include <linux/signal.h>
6#include <linux/time.h> 6#include <linux/time.h>
7#ifdef __KERNEL__
7#include <linux/user.h> 8#include <linux/user.h>
9#endif
8#include <linux/ptrace.h> 10#include <linux/ptrace.h>
9 11
10struct elf_siginfo 12struct elf_siginfo
@@ -14,7 +16,9 @@ struct elf_siginfo
14 int si_errno; /* errno */ 16 int si_errno; /* errno */
15}; 17};
16 18
19#ifdef __KERNEL__
17#include <asm/elf.h> 20#include <asm/elf.h>
21#endif
18 22
19#ifndef __KERNEL__ 23#ifndef __KERNEL__
20typedef elf_greg_t greg_t; 24typedef elf_greg_t greg_t;
diff --git a/include/linux/err.h b/include/linux/err.h
index 1ab1d44f8d3b..ec87f3142bf3 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -34,6 +34,19 @@ static inline long IS_ERR(const void *ptr)
34 return IS_ERR_VALUE((unsigned long)ptr); 34 return IS_ERR_VALUE((unsigned long)ptr);
35} 35}
36 36
37/**
38 * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
39 * @ptr: The pointer to cast.
40 *
41 * Explicitly cast an error-valued pointer to another pointer type in such a
42 * way as to make it clear that's what's going on.
43 */
44static inline void *ERR_CAST(const void *ptr)
45{
46 /* cast away the const */
47 return (void *) ptr;
48}
49
37#endif 50#endif
38 51
39#endif /* _LINUX_ERR_H */ 52#endif /* _LINUX_ERR_H */
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 241c01cb92b2..36c540396377 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -823,7 +823,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
823 sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, 823 sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
824 int create, int extend_disksize); 824 int create, int extend_disksize);
825 825
826extern void ext3_read_inode (struct inode *); 826extern struct inode *ext3_iget(struct super_block *, unsigned long);
827extern int ext3_write_inode (struct inode *, int); 827extern int ext3_write_inode (struct inode *, int);
828extern int ext3_setattr (struct dentry *, struct iattr *); 828extern int ext3_setattr (struct dentry *, struct iattr *);
829extern void ext3_delete_inode (struct inode *); 829extern void ext3_delete_inode (struct inode *);
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index 1852313fc7c7..c4f635a4dd25 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -1024,7 +1024,7 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode,
1024 struct buffer_head *bh_result, 1024 struct buffer_head *bh_result,
1025 int create, int extend_disksize); 1025 int create, int extend_disksize);
1026 1026
1027extern void ext4_read_inode (struct inode *); 1027extern struct inode *ext4_iget(struct super_block *, unsigned long);
1028extern int ext4_write_inode (struct inode *, int); 1028extern int ext4_write_inode (struct inode *, int);
1029extern int ext4_setattr (struct dentry *, struct iattr *); 1029extern int ext4_setattr (struct dentry *, struct iattr *);
1030extern void ext4_delete_inode (struct inode *); 1030extern void ext4_delete_inode (struct inode *);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 56bd421c1208..36b7abefacbe 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -21,7 +21,7 @@
21 21
22/* Fixed constants first: */ 22/* Fixed constants first: */
23#undef NR_OPEN 23#undef NR_OPEN
24#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */ 24extern int sysctl_nr_open;
25#define INR_OPEN 1024 /* Initial setting for nfile rlimits */ 25#define INR_OPEN 1024 /* Initial setting for nfile rlimits */
26 26
27#define BLOCK_SIZE_BITS 10 27#define BLOCK_SIZE_BITS 10
@@ -977,7 +977,6 @@ extern int send_sigurg(struct fown_struct *fown);
977extern struct list_head super_blocks; 977extern struct list_head super_blocks;
978extern spinlock_t sb_lock; 978extern spinlock_t sb_lock;
979 979
980#define sb_entry(list) list_entry((list), struct super_block, s_list)
981#define S_BIAS (1<<30) 980#define S_BIAS (1<<30)
982struct super_block { 981struct super_block {
983 struct list_head s_list; /* Keep this first */ 982 struct list_head s_list; /* Keep this first */
@@ -1242,8 +1241,6 @@ struct super_operations {
1242 struct inode *(*alloc_inode)(struct super_block *sb); 1241 struct inode *(*alloc_inode)(struct super_block *sb);
1243 void (*destroy_inode)(struct inode *); 1242 void (*destroy_inode)(struct inode *);
1244 1243
1245 void (*read_inode) (struct inode *);
1246
1247 void (*dirty_inode) (struct inode *); 1244 void (*dirty_inode) (struct inode *);
1248 int (*write_inode) (struct inode *, int); 1245 int (*write_inode) (struct inode *, int);
1249 void (*put_inode) (struct inode *); 1246 void (*put_inode) (struct inode *);
@@ -1279,8 +1276,10 @@ struct super_operations {
1279 * 1276 *
1280 * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. 1277 * Two bits are used for locking and completion notification, I_LOCK and I_SYNC.
1281 * 1278 *
1282 * I_DIRTY_SYNC Inode itself is dirty. 1279 * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on
1283 * I_DIRTY_DATASYNC Data-related inode changes pending 1280 * fdatasync(). i_atime is the usual cause.
1281 * I_DIRTY_DATASYNC Inode is dirty and must be written on fdatasync(), f.e.
1282 * because i_size changed.
1284 * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. 1283 * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean.
1285 * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both 1284 * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both
1286 * are cleared by unlock_new_inode(), called from iget(). 1285 * are cleared by unlock_new_inode(), called from iget().
@@ -1312,8 +1311,6 @@ struct super_operations {
1312 * purpose reduces latency and prevents some filesystem- 1311 * purpose reduces latency and prevents some filesystem-
1313 * specific deadlocks. 1312 * specific deadlocks.
1314 * 1313 *
1315 * Q: Why does I_DIRTY_DATASYNC exist? It appears as if it could be replaced
1316 * by (I_DIRTY_SYNC|I_DIRTY_PAGES).
1317 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1314 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1318 * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on 1315 * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on
1319 * I_CLEAR? If not, why? 1316 * I_CLEAR? If not, why?
@@ -1768,19 +1765,8 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te
1768extern struct inode * iget_locked(struct super_block *, unsigned long); 1765extern struct inode * iget_locked(struct super_block *, unsigned long);
1769extern void unlock_new_inode(struct inode *); 1766extern void unlock_new_inode(struct inode *);
1770 1767
1771static inline struct inode *iget(struct super_block *sb, unsigned long ino)
1772{
1773 struct inode *inode = iget_locked(sb, ino);
1774
1775 if (inode && (inode->i_state & I_NEW)) {
1776 sb->s_op->read_inode(inode);
1777 unlock_new_inode(inode);
1778 }
1779
1780 return inode;
1781}
1782
1783extern void __iget(struct inode * inode); 1768extern void __iget(struct inode * inode);
1769extern void iget_failed(struct inode *);
1784extern void clear_inode(struct inode *); 1770extern void clear_inode(struct inode *);
1785extern void destroy_inode(struct inode *); 1771extern void destroy_inode(struct inode *);
1786extern struct inode *new_inode(struct super_block *); 1772extern struct inode *new_inode(struct super_block *);
@@ -1942,7 +1928,9 @@ extern int vfs_stat_fd(int dfd, char __user *, struct kstat *);
1942extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *); 1928extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *);
1943extern int vfs_fstat(unsigned int, struct kstat *); 1929extern int vfs_fstat(unsigned int, struct kstat *);
1944 1930
1945extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); 1931extern long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
1932extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
1933 unsigned long arg);
1946 1934
1947extern void get_filesystem(struct file_system_type *fs); 1935extern void get_filesystem(struct file_system_type *fs);
1948extern void put_filesystem(struct file_system_type *fs); 1936extern void put_filesystem(struct file_system_type *fs);
@@ -2113,6 +2101,7 @@ struct ctl_table;
2113int proc_nr_files(struct ctl_table *table, int write, struct file *filp, 2101int proc_nr_files(struct ctl_table *table, int write, struct file *filp,
2114 void __user *buffer, size_t *lenp, loff_t *ppos); 2102 void __user *buffer, size_t *lenp, loff_t *ppos);
2115 2103
2104int get_filesystem_list(char * buf);
2116 2105
2117#endif /* __KERNEL__ */ 2106#endif /* __KERNEL__ */
2118#endif /* _LINUX_FS_H */ 2107#endif /* _LINUX_FS_H */
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 2bd31fa623b6..d4b7c4ac72e6 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -92,6 +92,14 @@ static inline void fsnotify_inoderemove(struct inode *inode)
92} 92}
93 93
94/* 94/*
95 * fsnotify_link_count - inode's link count changed
96 */
97static inline void fsnotify_link_count(struct inode *inode)
98{
99 inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL);
100}
101
102/*
95 * fsnotify_create - 'name' was linked in 103 * fsnotify_create - 'name' was linked in
96 */ 104 */
97static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) 105static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
@@ -103,6 +111,20 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
103} 111}
104 112
105/* 113/*
114 * fsnotify_link - new hardlink in 'inode' directory
115 * Note: We have to pass also the linked inode ptr as some filesystems leave
116 * new_dentry->d_inode NULL and instantiate inode pointer later
117 */
118static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry)
119{
120 inode_dir_notify(dir, DN_CREATE);
121 inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name,
122 inode);
123 fsnotify_link_count(inode);
124 audit_inode_child(new_dentry->d_name.name, new_dentry, dir);
125}
126
127/*
106 * fsnotify_mkdir - directory 'name' was created 128 * fsnotify_mkdir - directory 'name' was created
107 */ 129 */
108static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) 130static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
diff --git a/include/linux/hash.h b/include/linux/hash.h
index acf17bb8e7f9..06d25c189cc5 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -1,6 +1,6 @@
1#ifndef _LINUX_HASH_H 1#ifndef _LINUX_HASH_H
2#define _LINUX_HASH_H 2#define _LINUX_HASH_H
3/* Fast hashing routine for a long. 3/* Fast hashing routine for ints, longs and pointers.
4 (C) 2002 William Lee Irwin III, IBM */ 4 (C) 2002 William Lee Irwin III, IBM */
5 5
6/* 6/*
@@ -13,23 +13,30 @@
13 * them can use shifts and additions instead of multiplications for 13 * them can use shifts and additions instead of multiplications for
14 * machines where multiplications are slow. 14 * machines where multiplications are slow.
15 */ 15 */
16#if BITS_PER_LONG == 32 16
17#include <asm/types.h>
18
17/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ 19/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
18#define GOLDEN_RATIO_PRIME 0x9e370001UL 20#define GOLDEN_RATIO_PRIME_32 0x9e370001UL
19#elif BITS_PER_LONG == 64
20/* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */ 21/* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
21#define GOLDEN_RATIO_PRIME 0x9e37fffffffc0001UL 22#define GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001UL
23
24#if BITS_PER_LONG == 32
25#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_32
26#define hash_long(val, bits) hash_32(val, bits)
27#elif BITS_PER_LONG == 64
28#define hash_long(val, bits) hash_64(val, bits)
29#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_64
22#else 30#else
23#error Define GOLDEN_RATIO_PRIME for your wordsize. 31#error Wordsize not 32 or 64
24#endif 32#endif
25 33
26static inline unsigned long hash_long(unsigned long val, unsigned int bits) 34static inline u64 hash_64(u64 val, unsigned int bits)
27{ 35{
28 unsigned long hash = val; 36 u64 hash = val;
29 37
30#if BITS_PER_LONG == 64
31 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ 38 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */
32 unsigned long n = hash; 39 u64 n = hash;
33 n <<= 18; 40 n <<= 18;
34 hash -= n; 41 hash -= n;
35 n <<= 33; 42 n <<= 33;
@@ -42,15 +49,20 @@ static inline unsigned long hash_long(unsigned long val, unsigned int bits)
42 hash += n; 49 hash += n;
43 n <<= 2; 50 n <<= 2;
44 hash += n; 51 hash += n;
45#else 52
53 /* High bits are more random, so use them. */
54 return hash >> (64 - bits);
55}
56
57static inline u32 hash_32(u32 val, unsigned int bits)
58{
46 /* On some cpus multiply is faster, on others gcc will do shifts */ 59 /* On some cpus multiply is faster, on others gcc will do shifts */
47 hash *= GOLDEN_RATIO_PRIME; 60 u32 hash = val * GOLDEN_RATIO_PRIME_32;
48#endif
49 61
50 /* High bits are more random, so use them. */ 62 /* High bits are more random, so use them. */
51 return hash >> (BITS_PER_LONG - bits); 63 return hash >> (32 - bits);
52} 64}
53 65
54static inline unsigned long hash_ptr(void *ptr, unsigned int bits) 66static inline unsigned long hash_ptr(void *ptr, unsigned int bits)
55{ 67{
56 return hash_long((unsigned long)ptr, bits); 68 return hash_long((unsigned long)ptr, bits);
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h
index b436be7a7fff..2177ee5b2fe2 100644
--- a/include/linux/hayesesp.h
+++ b/include/linux/hayesesp.h
@@ -71,7 +71,6 @@ struct hayes_esp_config {
71#define ESP_STAT_NEVER_DMA 0x08 71#define ESP_STAT_NEVER_DMA 0x08
72#define ESP_STAT_USE_PIO 0x10 72#define ESP_STAT_USE_PIO 0x10
73 73
74#define ESP_EVENT_WRITE_WAKEUP 0
75#define ESP_MAGIC 0x53ee 74#define ESP_MAGIC 0x53ee
76#define ESP_XMIT_SIZE 4096 75#define ESP_XMIT_SIZE 4096
77 76
@@ -92,7 +91,6 @@ struct esp_struct {
92 unsigned short closing_wait2; 91 unsigned short closing_wait2;
93 int IER; /* Interrupt Enable Register */ 92 int IER; /* Interrupt Enable Register */
94 int MCR; /* Modem control register */ 93 int MCR; /* Modem control register */
95 unsigned long event;
96 unsigned long last_active; 94 unsigned long last_active;
97 int line; 95 int line;
98 int count; /* # of fd on device */ 96 int count; /* # of fd on device */
@@ -101,8 +99,6 @@ struct esp_struct {
101 int xmit_head; 99 int xmit_head;
102 int xmit_tail; 100 int xmit_tail;
103 int xmit_cnt; 101 int xmit_cnt;
104 struct work_struct tqueue;
105 struct work_struct tqueue_hangup;
106 wait_queue_head_t open_wait; 102 wait_queue_head_t open_wait;
107 wait_queue_head_t close_wait; 103 wait_queue_head_t close_wait;
108 wait_queue_head_t delta_msr_wait; 104 wait_queue_head_t delta_msr_wait;
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index db390c511ada..6115545a5b9c 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -26,13 +26,6 @@
26#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <linux/hdlc/ioctl.h> 27#include <linux/hdlc/ioctl.h>
28 28
29
30/* Used by all network devices here, pointed to by netdev_priv(dev) */
31struct hdlc_device_desc {
32 int (*netif_rx)(struct sk_buff *skb);
33 struct net_device_stats stats;
34};
35
36/* This structure is a private property of HDLC protocols. 29/* This structure is a private property of HDLC protocols.
37 Hardware drivers have no interest here */ 30 Hardware drivers have no interest here */
38 31
@@ -44,12 +37,15 @@ struct hdlc_proto {
44 void (*detach)(struct net_device *dev); 37 void (*detach)(struct net_device *dev);
45 int (*ioctl)(struct net_device *dev, struct ifreq *ifr); 38 int (*ioctl)(struct net_device *dev, struct ifreq *ifr);
46 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); 39 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev);
40 int (*netif_rx)(struct sk_buff *skb);
47 struct module *module; 41 struct module *module;
48 struct hdlc_proto *next; /* next protocol in the list */ 42 struct hdlc_proto *next; /* next protocol in the list */
49}; 43};
50 44
51 45
46/* Pointed to by dev->priv */
52typedef struct hdlc_device { 47typedef struct hdlc_device {
48 struct net_device_stats stats;
53 /* used by HDLC layer to take control over HDLC device from hw driver*/ 49 /* used by HDLC layer to take control over HDLC device from hw driver*/
54 int (*attach)(struct net_device *dev, 50 int (*attach)(struct net_device *dev,
55 unsigned short encoding, unsigned short parity); 51 unsigned short encoding, unsigned short parity);
@@ -83,18 +79,11 @@ void unregister_hdlc_protocol(struct hdlc_proto *proto);
83 79
84struct net_device *alloc_hdlcdev(void *priv); 80struct net_device *alloc_hdlcdev(void *priv);
85 81
86 82static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev)
87static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev)
88{
89 return netdev_priv(dev);
90}
91
92static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev)
93{ 83{
94 return netdev_priv(dev) + sizeof(struct hdlc_device_desc); 84 return dev->priv;
95} 85}
96 86
97
98static __inline__ void debug_frame(const struct sk_buff *skb) 87static __inline__ void debug_frame(const struct sk_buff *skb)
99{ 88{
100 int i; 89 int i;
@@ -116,13 +105,13 @@ int hdlc_open(struct net_device *dev);
116void hdlc_close(struct net_device *dev); 105void hdlc_close(struct net_device *dev);
117 106
118int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, 107int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
119 int (*rx)(struct sk_buff *skb), size_t size); 108 size_t size);
120/* May be used by hardware driver to gain control over HDLC device */ 109/* May be used by hardware driver to gain control over HDLC device */
121void detach_hdlc_protocol(struct net_device *dev); 110void detach_hdlc_protocol(struct net_device *dev);
122 111
123static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) 112static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
124{ 113{
125 return &dev_to_desc(dev)->stats; 114 return &dev_to_hdlc(dev)->stats;
126} 115}
127 116
128 117
diff --git a/include/linux/i2c/pca9539.h b/include/linux/i2c/pca953x.h
index 611d84ab7a30..3c7361217df8 100644
--- a/include/linux/i2c/pca9539.h
+++ b/include/linux/i2c/pca953x.h
@@ -1,6 +1,6 @@
1/* platform data for the PCA9539 16-bit I/O expander driver */ 1/* platform data for the PCA9539 16-bit I/O expander driver */
2 2
3struct pca9539_platform_data { 3struct pca953x_platform_data {
4 /* number of the first GPIO */ 4 /* number of the first GPIO */
5 unsigned gpio_base; 5 unsigned gpio_base;
6 6
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 34f40efc7607..79504b22a932 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -327,7 +327,7 @@ static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short t
327 * 327 *
328 * Returns error if the skb is not of VLAN type 328 * Returns error if the skb is not of VLAN type
329 */ 329 */
330static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) 330static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag)
331{ 331{
332 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; 332 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data;
333 333
@@ -347,7 +347,8 @@ static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag)
347 * 347 *
348 * Returns error if @skb->cb[] is not set correctly 348 * Returns error if @skb->cb[] is not set correctly
349 */ 349 */
350static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *tag) 350static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
351 unsigned short *tag)
351{ 352{
352 struct vlan_skb_tx_cookie *cookie; 353 struct vlan_skb_tx_cookie *cookie;
353 354
@@ -370,7 +371,7 @@ static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *ta
370 * 371 *
371 * Returns error if the skb is not VLAN tagged 372 * Returns error if the skb is not VLAN tagged
372 */ 373 */
373static inline int vlan_get_tag(struct sk_buff *skb, unsigned short *tag) 374static inline int vlan_get_tag(const struct sk_buff *skb, unsigned short *tag)
374{ 375{
375 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { 376 if (skb->dev->features & NETIF_F_HW_VLAN_TX) {
376 return __vlan_hwaccel_get_tag(skb, tag); 377 return __vlan_hwaccel_get_tag(skb, tag);
diff --git a/include/linux/init.h b/include/linux/init.h
index 90cdbbbbe077..a404a0055dd7 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -110,6 +110,7 @@
110#define __FINIT .previous 110#define __FINIT .previous
111 111
112#define __INITDATA .section ".init.data","aw" 112#define __INITDATA .section ".init.data","aw"
113#define __FINITDATA .previous
113 114
114#define __DEVINIT .section ".devinit.text", "ax" 115#define __DEVINIT .section ".devinit.text", "ax"
115#define __DEVINITDATA .section ".devinit.data", "aw" 116#define __DEVINITDATA .section ".devinit.data", "aw"
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index c3db4a00f1fa..dea7598aeff4 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -444,4 +444,6 @@ static inline void init_irq_proc(void)
444} 444}
445#endif 445#endif
446 446
447int show_interrupts(struct seq_file *p, void *v);
448
447#endif 449#endif
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index d0ecc8eebfbf..9cb2855bb170 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -507,7 +507,6 @@ typedef struct modem_info {
507 struct ktermios normal_termios; /* For saving termios structs */ 507 struct ktermios normal_termios; /* For saving termios structs */
508 struct ktermios callout_termios; 508 struct ktermios callout_termios;
509 wait_queue_head_t open_wait, close_wait; 509 wait_queue_head_t open_wait, close_wait;
510 struct semaphore write_sem;
511 spinlock_t readlock; 510 spinlock_t readlock;
512} modem_info; 511} modem_info;
513 512
diff --git a/include/linux/isicom.h b/include/linux/isicom.h
index 45b3d48f0978..8f4c71759d73 100644
--- a/include/linux/isicom.h
+++ b/include/linux/isicom.h
@@ -37,8 +37,6 @@
37#define BOARD_COUNT 4 37#define BOARD_COUNT 4
38#define PORT_COUNT (BOARD_COUNT*16) 38#define PORT_COUNT (BOARD_COUNT*16)
39 39
40#define SERIAL_TYPE_NORMAL 1
41
42/* character sizes */ 40/* character sizes */
43 41
44#define ISICOM_CS5 0x0000 42#define ISICOM_CS5 0x0000
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index 106a5e85e5c4..5a84fe944b74 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -71,7 +71,6 @@ struct stliport {
71 wait_queue_head_t open_wait; 71 wait_queue_head_t open_wait;
72 wait_queue_head_t close_wait; 72 wait_queue_head_t close_wait;
73 wait_queue_head_t raw_wait; 73 wait_queue_head_t raw_wait;
74 struct work_struct tqhangup;
75 struct asysigs asig; 74 struct asysigs asig;
76 unsigned long addr; 75 unsigned long addr;
77 unsigned long rxoffset; 76 unsigned long rxoffset;
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index d9ecd13393b0..b18fd3b9b835 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -33,7 +33,6 @@
33#include <linux/lockdep.h> 33#include <linux/lockdep.h>
34 34
35#include <asm/semaphore.h> 35#include <asm/semaphore.h>
36#endif
37 36
38#define journal_oom_retry 1 37#define journal_oom_retry 1
39 38
@@ -84,7 +83,6 @@ static inline void jbd_free(void *ptr, size_t size)
84 83
85#define JFS_MIN_JOURNAL_BLOCKS 1024 84#define JFS_MIN_JOURNAL_BLOCKS 1024
86 85
87#ifdef __KERNEL__
88 86
89/** 87/**
90 * typedef handle_t - The handle_t type represents a single atomic update being performed by some process. 88 * typedef handle_t - The handle_t type represents a single atomic update being performed by some process.
@@ -924,7 +922,6 @@ extern int journal_recover (journal_t *journal);
924extern int journal_wipe (journal_t *, int); 922extern int journal_wipe (journal_t *, int);
925extern int journal_skip_recovery (journal_t *); 923extern int journal_skip_recovery (journal_t *);
926extern void journal_update_superblock (journal_t *, int); 924extern void journal_update_superblock (journal_t *, int);
927extern void __journal_abort_hard (journal_t *);
928extern void journal_abort (journal_t *, int); 925extern void journal_abort (journal_t *, int);
929extern int journal_errno (journal_t *); 926extern int journal_errno (journal_t *);
930extern void journal_ack_err (journal_t *); 927extern void journal_ack_err (journal_t *);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ff356b2ee478..18222f267bc4 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -35,7 +35,7 @@ extern const char linux_proc_banner[];
35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
38#define IS_ALIGNED(x,a) (((x) % ((typeof(x))(a))) == 0) 38#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
39 39
40#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 40#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
41 41
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 2d9c448d8c52..3265968cd2cd 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -127,17 +127,21 @@ void vmcoreinfo_append_str(const char *fmt, ...)
127 __attribute__ ((format (printf, 1, 2))); 127 __attribute__ ((format (printf, 1, 2)));
128unsigned long paddr_vmcoreinfo_note(void); 128unsigned long paddr_vmcoreinfo_note(void);
129 129
130#define VMCOREINFO_OSRELEASE(name) \
131 vmcoreinfo_append_str("OSRELEASE=%s\n", #name)
132#define VMCOREINFO_PAGESIZE(value) \
133 vmcoreinfo_append_str("PAGESIZE=%ld\n", value)
130#define VMCOREINFO_SYMBOL(name) \ 134#define VMCOREINFO_SYMBOL(name) \
131 vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) 135 vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
132#define VMCOREINFO_SIZE(name) \ 136#define VMCOREINFO_SIZE(name) \
133 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ 137 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
134 (unsigned long)sizeof(struct name))
135#define VMCOREINFO_TYPEDEF_SIZE(name) \
136 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
137 (unsigned long)sizeof(name)) 138 (unsigned long)sizeof(name))
139#define VMCOREINFO_STRUCT_SIZE(name) \
140 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
141 (unsigned long)sizeof(struct name))
138#define VMCOREINFO_OFFSET(name, field) \ 142#define VMCOREINFO_OFFSET(name, field) \
139 vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ 143 vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
140 (unsigned long)&(((struct name *)0)->field)) 144 (unsigned long)offsetof(struct name, field))
141#define VMCOREINFO_LENGTH(name, value) \ 145#define VMCOREINFO_LENGTH(name, value) \
142 vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) 146 vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value)
143#define VMCOREINFO_NUMBER(name) \ 147#define VMCOREINFO_NUMBER(name) \
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 6168c0a44172..4a6ce82ba039 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -152,8 +152,10 @@ static inline int arch_trampoline_kprobe(struct kprobe *p)
152struct kretprobe { 152struct kretprobe {
153 struct kprobe kp; 153 struct kprobe kp;
154 kretprobe_handler_t handler; 154 kretprobe_handler_t handler;
155 kretprobe_handler_t entry_handler;
155 int maxactive; 156 int maxactive;
156 int nmissed; 157 int nmissed;
158 size_t data_size;
157 struct hlist_head free_instances; 159 struct hlist_head free_instances;
158 struct hlist_head used_instances; 160 struct hlist_head used_instances;
159}; 161};
@@ -164,6 +166,7 @@ struct kretprobe_instance {
164 struct kretprobe *rp; 166 struct kretprobe *rp;
165 kprobe_opcode_t *ret_addr; 167 kprobe_opcode_t *ret_addr;
166 struct task_struct *task; 168 struct task_struct *task;
169 char data[0];
167}; 170};
168 171
169struct kretprobe_blackpoint { 172struct kretprobe_blackpoint {
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 4374c4277780..bc5a8d0c7090 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -457,7 +457,6 @@ struct ata_queued_cmd {
457 unsigned long flags; /* ATA_QCFLAG_xxx */ 457 unsigned long flags; /* ATA_QCFLAG_xxx */
458 unsigned int tag; 458 unsigned int tag;
459 unsigned int n_elem; 459 unsigned int n_elem;
460 unsigned int n_iter;
461 unsigned int mapped_n_elem; 460 unsigned int mapped_n_elem;
462 461
463 int dma_dir; 462 int dma_dir;
@@ -1367,7 +1366,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1367 qc->nbytes = qc->raw_nbytes = qc->curbytes = 0; 1366 qc->nbytes = qc->raw_nbytes = qc->curbytes = 0;
1368 qc->n_elem = 0; 1367 qc->n_elem = 0;
1369 qc->mapped_n_elem = 0; 1368 qc->mapped_n_elem = 0;
1370 qc->n_iter = 0;
1371 qc->err_mask = 0; 1369 qc->err_mask = 0;
1372 qc->pad_len = 0; 1370 qc->pad_len = 0;
1373 qc->last_sg = NULL; 1371 qc->last_sg = NULL;
diff --git a/include/linux/log2.h b/include/linux/log2.h
index c8cf5e8ef171..25b808631cd9 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -190,4 +190,20 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
190 __rounddown_pow_of_two(n) \ 190 __rounddown_pow_of_two(n) \
191 ) 191 )
192 192
193/**
194 * order_base_2 - calculate the (rounded up) base 2 order of the argument
195 * @n: parameter
196 *
197 * The first few values calculated by this routine:
198 * ob2(0) = 0
199 * ob2(1) = 0
200 * ob2(2) = 1
201 * ob2(3) = 2
202 * ob2(4) = 2
203 * ob2(5) = 3
204 * ... and so on.
205 */
206
207#define order_base_2(n) ilog2(roundup_pow_of_two(n))
208
193#endif /* _LINUX_LOG2_H */ 209#endif /* _LINUX_LOG2_H */
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 26a0a103898f..46169a7b559b 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -76,6 +76,7 @@ struct loop_device {
76enum { 76enum {
77 LO_FLAGS_READ_ONLY = 1, 77 LO_FLAGS_READ_ONLY = 1,
78 LO_FLAGS_USE_AOPS = 2, 78 LO_FLAGS_USE_AOPS = 2,
79 LO_FLAGS_AUTOCLEAR = 4,
79}; 80};
80 81
81#include <asm/posix_types.h> /* for __kernel_old_dev_t */ 82#include <asm/posix_types.h> /* for __kernel_old_dev_t */
diff --git a/include/linux/lp.h b/include/linux/lp.h
index 7059b6b9878a..0df024bfd6f0 100644
--- a/include/linux/lp.h
+++ b/include/linux/lp.h
@@ -99,7 +99,7 @@
99#ifdef __KERNEL__ 99#ifdef __KERNEL__
100 100
101#include <linux/wait.h> 101#include <linux/wait.h>
102#include <asm/semaphore.h> 102#include <linux/mutex.h>
103 103
104/* Magic numbers for defining port-device mappings */ 104/* Magic numbers for defining port-device mappings */
105#define LP_PARPORT_UNSPEC -4 105#define LP_PARPORT_UNSPEC -4
@@ -145,7 +145,7 @@ struct lp_struct {
145#endif 145#endif
146 wait_queue_head_t waitq; 146 wait_queue_head_t waitq;
147 unsigned int last_error; 147 unsigned int last_error;
148 struct semaphore port_mutex; 148 struct mutex port_mutex;
149 wait_queue_head_t dataq; 149 wait_queue_head_t dataq;
150 long timeout; 150 long timeout;
151 unsigned int best_mode; 151 unsigned int best_mode;
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
new file mode 100644
index 000000000000..9815951ec995
--- /dev/null
+++ b/include/linux/memcontrol.h
@@ -0,0 +1,190 @@
1/* memcontrol.h - Memory Controller
2 *
3 * Copyright IBM Corporation, 2007
4 * Author Balbir Singh <balbir@linux.vnet.ibm.com>
5 *
6 * Copyright 2007 OpenVZ SWsoft Inc
7 * Author: Pavel Emelianov <xemul@openvz.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20#ifndef _LINUX_MEMCONTROL_H
21#define _LINUX_MEMCONTROL_H
22
23#include <linux/rcupdate.h>
24#include <linux/mm.h>
25
26struct mem_cgroup;
27struct page_cgroup;
28struct page;
29struct mm_struct;
30
31#ifdef CONFIG_CGROUP_MEM_CONT
32
33extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p);
34extern void mm_free_cgroup(struct mm_struct *mm);
35extern void page_assign_page_cgroup(struct page *page,
36 struct page_cgroup *pc);
37extern struct page_cgroup *page_get_page_cgroup(struct page *page);
38extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
39 gfp_t gfp_mask);
40extern void mem_cgroup_uncharge(struct page_cgroup *pc);
41extern void mem_cgroup_uncharge_page(struct page *page);
42extern void mem_cgroup_move_lists(struct page_cgroup *pc, bool active);
43extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
44 struct list_head *dst,
45 unsigned long *scanned, int order,
46 int mode, struct zone *z,
47 struct mem_cgroup *mem_cont,
48 int active);
49extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
50extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
51 gfp_t gfp_mask);
52int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
53
54static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm)
55{
56 return rcu_dereference(mm->mem_cgroup);
57}
58
59extern int mem_cgroup_prepare_migration(struct page *page);
60extern void mem_cgroup_end_migration(struct page *page);
61extern void mem_cgroup_page_migration(struct page *page, struct page *newpage);
62
63/*
64 * For memory reclaim.
65 */
66extern int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem);
67extern long mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem);
68
69extern int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem);
70extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem,
71 int priority);
72extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem,
73 int priority);
74
75extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem,
76 struct zone *zone, int priority);
77extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem,
78 struct zone *zone, int priority);
79
80#else /* CONFIG_CGROUP_MEM_CONT */
81static inline void mm_init_cgroup(struct mm_struct *mm,
82 struct task_struct *p)
83{
84}
85
86static inline void mm_free_cgroup(struct mm_struct *mm)
87{
88}
89
90static inline void page_assign_page_cgroup(struct page *page,
91 struct page_cgroup *pc)
92{
93}
94
95static inline struct page_cgroup *page_get_page_cgroup(struct page *page)
96{
97 return NULL;
98}
99
100static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
101 gfp_t gfp_mask)
102{
103 return 0;
104}
105
106static inline void mem_cgroup_uncharge(struct page_cgroup *pc)
107{
108}
109
110static inline void mem_cgroup_uncharge_page(struct page *page)
111{
112}
113
114static inline void mem_cgroup_move_lists(struct page_cgroup *pc,
115 bool active)
116{
117}
118
119static inline int mem_cgroup_cache_charge(struct page *page,
120 struct mm_struct *mm,
121 gfp_t gfp_mask)
122{
123 return 0;
124}
125
126static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm)
127{
128 return NULL;
129}
130
131static inline int task_in_mem_cgroup(struct task_struct *task,
132 const struct mem_cgroup *mem)
133{
134 return 1;
135}
136
137static inline int mem_cgroup_prepare_migration(struct page *page)
138{
139 return 0;
140}
141
142static inline void mem_cgroup_end_migration(struct page *page)
143{
144}
145
146static inline void
147mem_cgroup_page_migration(struct page *page, struct page *newpage)
148{
149}
150
151static inline int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem)
152{
153 return 0;
154}
155
156static inline int mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem)
157{
158 return 0;
159}
160
161static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem)
162{
163 return 0;
164}
165
166static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem,
167 int priority)
168{
169}
170
171static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem,
172 int priority)
173{
174}
175
176static inline long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem,
177 struct zone *zone, int priority)
178{
179 return 0;
180}
181
182static inline long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem,
183 struct zone *zone, int priority)
184{
185 return 0;
186}
187#endif /* CONFIG_CGROUP_MEM_CONT */
188
189#endif /* _LINUX_MEMCONTROL_H */
190
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h
new file mode 100644
index 000000000000..4ab2162db13b
--- /dev/null
+++ b/include/linux/mfd/asic3.h
@@ -0,0 +1,497 @@
1/*
2 * include/linux/mfd/asic3.h
3 *
4 * Compaq ASIC3 headers.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Copyright 2001 Compaq Computer Corporation.
11 * Copyright 2007 OpendHand.
12 */
13
14#ifndef __ASIC3_H__
15#define __ASIC3_H__
16
17#include <linux/types.h>
18
19struct asic3 {
20 void __iomem *mapping;
21 unsigned int bus_shift;
22 unsigned int irq_nr;
23 unsigned int irq_base;
24 spinlock_t lock;
25 u16 irq_bothedge[4];
26 struct device *dev;
27};
28
29struct asic3_platform_data {
30 struct {
31 u32 dir;
32 u32 init;
33 u32 sleep_mask;
34 u32 sleep_out;
35 u32 batt_fault_out;
36 u32 sleep_conf;
37 u32 alt_function;
38 } gpio_a, gpio_b, gpio_c, gpio_d;
39
40 unsigned int bus_shift;
41
42 unsigned int irq_base;
43
44 struct platform_device **children;
45 unsigned int n_children;
46};
47
48int asic3_gpio_get_value(struct asic3 *asic, unsigned gpio);
49void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val);
50
51#define ASIC3_NUM_GPIO_BANKS 4
52#define ASIC3_GPIOS_PER_BANK 16
53#define ASIC3_NUM_GPIOS 64
54#define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6
55
56#define ASIC3_GPIO_BANK_A 0
57#define ASIC3_GPIO_BANK_B 1
58#define ASIC3_GPIO_BANK_C 2
59#define ASIC3_GPIO_BANK_D 3
60
61#define ASIC3_GPIO(bank, gpio) \
62 ((ASIC3_GPIOS_PER_BANK * ASIC3_GPIO_BANK_##bank) + (gpio))
63#define ASIC3_GPIO_bit(gpio) (1 << (gpio & 0xf))
64/* All offsets below are specified with this address bus shift */
65#define ASIC3_DEFAULT_ADDR_SHIFT 2
66
67#define ASIC3_OFFSET(base, reg) (ASIC3_##base##_Base + ASIC3_##base##_##reg)
68#define ASIC3_GPIO_OFFSET(base, reg) \
69 (ASIC3_GPIO_##base##_Base + ASIC3_GPIO_##reg)
70
71#define ASIC3_GPIO_A_Base 0x0000
72#define ASIC3_GPIO_B_Base 0x0100
73#define ASIC3_GPIO_C_Base 0x0200
74#define ASIC3_GPIO_D_Base 0x0300
75
76#define ASIC3_GPIO_Mask 0x00 /* R/W 0:don't mask */
77#define ASIC3_GPIO_Direction 0x04 /* R/W 0:input */
78#define ASIC3_GPIO_Out 0x08 /* R/W 0:output low */
79#define ASIC3_GPIO_TriggerType 0x0c /* R/W 0:level */
80#define ASIC3_GPIO_EdgeTrigger 0x10 /* R/W 0:falling */
81#define ASIC3_GPIO_LevelTrigger 0x14 /* R/W 0:low level detect */
82#define ASIC3_GPIO_SleepMask 0x18 /* R/W 0:don't mask in sleep mode */
83#define ASIC3_GPIO_SleepOut 0x1c /* R/W level 0:low in sleep mode */
84#define ASIC3_GPIO_BattFaultOut 0x20 /* R/W level 0:low in batt_fault */
85#define ASIC3_GPIO_IntStatus 0x24 /* R/W 0:none, 1:detect */
86#define ASIC3_GPIO_AltFunction 0x28 /* R/W 1:LED register control */
87#define ASIC3_GPIO_SleepConf 0x2c /*
88 * R/W bit 1: autosleep
89 * 0: disable gposlpout in normal mode,
90 * enable gposlpout in sleep mode.
91 */
92#define ASIC3_GPIO_Status 0x30 /* R Pin status */
93
94#define ASIC3_SPI_Base 0x0400
95#define ASIC3_SPI_Control 0x0000
96#define ASIC3_SPI_TxData 0x0004
97#define ASIC3_SPI_RxData 0x0008
98#define ASIC3_SPI_Int 0x000c
99#define ASIC3_SPI_Status 0x0010
100
101#define SPI_CONTROL_SPR(clk) ((clk) & 0x0f) /* Clock rate */
102
103#define ASIC3_PWM_0_Base 0x0500
104#define ASIC3_PWM_1_Base 0x0600
105#define ASIC3_PWM_TimeBase 0x0000
106#define ASIC3_PWM_PeriodTime 0x0004
107#define ASIC3_PWM_DutyTime 0x0008
108
109#define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */
110#define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */
111
112#define ASIC3_LED_0_Base 0x0700
113#define ASIC3_LED_1_Base 0x0800
114#define ASIC3_LED_2_Base 0x0900
115#define ASIC3_LED_TimeBase 0x0000 /* R/W 7 bits */
116#define ASIC3_LED_PeriodTime 0x0004 /* R/W 12 bits */
117#define ASIC3_LED_DutyTime 0x0008 /* R/W 12 bits */
118#define ASIC3_LED_AutoStopCount 0x000c /* R/W 16 bits */
119
120/* LED TimeBase bits - match ASIC2 */
121#define LED_TBS 0x0f /* Low 4 bits sets time base, max = 13 */
122 /* Note: max = 5 on hx4700 */
123 /* 0: maximum time base */
124 /* 1: maximum time base / 2 */
125 /* n: maximum time base / 2^n */
126
127#define LED_EN (1 << 4) /* LED ON/OFF 0:off, 1:on */
128#define LED_AUTOSTOP (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */
129#define LED_ALWAYS (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */
130
131#define ASIC3_CLOCK_Base 0x0A00
132#define ASIC3_CLOCK_CDEX 0x00
133#define ASIC3_CLOCK_SEL 0x04
134
135#define CLOCK_CDEX_SOURCE (1 << 0) /* 2 bits */
136#define CLOCK_CDEX_SOURCE0 (1 << 0)
137#define CLOCK_CDEX_SOURCE1 (1 << 1)
138#define CLOCK_CDEX_SPI (1 << 2)
139#define CLOCK_CDEX_OWM (1 << 3)
140#define CLOCK_CDEX_PWM0 (1 << 4)
141#define CLOCK_CDEX_PWM1 (1 << 5)
142#define CLOCK_CDEX_LED0 (1 << 6)
143#define CLOCK_CDEX_LED1 (1 << 7)
144#define CLOCK_CDEX_LED2 (1 << 8)
145
146/* Clocks settings: 1 for 24.576 MHz, 0 for 12.288Mhz */
147#define CLOCK_CDEX_SD_HOST (1 << 9) /* R/W: SD host clock source */
148#define CLOCK_CDEX_SD_BUS (1 << 10) /* R/W: SD bus clock source ctrl */
149#define CLOCK_CDEX_SMBUS (1 << 11)
150#define CLOCK_CDEX_CONTROL_CX (1 << 12)
151
152#define CLOCK_CDEX_EX0 (1 << 13) /* R/W: 32.768 kHz crystal */
153#define CLOCK_CDEX_EX1 (1 << 14) /* R/W: 24.576 MHz crystal */
154
155#define CLOCK_SEL_SD_HCLK_SEL (1 << 0) /* R/W: SDIO host clock select */
156#define CLOCK_SEL_SD_BCLK_SEL (1 << 1) /* R/W: SDIO bus clock select */
157
158/* R/W: INT clock source control (32.768 kHz) */
159#define CLOCK_SEL_CX (1 << 2)
160
161
162#define ASIC3_INTR_Base 0x0B00
163
164#define ASIC3_INTR_IntMask 0x00 /* Interrupt mask control */
165#define ASIC3_INTR_PIntStat 0x04 /* Peripheral interrupt status */
166#define ASIC3_INTR_IntCPS 0x08 /* Interrupt timer clock pre-scale */
167#define ASIC3_INTR_IntTBS 0x0c /* Interrupt timer set */
168
169#define ASIC3_INTMASK_GINTMASK (1 << 0) /* Global INTs mask 1:enable */
170#define ASIC3_INTMASK_GINTEL (1 << 1) /* 1: rising edge, 0: hi level */
171#define ASIC3_INTMASK_MASK0 (1 << 2)
172#define ASIC3_INTMASK_MASK1 (1 << 3)
173#define ASIC3_INTMASK_MASK2 (1 << 4)
174#define ASIC3_INTMASK_MASK3 (1 << 5)
175#define ASIC3_INTMASK_MASK4 (1 << 6)
176#define ASIC3_INTMASK_MASK5 (1 << 7)
177
178#define ASIC3_INTR_PERIPHERAL_A (1 << 0)
179#define ASIC3_INTR_PERIPHERAL_B (1 << 1)
180#define ASIC3_INTR_PERIPHERAL_C (1 << 2)
181#define ASIC3_INTR_PERIPHERAL_D (1 << 3)
182#define ASIC3_INTR_LED0 (1 << 4)
183#define ASIC3_INTR_LED1 (1 << 5)
184#define ASIC3_INTR_LED2 (1 << 6)
185#define ASIC3_INTR_SPI (1 << 7)
186#define ASIC3_INTR_SMBUS (1 << 8)
187#define ASIC3_INTR_OWM (1 << 9)
188
189#define ASIC3_INTR_CPS(x) ((x)&0x0f) /* 4 bits, max 14 */
190#define ASIC3_INTR_CPS_SET (1 << 4) /* Time base enable */
191
192
193/* Basic control of the SD ASIC */
194#define ASIC3_SDHWCTRL_Base 0x0E00
195#define ASIC3_SDHWCTRL_SDConf 0x00
196
197#define ASIC3_SDHWCTRL_SUSPEND (1 << 0) /* 1=suspend all SD operations */
198#define ASIC3_SDHWCTRL_CLKSEL (1 << 1) /* 1=SDICK, 0=HCLK */
199#define ASIC3_SDHWCTRL_PCLR (1 << 2) /* All registers of SDIO cleared */
200#define ASIC3_SDHWCTRL_LEVCD (1 << 3) /* SD card detection: 0:low */
201
202/* SD card write protection: 0=high */
203#define ASIC3_SDHWCTRL_LEVWP (1 << 4)
204#define ASIC3_SDHWCTRL_SDLED (1 << 5) /* SD card LED signal 0=disable */
205
206/* SD card power supply ctrl 1=enable */
207#define ASIC3_SDHWCTRL_SDPWR (1 << 6)
208
209#define ASIC3_EXTCF_Base 0x1100
210
211#define ASIC3_EXTCF_Select 0x00
212#define ASIC3_EXTCF_Reset 0x04
213
214#define ASIC3_EXTCF_SMOD0 (1 << 0) /* slot number of mode 0 */
215#define ASIC3_EXTCF_SMOD1 (1 << 1) /* slot number of mode 1 */
216#define ASIC3_EXTCF_SMOD2 (1 << 2) /* slot number of mode 2 */
217#define ASIC3_EXTCF_OWM_EN (1 << 4) /* enable onewire module */
218#define ASIC3_EXTCF_OWM_SMB (1 << 5) /* OWM bus selection */
219#define ASIC3_EXTCF_OWM_RESET (1 << 6) /* ?? used by OWM and CF */
220#define ASIC3_EXTCF_CF0_SLEEP_MODE (1 << 7) /* CF0 sleep state */
221#define ASIC3_EXTCF_CF1_SLEEP_MODE (1 << 8) /* CF1 sleep state */
222#define ASIC3_EXTCF_CF0_PWAIT_EN (1 << 10) /* CF0 PWAIT_n control */
223#define ASIC3_EXTCF_CF1_PWAIT_EN (1 << 11) /* CF1 PWAIT_n control */
224#define ASIC3_EXTCF_CF0_BUF_EN (1 << 12) /* CF0 buffer control */
225#define ASIC3_EXTCF_CF1_BUF_EN (1 << 13) /* CF1 buffer control */
226#define ASIC3_EXTCF_SD_MEM_ENABLE (1 << 14)
227#define ASIC3_EXTCF_CF_SLEEP (1 << 15) /* CF sleep mode control */
228
229/*********************************************
230 * The Onewire interface registers
231 *
232 * OWM_CMD
233 * OWM_DAT
234 * OWM_INTR
235 * OWM_INTEN
236 * OWM_CLKDIV
237 *
238 *********************************************/
239
240#define ASIC3_OWM_Base 0xC00
241
242#define ASIC3_OWM_CMD 0x00
243#define ASIC3_OWM_DAT 0x04
244#define ASIC3_OWM_INTR 0x08
245#define ASIC3_OWM_INTEN 0x0C
246#define ASIC3_OWM_CLKDIV 0x10
247
248#define ASIC3_OWM_CMD_ONEWR (1 << 0)
249#define ASIC3_OWM_CMD_SRA (1 << 1)
250#define ASIC3_OWM_CMD_DQO (1 << 2)
251#define ASIC3_OWM_CMD_DQI (1 << 3)
252
253#define ASIC3_OWM_INTR_PD (1 << 0)
254#define ASIC3_OWM_INTR_PDR (1 << 1)
255#define ASIC3_OWM_INTR_TBE (1 << 2)
256#define ASIC3_OWM_INTR_TEMP (1 << 3)
257#define ASIC3_OWM_INTR_RBF (1 << 4)
258
259#define ASIC3_OWM_INTEN_EPD (1 << 0)
260#define ASIC3_OWM_INTEN_IAS (1 << 1)
261#define ASIC3_OWM_INTEN_ETBE (1 << 2)
262#define ASIC3_OWM_INTEN_ETMT (1 << 3)
263#define ASIC3_OWM_INTEN_ERBF (1 << 4)
264
265#define ASIC3_OWM_CLKDIV_PRE (3 << 0) /* two bits wide at bit 0 */
266#define ASIC3_OWM_CLKDIV_DIV (7 << 2) /* 3 bits wide at bit 2 */
267
268
269/*****************************************************************************
270 * The SD configuration registers are at a completely different location
271 * in memory. They are divided into three sets of registers:
272 *
273 * SD_CONFIG Core configuration register
274 * SD_CTRL Control registers for SD operations
275 * SDIO_CTRL Control registers for SDIO operations
276 *
277 *****************************************************************************/
278#define ASIC3_SD_CONFIG_Base 0x0400 /* Assumes 32 bit addressing */
279
280#define ASIC3_SD_CONFIG_Command 0x08 /* R/W: Command */
281
282/* [0:8] SD Control Register Base Address */
283#define ASIC3_SD_CONFIG_Addr0 0x20
284
285/* [9:31] SD Control Register Base Address */
286#define ASIC3_SD_CONFIG_Addr1 0x24
287
288/* R/O: interrupt assigned to pin */
289#define ASIC3_SD_CONFIG_IntPin 0x78
290
291/*
292 * Set to 0x1f to clock SD controller, 0 otherwise.
293 * At 0x82 - Gated Clock Ctrl
294 */
295#define ASIC3_SD_CONFIG_ClkStop 0x80
296
297/* Control clock of SD controller */
298#define ASIC3_SD_CONFIG_ClockMode 0x84
299#define ASIC3_SD_CONFIG_SDHC_PinStatus 0x88 /* R/0: SD pins status */
300#define ASIC3_SD_CONFIG_SDHC_Power1 0x90 /* Power1 - manual pwr ctrl */
301
302/* auto power up after card inserted */
303#define ASIC3_SD_CONFIG_SDHC_Power2 0x92
304
305/* auto power down when card removed */
306#define ASIC3_SD_CONFIG_SDHC_Power3 0x94
307#define ASIC3_SD_CONFIG_SDHC_CardDetect 0x98
308#define ASIC3_SD_CONFIG_SDHC_Slot 0xA0 /* R/O: support slot number */
309#define ASIC3_SD_CONFIG_SDHC_ExtGateClk1 0x1E0 /* Not used */
310#define ASIC3_SD_CONFIG_SDHC_ExtGateClk2 0x1E2 /* Not used*/
311
312/* GPIO Output Reg. , at 0x1EA - GPIO Output Enable Reg. */
313#define ASIC3_SD_CONFIG_SDHC_GPIO_OutAndEnable 0x1E8
314#define ASIC3_SD_CONFIG_SDHC_GPIO_Status 0x1EC /* GPIO Status Reg. */
315
316/* Bit 1: double buffer/single buffer */
317#define ASIC3_SD_CONFIG_SDHC_ExtGateClk3 0x1F0
318
319/* Memory access enable (set to 1 to access SD Controller) */
320#define SD_CONFIG_COMMAND_MAE (1<<1)
321
322#define SD_CONFIG_CLK_ENABLE_ALL 0x1f
323
324#define SD_CONFIG_POWER1_PC_33V 0x0200 /* Set for 3.3 volts */
325#define SD_CONFIG_POWER1_PC_OFF 0x0000 /* Turn off power */
326
327 /* two bits - number of cycles for card detection */
328#define SD_CONFIG_CARDDETECTMODE_CLK ((x) & 0x3)
329
330
331#define ASIC3_SD_CTRL_Base 0x1000
332
333#define ASIC3_SD_CTRL_Cmd 0x00
334#define ASIC3_SD_CTRL_Arg0 0x08
335#define ASIC3_SD_CTRL_Arg1 0x0C
336#define ASIC3_SD_CTRL_StopInternal 0x10
337#define ASIC3_SD_CTRL_TransferSectorCount 0x14
338#define ASIC3_SD_CTRL_Response0 0x18
339#define ASIC3_SD_CTRL_Response1 0x1C
340#define ASIC3_SD_CTRL_Response2 0x20
341#define ASIC3_SD_CTRL_Response3 0x24
342#define ASIC3_SD_CTRL_Response4 0x28
343#define ASIC3_SD_CTRL_Response5 0x2C
344#define ASIC3_SD_CTRL_Response6 0x30
345#define ASIC3_SD_CTRL_Response7 0x34
346#define ASIC3_SD_CTRL_CardStatus 0x38
347#define ASIC3_SD_CTRL_BufferCtrl 0x3C
348#define ASIC3_SD_CTRL_IntMaskCard 0x40
349#define ASIC3_SD_CTRL_IntMaskBuffer 0x44
350#define ASIC3_SD_CTRL_CardClockCtrl 0x48
351#define ASIC3_SD_CTRL_MemCardXferDataLen 0x4C
352#define ASIC3_SD_CTRL_MemCardOptionSetup 0x50
353#define ASIC3_SD_CTRL_ErrorStatus0 0x58
354#define ASIC3_SD_CTRL_ErrorStatus1 0x5C
355#define ASIC3_SD_CTRL_DataPort 0x60
356#define ASIC3_SD_CTRL_TransactionCtrl 0x68
357#define ASIC3_SD_CTRL_SoftwareReset 0x1C0
358
359#define SD_CTRL_SOFTWARE_RESET_CLEAR (1<<0)
360
361#define SD_CTRL_TRANSACTIONCONTROL_SET (1<<8)
362
363#define SD_CTRL_CARDCLOCKCONTROL_FOR_SD_CARD (1<<15)
364#define SD_CTRL_CARDCLOCKCONTROL_ENABLE_CLOCK (1<<8)
365#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_512 (1<<7)
366#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_256 (1<<6)
367#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_128 (1<<5)
368#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_64 (1<<4)
369#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_32 (1<<3)
370#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_16 (1<<2)
371#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_8 (1<<1)
372#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_4 (1<<0)
373#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_2 (0<<0)
374
375#define MEM_CARD_OPTION_REQUIRED 0x000e
376#define MEM_CARD_OPTION_DATA_RESPONSE_TIMEOUT(x) (((x) & 0x0f) << 4)
377#define MEM_CARD_OPTION_C2_MODULE_NOT_PRESENT (1<<14)
378#define MEM_CARD_OPTION_DATA_XFR_WIDTH_1 (1<<15)
379#define MEM_CARD_OPTION_DATA_XFR_WIDTH_4 0
380
381#define SD_CTRL_COMMAND_INDEX(x) ((x) & 0x3f)
382#define SD_CTRL_COMMAND_TYPE_CMD (0 << 6)
383#define SD_CTRL_COMMAND_TYPE_ACMD (1 << 6)
384#define SD_CTRL_COMMAND_TYPE_AUTHENTICATION (2 << 6)
385#define SD_CTRL_COMMAND_RESPONSE_TYPE_NORMAL (0 << 8)
386#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1 (4 << 8)
387#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1B (5 << 8)
388#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R2 (6 << 8)
389#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R3 (7 << 8)
390#define SD_CTRL_COMMAND_DATA_PRESENT (1 << 11)
391#define SD_CTRL_COMMAND_TRANSFER_READ (1 << 12)
392#define SD_CTRL_COMMAND_TRANSFER_WRITE (0 << 12)
393#define SD_CTRL_COMMAND_MULTI_BLOCK (1 << 13)
394#define SD_CTRL_COMMAND_SECURITY_CMD (1 << 14)
395
396#define SD_CTRL_STOP_INTERNAL_ISSSUE_CMD12 (1 << 0)
397#define SD_CTRL_STOP_INTERNAL_AUTO_ISSUE_CMD12 (1 << 8)
398
399#define SD_CTRL_CARDSTATUS_RESPONSE_END (1 << 0)
400#define SD_CTRL_CARDSTATUS_RW_END (1 << 2)
401#define SD_CTRL_CARDSTATUS_CARD_REMOVED_0 (1 << 3)
402#define SD_CTRL_CARDSTATUS_CARD_INSERTED_0 (1 << 4)
403#define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_0 (1 << 5)
404#define SD_CTRL_CARDSTATUS_WRITE_PROTECT (1 << 7)
405#define SD_CTRL_CARDSTATUS_CARD_REMOVED_3 (1 << 8)
406#define SD_CTRL_CARDSTATUS_CARD_INSERTED_3 (1 << 9)
407#define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_3 (1 << 10)
408
409#define SD_CTRL_BUFFERSTATUS_CMD_INDEX_ERROR (1 << 0)
410#define SD_CTRL_BUFFERSTATUS_CRC_ERROR (1 << 1)
411#define SD_CTRL_BUFFERSTATUS_STOP_BIT_END_ERROR (1 << 2)
412#define SD_CTRL_BUFFERSTATUS_DATA_TIMEOUT (1 << 3)
413#define SD_CTRL_BUFFERSTATUS_BUFFER_OVERFLOW (1 << 4)
414#define SD_CTRL_BUFFERSTATUS_BUFFER_UNDERFLOW (1 << 5)
415#define SD_CTRL_BUFFERSTATUS_CMD_TIMEOUT (1 << 6)
416#define SD_CTRL_BUFFERSTATUS_UNK7 (1 << 7)
417#define SD_CTRL_BUFFERSTATUS_BUFFER_READ_ENABLE (1 << 8)
418#define SD_CTRL_BUFFERSTATUS_BUFFER_WRITE_ENABLE (1 << 9)
419#define SD_CTRL_BUFFERSTATUS_ILLEGAL_FUNCTION (1 << 13)
420#define SD_CTRL_BUFFERSTATUS_CMD_BUSY (1 << 14)
421#define SD_CTRL_BUFFERSTATUS_ILLEGAL_ACCESS (1 << 15)
422
423#define SD_CTRL_INTMASKCARD_RESPONSE_END (1 << 0)
424#define SD_CTRL_INTMASKCARD_RW_END (1 << 2)
425#define SD_CTRL_INTMASKCARD_CARD_REMOVED_0 (1 << 3)
426#define SD_CTRL_INTMASKCARD_CARD_INSERTED_0 (1 << 4)
427#define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_0 (1 << 5)
428#define SD_CTRL_INTMASKCARD_UNK6 (1 << 6)
429#define SD_CTRL_INTMASKCARD_WRITE_PROTECT (1 << 7)
430#define SD_CTRL_INTMASKCARD_CARD_REMOVED_3 (1 << 8)
431#define SD_CTRL_INTMASKCARD_CARD_INSERTED_3 (1 << 9)
432#define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_3 (1 << 10)
433
434#define SD_CTRL_INTMASKBUFFER_CMD_INDEX_ERROR (1 << 0)
435#define SD_CTRL_INTMASKBUFFER_CRC_ERROR (1 << 1)
436#define SD_CTRL_INTMASKBUFFER_STOP_BIT_END_ERROR (1 << 2)
437#define SD_CTRL_INTMASKBUFFER_DATA_TIMEOUT (1 << 3)
438#define SD_CTRL_INTMASKBUFFER_BUFFER_OVERFLOW (1 << 4)
439#define SD_CTRL_INTMASKBUFFER_BUFFER_UNDERFLOW (1 << 5)
440#define SD_CTRL_INTMASKBUFFER_CMD_TIMEOUT (1 << 6)
441#define SD_CTRL_INTMASKBUFFER_UNK7 (1 << 7)
442#define SD_CTRL_INTMASKBUFFER_BUFFER_READ_ENABLE (1 << 8)
443#define SD_CTRL_INTMASKBUFFER_BUFFER_WRITE_ENABLE (1 << 9)
444#define SD_CTRL_INTMASKBUFFER_ILLEGAL_FUNCTION (1 << 13)
445#define SD_CTRL_INTMASKBUFFER_CMD_BUSY (1 << 14)
446#define SD_CTRL_INTMASKBUFFER_ILLEGAL_ACCESS (1 << 15)
447
448#define SD_CTRL_DETAIL0_RESPONSE_CMD_ERROR (1 << 0)
449#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 2)
450#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_CMD12 (1 << 3)
451#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_READ_DATA (1 << 4)
452#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_WRITE_CRC_STATUS (1 << 5)
453#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 8)
454#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_CMD12 (1 << 9)
455#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_READ_DATA (1 << 10)
456#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_WRITE_CMD (1 << 11)
457
458#define SD_CTRL_DETAIL1_NO_CMD_RESPONSE (1 << 0)
459#define SD_CTRL_DETAIL1_TIMEOUT_READ_DATA (1 << 4)
460#define SD_CTRL_DETAIL1_TIMEOUT_CRS_STATUS (1 << 5)
461#define SD_CTRL_DETAIL1_TIMEOUT_CRC_BUSY (1 << 6)
462
463#define ASIC3_SDIO_CTRL_Base 0x1200
464
465#define ASIC3_SDIO_CTRL_Cmd 0x00
466#define ASIC3_SDIO_CTRL_CardPortSel 0x04
467#define ASIC3_SDIO_CTRL_Arg0 0x08
468#define ASIC3_SDIO_CTRL_Arg1 0x0C
469#define ASIC3_SDIO_CTRL_TransferBlockCount 0x14
470#define ASIC3_SDIO_CTRL_Response0 0x18
471#define ASIC3_SDIO_CTRL_Response1 0x1C
472#define ASIC3_SDIO_CTRL_Response2 0x20
473#define ASIC3_SDIO_CTRL_Response3 0x24
474#define ASIC3_SDIO_CTRL_Response4 0x28
475#define ASIC3_SDIO_CTRL_Response5 0x2C
476#define ASIC3_SDIO_CTRL_Response6 0x30
477#define ASIC3_SDIO_CTRL_Response7 0x34
478#define ASIC3_SDIO_CTRL_CardStatus 0x38
479#define ASIC3_SDIO_CTRL_BufferCtrl 0x3C
480#define ASIC3_SDIO_CTRL_IntMaskCard 0x40
481#define ASIC3_SDIO_CTRL_IntMaskBuffer 0x44
482#define ASIC3_SDIO_CTRL_CardXferDataLen 0x4C
483#define ASIC3_SDIO_CTRL_CardOptionSetup 0x50
484#define ASIC3_SDIO_CTRL_ErrorStatus0 0x54
485#define ASIC3_SDIO_CTRL_ErrorStatus1 0x58
486#define ASIC3_SDIO_CTRL_DataPort 0x60
487#define ASIC3_SDIO_CTRL_TransactionCtrl 0x68
488#define ASIC3_SDIO_CTRL_CardIntCtrl 0x6C
489#define ASIC3_SDIO_CTRL_ClocknWaitCtrl 0x70
490#define ASIC3_SDIO_CTRL_HostInformation 0x74
491#define ASIC3_SDIO_CTRL_ErrorCtrl 0x78
492#define ASIC3_SDIO_CTRL_LEDCtrl 0x7C
493#define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0
494
495#define ASIC3_MAP_SIZE 0x2000
496
497#endif /* __ASIC3_H__ */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index f4c03e0b355e..34023c65d466 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -88,6 +88,9 @@ struct page {
88 void *virtual; /* Kernel virtual address (NULL if 88 void *virtual; /* Kernel virtual address (NULL if
89 not kmapped, ie. highmem) */ 89 not kmapped, ie. highmem) */
90#endif /* WANT_PAGE_VIRTUAL */ 90#endif /* WANT_PAGE_VIRTUAL */
91#ifdef CONFIG_CGROUP_MEM_CONT
92 unsigned long page_cgroup;
93#endif
91}; 94};
92 95
93/* 96/*
@@ -219,6 +222,9 @@ struct mm_struct {
219 /* aio bits */ 222 /* aio bits */
220 rwlock_t ioctx_list_lock; 223 rwlock_t ioctx_list_lock;
221 struct kioctx *ioctx_list; 224 struct kioctx *ioctx_list;
225#ifdef CONFIG_CGROUP_MEM_CONT
226 struct mem_cgroup *mem_cgroup;
227#endif
222}; 228};
223 229
224#endif /* _LINUX_MM_TYPES_H */ 230#endif /* _LINUX_MM_TYPES_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 39d32837265b..df6dd79a0d3b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1765,6 +1765,7 @@
1765#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 1765#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
1766#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 1766#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050
1767#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 1767#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060
1768#define PCI_DEVICE_ID_QUATECH_SPPXP_100 0x0278
1768 1769
1769#define PCI_VENDOR_ID_SEALEVEL 0x135e 1770#define PCI_VENDOR_ID_SEALEVEL 0x135e
1770#define PCI_DEVICE_ID_SEALEVEL_U530 0x7101 1771#define PCI_DEVICE_ID_SEALEVEL_U530 0x7101
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 50faa0ea28e4..1ac969724bb2 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -54,7 +54,7 @@
54#ifdef CONFIG_SMP 54#ifdef CONFIG_SMP
55 55
56struct percpu_data { 56struct percpu_data {
57 void *ptrs[NR_CPUS]; 57 void *ptrs[1];
58}; 58};
59 59
60#define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) 60#define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata)
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 40fac8c4559d..28dfc61cf79e 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -348,6 +348,7 @@ enum
348 FLOW_KEY_RTCLASSID, 348 FLOW_KEY_RTCLASSID,
349 FLOW_KEY_SKUID, 349 FLOW_KEY_SKUID,
350 FLOW_KEY_SKGID, 350 FLOW_KEY_SKGID,
351 FLOW_KEY_VLAN_TAG,
351 __FLOW_KEY_MAX, 352 __FLOW_KEY_MAX,
352}; 353};
353 354
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index b9339d8b95bc..cd6332b88829 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -258,6 +258,7 @@ extern struct pnp_protocol isapnp_protocol;
258#else 258#else
259#define pnp_device_is_isapnp(dev) 0 259#define pnp_device_is_isapnp(dev) 0
260#endif 260#endif
261extern struct mutex pnp_res_mutex;
261 262
262#ifdef CONFIG_PNPBIOS 263#ifdef CONFIG_PNPBIOS
263extern struct pnp_protocol pnpbios_protocol; 264extern struct pnp_protocol pnpbios_protocol;
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 515bff053de8..6ab80714a916 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -204,6 +204,41 @@ static inline void user_enable_block_step(struct task_struct *task)
204} 204}
205#endif /* arch_has_block_step */ 205#endif /* arch_has_block_step */
206 206
207#ifndef arch_ptrace_stop_needed
208/**
209 * arch_ptrace_stop_needed - Decide whether arch_ptrace_stop() should be called
210 * @code: current->exit_code value ptrace will stop with
211 * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with
212 *
213 * This is called with the siglock held, to decide whether or not it's
214 * necessary to release the siglock and call arch_ptrace_stop() with the
215 * same @code and @info arguments. It can be defined to a constant if
216 * arch_ptrace_stop() is never required, or always is. On machines where
217 * this makes sense, it should be defined to a quick test to optimize out
218 * calling arch_ptrace_stop() when it would be superfluous. For example,
219 * if the thread has not been back to user mode since the last stop, the
220 * thread state might indicate that nothing needs to be done.
221 */
222#define arch_ptrace_stop_needed(code, info) (0)
223#endif
224
225#ifndef arch_ptrace_stop
226/**
227 * arch_ptrace_stop - Do machine-specific work before stopping for ptrace
228 * @code: current->exit_code value ptrace will stop with
229 * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with
230 *
231 * This is called with no locks held when arch_ptrace_stop_needed() has
232 * just returned nonzero. It is allowed to block, e.g. for user memory
233 * access. The arch can have machine-specific work to be done before
234 * ptrace stops. On ia64, register backing store gets written back to user
235 * memory here. Since this can be costly (requires dropping the siglock),
236 * we only do it when the arch requires it for this particular stop, as
237 * indicated by arch_ptrace_stop_needed().
238 */
239#define arch_ptrace_stop(code, info) do { } while (0)
240#endif
241
207#endif 242#endif
208 243
209#endif 244#endif
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h
index 19bc9b8b6191..34a196ee7941 100644
--- a/include/linux/qnx4_fs.h
+++ b/include/linux/qnx4_fs.h
@@ -110,6 +110,7 @@ struct qnx4_inode_info {
110 struct inode vfs_inode; 110 struct inode vfs_inode;
111}; 111};
112 112
113extern struct inode *qnx4_iget(struct super_block *, unsigned long);
113extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd); 114extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd);
114extern unsigned long qnx4_count_free_blocks(struct super_block *sb); 115extern unsigned long qnx4_count_free_blocks(struct super_block *sb);
115extern unsigned long qnx4_block_map(struct inode *inode, long iblock); 116extern unsigned long qnx4_block_map(struct inode *inode, long iblock);
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 306a1d1a5af0..e51b531cd0b2 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -244,6 +244,8 @@ struct bitmap {
244 */ 244 */
245 unsigned long daemon_lastrun; /* jiffies of last run */ 245 unsigned long daemon_lastrun; /* jiffies of last run */
246 unsigned long daemon_sleep; /* how many seconds between updates? */ 246 unsigned long daemon_sleep; /* how many seconds between updates? */
247 unsigned long last_end_sync; /* when we lasted called end_sync to
248 * update bitmap with resync progress */
247 249
248 atomic_t pending_writes; /* pending writes to the bitmap file */ 250 atomic_t pending_writes; /* pending writes to the bitmap file */
249 wait_queue_head_t write_wait; 251 wait_queue_head_t write_wait;
@@ -275,6 +277,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset,
275int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); 277int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded);
276void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); 278void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
277void bitmap_close_sync(struct bitmap *bitmap); 279void bitmap_close_sync(struct bitmap *bitmap);
280void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector);
278 281
279void bitmap_unplug(struct bitmap *bitmap); 282void bitmap_unplug(struct bitmap *bitmap);
280void bitmap_daemon_work(struct bitmap *bitmap); 283void bitmap_daemon_work(struct bitmap *bitmap);
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index dcb729244f47..85a068bab625 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -81,6 +81,8 @@ struct mdk_rdev_s
81#define In_sync 2 /* device is in_sync with rest of array */ 81#define In_sync 2 /* device is in_sync with rest of array */
82#define WriteMostly 4 /* Avoid reading if at all possible */ 82#define WriteMostly 4 /* Avoid reading if at all possible */
83#define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */ 83#define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */
84#define AllReserved 6 /* If whole device is reserved for
85 * one array */
84 86
85 int desc_nr; /* descriptor index in the superblock */ 87 int desc_nr; /* descriptor index in the superblock */
86 int raid_disk; /* role of device in array */ 88 int raid_disk; /* role of device in array */
@@ -130,6 +132,9 @@ struct mddev_s
130 minor_version, 132 minor_version,
131 patch_version; 133 patch_version;
132 int persistent; 134 int persistent;
135 int external; /* metadata is
136 * managed externally */
137 char metadata_type[17]; /* externally set*/
133 int chunk_size; 138 int chunk_size;
134 time_t ctime, utime; 139 time_t ctime, utime;
135 int level, layout; 140 int level, layout;
@@ -216,6 +221,8 @@ struct mddev_s
216 atomic_t recovery_active; /* blocks scheduled, but not written */ 221 atomic_t recovery_active; /* blocks scheduled, but not written */
217 wait_queue_head_t recovery_wait; 222 wait_queue_head_t recovery_wait;
218 sector_t recovery_cp; 223 sector_t recovery_cp;
224 sector_t resync_max; /* resync should pause
225 * when it gets here */
219 226
220 spinlock_t write_lock; 227 spinlock_t write_lock;
221 wait_queue_head_t sb_wait; /* for waiting on superblock updates */ 228 wait_queue_head_t sb_wait; /* for waiting on superblock updates */
@@ -306,23 +313,17 @@ static inline char * mdname (mddev_t * mddev)
306 * iterates through some rdev ringlist. It's safe to remove the 313 * iterates through some rdev ringlist. It's safe to remove the
307 * current 'rdev'. Dont touch 'tmp' though. 314 * current 'rdev'. Dont touch 'tmp' though.
308 */ 315 */
309#define ITERATE_RDEV_GENERIC(head,rdev,tmp) \ 316#define rdev_for_each_list(rdev, tmp, list) \
310 \ 317 \
311 for ((tmp) = (head).next; \ 318 for ((tmp) = (list).next; \
312 (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ 319 (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \
313 (tmp) = (tmp)->next, (tmp)->prev != &(head) \ 320 (tmp) = (tmp)->next, (tmp)->prev != &(list) \
314 ; ) 321 ; )
315/* 322/*
316 * iterates through the 'same array disks' ringlist 323 * iterates through the 'same array disks' ringlist
317 */ 324 */
318#define ITERATE_RDEV(mddev,rdev,tmp) \ 325#define rdev_for_each(rdev, tmp, mddev) \
319 ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp) 326 rdev_for_each_list(rdev, tmp, (mddev)->disks)
320
321/*
322 * Iterates through 'pending RAID disks'
323 */
324#define ITERATE_RDEV_PENDING(rdev,tmp) \
325 ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp)
326 327
327typedef struct mdk_thread_s { 328typedef struct mdk_thread_s {
328 void (*run) (mddev_t *mddev); 329 void (*run) (mddev_t *mddev);
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index d32c14de270e..37a642c54871 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -174,10 +174,13 @@ struct rcu_head {
174 * code. 174 * code.
175 */ 175 */
176 176
177#define rcu_assign_pointer(p, v) ({ \ 177#define rcu_assign_pointer(p, v) \
178 smp_wmb(); \ 178 ({ \
179 (p) = (v); \ 179 if (!__builtin_constant_p(v) || \
180 }) 180 ((v) != NULL)) \
181 smp_wmb(); \
182 (p) = (v); \
183 })
181 184
182/** 185/**
183 * synchronize_sched - block until all CPUs have exited any non-preemptive 186 * synchronize_sched - block until all CPUs have exited any non-preemptive
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
new file mode 100644
index 000000000000..61363ce896d5
--- /dev/null
+++ b/include/linux/res_counter.h
@@ -0,0 +1,127 @@
1#ifndef __RES_COUNTER_H__
2#define __RES_COUNTER_H__
3
4/*
5 * Resource Counters
6 * Contain common data types and routines for resource accounting
7 *
8 * Copyright 2007 OpenVZ SWsoft Inc
9 *
10 * Author: Pavel Emelianov <xemul@openvz.org>
11 *
12 */
13
14#include <linux/cgroup.h>
15
16/*
17 * The core object. the cgroup that wishes to account for some
18 * resource may include this counter into its structures and use
19 * the helpers described beyond
20 */
21
22struct res_counter {
23 /*
24 * the current resource consumption level
25 */
26 unsigned long long usage;
27 /*
28 * the limit that usage cannot exceed
29 */
30 unsigned long long limit;
31 /*
32 * the number of unsuccessful attempts to consume the resource
33 */
34 unsigned long long failcnt;
35 /*
36 * the lock to protect all of the above.
37 * the routines below consider this to be IRQ-safe
38 */
39 spinlock_t lock;
40};
41
42/*
43 * Helpers to interact with userspace
44 * res_counter_read/_write - put/get the specified fields from the
45 * res_counter struct to/from the user
46 *
47 * @counter: the counter in question
48 * @member: the field to work with (see RES_xxx below)
49 * @buf: the buffer to opeate on,...
50 * @nbytes: its size...
51 * @pos: and the offset.
52 */
53
54ssize_t res_counter_read(struct res_counter *counter, int member,
55 const char __user *buf, size_t nbytes, loff_t *pos,
56 int (*read_strategy)(unsigned long long val, char *s));
57ssize_t res_counter_write(struct res_counter *counter, int member,
58 const char __user *buf, size_t nbytes, loff_t *pos,
59 int (*write_strategy)(char *buf, unsigned long long *val));
60
61/*
62 * the field descriptors. one for each member of res_counter
63 */
64
65enum {
66 RES_USAGE,
67 RES_LIMIT,
68 RES_FAILCNT,
69};
70
71/*
72 * helpers for accounting
73 */
74
75void res_counter_init(struct res_counter *counter);
76
77/*
78 * charge - try to consume more resource.
79 *
80 * @counter: the counter
81 * @val: the amount of the resource. each controller defines its own
82 * units, e.g. numbers, bytes, Kbytes, etc
83 *
84 * returns 0 on success and <0 if the counter->usage will exceed the
85 * counter->limit _locked call expects the counter->lock to be taken
86 */
87
88int res_counter_charge_locked(struct res_counter *counter, unsigned long val);
89int res_counter_charge(struct res_counter *counter, unsigned long val);
90
91/*
92 * uncharge - tell that some portion of the resource is released
93 *
94 * @counter: the counter
95 * @val: the amount of the resource
96 *
97 * these calls check for usage underflow and show a warning on the console
98 * _locked call expects the counter->lock to be taken
99 */
100
101void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val);
102void res_counter_uncharge(struct res_counter *counter, unsigned long val);
103
104static inline bool res_counter_limit_check_locked(struct res_counter *cnt)
105{
106 if (cnt->usage < cnt->limit)
107 return true;
108
109 return false;
110}
111
112/*
113 * Helper function to detect if the cgroup is within it's limit or
114 * not. It's currently called from cgroup_rss_prepare()
115 */
116static inline bool res_counter_check_under_limit(struct res_counter *cnt)
117{
118 bool ret;
119 unsigned long flags;
120
121 spin_lock_irqsave(&cnt->lock, flags);
122 ret = res_counter_limit_check_locked(cnt);
123 spin_unlock_irqrestore(&cnt->lock, flags);
124 return ret;
125}
126
127#endif
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 97347f22fc20..1383692ac5bd 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -8,6 +8,7 @@
8#include <linux/slab.h> 8#include <linux/slab.h>
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/spinlock.h> 10#include <linux/spinlock.h>
11#include <linux/memcontrol.h>
11 12
12/* 13/*
13 * The anon_vma heads a list of private "related" vmas, to scan if 14 * The anon_vma heads a list of private "related" vmas, to scan if
@@ -86,7 +87,7 @@ static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma,
86/* 87/*
87 * Called from mm/vmscan.c to handle paging out 88 * Called from mm/vmscan.c to handle paging out
88 */ 89 */
89int page_referenced(struct page *, int is_locked); 90int page_referenced(struct page *, int is_locked, struct mem_cgroup *cnt);
90int try_to_unmap(struct page *, int ignore_refs); 91int try_to_unmap(struct page *, int ignore_refs);
91 92
92/* 93/*
@@ -114,7 +115,7 @@ int page_mkclean(struct page *);
114#define anon_vma_prepare(vma) (0) 115#define anon_vma_prepare(vma) (0)
115#define anon_vma_link(vma) do {} while (0) 116#define anon_vma_link(vma) do {} while (0)
116 117
117#define page_referenced(page,l) TestClearPageReferenced(page) 118#define page_referenced(page,l,cnt) TestClearPageReferenced(page)
118#define try_to_unmap(page, refs) SWAP_FAIL 119#define try_to_unmap(page, refs) SWAP_FAIL
119 120
120static inline int page_mkclean(struct page *page) 121static inline int page_mkclean(struct page *page)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9c13be3a21e8..8a4812c1c038 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -92,6 +92,7 @@ struct sched_param {
92 92
93#include <asm/processor.h> 93#include <asm/processor.h>
94 94
95struct mem_cgroup;
95struct exec_domain; 96struct exec_domain;
96struct futex_pi_state; 97struct futex_pi_state;
97struct robust_list_head; 98struct robust_list_head;
@@ -810,7 +811,7 @@ static inline int above_background_load(void)
810 811
811struct io_context; /* See blkdev.h */ 812struct io_context; /* See blkdev.h */
812#define NGROUPS_SMALL 32 813#define NGROUPS_SMALL 32
813#define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t))) 814#define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t)))
814struct group_info { 815struct group_info {
815 int ngroups; 816 int ngroups;
816 atomic_t usage; 817 atomic_t usage;
diff --git a/include/linux/serial167.h b/include/linux/serial167.h
index 71b6df2516a6..59c81b708562 100644
--- a/include/linux/serial167.h
+++ b/include/linux/serial167.h
@@ -37,7 +37,6 @@ struct cyclades_port {
37 int ignore_status_mask; 37 int ignore_status_mask;
38 int close_delay; 38 int close_delay;
39 int IER; /* Interrupt Enable Register */ 39 int IER; /* Interrupt Enable Register */
40 unsigned long event;
41 unsigned long last_active; 40 unsigned long last_active;
42 int count; /* # of fd on device */ 41 int count; /* # of fd on device */
43 int x_char; /* to be pushed out ASAP */ 42 int x_char; /* to be pushed out ASAP */
@@ -49,7 +48,6 @@ struct cyclades_port {
49 int xmit_cnt; 48 int xmit_cnt;
50 int default_threshold; 49 int default_threshold;
51 int default_timeout; 50 int default_timeout;
52 struct work_struct tqueue;
53 wait_queue_head_t open_wait; 51 wait_queue_head_t open_wait;
54 wait_queue_head_t close_wait; 52 wait_queue_head_t close_wait;
55 struct cyclades_monitor mon; 53 struct cyclades_monitor mon;
@@ -67,18 +65,6 @@ struct cyclades_port {
67#define CYGETDEFTIMEOUT 0x435908 65#define CYGETDEFTIMEOUT 0x435908
68#define CYSETDEFTIMEOUT 0x435909 66#define CYSETDEFTIMEOUT 0x435909
69 67
70/*
71 * Events are used to schedule things to happen at timer-interrupt
72 * time, instead of at cy interrupt time.
73 */
74#define Cy_EVENT_READ_PROCESS 0
75#define Cy_EVENT_WRITE_WAKEUP 1
76#define Cy_EVENT_HANGUP 2
77#define Cy_EVENT_BREAK 3
78#define Cy_EVENT_OPEN_WAKEUP 4
79
80
81
82#define CyMaxChipsPerCard 1 68#define CyMaxChipsPerCard 1
83 69
84/**** cd2401 registers ****/ 70/**** cd2401 registers ****/
diff --git a/include/linux/shm.h b/include/linux/shm.h
index eeaed921a1dc..eca6235a46c0 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -3,7 +3,11 @@
3 3
4#include <linux/ipc.h> 4#include <linux/ipc.h>
5#include <linux/errno.h> 5#include <linux/errno.h>
6#ifdef __KERNEL__
6#include <asm/page.h> 7#include <asm/page.h>
8#else
9#include <unistd.h>
10#endif
7 11
8/* 12/*
9 * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can 13 * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
@@ -13,7 +17,11 @@
13#define SHMMAX 0x2000000 /* max shared seg size (bytes) */ 17#define SHMMAX 0x2000000 /* max shared seg size (bytes) */
14#define SHMMIN 1 /* min shared seg size (bytes) */ 18#define SHMMIN 1 /* min shared seg size (bytes) */
15#define SHMMNI 4096 /* max num of segs system wide */ 19#define SHMMNI 4096 /* max num of segs system wide */
20#ifdef __KERNEL__
16#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ 21#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
22#else
23#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
24#endif
17#define SHMSEG SHMMNI /* max shared segs per process */ 25#define SHMSEG SHMMNI /* max shared segs per process */
18 26
19#ifdef __KERNEL__ 27#ifdef __KERNEL__
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 0ae338866240..7e095147656c 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -371,6 +371,8 @@ int unhandled_signal(struct task_struct *tsk, int sig);
371 (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \ 371 (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \
372 (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL) 372 (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL)
373 373
374void signals_init(void);
375
374#endif /* __KERNEL__ */ 376#endif /* __KERNEL__ */
375 377
376#endif /* _LINUX_SIGNAL_H */ 378#endif /* _LINUX_SIGNAL_H */
diff --git a/include/linux/sm501.h b/include/linux/sm501.h
index 9e3aaad6fe4d..932a9efee8a5 100644
--- a/include/linux/sm501.h
+++ b/include/linux/sm501.h
@@ -70,6 +70,8 @@ extern unsigned long sm501_gpio_get(struct device *dev,
70#define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) 70#define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1)
71#define SM501FB_FLAG_USE_HWCURSOR (1<<2) 71#define SM501FB_FLAG_USE_HWCURSOR (1<<2)
72#define SM501FB_FLAG_USE_HWACCEL (1<<3) 72#define SM501FB_FLAG_USE_HWACCEL (1<<3)
73#define SM501FB_FLAG_PANEL_USE_FPEN (1<<4)
74#define SM501FB_FLAG_PANEL_USE_VBIASEN (1<<5)
73 75
74struct sm501_platdata_fbsub { 76struct sm501_platdata_fbsub {
75 struct fb_videomode *def_mode; 77 struct fb_videomode *def_mode;
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index e18f5c23b930..9d5da8b2ccf9 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -373,6 +373,15 @@ void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
373 if (sdev->bus->bustype == SSB_BUSTYPE_PCI) 373 if (sdev->bus->bustype == SSB_BUSTYPE_PCI)
374 pci_set_power_state(sdev->bus->host_pci, state); 374 pci_set_power_state(sdev->bus->host_pci, state);
375} 375}
376#else
377static inline void ssb_pcihost_unregister(struct pci_driver *driver)
378{
379}
380
381static inline
382void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
383{
384}
376#endif /* CONFIG_SSB_PCIHOST */ 385#endif /* CONFIG_SSB_PCIHOST */
377 386
378 387
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index 94b4a10b912f..0424d75a5aaa 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -95,7 +95,6 @@ struct stlport {
95 struct tty_struct *tty; 95 struct tty_struct *tty;
96 wait_queue_head_t open_wait; 96 wait_queue_head_t open_wait;
97 wait_queue_head_t close_wait; 97 wait_queue_head_t close_wait;
98 struct work_struct tqueue;
99 comstats_t stats; 98 comstats_t stats;
100 struct stlrq tx; 99 struct stlrq tx;
101}; 100};
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 353153ea0bd5..3ca5c4bd6d3f 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -5,6 +5,7 @@
5#include <linux/linkage.h> 5#include <linux/linkage.h>
6#include <linux/mmzone.h> 6#include <linux/mmzone.h>
7#include <linux/list.h> 7#include <linux/list.h>
8#include <linux/memcontrol.h>
8#include <linux/sched.h> 9#include <linux/sched.h>
9 10
10#include <asm/atomic.h> 11#include <asm/atomic.h>
@@ -182,6 +183,9 @@ extern void swap_setup(void);
182/* linux/mm/vmscan.c */ 183/* linux/mm/vmscan.c */
183extern unsigned long try_to_free_pages(struct zone **zones, int order, 184extern unsigned long try_to_free_pages(struct zone **zones, int order,
184 gfp_t gfp_mask); 185 gfp_t gfp_mask);
186extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
187 gfp_t gfp_mask);
188extern int __isolate_lru_page(struct page *page, int mode);
185extern unsigned long shrink_all_memory(unsigned long nr_pages); 189extern unsigned long shrink_all_memory(unsigned long nr_pages);
186extern int vm_swappiness; 190extern int vm_swappiness;
187extern int remove_mapping(struct address_space *mapping, struct page *page); 191extern int remove_mapping(struct address_space *mapping, struct page *page);
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 24c6a2b59511..8ea3e71ba7fa 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -244,6 +244,8 @@ extern int do_adjtimex(struct timex *);
244/* Don't use! Compatibility define for existing users. */ 244/* Don't use! Compatibility define for existing users. */
245#define tickadj (500/HZ ? : 1) 245#define tickadj (500/HZ ? : 1)
246 246
247int read_current_timer(unsigned long *timer_val);
248
247#endif /* KERNEL */ 249#endif /* KERNEL */
248 250
249#endif /* LINUX_TIMEX_H */ 251#endif /* LINUX_TIMEX_H */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 402de892b3ed..dd8e08fe8855 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -53,13 +53,6 @@
53 */ 53 */
54#define __DISABLED_CHAR '\0' 54#define __DISABLED_CHAR '\0'
55 55
56/*
57 * This is the flip buffer used for the tty driver. The buffer is
58 * located in the tty structure, and is used as a high speed interface
59 * between the tty driver and the tty line discipline.
60 */
61#define TTY_FLIPBUF_SIZE 512
62
63struct tty_buffer { 56struct tty_buffer {
64 struct tty_buffer *next; 57 struct tty_buffer *next;
65 char *char_buf_ptr; 58 char *char_buf_ptr;
@@ -74,7 +67,6 @@ struct tty_buffer {
74 67
75struct tty_bufhead { 68struct tty_bufhead {
76 struct delayed_work work; 69 struct delayed_work work;
77 struct semaphore pty_sem;
78 spinlock_t lock; 70 spinlock_t lock;
79 struct tty_buffer *head; /* Queue head */ 71 struct tty_buffer *head; /* Queue head */
80 struct tty_buffer *tail; /* Active buffer */ 72 struct tty_buffer *tail; /* Active buffer */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index feb5e99a1079..9448ffbdcbf6 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -77,6 +77,7 @@ void change_console(struct vc_data *new_vc);
77void reset_vc(struct vc_data *vc); 77void reset_vc(struct vc_data *vc);
78extern int unbind_con_driver(const struct consw *csw, int first, int last, 78extern int unbind_con_driver(const struct consw *csw, int first, int last,
79 int deflt); 79 int deflt);
80int vty_init(void);
80 81
81/* 82/*
82 * vc_screen.c shares this temporary buffer with the console write code so that 83 * vc_screen.c shares this temporary buffer with the console write code so that
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h
new file mode 100644
index 000000000000..9797fec7748a
--- /dev/null
+++ b/include/linux/w1-gpio.h
@@ -0,0 +1,23 @@
1/*
2 * w1-gpio interface to platform code
3 *
4 * Copyright (C) 2007 Ville Syrjala <syrjala@sci.fi>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 */
10#ifndef _LINUX_W1_GPIO_H
11#define _LINUX_W1_GPIO_H
12
13/**
14 * struct w1_gpio_platform_data - Platform-dependent data for w1-gpio
15 * @pin: GPIO pin to use
16 * @is_open_drain: GPIO pin is configured as open drain
17 */
18struct w1_gpio_platform_data {
19 unsigned int pin;
20 unsigned int is_open_drain:1;
21};
22
23#endif /* _LINUX_W1_GPIO_H */