diff options
Diffstat (limited to 'include/linux')
108 files changed, 1955 insertions, 883 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 34321cfffeab..dfcd920c3e54 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -41,8 +41,6 @@ | |||
41 | #include <acpi/acpi_drivers.h> | 41 | #include <acpi/acpi_drivers.h> |
42 | #include <acpi/acpi_numa.h> | 42 | #include <acpi/acpi_numa.h> |
43 | #include <asm/acpi.h> | 43 | #include <asm/acpi.h> |
44 | #include <linux/dmi.h> | ||
45 | |||
46 | 44 | ||
47 | enum acpi_irq_model_id { | 45 | enum acpi_irq_model_id { |
48 | ACPI_IRQ_MODEL_PIC = 0, | 46 | ACPI_IRQ_MODEL_PIC = 0, |
@@ -219,10 +217,8 @@ static inline int acpi_video_display_switch_support(void) | |||
219 | #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */ | 217 | #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */ |
220 | 218 | ||
221 | extern int acpi_blacklisted(void); | 219 | extern int acpi_blacklisted(void); |
222 | #ifdef CONFIG_DMI | ||
223 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); | 220 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); |
224 | extern int acpi_osi_setup(char *str); | 221 | extern int acpi_osi_setup(char *str); |
225 | #endif | ||
226 | 222 | ||
227 | #ifdef CONFIG_ACPI_NUMA | 223 | #ifdef CONFIG_ACPI_NUMA |
228 | int acpi_get_pxm(acpi_handle handle); | 224 | int acpi_get_pxm(acpi_handle handle); |
@@ -292,7 +288,10 @@ void __init acpi_s4_no_nvs(void); | |||
292 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); | 288 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); |
293 | extern void acpi_early_init(void); | 289 | extern void acpi_early_init(void); |
294 | 290 | ||
295 | #else /* CONFIG_ACPI */ | 291 | #else /* !CONFIG_ACPI */ |
292 | |||
293 | #define acpi_disabled 1 | ||
294 | |||
296 | static inline void acpi_early_init(void) { } | 295 | static inline void acpi_early_init(void) { } |
297 | 296 | ||
298 | static inline int early_acpi_boot_init(void) | 297 | static inline int early_acpi_boot_init(void) |
@@ -331,5 +330,11 @@ static inline int acpi_check_mem_region(resource_size_t start, | |||
331 | return 0; | 330 | return 0; |
332 | } | 331 | } |
333 | 332 | ||
333 | struct acpi_table_header; | ||
334 | static inline int acpi_table_parse(char *id, | ||
335 | int (*handler)(struct acpi_table_header *)) | ||
336 | { | ||
337 | return -1; | ||
338 | } | ||
334 | #endif /* !CONFIG_ACPI */ | 339 | #endif /* !CONFIG_ACPI */ |
335 | #endif /*_LINUX_ACPI_H*/ | 340 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index e0a0cdc2da43..69a21e0ebd33 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h | |||
@@ -8,6 +8,9 @@ | |||
8 | #ifndef _LINUX_ANON_INODES_H | 8 | #ifndef _LINUX_ANON_INODES_H |
9 | #define _LINUX_ANON_INODES_H | 9 | #define _LINUX_ANON_INODES_H |
10 | 10 | ||
11 | struct file *anon_inode_getfile(const char *name, | ||
12 | const struct file_operations *fops, | ||
13 | void *priv, int flags); | ||
11 | int anon_inode_getfd(const char *name, const struct file_operations *fops, | 14 | int anon_inode_getfd(const char *name, const struct file_operations *fops, |
12 | void *priv, int flags); | 15 | void *priv, int flags); |
13 | 16 | ||
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 2046b5b8af48..aece486ac734 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -120,7 +120,7 @@ extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | |||
120 | extern int prepare_bprm_creds(struct linux_binprm *bprm); | 120 | extern int prepare_bprm_creds(struct linux_binprm *bprm); |
121 | extern void install_exec_creds(struct linux_binprm *bprm); | 121 | extern void install_exec_creds(struct linux_binprm *bprm); |
122 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); | 122 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); |
123 | extern int set_binfmt(struct linux_binfmt *new); | 123 | extern void set_binfmt(struct linux_binfmt *new); |
124 | extern void free_bprm(struct linux_binprm *); | 124 | extern void free_bprm(struct linux_binprm *); |
125 | 125 | ||
126 | #endif /* __KERNEL__ */ | 126 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 90bba9e62286..b62bb9294d0c 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -141,6 +141,38 @@ enum { | |||
141 | CGRP_WAIT_ON_RMDIR, | 141 | CGRP_WAIT_ON_RMDIR, |
142 | }; | 142 | }; |
143 | 143 | ||
144 | /* which pidlist file are we talking about? */ | ||
145 | enum cgroup_filetype { | ||
146 | CGROUP_FILE_PROCS, | ||
147 | CGROUP_FILE_TASKS, | ||
148 | }; | ||
149 | |||
150 | /* | ||
151 | * A pidlist is a list of pids that virtually represents the contents of one | ||
152 | * of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists, | ||
153 | * a pair (one each for procs, tasks) for each pid namespace that's relevant | ||
154 | * to the cgroup. | ||
155 | */ | ||
156 | struct cgroup_pidlist { | ||
157 | /* | ||
158 | * used to find which pidlist is wanted. doesn't change as long as | ||
159 | * this particular list stays in the list. | ||
160 | */ | ||
161 | struct { enum cgroup_filetype type; struct pid_namespace *ns; } key; | ||
162 | /* array of xids */ | ||
163 | pid_t *list; | ||
164 | /* how many elements the above list has */ | ||
165 | int length; | ||
166 | /* how many files are using the current array */ | ||
167 | int use_count; | ||
168 | /* each of these stored in a list by its cgroup */ | ||
169 | struct list_head links; | ||
170 | /* pointer to the cgroup we belong to, for list removal purposes */ | ||
171 | struct cgroup *owner; | ||
172 | /* protects the other fields */ | ||
173 | struct rw_semaphore mutex; | ||
174 | }; | ||
175 | |||
144 | struct cgroup { | 176 | struct cgroup { |
145 | unsigned long flags; /* "unsigned long" so bitops work */ | 177 | unsigned long flags; /* "unsigned long" so bitops work */ |
146 | 178 | ||
@@ -179,11 +211,12 @@ struct cgroup { | |||
179 | */ | 211 | */ |
180 | struct list_head release_list; | 212 | struct list_head release_list; |
181 | 213 | ||
182 | /* pids_mutex protects pids_list and cached pid arrays. */ | 214 | /* |
183 | struct rw_semaphore pids_mutex; | 215 | * list of pidlists, up to two for each namespace (one for procs, one |
184 | 216 | * for tasks); created on demand. | |
185 | /* Linked list of struct cgroup_pids */ | 217 | */ |
186 | struct list_head pids_list; | 218 | struct list_head pidlists; |
219 | struct mutex pidlist_mutex; | ||
187 | 220 | ||
188 | /* For RCU-protected deletion */ | 221 | /* For RCU-protected deletion */ |
189 | struct rcu_head rcu_head; | 222 | struct rcu_head rcu_head; |
@@ -227,6 +260,9 @@ struct css_set { | |||
227 | * during subsystem registration (at boot time). | 260 | * during subsystem registration (at boot time). |
228 | */ | 261 | */ |
229 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | 262 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; |
263 | |||
264 | /* For RCU-protected deletion */ | ||
265 | struct rcu_head rcu_head; | ||
230 | }; | 266 | }; |
231 | 267 | ||
232 | /* | 268 | /* |
@@ -389,10 +425,11 @@ struct cgroup_subsys { | |||
389 | struct cgroup *cgrp); | 425 | struct cgroup *cgrp); |
390 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 426 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
391 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 427 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
392 | int (*can_attach)(struct cgroup_subsys *ss, | 428 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
393 | struct cgroup *cgrp, struct task_struct *tsk); | 429 | struct task_struct *tsk, bool threadgroup); |
394 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 430 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
395 | struct cgroup *old_cgrp, struct task_struct *tsk); | 431 | struct cgroup *old_cgrp, struct task_struct *tsk, |
432 | bool threadgroup); | ||
396 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); | 433 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); |
397 | void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); | 434 | void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); |
398 | int (*populate)(struct cgroup_subsys *ss, | 435 | int (*populate)(struct cgroup_subsys *ss, |
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h index b8125b2eb665..47dac5ea8d3a 100644 --- a/include/linux/cn_proc.h +++ b/include/linux/cn_proc.h | |||
@@ -52,6 +52,7 @@ struct proc_event { | |||
52 | PROC_EVENT_EXEC = 0x00000002, | 52 | PROC_EVENT_EXEC = 0x00000002, |
53 | PROC_EVENT_UID = 0x00000004, | 53 | PROC_EVENT_UID = 0x00000004, |
54 | PROC_EVENT_GID = 0x00000040, | 54 | PROC_EVENT_GID = 0x00000040, |
55 | PROC_EVENT_SID = 0x00000080, | ||
55 | /* "next" should be 0x00000400 */ | 56 | /* "next" should be 0x00000400 */ |
56 | /* "last" is the last process event: exit */ | 57 | /* "last" is the last process event: exit */ |
57 | PROC_EVENT_EXIT = 0x80000000 | 58 | PROC_EVENT_EXIT = 0x80000000 |
@@ -89,6 +90,11 @@ struct proc_event { | |||
89 | } e; | 90 | } e; |
90 | } id; | 91 | } id; |
91 | 92 | ||
93 | struct sid_proc_event { | ||
94 | __kernel_pid_t process_pid; | ||
95 | __kernel_pid_t process_tgid; | ||
96 | } sid; | ||
97 | |||
92 | struct exit_proc_event { | 98 | struct exit_proc_event { |
93 | __kernel_pid_t process_pid; | 99 | __kernel_pid_t process_pid; |
94 | __kernel_pid_t process_tgid; | 100 | __kernel_pid_t process_tgid; |
@@ -102,6 +108,7 @@ struct proc_event { | |||
102 | void proc_fork_connector(struct task_struct *task); | 108 | void proc_fork_connector(struct task_struct *task); |
103 | void proc_exec_connector(struct task_struct *task); | 109 | void proc_exec_connector(struct task_struct *task); |
104 | void proc_id_connector(struct task_struct *task, int which_id); | 110 | void proc_id_connector(struct task_struct *task, int which_id); |
111 | void proc_sid_connector(struct task_struct *task); | ||
105 | void proc_exit_connector(struct task_struct *task); | 112 | void proc_exit_connector(struct task_struct *task); |
106 | #else | 113 | #else |
107 | static inline void proc_fork_connector(struct task_struct *task) | 114 | static inline void proc_fork_connector(struct task_struct *task) |
@@ -114,6 +121,9 @@ static inline void proc_id_connector(struct task_struct *task, | |||
114 | int which_id) | 121 | int which_id) |
115 | {} | 122 | {} |
116 | 123 | ||
124 | static inline void proc_sid_connector(struct task_struct *task) | ||
125 | {} | ||
126 | |||
117 | static inline void proc_exit_connector(struct task_struct *task) | 127 | static inline void proc_exit_connector(struct task_struct *task) |
118 | {} | 128 | {} |
119 | #endif /* CONFIG_PROC_EVENTS */ | 129 | #endif /* CONFIG_PROC_EVENTS */ |
diff --git a/include/linux/configfs.h b/include/linux/configfs.h index 7f627775c947..ddb7a97c78c2 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h | |||
@@ -27,8 +27,8 @@ | |||
27 | * | 27 | * |
28 | * configfs Copyright (C) 2005 Oracle. All rights reserved. | 28 | * configfs Copyright (C) 2005 Oracle. All rights reserved. |
29 | * | 29 | * |
30 | * Please read Documentation/filesystems/configfs.txt before using the | 30 | * Please read Documentation/filesystems/configfs/configfs.txt before using |
31 | * configfs interface, ESPECIALLY the parts about reference counts and | 31 | * the configfs interface, ESPECIALLY the parts about reference counts and |
32 | * item destructors. | 32 | * item destructors. |
33 | */ | 33 | */ |
34 | 34 | ||
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 796df12091b7..789cf5f920ce 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -3,444 +3,37 @@ | |||
3 | 3 | ||
4 | /* | 4 | /* |
5 | * Cpumasks provide a bitmap suitable for representing the | 5 | * Cpumasks provide a bitmap suitable for representing the |
6 | * set of CPU's in a system, one bit position per CPU number. | 6 | * set of CPU's in a system, one bit position per CPU number. In general, |
7 | * | 7 | * only nr_cpu_ids (<= NR_CPUS) bits are valid. |
8 | * The new cpumask_ ops take a "struct cpumask *"; the old ones | ||
9 | * use cpumask_t. | ||
10 | * | ||
11 | * See detailed comments in the file linux/bitmap.h describing the | ||
12 | * data type on which these cpumasks are based. | ||
13 | * | ||
14 | * For details of cpumask_scnprintf() and cpumask_parse_user(), | ||
15 | * see bitmap_scnprintf() and bitmap_parse_user() in lib/bitmap.c. | ||
16 | * For details of cpulist_scnprintf() and cpulist_parse(), see | ||
17 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. | ||
18 | * For details of cpu_remap(), see bitmap_bitremap in lib/bitmap.c | ||
19 | * For details of cpus_remap(), see bitmap_remap in lib/bitmap.c. | ||
20 | * For details of cpus_onto(), see bitmap_onto in lib/bitmap.c. | ||
21 | * For details of cpus_fold(), see bitmap_fold in lib/bitmap.c. | ||
22 | * | ||
23 | * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | ||
24 | * Note: The alternate operations with the suffix "_nr" are used | ||
25 | * to limit the range of the loop to nr_cpu_ids instead of | ||
26 | * NR_CPUS when NR_CPUS > 64 for performance reasons. | ||
27 | * If NR_CPUS is <= 64 then most assembler bitmask | ||
28 | * operators execute faster with a constant range, so | ||
29 | * the operator will continue to use NR_CPUS. | ||
30 | * | ||
31 | * Another consideration is that nr_cpu_ids is initialized | ||
32 | * to NR_CPUS and isn't lowered until the possible cpus are | ||
33 | * discovered (including any disabled cpus). So early uses | ||
34 | * will span the entire range of NR_CPUS. | ||
35 | * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | ||
36 | * | ||
37 | * The obsolescent cpumask operations are: | ||
38 | * | ||
39 | * void cpu_set(cpu, mask) turn on bit 'cpu' in mask | ||
40 | * void cpu_clear(cpu, mask) turn off bit 'cpu' in mask | ||
41 | * void cpus_setall(mask) set all bits | ||
42 | * void cpus_clear(mask) clear all bits | ||
43 | * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask | ||
44 | * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask | ||
45 | * | ||
46 | * int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] | ||
47 | * void cpus_or(dst, src1, src2) dst = src1 | src2 [union] | ||
48 | * void cpus_xor(dst, src1, src2) dst = src1 ^ src2 | ||
49 | * int cpus_andnot(dst, src1, src2) dst = src1 & ~src2 | ||
50 | * void cpus_complement(dst, src) dst = ~src | ||
51 | * | ||
52 | * int cpus_equal(mask1, mask2) Does mask1 == mask2? | ||
53 | * int cpus_intersects(mask1, mask2) Do mask1 and mask2 intersect? | ||
54 | * int cpus_subset(mask1, mask2) Is mask1 a subset of mask2? | ||
55 | * int cpus_empty(mask) Is mask empty (no bits sets)? | ||
56 | * int cpus_full(mask) Is mask full (all bits sets)? | ||
57 | * int cpus_weight(mask) Hamming weigh - number of set bits | ||
58 | * int cpus_weight_nr(mask) Same using nr_cpu_ids instead of NR_CPUS | ||
59 | * | ||
60 | * void cpus_shift_right(dst, src, n) Shift right | ||
61 | * void cpus_shift_left(dst, src, n) Shift left | ||
62 | * | ||
63 | * int first_cpu(mask) Number lowest set bit, or NR_CPUS | ||
64 | * int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS | ||
65 | * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids | ||
66 | * | ||
67 | * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set | ||
68 | * (can be used as an lvalue) | ||
69 | * CPU_MASK_ALL Initializer - all bits set | ||
70 | * CPU_MASK_NONE Initializer - no bits set | ||
71 | * unsigned long *cpus_addr(mask) Array of unsigned long's in mask | ||
72 | * | ||
73 | * CPUMASK_ALLOC kmalloc's a structure that is a composite of many cpumask_t | ||
74 | * variables, and CPUMASK_PTR provides pointers to each field. | ||
75 | * | ||
76 | * The structure should be defined something like this: | ||
77 | * struct my_cpumasks { | ||
78 | * cpumask_t mask1; | ||
79 | * cpumask_t mask2; | ||
80 | * }; | ||
81 | * | ||
82 | * Usage is then: | ||
83 | * CPUMASK_ALLOC(my_cpumasks); | ||
84 | * CPUMASK_PTR(mask1, my_cpumasks); | ||
85 | * CPUMASK_PTR(mask2, my_cpumasks); | ||
86 | * | ||
87 | * --- DO NOT reference cpumask_t pointers until this check --- | ||
88 | * if (my_cpumasks == NULL) | ||
89 | * "kmalloc failed"... | ||
90 | * | ||
91 | * References are now pointers to the cpumask_t variables (*mask1, ...) | ||
92 | * | ||
93 | *if NR_CPUS > BITS_PER_LONG | ||
94 | * CPUMASK_ALLOC(m) Declares and allocates struct m *m = | ||
95 | * kmalloc(sizeof(*m), GFP_KERNEL) | ||
96 | * CPUMASK_FREE(m) Macro for kfree(m) | ||
97 | *else | ||
98 | * CPUMASK_ALLOC(m) Declares struct m _m, *m = &_m | ||
99 | * CPUMASK_FREE(m) Nop | ||
100 | *endif | ||
101 | * CPUMASK_PTR(v, m) Declares cpumask_t *v = &(m->v) | ||
102 | * ------------------------------------------------------------------------ | ||
103 | * | ||
104 | * int cpumask_scnprintf(buf, len, mask) Format cpumask for printing | ||
105 | * int cpumask_parse_user(ubuf, ulen, mask) Parse ascii string as cpumask | ||
106 | * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing | ||
107 | * int cpulist_parse(buf, map) Parse ascii string as cpulist | ||
108 | * int cpu_remap(oldbit, old, new) newbit = map(old, new)(oldbit) | ||
109 | * void cpus_remap(dst, src, old, new) *dst = map(old, new)(src) | ||
110 | * void cpus_onto(dst, orig, relmap) *dst = orig relative to relmap | ||
111 | * void cpus_fold(dst, orig, sz) dst bits = orig bits mod sz | ||
112 | * | ||
113 | * for_each_cpu_mask(cpu, mask) for-loop cpu over mask using NR_CPUS | ||
114 | * for_each_cpu_mask_nr(cpu, mask) for-loop cpu over mask using nr_cpu_ids | ||
115 | * | ||
116 | * int num_online_cpus() Number of online CPUs | ||
117 | * int num_possible_cpus() Number of all possible CPUs | ||
118 | * int num_present_cpus() Number of present CPUs | ||
119 | * | ||
120 | * int cpu_online(cpu) Is some cpu online? | ||
121 | * int cpu_possible(cpu) Is some cpu possible? | ||
122 | * int cpu_present(cpu) Is some cpu present (can schedule)? | ||
123 | * | ||
124 | * int any_online_cpu(mask) First online cpu in mask | ||
125 | * | ||
126 | * for_each_possible_cpu(cpu) for-loop cpu over cpu_possible_map | ||
127 | * for_each_online_cpu(cpu) for-loop cpu over cpu_online_map | ||
128 | * for_each_present_cpu(cpu) for-loop cpu over cpu_present_map | ||
129 | * | ||
130 | * Subtlety: | ||
131 | * 1) The 'type-checked' form of cpu_isset() causes gcc (3.3.2, anyway) | ||
132 | * to generate slightly worse code. Note for example the additional | ||
133 | * 40 lines of assembly code compiling the "for each possible cpu" | ||
134 | * loops buried in the disk_stat_read() macros calls when compiling | ||
135 | * drivers/block/genhd.c (arch i386, CONFIG_SMP=y). So use a simple | ||
136 | * one-line #define for cpu_isset(), instead of wrapping an inline | ||
137 | * inside a macro, the way we do the other calls. | ||
138 | */ | 8 | */ |
139 | |||
140 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
141 | #include <linux/threads.h> | 10 | #include <linux/threads.h> |
142 | #include <linux/bitmap.h> | 11 | #include <linux/bitmap.h> |
143 | 12 | ||
144 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; | 13 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; |
145 | extern cpumask_t _unused_cpumask_arg_; | ||
146 | |||
147 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
148 | #define cpu_set(cpu, dst) __cpu_set((cpu), &(dst)) | ||
149 | static inline void __cpu_set(int cpu, volatile cpumask_t *dstp) | ||
150 | { | ||
151 | set_bit(cpu, dstp->bits); | ||
152 | } | ||
153 | |||
154 | #define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst)) | ||
155 | static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp) | ||
156 | { | ||
157 | clear_bit(cpu, dstp->bits); | ||
158 | } | ||
159 | |||
160 | #define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS) | ||
161 | static inline void __cpus_setall(cpumask_t *dstp, int nbits) | ||
162 | { | ||
163 | bitmap_fill(dstp->bits, nbits); | ||
164 | } | ||
165 | |||
166 | #define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS) | ||
167 | static inline void __cpus_clear(cpumask_t *dstp, int nbits) | ||
168 | { | ||
169 | bitmap_zero(dstp->bits, nbits); | ||
170 | } | ||
171 | |||
172 | /* No static inline type checking - see Subtlety (1) above. */ | ||
173 | #define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits) | ||
174 | |||
175 | #define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask)) | ||
176 | static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) | ||
177 | { | ||
178 | return test_and_set_bit(cpu, addr->bits); | ||
179 | } | ||
180 | |||
181 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) | ||
182 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | ||
183 | const cpumask_t *src2p, int nbits) | ||
184 | { | ||
185 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
186 | } | ||
187 | |||
188 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) | ||
189 | static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p, | ||
190 | const cpumask_t *src2p, int nbits) | ||
191 | { | ||
192 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
193 | } | ||
194 | |||
195 | #define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS) | ||
196 | static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | ||
197 | const cpumask_t *src2p, int nbits) | ||
198 | { | ||
199 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
200 | } | ||
201 | |||
202 | #define cpus_andnot(dst, src1, src2) \ | ||
203 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) | ||
204 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | ||
205 | const cpumask_t *src2p, int nbits) | ||
206 | { | ||
207 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
208 | } | ||
209 | |||
210 | #define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS) | ||
211 | static inline void __cpus_complement(cpumask_t *dstp, | ||
212 | const cpumask_t *srcp, int nbits) | ||
213 | { | ||
214 | bitmap_complement(dstp->bits, srcp->bits, nbits); | ||
215 | } | ||
216 | |||
217 | #define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS) | ||
218 | static inline int __cpus_equal(const cpumask_t *src1p, | ||
219 | const cpumask_t *src2p, int nbits) | ||
220 | { | ||
221 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | ||
222 | } | ||
223 | |||
224 | #define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS) | ||
225 | static inline int __cpus_intersects(const cpumask_t *src1p, | ||
226 | const cpumask_t *src2p, int nbits) | ||
227 | { | ||
228 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | ||
229 | } | ||
230 | |||
231 | #define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS) | ||
232 | static inline int __cpus_subset(const cpumask_t *src1p, | ||
233 | const cpumask_t *src2p, int nbits) | ||
234 | { | ||
235 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | ||
236 | } | ||
237 | |||
238 | #define cpus_empty(src) __cpus_empty(&(src), NR_CPUS) | ||
239 | static inline int __cpus_empty(const cpumask_t *srcp, int nbits) | ||
240 | { | ||
241 | return bitmap_empty(srcp->bits, nbits); | ||
242 | } | ||
243 | |||
244 | #define cpus_full(cpumask) __cpus_full(&(cpumask), NR_CPUS) | ||
245 | static inline int __cpus_full(const cpumask_t *srcp, int nbits) | ||
246 | { | ||
247 | return bitmap_full(srcp->bits, nbits); | ||
248 | } | ||
249 | |||
250 | #define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS) | ||
251 | static inline int __cpus_weight(const cpumask_t *srcp, int nbits) | ||
252 | { | ||
253 | return bitmap_weight(srcp->bits, nbits); | ||
254 | } | ||
255 | |||
256 | #define cpus_shift_right(dst, src, n) \ | ||
257 | __cpus_shift_right(&(dst), &(src), (n), NR_CPUS) | ||
258 | static inline void __cpus_shift_right(cpumask_t *dstp, | ||
259 | const cpumask_t *srcp, int n, int nbits) | ||
260 | { | ||
261 | bitmap_shift_right(dstp->bits, srcp->bits, n, nbits); | ||
262 | } | ||
263 | |||
264 | #define cpus_shift_left(dst, src, n) \ | ||
265 | __cpus_shift_left(&(dst), &(src), (n), NR_CPUS) | ||
266 | static inline void __cpus_shift_left(cpumask_t *dstp, | ||
267 | const cpumask_t *srcp, int n, int nbits) | ||
268 | { | ||
269 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | ||
270 | } | ||
271 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
272 | 14 | ||
273 | /** | 15 | /** |
274 | * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * | 16 | * cpumask_bits - get the bits in a cpumask |
275 | * @bitmap: the bitmap | 17 | * @maskp: the struct cpumask * |
276 | * | ||
277 | * There are a few places where cpumask_var_t isn't appropriate and | ||
278 | * static cpumasks must be used (eg. very early boot), yet we don't | ||
279 | * expose the definition of 'struct cpumask'. | ||
280 | * | 18 | * |
281 | * This does the conversion, and can be used as a constant initializer. | 19 | * You should only assume nr_cpu_ids bits of this mask are valid. This is |
20 | * a macro so it's const-correct. | ||
282 | */ | 21 | */ |
283 | #define to_cpumask(bitmap) \ | 22 | #define cpumask_bits(maskp) ((maskp)->bits) |
284 | ((struct cpumask *)(1 ? (bitmap) \ | ||
285 | : (void *)sizeof(__check_is_bitmap(bitmap)))) | ||
286 | |||
287 | static inline int __check_is_bitmap(const unsigned long *bitmap) | ||
288 | { | ||
289 | return 1; | ||
290 | } | ||
291 | |||
292 | /* | ||
293 | * Special-case data structure for "single bit set only" constant CPU masks. | ||
294 | * | ||
295 | * We pre-generate all the 64 (or 32) possible bit positions, with enough | ||
296 | * padding to the left and the right, and return the constant pointer | ||
297 | * appropriately offset. | ||
298 | */ | ||
299 | extern const unsigned long | ||
300 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; | ||
301 | |||
302 | static inline const struct cpumask *get_cpu_mask(unsigned int cpu) | ||
303 | { | ||
304 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; | ||
305 | p -= cpu / BITS_PER_LONG; | ||
306 | return to_cpumask(p); | ||
307 | } | ||
308 | |||
309 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
310 | /* | ||
311 | * In cases where we take the address of the cpumask immediately, | ||
312 | * gcc optimizes it out (it's a constant) and there's no huge stack | ||
313 | * variable created: | ||
314 | */ | ||
315 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) | ||
316 | |||
317 | |||
318 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | ||
319 | |||
320 | #if NR_CPUS <= BITS_PER_LONG | ||
321 | |||
322 | #define CPU_MASK_ALL \ | ||
323 | (cpumask_t) { { \ | ||
324 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
325 | } } | ||
326 | |||
327 | #define CPU_MASK_ALL_PTR (&CPU_MASK_ALL) | ||
328 | |||
329 | #else | ||
330 | |||
331 | #define CPU_MASK_ALL \ | ||
332 | (cpumask_t) { { \ | ||
333 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
334 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
335 | } } | ||
336 | |||
337 | /* cpu_mask_all is in init/main.c */ | ||
338 | extern cpumask_t cpu_mask_all; | ||
339 | #define CPU_MASK_ALL_PTR (&cpu_mask_all) | ||
340 | |||
341 | #endif | ||
342 | |||
343 | #define CPU_MASK_NONE \ | ||
344 | (cpumask_t) { { \ | ||
345 | [0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \ | ||
346 | } } | ||
347 | |||
348 | #define CPU_MASK_CPU0 \ | ||
349 | (cpumask_t) { { \ | ||
350 | [0] = 1UL \ | ||
351 | } } | ||
352 | |||
353 | #define cpus_addr(src) ((src).bits) | ||
354 | |||
355 | #if NR_CPUS > BITS_PER_LONG | ||
356 | #define CPUMASK_ALLOC(m) struct m *m = kmalloc(sizeof(*m), GFP_KERNEL) | ||
357 | #define CPUMASK_FREE(m) kfree(m) | ||
358 | #else | ||
359 | #define CPUMASK_ALLOC(m) struct m _m, *m = &_m | ||
360 | #define CPUMASK_FREE(m) | ||
361 | #endif | ||
362 | #define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v) | ||
363 | |||
364 | #define cpu_remap(oldbit, old, new) \ | ||
365 | __cpu_remap((oldbit), &(old), &(new), NR_CPUS) | ||
366 | static inline int __cpu_remap(int oldbit, | ||
367 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | ||
368 | { | ||
369 | return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits); | ||
370 | } | ||
371 | |||
372 | #define cpus_remap(dst, src, old, new) \ | ||
373 | __cpus_remap(&(dst), &(src), &(old), &(new), NR_CPUS) | ||
374 | static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, | ||
375 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | ||
376 | { | ||
377 | bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits); | ||
378 | } | ||
379 | |||
380 | #define cpus_onto(dst, orig, relmap) \ | ||
381 | __cpus_onto(&(dst), &(orig), &(relmap), NR_CPUS) | ||
382 | static inline void __cpus_onto(cpumask_t *dstp, const cpumask_t *origp, | ||
383 | const cpumask_t *relmapp, int nbits) | ||
384 | { | ||
385 | bitmap_onto(dstp->bits, origp->bits, relmapp->bits, nbits); | ||
386 | } | ||
387 | |||
388 | #define cpus_fold(dst, orig, sz) \ | ||
389 | __cpus_fold(&(dst), &(orig), sz, NR_CPUS) | ||
390 | static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp, | ||
391 | int sz, int nbits) | ||
392 | { | ||
393 | bitmap_fold(dstp->bits, origp->bits, sz, nbits); | ||
394 | } | ||
395 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
396 | 23 | ||
397 | #if NR_CPUS == 1 | 24 | #if NR_CPUS == 1 |
398 | |||
399 | #define nr_cpu_ids 1 | 25 | #define nr_cpu_ids 1 |
400 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | 26 | #else |
401 | #define first_cpu(src) ({ (void)(src); 0; }) | ||
402 | #define next_cpu(n, src) ({ (void)(src); 1; }) | ||
403 | #define any_online_cpu(mask) 0 | ||
404 | #define for_each_cpu_mask(cpu, mask) \ | ||
405 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
406 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
407 | #else /* NR_CPUS > 1 */ | ||
408 | |||
409 | extern int nr_cpu_ids; | 27 | extern int nr_cpu_ids; |
410 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
411 | int __first_cpu(const cpumask_t *srcp); | ||
412 | int __next_cpu(int n, const cpumask_t *srcp); | ||
413 | int __any_online_cpu(const cpumask_t *mask); | ||
414 | |||
415 | #define first_cpu(src) __first_cpu(&(src)) | ||
416 | #define next_cpu(n, src) __next_cpu((n), &(src)) | ||
417 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | ||
418 | #define for_each_cpu_mask(cpu, mask) \ | ||
419 | for ((cpu) = -1; \ | ||
420 | (cpu) = next_cpu((cpu), (mask)), \ | ||
421 | (cpu) < NR_CPUS; ) | ||
422 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
423 | #endif | 28 | #endif |
424 | 29 | ||
425 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | 30 | #ifdef CONFIG_CPUMASK_OFFSTACK |
426 | #if NR_CPUS <= 64 | 31 | /* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, |
427 | 32 | * not all bits may be allocated. */ | |
428 | #define next_cpu_nr(n, src) next_cpu(n, src) | 33 | #define nr_cpumask_bits nr_cpu_ids |
429 | #define cpus_weight_nr(cpumask) cpus_weight(cpumask) | 34 | #else |
430 | #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) | 35 | #define nr_cpumask_bits NR_CPUS |
431 | 36 | #endif | |
432 | #else /* NR_CPUS > 64 */ | ||
433 | |||
434 | int __next_cpu_nr(int n, const cpumask_t *srcp); | ||
435 | #define next_cpu_nr(n, src) __next_cpu_nr((n), &(src)) | ||
436 | #define cpus_weight_nr(cpumask) __cpus_weight(&(cpumask), nr_cpu_ids) | ||
437 | #define for_each_cpu_mask_nr(cpu, mask) \ | ||
438 | for ((cpu) = -1; \ | ||
439 | (cpu) = next_cpu_nr((cpu), (mask)), \ | ||
440 | (cpu) < nr_cpu_ids; ) | ||
441 | |||
442 | #endif /* NR_CPUS > 64 */ | ||
443 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
444 | 37 | ||
445 | /* | 38 | /* |
446 | * The following particular system cpumasks and operations manage | 39 | * The following particular system cpumasks and operations manage |
@@ -487,12 +80,6 @@ extern const struct cpumask *const cpu_online_mask; | |||
487 | extern const struct cpumask *const cpu_present_mask; | 80 | extern const struct cpumask *const cpu_present_mask; |
488 | extern const struct cpumask *const cpu_active_mask; | 81 | extern const struct cpumask *const cpu_active_mask; |
489 | 82 | ||
490 | /* These strip const, as traditionally they weren't const. */ | ||
491 | #define cpu_possible_map (*(cpumask_t *)cpu_possible_mask) | ||
492 | #define cpu_online_map (*(cpumask_t *)cpu_online_mask) | ||
493 | #define cpu_present_map (*(cpumask_t *)cpu_present_mask) | ||
494 | #define cpu_active_map (*(cpumask_t *)cpu_active_mask) | ||
495 | |||
496 | #if NR_CPUS > 1 | 83 | #if NR_CPUS > 1 |
497 | #define num_online_cpus() cpumask_weight(cpu_online_mask) | 84 | #define num_online_cpus() cpumask_weight(cpu_online_mask) |
498 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) | 85 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) |
@@ -511,35 +98,6 @@ extern const struct cpumask *const cpu_active_mask; | |||
511 | #define cpu_active(cpu) ((cpu) == 0) | 98 | #define cpu_active(cpu) ((cpu) == 0) |
512 | #endif | 99 | #endif |
513 | 100 | ||
514 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | ||
515 | |||
516 | /* These are the new versions of the cpumask operators: passed by pointer. | ||
517 | * The older versions will be implemented in terms of these, then deleted. */ | ||
518 | #define cpumask_bits(maskp) ((maskp)->bits) | ||
519 | |||
520 | #if NR_CPUS <= BITS_PER_LONG | ||
521 | #define CPU_BITS_ALL \ | ||
522 | { \ | ||
523 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
524 | } | ||
525 | |||
526 | #else /* NR_CPUS > BITS_PER_LONG */ | ||
527 | |||
528 | #define CPU_BITS_ALL \ | ||
529 | { \ | ||
530 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
531 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
532 | } | ||
533 | #endif /* NR_CPUS > BITS_PER_LONG */ | ||
534 | |||
535 | #ifdef CONFIG_CPUMASK_OFFSTACK | ||
536 | /* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, | ||
537 | * not all bits may be allocated. */ | ||
538 | #define nr_cpumask_bits nr_cpu_ids | ||
539 | #else | ||
540 | #define nr_cpumask_bits NR_CPUS | ||
541 | #endif | ||
542 | |||
543 | /* verify cpu argument to cpumask_* operators */ | 101 | /* verify cpu argument to cpumask_* operators */ |
544 | static inline unsigned int cpumask_check(unsigned int cpu) | 102 | static inline unsigned int cpumask_check(unsigned int cpu) |
545 | { | 103 | { |
@@ -715,6 +273,18 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) | |||
715 | } | 273 | } |
716 | 274 | ||
717 | /** | 275 | /** |
276 | * cpumask_test_and_clear_cpu - atomically test and clear a cpu in a cpumask | ||
277 | * @cpu: cpu number (< nr_cpu_ids) | ||
278 | * @cpumask: the cpumask pointer | ||
279 | * | ||
280 | * test_and_clear_bit wrapper for cpumasks. | ||
281 | */ | ||
282 | static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask) | ||
283 | { | ||
284 | return test_and_clear_bit(cpumask_check(cpu), cpumask_bits(cpumask)); | ||
285 | } | ||
286 | |||
287 | /** | ||
718 | * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask | 288 | * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask |
719 | * @dstp: the cpumask pointer | 289 | * @dstp: the cpumask pointer |
720 | */ | 290 | */ |
@@ -1088,4 +658,241 @@ void set_cpu_active(unsigned int cpu, bool active); | |||
1088 | void init_cpu_present(const struct cpumask *src); | 658 | void init_cpu_present(const struct cpumask *src); |
1089 | void init_cpu_possible(const struct cpumask *src); | 659 | void init_cpu_possible(const struct cpumask *src); |
1090 | void init_cpu_online(const struct cpumask *src); | 660 | void init_cpu_online(const struct cpumask *src); |
661 | |||
662 | /** | ||
663 | * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * | ||
664 | * @bitmap: the bitmap | ||
665 | * | ||
666 | * There are a few places where cpumask_var_t isn't appropriate and | ||
667 | * static cpumasks must be used (eg. very early boot), yet we don't | ||
668 | * expose the definition of 'struct cpumask'. | ||
669 | * | ||
670 | * This does the conversion, and can be used as a constant initializer. | ||
671 | */ | ||
672 | #define to_cpumask(bitmap) \ | ||
673 | ((struct cpumask *)(1 ? (bitmap) \ | ||
674 | : (void *)sizeof(__check_is_bitmap(bitmap)))) | ||
675 | |||
676 | static inline int __check_is_bitmap(const unsigned long *bitmap) | ||
677 | { | ||
678 | return 1; | ||
679 | } | ||
680 | |||
681 | /* | ||
682 | * Special-case data structure for "single bit set only" constant CPU masks. | ||
683 | * | ||
684 | * We pre-generate all the 64 (or 32) possible bit positions, with enough | ||
685 | * padding to the left and the right, and return the constant pointer | ||
686 | * appropriately offset. | ||
687 | */ | ||
688 | extern const unsigned long | ||
689 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; | ||
690 | |||
691 | static inline const struct cpumask *get_cpu_mask(unsigned int cpu) | ||
692 | { | ||
693 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; | ||
694 | p -= cpu / BITS_PER_LONG; | ||
695 | return to_cpumask(p); | ||
696 | } | ||
697 | |||
698 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | ||
699 | |||
700 | #if NR_CPUS <= BITS_PER_LONG | ||
701 | #define CPU_BITS_ALL \ | ||
702 | { \ | ||
703 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
704 | } | ||
705 | |||
706 | #else /* NR_CPUS > BITS_PER_LONG */ | ||
707 | |||
708 | #define CPU_BITS_ALL \ | ||
709 | { \ | ||
710 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
711 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
712 | } | ||
713 | #endif /* NR_CPUS > BITS_PER_LONG */ | ||
714 | |||
715 | /* | ||
716 | * | ||
717 | * From here down, all obsolete. Use cpumask_ variants! | ||
718 | * | ||
719 | */ | ||
720 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
721 | /* These strip const, as traditionally they weren't const. */ | ||
722 | #define cpu_possible_map (*(cpumask_t *)cpu_possible_mask) | ||
723 | #define cpu_online_map (*(cpumask_t *)cpu_online_mask) | ||
724 | #define cpu_present_map (*(cpumask_t *)cpu_present_mask) | ||
725 | #define cpu_active_map (*(cpumask_t *)cpu_active_mask) | ||
726 | |||
727 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) | ||
728 | |||
729 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | ||
730 | |||
731 | #if NR_CPUS <= BITS_PER_LONG | ||
732 | |||
733 | #define CPU_MASK_ALL \ | ||
734 | (cpumask_t) { { \ | ||
735 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
736 | } } | ||
737 | |||
738 | #else | ||
739 | |||
740 | #define CPU_MASK_ALL \ | ||
741 | (cpumask_t) { { \ | ||
742 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
743 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
744 | } } | ||
745 | |||
746 | #endif | ||
747 | |||
748 | #define CPU_MASK_NONE \ | ||
749 | (cpumask_t) { { \ | ||
750 | [0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \ | ||
751 | } } | ||
752 | |||
753 | #define CPU_MASK_CPU0 \ | ||
754 | (cpumask_t) { { \ | ||
755 | [0] = 1UL \ | ||
756 | } } | ||
757 | |||
758 | #if NR_CPUS == 1 | ||
759 | #define first_cpu(src) ({ (void)(src); 0; }) | ||
760 | #define next_cpu(n, src) ({ (void)(src); 1; }) | ||
761 | #define any_online_cpu(mask) 0 | ||
762 | #define for_each_cpu_mask(cpu, mask) \ | ||
763 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
764 | #else /* NR_CPUS > 1 */ | ||
765 | int __first_cpu(const cpumask_t *srcp); | ||
766 | int __next_cpu(int n, const cpumask_t *srcp); | ||
767 | int __any_online_cpu(const cpumask_t *mask); | ||
768 | |||
769 | #define first_cpu(src) __first_cpu(&(src)) | ||
770 | #define next_cpu(n, src) __next_cpu((n), &(src)) | ||
771 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | ||
772 | #define for_each_cpu_mask(cpu, mask) \ | ||
773 | for ((cpu) = -1; \ | ||
774 | (cpu) = next_cpu((cpu), (mask)), \ | ||
775 | (cpu) < NR_CPUS; ) | ||
776 | #endif /* SMP */ | ||
777 | |||
778 | #if NR_CPUS <= 64 | ||
779 | |||
780 | #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) | ||
781 | |||
782 | #else /* NR_CPUS > 64 */ | ||
783 | |||
784 | int __next_cpu_nr(int n, const cpumask_t *srcp); | ||
785 | #define for_each_cpu_mask_nr(cpu, mask) \ | ||
786 | for ((cpu) = -1; \ | ||
787 | (cpu) = __next_cpu_nr((cpu), &(mask)), \ | ||
788 | (cpu) < nr_cpu_ids; ) | ||
789 | |||
790 | #endif /* NR_CPUS > 64 */ | ||
791 | |||
792 | #define cpus_addr(src) ((src).bits) | ||
793 | |||
794 | #define cpu_set(cpu, dst) __cpu_set((cpu), &(dst)) | ||
795 | static inline void __cpu_set(int cpu, volatile cpumask_t *dstp) | ||
796 | { | ||
797 | set_bit(cpu, dstp->bits); | ||
798 | } | ||
799 | |||
800 | #define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst)) | ||
801 | static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp) | ||
802 | { | ||
803 | clear_bit(cpu, dstp->bits); | ||
804 | } | ||
805 | |||
806 | #define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS) | ||
807 | static inline void __cpus_setall(cpumask_t *dstp, int nbits) | ||
808 | { | ||
809 | bitmap_fill(dstp->bits, nbits); | ||
810 | } | ||
811 | |||
812 | #define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS) | ||
813 | static inline void __cpus_clear(cpumask_t *dstp, int nbits) | ||
814 | { | ||
815 | bitmap_zero(dstp->bits, nbits); | ||
816 | } | ||
817 | |||
818 | /* No static inline type checking - see Subtlety (1) above. */ | ||
819 | #define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits) | ||
820 | |||
821 | #define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask)) | ||
822 | static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) | ||
823 | { | ||
824 | return test_and_set_bit(cpu, addr->bits); | ||
825 | } | ||
826 | |||
827 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) | ||
828 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | ||
829 | const cpumask_t *src2p, int nbits) | ||
830 | { | ||
831 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
832 | } | ||
833 | |||
834 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) | ||
835 | static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p, | ||
836 | const cpumask_t *src2p, int nbits) | ||
837 | { | ||
838 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
839 | } | ||
840 | |||
841 | #define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS) | ||
842 | static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | ||
843 | const cpumask_t *src2p, int nbits) | ||
844 | { | ||
845 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
846 | } | ||
847 | |||
848 | #define cpus_andnot(dst, src1, src2) \ | ||
849 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) | ||
850 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | ||
851 | const cpumask_t *src2p, int nbits) | ||
852 | { | ||
853 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
854 | } | ||
855 | |||
856 | #define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS) | ||
857 | static inline int __cpus_equal(const cpumask_t *src1p, | ||
858 | const cpumask_t *src2p, int nbits) | ||
859 | { | ||
860 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | ||
861 | } | ||
862 | |||
863 | #define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS) | ||
864 | static inline int __cpus_intersects(const cpumask_t *src1p, | ||
865 | const cpumask_t *src2p, int nbits) | ||
866 | { | ||
867 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | ||
868 | } | ||
869 | |||
870 | #define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS) | ||
871 | static inline int __cpus_subset(const cpumask_t *src1p, | ||
872 | const cpumask_t *src2p, int nbits) | ||
873 | { | ||
874 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | ||
875 | } | ||
876 | |||
877 | #define cpus_empty(src) __cpus_empty(&(src), NR_CPUS) | ||
878 | static inline int __cpus_empty(const cpumask_t *srcp, int nbits) | ||
879 | { | ||
880 | return bitmap_empty(srcp->bits, nbits); | ||
881 | } | ||
882 | |||
883 | #define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS) | ||
884 | static inline int __cpus_weight(const cpumask_t *srcp, int nbits) | ||
885 | { | ||
886 | return bitmap_weight(srcp->bits, nbits); | ||
887 | } | ||
888 | |||
889 | #define cpus_shift_left(dst, src, n) \ | ||
890 | __cpus_shift_left(&(dst), &(src), (n), NR_CPUS) | ||
891 | static inline void __cpus_shift_left(cpumask_t *dstp, | ||
892 | const cpumask_t *srcp, int n, int nbits) | ||
893 | { | ||
894 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | ||
895 | } | ||
896 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
897 | |||
1091 | #endif /* __LINUX_CPUMASK_H */ | 898 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/cred.h b/include/linux/cred.h index fb371601a3b4..4e3387a89cb9 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -176,23 +176,7 @@ extern void __invalid_creds(const struct cred *, const char *, unsigned); | |||
176 | extern void __validate_process_creds(struct task_struct *, | 176 | extern void __validate_process_creds(struct task_struct *, |
177 | const char *, unsigned); | 177 | const char *, unsigned); |
178 | 178 | ||
179 | static inline bool creds_are_invalid(const struct cred *cred) | 179 | extern bool creds_are_invalid(const struct cred *cred); |
180 | { | ||
181 | if (cred->magic != CRED_MAGIC) | ||
182 | return true; | ||
183 | if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers)) | ||
184 | return true; | ||
185 | #ifdef CONFIG_SECURITY_SELINUX | ||
186 | if (selinux_is_enabled()) { | ||
187 | if ((unsigned long) cred->security < PAGE_SIZE) | ||
188 | return true; | ||
189 | if ((*(u32 *)cred->security & 0xffffff00) == | ||
190 | (POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8)) | ||
191 | return true; | ||
192 | } | ||
193 | #endif | ||
194 | return false; | ||
195 | } | ||
196 | 180 | ||
197 | static inline void __validate_creds(const struct cred *cred, | 181 | static inline void __validate_creds(const struct cred *cred, |
198 | const char *file, unsigned line) | 182 | const char *file, unsigned line) |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index eb5c2ba2f81a..fc1b930f246c 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * 2 as published by the Free Software Foundation. | 9 | * 2 as published by the Free Software Foundation. |
10 | * | 10 | * |
11 | * debugfs is for people to use instead of /proc or /sys. | 11 | * debugfs is for people to use instead of /proc or /sys. |
12 | * See Documentation/DocBook/kernel-api for more details. | 12 | * See Documentation/DocBook/filesystems for more details. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifndef _DEBUGFS_H_ | 15 | #ifndef _DEBUGFS_H_ |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 3b85ba6479f4..94dd10366a78 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #ifdef CONFIG_EVENTFD | 28 | #ifdef CONFIG_EVENTFD |
29 | 29 | ||
30 | struct file *eventfd_file_create(unsigned int count, int flags); | ||
30 | struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx); | 31 | struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx); |
31 | void eventfd_ctx_put(struct eventfd_ctx *ctx); | 32 | void eventfd_ctx_put(struct eventfd_ctx *ctx); |
32 | struct file *eventfd_fget(int fd); | 33 | struct file *eventfd_fget(int fd); |
@@ -40,6 +41,11 @@ int eventfd_signal(struct eventfd_ctx *ctx, int n); | |||
40 | * Ugly ugly ugly error layer to support modules that uses eventfd but | 41 | * Ugly ugly ugly error layer to support modules that uses eventfd but |
41 | * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO. | 42 | * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO. |
42 | */ | 43 | */ |
44 | static inline struct file *eventfd_file_create(unsigned int count, int flags) | ||
45 | { | ||
46 | return ERR_PTR(-ENOSYS); | ||
47 | } | ||
48 | |||
43 | static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) | 49 | static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) |
44 | { | 50 | { |
45 | return ERR_PTR(-ENOSYS); | 51 | return ERR_PTR(-ENOSYS); |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 192d1e43c43c..7e1d4dec83e7 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -134,20 +134,6 @@ struct fw_card { | |||
134 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; | 134 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; |
135 | }; | 135 | }; |
136 | 136 | ||
137 | static inline struct fw_card *fw_card_get(struct fw_card *card) | ||
138 | { | ||
139 | kref_get(&card->kref); | ||
140 | |||
141 | return card; | ||
142 | } | ||
143 | |||
144 | void fw_card_release(struct kref *kref); | ||
145 | |||
146 | static inline void fw_card_put(struct fw_card *card) | ||
147 | { | ||
148 | kref_put(&card->kref, fw_card_release); | ||
149 | } | ||
150 | |||
151 | struct fw_attribute_group { | 137 | struct fw_attribute_group { |
152 | struct attribute_group *groups[2]; | 138 | struct attribute_group *groups[2]; |
153 | struct attribute_group group; | 139 | struct attribute_group group; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 51803528b095..78e95b8b66d4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -595,6 +595,7 @@ struct address_space_operations { | |||
595 | int (*launder_page) (struct page *); | 595 | int (*launder_page) (struct page *); |
596 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | 596 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, |
597 | unsigned long); | 597 | unsigned long); |
598 | int (*error_remove_page)(struct address_space *, struct page *); | ||
598 | }; | 599 | }; |
599 | 600 | ||
600 | /* | 601 | /* |
@@ -2467,7 +2468,7 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf, | |||
2467 | size_t len, loff_t *ppos); | 2468 | size_t len, loff_t *ppos); |
2468 | 2469 | ||
2469 | struct ctl_table; | 2470 | struct ctl_table; |
2470 | int proc_nr_files(struct ctl_table *table, int write, struct file *filp, | 2471 | int proc_nr_files(struct ctl_table *table, int write, |
2471 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2472 | void __user *buffer, size_t *lenp, loff_t *ppos); |
2472 | 2473 | ||
2473 | int __init get_filesystem_list(char *buf); | 2474 | int __init get_filesystem_list(char *buf); |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 3c0924a18daf..cd3d2abaf30a 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -19,7 +19,7 @@ | |||
19 | extern int ftrace_enabled; | 19 | extern int ftrace_enabled; |
20 | extern int | 20 | extern int |
21 | ftrace_enable_sysctl(struct ctl_table *table, int write, | 21 | ftrace_enable_sysctl(struct ctl_table *table, int write, |
22 | struct file *filp, void __user *buffer, size_t *lenp, | 22 | void __user *buffer, size_t *lenp, |
23 | loff_t *ppos); | 23 | loff_t *ppos); |
24 | 24 | ||
25 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | 25 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); |
@@ -94,7 +94,7 @@ static inline void ftrace_start(void) { } | |||
94 | extern int stack_tracer_enabled; | 94 | extern int stack_tracer_enabled; |
95 | int | 95 | int |
96 | stack_trace_sysctl(struct ctl_table *table, int write, | 96 | stack_trace_sysctl(struct ctl_table *table, int write, |
97 | struct file *file, void __user *buffer, size_t *lenp, | 97 | void __user *buffer, size_t *lenp, |
98 | loff_t *ppos); | 98 | loff_t *ppos); |
99 | #endif | 99 | #endif |
100 | 100 | ||
diff --git a/include/linux/futex.h b/include/linux/futex.h index 34956c8fdebf..8ec17997d94f 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -4,11 +4,6 @@ | |||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | 6 | ||
7 | struct inode; | ||
8 | struct mm_struct; | ||
9 | struct task_struct; | ||
10 | union ktime; | ||
11 | |||
12 | /* Second argument to futex syscall */ | 7 | /* Second argument to futex syscall */ |
13 | 8 | ||
14 | 9 | ||
@@ -129,6 +124,11 @@ struct robust_list_head { | |||
129 | #define FUTEX_BITSET_MATCH_ANY 0xffffffff | 124 | #define FUTEX_BITSET_MATCH_ANY 0xffffffff |
130 | 125 | ||
131 | #ifdef __KERNEL__ | 126 | #ifdef __KERNEL__ |
127 | struct inode; | ||
128 | struct mm_struct; | ||
129 | struct task_struct; | ||
130 | union ktime; | ||
131 | |||
132 | long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout, | 132 | long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout, |
133 | u32 __user *uaddr2, u32 val2, u32 val3); | 133 | u32 __user *uaddr2, u32 val2, u32 val3); |
134 | 134 | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index f53e9b868c26..557bdad320b6 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -220,7 +220,7 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
220 | ((1 << ZONES_SHIFT) - 1); | 220 | ((1 << ZONES_SHIFT) - 1); |
221 | 221 | ||
222 | if (__builtin_constant_p(bit)) | 222 | if (__builtin_constant_p(bit)) |
223 | BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | 223 | MAYBE_BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); |
224 | else { | 224 | else { |
225 | #ifdef CONFIG_DEBUG_VM | 225 | #ifdef CONFIG_DEBUG_VM |
226 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); | 226 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index e10c49a5b96e..059bd189d35d 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | 14 | ||
15 | struct device; | ||
16 | |||
15 | /* | 17 | /* |
16 | * Some platforms don't support the GPIO programming interface. | 18 | * Some platforms don't support the GPIO programming interface. |
17 | * | 19 | * |
@@ -89,6 +91,15 @@ static inline int gpio_export(unsigned gpio, bool direction_may_change) | |||
89 | return -EINVAL; | 91 | return -EINVAL; |
90 | } | 92 | } |
91 | 93 | ||
94 | static inline int gpio_export_link(struct device *dev, const char *name, | ||
95 | unsigned gpio) | ||
96 | { | ||
97 | /* GPIO can never have been exported */ | ||
98 | WARN_ON(1); | ||
99 | return -EINVAL; | ||
100 | } | ||
101 | |||
102 | |||
92 | static inline void gpio_unexport(unsigned gpio) | 103 | static inline void gpio_unexport(unsigned gpio) |
93 | { | 104 | { |
94 | /* GPIO can never have been exported */ | 105 | /* GPIO can never have been exported */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 176e7ee73eff..11ab19ac6b3d 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -20,9 +20,9 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
20 | } | 20 | } |
21 | 21 | ||
22 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 22 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); |
23 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 23 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
24 | int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 24 | int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
26 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 26 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
27 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, | 27 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, |
28 | struct page **, struct vm_area_struct **, | 28 | struct page **, struct vm_area_struct **, |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index c9087de5c6c6..e844a0b18695 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -28,17 +28,6 @@ | |||
28 | identify a legacy client. If you don't need them, just don't set them. */ | 28 | identify a legacy client. If you don't need them, just don't set them. */ |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * ---- Driver types ----------------------------------------------------- | ||
32 | */ | ||
33 | |||
34 | #define I2C_DRIVERID_MSP3400 1 | ||
35 | #define I2C_DRIVERID_TUNER 2 | ||
36 | #define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ | ||
37 | #define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ | ||
38 | #define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ | ||
39 | #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ | ||
40 | |||
41 | /* | ||
42 | * ---- Adapter types ---------------------------------------------------- | 31 | * ---- Adapter types ---------------------------------------------------- |
43 | */ | 32 | */ |
44 | 33 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index f4784c0fe975..57d41b0abce2 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -98,7 +98,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
98 | 98 | ||
99 | /** | 99 | /** |
100 | * struct i2c_driver - represent an I2C device driver | 100 | * struct i2c_driver - represent an I2C device driver |
101 | * @id: Unique driver ID (optional) | ||
102 | * @class: What kind of i2c device we instantiate (for detect) | 101 | * @class: What kind of i2c device we instantiate (for detect) |
103 | * @attach_adapter: Callback for bus addition (for legacy drivers) | 102 | * @attach_adapter: Callback for bus addition (for legacy drivers) |
104 | * @detach_adapter: Callback for bus removal (for legacy drivers) | 103 | * @detach_adapter: Callback for bus removal (for legacy drivers) |
@@ -135,7 +134,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
135 | * not allowed. | 134 | * not allowed. |
136 | */ | 135 | */ |
137 | struct i2c_driver { | 136 | struct i2c_driver { |
138 | int id; | ||
139 | unsigned int class; | 137 | unsigned int class; |
140 | 138 | ||
141 | /* Notifies the driver that a new bus has appeared or is about to be | 139 | /* Notifies the driver that a new bus has appeared or is about to be |
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h new file mode 100644 index 000000000000..fc5db826b48e --- /dev/null +++ b/include/linux/i2c/adp5588.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller | ||
3 | * | ||
4 | * Copyright 2009 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ADP5588_H | ||
10 | #define _ADP5588_H | ||
11 | |||
12 | #define DEV_ID 0x00 /* Device ID */ | ||
13 | #define CFG 0x01 /* Configuration Register1 */ | ||
14 | #define INT_STAT 0x02 /* Interrupt Status Register */ | ||
15 | #define KEY_LCK_EC_STAT 0x03 /* Key Lock and Event Counter Register */ | ||
16 | #define Key_EVENTA 0x04 /* Key Event Register A */ | ||
17 | #define Key_EVENTB 0x05 /* Key Event Register B */ | ||
18 | #define Key_EVENTC 0x06 /* Key Event Register C */ | ||
19 | #define Key_EVENTD 0x07 /* Key Event Register D */ | ||
20 | #define Key_EVENTE 0x08 /* Key Event Register E */ | ||
21 | #define Key_EVENTF 0x09 /* Key Event Register F */ | ||
22 | #define Key_EVENTG 0x0A /* Key Event Register G */ | ||
23 | #define Key_EVENTH 0x0B /* Key Event Register H */ | ||
24 | #define Key_EVENTI 0x0C /* Key Event Register I */ | ||
25 | #define Key_EVENTJ 0x0D /* Key Event Register J */ | ||
26 | #define KP_LCK_TMR 0x0E /* Keypad Lock1 to Lock2 Timer */ | ||
27 | #define UNLOCK1 0x0F /* Unlock Key1 */ | ||
28 | #define UNLOCK2 0x10 /* Unlock Key2 */ | ||
29 | #define GPIO_INT_STAT1 0x11 /* GPIO Interrupt Status */ | ||
30 | #define GPIO_INT_STAT2 0x12 /* GPIO Interrupt Status */ | ||
31 | #define GPIO_INT_STAT3 0x13 /* GPIO Interrupt Status */ | ||
32 | #define GPIO_DAT_STAT1 0x14 /* GPIO Data Status, Read twice to clear */ | ||
33 | #define GPIO_DAT_STAT2 0x15 /* GPIO Data Status, Read twice to clear */ | ||
34 | #define GPIO_DAT_STAT3 0x16 /* GPIO Data Status, Read twice to clear */ | ||
35 | #define GPIO_DAT_OUT1 0x17 /* GPIO DATA OUT */ | ||
36 | #define GPIO_DAT_OUT2 0x18 /* GPIO DATA OUT */ | ||
37 | #define GPIO_DAT_OUT3 0x19 /* GPIO DATA OUT */ | ||
38 | #define GPIO_INT_EN1 0x1A /* GPIO Interrupt Enable */ | ||
39 | #define GPIO_INT_EN2 0x1B /* GPIO Interrupt Enable */ | ||
40 | #define GPIO_INT_EN3 0x1C /* GPIO Interrupt Enable */ | ||
41 | #define KP_GPIO1 0x1D /* Keypad or GPIO Selection */ | ||
42 | #define KP_GPIO2 0x1E /* Keypad or GPIO Selection */ | ||
43 | #define KP_GPIO3 0x1F /* Keypad or GPIO Selection */ | ||
44 | #define GPI_EM1 0x20 /* GPI Event Mode 1 */ | ||
45 | #define GPI_EM2 0x21 /* GPI Event Mode 2 */ | ||
46 | #define GPI_EM3 0x22 /* GPI Event Mode 3 */ | ||
47 | #define GPIO_DIR1 0x23 /* GPIO Data Direction */ | ||
48 | #define GPIO_DIR2 0x24 /* GPIO Data Direction */ | ||
49 | #define GPIO_DIR3 0x25 /* GPIO Data Direction */ | ||
50 | #define GPIO_INT_LVL1 0x26 /* GPIO Edge/Level Detect */ | ||
51 | #define GPIO_INT_LVL2 0x27 /* GPIO Edge/Level Detect */ | ||
52 | #define GPIO_INT_LVL3 0x28 /* GPIO Edge/Level Detect */ | ||
53 | #define Debounce_DIS1 0x29 /* Debounce Disable */ | ||
54 | #define Debounce_DIS2 0x2A /* Debounce Disable */ | ||
55 | #define Debounce_DIS3 0x2B /* Debounce Disable */ | ||
56 | #define GPIO_PULL1 0x2C /* GPIO Pull Disable */ | ||
57 | #define GPIO_PULL2 0x2D /* GPIO Pull Disable */ | ||
58 | #define GPIO_PULL3 0x2E /* GPIO Pull Disable */ | ||
59 | #define CMP_CFG_STAT 0x30 /* Comparator Configuration and Status Register */ | ||
60 | #define CMP_CONFG_SENS1 0x31 /* Sensor1 Comparator Configuration Register */ | ||
61 | #define CMP_CONFG_SENS2 0x32 /* L2 Light Sensor Reference Level, Output Falling for Sensor 1 */ | ||
62 | #define CMP1_LVL2_TRIP 0x33 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 1 */ | ||
63 | #define CMP1_LVL2_HYS 0x34 /* L3 Light Sensor Reference Level, Output Falling For Sensor 1 */ | ||
64 | #define CMP1_LVL3_TRIP 0x35 /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 1 */ | ||
65 | #define CMP1_LVL3_HYS 0x36 /* Sensor 2 Comparator Configuration Register */ | ||
66 | #define CMP2_LVL2_TRIP 0x37 /* L2 Light Sensor Reference Level, Output Falling for Sensor 2 */ | ||
67 | #define CMP2_LVL2_HYS 0x38 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 2 */ | ||
68 | #define CMP2_LVL3_TRIP 0x39 /* L3 Light Sensor Reference Level, Output Falling For Sensor 2 */ | ||
69 | #define CMP2_LVL3_HYS 0x3A /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 2 */ | ||
70 | #define CMP1_ADC_DAT_R1 0x3B /* Comparator 1 ADC data Register1 */ | ||
71 | #define CMP1_ADC_DAT_R2 0x3C /* Comparator 1 ADC data Register2 */ | ||
72 | #define CMP2_ADC_DAT_R1 0x3D /* Comparator 2 ADC data Register1 */ | ||
73 | #define CMP2_ADC_DAT_R2 0x3E /* Comparator 2 ADC data Register2 */ | ||
74 | |||
75 | #define ADP5588_DEVICE_ID_MASK 0xF | ||
76 | |||
77 | /* Put one of these structures in i2c_board_info platform_data */ | ||
78 | |||
79 | #define ADP5588_KEYMAPSIZE 80 | ||
80 | |||
81 | struct adp5588_kpad_platform_data { | ||
82 | int rows; /* Number of rows */ | ||
83 | int cols; /* Number of columns */ | ||
84 | const unsigned short *keymap; /* Pointer to keymap */ | ||
85 | unsigned short keymapsize; /* Keymap size */ | ||
86 | unsigned repeat:1; /* Enable key repeat */ | ||
87 | unsigned en_keylock:1; /* Enable Key Lock feature */ | ||
88 | unsigned short unlock_key1; /* Unlock Key 1 */ | ||
89 | unsigned short unlock_key2; /* Unlock Key 2 */ | ||
90 | }; | ||
91 | |||
92 | #endif | ||
diff --git a/include/linux/i2c/mcs5000_ts.h b/include/linux/i2c/mcs5000_ts.h new file mode 100644 index 000000000000..5a117b5ca15e --- /dev/null +++ b/include/linux/i2c/mcs5000_ts.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * mcs5000_ts.h | ||
3 | * | ||
4 | * Copyright (C) 2009 Samsung Electronics Co.Ltd | ||
5 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __LINUX_MCS5000_TS_H | ||
15 | #define __LINUX_MCS5000_TS_H | ||
16 | |||
17 | /* platform data for the MELFAS MCS-5000 touchscreen driver */ | ||
18 | struct mcs5000_ts_platform_data { | ||
19 | void (*cfg_pin)(void); | ||
20 | int x_size; | ||
21 | int y_size; | ||
22 | }; | ||
23 | |||
24 | #endif /* __LINUX_MCS5000_TS_H */ | ||
diff --git a/include/linux/i8042.h b/include/linux/i8042.h index 7907a72403ee..60c3360ef6ad 100644 --- a/include/linux/i8042.h +++ b/include/linux/i8042.h | |||
@@ -7,6 +7,7 @@ | |||
7 | * the Free Software Foundation. | 7 | * the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/types.h> | ||
10 | 11 | ||
11 | /* | 12 | /* |
12 | * Standard commands. | 13 | * Standard commands. |
@@ -30,6 +31,35 @@ | |||
30 | #define I8042_CMD_MUX_PFX 0x0090 | 31 | #define I8042_CMD_MUX_PFX 0x0090 |
31 | #define I8042_CMD_MUX_SEND 0x1090 | 32 | #define I8042_CMD_MUX_SEND 0x1090 |
32 | 33 | ||
34 | struct serio; | ||
35 | |||
36 | #if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE) | ||
37 | |||
38 | void i8042_lock_chip(void); | ||
39 | void i8042_unlock_chip(void); | ||
33 | int i8042_command(unsigned char *param, int command); | 40 | int i8042_command(unsigned char *param, int command); |
41 | bool i8042_check_port_owner(const struct serio *); | ||
42 | |||
43 | #else | ||
44 | |||
45 | void i8042_lock_chip(void) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | void i8042_unlock_chip(void) | ||
50 | { | ||
51 | } | ||
52 | |||
53 | int i8042_command(unsigned char *param, int command) | ||
54 | { | ||
55 | return -ENOSYS; | ||
56 | } | ||
57 | |||
58 | bool i8042_check_port_owner(const struct serio *serio) | ||
59 | { | ||
60 | return false; | ||
61 | } | ||
62 | |||
63 | #endif | ||
34 | 64 | ||
35 | #endif | 65 | #endif |
diff --git a/include/linux/input.h b/include/linux/input.h index 8b3bc3e0d146..0ccfc30cd40f 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1123,7 +1123,7 @@ struct input_dev { | |||
1123 | struct mutex mutex; | 1123 | struct mutex mutex; |
1124 | 1124 | ||
1125 | unsigned int users; | 1125 | unsigned int users; |
1126 | int going_away; | 1126 | bool going_away; |
1127 | 1127 | ||
1128 | struct device dev; | 1128 | struct device dev; |
1129 | 1129 | ||
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 482dc91fd53a..4f0a72a9740c 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
@@ -360,4 +360,6 @@ extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, | |||
360 | 360 | ||
361 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | 361 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); |
362 | 362 | ||
363 | extern int dmar_ir_support(void); | ||
364 | |||
363 | #endif | 365 | #endif |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 8e9e151f811e..b78cf8194957 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -84,7 +84,6 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
84 | * struct irqaction - per interrupt action descriptor | 84 | * struct irqaction - per interrupt action descriptor |
85 | * @handler: interrupt handler function | 85 | * @handler: interrupt handler function |
86 | * @flags: flags (see IRQF_* above) | 86 | * @flags: flags (see IRQF_* above) |
87 | * @mask: no comment as it is useless and about to be removed | ||
88 | * @name: name of the device | 87 | * @name: name of the device |
89 | * @dev_id: cookie to identify the device | 88 | * @dev_id: cookie to identify the device |
90 | * @next: pointer to the next irqaction for shared interrupts | 89 | * @next: pointer to the next irqaction for shared interrupts |
@@ -97,7 +96,6 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
97 | struct irqaction { | 96 | struct irqaction { |
98 | irq_handler_t handler; | 97 | irq_handler_t handler; |
99 | unsigned long flags; | 98 | unsigned long flags; |
100 | cpumask_t mask; | ||
101 | const char *name; | 99 | const char *name; |
102 | void *dev_id; | 100 | void *dev_id; |
103 | struct irqaction *next; | 101 | struct irqaction *next; |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 786e7b8cece9..83aa81297ea3 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -184,5 +184,9 @@ extern void __devm_release_region(struct device *dev, struct resource *parent, | |||
184 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | 184 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); |
185 | extern int iomem_is_exclusive(u64 addr); | 185 | extern int iomem_is_exclusive(u64 addr); |
186 | 186 | ||
187 | extern int | ||
188 | walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, | ||
189 | void *arg, int (*func)(unsigned long, unsigned long, void *)); | ||
190 | |||
187 | #endif /* __ASSEMBLY__ */ | 191 | #endif /* __ASSEMBLY__ */ |
188 | #endif /* _LINUX_IOPORT_H */ | 192 | #endif /* _LINUX_IOPORT_H */ |
diff --git a/include/linux/iova.h b/include/linux/iova.h index 228f6c94b69c..76a0759e88ec 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h | |||
@@ -28,7 +28,6 @@ struct iova { | |||
28 | 28 | ||
29 | /* holds all the iova translations for a domain */ | 29 | /* holds all the iova translations for a domain */ |
30 | struct iova_domain { | 30 | struct iova_domain { |
31 | spinlock_t iova_alloc_lock;/* Lock to protect iova allocation */ | ||
32 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ | 31 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ |
33 | struct rb_root rbroot; /* iova domain rbtree root */ | 32 | struct rb_root rbroot; /* iova domain rbtree root */ |
34 | struct rb_node *cached32_node; /* Save last alloced node */ | 33 | struct rb_node *cached32_node; /* Save last alloced node */ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index a1187a0c99b4..331530cd3cc6 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -556,7 +556,7 @@ struct transaction_s | |||
556 | * This transaction is being forced and some process is | 556 | * This transaction is being forced and some process is |
557 | * waiting for it to finish. | 557 | * waiting for it to finish. |
558 | */ | 558 | */ |
559 | int t_synchronous_commit:1; | 559 | unsigned int t_synchronous_commit:1; |
560 | }; | 560 | }; |
561 | 561 | ||
562 | /** | 562 | /** |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 2b5b1e0899a8..d3cd23f30039 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -146,7 +146,7 @@ extern int _cond_resched(void); | |||
146 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) | 146 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) |
147 | 147 | ||
148 | #define abs(x) ({ \ | 148 | #define abs(x) ({ \ |
149 | int __x = (x); \ | 149 | long __x = (x); \ |
150 | (__x < 0) ? -__x : __x; \ | 150 | (__x < 0) ? -__x : __x; \ |
151 | }) | 151 | }) |
152 | 152 | ||
@@ -246,14 +246,16 @@ extern int printk_ratelimit(void); | |||
246 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 246 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
247 | unsigned int interval_msec); | 247 | unsigned int interval_msec); |
248 | 248 | ||
249 | extern int printk_delay_msec; | ||
250 | |||
249 | /* | 251 | /* |
250 | * Print a one-time message (analogous to WARN_ONCE() et al): | 252 | * Print a one-time message (analogous to WARN_ONCE() et al): |
251 | */ | 253 | */ |
252 | #define printk_once(x...) ({ \ | 254 | #define printk_once(x...) ({ \ |
253 | static int __print_once = 1; \ | 255 | static bool __print_once = true; \ |
254 | \ | 256 | \ |
255 | if (__print_once) { \ | 257 | if (__print_once) { \ |
256 | __print_once = 0; \ | 258 | __print_once = false; \ |
257 | printk(x); \ | 259 | printk(x); \ |
258 | } \ | 260 | } \ |
259 | }) | 261 | }) |
@@ -676,13 +678,17 @@ struct sysinfo { | |||
676 | }; | 678 | }; |
677 | 679 | ||
678 | /* Force a compilation error if condition is true */ | 680 | /* Force a compilation error if condition is true */ |
679 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 681 | #define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition)) |
682 | |||
683 | /* Force a compilation error if condition is constant and true */ | ||
684 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) | ||
680 | 685 | ||
681 | /* Force a compilation error if condition is true, but also produce a | 686 | /* Force a compilation error if condition is true, but also produce a |
682 | result (of value 0 and type size_t), so the expression can be used | 687 | result (of value 0 and type size_t), so the expression can be used |
683 | e.g. in a structure initializer (or where-ever else comma expressions | 688 | e.g. in a structure initializer (or where-ever else comma expressions |
684 | aren't permitted). */ | 689 | aren't permitted). */ |
685 | #define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) | 690 | #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) |
691 | #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) | ||
686 | 692 | ||
687 | /* Trap pasters of __FUNCTION__ at compile-time */ | 693 | /* Trap pasters of __FUNCTION__ at compile-time */ |
688 | #define __FUNCTION__ (__func__) | 694 | #define __FUNCTION__ (__func__) |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index c8006607f947..e880d4cf9e22 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
@@ -145,12 +145,14 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | |||
145 | 145 | ||
146 | #define kmemcheck_annotate_bitfield(ptr, name) \ | 146 | #define kmemcheck_annotate_bitfield(ptr, name) \ |
147 | do { \ | 147 | do { \ |
148 | int _n; \ | ||
149 | \ | ||
148 | if (!ptr) \ | 150 | if (!ptr) \ |
149 | break; \ | 151 | break; \ |
150 | \ | 152 | \ |
151 | int _n = (long) &((ptr)->name##_end) \ | 153 | _n = (long) &((ptr)->name##_end) \ |
152 | - (long) &((ptr)->name##_begin); \ | 154 | - (long) &((ptr)->name##_begin); \ |
153 | BUILD_BUG_ON(_n < 0); \ | 155 | MAYBE_BUILD_BUG_ON(_n < 0); \ |
154 | \ | 156 | \ |
155 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | 157 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ |
156 | } while (0) | 158 | } while (0) |
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index fcf5fbe6a50c..79603a6c356f 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
@@ -44,6 +44,8 @@ struct ps2dev { | |||
44 | void ps2_init(struct ps2dev *ps2dev, struct serio *serio); | 44 | void ps2_init(struct ps2dev *ps2dev, struct serio *serio); |
45 | int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); | 45 | int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); |
46 | void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout); | 46 | void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout); |
47 | void ps2_begin_command(struct ps2dev *ps2dev); | ||
48 | void ps2_end_command(struct ps2dev *ps2dev); | ||
47 | int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); | 49 | int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); |
48 | int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); | 50 | int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); |
49 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); | 51 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 691f59171c6c..5126cceb6ae9 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -57,6 +57,7 @@ | |||
57 | 57 | ||
58 | #ifdef __ASSEMBLY__ | 58 | #ifdef __ASSEMBLY__ |
59 | 59 | ||
60 | #ifndef LINKER_SCRIPT | ||
60 | #define ALIGN __ALIGN | 61 | #define ALIGN __ALIGN |
61 | #define ALIGN_STR __ALIGN_STR | 62 | #define ALIGN_STR __ALIGN_STR |
62 | 63 | ||
@@ -66,6 +67,7 @@ | |||
66 | ALIGN; \ | 67 | ALIGN; \ |
67 | name: | 68 | name: |
68 | #endif | 69 | #endif |
70 | #endif /* LINKER_SCRIPT */ | ||
69 | 71 | ||
70 | #ifndef WEAK | 72 | #ifndef WEAK |
71 | #define WEAK(name) \ | 73 | #define WEAK(name) \ |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 1923327b9869..76285e01b39e 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -12,7 +12,9 @@ | |||
12 | #define SYSFS_MAGIC 0x62656572 | 12 | #define SYSFS_MAGIC 0x62656572 |
13 | #define SECURITYFS_MAGIC 0x73636673 | 13 | #define SECURITYFS_MAGIC 0x73636673 |
14 | #define SELINUX_MAGIC 0xf97cff8c | 14 | #define SELINUX_MAGIC 0xf97cff8c |
15 | #define RAMFS_MAGIC 0x858458f6 /* some random number */ | ||
15 | #define TMPFS_MAGIC 0x01021994 | 16 | #define TMPFS_MAGIC 0x01021994 |
17 | #define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ | ||
16 | #define SQUASHFS_MAGIC 0x73717368 | 18 | #define SQUASHFS_MAGIC 0x73717368 |
17 | #define EFS_SUPER_MAGIC 0x414A53 | 19 | #define EFS_SUPER_MAGIC 0x414A53 |
18 | #define EXT2_SUPER_MAGIC 0xEF53 | 20 | #define EXT2_SUPER_MAGIC 0xEF53 |
@@ -53,4 +55,8 @@ | |||
53 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA | 55 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA |
54 | 56 | ||
55 | #define STACK_END_MAGIC 0x57AC6E9D | 57 | #define STACK_END_MAGIC 0x57AC6E9D |
58 | |||
59 | #define DEVPTS_SUPER_MAGIC 0x1cd1 | ||
60 | #define SOCKFS_MAGIC 0x534F434B | ||
61 | |||
56 | #endif /* __LINUX_MAGIC_H__ */ | 62 | #endif /* __LINUX_MAGIC_H__ */ |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e46a0734ab6e..bf9213b2db8f 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -118,6 +118,9 @@ static inline bool mem_cgroup_disabled(void) | |||
118 | 118 | ||
119 | extern bool mem_cgroup_oom_called(struct task_struct *task); | 119 | extern bool mem_cgroup_oom_called(struct task_struct *task); |
120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); | 120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); |
121 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | ||
122 | gfp_t gfp_mask, int nid, | ||
123 | int zid); | ||
121 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 124 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
122 | struct mem_cgroup; | 125 | struct mem_cgroup; |
123 | 126 | ||
@@ -276,6 +279,13 @@ static inline void mem_cgroup_update_mapped_file_stat(struct page *page, | |||
276 | { | 279 | { |
277 | } | 280 | } |
278 | 281 | ||
282 | static inline | ||
283 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | ||
284 | gfp_t gfp_mask, int nid, int zid) | ||
285 | { | ||
286 | return 0; | ||
287 | } | ||
288 | |||
279 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 289 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
280 | 290 | ||
281 | #endif /* _LINUX_MEMCONTROL_H */ | 291 | #endif /* _LINUX_MEMCONTROL_H */ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index d95f72e79b82..fed969281a41 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -191,14 +191,6 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | |||
191 | 191 | ||
192 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ | 192 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ |
193 | 193 | ||
194 | /* | ||
195 | * Walk through all memory which is registered as resource. | ||
196 | * arg is (start_pfn, nr_pages, private_arg_pointer) | ||
197 | */ | ||
198 | extern int walk_memory_resource(unsigned long start_pfn, | ||
199 | unsigned long nr_pages, void *arg, | ||
200 | int (*func)(unsigned long, unsigned long, void *)); | ||
201 | |||
202 | #ifdef CONFIG_MEMORY_HOTREMOVE | 194 | #ifdef CONFIG_MEMORY_HOTREMOVE |
203 | 195 | ||
204 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); | 196 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); |
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h index 115dbe965082..c63b65c94429 100644 --- a/include/linux/mfd/da903x.h +++ b/include/linux/mfd/da903x.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __LINUX_PMIC_DA903X_H | 1 | #ifndef __LINUX_PMIC_DA903X_H |
2 | #define __LINUX_PMIC_DA903X_H | 2 | #define __LINUX_PMIC_DA903X_H |
3 | 3 | ||
4 | /* Unified sub device IDs for DA9030/DA9034 */ | 4 | /* Unified sub device IDs for DA9030/DA9034/DA9035 */ |
5 | enum { | 5 | enum { |
6 | DA9030_ID_LED_1, | 6 | DA9030_ID_LED_1, |
7 | DA9030_ID_LED_2, | 7 | DA9030_ID_LED_2, |
@@ -57,6 +57,8 @@ enum { | |||
57 | DA9034_ID_LDO13, | 57 | DA9034_ID_LDO13, |
58 | DA9034_ID_LDO14, | 58 | DA9034_ID_LDO14, |
59 | DA9034_ID_LDO15, | 59 | DA9034_ID_LDO15, |
60 | |||
61 | DA9035_ID_BUCK3, | ||
60 | }; | 62 | }; |
61 | 63 | ||
62 | /* | 64 | /* |
diff --git a/include/linux/mfd/wm831x/pmu.h b/include/linux/mfd/wm831x/pmu.h new file mode 100644 index 000000000000..b18cbb027bc3 --- /dev/null +++ b/include/linux/mfd/wm831x/pmu.h | |||
@@ -0,0 +1,189 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/wm831x/pmu.h -- PMU for WM831x | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __MFD_WM831X_PMU_H__ | ||
16 | #define __MFD_WM831X_PMU_H__ | ||
17 | |||
18 | /* | ||
19 | * R16387 (0x4003) - Power State | ||
20 | */ | ||
21 | #define WM831X_CHIP_ON 0x8000 /* CHIP_ON */ | ||
22 | #define WM831X_CHIP_ON_MASK 0x8000 /* CHIP_ON */ | ||
23 | #define WM831X_CHIP_ON_SHIFT 15 /* CHIP_ON */ | ||
24 | #define WM831X_CHIP_ON_WIDTH 1 /* CHIP_ON */ | ||
25 | #define WM831X_CHIP_SLP 0x4000 /* CHIP_SLP */ | ||
26 | #define WM831X_CHIP_SLP_MASK 0x4000 /* CHIP_SLP */ | ||
27 | #define WM831X_CHIP_SLP_SHIFT 14 /* CHIP_SLP */ | ||
28 | #define WM831X_CHIP_SLP_WIDTH 1 /* CHIP_SLP */ | ||
29 | #define WM831X_REF_LP 0x1000 /* REF_LP */ | ||
30 | #define WM831X_REF_LP_MASK 0x1000 /* REF_LP */ | ||
31 | #define WM831X_REF_LP_SHIFT 12 /* REF_LP */ | ||
32 | #define WM831X_REF_LP_WIDTH 1 /* REF_LP */ | ||
33 | #define WM831X_PWRSTATE_DLY_MASK 0x0C00 /* PWRSTATE_DLY - [11:10] */ | ||
34 | #define WM831X_PWRSTATE_DLY_SHIFT 10 /* PWRSTATE_DLY - [11:10] */ | ||
35 | #define WM831X_PWRSTATE_DLY_WIDTH 2 /* PWRSTATE_DLY - [11:10] */ | ||
36 | #define WM831X_SWRST_DLY 0x0200 /* SWRST_DLY */ | ||
37 | #define WM831X_SWRST_DLY_MASK 0x0200 /* SWRST_DLY */ | ||
38 | #define WM831X_SWRST_DLY_SHIFT 9 /* SWRST_DLY */ | ||
39 | #define WM831X_SWRST_DLY_WIDTH 1 /* SWRST_DLY */ | ||
40 | #define WM831X_USB100MA_STARTUP_MASK 0x0030 /* USB100MA_STARTUP - [5:4] */ | ||
41 | #define WM831X_USB100MA_STARTUP_SHIFT 4 /* USB100MA_STARTUP - [5:4] */ | ||
42 | #define WM831X_USB100MA_STARTUP_WIDTH 2 /* USB100MA_STARTUP - [5:4] */ | ||
43 | #define WM831X_USB_CURR_STS 0x0008 /* USB_CURR_STS */ | ||
44 | #define WM831X_USB_CURR_STS_MASK 0x0008 /* USB_CURR_STS */ | ||
45 | #define WM831X_USB_CURR_STS_SHIFT 3 /* USB_CURR_STS */ | ||
46 | #define WM831X_USB_CURR_STS_WIDTH 1 /* USB_CURR_STS */ | ||
47 | #define WM831X_USB_ILIM_MASK 0x0007 /* USB_ILIM - [2:0] */ | ||
48 | #define WM831X_USB_ILIM_SHIFT 0 /* USB_ILIM - [2:0] */ | ||
49 | #define WM831X_USB_ILIM_WIDTH 3 /* USB_ILIM - [2:0] */ | ||
50 | |||
51 | /* | ||
52 | * R16397 (0x400D) - System Status | ||
53 | */ | ||
54 | #define WM831X_THW_STS 0x8000 /* THW_STS */ | ||
55 | #define WM831X_THW_STS_MASK 0x8000 /* THW_STS */ | ||
56 | #define WM831X_THW_STS_SHIFT 15 /* THW_STS */ | ||
57 | #define WM831X_THW_STS_WIDTH 1 /* THW_STS */ | ||
58 | #define WM831X_PWR_SRC_BATT 0x0400 /* PWR_SRC_BATT */ | ||
59 | #define WM831X_PWR_SRC_BATT_MASK 0x0400 /* PWR_SRC_BATT */ | ||
60 | #define WM831X_PWR_SRC_BATT_SHIFT 10 /* PWR_SRC_BATT */ | ||
61 | #define WM831X_PWR_SRC_BATT_WIDTH 1 /* PWR_SRC_BATT */ | ||
62 | #define WM831X_PWR_WALL 0x0200 /* PWR_WALL */ | ||
63 | #define WM831X_PWR_WALL_MASK 0x0200 /* PWR_WALL */ | ||
64 | #define WM831X_PWR_WALL_SHIFT 9 /* PWR_WALL */ | ||
65 | #define WM831X_PWR_WALL_WIDTH 1 /* PWR_WALL */ | ||
66 | #define WM831X_PWR_USB 0x0100 /* PWR_USB */ | ||
67 | #define WM831X_PWR_USB_MASK 0x0100 /* PWR_USB */ | ||
68 | #define WM831X_PWR_USB_SHIFT 8 /* PWR_USB */ | ||
69 | #define WM831X_PWR_USB_WIDTH 1 /* PWR_USB */ | ||
70 | #define WM831X_MAIN_STATE_MASK 0x001F /* MAIN_STATE - [4:0] */ | ||
71 | #define WM831X_MAIN_STATE_SHIFT 0 /* MAIN_STATE - [4:0] */ | ||
72 | #define WM831X_MAIN_STATE_WIDTH 5 /* MAIN_STATE - [4:0] */ | ||
73 | |||
74 | /* | ||
75 | * R16456 (0x4048) - Charger Control 1 | ||
76 | */ | ||
77 | #define WM831X_CHG_ENA 0x8000 /* CHG_ENA */ | ||
78 | #define WM831X_CHG_ENA_MASK 0x8000 /* CHG_ENA */ | ||
79 | #define WM831X_CHG_ENA_SHIFT 15 /* CHG_ENA */ | ||
80 | #define WM831X_CHG_ENA_WIDTH 1 /* CHG_ENA */ | ||
81 | #define WM831X_CHG_FRC 0x4000 /* CHG_FRC */ | ||
82 | #define WM831X_CHG_FRC_MASK 0x4000 /* CHG_FRC */ | ||
83 | #define WM831X_CHG_FRC_SHIFT 14 /* CHG_FRC */ | ||
84 | #define WM831X_CHG_FRC_WIDTH 1 /* CHG_FRC */ | ||
85 | #define WM831X_CHG_ITERM_MASK 0x1C00 /* CHG_ITERM - [12:10] */ | ||
86 | #define WM831X_CHG_ITERM_SHIFT 10 /* CHG_ITERM - [12:10] */ | ||
87 | #define WM831X_CHG_ITERM_WIDTH 3 /* CHG_ITERM - [12:10] */ | ||
88 | #define WM831X_CHG_FAST 0x0020 /* CHG_FAST */ | ||
89 | #define WM831X_CHG_FAST_MASK 0x0020 /* CHG_FAST */ | ||
90 | #define WM831X_CHG_FAST_SHIFT 5 /* CHG_FAST */ | ||
91 | #define WM831X_CHG_FAST_WIDTH 1 /* CHG_FAST */ | ||
92 | #define WM831X_CHG_IMON_ENA 0x0002 /* CHG_IMON_ENA */ | ||
93 | #define WM831X_CHG_IMON_ENA_MASK 0x0002 /* CHG_IMON_ENA */ | ||
94 | #define WM831X_CHG_IMON_ENA_SHIFT 1 /* CHG_IMON_ENA */ | ||
95 | #define WM831X_CHG_IMON_ENA_WIDTH 1 /* CHG_IMON_ENA */ | ||
96 | #define WM831X_CHG_CHIP_TEMP_MON 0x0001 /* CHG_CHIP_TEMP_MON */ | ||
97 | #define WM831X_CHG_CHIP_TEMP_MON_MASK 0x0001 /* CHG_CHIP_TEMP_MON */ | ||
98 | #define WM831X_CHG_CHIP_TEMP_MON_SHIFT 0 /* CHG_CHIP_TEMP_MON */ | ||
99 | #define WM831X_CHG_CHIP_TEMP_MON_WIDTH 1 /* CHG_CHIP_TEMP_MON */ | ||
100 | |||
101 | /* | ||
102 | * R16457 (0x4049) - Charger Control 2 | ||
103 | */ | ||
104 | #define WM831X_CHG_OFF_MSK 0x4000 /* CHG_OFF_MSK */ | ||
105 | #define WM831X_CHG_OFF_MSK_MASK 0x4000 /* CHG_OFF_MSK */ | ||
106 | #define WM831X_CHG_OFF_MSK_SHIFT 14 /* CHG_OFF_MSK */ | ||
107 | #define WM831X_CHG_OFF_MSK_WIDTH 1 /* CHG_OFF_MSK */ | ||
108 | #define WM831X_CHG_TIME_MASK 0x0F00 /* CHG_TIME - [11:8] */ | ||
109 | #define WM831X_CHG_TIME_SHIFT 8 /* CHG_TIME - [11:8] */ | ||
110 | #define WM831X_CHG_TIME_WIDTH 4 /* CHG_TIME - [11:8] */ | ||
111 | #define WM831X_CHG_TRKL_ILIM_MASK 0x00C0 /* CHG_TRKL_ILIM - [7:6] */ | ||
112 | #define WM831X_CHG_TRKL_ILIM_SHIFT 6 /* CHG_TRKL_ILIM - [7:6] */ | ||
113 | #define WM831X_CHG_TRKL_ILIM_WIDTH 2 /* CHG_TRKL_ILIM - [7:6] */ | ||
114 | #define WM831X_CHG_VSEL_MASK 0x0030 /* CHG_VSEL - [5:4] */ | ||
115 | #define WM831X_CHG_VSEL_SHIFT 4 /* CHG_VSEL - [5:4] */ | ||
116 | #define WM831X_CHG_VSEL_WIDTH 2 /* CHG_VSEL - [5:4] */ | ||
117 | #define WM831X_CHG_FAST_ILIM_MASK 0x000F /* CHG_FAST_ILIM - [3:0] */ | ||
118 | #define WM831X_CHG_FAST_ILIM_SHIFT 0 /* CHG_FAST_ILIM - [3:0] */ | ||
119 | #define WM831X_CHG_FAST_ILIM_WIDTH 4 /* CHG_FAST_ILIM - [3:0] */ | ||
120 | |||
121 | /* | ||
122 | * R16458 (0x404A) - Charger Status | ||
123 | */ | ||
124 | #define WM831X_BATT_OV_STS 0x8000 /* BATT_OV_STS */ | ||
125 | #define WM831X_BATT_OV_STS_MASK 0x8000 /* BATT_OV_STS */ | ||
126 | #define WM831X_BATT_OV_STS_SHIFT 15 /* BATT_OV_STS */ | ||
127 | #define WM831X_BATT_OV_STS_WIDTH 1 /* BATT_OV_STS */ | ||
128 | #define WM831X_CHG_STATE_MASK 0x7000 /* CHG_STATE - [14:12] */ | ||
129 | #define WM831X_CHG_STATE_SHIFT 12 /* CHG_STATE - [14:12] */ | ||
130 | #define WM831X_CHG_STATE_WIDTH 3 /* CHG_STATE - [14:12] */ | ||
131 | #define WM831X_BATT_HOT_STS 0x0800 /* BATT_HOT_STS */ | ||
132 | #define WM831X_BATT_HOT_STS_MASK 0x0800 /* BATT_HOT_STS */ | ||
133 | #define WM831X_BATT_HOT_STS_SHIFT 11 /* BATT_HOT_STS */ | ||
134 | #define WM831X_BATT_HOT_STS_WIDTH 1 /* BATT_HOT_STS */ | ||
135 | #define WM831X_BATT_COLD_STS 0x0400 /* BATT_COLD_STS */ | ||
136 | #define WM831X_BATT_COLD_STS_MASK 0x0400 /* BATT_COLD_STS */ | ||
137 | #define WM831X_BATT_COLD_STS_SHIFT 10 /* BATT_COLD_STS */ | ||
138 | #define WM831X_BATT_COLD_STS_WIDTH 1 /* BATT_COLD_STS */ | ||
139 | #define WM831X_CHG_TOPOFF 0x0200 /* CHG_TOPOFF */ | ||
140 | #define WM831X_CHG_TOPOFF_MASK 0x0200 /* CHG_TOPOFF */ | ||
141 | #define WM831X_CHG_TOPOFF_SHIFT 9 /* CHG_TOPOFF */ | ||
142 | #define WM831X_CHG_TOPOFF_WIDTH 1 /* CHG_TOPOFF */ | ||
143 | #define WM831X_CHG_ACTIVE 0x0100 /* CHG_ACTIVE */ | ||
144 | #define WM831X_CHG_ACTIVE_MASK 0x0100 /* CHG_ACTIVE */ | ||
145 | #define WM831X_CHG_ACTIVE_SHIFT 8 /* CHG_ACTIVE */ | ||
146 | #define WM831X_CHG_ACTIVE_WIDTH 1 /* CHG_ACTIVE */ | ||
147 | #define WM831X_CHG_TIME_ELAPSED_MASK 0x00FF /* CHG_TIME_ELAPSED - [7:0] */ | ||
148 | #define WM831X_CHG_TIME_ELAPSED_SHIFT 0 /* CHG_TIME_ELAPSED - [7:0] */ | ||
149 | #define WM831X_CHG_TIME_ELAPSED_WIDTH 8 /* CHG_TIME_ELAPSED - [7:0] */ | ||
150 | |||
151 | #define WM831X_CHG_STATE_OFF (0 << WM831X_CHG_STATE_SHIFT) | ||
152 | #define WM831X_CHG_STATE_TRICKLE (1 << WM831X_CHG_STATE_SHIFT) | ||
153 | #define WM831X_CHG_STATE_FAST (2 << WM831X_CHG_STATE_SHIFT) | ||
154 | #define WM831X_CHG_STATE_TRICKLE_OT (3 << WM831X_CHG_STATE_SHIFT) | ||
155 | #define WM831X_CHG_STATE_FAST_OT (4 << WM831X_CHG_STATE_SHIFT) | ||
156 | #define WM831X_CHG_STATE_DEFECTIVE (5 << WM831X_CHG_STATE_SHIFT) | ||
157 | |||
158 | /* | ||
159 | * R16459 (0x404B) - Backup Charger Control | ||
160 | */ | ||
161 | #define WM831X_BKUP_CHG_ENA 0x8000 /* BKUP_CHG_ENA */ | ||
162 | #define WM831X_BKUP_CHG_ENA_MASK 0x8000 /* BKUP_CHG_ENA */ | ||
163 | #define WM831X_BKUP_CHG_ENA_SHIFT 15 /* BKUP_CHG_ENA */ | ||
164 | #define WM831X_BKUP_CHG_ENA_WIDTH 1 /* BKUP_CHG_ENA */ | ||
165 | #define WM831X_BKUP_CHG_STS 0x4000 /* BKUP_CHG_STS */ | ||
166 | #define WM831X_BKUP_CHG_STS_MASK 0x4000 /* BKUP_CHG_STS */ | ||
167 | #define WM831X_BKUP_CHG_STS_SHIFT 14 /* BKUP_CHG_STS */ | ||
168 | #define WM831X_BKUP_CHG_STS_WIDTH 1 /* BKUP_CHG_STS */ | ||
169 | #define WM831X_BKUP_CHG_MODE 0x1000 /* BKUP_CHG_MODE */ | ||
170 | #define WM831X_BKUP_CHG_MODE_MASK 0x1000 /* BKUP_CHG_MODE */ | ||
171 | #define WM831X_BKUP_CHG_MODE_SHIFT 12 /* BKUP_CHG_MODE */ | ||
172 | #define WM831X_BKUP_CHG_MODE_WIDTH 1 /* BKUP_CHG_MODE */ | ||
173 | #define WM831X_BKUP_BATT_DET_ENA 0x0800 /* BKUP_BATT_DET_ENA */ | ||
174 | #define WM831X_BKUP_BATT_DET_ENA_MASK 0x0800 /* BKUP_BATT_DET_ENA */ | ||
175 | #define WM831X_BKUP_BATT_DET_ENA_SHIFT 11 /* BKUP_BATT_DET_ENA */ | ||
176 | #define WM831X_BKUP_BATT_DET_ENA_WIDTH 1 /* BKUP_BATT_DET_ENA */ | ||
177 | #define WM831X_BKUP_BATT_STS 0x0400 /* BKUP_BATT_STS */ | ||
178 | #define WM831X_BKUP_BATT_STS_MASK 0x0400 /* BKUP_BATT_STS */ | ||
179 | #define WM831X_BKUP_BATT_STS_SHIFT 10 /* BKUP_BATT_STS */ | ||
180 | #define WM831X_BKUP_BATT_STS_WIDTH 1 /* BKUP_BATT_STS */ | ||
181 | #define WM831X_BKUP_CHG_VLIM 0x0010 /* BKUP_CHG_VLIM */ | ||
182 | #define WM831X_BKUP_CHG_VLIM_MASK 0x0010 /* BKUP_CHG_VLIM */ | ||
183 | #define WM831X_BKUP_CHG_VLIM_SHIFT 4 /* BKUP_CHG_VLIM */ | ||
184 | #define WM831X_BKUP_CHG_VLIM_WIDTH 1 /* BKUP_CHG_VLIM */ | ||
185 | #define WM831X_BKUP_CHG_ILIM_MASK 0x0003 /* BKUP_CHG_ILIM - [1:0] */ | ||
186 | #define WM831X_BKUP_CHG_ILIM_SHIFT 0 /* BKUP_CHG_ILIM - [1:0] */ | ||
187 | #define WM831X_BKUP_CHG_ILIM_WIDTH 2 /* BKUP_CHG_ILIM - [1:0] */ | ||
188 | |||
189 | #endif | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 5946e2ff9fe8..6953a5a53e44 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -285,6 +285,14 @@ static inline int is_vmalloc_addr(const void *x) | |||
285 | return 0; | 285 | return 0; |
286 | #endif | 286 | #endif |
287 | } | 287 | } |
288 | #ifdef CONFIG_MMU | ||
289 | extern int is_vmalloc_or_module_addr(const void *x); | ||
290 | #else | ||
291 | static int is_vmalloc_or_module_addr(const void *x) | ||
292 | { | ||
293 | return 0; | ||
294 | } | ||
295 | #endif | ||
288 | 296 | ||
289 | static inline struct page *compound_head(struct page *page) | 297 | static inline struct page *compound_head(struct page *page) |
290 | { | 298 | { |
@@ -687,11 +695,12 @@ static inline int page_mapped(struct page *page) | |||
687 | #define VM_FAULT_SIGBUS 0x0002 | 695 | #define VM_FAULT_SIGBUS 0x0002 |
688 | #define VM_FAULT_MAJOR 0x0004 | 696 | #define VM_FAULT_MAJOR 0x0004 |
689 | #define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ | 697 | #define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ |
698 | #define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned page */ | ||
690 | 699 | ||
691 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ | 700 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ |
692 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ | 701 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ |
693 | 702 | ||
694 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) | 703 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON) |
695 | 704 | ||
696 | /* | 705 | /* |
697 | * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. | 706 | * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. |
@@ -786,6 +795,11 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, | |||
786 | extern int vmtruncate(struct inode * inode, loff_t offset); | 795 | extern int vmtruncate(struct inode * inode, loff_t offset); |
787 | extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); | 796 | extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); |
788 | 797 | ||
798 | int truncate_inode_page(struct address_space *mapping, struct page *page); | ||
799 | int generic_error_remove_page(struct address_space *mapping, struct page *page); | ||
800 | |||
801 | int invalidate_inode_page(struct page *page); | ||
802 | |||
789 | #ifdef CONFIG_MMU | 803 | #ifdef CONFIG_MMU |
790 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 804 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
791 | unsigned long address, unsigned int flags); | 805 | unsigned long address, unsigned int flags); |
@@ -1271,7 +1285,7 @@ int in_gate_area_no_task(unsigned long addr); | |||
1271 | #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) | 1285 | #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) |
1272 | #endif /* __HAVE_ARCH_GATE_AREA */ | 1286 | #endif /* __HAVE_ARCH_GATE_AREA */ |
1273 | 1287 | ||
1274 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, | 1288 | int drop_caches_sysctl_handler(struct ctl_table *, int, |
1275 | void __user *, size_t *, loff_t *); | 1289 | void __user *, size_t *, loff_t *); |
1276 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1290 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, |
1277 | unsigned long lru_pages); | 1291 | unsigned long lru_pages); |
@@ -1300,5 +1314,12 @@ void vmemmap_populate_print_last(void); | |||
1300 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, | 1314 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, |
1301 | size_t size); | 1315 | size_t size); |
1302 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); | 1316 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); |
1317 | |||
1318 | extern void memory_failure(unsigned long pfn, int trapno); | ||
1319 | extern int __memory_failure(unsigned long pfn, int trapno, int ref); | ||
1320 | extern int sysctl_memory_failure_early_kill; | ||
1321 | extern int sysctl_memory_failure_recovery; | ||
1322 | extern atomic_long_t mce_bad_pages; | ||
1323 | |||
1303 | #endif /* __KERNEL__ */ | 1324 | #endif /* __KERNEL__ */ |
1304 | #endif /* _LINUX_MM_H */ | 1325 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0042090a4d70..21d6aa45206a 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -240,6 +240,8 @@ struct mm_struct { | |||
240 | 240 | ||
241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
242 | 242 | ||
243 | struct linux_binfmt *binfmt; | ||
244 | |||
243 | cpumask_t cpu_vm_mask; | 245 | cpumask_t cpu_vm_mask; |
244 | 246 | ||
245 | /* Architecture-specific MM context */ | 247 | /* Architecture-specific MM context */ |
@@ -259,11 +261,10 @@ struct mm_struct { | |||
259 | unsigned long flags; /* Must use atomic bitops to access the bits */ | 261 | unsigned long flags; /* Must use atomic bitops to access the bits */ |
260 | 262 | ||
261 | struct core_state *core_state; /* coredumping support */ | 263 | struct core_state *core_state; /* coredumping support */ |
262 | 264 | #ifdef CONFIG_AIO | |
263 | /* aio bits */ | ||
264 | spinlock_t ioctx_lock; | 265 | spinlock_t ioctx_lock; |
265 | struct hlist_head ioctx_list; | 266 | struct hlist_head ioctx_list; |
266 | 267 | #endif | |
267 | #ifdef CONFIG_MM_OWNER | 268 | #ifdef CONFIG_MM_OWNER |
268 | /* | 269 | /* |
269 | * "owner" points to a task that is regarded as the canonical | 270 | * "owner" points to a task that is regarded as the canonical |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 403aa505f27e..2ee22e8af110 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -40,6 +40,8 @@ struct mmc_csd { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | struct mmc_ext_csd { | 42 | struct mmc_ext_csd { |
43 | u8 rev; | ||
44 | unsigned int sa_timeout; /* Units: 100ns */ | ||
43 | unsigned int hs_max_dtr; | 45 | unsigned int hs_max_dtr; |
44 | unsigned int sectors; | 46 | unsigned int sectors; |
45 | }; | 47 | }; |
@@ -62,7 +64,8 @@ struct sdio_cccr { | |||
62 | low_speed:1, | 64 | low_speed:1, |
63 | wide_bus:1, | 65 | wide_bus:1, |
64 | high_power:1, | 66 | high_power:1, |
65 | high_speed:1; | 67 | high_speed:1, |
68 | disable_cd:1; | ||
66 | }; | 69 | }; |
67 | 70 | ||
68 | struct sdio_cis { | 71 | struct sdio_cis { |
@@ -94,6 +97,8 @@ struct mmc_card { | |||
94 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ | 97 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ |
95 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ | 98 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ |
96 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ | 99 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
100 | unsigned int quirks; /* card quirks */ | ||
101 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | ||
97 | 102 | ||
98 | u32 raw_cid[4]; /* raw card CID */ | 103 | u32 raw_cid[4]; /* raw card CID */ |
99 | u32 raw_csd[4]; /* raw card CSD */ | 104 | u32 raw_csd[4]; /* raw card CSD */ |
@@ -129,6 +134,11 @@ struct mmc_card { | |||
129 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 134 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
130 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 135 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
131 | 136 | ||
137 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) | ||
138 | { | ||
139 | return c->quirks & MMC_QUIRK_LENIENT_FN0; | ||
140 | } | ||
141 | |||
132 | #define mmc_card_name(c) ((c)->cid.prod_name) | 142 | #define mmc_card_name(c) ((c)->cid.prod_name) |
133 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 143 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
134 | 144 | ||
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 7ac8b500d55c..e4898e9eeb59 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -139,6 +139,7 @@ extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); | |||
139 | 139 | ||
140 | extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); | 140 | extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); |
141 | extern void mmc_release_host(struct mmc_host *host); | 141 | extern void mmc_release_host(struct mmc_host *host); |
142 | extern int mmc_try_claim_host(struct mmc_host *host); | ||
142 | 143 | ||
143 | /** | 144 | /** |
144 | * mmc_claim_host - exclusively claim a host | 145 | * mmc_claim_host - exclusively claim a host |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 3e7615e9087e..81bb42358595 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -51,6 +51,35 @@ struct mmc_ios { | |||
51 | }; | 51 | }; |
52 | 52 | ||
53 | struct mmc_host_ops { | 53 | struct mmc_host_ops { |
54 | /* | ||
55 | * Hosts that support power saving can use the 'enable' and 'disable' | ||
56 | * methods to exit and enter power saving states. 'enable' is called | ||
57 | * when the host is claimed and 'disable' is called (or scheduled with | ||
58 | * a delay) when the host is released. The 'disable' is scheduled if | ||
59 | * the disable delay set by 'mmc_set_disable_delay()' is non-zero, | ||
60 | * otherwise 'disable' is called immediately. 'disable' may be | ||
61 | * scheduled repeatedly, to permit ever greater power saving at the | ||
62 | * expense of ever greater latency to re-enable. Rescheduling is | ||
63 | * determined by the return value of the 'disable' method. A positive | ||
64 | * value gives the delay in milliseconds. | ||
65 | * | ||
66 | * In the case where a host function (like set_ios) may be called | ||
67 | * with or without the host claimed, enabling and disabling can be | ||
68 | * done directly and will nest correctly. Call 'mmc_host_enable()' and | ||
69 | * 'mmc_host_lazy_disable()' for this purpose, but note that these | ||
70 | * functions must be paired. | ||
71 | * | ||
72 | * Alternatively, 'mmc_host_enable()' may be paired with | ||
73 | * 'mmc_host_disable()' which calls 'disable' immediately. In this | ||
74 | * case the 'disable' method will be called with 'lazy' set to 0. | ||
75 | * This is mainly useful for error paths. | ||
76 | * | ||
77 | * Because lazy disable may be called from a work queue, the 'disable' | ||
78 | * method must claim the host when 'lazy' != 0, which will work | ||
79 | * correctly because recursion is detected and handled. | ||
80 | */ | ||
81 | int (*enable)(struct mmc_host *host); | ||
82 | int (*disable)(struct mmc_host *host, int lazy); | ||
54 | void (*request)(struct mmc_host *host, struct mmc_request *req); | 83 | void (*request)(struct mmc_host *host, struct mmc_request *req); |
55 | /* | 84 | /* |
56 | * Avoid calling these three functions too often or in a "fast path", | 85 | * Avoid calling these three functions too often or in a "fast path", |
@@ -118,6 +147,9 @@ struct mmc_host { | |||
118 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ | 147 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ |
119 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ | 148 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ |
120 | #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ | 149 | #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ |
150 | #define MMC_CAP_DISABLE (1 << 7) /* Can the host be disabled */ | ||
151 | #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ | ||
152 | #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ | ||
121 | 153 | ||
122 | /* host specific block data */ | 154 | /* host specific block data */ |
123 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 155 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
@@ -142,9 +174,18 @@ struct mmc_host { | |||
142 | unsigned int removed:1; /* host is being removed */ | 174 | unsigned int removed:1; /* host is being removed */ |
143 | #endif | 175 | #endif |
144 | 176 | ||
177 | /* Only used with MMC_CAP_DISABLE */ | ||
178 | int enabled; /* host is enabled */ | ||
179 | int nesting_cnt; /* "enable" nesting count */ | ||
180 | int en_dis_recurs; /* detect recursion */ | ||
181 | unsigned int disable_delay; /* disable delay in msecs */ | ||
182 | struct delayed_work disable; /* disabling work */ | ||
183 | |||
145 | struct mmc_card *card; /* device attached to this host */ | 184 | struct mmc_card *card; /* device attached to this host */ |
146 | 185 | ||
147 | wait_queue_head_t wq; | 186 | wait_queue_head_t wq; |
187 | struct task_struct *claimer; /* task that has host claimed */ | ||
188 | int claim_cnt; /* "claim" nesting count */ | ||
148 | 189 | ||
149 | struct delayed_work detect; | 190 | struct delayed_work detect; |
150 | 191 | ||
@@ -183,6 +224,9 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
183 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); | 224 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); |
184 | extern int mmc_resume_host(struct mmc_host *); | 225 | extern int mmc_resume_host(struct mmc_host *); |
185 | 226 | ||
227 | extern void mmc_power_save_host(struct mmc_host *host); | ||
228 | extern void mmc_power_restore_host(struct mmc_host *host); | ||
229 | |||
186 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 230 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
187 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 231 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
188 | 232 | ||
@@ -197,5 +241,19 @@ struct regulator; | |||
197 | int mmc_regulator_get_ocrmask(struct regulator *supply); | 241 | int mmc_regulator_get_ocrmask(struct regulator *supply); |
198 | int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); | 242 | int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); |
199 | 243 | ||
244 | int mmc_card_awake(struct mmc_host *host); | ||
245 | int mmc_card_sleep(struct mmc_host *host); | ||
246 | int mmc_card_can_sleep(struct mmc_host *host); | ||
247 | |||
248 | int mmc_host_enable(struct mmc_host *host); | ||
249 | int mmc_host_disable(struct mmc_host *host); | ||
250 | int mmc_host_lazy_disable(struct mmc_host *host); | ||
251 | |||
252 | static inline void mmc_set_disable_delay(struct mmc_host *host, | ||
253 | unsigned int disable_delay) | ||
254 | { | ||
255 | host->disable_delay = disable_delay; | ||
256 | } | ||
257 | |||
200 | #endif | 258 | #endif |
201 | 259 | ||
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 14b81f3e5232..c02c8db73701 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ | 31 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ |
32 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ | 32 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ |
33 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ | 33 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ |
34 | #define MMC_SLEEP_AWAKE 5 /* ac [31:16] RCA 15:flg R1b */ | ||
34 | #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ | 35 | #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ |
35 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ | 36 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ |
36 | #define MMC_SEND_EXT_CSD 8 /* adtc R1 */ | 37 | #define MMC_SEND_EXT_CSD 8 /* adtc R1 */ |
@@ -127,6 +128,7 @@ | |||
127 | #define R1_STATUS(x) (x & 0xFFFFE000) | 128 | #define R1_STATUS(x) (x & 0xFFFFE000) |
128 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ | 129 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ |
129 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ | 130 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ |
131 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ | ||
130 | #define R1_APP_CMD (1 << 5) /* sr, c */ | 132 | #define R1_APP_CMD (1 << 5) /* sr, c */ |
131 | 133 | ||
132 | /* | 134 | /* |
@@ -254,6 +256,7 @@ struct _mmc_csd { | |||
254 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | 256 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
255 | #define EXT_CSD_REV 192 /* RO */ | 257 | #define EXT_CSD_REV 192 /* RO */ |
256 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | 258 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ |
259 | #define EXT_CSD_S_A_TIMEOUT 217 | ||
257 | 260 | ||
258 | /* | 261 | /* |
259 | * EXT_CSD field definitions | 262 | * EXT_CSD field definitions |
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index 451bdfc85830..ac3ab683fec6 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h | |||
@@ -67,6 +67,7 @@ struct sdio_func { | |||
67 | 67 | ||
68 | #define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev) | 68 | #define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev) |
69 | #define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d) | 69 | #define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d) |
70 | #define dev_to_sdio_func(d) container_of(d, struct sdio_func, dev) | ||
70 | 71 | ||
71 | /* | 72 | /* |
72 | * SDIO function device driver | 73 | * SDIO function device driver |
@@ -81,6 +82,8 @@ struct sdio_driver { | |||
81 | struct device_driver drv; | 82 | struct device_driver drv; |
82 | }; | 83 | }; |
83 | 84 | ||
85 | #define to_sdio_driver(d) container_of(d, struct sdio_driver, drv) | ||
86 | |||
84 | /** | 87 | /** |
85 | * SDIO_DEVICE - macro used to describe a specific SDIO device | 88 | * SDIO_DEVICE - macro used to describe a specific SDIO device |
86 | * @vend: the 16 bit manufacturer code | 89 | * @vend: the 16 bit manufacturer code |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 652ef01be582..6f7561730d88 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -755,21 +755,20 @@ static inline int is_dma(struct zone *zone) | |||
755 | 755 | ||
756 | /* These two functions are used to setup the per zone pages min values */ | 756 | /* These two functions are used to setup the per zone pages min values */ |
757 | struct ctl_table; | 757 | struct ctl_table; |
758 | struct file; | 758 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, |
759 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, | ||
760 | void __user *, size_t *, loff_t *); | 759 | void __user *, size_t *, loff_t *); |
761 | extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; | 760 | extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; |
762 | int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, | 761 | int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, |
763 | void __user *, size_t *, loff_t *); | 762 | void __user *, size_t *, loff_t *); |
764 | int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *, | 763 | int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, |
765 | void __user *, size_t *, loff_t *); | 764 | void __user *, size_t *, loff_t *); |
766 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, | 765 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, |
767 | struct file *, void __user *, size_t *, loff_t *); | 766 | void __user *, size_t *, loff_t *); |
768 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, | 767 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, |
769 | struct file *, void __user *, size_t *, loff_t *); | 768 | void __user *, size_t *, loff_t *); |
770 | 769 | ||
771 | extern int numa_zonelist_order_handler(struct ctl_table *, int, | 770 | extern int numa_zonelist_order_handler(struct ctl_table *, int, |
772 | struct file *, void __user *, size_t *, loff_t *); | 771 | void __user *, size_t *, loff_t *); |
773 | extern char numa_zonelist_order[]; | 772 | extern char numa_zonelist_order[]; |
774 | #define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */ | 773 | #define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */ |
775 | 774 | ||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 1bf5900ffe43..f58e9d836f32 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -399,6 +399,17 @@ struct i2c_device_id { | |||
399 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | 399 | __attribute__((aligned(sizeof(kernel_ulong_t)))); |
400 | }; | 400 | }; |
401 | 401 | ||
402 | /* spi */ | ||
403 | |||
404 | #define SPI_NAME_SIZE 32 | ||
405 | #define SPI_MODULE_PREFIX "spi:" | ||
406 | |||
407 | struct spi_device_id { | ||
408 | char name[SPI_NAME_SIZE]; | ||
409 | kernel_ulong_t driver_data /* Data private to the driver */ | ||
410 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
411 | }; | ||
412 | |||
402 | /* dmi */ | 413 | /* dmi */ |
403 | enum dmi_field { | 414 | enum dmi_field { |
404 | DMI_NONE, | 415 | DMI_NONE, |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 4030ebada49e..7a232a9bdd62 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -121,6 +121,7 @@ typedef enum { | |||
121 | NAND_ECC_SOFT, | 121 | NAND_ECC_SOFT, |
122 | NAND_ECC_HW, | 122 | NAND_ECC_HW, |
123 | NAND_ECC_HW_SYNDROME, | 123 | NAND_ECC_HW_SYNDROME, |
124 | NAND_ECC_HW_OOB_FIRST, | ||
124 | } nand_ecc_modes_t; | 125 | } nand_ecc_modes_t; |
125 | 126 | ||
126 | /* | 127 | /* |
@@ -271,13 +272,13 @@ struct nand_ecc_ctrl { | |||
271 | uint8_t *calc_ecc); | 272 | uint8_t *calc_ecc); |
272 | int (*read_page_raw)(struct mtd_info *mtd, | 273 | int (*read_page_raw)(struct mtd_info *mtd, |
273 | struct nand_chip *chip, | 274 | struct nand_chip *chip, |
274 | uint8_t *buf); | 275 | uint8_t *buf, int page); |
275 | void (*write_page_raw)(struct mtd_info *mtd, | 276 | void (*write_page_raw)(struct mtd_info *mtd, |
276 | struct nand_chip *chip, | 277 | struct nand_chip *chip, |
277 | const uint8_t *buf); | 278 | const uint8_t *buf); |
278 | int (*read_page)(struct mtd_info *mtd, | 279 | int (*read_page)(struct mtd_info *mtd, |
279 | struct nand_chip *chip, | 280 | struct nand_chip *chip, |
280 | uint8_t *buf); | 281 | uint8_t *buf, int page); |
281 | int (*read_subpage)(struct mtd_info *mtd, | 282 | int (*read_subpage)(struct mtd_info *mtd, |
282 | struct nand_chip *chip, | 283 | struct nand_chip *chip, |
283 | uint32_t offs, uint32_t len, | 284 | uint32_t offs, uint32_t len, |
diff --git a/include/linux/mtd/nand_ecc.h b/include/linux/mtd/nand_ecc.h index 090da505425d..052ea8ca2434 100644 --- a/include/linux/mtd/nand_ecc.h +++ b/include/linux/mtd/nand_ecc.h | |||
@@ -21,6 +21,12 @@ struct mtd_info; | |||
21 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); | 21 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); |
22 | 22 | ||
23 | /* | 23 | /* |
24 | * Detect and correct a 1 bit error for eccsize byte block | ||
25 | */ | ||
26 | int __nand_correct_data(u_char *dat, u_char *read_ecc, u_char *calc_ecc, | ||
27 | unsigned int eccsize); | ||
28 | |||
29 | /* | ||
24 | * Detect and correct a 1 bit error for 256 byte block | 30 | * Detect and correct a 1 bit error for 256 byte block |
25 | */ | 31 | */ |
26 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); | 32 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 8ed873374381..4e49f3350678 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -214,4 +214,12 @@ unsigned onenand_block(struct onenand_chip *this, loff_t addr); | |||
214 | loff_t onenand_addr(struct onenand_chip *this, int block); | 214 | loff_t onenand_addr(struct onenand_chip *this, int block); |
215 | int flexonenand_region(struct mtd_info *mtd, loff_t addr); | 215 | int flexonenand_region(struct mtd_info *mtd, loff_t addr); |
216 | 216 | ||
217 | struct mtd_partition; | ||
218 | |||
219 | struct onenand_platform_data { | ||
220 | void (*mmcontrol)(struct mtd_info *mtd, int sync_read); | ||
221 | struct mtd_partition *parts; | ||
222 | unsigned int nr_parts; | ||
223 | }; | ||
224 | |||
217 | #endif /* __LINUX_MTD_ONENAND_H */ | 225 | #endif /* __LINUX_MTD_ONENAND_H */ |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index 86a6bbef6465..acadbf53a69f 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -207,6 +207,9 @@ | |||
207 | #define ONENAND_ECC_2BIT (1 << 1) | 207 | #define ONENAND_ECC_2BIT (1 << 1) |
208 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) | 208 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) |
209 | #define FLEXONENAND_UNCORRECTABLE_ERROR (0x1010) | 209 | #define FLEXONENAND_UNCORRECTABLE_ERROR (0x1010) |
210 | #define ONENAND_ECC_3BIT (1 << 2) | ||
211 | #define ONENAND_ECC_4BIT (1 << 3) | ||
212 | #define ONENAND_ECC_4BIT_UNCORRECTABLE (0x1010) | ||
210 | 213 | ||
211 | /* | 214 | /* |
212 | * One-Time Programmable (OTP) | 215 | * One-Time Programmable (OTP) |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 03bbe9039104..510ffdd5020e 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -60,7 +60,7 @@ extern spinlock_t nfsd_drc_lock; | |||
60 | extern unsigned int nfsd_drc_max_mem; | 60 | extern unsigned int nfsd_drc_max_mem; |
61 | extern unsigned int nfsd_drc_mem_used; | 61 | extern unsigned int nfsd_drc_mem_used; |
62 | 62 | ||
63 | extern struct seq_operations nfs_exports_op; | 63 | extern const struct seq_operations nfs_exports_op; |
64 | 64 | ||
65 | /* | 65 | /* |
66 | * Function prototypes. | 66 | * Function prototypes. |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 13de789f0a5c..6b202b173955 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -51,6 +51,9 @@ | |||
51 | * PG_buddy is set to indicate that the page is free and in the buddy system | 51 | * PG_buddy is set to indicate that the page is free and in the buddy system |
52 | * (see mm/page_alloc.c). | 52 | * (see mm/page_alloc.c). |
53 | * | 53 | * |
54 | * PG_hwpoison indicates that a page got corrupted in hardware and contains | ||
55 | * data with incorrect ECC bits that triggered a machine check. Accessing is | ||
56 | * not safe since it may cause another machine check. Don't touch! | ||
54 | */ | 57 | */ |
55 | 58 | ||
56 | /* | 59 | /* |
@@ -102,6 +105,9 @@ enum pageflags { | |||
102 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED | 105 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED |
103 | PG_uncached, /* Page has been mapped as uncached */ | 106 | PG_uncached, /* Page has been mapped as uncached */ |
104 | #endif | 107 | #endif |
108 | #ifdef CONFIG_MEMORY_FAILURE | ||
109 | PG_hwpoison, /* hardware poisoned page. Don't touch */ | ||
110 | #endif | ||
105 | __NR_PAGEFLAGS, | 111 | __NR_PAGEFLAGS, |
106 | 112 | ||
107 | /* Filesystems */ | 113 | /* Filesystems */ |
@@ -269,6 +275,15 @@ PAGEFLAG(Uncached, uncached) | |||
269 | PAGEFLAG_FALSE(Uncached) | 275 | PAGEFLAG_FALSE(Uncached) |
270 | #endif | 276 | #endif |
271 | 277 | ||
278 | #ifdef CONFIG_MEMORY_FAILURE | ||
279 | PAGEFLAG(HWPoison, hwpoison) | ||
280 | TESTSETFLAG(HWPoison, hwpoison) | ||
281 | #define __PG_HWPOISON (1UL << PG_hwpoison) | ||
282 | #else | ||
283 | PAGEFLAG_FALSE(HWPoison) | ||
284 | #define __PG_HWPOISON 0 | ||
285 | #endif | ||
286 | |||
272 | static inline int PageUptodate(struct page *page) | 287 | static inline int PageUptodate(struct page *page) |
273 | { | 288 | { |
274 | int ret = test_bit(PG_uptodate, &(page)->flags); | 289 | int ret = test_bit(PG_uptodate, &(page)->flags); |
@@ -393,7 +408,7 @@ static inline void __ClearPageTail(struct page *page) | |||
393 | 1 << PG_private | 1 << PG_private_2 | \ | 408 | 1 << PG_private | 1 << PG_private_2 | \ |
394 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ | 409 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ |
395 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | 410 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ |
396 | 1 << PG_unevictable | __PG_MLOCKED) | 411 | 1 << PG_unevictable | __PG_MLOCKED | __PG_HWPOISON) |
397 | 412 | ||
398 | /* | 413 | /* |
399 | * Flags checked when a page is prepped for return by the page allocator. | 414 | * Flags checked when a page is prepped for return by the page allocator. |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index ada779f24178..4b938d4f3ac2 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -38,6 +38,7 @@ enum { | |||
38 | PCG_LOCK, /* page cgroup is locked */ | 38 | PCG_LOCK, /* page cgroup is locked */ |
39 | PCG_CACHE, /* charged as cache */ | 39 | PCG_CACHE, /* charged as cache */ |
40 | PCG_USED, /* this object is in use. */ | 40 | PCG_USED, /* this object is in use. */ |
41 | PCG_ACCT_LRU, /* page has been accounted for */ | ||
41 | }; | 42 | }; |
42 | 43 | ||
43 | #define TESTPCGFLAG(uname, lname) \ | 44 | #define TESTPCGFLAG(uname, lname) \ |
@@ -52,11 +53,23 @@ static inline void SetPageCgroup##uname(struct page_cgroup *pc)\ | |||
52 | static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ | 53 | static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ |
53 | { clear_bit(PCG_##lname, &pc->flags); } | 54 | { clear_bit(PCG_##lname, &pc->flags); } |
54 | 55 | ||
56 | #define TESTCLEARPCGFLAG(uname, lname) \ | ||
57 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ | ||
58 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } | ||
59 | |||
55 | /* Cache flag is set only once (at allocation) */ | 60 | /* Cache flag is set only once (at allocation) */ |
56 | TESTPCGFLAG(Cache, CACHE) | 61 | TESTPCGFLAG(Cache, CACHE) |
62 | CLEARPCGFLAG(Cache, CACHE) | ||
63 | SETPCGFLAG(Cache, CACHE) | ||
57 | 64 | ||
58 | TESTPCGFLAG(Used, USED) | 65 | TESTPCGFLAG(Used, USED) |
59 | CLEARPCGFLAG(Used, USED) | 66 | CLEARPCGFLAG(Used, USED) |
67 | SETPCGFLAG(Used, USED) | ||
68 | |||
69 | SETPCGFLAG(AcctLRU, ACCT_LRU) | ||
70 | CLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
71 | TESTPCGFLAG(AcctLRU, ACCT_LRU) | ||
72 | TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
60 | 73 | ||
61 | static inline int page_cgroup_nid(struct page_cgroup *pc) | 74 | static inline int page_cgroup_nid(struct page_cgroup *pc) |
62 | { | 75 | { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 6f9623710f28..da1fda8623e0 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -543,6 +543,7 @@ | |||
543 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 | 543 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
544 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | 544 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 |
545 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 | 545 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 |
546 | #define PCI_DEVICE_ID_AMD_SB900_SMBUS 0x780b | ||
546 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F | 547 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F |
547 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 548 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
548 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 549 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 594c494ac3f0..b5d096d3a9be 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -39,6 +39,13 @@ enum { | |||
39 | }; | 39 | }; |
40 | 40 | ||
41 | enum { | 41 | enum { |
42 | POWER_SUPPLY_CHARGE_TYPE_UNKNOWN = 0, | ||
43 | POWER_SUPPLY_CHARGE_TYPE_NONE, | ||
44 | POWER_SUPPLY_CHARGE_TYPE_TRICKLE, | ||
45 | POWER_SUPPLY_CHARGE_TYPE_FAST, | ||
46 | }; | ||
47 | |||
48 | enum { | ||
42 | POWER_SUPPLY_HEALTH_UNKNOWN = 0, | 49 | POWER_SUPPLY_HEALTH_UNKNOWN = 0, |
43 | POWER_SUPPLY_HEALTH_GOOD, | 50 | POWER_SUPPLY_HEALTH_GOOD, |
44 | POWER_SUPPLY_HEALTH_OVERHEAT, | 51 | POWER_SUPPLY_HEALTH_OVERHEAT, |
@@ -58,9 +65,19 @@ enum { | |||
58 | POWER_SUPPLY_TECHNOLOGY_LiMn, | 65 | POWER_SUPPLY_TECHNOLOGY_LiMn, |
59 | }; | 66 | }; |
60 | 67 | ||
68 | enum { | ||
69 | POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN = 0, | ||
70 | POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL, | ||
71 | POWER_SUPPLY_CAPACITY_LEVEL_LOW, | ||
72 | POWER_SUPPLY_CAPACITY_LEVEL_NORMAL, | ||
73 | POWER_SUPPLY_CAPACITY_LEVEL_HIGH, | ||
74 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, | ||
75 | }; | ||
76 | |||
61 | enum power_supply_property { | 77 | enum power_supply_property { |
62 | /* Properties of type `int' */ | 78 | /* Properties of type `int' */ |
63 | POWER_SUPPLY_PROP_STATUS = 0, | 79 | POWER_SUPPLY_PROP_STATUS = 0, |
80 | POWER_SUPPLY_PROP_CHARGE_TYPE, | ||
64 | POWER_SUPPLY_PROP_HEALTH, | 81 | POWER_SUPPLY_PROP_HEALTH, |
65 | POWER_SUPPLY_PROP_PRESENT, | 82 | POWER_SUPPLY_PROP_PRESENT, |
66 | POWER_SUPPLY_PROP_ONLINE, | 83 | POWER_SUPPLY_PROP_ONLINE, |
@@ -89,6 +106,7 @@ enum power_supply_property { | |||
89 | POWER_SUPPLY_PROP_ENERGY_NOW, | 106 | POWER_SUPPLY_PROP_ENERGY_NOW, |
90 | POWER_SUPPLY_PROP_ENERGY_AVG, | 107 | POWER_SUPPLY_PROP_ENERGY_AVG, |
91 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ | 108 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ |
109 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, | ||
92 | POWER_SUPPLY_PROP_TEMP, | 110 | POWER_SUPPLY_PROP_TEMP, |
93 | POWER_SUPPLY_PROP_TEMP_AMBIENT, | 111 | POWER_SUPPLY_PROP_TEMP_AMBIENT, |
94 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, | 112 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, |
@@ -126,6 +144,7 @@ struct power_supply { | |||
126 | enum power_supply_property psp, | 144 | enum power_supply_property psp, |
127 | union power_supply_propval *val); | 145 | union power_supply_propval *val); |
128 | void (*external_power_changed)(struct power_supply *psy); | 146 | void (*external_power_changed)(struct power_supply *psy); |
147 | void (*set_charged)(struct power_supply *psy); | ||
129 | 148 | ||
130 | /* For APM emulation, think legacy userspace. */ | 149 | /* For APM emulation, think legacy userspace. */ |
131 | int use_for_apm; | 150 | int use_for_apm; |
@@ -165,8 +184,10 @@ struct power_supply_info { | |||
165 | int use_for_apm; | 184 | int use_for_apm; |
166 | }; | 185 | }; |
167 | 186 | ||
187 | extern struct power_supply *power_supply_get_by_name(char *name); | ||
168 | extern void power_supply_changed(struct power_supply *psy); | 188 | extern void power_supply_changed(struct power_supply *psy); |
169 | extern int power_supply_am_i_supplied(struct power_supply *psy); | 189 | extern int power_supply_am_i_supplied(struct power_supply *psy); |
190 | extern int power_supply_set_battery_charged(struct power_supply *psy); | ||
170 | 191 | ||
171 | #if defined(CONFIG_POWER_SUPPLY) || defined(CONFIG_POWER_SUPPLY_MODULE) | 192 | #if defined(CONFIG_POWER_SUPPLY) || defined(CONFIG_POWER_SUPPLY_MODULE) |
172 | extern int power_supply_is_system_supplied(void); | 193 | extern int power_supply_is_system_supplied(void); |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index 07bff666e65b..931150566ade 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
@@ -88,4 +88,6 @@ | |||
88 | #define PR_TASK_PERF_EVENTS_DISABLE 31 | 88 | #define PR_TASK_PERF_EVENTS_DISABLE 31 |
89 | #define PR_TASK_PERF_EVENTS_ENABLE 32 | 89 | #define PR_TASK_PERF_EVENTS_ENABLE 32 |
90 | 90 | ||
91 | #define PR_MCE_KILL 33 | ||
92 | |||
91 | #endif /* _LINUX_PRCTL_H */ | 93 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index e6e77d31c418..379eaed72d4b 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -78,10 +78,19 @@ struct proc_dir_entry { | |||
78 | struct list_head pde_openers; /* who did ->open, but not ->release */ | 78 | struct list_head pde_openers; /* who did ->open, but not ->release */ |
79 | }; | 79 | }; |
80 | 80 | ||
81 | enum kcore_type { | ||
82 | KCORE_TEXT, | ||
83 | KCORE_VMALLOC, | ||
84 | KCORE_RAM, | ||
85 | KCORE_VMEMMAP, | ||
86 | KCORE_OTHER, | ||
87 | }; | ||
88 | |||
81 | struct kcore_list { | 89 | struct kcore_list { |
82 | struct kcore_list *next; | 90 | struct list_head list; |
83 | unsigned long addr; | 91 | unsigned long addr; |
84 | size_t size; | 92 | size_t size; |
93 | int type; | ||
85 | }; | 94 | }; |
86 | 95 | ||
87 | struct vmcore { | 96 | struct vmcore { |
@@ -233,11 +242,12 @@ static inline void dup_mm_exe_file(struct mm_struct *oldmm, | |||
233 | #endif /* CONFIG_PROC_FS */ | 242 | #endif /* CONFIG_PROC_FS */ |
234 | 243 | ||
235 | #if !defined(CONFIG_PROC_KCORE) | 244 | #if !defined(CONFIG_PROC_KCORE) |
236 | static inline void kclist_add(struct kcore_list *new, void *addr, size_t size) | 245 | static inline void |
246 | kclist_add(struct kcore_list *new, void *addr, size_t size, int type) | ||
237 | { | 247 | { |
238 | } | 248 | } |
239 | #else | 249 | #else |
240 | extern void kclist_add(struct kcore_list *, void *, size_t); | 250 | extern void kclist_add(struct kcore_list *, void *, size_t, int type); |
241 | #endif | 251 | #endif |
242 | 252 | ||
243 | union proc_op { | 253 | union proc_op { |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 277f4b964df5..490c5b37b6d7 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -125,6 +125,8 @@ struct regulator_bulk_data { | |||
125 | /* regulator get and put */ | 125 | /* regulator get and put */ |
126 | struct regulator *__must_check regulator_get(struct device *dev, | 126 | struct regulator *__must_check regulator_get(struct device *dev, |
127 | const char *id); | 127 | const char *id); |
128 | struct regulator *__must_check regulator_get_exclusive(struct device *dev, | ||
129 | const char *id); | ||
128 | void regulator_put(struct regulator *regulator); | 130 | void regulator_put(struct regulator *regulator); |
129 | 131 | ||
130 | /* regulator output control and status */ | 132 | /* regulator output control and status */ |
@@ -144,6 +146,8 @@ void regulator_bulk_free(int num_consumers, | |||
144 | 146 | ||
145 | int regulator_count_voltages(struct regulator *regulator); | 147 | int regulator_count_voltages(struct regulator *regulator); |
146 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); | 148 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); |
149 | int regulator_is_supported_voltage(struct regulator *regulator, | ||
150 | int min_uV, int max_uV); | ||
147 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); | 151 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); |
148 | int regulator_get_voltage(struct regulator *regulator); | 152 | int regulator_get_voltage(struct regulator *regulator); |
149 | int regulator_set_current_limit(struct regulator *regulator, | 153 | int regulator_set_current_limit(struct regulator *regulator, |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index ce1be708ca16..31f2055eae28 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -37,7 +37,8 @@ enum regulator_status { | |||
37 | * | 37 | * |
38 | * @enable: Configure the regulator as enabled. | 38 | * @enable: Configure the regulator as enabled. |
39 | * @disable: Configure the regulator as disabled. | 39 | * @disable: Configure the regulator as disabled. |
40 | * @is_enabled: Return 1 if the regulator is enabled, 0 otherwise. | 40 | * @is_enabled: Return 1 if the regulator is enabled, 0 if not. |
41 | * May also return negative errno. | ||
41 | * | 42 | * |
42 | * @set_voltage: Set the voltage for the regulator within the range specified. | 43 | * @set_voltage: Set the voltage for the regulator within the range specified. |
43 | * The driver should select the voltage closest to min_uV. | 44 | * The driver should select the voltage closest to min_uV. |
@@ -162,6 +163,8 @@ struct regulator_desc { | |||
162 | struct regulator_dev { | 163 | struct regulator_dev { |
163 | struct regulator_desc *desc; | 164 | struct regulator_desc *desc; |
164 | int use_count; | 165 | int use_count; |
166 | int open_count; | ||
167 | int exclusive; | ||
165 | 168 | ||
166 | /* lists we belong to */ | 169 | /* lists we belong to */ |
167 | struct list_head list; /* list of all regulators */ | 170 | struct list_head list; /* list of all regulators */ |
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h index 91b4da31f1b5..e94a4a1c7c8a 100644 --- a/include/linux/regulator/fixed.h +++ b/include/linux/regulator/fixed.h | |||
@@ -5,6 +5,9 @@ | |||
5 | * | 5 | * |
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
7 | * | 7 | * |
8 | * Copyright (c) 2009 Nokia Corporation | ||
9 | * Roger Quadros <ext-roger.quadros@nokia.com> | ||
10 | * | ||
8 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU General Public License as | 12 | * modify it under the terms of the GNU General Public License as |
10 | * published by the Free Software Foundation; either version 2 of the | 13 | * published by the Free Software Foundation; either version 2 of the |
@@ -16,9 +19,30 @@ | |||
16 | 19 | ||
17 | struct regulator_init_data; | 20 | struct regulator_init_data; |
18 | 21 | ||
22 | /** | ||
23 | * struct fixed_voltage_config - fixed_voltage_config structure | ||
24 | * @supply_name: Name of the regulator supply | ||
25 | * @microvolts: Output voltage of regulator | ||
26 | * @gpio: GPIO to use for enable control | ||
27 | * set to -EINVAL if not used | ||
28 | * @enable_high: Polarity of enable GPIO | ||
29 | * 1 = Active high, 0 = Active low | ||
30 | * @enabled_at_boot: Whether regulator has been enabled at | ||
31 | * boot or not. 1 = Yes, 0 = No | ||
32 | * This is used to keep the regulator at | ||
33 | * the default state | ||
34 | * @init_data: regulator_init_data | ||
35 | * | ||
36 | * This structure contains fixed voltage regulator configuration | ||
37 | * information that must be passed by platform code to the fixed | ||
38 | * voltage regulator driver. | ||
39 | */ | ||
19 | struct fixed_voltage_config { | 40 | struct fixed_voltage_config { |
20 | const char *supply_name; | 41 | const char *supply_name; |
21 | int microvolts; | 42 | int microvolts; |
43 | int gpio; | ||
44 | unsigned enable_high:1; | ||
45 | unsigned enabled_at_boot:1; | ||
22 | struct regulator_init_data *init_data; | 46 | struct regulator_init_data *init_data; |
23 | }; | 47 | }; |
24 | 48 | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index bac64fa390f2..87f5f176d4ef 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -41,7 +41,7 @@ struct regulator; | |||
41 | #define REGULATOR_CHANGE_DRMS 0x10 | 41 | #define REGULATOR_CHANGE_DRMS 0x10 |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct regulator_state - regulator state during low power syatem states | 44 | * struct regulator_state - regulator state during low power system states |
45 | * | 45 | * |
46 | * This describes a regulators state during a system wide low power state. | 46 | * This describes a regulators state during a system wide low power state. |
47 | * | 47 | * |
@@ -117,25 +117,37 @@ struct regulation_constraints { | |||
117 | /* mode to set on startup */ | 117 | /* mode to set on startup */ |
118 | unsigned int initial_mode; | 118 | unsigned int initial_mode; |
119 | 119 | ||
120 | /* constriant flags */ | 120 | /* constraint flags */ |
121 | unsigned always_on:1; /* regulator never off when system is on */ | 121 | unsigned always_on:1; /* regulator never off when system is on */ |
122 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ | 122 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ |
123 | unsigned apply_uV:1; /* apply uV constraint iff min == max */ | 123 | unsigned apply_uV:1; /* apply uV constraint if min == max */ |
124 | }; | 124 | }; |
125 | 125 | ||
126 | /** | 126 | /** |
127 | * struct regulator_consumer_supply - supply -> device mapping | 127 | * struct regulator_consumer_supply - supply -> device mapping |
128 | * | 128 | * |
129 | * This maps a supply name to a device. | 129 | * This maps a supply name to a device. Only one of dev or dev_name |
130 | * can be specified. Use of dev_name allows support for buses which | ||
131 | * make struct device available late such as I2C and is the preferred | ||
132 | * form. | ||
130 | * | 133 | * |
131 | * @dev: Device structure for the consumer. | 134 | * @dev: Device structure for the consumer. |
135 | * @dev_name: Result of dev_name() for the consumer. | ||
132 | * @supply: Name for the supply. | 136 | * @supply: Name for the supply. |
133 | */ | 137 | */ |
134 | struct regulator_consumer_supply { | 138 | struct regulator_consumer_supply { |
135 | struct device *dev; /* consumer */ | 139 | struct device *dev; /* consumer */ |
140 | const char *dev_name; /* dev_name() for consumer */ | ||
136 | const char *supply; /* consumer supply - e.g. "vcc" */ | 141 | const char *supply; /* consumer supply - e.g. "vcc" */ |
137 | }; | 142 | }; |
138 | 143 | ||
144 | /* Initialize struct regulator_consumer_supply */ | ||
145 | #define REGULATOR_SUPPLY(_name, _dev_name) \ | ||
146 | { \ | ||
147 | .supply = _name, \ | ||
148 | .dev_name = _dev_name, \ | ||
149 | } | ||
150 | |||
139 | /** | 151 | /** |
140 | * struct regulator_init_data - regulator platform initialisation data. | 152 | * struct regulator_init_data - regulator platform initialisation data. |
141 | * | 153 | * |
@@ -166,6 +178,12 @@ struct regulator_init_data { | |||
166 | 178 | ||
167 | int regulator_suspend_prepare(suspend_state_t state); | 179 | int regulator_suspend_prepare(suspend_state_t state); |
168 | 180 | ||
181 | #ifdef CONFIG_REGULATOR | ||
169 | void regulator_has_full_constraints(void); | 182 | void regulator_has_full_constraints(void); |
183 | #else | ||
184 | static inline void regulator_has_full_constraints(void) | ||
185 | { | ||
186 | } | ||
187 | #endif | ||
170 | 188 | ||
171 | #endif | 189 | #endif |
diff --git a/include/linux/regulator/max1586.h b/include/linux/regulator/max1586.h index 44563192bf16..de9a7fae20be 100644 --- a/include/linux/regulator/max1586.h +++ b/include/linux/regulator/max1586.h | |||
@@ -36,7 +36,7 @@ | |||
36 | * max1586_subdev_data - regulator data | 36 | * max1586_subdev_data - regulator data |
37 | * @id: regulator Id (either MAX1586_V3 or MAX1586_V6) | 37 | * @id: regulator Id (either MAX1586_V3 or MAX1586_V6) |
38 | * @name: regulator cute name (example for V3: "vcc_core") | 38 | * @name: regulator cute name (example for V3: "vcc_core") |
39 | * @platform_data: regulator init data (contraints, supplies, ...) | 39 | * @platform_data: regulator init data (constraints, supplies, ...) |
40 | */ | 40 | */ |
41 | struct max1586_subdev_data { | 41 | struct max1586_subdev_data { |
42 | int id; | 42 | int id; |
@@ -46,7 +46,7 @@ struct max1586_subdev_data { | |||
46 | 46 | ||
47 | /** | 47 | /** |
48 | * max1586_platform_data - platform data for max1586 | 48 | * max1586_platform_data - platform data for max1586 |
49 | * @num_subdevs: number of regultors used (may be 1 or 2) | 49 | * @num_subdevs: number of regulators used (may be 1 or 2) |
50 | * @subdevs: regulator used | 50 | * @subdevs: regulator used |
51 | * At most, there will be a regulator for V3 and one for V6 voltages. | 51 | * At most, there will be a regulator for V3 and one for V6 voltages. |
52 | * @v3_gain: gain on the V3 voltage output multiplied by 1e6. | 52 | * @v3_gain: gain on the V3 voltage output multiplied by 1e6. |
diff --git a/include/linux/relay.h b/include/linux/relay.h index 953fc055e875..14a86bc7102b 100644 --- a/include/linux/relay.h +++ b/include/linux/relay.h | |||
@@ -140,7 +140,7 @@ struct rchan_callbacks | |||
140 | * cause relay_open() to create a single global buffer rather | 140 | * cause relay_open() to create a single global buffer rather |
141 | * than the default set of per-cpu buffers. | 141 | * than the default set of per-cpu buffers. |
142 | * | 142 | * |
143 | * See Documentation/filesystems/relayfs.txt for more info. | 143 | * See Documentation/filesystems/relay.txt for more info. |
144 | */ | 144 | */ |
145 | struct dentry *(*create_buf_file)(const char *filename, | 145 | struct dentry *(*create_buf_file)(const char *filename, |
146 | struct dentry *parent, | 146 | struct dentry *parent, |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 511f42fc6816..731af71cddc9 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -35,6 +35,10 @@ struct res_counter { | |||
35 | */ | 35 | */ |
36 | unsigned long long limit; | 36 | unsigned long long limit; |
37 | /* | 37 | /* |
38 | * the limit that usage can be exceed | ||
39 | */ | ||
40 | unsigned long long soft_limit; | ||
41 | /* | ||
38 | * the number of unsuccessful attempts to consume the resource | 42 | * the number of unsuccessful attempts to consume the resource |
39 | */ | 43 | */ |
40 | unsigned long long failcnt; | 44 | unsigned long long failcnt; |
@@ -87,6 +91,7 @@ enum { | |||
87 | RES_MAX_USAGE, | 91 | RES_MAX_USAGE, |
88 | RES_LIMIT, | 92 | RES_LIMIT, |
89 | RES_FAILCNT, | 93 | RES_FAILCNT, |
94 | RES_SOFT_LIMIT, | ||
90 | }; | 95 | }; |
91 | 96 | ||
92 | /* | 97 | /* |
@@ -109,7 +114,8 @@ void res_counter_init(struct res_counter *counter, struct res_counter *parent); | |||
109 | int __must_check res_counter_charge_locked(struct res_counter *counter, | 114 | int __must_check res_counter_charge_locked(struct res_counter *counter, |
110 | unsigned long val); | 115 | unsigned long val); |
111 | int __must_check res_counter_charge(struct res_counter *counter, | 116 | int __must_check res_counter_charge(struct res_counter *counter, |
112 | unsigned long val, struct res_counter **limit_fail_at); | 117 | unsigned long val, struct res_counter **limit_fail_at, |
118 | struct res_counter **soft_limit_at); | ||
113 | 119 | ||
114 | /* | 120 | /* |
115 | * uncharge - tell that some portion of the resource is released | 121 | * uncharge - tell that some portion of the resource is released |
@@ -122,7 +128,8 @@ int __must_check res_counter_charge(struct res_counter *counter, | |||
122 | */ | 128 | */ |
123 | 129 | ||
124 | void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val); | 130 | void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val); |
125 | void res_counter_uncharge(struct res_counter *counter, unsigned long val); | 131 | void res_counter_uncharge(struct res_counter *counter, unsigned long val, |
132 | bool *was_soft_limit_excess); | ||
126 | 133 | ||
127 | static inline bool res_counter_limit_check_locked(struct res_counter *cnt) | 134 | static inline bool res_counter_limit_check_locked(struct res_counter *cnt) |
128 | { | 135 | { |
@@ -132,6 +139,36 @@ static inline bool res_counter_limit_check_locked(struct res_counter *cnt) | |||
132 | return false; | 139 | return false; |
133 | } | 140 | } |
134 | 141 | ||
142 | static inline bool res_counter_soft_limit_check_locked(struct res_counter *cnt) | ||
143 | { | ||
144 | if (cnt->usage < cnt->soft_limit) | ||
145 | return true; | ||
146 | |||
147 | return false; | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * Get the difference between the usage and the soft limit | ||
152 | * @cnt: The counter | ||
153 | * | ||
154 | * Returns 0 if usage is less than or equal to soft limit | ||
155 | * The difference between usage and soft limit, otherwise. | ||
156 | */ | ||
157 | static inline unsigned long long | ||
158 | res_counter_soft_limit_excess(struct res_counter *cnt) | ||
159 | { | ||
160 | unsigned long long excess; | ||
161 | unsigned long flags; | ||
162 | |||
163 | spin_lock_irqsave(&cnt->lock, flags); | ||
164 | if (cnt->usage <= cnt->soft_limit) | ||
165 | excess = 0; | ||
166 | else | ||
167 | excess = cnt->usage - cnt->soft_limit; | ||
168 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
169 | return excess; | ||
170 | } | ||
171 | |||
135 | /* | 172 | /* |
136 | * Helper function to detect if the cgroup is within it's limit or | 173 | * Helper function to detect if the cgroup is within it's limit or |
137 | * not. It's currently called from cgroup_rss_prepare() | 174 | * not. It's currently called from cgroup_rss_prepare() |
@@ -147,6 +184,17 @@ static inline bool res_counter_check_under_limit(struct res_counter *cnt) | |||
147 | return ret; | 184 | return ret; |
148 | } | 185 | } |
149 | 186 | ||
187 | static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt) | ||
188 | { | ||
189 | bool ret; | ||
190 | unsigned long flags; | ||
191 | |||
192 | spin_lock_irqsave(&cnt->lock, flags); | ||
193 | ret = res_counter_soft_limit_check_locked(cnt); | ||
194 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
195 | return ret; | ||
196 | } | ||
197 | |||
150 | static inline void res_counter_reset_max(struct res_counter *cnt) | 198 | static inline void res_counter_reset_max(struct res_counter *cnt) |
151 | { | 199 | { |
152 | unsigned long flags; | 200 | unsigned long flags; |
@@ -180,4 +228,16 @@ static inline int res_counter_set_limit(struct res_counter *cnt, | |||
180 | return ret; | 228 | return ret; |
181 | } | 229 | } |
182 | 230 | ||
231 | static inline int | ||
232 | res_counter_set_soft_limit(struct res_counter *cnt, | ||
233 | unsigned long long soft_limit) | ||
234 | { | ||
235 | unsigned long flags; | ||
236 | |||
237 | spin_lock_irqsave(&cnt->lock, flags); | ||
238 | cnt->soft_limit = soft_limit; | ||
239 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
240 | return 0; | ||
241 | } | ||
242 | |||
183 | #endif | 243 | #endif |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 477841d29fce..cb0ba7032609 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -81,7 +81,19 @@ static inline void page_dup_rmap(struct page *page) | |||
81 | */ | 81 | */ |
82 | int page_referenced(struct page *, int is_locked, | 82 | int page_referenced(struct page *, int is_locked, |
83 | struct mem_cgroup *cnt, unsigned long *vm_flags); | 83 | struct mem_cgroup *cnt, unsigned long *vm_flags); |
84 | int try_to_unmap(struct page *, int ignore_refs); | 84 | enum ttu_flags { |
85 | TTU_UNMAP = 0, /* unmap mode */ | ||
86 | TTU_MIGRATION = 1, /* migration mode */ | ||
87 | TTU_MUNLOCK = 2, /* munlock mode */ | ||
88 | TTU_ACTION_MASK = 0xff, | ||
89 | |||
90 | TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */ | ||
91 | TTU_IGNORE_ACCESS = (1 << 9), /* don't age */ | ||
92 | TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */ | ||
93 | }; | ||
94 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) | ||
95 | |||
96 | int try_to_unmap(struct page *, enum ttu_flags flags); | ||
85 | 97 | ||
86 | /* | 98 | /* |
87 | * Called from mm/filemap_xip.c to unmap empty zero page | 99 | * Called from mm/filemap_xip.c to unmap empty zero page |
@@ -108,6 +120,13 @@ int page_mkclean(struct page *); | |||
108 | */ | 120 | */ |
109 | int try_to_munlock(struct page *); | 121 | int try_to_munlock(struct page *); |
110 | 122 | ||
123 | /* | ||
124 | * Called by memory-failure.c to kill processes. | ||
125 | */ | ||
126 | struct anon_vma *page_lock_anon_vma(struct page *page); | ||
127 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | ||
128 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | ||
129 | |||
111 | #else /* !CONFIG_MMU */ | 130 | #else /* !CONFIG_MMU */ |
112 | 131 | ||
113 | #define anon_vma_init() do {} while (0) | 132 | #define anon_vma_init() do {} while (0) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 97b10da0a3ea..75e6e60bf583 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -309,7 +309,7 @@ extern void softlockup_tick(void); | |||
309 | extern void touch_softlockup_watchdog(void); | 309 | extern void touch_softlockup_watchdog(void); |
310 | extern void touch_all_softlockup_watchdogs(void); | 310 | extern void touch_all_softlockup_watchdogs(void); |
311 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, | 311 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, |
312 | struct file *filp, void __user *buffer, | 312 | void __user *buffer, |
313 | size_t *lenp, loff_t *ppos); | 313 | size_t *lenp, loff_t *ppos); |
314 | extern unsigned int softlockup_panic; | 314 | extern unsigned int softlockup_panic; |
315 | extern int softlockup_thresh; | 315 | extern int softlockup_thresh; |
@@ -331,7 +331,7 @@ extern unsigned long sysctl_hung_task_check_count; | |||
331 | extern unsigned long sysctl_hung_task_timeout_secs; | 331 | extern unsigned long sysctl_hung_task_timeout_secs; |
332 | extern unsigned long sysctl_hung_task_warnings; | 332 | extern unsigned long sysctl_hung_task_warnings; |
333 | extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, | 333 | extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, |
334 | struct file *filp, void __user *buffer, | 334 | void __user *buffer, |
335 | size_t *lenp, loff_t *ppos); | 335 | size_t *lenp, loff_t *ppos); |
336 | #endif | 336 | #endif |
337 | 337 | ||
@@ -426,6 +426,15 @@ static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm) | |||
426 | return max(mm->hiwater_rss, get_mm_rss(mm)); | 426 | return max(mm->hiwater_rss, get_mm_rss(mm)); |
427 | } | 427 | } |
428 | 428 | ||
429 | static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, | ||
430 | struct mm_struct *mm) | ||
431 | { | ||
432 | unsigned long hiwater_rss = get_mm_hiwater_rss(mm); | ||
433 | |||
434 | if (*maxrss < hiwater_rss) | ||
435 | *maxrss = hiwater_rss; | ||
436 | } | ||
437 | |||
429 | static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) | 438 | static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) |
430 | { | 439 | { |
431 | return max(mm->hiwater_vm, mm->total_vm); | 440 | return max(mm->hiwater_vm, mm->total_vm); |
@@ -484,6 +493,13 @@ struct pacct_struct { | |||
484 | unsigned long ac_minflt, ac_majflt; | 493 | unsigned long ac_minflt, ac_majflt; |
485 | }; | 494 | }; |
486 | 495 | ||
496 | struct cpu_itimer { | ||
497 | cputime_t expires; | ||
498 | cputime_t incr; | ||
499 | u32 error; | ||
500 | u32 incr_error; | ||
501 | }; | ||
502 | |||
487 | /** | 503 | /** |
488 | * struct task_cputime - collected CPU time counts | 504 | * struct task_cputime - collected CPU time counts |
489 | * @utime: time spent in user mode, in &cputime_t units | 505 | * @utime: time spent in user mode, in &cputime_t units |
@@ -578,9 +594,12 @@ struct signal_struct { | |||
578 | struct pid *leader_pid; | 594 | struct pid *leader_pid; |
579 | ktime_t it_real_incr; | 595 | ktime_t it_real_incr; |
580 | 596 | ||
581 | /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ | 597 | /* |
582 | cputime_t it_prof_expires, it_virt_expires; | 598 | * ITIMER_PROF and ITIMER_VIRTUAL timers for the process, we use |
583 | cputime_t it_prof_incr, it_virt_incr; | 599 | * CPUCLOCK_PROF and CPUCLOCK_VIRT for indexing array as these |
600 | * values are defined to 0 and 1 respectively | ||
601 | */ | ||
602 | struct cpu_itimer it[2]; | ||
584 | 603 | ||
585 | /* | 604 | /* |
586 | * Thread group totals for process CPU timers. | 605 | * Thread group totals for process CPU timers. |
@@ -612,6 +631,7 @@ struct signal_struct { | |||
612 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 631 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
613 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; | 632 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; |
614 | unsigned long inblock, oublock, cinblock, coublock; | 633 | unsigned long inblock, oublock, cinblock, coublock; |
634 | unsigned long maxrss, cmaxrss; | ||
615 | struct task_io_accounting ioac; | 635 | struct task_io_accounting ioac; |
616 | 636 | ||
617 | /* | 637 | /* |
@@ -1251,7 +1271,6 @@ struct task_struct { | |||
1251 | struct mm_struct *mm, *active_mm; | 1271 | struct mm_struct *mm, *active_mm; |
1252 | 1272 | ||
1253 | /* task state */ | 1273 | /* task state */ |
1254 | struct linux_binfmt *binfmt; | ||
1255 | int exit_state; | 1274 | int exit_state; |
1256 | int exit_code, exit_signal; | 1275 | int exit_code, exit_signal; |
1257 | int pdeath_signal; /* The signal sent when the parent dies */ | 1276 | int pdeath_signal; /* The signal sent when the parent dies */ |
@@ -1519,6 +1538,7 @@ struct task_struct { | |||
1519 | /* bitmask of trace recursion */ | 1538 | /* bitmask of trace recursion */ |
1520 | unsigned long trace_recursion; | 1539 | unsigned long trace_recursion; |
1521 | #endif /* CONFIG_TRACING */ | 1540 | #endif /* CONFIG_TRACING */ |
1541 | unsigned long stack_start; | ||
1522 | }; | 1542 | }; |
1523 | 1543 | ||
1524 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1544 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
@@ -1714,6 +1734,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1714 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ | 1734 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ |
1715 | #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ | 1735 | #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ |
1716 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ | 1736 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ |
1737 | #define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */ | ||
1717 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ | 1738 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ |
1718 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1739 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |
1719 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ | 1740 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ |
@@ -1733,6 +1754,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1733 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ | 1754 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ |
1734 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ | 1755 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ |
1735 | #define PF_THREAD_BOUND 0x04000000 /* Thread bound to specific cpu */ | 1756 | #define PF_THREAD_BOUND 0x04000000 /* Thread bound to specific cpu */ |
1757 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ | ||
1736 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 1758 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
1737 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | 1759 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ |
1738 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ | 1760 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ |
@@ -1796,10 +1818,13 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p, | |||
1796 | return 0; | 1818 | return 0; |
1797 | } | 1819 | } |
1798 | #endif | 1820 | #endif |
1821 | |||
1822 | #ifndef CONFIG_CPUMASK_OFFSTACK | ||
1799 | static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | 1823 | static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) |
1800 | { | 1824 | { |
1801 | return set_cpus_allowed_ptr(p, &new_mask); | 1825 | return set_cpus_allowed_ptr(p, &new_mask); |
1802 | } | 1826 | } |
1827 | #endif | ||
1803 | 1828 | ||
1804 | /* | 1829 | /* |
1805 | * Architectures can set this to 1 if they have specified | 1830 | * Architectures can set this to 1 if they have specified |
@@ -1882,7 +1907,7 @@ extern unsigned int sysctl_sched_time_avg; | |||
1882 | extern unsigned int sysctl_timer_migration; | 1907 | extern unsigned int sysctl_timer_migration; |
1883 | 1908 | ||
1884 | int sched_nr_latency_handler(struct ctl_table *table, int write, | 1909 | int sched_nr_latency_handler(struct ctl_table *table, int write, |
1885 | struct file *file, void __user *buffer, size_t *length, | 1910 | void __user *buffer, size_t *length, |
1886 | loff_t *ppos); | 1911 | loff_t *ppos); |
1887 | #endif | 1912 | #endif |
1888 | #ifdef CONFIG_SCHED_DEBUG | 1913 | #ifdef CONFIG_SCHED_DEBUG |
@@ -1900,7 +1925,7 @@ extern unsigned int sysctl_sched_rt_period; | |||
1900 | extern int sysctl_sched_rt_runtime; | 1925 | extern int sysctl_sched_rt_runtime; |
1901 | 1926 | ||
1902 | int sched_rt_handler(struct ctl_table *table, int write, | 1927 | int sched_rt_handler(struct ctl_table *table, int write, |
1903 | struct file *filp, void __user *buffer, size_t *lenp, | 1928 | void __user *buffer, size_t *lenp, |
1904 | loff_t *ppos); | 1929 | loff_t *ppos); |
1905 | 1930 | ||
1906 | extern unsigned int sysctl_sched_compat_yield; | 1931 | extern unsigned int sysctl_sched_compat_yield; |
@@ -2035,6 +2060,7 @@ extern int kill_pgrp(struct pid *pid, int sig, int priv); | |||
2035 | extern int kill_pid(struct pid *pid, int sig, int priv); | 2060 | extern int kill_pid(struct pid *pid, int sig, int priv); |
2036 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 2061 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
2037 | extern int do_notify_parent(struct task_struct *, int); | 2062 | extern int do_notify_parent(struct task_struct *, int); |
2063 | extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); | ||
2038 | extern void force_sig(int, struct task_struct *); | 2064 | extern void force_sig(int, struct task_struct *); |
2039 | extern void force_sig_specific(int, struct task_struct *); | 2065 | extern void force_sig_specific(int, struct task_struct *); |
2040 | extern int send_sig(int, struct task_struct *, int); | 2066 | extern int send_sig(int, struct task_struct *, int); |
@@ -2312,7 +2338,10 @@ static inline int signal_pending(struct task_struct *p) | |||
2312 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); | 2338 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); |
2313 | } | 2339 | } |
2314 | 2340 | ||
2315 | extern int __fatal_signal_pending(struct task_struct *p); | 2341 | static inline int __fatal_signal_pending(struct task_struct *p) |
2342 | { | ||
2343 | return unlikely(sigismember(&p->pending.signal, SIGKILL)); | ||
2344 | } | ||
2316 | 2345 | ||
2317 | static inline int fatal_signal_pending(struct task_struct *p) | 2346 | static inline int fatal_signal_pending(struct task_struct *p) |
2318 | { | 2347 | { |
diff --git a/include/linux/security.h b/include/linux/security.h index d050b66ab9ef..239e40d0450b 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -133,7 +133,7 @@ static inline unsigned long round_hint_to_min(unsigned long hint) | |||
133 | return PAGE_ALIGN(mmap_min_addr); | 133 | return PAGE_ALIGN(mmap_min_addr); |
134 | return hint; | 134 | return hint; |
135 | } | 135 | } |
136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp, | 136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, |
137 | void __user *buffer, size_t *lenp, loff_t *ppos); | 137 | void __user *buffer, size_t *lenp, loff_t *ppos); |
138 | 138 | ||
139 | #ifdef CONFIG_SECURITY | 139 | #ifdef CONFIG_SECURITY |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index d58e460844dd..fe661afe0713 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -477,7 +477,7 @@ static inline int uart_handle_break(struct uart_port *port) | |||
477 | 477 | ||
478 | /** | 478 | /** |
479 | * uart_handle_dcd_change - handle a change of carrier detect state | 479 | * uart_handle_dcd_change - handle a change of carrier detect state |
480 | * @port: uart_port structure for the open port | 480 | * @uport: uart_port structure for the open port |
481 | * @status: new carrier detect status, nonzero if active | 481 | * @status: new carrier detect status, nonzero if active |
482 | */ | 482 | */ |
483 | static inline void | 483 | static inline void |
@@ -503,7 +503,7 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
503 | 503 | ||
504 | /** | 504 | /** |
505 | * uart_handle_cts_change - handle a change of clear-to-send state | 505 | * uart_handle_cts_change - handle a change of clear-to-send state |
506 | * @port: uart_port structure for the open port | 506 | * @uport: uart_port structure for the open port |
507 | * @status: new clear to send status, nonzero if active | 507 | * @status: new clear to send status, nonzero if active |
508 | */ | 508 | */ |
509 | static inline void | 509 | static inline void |
diff --git a/include/linux/sfi.h b/include/linux/sfi.h new file mode 100644 index 000000000000..9a6f7607174e --- /dev/null +++ b/include/linux/sfi.h | |||
@@ -0,0 +1,206 @@ | |||
1 | /* sfi.h Simple Firmware Interface */ | ||
2 | |||
3 | /* | ||
4 | |||
5 | This file is provided under a dual BSD/GPLv2 license. When using or | ||
6 | redistributing this file, you may do so under either license. | ||
7 | |||
8 | GPL LICENSE SUMMARY | ||
9 | |||
10 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify | ||
13 | it under the terms of version 2 of the GNU General Public License as | ||
14 | published by the Free Software Foundation. | ||
15 | |||
16 | This program is distributed in the hope that it will be useful, but | ||
17 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License | ||
22 | along with this program; if not, write to the Free Software | ||
23 | Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | The full GNU General Public License is included in this distribution | ||
25 | in the file called LICENSE.GPL. | ||
26 | |||
27 | BSD LICENSE | ||
28 | |||
29 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
30 | |||
31 | Redistribution and use in source and binary forms, with or without | ||
32 | modification, are permitted provided that the following conditions | ||
33 | are met: | ||
34 | |||
35 | * Redistributions of source code must retain the above copyright | ||
36 | notice, this list of conditions and the following disclaimer. | ||
37 | * Redistributions in binary form must reproduce the above copyright | ||
38 | notice, this list of conditions and the following disclaimer in | ||
39 | the documentation and/or other materials provided with the | ||
40 | distribution. | ||
41 | * Neither the name of Intel Corporation nor the names of its | ||
42 | contributors may be used to endorse or promote products derived | ||
43 | from this software without specific prior written permission. | ||
44 | |||
45 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
46 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
47 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
48 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
49 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
50 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
51 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
52 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
53 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
54 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
55 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
56 | |||
57 | */ | ||
58 | |||
59 | #ifndef _LINUX_SFI_H | ||
60 | #define _LINUX_SFI_H | ||
61 | |||
62 | /* Table signatures reserved by the SFI specification */ | ||
63 | #define SFI_SIG_SYST "SYST" | ||
64 | #define SFI_SIG_FREQ "FREQ" | ||
65 | #define SFI_SIG_IDLE "IDLE" | ||
66 | #define SFI_SIG_CPUS "CPUS" | ||
67 | #define SFI_SIG_MTMR "MTMR" | ||
68 | #define SFI_SIG_MRTC "MRTC" | ||
69 | #define SFI_SIG_MMAP "MMAP" | ||
70 | #define SFI_SIG_APIC "APIC" | ||
71 | #define SFI_SIG_XSDT "XSDT" | ||
72 | #define SFI_SIG_WAKE "WAKE" | ||
73 | #define SFI_SIG_SPIB "SPIB" | ||
74 | #define SFI_SIG_I2CB "I2CB" | ||
75 | #define SFI_SIG_GPEM "GPEM" | ||
76 | |||
77 | #define SFI_SIGNATURE_SIZE 4 | ||
78 | #define SFI_OEM_ID_SIZE 6 | ||
79 | #define SFI_OEM_TABLE_ID_SIZE 8 | ||
80 | |||
81 | #define SFI_SYST_SEARCH_BEGIN 0x000E0000 | ||
82 | #define SFI_SYST_SEARCH_END 0x000FFFFF | ||
83 | |||
84 | #define SFI_GET_NUM_ENTRIES(ptable, entry_type) \ | ||
85 | ((ptable->header.len - sizeof(struct sfi_table_header)) / \ | ||
86 | (sizeof(entry_type))) | ||
87 | /* | ||
88 | * Table structures must be byte-packed to match the SFI specification, | ||
89 | * as they are provided by the BIOS. | ||
90 | */ | ||
91 | struct sfi_table_header { | ||
92 | char sig[SFI_SIGNATURE_SIZE]; | ||
93 | u32 len; | ||
94 | u8 rev; | ||
95 | u8 csum; | ||
96 | char oem_id[SFI_OEM_ID_SIZE]; | ||
97 | char oem_table_id[SFI_OEM_TABLE_ID_SIZE]; | ||
98 | } __packed; | ||
99 | |||
100 | struct sfi_table_simple { | ||
101 | struct sfi_table_header header; | ||
102 | u64 pentry[1]; | ||
103 | } __packed; | ||
104 | |||
105 | /* Comply with UEFI spec 2.1 */ | ||
106 | struct sfi_mem_entry { | ||
107 | u32 type; | ||
108 | u64 phys_start; | ||
109 | u64 virt_start; | ||
110 | u64 pages; | ||
111 | u64 attrib; | ||
112 | } __packed; | ||
113 | |||
114 | struct sfi_cpu_table_entry { | ||
115 | u32 apic_id; | ||
116 | } __packed; | ||
117 | |||
118 | struct sfi_cstate_table_entry { | ||
119 | u32 hint; /* MWAIT hint */ | ||
120 | u32 latency; /* latency in ms */ | ||
121 | } __packed; | ||
122 | |||
123 | struct sfi_apic_table_entry { | ||
124 | u64 phys_addr; /* phy base addr for APIC reg */ | ||
125 | } __packed; | ||
126 | |||
127 | struct sfi_freq_table_entry { | ||
128 | u32 freq_mhz; /* in MHZ */ | ||
129 | u32 latency; /* transition latency in ms */ | ||
130 | u32 ctrl_val; /* value to write to PERF_CTL */ | ||
131 | } __packed; | ||
132 | |||
133 | struct sfi_wake_table_entry { | ||
134 | u64 phys_addr; /* pointer to where the wake vector locates */ | ||
135 | } __packed; | ||
136 | |||
137 | struct sfi_timer_table_entry { | ||
138 | u64 phys_addr; /* phy base addr for the timer */ | ||
139 | u32 freq_hz; /* in HZ */ | ||
140 | u32 irq; | ||
141 | } __packed; | ||
142 | |||
143 | struct sfi_rtc_table_entry { | ||
144 | u64 phys_addr; /* phy base addr for the RTC */ | ||
145 | u32 irq; | ||
146 | } __packed; | ||
147 | |||
148 | struct sfi_spi_table_entry { | ||
149 | u16 host_num; /* attached to host 0, 1...*/ | ||
150 | u16 cs; /* chip select */ | ||
151 | u16 irq_info; | ||
152 | char name[16]; | ||
153 | u8 dev_info[10]; | ||
154 | } __packed; | ||
155 | |||
156 | struct sfi_i2c_table_entry { | ||
157 | u16 host_num; | ||
158 | u16 addr; /* slave addr */ | ||
159 | u16 irq_info; | ||
160 | char name[16]; | ||
161 | u8 dev_info[10]; | ||
162 | } __packed; | ||
163 | |||
164 | struct sfi_gpe_table_entry { | ||
165 | u16 logical_id; /* logical id */ | ||
166 | u16 phys_id; /* physical GPE id */ | ||
167 | } __packed; | ||
168 | |||
169 | |||
170 | typedef int (*sfi_table_handler) (struct sfi_table_header *table); | ||
171 | |||
172 | #ifdef CONFIG_SFI | ||
173 | extern void __init sfi_init(void); | ||
174 | extern int __init sfi_platform_init(void); | ||
175 | extern void __init sfi_init_late(void); | ||
176 | extern int sfi_table_parse(char *signature, char *oem_id, char *oem_table_id, | ||
177 | sfi_table_handler handler); | ||
178 | |||
179 | extern int sfi_disabled; | ||
180 | static inline void disable_sfi(void) | ||
181 | { | ||
182 | sfi_disabled = 1; | ||
183 | } | ||
184 | |||
185 | #else /* !CONFIG_SFI */ | ||
186 | |||
187 | static inline void sfi_init(void) | ||
188 | { | ||
189 | } | ||
190 | |||
191 | static inline void sfi_init_late(void) | ||
192 | { | ||
193 | } | ||
194 | |||
195 | #define sfi_disabled 0 | ||
196 | |||
197 | static inline int sfi_table_parse(char *signature, char *oem_id, | ||
198 | char *oem_table_id, | ||
199 | sfi_table_handler handler) | ||
200 | { | ||
201 | return -1; | ||
202 | } | ||
203 | |||
204 | #endif /* !CONFIG_SFI */ | ||
205 | |||
206 | #endif /*_LINUX_SFI_H*/ | ||
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h new file mode 100644 index 000000000000..c4a5a8cd4469 --- /dev/null +++ b/include/linux/sfi_acpi.h | |||
@@ -0,0 +1,93 @@ | |||
1 | /* sfi.h Simple Firmware Interface */ | ||
2 | |||
3 | /* | ||
4 | |||
5 | This file is provided under a dual BSD/GPLv2 license. When using or | ||
6 | redistributing this file, you may do so under either license. | ||
7 | |||
8 | GPL LICENSE SUMMARY | ||
9 | |||
10 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify | ||
13 | it under the terms of version 2 of the GNU General Public License as | ||
14 | published by the Free Software Foundation. | ||
15 | |||
16 | This program is distributed in the hope that it will be useful, but | ||
17 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License | ||
22 | along with this program; if not, write to the Free Software | ||
23 | Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | The full GNU General Public License is included in this distribution | ||
25 | in the file called LICENSE.GPL. | ||
26 | |||
27 | BSD LICENSE | ||
28 | |||
29 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
30 | |||
31 | Redistribution and use in source and binary forms, with or without | ||
32 | modification, are permitted provided that the following conditions | ||
33 | are met: | ||
34 | |||
35 | * Redistributions of source code must retain the above copyright | ||
36 | notice, this list of conditions and the following disclaimer. | ||
37 | * Redistributions in binary form must reproduce the above copyright | ||
38 | notice, this list of conditions and the following disclaimer in | ||
39 | the documentation and/or other materials provided with the | ||
40 | distribution. | ||
41 | * Neither the name of Intel Corporation nor the names of its | ||
42 | contributors may be used to endorse or promote products derived | ||
43 | from this software without specific prior written permission. | ||
44 | |||
45 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
46 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
47 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
48 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
49 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
50 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
51 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
52 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
53 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
54 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
55 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
56 | |||
57 | */ | ||
58 | |||
59 | #ifndef _LINUX_SFI_ACPI_H | ||
60 | #define _LINUX_SFI_ACPI_H | ||
61 | |||
62 | #ifdef CONFIG_SFI | ||
63 | #include <acpi/acpi.h> /* struct acpi_table_header */ | ||
64 | |||
65 | extern int sfi_acpi_table_parse(char *signature, char *oem_id, | ||
66 | char *oem_table_id, | ||
67 | int (*handler)(struct acpi_table_header *)); | ||
68 | |||
69 | static inline int acpi_sfi_table_parse(char *signature, | ||
70 | int (*handler)(struct acpi_table_header *)) | ||
71 | { | ||
72 | if (!acpi_table_parse(signature, handler)) | ||
73 | return 0; | ||
74 | |||
75 | return sfi_acpi_table_parse(signature, NULL, NULL, handler); | ||
76 | } | ||
77 | #else /* !CONFIG_SFI */ | ||
78 | |||
79 | static inline int sfi_acpi_table_parse(char *signature, char *oem_id, | ||
80 | char *oem_table_id, | ||
81 | int (*handler)(struct acpi_table_header *)) | ||
82 | { | ||
83 | return -1; | ||
84 | } | ||
85 | |||
86 | static inline int acpi_sfi_table_parse(char *signature, | ||
87 | int (*handler)(struct acpi_table_header *)) | ||
88 | { | ||
89 | return acpi_table_parse(signature, handler); | ||
90 | } | ||
91 | #endif /* !CONFIG_SFI */ | ||
92 | |||
93 | #endif /*_LINUX_SFI_ACPI_H*/ | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index c7552836bd95..ab9272cc270c 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -233,6 +233,8 @@ static inline int valid_signal(unsigned long sig) | |||
233 | } | 233 | } |
234 | 234 | ||
235 | extern int next_signal(struct sigpending *pending, sigset_t *mask); | 235 | extern int next_signal(struct sigpending *pending, sigset_t *mask); |
236 | extern int do_send_sig_info(int sig, struct siginfo *info, | ||
237 | struct task_struct *p, bool group); | ||
236 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); | 238 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); |
237 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | 239 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); |
238 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, | 240 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 9e3d8af09207..39c64bae776d 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -73,15 +73,6 @@ int smp_call_function(void(*func)(void *info), void *info, int wait); | |||
73 | void smp_call_function_many(const struct cpumask *mask, | 73 | void smp_call_function_many(const struct cpumask *mask, |
74 | void (*func)(void *info), void *info, bool wait); | 74 | void (*func)(void *info), void *info, bool wait); |
75 | 75 | ||
76 | /* Deprecated: Use smp_call_function_many which takes a pointer to the mask. */ | ||
77 | static inline int | ||
78 | smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, | ||
79 | int wait) | ||
80 | { | ||
81 | smp_call_function_many(&mask, func, info, wait); | ||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | void __smp_call_function_single(int cpuid, struct call_single_data *data, | 76 | void __smp_call_function_single(int cpuid, struct call_single_data *data, |
86 | int wait); | 77 | int wait); |
87 | 78 | ||
@@ -144,8 +135,6 @@ static inline int up_smp_call_function(void (*func)(void *), void *info) | |||
144 | static inline void smp_send_reschedule(int cpu) { } | 135 | static inline void smp_send_reschedule(int cpu) { } |
145 | #define num_booting_cpus() 1 | 136 | #define num_booting_cpus() 1 |
146 | #define smp_prepare_boot_cpu() do {} while (0) | 137 | #define smp_prepare_boot_cpu() do {} while (0) |
147 | #define smp_call_function_mask(mask, func, info, wait) \ | ||
148 | (up_smp_call_function(func, info)) | ||
149 | #define smp_call_function_many(mask, func, info, wait) \ | 138 | #define smp_call_function_many(mask, func, info, wait) \ |
150 | (up_smp_call_function(func, info)) | 139 | (up_smp_call_function(func, info)) |
151 | static inline void init_call_single_data(void) | 140 | static inline void init_call_single_data(void) |
diff --git a/include/linux/spi/mc33880.h b/include/linux/spi/mc33880.h new file mode 100644 index 000000000000..82ffccd6fbe5 --- /dev/null +++ b/include/linux/spi/mc33880.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef LINUX_SPI_MC33880_H | ||
2 | #define LINUX_SPI_MC33880_H | ||
3 | |||
4 | struct mc33880_platform_data { | ||
5 | /* number assigned to the first GPIO */ | ||
6 | unsigned base; | ||
7 | }; | ||
8 | |||
9 | #endif | ||
10 | |||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index c47c4b4da97e..97b60b37f445 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #define __LINUX_SPI_H | 20 | #define __LINUX_SPI_H |
21 | 21 | ||
22 | #include <linux/device.h> | 22 | #include <linux/device.h> |
23 | #include <linux/mod_devicetable.h> | ||
23 | 24 | ||
24 | /* | 25 | /* |
25 | * INTERFACES between SPI master-side drivers and SPI infrastructure. | 26 | * INTERFACES between SPI master-side drivers and SPI infrastructure. |
@@ -86,7 +87,7 @@ struct spi_device { | |||
86 | int irq; | 87 | int irq; |
87 | void *controller_state; | 88 | void *controller_state; |
88 | void *controller_data; | 89 | void *controller_data; |
89 | char modalias[32]; | 90 | char modalias[SPI_NAME_SIZE]; |
90 | 91 | ||
91 | /* | 92 | /* |
92 | * likely need more hooks for more protocol options affecting how | 93 | * likely need more hooks for more protocol options affecting how |
@@ -145,6 +146,7 @@ struct spi_message; | |||
145 | 146 | ||
146 | /** | 147 | /** |
147 | * struct spi_driver - Host side "protocol" driver | 148 | * struct spi_driver - Host side "protocol" driver |
149 | * @id_table: List of SPI devices supported by this driver | ||
148 | * @probe: Binds this driver to the spi device. Drivers can verify | 150 | * @probe: Binds this driver to the spi device. Drivers can verify |
149 | * that the device is actually present, and may need to configure | 151 | * that the device is actually present, and may need to configure |
150 | * characteristics (such as bits_per_word) which weren't needed for | 152 | * characteristics (such as bits_per_word) which weren't needed for |
@@ -170,6 +172,7 @@ struct spi_message; | |||
170 | * MMC, RTC, filesystem character device nodes, and hardware monitoring. | 172 | * MMC, RTC, filesystem character device nodes, and hardware monitoring. |
171 | */ | 173 | */ |
172 | struct spi_driver { | 174 | struct spi_driver { |
175 | const struct spi_device_id *id_table; | ||
173 | int (*probe)(struct spi_device *spi); | 176 | int (*probe)(struct spi_device *spi); |
174 | int (*remove)(struct spi_device *spi); | 177 | int (*remove)(struct spi_device *spi); |
175 | void (*shutdown)(struct spi_device *spi); | 178 | void (*shutdown)(struct spi_device *spi); |
@@ -207,6 +210,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
207 | * each slave has a chipselect signal, but it's common that not | 210 | * each slave has a chipselect signal, but it's common that not |
208 | * every chipselect is connected to a slave. | 211 | * every chipselect is connected to a slave. |
209 | * @dma_alignment: SPI controller constraint on DMA buffers alignment. | 212 | * @dma_alignment: SPI controller constraint on DMA buffers alignment. |
213 | * @mode_bits: flags understood by this controller driver | ||
214 | * @flags: other constraints relevant to this driver | ||
210 | * @setup: updates the device mode and clocking records used by a | 215 | * @setup: updates the device mode and clocking records used by a |
211 | * device's SPI controller; protocol code may call this. This | 216 | * device's SPI controller; protocol code may call this. This |
212 | * must fail if an unrecognized or unsupported mode is requested. | 217 | * must fail if an unrecognized or unsupported mode is requested. |
@@ -253,6 +258,8 @@ struct spi_master { | |||
253 | /* other constraints relevant to this driver */ | 258 | /* other constraints relevant to this driver */ |
254 | u16 flags; | 259 | u16 flags; |
255 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ | 260 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ |
261 | #define SPI_MASTER_NO_RX BIT(1) /* can't do buffer read */ | ||
262 | #define SPI_MASTER_NO_TX BIT(2) /* can't do buffer write */ | ||
256 | 263 | ||
257 | /* Setup mode and clock, etc (spi driver may call many times). | 264 | /* Setup mode and clock, etc (spi driver may call many times). |
258 | * | 265 | * |
@@ -533,42 +540,7 @@ static inline void spi_message_free(struct spi_message *m) | |||
533 | } | 540 | } |
534 | 541 | ||
535 | extern int spi_setup(struct spi_device *spi); | 542 | extern int spi_setup(struct spi_device *spi); |
536 | 543 | extern int spi_async(struct spi_device *spi, struct spi_message *message); | |
537 | /** | ||
538 | * spi_async - asynchronous SPI transfer | ||
539 | * @spi: device with which data will be exchanged | ||
540 | * @message: describes the data transfers, including completion callback | ||
541 | * Context: any (irqs may be blocked, etc) | ||
542 | * | ||
543 | * This call may be used in_irq and other contexts which can't sleep, | ||
544 | * as well as from task contexts which can sleep. | ||
545 | * | ||
546 | * The completion callback is invoked in a context which can't sleep. | ||
547 | * Before that invocation, the value of message->status is undefined. | ||
548 | * When the callback is issued, message->status holds either zero (to | ||
549 | * indicate complete success) or a negative error code. After that | ||
550 | * callback returns, the driver which issued the transfer request may | ||
551 | * deallocate the associated memory; it's no longer in use by any SPI | ||
552 | * core or controller driver code. | ||
553 | * | ||
554 | * Note that although all messages to a spi_device are handled in | ||
555 | * FIFO order, messages may go to different devices in other orders. | ||
556 | * Some device might be higher priority, or have various "hard" access | ||
557 | * time requirements, for example. | ||
558 | * | ||
559 | * On detection of any fault during the transfer, processing of | ||
560 | * the entire message is aborted, and the device is deselected. | ||
561 | * Until returning from the associated message completion callback, | ||
562 | * no other spi_message queued to that device will be processed. | ||
563 | * (This rule applies equally to all the synchronous transfer calls, | ||
564 | * which are wrappers around this core asynchronous primitive.) | ||
565 | */ | ||
566 | static inline int | ||
567 | spi_async(struct spi_device *spi, struct spi_message *message) | ||
568 | { | ||
569 | message->spi = spi; | ||
570 | return spi->master->transfer(spi, message); | ||
571 | } | ||
572 | 544 | ||
573 | /*---------------------------------------------------------------------------*/ | 545 | /*---------------------------------------------------------------------------*/ |
574 | 546 | ||
@@ -732,7 +704,7 @@ struct spi_board_info { | |||
732 | * controller_data goes to spi_device.controller_data, | 704 | * controller_data goes to spi_device.controller_data, |
733 | * irq is copied too | 705 | * irq is copied too |
734 | */ | 706 | */ |
735 | char modalias[32]; | 707 | char modalias[SPI_NAME_SIZE]; |
736 | const void *platform_data; | 708 | const void *platform_data; |
737 | void *controller_data; | 709 | void *controller_data; |
738 | int irq; | 710 | int irq; |
@@ -800,4 +772,7 @@ spi_unregister_device(struct spi_device *spi) | |||
800 | device_unregister(&spi->dev); | 772 | device_unregister(&spi->dev); |
801 | } | 773 | } |
802 | 774 | ||
775 | extern const struct spi_device_id * | ||
776 | spi_get_device_id(const struct spi_device *sdev); | ||
777 | |||
803 | #endif /* __LINUX_SPI_H */ | 778 | #endif /* __LINUX_SPI_H */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 7da466ba4b0d..f5cc0898bc53 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/uio.h> | 12 | #include <linux/uio.h> |
13 | #include <asm/byteorder.h> | 13 | #include <asm/byteorder.h> |
14 | #include <asm/unaligned.h> | ||
14 | #include <linux/scatterlist.h> | 15 | #include <linux/scatterlist.h> |
15 | 16 | ||
16 | /* | 17 | /* |
@@ -117,14 +118,14 @@ static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int le | |||
117 | static inline __be32 * | 118 | static inline __be32 * |
118 | xdr_encode_hyper(__be32 *p, __u64 val) | 119 | xdr_encode_hyper(__be32 *p, __u64 val) |
119 | { | 120 | { |
120 | *(__be64 *)p = cpu_to_be64(val); | 121 | put_unaligned_be64(val, p); |
121 | return p + 2; | 122 | return p + 2; |
122 | } | 123 | } |
123 | 124 | ||
124 | static inline __be32 * | 125 | static inline __be32 * |
125 | xdr_decode_hyper(__be32 *p, __u64 *valp) | 126 | xdr_decode_hyper(__be32 *p, __u64 *valp) |
126 | { | 127 | { |
127 | *valp = be64_to_cpup((__be64 *)p); | 128 | *valp = get_unaligned_be64(p); |
128 | return p + 2; | 129 | return p + 2; |
129 | } | 130 | } |
130 | 131 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index 6c990e658f4e..4ec90019c1a4 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -34,16 +34,38 @@ static inline int current_is_kswapd(void) | |||
34 | * the type/offset into the pte as 5/27 as well. | 34 | * the type/offset into the pte as 5/27 as well. |
35 | */ | 35 | */ |
36 | #define MAX_SWAPFILES_SHIFT 5 | 36 | #define MAX_SWAPFILES_SHIFT 5 |
37 | #ifndef CONFIG_MIGRATION | 37 | |
38 | #define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) | 38 | /* |
39 | * Use some of the swap files numbers for other purposes. This | ||
40 | * is a convenient way to hook into the VM to trigger special | ||
41 | * actions on faults. | ||
42 | */ | ||
43 | |||
44 | /* | ||
45 | * NUMA node memory migration support | ||
46 | */ | ||
47 | #ifdef CONFIG_MIGRATION | ||
48 | #define SWP_MIGRATION_NUM 2 | ||
49 | #define SWP_MIGRATION_READ (MAX_SWAPFILES + SWP_HWPOISON_NUM) | ||
50 | #define SWP_MIGRATION_WRITE (MAX_SWAPFILES + SWP_HWPOISON_NUM + 1) | ||
39 | #else | 51 | #else |
40 | /* Use last two entries for page migration swap entries */ | 52 | #define SWP_MIGRATION_NUM 0 |
41 | #define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2) | ||
42 | #define SWP_MIGRATION_READ MAX_SWAPFILES | ||
43 | #define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1) | ||
44 | #endif | 53 | #endif |
45 | 54 | ||
46 | /* | 55 | /* |
56 | * Handling of hardware poisoned pages with memory corruption. | ||
57 | */ | ||
58 | #ifdef CONFIG_MEMORY_FAILURE | ||
59 | #define SWP_HWPOISON_NUM 1 | ||
60 | #define SWP_HWPOISON MAX_SWAPFILES | ||
61 | #else | ||
62 | #define SWP_HWPOISON_NUM 0 | ||
63 | #endif | ||
64 | |||
65 | #define MAX_SWAPFILES \ | ||
66 | ((1 << MAX_SWAPFILES_SHIFT) - SWP_MIGRATION_NUM - SWP_HWPOISON_NUM) | ||
67 | |||
68 | /* | ||
47 | * Magic header for a swap area. The first part of the union is | 69 | * Magic header for a swap area. The first part of the union is |
48 | * what the swap magic looks like for the old (limited to 128MB) | 70 | * what the swap magic looks like for the old (limited to 128MB) |
49 | * swap area format, the second part of the union adds - in the | 71 | * swap area format, the second part of the union adds - in the |
@@ -217,6 +239,11 @@ extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | |||
217 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | 239 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, |
218 | gfp_t gfp_mask, bool noswap, | 240 | gfp_t gfp_mask, bool noswap, |
219 | unsigned int swappiness); | 241 | unsigned int swappiness); |
242 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | ||
243 | gfp_t gfp_mask, bool noswap, | ||
244 | unsigned int swappiness, | ||
245 | struct zone *zone, | ||
246 | int nid); | ||
220 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 247 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
221 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 248 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
222 | extern int vm_swappiness; | 249 | extern int vm_swappiness; |
@@ -240,7 +267,7 @@ extern int page_evictable(struct page *page, struct vm_area_struct *vma); | |||
240 | extern void scan_mapping_unevictable_pages(struct address_space *); | 267 | extern void scan_mapping_unevictable_pages(struct address_space *); |
241 | 268 | ||
242 | extern unsigned long scan_unevictable_pages; | 269 | extern unsigned long scan_unevictable_pages; |
243 | extern int scan_unevictable_handler(struct ctl_table *, int, struct file *, | 270 | extern int scan_unevictable_handler(struct ctl_table *, int, |
244 | void __user *, size_t *, loff_t *); | 271 | void __user *, size_t *, loff_t *); |
245 | extern int scan_unevictable_register_node(struct node *node); | 272 | extern int scan_unevictable_register_node(struct node *node); |
246 | extern void scan_unevictable_unregister_node(struct node *node); | 273 | extern void scan_unevictable_unregister_node(struct node *node); |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 6ec39ab27b4b..cd42e30b7c6e 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -131,3 +131,41 @@ static inline int is_write_migration_entry(swp_entry_t entry) | |||
131 | 131 | ||
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | #ifdef CONFIG_MEMORY_FAILURE | ||
135 | /* | ||
136 | * Support for hardware poisoned pages | ||
137 | */ | ||
138 | static inline swp_entry_t make_hwpoison_entry(struct page *page) | ||
139 | { | ||
140 | BUG_ON(!PageLocked(page)); | ||
141 | return swp_entry(SWP_HWPOISON, page_to_pfn(page)); | ||
142 | } | ||
143 | |||
144 | static inline int is_hwpoison_entry(swp_entry_t entry) | ||
145 | { | ||
146 | return swp_type(entry) == SWP_HWPOISON; | ||
147 | } | ||
148 | #else | ||
149 | |||
150 | static inline swp_entry_t make_hwpoison_entry(struct page *page) | ||
151 | { | ||
152 | return swp_entry(0, 0); | ||
153 | } | ||
154 | |||
155 | static inline int is_hwpoison_entry(swp_entry_t swp) | ||
156 | { | ||
157 | return 0; | ||
158 | } | ||
159 | #endif | ||
160 | |||
161 | #if defined(CONFIG_MEMORY_FAILURE) || defined(CONFIG_MIGRATION) | ||
162 | static inline int non_swap_entry(swp_entry_t entry) | ||
163 | { | ||
164 | return swp_type(entry) >= MAX_SWAPFILES; | ||
165 | } | ||
166 | #else | ||
167 | static inline int non_swap_entry(swp_entry_t entry) | ||
168 | { | ||
169 | return 0; | ||
170 | } | ||
171 | #endif | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 8d8285a10db9..a990ace1a838 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -460,8 +460,7 @@ asmlinkage long sys_mount(char __user *dev_name, char __user *dir_name, | |||
460 | void __user *data); | 460 | void __user *data); |
461 | asmlinkage long sys_umount(char __user *name, int flags); | 461 | asmlinkage long sys_umount(char __user *name, int flags); |
462 | asmlinkage long sys_oldumount(char __user *name); | 462 | asmlinkage long sys_oldumount(char __user *name); |
463 | asmlinkage long sys_truncate(const char __user *path, | 463 | asmlinkage long sys_truncate(const char __user *path, long length); |
464 | unsigned long length); | ||
465 | asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); | 464 | asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); |
466 | asmlinkage long sys_stat(char __user *filename, | 465 | asmlinkage long sys_stat(char __user *filename, |
467 | struct __old_kernel_stat __user *statbuf); | 466 | struct __old_kernel_stat __user *statbuf); |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index e76d3b22a466..1e4743ee6831 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #include <linux/compiler.h> | 30 | #include <linux/compiler.h> |
31 | 31 | ||
32 | struct file; | ||
33 | struct completion; | 32 | struct completion; |
34 | 33 | ||
35 | #define CTL_MAXNAME 10 /* how many path components do we allow in a | 34 | #define CTL_MAXNAME 10 /* how many path components do we allow in a |
@@ -977,25 +976,25 @@ typedef int ctl_handler (struct ctl_table *table, | |||
977 | void __user *oldval, size_t __user *oldlenp, | 976 | void __user *oldval, size_t __user *oldlenp, |
978 | void __user *newval, size_t newlen); | 977 | void __user *newval, size_t newlen); |
979 | 978 | ||
980 | typedef int proc_handler (struct ctl_table *ctl, int write, struct file * filp, | 979 | typedef int proc_handler (struct ctl_table *ctl, int write, |
981 | void __user *buffer, size_t *lenp, loff_t *ppos); | 980 | void __user *buffer, size_t *lenp, loff_t *ppos); |
982 | 981 | ||
983 | extern int proc_dostring(struct ctl_table *, int, struct file *, | 982 | extern int proc_dostring(struct ctl_table *, int, |
984 | void __user *, size_t *, loff_t *); | 983 | void __user *, size_t *, loff_t *); |
985 | extern int proc_dointvec(struct ctl_table *, int, struct file *, | 984 | extern int proc_dointvec(struct ctl_table *, int, |
986 | void __user *, size_t *, loff_t *); | 985 | void __user *, size_t *, loff_t *); |
987 | extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *, | 986 | extern int proc_dointvec_minmax(struct ctl_table *, int, |
988 | void __user *, size_t *, loff_t *); | 987 | void __user *, size_t *, loff_t *); |
989 | extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *, | 988 | extern int proc_dointvec_jiffies(struct ctl_table *, int, |
990 | void __user *, size_t *, loff_t *); | 989 | void __user *, size_t *, loff_t *); |
991 | extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int, struct file *, | 990 | extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int, |
992 | void __user *, size_t *, loff_t *); | 991 | void __user *, size_t *, loff_t *); |
993 | extern int proc_dointvec_ms_jiffies(struct ctl_table *, int, struct file *, | 992 | extern int proc_dointvec_ms_jiffies(struct ctl_table *, int, |
994 | void __user *, size_t *, loff_t *); | 993 | void __user *, size_t *, loff_t *); |
995 | extern int proc_doulongvec_minmax(struct ctl_table *, int, struct file *, | 994 | extern int proc_doulongvec_minmax(struct ctl_table *, int, |
996 | void __user *, size_t *, loff_t *); | 995 | void __user *, size_t *, loff_t *); |
997 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, | 996 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, |
998 | struct file *, void __user *, size_t *, loff_t *); | 997 | void __user *, size_t *, loff_t *); |
999 | 998 | ||
1000 | extern int do_sysctl (int __user *name, int nlen, | 999 | extern int do_sysctl (int __user *name, int nlen, |
1001 | void __user *oldval, size_t __user *oldlenp, | 1000 | void __user *oldval, size_t __user *oldlenp, |
diff --git a/include/linux/time.h b/include/linux/time.h index 56787c093345..fe04e5ef6a59 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -155,6 +155,34 @@ extern void timekeeping_leap_insert(int leapsecond); | |||
155 | struct tms; | 155 | struct tms; |
156 | extern void do_sys_times(struct tms *); | 156 | extern void do_sys_times(struct tms *); |
157 | 157 | ||
158 | /* | ||
159 | * Similar to the struct tm in userspace <time.h>, but it needs to be here so | ||
160 | * that the kernel source is self contained. | ||
161 | */ | ||
162 | struct tm { | ||
163 | /* | ||
164 | * the number of seconds after the minute, normally in the range | ||
165 | * 0 to 59, but can be up to 60 to allow for leap seconds | ||
166 | */ | ||
167 | int tm_sec; | ||
168 | /* the number of minutes after the hour, in the range 0 to 59*/ | ||
169 | int tm_min; | ||
170 | /* the number of hours past midnight, in the range 0 to 23 */ | ||
171 | int tm_hour; | ||
172 | /* the day of the month, in the range 1 to 31 */ | ||
173 | int tm_mday; | ||
174 | /* the number of months since January, in the range 0 to 11 */ | ||
175 | int tm_mon; | ||
176 | /* the number of years since 1900 */ | ||
177 | long tm_year; | ||
178 | /* the number of days since Sunday, in the range 0 to 6 */ | ||
179 | int tm_wday; | ||
180 | /* the number of days since January 1, in the range 0 to 365 */ | ||
181 | int tm_yday; | ||
182 | }; | ||
183 | |||
184 | void time_to_tm(time_t totalsecs, int offset, struct tm *result); | ||
185 | |||
158 | /** | 186 | /** |
159 | * timespec_to_ns - Convert timespec to nanoseconds | 187 | * timespec_to_ns - Convert timespec to nanoseconds |
160 | * @ts: pointer to the timespec variable to be converted | 188 | * @ts: pointer to the timespec variable to be converted |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 809b26c07090..fc0bf3edeb67 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -211,12 +211,6 @@ int arch_update_cpu_topology(void); | |||
211 | #ifndef topology_core_id | 211 | #ifndef topology_core_id |
212 | #define topology_core_id(cpu) ((void)(cpu), 0) | 212 | #define topology_core_id(cpu) ((void)(cpu), 0) |
213 | #endif | 213 | #endif |
214 | #ifndef topology_thread_siblings | ||
215 | #define topology_thread_siblings(cpu) cpumask_of_cpu(cpu) | ||
216 | #endif | ||
217 | #ifndef topology_core_siblings | ||
218 | #define topology_core_siblings(cpu) cpumask_of_cpu(cpu) | ||
219 | #endif | ||
220 | #ifndef topology_thread_cpumask | 214 | #ifndef topology_thread_cpumask |
221 | #define topology_thread_cpumask(cpu) cpumask_of(cpu) | 215 | #define topology_thread_cpumask(cpu) cpumask_of(cpu) |
222 | #endif | 216 | #endif |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 17ba82efa483..1eb44a924e56 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Tracing hooks | 2 | * Tracing hooks |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | 4 | * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. |
5 | * | 5 | * |
6 | * This copyrighted material is made available to anyone wishing to use, | 6 | * This copyrighted material is made available to anyone wishing to use, |
7 | * modify, copy, or redistribute it subject to the terms and conditions | 7 | * modify, copy, or redistribute it subject to the terms and conditions |
@@ -463,22 +463,38 @@ static inline int tracehook_get_signal(struct task_struct *task, | |||
463 | 463 | ||
464 | /** | 464 | /** |
465 | * tracehook_notify_jctl - report about job control stop/continue | 465 | * tracehook_notify_jctl - report about job control stop/continue |
466 | * @notify: nonzero if this is the last thread in the group to stop | 466 | * @notify: zero, %CLD_STOPPED or %CLD_CONTINUED |
467 | * @why: %CLD_STOPPED or %CLD_CONTINUED | 467 | * @why: %CLD_STOPPED or %CLD_CONTINUED |
468 | * | 468 | * |
469 | * This is called when we might call do_notify_parent_cldstop(). | 469 | * This is called when we might call do_notify_parent_cldstop(). |
470 | * It's called when about to stop for job control; we are already in | ||
471 | * %TASK_STOPPED state, about to call schedule(). It's also called when | ||
472 | * a delayed %CLD_STOPPED or %CLD_CONTINUED report is ready to be made. | ||
473 | * | 470 | * |
474 | * Return nonzero to generate a %SIGCHLD with @why, which is | 471 | * @notify is zero if we would not ordinarily send a %SIGCHLD, |
475 | * normal if @notify is nonzero. | 472 | * or is the %CLD_STOPPED or %CLD_CONTINUED .si_code for %SIGCHLD. |
476 | * | 473 | * |
477 | * Called with no locks held. | 474 | * @why is %CLD_STOPPED when about to stop for job control; |
475 | * we are already in %TASK_STOPPED state, about to call schedule(). | ||
476 | * It might also be that we have just exited (check %PF_EXITING), | ||
477 | * but need to report that a group-wide stop is complete. | ||
478 | * | ||
479 | * @why is %CLD_CONTINUED when waking up after job control stop and | ||
480 | * ready to make a delayed @notify report. | ||
481 | * | ||
482 | * Return the %CLD_* value for %SIGCHLD, or zero to generate no signal. | ||
483 | * | ||
484 | * Called with the siglock held. | ||
478 | */ | 485 | */ |
479 | static inline int tracehook_notify_jctl(int notify, int why) | 486 | static inline int tracehook_notify_jctl(int notify, int why) |
480 | { | 487 | { |
481 | return notify || (current->ptrace & PT_PTRACED); | 488 | return notify ?: (current->ptrace & PT_PTRACED) ? why : 0; |
489 | } | ||
490 | |||
491 | /** | ||
492 | * tracehook_finish_jctl - report about return from job control stop | ||
493 | * | ||
494 | * This is called by do_signal_stop() after wakeup. | ||
495 | */ | ||
496 | static inline void tracehook_finish_jctl(void) | ||
497 | { | ||
482 | } | 498 | } |
483 | 499 | ||
484 | #define DEATH_REAP -1 | 500 | #define DEATH_REAP -1 |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 63a3f7a80580..660a9de96f81 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -4,7 +4,7 @@ | |||
4 | /* | 4 | /* |
5 | * Kernel Tracepoint API. | 5 | * Kernel Tracepoint API. |
6 | * | 6 | * |
7 | * See Documentation/tracepoint.txt. | 7 | * See Documentation/trace/tracepoints.txt. |
8 | * | 8 | * |
9 | * (C) Copyright 2008 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 9 | * (C) Copyright 2008 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
10 | * | 10 | * |
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index ae779bb8cc0f..adb44066680c 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <sound/ac97_codec.h> | 26 | #include <sound/ac97_codec.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/gpio.h> | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * UCB1400 AC-link registers | 32 | * UCB1400 AC-link registers |
@@ -82,6 +83,17 @@ | |||
82 | #define UCB_ID 0x7e | 83 | #define UCB_ID 0x7e |
83 | #define UCB_ID_1400 0x4304 | 84 | #define UCB_ID_1400 0x4304 |
84 | 85 | ||
86 | struct ucb1400_gpio_data { | ||
87 | int gpio_offset; | ||
88 | int (*gpio_setup)(struct device *dev, int ngpio); | ||
89 | int (*gpio_teardown)(struct device *dev, int ngpio); | ||
90 | }; | ||
91 | |||
92 | struct ucb1400_gpio { | ||
93 | struct gpio_chip gc; | ||
94 | struct snd_ac97 *ac97; | ||
95 | }; | ||
96 | |||
85 | struct ucb1400_ts { | 97 | struct ucb1400_ts { |
86 | struct input_dev *ts_idev; | 98 | struct input_dev *ts_idev; |
87 | struct task_struct *ts_task; | 99 | struct task_struct *ts_task; |
@@ -95,6 +107,7 @@ struct ucb1400_ts { | |||
95 | 107 | ||
96 | struct ucb1400 { | 108 | struct ucb1400 { |
97 | struct platform_device *ucb1400_ts; | 109 | struct platform_device *ucb1400_ts; |
110 | struct platform_device *ucb1400_gpio; | ||
98 | }; | 111 | }; |
99 | 112 | ||
100 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) | 113 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) |
@@ -147,4 +160,10 @@ static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) | |||
147 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, | 160 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, |
148 | int adcsync); | 161 | int adcsync); |
149 | 162 | ||
163 | #ifdef CONFIG_GPIO_UCB1400 | ||
164 | void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data); | ||
165 | #else | ||
166 | static inline void ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) {} | ||
167 | #endif | ||
168 | |||
150 | #endif | 169 | #endif |
diff --git a/include/linux/unaligned/be_byteshift.h b/include/linux/unaligned/be_byteshift.h index 46dd12c5709e..9356b24223ac 100644 --- a/include/linux/unaligned/be_byteshift.h +++ b/include/linux/unaligned/be_byteshift.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_UNALIGNED_BE_BYTESHIFT_H | 1 | #ifndef _LINUX_UNALIGNED_BE_BYTESHIFT_H |
2 | #define _LINUX_UNALIGNED_BE_BYTESHIFT_H | 2 | #define _LINUX_UNALIGNED_BE_BYTESHIFT_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | static inline u16 __get_unaligned_be16(const u8 *p) | 6 | static inline u16 __get_unaligned_be16(const u8 *p) |
7 | { | 7 | { |
diff --git a/include/linux/unaligned/le_byteshift.h b/include/linux/unaligned/le_byteshift.h index 59777e951baf..be376fb79b64 100644 --- a/include/linux/unaligned/le_byteshift.h +++ b/include/linux/unaligned/le_byteshift.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_UNALIGNED_LE_BYTESHIFT_H | 1 | #ifndef _LINUX_UNALIGNED_LE_BYTESHIFT_H |
2 | #define _LINUX_UNALIGNED_LE_BYTESHIFT_H | 2 | #define _LINUX_UNALIGNED_LE_BYTESHIFT_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | static inline u16 __get_unaligned_le16(const u8 *p) | 6 | static inline u16 __get_unaligned_le16(const u8 *p) |
7 | { | 7 | { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 19fabc487beb..a34fa89f1474 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -195,7 +195,7 @@ struct usb_interface { | |||
195 | 195 | ||
196 | struct device dev; /* interface specific device info */ | 196 | struct device dev; /* interface specific device info */ |
197 | struct device *usb_dev; | 197 | struct device *usb_dev; |
198 | int pm_usage_cnt; /* usage counter for autosuspend */ | 198 | atomic_t pm_usage_cnt; /* usage counter for autosuspend */ |
199 | struct work_struct reset_ws; /* for resets in atomic context */ | 199 | struct work_struct reset_ws; /* for resets in atomic context */ |
200 | }; | 200 | }; |
201 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 201 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
@@ -551,13 +551,13 @@ extern void usb_autopm_put_interface_async(struct usb_interface *intf); | |||
551 | 551 | ||
552 | static inline void usb_autopm_enable(struct usb_interface *intf) | 552 | static inline void usb_autopm_enable(struct usb_interface *intf) |
553 | { | 553 | { |
554 | intf->pm_usage_cnt = 0; | 554 | atomic_set(&intf->pm_usage_cnt, 0); |
555 | usb_autopm_set_interface(intf); | 555 | usb_autopm_set_interface(intf); |
556 | } | 556 | } |
557 | 557 | ||
558 | static inline void usb_autopm_disable(struct usb_interface *intf) | 558 | static inline void usb_autopm_disable(struct usb_interface *intf) |
559 | { | 559 | { |
560 | intf->pm_usage_cnt = 1; | 560 | atomic_set(&intf->pm_usage_cnt, 1); |
561 | usb_autopm_set_interface(intf); | 561 | usb_autopm_set_interface(intf); |
562 | } | 562 | } |
563 | 563 | ||
@@ -1036,9 +1036,10 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1036 | * @transfer_flags: A variety of flags may be used to affect how URB | 1036 | * @transfer_flags: A variety of flags may be used to affect how URB |
1037 | * submission, unlinking, or operation are handled. Different | 1037 | * submission, unlinking, or operation are handled. Different |
1038 | * kinds of URB can use different flags. | 1038 | * kinds of URB can use different flags. |
1039 | * @transfer_buffer: This identifies the buffer to (or from) which | 1039 | * @transfer_buffer: This identifies the buffer to (or from) which the I/O |
1040 | * the I/O request will be performed (unless URB_NO_TRANSFER_DMA_MAP | 1040 | * request will be performed unless URB_NO_TRANSFER_DMA_MAP is set |
1041 | * is set). This buffer must be suitable for DMA; allocate it with | 1041 | * (however, do not leave garbage in transfer_buffer even then). |
1042 | * This buffer must be suitable for DMA; allocate it with | ||
1042 | * kmalloc() or equivalent. For transfers to "in" endpoints, contents | 1043 | * kmalloc() or equivalent. For transfers to "in" endpoints, contents |
1043 | * of this buffer will be modified. This buffer is used for the data | 1044 | * of this buffer will be modified. This buffer is used for the data |
1044 | * stage of control transfers. | 1045 | * stage of control transfers. |
@@ -1104,9 +1105,15 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1104 | * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). | 1105 | * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). |
1105 | * When these transfer flags are provided, host controller drivers will | 1106 | * When these transfer flags are provided, host controller drivers will |
1106 | * attempt to use the dma addresses found in the transfer_dma and/or | 1107 | * attempt to use the dma addresses found in the transfer_dma and/or |
1107 | * setup_dma fields rather than determining a dma address themselves. (Note | 1108 | * setup_dma fields rather than determining a dma address themselves. |
1108 | * that transfer_buffer and setup_packet must still be set because not all | 1109 | * |
1109 | * host controllers use DMA, nor do virtual root hubs). | 1110 | * Note that transfer_buffer must still be set if the controller |
1111 | * does not support DMA (as indicated by bus.uses_dma) and when talking | ||
1112 | * to root hub. If you have to trasfer between highmem zone and the device | ||
1113 | * on such controller, create a bounce buffer or bail out with an error. | ||
1114 | * If transfer_buffer cannot be set (is in highmem) and the controller is DMA | ||
1115 | * capable, assign NULL to it, so that usbmon knows not to use the value. | ||
1116 | * The setup_packet must always be set, so it cannot be located in highmem. | ||
1110 | * | 1117 | * |
1111 | * Initialization: | 1118 | * Initialization: |
1112 | * | 1119 | * |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index b5744bc218ab..eaf9dffe0a01 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
@@ -24,88 +24,78 @@ | |||
24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | 24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 |
25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
27 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | 27 | |
28 | 28 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ | |
29 | /* A.5 Audio Class-Specific AC interface Descriptor Subtypes*/ | 29 | #define UAC_HEADER 0x01 |
30 | #define HEADER 0x01 | 30 | #define UAC_INPUT_TERMINAL 0x02 |
31 | #define INPUT_TERMINAL 0x02 | 31 | #define UAC_OUTPUT_TERMINAL 0x03 |
32 | #define OUTPUT_TERMINAL 0x03 | 32 | #define UAC_MIXER_UNIT 0x04 |
33 | #define MIXER_UNIT 0x04 | 33 | #define UAC_SELECTOR_UNIT 0x05 |
34 | #define SELECTOR_UNIT 0x05 | 34 | #define UAC_FEATURE_UNIT 0x06 |
35 | #define FEATURE_UNIT 0x06 | 35 | #define UAC_PROCESSING_UNIT 0x07 |
36 | #define PROCESSING_UNIT 0x07 | 36 | #define UAC_EXTENSION_UNIT 0x08 |
37 | #define EXTENSION_UNIT 0x08 | 37 | |
38 | 38 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | |
39 | #define AS_GENERAL 0x01 | 39 | #define UAC_AS_GENERAL 0x01 |
40 | #define FORMAT_TYPE 0x02 | 40 | #define UAC_FORMAT_TYPE 0x02 |
41 | #define FORMAT_SPECIFIC 0x03 | 41 | #define UAC_FORMAT_SPECIFIC 0x03 |
42 | 42 | ||
43 | #define EP_GENERAL 0x01 | 43 | /* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */ |
44 | 44 | #define UAC_EP_GENERAL 0x01 | |
45 | #define MS_GENERAL 0x01 | 45 | |
46 | #define MIDI_IN_JACK 0x02 | 46 | /* A.9 Audio Class-Specific Request Codes */ |
47 | #define MIDI_OUT_JACK 0x03 | 47 | #define UAC_SET_ 0x00 |
48 | 48 | #define UAC_GET_ 0x80 | |
49 | /* endpoint attributes */ | 49 | |
50 | #define EP_ATTR_MASK 0x0c | 50 | #define UAC__CUR 0x1 |
51 | #define EP_ATTR_ASYNC 0x04 | 51 | #define UAC__MIN 0x2 |
52 | #define EP_ATTR_ADAPTIVE 0x08 | 52 | #define UAC__MAX 0x3 |
53 | #define EP_ATTR_SYNC 0x0c | 53 | #define UAC__RES 0x4 |
54 | 54 | #define UAC__MEM 0x5 | |
55 | /* cs endpoint attributes */ | 55 | |
56 | #define EP_CS_ATTR_SAMPLE_RATE 0x01 | 56 | #define UAC_SET_CUR (UAC_SET_ | UAC__CUR) |
57 | #define EP_CS_ATTR_PITCH_CONTROL 0x02 | 57 | #define UAC_GET_CUR (UAC_GET_ | UAC__CUR) |
58 | #define EP_CS_ATTR_FILL_MAX 0x80 | 58 | #define UAC_SET_MIN (UAC_SET_ | UAC__MIN) |
59 | 59 | #define UAC_GET_MIN (UAC_GET_ | UAC__MIN) | |
60 | /* Audio Class specific Request Codes */ | 60 | #define UAC_SET_MAX (UAC_SET_ | UAC__MAX) |
61 | #define USB_AUDIO_SET_INTF 0x21 | 61 | #define UAC_GET_MAX (UAC_GET_ | UAC__MAX) |
62 | #define USB_AUDIO_SET_ENDPOINT 0x22 | 62 | #define UAC_SET_RES (UAC_SET_ | UAC__RES) |
63 | #define USB_AUDIO_GET_INTF 0xa1 | 63 | #define UAC_GET_RES (UAC_GET_ | UAC__RES) |
64 | #define USB_AUDIO_GET_ENDPOINT 0xa2 | 64 | #define UAC_SET_MEM (UAC_SET_ | UAC__MEM) |
65 | 65 | #define UAC_GET_MEM (UAC_GET_ | UAC__MEM) | |
66 | #define SET_ 0x00 | 66 | |
67 | #define GET_ 0x80 | 67 | #define UAC_GET_STAT 0xff |
68 | 68 | ||
69 | #define _CUR 0x1 | 69 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ |
70 | #define _MIN 0x2 | 70 | #define UAC_MS_HEADER 0x01 |
71 | #define _MAX 0x3 | 71 | #define UAC_MIDI_IN_JACK 0x02 |
72 | #define _RES 0x4 | 72 | #define UAC_MIDI_OUT_JACK 0x03 |
73 | #define _MEM 0x5 | 73 | |
74 | 74 | /* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */ | |
75 | #define SET_CUR (SET_ | _CUR) | 75 | #define UAC_MS_GENERAL 0x01 |
76 | #define GET_CUR (GET_ | _CUR) | 76 | |
77 | #define SET_MIN (SET_ | _MIN) | 77 | /* Terminals - 2.1 USB Terminal Types */ |
78 | #define GET_MIN (GET_ | _MIN) | 78 | #define UAC_TERMINAL_UNDEFINED 0x100 |
79 | #define SET_MAX (SET_ | _MAX) | 79 | #define UAC_TERMINAL_STREAMING 0x101 |
80 | #define GET_MAX (GET_ | _MAX) | 80 | #define UAC_TERMINAL_VENDOR_SPEC 0x1FF |
81 | #define SET_RES (SET_ | _RES) | ||
82 | #define GET_RES (GET_ | _RES) | ||
83 | #define SET_MEM (SET_ | _MEM) | ||
84 | #define GET_MEM (GET_ | _MEM) | ||
85 | |||
86 | #define GET_STAT 0xff | ||
87 | |||
88 | #define USB_AC_TERMINAL_UNDEFINED 0x100 | ||
89 | #define USB_AC_TERMINAL_STREAMING 0x101 | ||
90 | #define USB_AC_TERMINAL_VENDOR_SPEC 0x1FF | ||
91 | 81 | ||
92 | /* Terminal Control Selectors */ | 82 | /* Terminal Control Selectors */ |
93 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 83 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
94 | struct usb_ac_header_descriptor { | 84 | struct uac_ac_header_descriptor { |
95 | __u8 bLength; /* 8 + n */ | 85 | __u8 bLength; /* 8 + n */ |
96 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 86 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
97 | __u8 bDescriptorSubtype; /* USB_MS_HEADER */ | 87 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ |
98 | __le16 bcdADC; /* 0x0100 */ | 88 | __le16 bcdADC; /* 0x0100 */ |
99 | __le16 wTotalLength; /* includes Unit and Terminal desc. */ | 89 | __le16 wTotalLength; /* includes Unit and Terminal desc. */ |
100 | __u8 bInCollection; /* n */ | 90 | __u8 bInCollection; /* n */ |
101 | __u8 baInterfaceNr[]; /* [n] */ | 91 | __u8 baInterfaceNr[]; /* [n] */ |
102 | } __attribute__ ((packed)); | 92 | } __attribute__ ((packed)); |
103 | 93 | ||
104 | #define USB_DT_AC_HEADER_SIZE(n) (8 + (n)) | 94 | #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) |
105 | 95 | ||
106 | /* As above, but more useful for defining your own descriptors: */ | 96 | /* As above, but more useful for defining your own descriptors: */ |
107 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ | 97 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ |
108 | struct usb_ac_header_descriptor_##n { \ | 98 | struct uac_ac_header_descriptor_##n { \ |
109 | __u8 bLength; \ | 99 | __u8 bLength; \ |
110 | __u8 bDescriptorType; \ | 100 | __u8 bDescriptorType; \ |
111 | __u8 bDescriptorSubtype; \ | 101 | __u8 bDescriptorSubtype; \ |
@@ -116,7 +106,7 @@ struct usb_ac_header_descriptor_##n { \ | |||
116 | } __attribute__ ((packed)) | 106 | } __attribute__ ((packed)) |
117 | 107 | ||
118 | /* 4.3.2.1 Input Terminal Descriptor */ | 108 | /* 4.3.2.1 Input Terminal Descriptor */ |
119 | struct usb_input_terminal_descriptor { | 109 | struct uac_input_terminal_descriptor { |
120 | __u8 bLength; /* in bytes: 12 */ | 110 | __u8 bLength; /* in bytes: 12 */ |
121 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 111 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
122 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ | 112 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ |
@@ -129,18 +119,19 @@ struct usb_input_terminal_descriptor { | |||
129 | __u8 iTerminal; | 119 | __u8 iTerminal; |
130 | } __attribute__ ((packed)); | 120 | } __attribute__ ((packed)); |
131 | 121 | ||
132 | #define USB_DT_AC_INPUT_TERMINAL_SIZE 12 | 122 | #define UAC_DT_INPUT_TERMINAL_SIZE 12 |
133 | 123 | ||
134 | #define USB_AC_INPUT_TERMINAL_UNDEFINED 0x200 | 124 | /* Terminals - 2.2 Input Terminal Types */ |
135 | #define USB_AC_INPUT_TERMINAL_MICROPHONE 0x201 | 125 | #define UAC_INPUT_TERMINAL_UNDEFINED 0x200 |
136 | #define USB_AC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 | 126 | #define UAC_INPUT_TERMINAL_MICROPHONE 0x201 |
137 | #define USB_AC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 | 127 | #define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 |
138 | #define USB_AC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 | 128 | #define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 |
139 | #define USB_AC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | 129 | #define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 |
140 | #define USB_AC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | 130 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 |
131 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | ||
141 | 132 | ||
142 | /* 4.3.2.2 Output Terminal Descriptor */ | 133 | /* 4.3.2.2 Output Terminal Descriptor */ |
143 | struct usb_output_terminal_descriptor { | 134 | struct uac_output_terminal_descriptor { |
144 | __u8 bLength; /* in bytes: 9 */ | 135 | __u8 bLength; /* in bytes: 9 */ |
145 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 136 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
146 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | 137 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ |
@@ -151,23 +142,24 @@ struct usb_output_terminal_descriptor { | |||
151 | __u8 iTerminal; | 142 | __u8 iTerminal; |
152 | } __attribute__ ((packed)); | 143 | } __attribute__ ((packed)); |
153 | 144 | ||
154 | #define USB_DT_AC_OUTPUT_TERMINAL_SIZE 9 | 145 | #define UAC_DT_OUTPUT_TERMINAL_SIZE 9 |
155 | 146 | ||
156 | #define USB_AC_OUTPUT_TERMINAL_UNDEFINED 0x300 | 147 | /* Terminals - 2.3 Output Terminal Types */ |
157 | #define USB_AC_OUTPUT_TERMINAL_SPEAKER 0x301 | 148 | #define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300 |
158 | #define USB_AC_OUTPUT_TERMINAL_HEADPHONES 0x302 | 149 | #define UAC_OUTPUT_TERMINAL_SPEAKER 0x301 |
159 | #define USB_AC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 | 150 | #define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302 |
160 | #define USB_AC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 | 151 | #define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 |
161 | #define USB_AC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 | 152 | #define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 |
162 | #define USB_AC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 | 153 | #define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 |
163 | #define USB_AC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | 154 | #define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 |
155 | #define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | ||
164 | 156 | ||
165 | /* Set bControlSize = 2 as default setting */ | 157 | /* Set bControlSize = 2 as default setting */ |
166 | #define USB_DT_AC_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) | 158 | #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) |
167 | 159 | ||
168 | /* As above, but more useful for defining your own descriptors: */ | 160 | /* As above, but more useful for defining your own descriptors: */ |
169 | #define DECLARE_USB_AC_FEATURE_UNIT_DESCRIPTOR(ch) \ | 161 | #define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \ |
170 | struct usb_ac_feature_unit_descriptor_##ch { \ | 162 | struct uac_feature_unit_descriptor_##ch { \ |
171 | __u8 bLength; \ | 163 | __u8 bLength; \ |
172 | __u8 bDescriptorType; \ | 164 | __u8 bDescriptorType; \ |
173 | __u8 bDescriptorSubtype; \ | 165 | __u8 bDescriptorSubtype; \ |
@@ -179,7 +171,7 @@ struct usb_ac_feature_unit_descriptor_##ch { \ | |||
179 | } __attribute__ ((packed)) | 171 | } __attribute__ ((packed)) |
180 | 172 | ||
181 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 173 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
182 | struct usb_as_header_descriptor { | 174 | struct uac_as_header_descriptor { |
183 | __u8 bLength; /* in bytes: 7 */ | 175 | __u8 bLength; /* in bytes: 7 */ |
184 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 176 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
185 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | 177 | __u8 bDescriptorSubtype; /* AS_GENERAL */ |
@@ -188,16 +180,17 @@ struct usb_as_header_descriptor { | |||
188 | __le16 wFormatTag; /* The Audio Data Format */ | 180 | __le16 wFormatTag; /* The Audio Data Format */ |
189 | } __attribute__ ((packed)); | 181 | } __attribute__ ((packed)); |
190 | 182 | ||
191 | #define USB_DT_AS_HEADER_SIZE 7 | 183 | #define UAC_DT_AS_HEADER_SIZE 7 |
192 | 184 | ||
193 | #define USB_AS_AUDIO_FORMAT_TYPE_I_UNDEFINED 0x0 | 185 | /* Formats - A.1.1 Audio Data Format Type I Codes */ |
194 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM 0x1 | 186 | #define UAC_FORMAT_TYPE_I_UNDEFINED 0x0 |
195 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM8 0x2 | 187 | #define UAC_FORMAT_TYPE_I_PCM 0x1 |
196 | #define USB_AS_AUDIO_FORMAT_TYPE_I_IEEE_FLOAT 0x3 | 188 | #define UAC_FORMAT_TYPE_I_PCM8 0x2 |
197 | #define USB_AS_AUDIO_FORMAT_TYPE_I_ALAW 0x4 | 189 | #define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3 |
198 | #define USB_AS_AUDIO_FORMAT_TYPE_I_MULAW 0x5 | 190 | #define UAC_FORMAT_TYPE_I_ALAW 0x4 |
191 | #define UAC_FORMAT_TYPE_I_MULAW 0x5 | ||
199 | 192 | ||
200 | struct usb_as_format_type_i_continuous_descriptor { | 193 | struct uac_format_type_i_continuous_descriptor { |
201 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | 194 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ |
202 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 195 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
203 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | 196 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ |
@@ -210,9 +203,9 @@ struct usb_as_format_type_i_continuous_descriptor { | |||
210 | __u8 tUpperSamFreq[3]; | 203 | __u8 tUpperSamFreq[3]; |
211 | } __attribute__ ((packed)); | 204 | } __attribute__ ((packed)); |
212 | 205 | ||
213 | #define USB_AS_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 | 206 | #define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 |
214 | 207 | ||
215 | struct usb_as_formate_type_i_discrete_descriptor { | 208 | struct uac_format_type_i_discrete_descriptor { |
216 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | 209 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ |
217 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 210 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
218 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | 211 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ |
@@ -224,8 +217,8 @@ struct usb_as_formate_type_i_discrete_descriptor { | |||
224 | __u8 tSamFreq[][3]; | 217 | __u8 tSamFreq[][3]; |
225 | } __attribute__ ((packed)); | 218 | } __attribute__ ((packed)); |
226 | 219 | ||
227 | #define DECLARE_USB_AS_FORMAT_TYPE_I_DISCRETE_DESC(n) \ | 220 | #define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \ |
228 | struct usb_as_formate_type_i_discrete_descriptor_##n { \ | 221 | struct uac_format_type_i_discrete_descriptor_##n { \ |
229 | __u8 bLength; \ | 222 | __u8 bLength; \ |
230 | __u8 bDescriptorType; \ | 223 | __u8 bDescriptorType; \ |
231 | __u8 bDescriptorSubtype; \ | 224 | __u8 bDescriptorSubtype; \ |
@@ -237,18 +230,15 @@ struct usb_as_formate_type_i_discrete_descriptor_##n { \ | |||
237 | __u8 tSamFreq[n][3]; \ | 230 | __u8 tSamFreq[n][3]; \ |
238 | } __attribute__ ((packed)) | 231 | } __attribute__ ((packed)) |
239 | 232 | ||
240 | #define USB_AS_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | 233 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) |
241 | |||
242 | #define USB_AS_FORMAT_TYPE_UNDEFINED 0x0 | ||
243 | #define USB_AS_FORMAT_TYPE_I 0x1 | ||
244 | #define USB_AS_FORMAT_TYPE_II 0x2 | ||
245 | #define USB_AS_FORMAT_TYPE_III 0x3 | ||
246 | 234 | ||
247 | #define USB_AS_ENDPOINT_ASYNC (1 << 2) | 235 | /* Formats - A.2 Format Type Codes */ |
248 | #define USB_AS_ENDPOINT_ADAPTIVE (2 << 2) | 236 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 |
249 | #define USB_AS_ENDPOINT_SYNC (3 << 2) | 237 | #define UAC_FORMAT_TYPE_I 0x1 |
238 | #define UAC_FORMAT_TYPE_II 0x2 | ||
239 | #define UAC_FORMAT_TYPE_III 0x3 | ||
250 | 240 | ||
251 | struct usb_as_iso_endpoint_descriptor { | 241 | struct uac_iso_endpoint_descriptor { |
252 | __u8 bLength; /* in bytes: 7 */ | 242 | __u8 bLength; /* in bytes: 7 */ |
253 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ | 243 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ |
254 | __u8 bDescriptorSubtype; /* EP_GENERAL */ | 244 | __u8 bDescriptorSubtype; /* EP_GENERAL */ |
@@ -256,30 +246,37 @@ struct usb_as_iso_endpoint_descriptor { | |||
256 | __u8 bLockDelayUnits; | 246 | __u8 bLockDelayUnits; |
257 | __le16 wLockDelay; | 247 | __le16 wLockDelay; |
258 | }; | 248 | }; |
259 | #define USB_AS_ISO_ENDPOINT_DESC_SIZE 7 | 249 | #define UAC_ISO_ENDPOINT_DESC_SIZE 7 |
260 | 250 | ||
261 | #define FU_CONTROL_UNDEFINED 0x00 | 251 | #define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 |
262 | #define MUTE_CONTROL 0x01 | 252 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 |
263 | #define VOLUME_CONTROL 0x02 | 253 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 |
264 | #define BASS_CONTROL 0x03 | 254 | |
265 | #define MID_CONTROL 0x04 | 255 | /* A.10.2 Feature Unit Control Selectors */ |
266 | #define TREBLE_CONTROL 0x05 | 256 | #define UAC_FU_CONTROL_UNDEFINED 0x00 |
267 | #define GRAPHIC_EQUALIZER_CONTROL 0x06 | 257 | #define UAC_MUTE_CONTROL 0x01 |
268 | #define AUTOMATIC_GAIN_CONTROL 0x07 | 258 | #define UAC_VOLUME_CONTROL 0x02 |
269 | #define DELAY_CONTROL 0x08 | 259 | #define UAC_BASS_CONTROL 0x03 |
270 | #define BASS_BOOST_CONTROL 0x09 | 260 | #define UAC_MID_CONTROL 0x04 |
271 | #define LOUDNESS_CONTROL 0x0a | 261 | #define UAC_TREBLE_CONTROL 0x05 |
272 | 262 | #define UAC_GRAPHIC_EQUALIZER_CONTROL 0x06 | |
273 | #define FU_MUTE (1 << (MUTE_CONTROL - 1)) | 263 | #define UAC_AUTOMATIC_GAIN_CONTROL 0x07 |
274 | #define FU_VOLUME (1 << (VOLUME_CONTROL - 1)) | 264 | #define UAC_DELAY_CONTROL 0x08 |
275 | #define FU_BASS (1 << (BASS_CONTROL - 1)) | 265 | #define UAC_BASS_BOOST_CONTROL 0x09 |
276 | #define FU_MID (1 << (MID_CONTROL - 1)) | 266 | #define UAC_LOUDNESS_CONTROL 0x0a |
277 | #define FU_TREBLE (1 << (TREBLE_CONTROL - 1)) | 267 | |
278 | #define FU_GRAPHIC_EQ (1 << (GRAPHIC_EQUALIZER_CONTROL - 1)) | 268 | #define UAC_FU_MUTE (1 << (UAC_MUTE_CONTROL - 1)) |
279 | #define FU_AUTO_GAIN (1 << (AUTOMATIC_GAIN_CONTROL - 1)) | 269 | #define UAC_FU_VOLUME (1 << (UAC_VOLUME_CONTROL - 1)) |
280 | #define FU_DELAY (1 << (DELAY_CONTROL - 1)) | 270 | #define UAC_FU_BASS (1 << (UAC_BASS_CONTROL - 1)) |
281 | #define FU_BASS_BOOST (1 << (BASS_BOOST_CONTROL - 1)) | 271 | #define UAC_FU_MID (1 << (UAC_MID_CONTROL - 1)) |
282 | #define FU_LOUDNESS (1 << (LOUDNESS_CONTROL - 1)) | 272 | #define UAC_FU_TREBLE (1 << (UAC_TREBLE_CONTROL - 1)) |
273 | #define UAC_FU_GRAPHIC_EQ (1 << (UAC_GRAPHIC_EQUALIZER_CONTROL - 1)) | ||
274 | #define UAC_FU_AUTO_GAIN (1 << (UAC_AUTOMATIC_GAIN_CONTROL - 1)) | ||
275 | #define UAC_FU_DELAY (1 << (UAC_DELAY_CONTROL - 1)) | ||
276 | #define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1)) | ||
277 | #define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1)) | ||
278 | |||
279 | #ifdef __KERNEL__ | ||
283 | 280 | ||
284 | struct usb_audio_control { | 281 | struct usb_audio_control { |
285 | struct list_head list; | 282 | struct list_head list; |
@@ -290,18 +287,6 @@ struct usb_audio_control { | |||
290 | int (*get)(struct usb_audio_control *con, u8 cmd); | 287 | int (*get)(struct usb_audio_control *con, u8 cmd); |
291 | }; | 288 | }; |
292 | 289 | ||
293 | static inline int generic_set_cmd(struct usb_audio_control *con, u8 cmd, int value) | ||
294 | { | ||
295 | con->data[cmd] = value; | ||
296 | |||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | static inline int generic_get_cmd(struct usb_audio_control *con, u8 cmd) | ||
301 | { | ||
302 | return con->data[cmd]; | ||
303 | } | ||
304 | |||
305 | struct usb_audio_control_selector { | 290 | struct usb_audio_control_selector { |
306 | struct list_head list; | 291 | struct list_head list; |
307 | struct list_head control; | 292 | struct list_head control; |
@@ -311,4 +296,6 @@ struct usb_audio_control_selector { | |||
311 | struct usb_descriptor_header *desc; | 296 | struct usb_descriptor_header *desc; |
312 | }; | 297 | }; |
313 | 298 | ||
299 | #endif /* __KERNEL__ */ | ||
300 | |||
314 | #endif /* __LINUX_USB_AUDIO_H */ | 301 | #endif /* __LINUX_USB_AUDIO_H */ |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 93223638f702..94012e649d86 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -258,6 +258,8 @@ struct usb_device_descriptor { | |||
258 | #define USB_CLASS_APP_SPEC 0xfe | 258 | #define USB_CLASS_APP_SPEC 0xfe |
259 | #define USB_CLASS_VENDOR_SPEC 0xff | 259 | #define USB_CLASS_VENDOR_SPEC 0xff |
260 | 260 | ||
261 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | ||
262 | |||
261 | /*-------------------------------------------------------------------------*/ | 263 | /*-------------------------------------------------------------------------*/ |
262 | 264 | ||
263 | /* USB_DT_CONFIG: Configuration descriptor information. | 265 | /* USB_DT_CONFIG: Configuration descriptor information. |
@@ -348,6 +350,12 @@ struct usb_endpoint_descriptor { | |||
348 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ | 350 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ |
349 | #define USB_ENDPOINT_DIR_MASK 0x80 | 351 | #define USB_ENDPOINT_DIR_MASK 0x80 |
350 | 352 | ||
353 | #define USB_ENDPOINT_SYNCTYPE 0x0c | ||
354 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | ||
355 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | ||
356 | #define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2) | ||
357 | #define USB_ENDPOINT_SYNC_SYNC (3 << 2) | ||
358 | |||
351 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ | 359 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ |
352 | #define USB_ENDPOINT_XFER_CONTROL 0 | 360 | #define USB_ENDPOINT_XFER_CONTROL 0 |
353 | #define USB_ENDPOINT_XFER_ISOC 1 | 361 | #define USB_ENDPOINT_XFER_ISOC 1 |
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index 5b88e36c9103..af4b86f3aca3 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
@@ -105,6 +105,7 @@ struct ehci_regs { | |||
105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ | 105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ |
106 | #define PORT_WKCONN_E (1<<20) /* wake on connect (enable) */ | 106 | #define PORT_WKCONN_E (1<<20) /* wake on connect (enable) */ |
107 | /* 19:16 for port testing */ | 107 | /* 19:16 for port testing */ |
108 | #define PORT_TEST_PKT (0x4<<16) /* Port Test Control - packet test */ | ||
108 | #define PORT_LED_OFF (0<<14) | 109 | #define PORT_LED_OFF (0<<14) |
109 | #define PORT_LED_AMBER (1<<14) | 110 | #define PORT_LED_AMBER (1<<14) |
110 | #define PORT_LED_GREEN (2<<14) | 111 | #define PORT_LED_GREEN (2<<14) |
@@ -132,6 +133,19 @@ struct ehci_regs { | |||
132 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ | 133 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ |
133 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ | 134 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ |
134 | 135 | ||
136 | /* Moorestown has some non-standard registers, partially due to the fact that | ||
137 | * its EHCI controller has both TT and LPM support. HOSTPCx are extentions to | ||
138 | * PORTSCx | ||
139 | */ | ||
140 | #define HOSTPC0 0x84 /* HOSTPC extension */ | ||
141 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ | ||
142 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ | ||
143 | #define USBMODE_EX 0xc8 /* USB Device mode extension */ | ||
144 | #define USBMODE_EX_VBPS (1<<5) /* VBus Power Select On */ | ||
145 | #define USBMODE_EX_HC (3<<0) /* host controller mode */ | ||
146 | #define TXFILLTUNING 0x24 /* TX FIFO Tuning register */ | ||
147 | #define TXFIFO_DEFAULT (8<<16) /* FIFO burst threshold 8 */ | ||
148 | |||
135 | /* Appendix C, Debug port ... intended for use with special "debug devices" | 149 | /* Appendix C, Debug port ... intended for use with special "debug devices" |
136 | * that can help if there's no serial console. (nonstandard enumeration.) | 150 | * that can help if there's no serial console. (nonstandard enumeration.) |
137 | */ | 151 | */ |
@@ -157,4 +171,25 @@ struct ehci_dbg_port { | |||
157 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) | 171 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) |
158 | } __attribute__ ((packed)); | 172 | } __attribute__ ((packed)); |
159 | 173 | ||
174 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
175 | #include <linux/init.h> | ||
176 | extern int __init early_dbgp_init(char *s); | ||
177 | extern struct console early_dbgp_console; | ||
178 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ | ||
179 | |||
180 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
181 | /* Call backs from ehci host driver to ehci debug driver */ | ||
182 | extern int dbgp_external_startup(void); | ||
183 | extern int dbgp_reset_prep(void); | ||
184 | #else | ||
185 | static inline int dbgp_reset_prep(void) | ||
186 | { | ||
187 | return 1; | ||
188 | } | ||
189 | static inline int dbgp_external_startup(void) | ||
190 | { | ||
191 | return -1; | ||
192 | } | ||
193 | #endif | ||
194 | |||
160 | #endif /* __LINUX_USB_EHCI_DEF_H */ | 195 | #endif /* __LINUX_USB_EHCI_DEF_H */ |
diff --git a/include/linux/usb/isp1362.h b/include/linux/usb/isp1362.h new file mode 100644 index 000000000000..642684bb9292 --- /dev/null +++ b/include/linux/usb/isp1362.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * board initialization code should put one of these into dev->platform_data | ||
3 | * and place the isp1362 onto platform_bus. | ||
4 | */ | ||
5 | |||
6 | #ifndef __LINUX_USB_ISP1362_H__ | ||
7 | #define __LINUX_USB_ISP1362_H__ | ||
8 | |||
9 | struct isp1362_platform_data { | ||
10 | /* Enable internal pulldown resistors on downstream ports */ | ||
11 | unsigned sel15Kres:1; | ||
12 | /* Clock cannot be stopped */ | ||
13 | unsigned clknotstop:1; | ||
14 | /* On-chip overcurrent protection */ | ||
15 | unsigned oc_enable:1; | ||
16 | /* INT output polarity */ | ||
17 | unsigned int_act_high:1; | ||
18 | /* INT edge or level triggered */ | ||
19 | unsigned int_edge_triggered:1; | ||
20 | /* DREQ output polarity */ | ||
21 | unsigned dreq_act_high:1; | ||
22 | /* DACK input polarity */ | ||
23 | unsigned dack_act_high:1; | ||
24 | /* chip can be resumed via H_WAKEUP pin */ | ||
25 | unsigned remote_wakeup_connected:1; | ||
26 | /* Switch or not to switch (keep always powered) */ | ||
27 | unsigned no_power_switching:1; | ||
28 | /* Ganged port power switching (0) or individual port power switching (1) */ | ||
29 | unsigned power_switching_mode:1; | ||
30 | /* Given port_power, msec/2 after power on till power good */ | ||
31 | u8 potpg; | ||
32 | /* Hardware reset set/clear */ | ||
33 | void (*reset) (struct device *dev, int set); | ||
34 | /* Clock start/stop */ | ||
35 | void (*clock) (struct device *dev, int start); | ||
36 | /* Inter-io delay (ns). The chip is picky about access timings; it | ||
37 | * expects at least: | ||
38 | * 110ns delay between consecutive accesses to DATA_REG, | ||
39 | * 300ns delay between access to ADDR_REG and DATA_REG (registers) | ||
40 | * 462ns delay between access to ADDR_REG and DATA_REG (buffer memory) | ||
41 | * WE MUST NOT be activated during these intervals (even without CS!) | ||
42 | */ | ||
43 | void (*delay) (struct device *dev, unsigned int delay); | ||
44 | }; | ||
45 | |||
46 | #endif | ||
diff --git a/include/linux/usb/isp1760.h b/include/linux/usb/isp1760.h new file mode 100644 index 000000000000..de7de53c5531 --- /dev/null +++ b/include/linux/usb/isp1760.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * board initialization should put one of these into dev->platform_data | ||
3 | * and place the isp1760 onto platform_bus named "isp1760-hcd". | ||
4 | */ | ||
5 | |||
6 | #ifndef __LINUX_USB_ISP1760_H | ||
7 | #define __LINUX_USB_ISP1760_H | ||
8 | |||
9 | struct isp1760_platform_data { | ||
10 | unsigned is_isp1761:1; /* Chip is ISP1761 */ | ||
11 | unsigned bus_width_16:1; /* 16/32-bit data bus width */ | ||
12 | unsigned port1_otg:1; /* Port 1 supports OTG */ | ||
13 | unsigned analog_oc:1; /* Analog overcurrent */ | ||
14 | unsigned dack_polarity_high:1; /* DACK active high */ | ||
15 | unsigned dreq_polarity_high:1; /* DREQ active high */ | ||
16 | }; | ||
17 | |||
18 | #endif /* __LINUX_USB_ISP1760_H */ | ||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 7b85e327af91..c17eb64d7213 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -59,6 +59,7 @@ enum port_dev_state { | |||
59 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. | 59 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. |
60 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. | 60 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. |
61 | * @write_urb: pointer to the bulk out struct urb for this port. | 61 | * @write_urb: pointer to the bulk out struct urb for this port. |
62 | * @write_fifo: kfifo used to buffer outgoing data | ||
62 | * @write_urb_busy: port`s writing status | 63 | * @write_urb_busy: port`s writing status |
63 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this | 64 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this |
64 | * port. | 65 | * port. |
@@ -96,6 +97,7 @@ struct usb_serial_port { | |||
96 | unsigned char *bulk_out_buffer; | 97 | unsigned char *bulk_out_buffer; |
97 | int bulk_out_size; | 98 | int bulk_out_size; |
98 | struct urb *write_urb; | 99 | struct urb *write_urb; |
100 | struct kfifo *write_fifo; | ||
99 | int write_urb_busy; | 101 | int write_urb_busy; |
100 | __u8 bulk_out_endpointAddress; | 102 | __u8 bulk_out_endpointAddress; |
101 | 103 | ||
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 0044d9b4cb85..b2a7d8ba6ee3 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
@@ -77,6 +77,7 @@ struct usbdevfs_connectinfo { | |||
77 | 77 | ||
78 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 | 78 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 |
79 | #define USBDEVFS_URB_ISO_ASAP 0x02 | 79 | #define USBDEVFS_URB_ISO_ASAP 0x02 |
80 | #define USBDEVFS_URB_BULK_CONTINUATION 0x04 | ||
80 | #define USBDEVFS_URB_NO_FSBR 0x20 | 81 | #define USBDEVFS_URB_NO_FSBR 0x20 |
81 | #define USBDEVFS_URB_ZERO_PACKET 0x40 | 82 | #define USBDEVFS_URB_ZERO_PACKET 0x40 |
82 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 | 83 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 |
@@ -175,4 +176,6 @@ struct usbdevfs_ioctl32 { | |||
175 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) | 176 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) |
176 | #define USBDEVFS_DISCONNECT _IO('U', 22) | 177 | #define USBDEVFS_DISCONNECT _IO('U', 22) |
177 | #define USBDEVFS_CONNECT _IO('U', 23) | 178 | #define USBDEVFS_CONNECT _IO('U', 23) |
179 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) | ||
180 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) | ||
178 | #endif /* _LINUX_USBDEVICE_FS_H */ | 181 | #endif /* _LINUX_USBDEVICE_FS_H */ |
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 3656b300de3a..69f39974c041 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -36,7 +36,6 @@ struct new_utsname { | |||
36 | #include <linux/kref.h> | 36 | #include <linux/kref.h> |
37 | #include <linux/nsproxy.h> | 37 | #include <linux/nsproxy.h> |
38 | #include <linux/err.h> | 38 | #include <linux/err.h> |
39 | #include <asm/atomic.h> | ||
40 | 39 | ||
41 | struct uts_namespace { | 40 | struct uts_namespace { |
42 | struct kref kref; | 41 | struct kref kref; |
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index e81c64af80c1..923f9040ea20 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h | |||
@@ -41,7 +41,7 @@ | |||
41 | * interrupts at any time. | 41 | * interrupts at any time. |
42 | */ | 42 | */ |
43 | extern void vga_set_legacy_decoding(struct pci_dev *pdev, | 43 | extern void vga_set_legacy_decoding(struct pci_dev *pdev, |
44 | unsigned int decodes); | 44 | unsigned int decodes); |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * vga_get - acquire & locks VGA resources | 47 | * vga_get - acquire & locks VGA resources |
@@ -193,8 +193,17 @@ static inline int vga_conflicts(struct pci_dev *p1, struct pci_dev *p2) | |||
193 | * They driver will get a callback when VGA arbitration is first used | 193 | * They driver will get a callback when VGA arbitration is first used |
194 | * by userspace since we some older X servers have issues. | 194 | * by userspace since we some older X servers have issues. |
195 | */ | 195 | */ |
196 | #if defined(CONFIG_VGA_ARB) | ||
196 | int vga_client_register(struct pci_dev *pdev, void *cookie, | 197 | int vga_client_register(struct pci_dev *pdev, void *cookie, |
197 | void (*irq_set_state)(void *cookie, bool state), | 198 | void (*irq_set_state)(void *cookie, bool state), |
198 | unsigned int (*set_vga_decode)(void *cookie, bool state)); | 199 | unsigned int (*set_vga_decode)(void *cookie, bool state)); |
200 | #else | ||
201 | static inline int vga_client_register(struct pci_dev *pdev, void *cookie, | ||
202 | void (*irq_set_state)(void *cookie, bool state), | ||
203 | unsigned int (*set_vga_decode)(void *cookie, bool state)) | ||
204 | { | ||
205 | return 0; | ||
206 | } | ||
207 | #endif | ||
199 | 208 | ||
200 | #endif /* LINUX_VGA_H */ | 209 | #endif /* LINUX_VGA_H */ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 4fca4f5440ba..057a2e010758 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -34,7 +34,7 @@ struct virtqueue { | |||
34 | * out_num: the number of sg readable by other side | 34 | * out_num: the number of sg readable by other side |
35 | * in_num: the number of sg which are writable (after readable ones) | 35 | * in_num: the number of sg which are writable (after readable ones) |
36 | * data: the token identifying the buffer. | 36 | * data: the token identifying the buffer. |
37 | * Returns 0 or an error. | 37 | * Returns remaining capacity of queue (sg segments) or a negative error. |
38 | * @kick: update after add_buf | 38 | * @kick: update after add_buf |
39 | * vq: the struct virtqueue | 39 | * vq: the struct virtqueue |
40 | * After one or more add_buf calls, invoke this to kick the other side. | 40 | * After one or more add_buf calls, invoke this to kick the other side. |
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h index b3c4a60ceeb3..ea7226a45acb 100644 --- a/include/linux/virtio_9p.h +++ b/include/linux/virtio_9p.h | |||
@@ -4,8 +4,6 @@ | |||
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
5 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
6 | 6 | ||
7 | /* The ID for virtio console */ | ||
8 | #define VIRTIO_ID_9P 9 | ||
9 | /* Maximum number of virtio channels per partition (1 for now) */ | 7 | /* Maximum number of virtio channels per partition (1 for now) */ |
10 | #define MAX_9P_CHAN 1 | 8 | #define MAX_9P_CHAN 1 |
11 | 9 | ||
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h index 8726ff77763e..09d730085060 100644 --- a/include/linux/virtio_balloon.h +++ b/include/linux/virtio_balloon.h | |||
@@ -4,9 +4,6 @@ | |||
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
5 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
6 | 6 | ||
7 | /* The ID for virtio_balloon */ | ||
8 | #define VIRTIO_ID_BALLOON 5 | ||
9 | |||
10 | /* The feature bitmap for virtio balloon */ | 7 | /* The feature bitmap for virtio balloon */ |
11 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ | 8 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ |
12 | 9 | ||
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index 8dab9f2b8832..15cb666581d7 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
@@ -5,9 +5,6 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
7 | 7 | ||
8 | /* The ID for virtio_block */ | ||
9 | #define VIRTIO_ID_BLOCK 2 | ||
10 | |||
11 | /* Feature bits */ | 8 | /* Feature bits */ |
12 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | 9 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ |
13 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ | 10 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ |
@@ -17,6 +14,7 @@ | |||
17 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | 14 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ |
18 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | 15 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ |
19 | #define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */ | 16 | #define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */ |
17 | #define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ | ||
20 | 18 | ||
21 | #define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ | 19 | #define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ |
22 | 20 | ||
@@ -38,6 +36,17 @@ struct virtio_blk_config { | |||
38 | __u8 identify[VIRTIO_BLK_ID_BYTES]; | 36 | __u8 identify[VIRTIO_BLK_ID_BYTES]; |
39 | } __attribute__((packed)); | 37 | } __attribute__((packed)); |
40 | 38 | ||
39 | /* | ||
40 | * Command types | ||
41 | * | ||
42 | * Usage is a bit tricky as some bits are used as flags and some are not. | ||
43 | * | ||
44 | * Rules: | ||
45 | * VIRTIO_BLK_T_OUT may be combined with VIRTIO_BLK_T_SCSI_CMD or | ||
46 | * VIRTIO_BLK_T_BARRIER. VIRTIO_BLK_T_FLUSH is a command of its own | ||
47 | * and may not be combined with any of the other flags. | ||
48 | */ | ||
49 | |||
41 | /* These two define direction. */ | 50 | /* These two define direction. */ |
42 | #define VIRTIO_BLK_T_IN 0 | 51 | #define VIRTIO_BLK_T_IN 0 |
43 | #define VIRTIO_BLK_T_OUT 1 | 52 | #define VIRTIO_BLK_T_OUT 1 |
@@ -45,6 +54,9 @@ struct virtio_blk_config { | |||
45 | /* This bit says it's a scsi command, not an actual read or write. */ | 54 | /* This bit says it's a scsi command, not an actual read or write. */ |
46 | #define VIRTIO_BLK_T_SCSI_CMD 2 | 55 | #define VIRTIO_BLK_T_SCSI_CMD 2 |
47 | 56 | ||
57 | /* Cache flush command */ | ||
58 | #define VIRTIO_BLK_T_FLUSH 4 | ||
59 | |||
48 | /* Barrier before this op. */ | 60 | /* Barrier before this op. */ |
49 | #define VIRTIO_BLK_T_BARRIER 0x80000000 | 61 | #define VIRTIO_BLK_T_BARRIER 0x80000000 |
50 | 62 | ||
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index e547e3c8ee9a..0093dd7c1d6f 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -109,8 +109,7 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, | |||
109 | unsigned int fbit) | 109 | unsigned int fbit) |
110 | { | 110 | { |
111 | /* Did you forget to fix assumptions on max features? */ | 111 | /* Did you forget to fix assumptions on max features? */ |
112 | if (__builtin_constant_p(fbit)) | 112 | MAYBE_BUILD_BUG_ON(fbit >= 32); |
113 | BUILD_BUG_ON(fbit >= 32); | ||
114 | 113 | ||
115 | if (fbit < VIRTIO_TRANSPORT_F_START) | 114 | if (fbit < VIRTIO_TRANSPORT_F_START) |
116 | virtio_check_driver_offered_feature(vdev, fbit); | 115 | virtio_check_driver_offered_feature(vdev, fbit); |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index dc161115ae35..b5f519806014 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
@@ -5,9 +5,6 @@ | |||
5 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | 5 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so |
6 | * anyone can use the definitions to implement compatible drivers/servers. */ | 6 | * anyone can use the definitions to implement compatible drivers/servers. */ |
7 | 7 | ||
8 | /* The ID for virtio console */ | ||
9 | #define VIRTIO_ID_CONSOLE 3 | ||
10 | |||
11 | /* Feature bits */ | 8 | /* Feature bits */ |
12 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ | 9 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ |
13 | 10 | ||
diff --git a/include/linux/virtio_ids.h b/include/linux/virtio_ids.h new file mode 100644 index 000000000000..06660c0a78d7 --- /dev/null +++ b/include/linux/virtio_ids.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _LINUX_VIRTIO_IDS_H | ||
2 | #define _LINUX_VIRTIO_IDS_H | ||
3 | /* | ||
4 | * Virtio IDs | ||
5 | * | ||
6 | * This header is BSD licensed so anyone can use the definitions to implement | ||
7 | * compatible drivers/servers. | ||
8 | */ | ||
9 | |||
10 | #define VIRTIO_ID_NET 1 /* virtio net */ | ||
11 | #define VIRTIO_ID_BLOCK 2 /* virtio block */ | ||
12 | #define VIRTIO_ID_CONSOLE 3 /* virtio console */ | ||
13 | #define VIRTIO_ID_RNG 4 /* virtio ring */ | ||
14 | #define VIRTIO_ID_BALLOON 5 /* virtio balloon */ | ||
15 | #define VIRTIO_ID_9P 9 /* 9p virtio console */ | ||
16 | |||
17 | #endif /* _LINUX_VIRTIO_IDS_H */ | ||
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index d8dd539c9f48..1f41734bbb77 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
@@ -6,9 +6,6 @@ | |||
6 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
7 | #include <linux/if_ether.h> | 7 | #include <linux/if_ether.h> |
8 | 8 | ||
9 | /* The ID for virtio_net */ | ||
10 | #define VIRTIO_ID_NET 1 | ||
11 | |||
12 | /* The feature bitmap for virtio net */ | 9 | /* The feature bitmap for virtio net */ |
13 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ | 10 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ |
14 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ | 11 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ |
diff --git a/include/linux/virtio_rng.h b/include/linux/virtio_rng.h index 1a85dab8a940..48121c3c434b 100644 --- a/include/linux/virtio_rng.h +++ b/include/linux/virtio_rng.h | |||
@@ -4,7 +4,4 @@ | |||
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
5 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
6 | 6 | ||
7 | /* The ID for virtio_rng */ | ||
8 | #define VIRTIO_ID_RNG 4 | ||
9 | |||
10 | #endif /* _LINUX_VIRTIO_RNG_H */ | 7 | #endif /* _LINUX_VIRTIO_RNG_H */ |
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h index 0c9878123d5f..38e8c4d9289e 100644 --- a/include/linux/wm97xx.h +++ b/include/linux/wm97xx.h | |||
@@ -293,6 +293,24 @@ struct wm97xx { | |||
293 | u16 suspend_mode; /* PRP in suspend mode */ | 293 | u16 suspend_mode; /* PRP in suspend mode */ |
294 | }; | 294 | }; |
295 | 295 | ||
296 | struct wm97xx_batt_pdata { | ||
297 | int batt_aux; | ||
298 | int temp_aux; | ||
299 | int charge_gpio; | ||
300 | int min_voltage; | ||
301 | int max_voltage; | ||
302 | int batt_div; | ||
303 | int batt_mult; | ||
304 | int temp_div; | ||
305 | int temp_mult; | ||
306 | int batt_tech; | ||
307 | char *batt_name; | ||
308 | }; | ||
309 | |||
310 | struct wm97xx_pdata { | ||
311 | struct wm97xx_batt_pdata *batt_pdata; /* battery data */ | ||
312 | }; | ||
313 | |||
296 | /* | 314 | /* |
297 | * Codec GPIO access (not supported on WM9705) | 315 | * Codec GPIO access (not supported on WM9705) |
298 | * This can be used to set/get codec GPIO and Virtual GPIO status. | 316 | * This can be used to set/get codec GPIO and Virtual GPIO status. |
diff --git a/include/linux/wm97xx_batt.h b/include/linux/wm97xx_batt.h index 9681d1ab0e4f..a1d6419c2ff8 100644 --- a/include/linux/wm97xx_batt.h +++ b/include/linux/wm97xx_batt.h | |||
@@ -3,22 +3,12 @@ | |||
3 | 3 | ||
4 | #include <linux/wm97xx.h> | 4 | #include <linux/wm97xx.h> |
5 | 5 | ||
6 | struct wm97xx_batt_info { | 6 | #warning This file will be removed soon, use wm97xx.h instead! |
7 | int batt_aux; | 7 | |
8 | int temp_aux; | 8 | #define wm97xx_batt_info wm97xx_batt_pdata |
9 | int charge_gpio; | ||
10 | int min_voltage; | ||
11 | int max_voltage; | ||
12 | int batt_div; | ||
13 | int batt_mult; | ||
14 | int temp_div; | ||
15 | int temp_mult; | ||
16 | int batt_tech; | ||
17 | char *batt_name; | ||
18 | }; | ||
19 | 9 | ||
20 | #ifdef CONFIG_BATTERY_WM97XX | 10 | #ifdef CONFIG_BATTERY_WM97XX |
21 | void __init wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); | 11 | void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); |
22 | #else | 12 | #else |
23 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} | 13 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} |
24 | #endif | 14 | #endif |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 75cf58666ff9..66ebddcff664 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -110,21 +110,20 @@ extern int laptop_mode; | |||
110 | extern unsigned long determine_dirtyable_memory(void); | 110 | extern unsigned long determine_dirtyable_memory(void); |
111 | 111 | ||
112 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, | 112 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, |
113 | struct file *filp, void __user *buffer, size_t *lenp, | 113 | void __user *buffer, size_t *lenp, |
114 | loff_t *ppos); | 114 | loff_t *ppos); |
115 | extern int dirty_background_bytes_handler(struct ctl_table *table, int write, | 115 | extern int dirty_background_bytes_handler(struct ctl_table *table, int write, |
116 | struct file *filp, void __user *buffer, size_t *lenp, | 116 | void __user *buffer, size_t *lenp, |
117 | loff_t *ppos); | 117 | loff_t *ppos); |
118 | extern int dirty_ratio_handler(struct ctl_table *table, int write, | 118 | extern int dirty_ratio_handler(struct ctl_table *table, int write, |
119 | struct file *filp, void __user *buffer, size_t *lenp, | 119 | void __user *buffer, size_t *lenp, |
120 | loff_t *ppos); | 120 | loff_t *ppos); |
121 | extern int dirty_bytes_handler(struct ctl_table *table, int write, | 121 | extern int dirty_bytes_handler(struct ctl_table *table, int write, |
122 | struct file *filp, void __user *buffer, size_t *lenp, | 122 | void __user *buffer, size_t *lenp, |
123 | loff_t *ppos); | 123 | loff_t *ppos); |
124 | 124 | ||
125 | struct ctl_table; | 125 | struct ctl_table; |
126 | struct file; | 126 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, |
127 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, | ||
128 | void __user *, size_t *, loff_t *); | 127 | void __user *, size_t *, loff_t *); |
129 | 128 | ||
130 | void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty, | 129 | void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty, |