diff options
Diffstat (limited to 'include/linux')
156 files changed, 2700 insertions, 1613 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 93631229fd5c..5cae9b5960ea 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -18,7 +18,6 @@ header-y += usb/ | |||
18 | 18 | ||
19 | header-y += affs_hardblocks.h | 19 | header-y += affs_hardblocks.h |
20 | header-y += aio_abi.h | 20 | header-y += aio_abi.h |
21 | header-y += a.out.h | ||
22 | header-y += arcfb.h | 21 | header-y += arcfb.h |
23 | header-y += atmapi.h | 22 | header-y += atmapi.h |
24 | header-y += atmbr2684.h | 23 | header-y += atmbr2684.h |
@@ -60,7 +59,6 @@ header-y += dqblk_v2.h | |||
60 | header-y += dqblk_xfs.h | 59 | header-y += dqblk_xfs.h |
61 | header-y += efs_fs_sb.h | 60 | header-y += efs_fs_sb.h |
62 | header-y += elf-fdpic.h | 61 | header-y += elf-fdpic.h |
63 | header-y += elf.h | ||
64 | header-y += elf-em.h | 62 | header-y += elf-em.h |
65 | header-y += fadvise.h | 63 | header-y += fadvise.h |
66 | header-y += fd.h | 64 | header-y += fd.h |
@@ -190,6 +188,7 @@ unifdef-y += dccp.h | |||
190 | unifdef-y += dirent.h | 188 | unifdef-y += dirent.h |
191 | unifdef-y += dlm.h | 189 | unifdef-y += dlm.h |
192 | unifdef-y += edd.h | 190 | unifdef-y += edd.h |
191 | unifdef-y += elf.h | ||
193 | unifdef-y += elfcore.h | 192 | unifdef-y += elfcore.h |
194 | unifdef-y += errno.h | 193 | unifdef-y += errno.h |
195 | unifdef-y += errqueue.h | 194 | unifdef-y += errqueue.h |
@@ -339,12 +338,10 @@ unifdef-y += tty.h | |||
339 | unifdef-y += types.h | 338 | unifdef-y += types.h |
340 | unifdef-y += udf_fs_i.h | 339 | unifdef-y += udf_fs_i.h |
341 | unifdef-y += udp.h | 340 | unifdef-y += udp.h |
342 | unifdef-y += ufs_fs.h | ||
343 | unifdef-y += uinput.h | 341 | unifdef-y += uinput.h |
344 | unifdef-y += uio.h | 342 | unifdef-y += uio.h |
345 | unifdef-y += unistd.h | 343 | unifdef-y += unistd.h |
346 | unifdef-y += usbdevice_fs.h | 344 | unifdef-y += usbdevice_fs.h |
347 | unifdef-y += user.h | ||
348 | unifdef-y += utsname.h | 345 | unifdef-y += utsname.h |
349 | unifdef-y += videodev2.h | 346 | unifdef-y += videodev2.h |
350 | unifdef-y += videodev.h | 347 | unifdef-y += videodev.h |
diff --git a/include/linux/a.out.h b/include/linux/a.out.h index f913cc3e1b0d..208f4e8ed304 100644 --- a/include/linux/a.out.h +++ b/include/linux/a.out.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __A_OUT_GNU_H__ | 1 | #ifndef __A_OUT_GNU_H__ |
2 | #define __A_OUT_GNU_H__ | 2 | #define __A_OUT_GNU_H__ |
3 | 3 | ||
4 | #ifdef CONFIG_ARCH_SUPPORTS_AOUT | ||
5 | |||
4 | #define __GNU_EXEC_MACROS__ | 6 | #define __GNU_EXEC_MACROS__ |
5 | 7 | ||
6 | #ifndef __STRUCT_EXEC_OVERRIDE__ | 8 | #ifndef __STRUCT_EXEC_OVERRIDE__ |
@@ -9,6 +11,8 @@ | |||
9 | 11 | ||
10 | #endif /* __STRUCT_EXEC_OVERRIDE__ */ | 12 | #endif /* __STRUCT_EXEC_OVERRIDE__ */ |
11 | 13 | ||
14 | #ifndef __ASSEMBLY__ | ||
15 | |||
12 | /* these go in the N_MACHTYPE field */ | 16 | /* these go in the N_MACHTYPE field */ |
13 | enum machine_type { | 17 | enum machine_type { |
14 | #if defined (M_OLDSUN2) | 18 | #if defined (M_OLDSUN2) |
@@ -128,12 +132,20 @@ enum machine_type { | |||
128 | #endif | 132 | #endif |
129 | 133 | ||
130 | #ifdef linux | 134 | #ifdef linux |
135 | #ifdef __KERNEL__ | ||
131 | #include <asm/page.h> | 136 | #include <asm/page.h> |
137 | #else | ||
138 | #include <unistd.h> | ||
139 | #endif | ||
132 | #if defined(__i386__) || defined(__mc68000__) | 140 | #if defined(__i386__) || defined(__mc68000__) |
133 | #define SEGMENT_SIZE 1024 | 141 | #define SEGMENT_SIZE 1024 |
134 | #else | 142 | #else |
135 | #ifndef SEGMENT_SIZE | 143 | #ifndef SEGMENT_SIZE |
144 | #ifdef __KERNEL__ | ||
136 | #define SEGMENT_SIZE PAGE_SIZE | 145 | #define SEGMENT_SIZE PAGE_SIZE |
146 | #else | ||
147 | #define SEGMENT_SIZE getpagesize() | ||
148 | #endif | ||
137 | #endif | 149 | #endif |
138 | #endif | 150 | #endif |
139 | #endif | 151 | #endif |
@@ -264,5 +276,11 @@ struct relocation_info | |||
264 | }; | 276 | }; |
265 | #endif /* no N_RELOCATION_INFO_DECLARED. */ | 277 | #endif /* no N_RELOCATION_INFO_DECLARED. */ |
266 | 278 | ||
267 | 279 | #endif /*__ASSEMBLY__ */ | |
280 | #else /* CONFIG_ARCH_SUPPORTS_AOUT */ | ||
281 | #ifndef __ASSEMBLY__ | ||
282 | struct exec { | ||
283 | }; | ||
284 | #endif | ||
285 | #endif /* CONFIG_ARCH_SUPPORTS_AOUT */ | ||
268 | #endif /* __A_OUT_GNU_H__ */ | 286 | #endif /* __A_OUT_GNU_H__ */ |
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index 22eb9367235a..0260c3e79fdd 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h | |||
@@ -326,11 +326,7 @@ struct ac97_ops | |||
326 | #define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */ | 326 | #define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */ |
327 | }; | 327 | }; |
328 | 328 | ||
329 | extern int ac97_read_proc (char *page_out, char **start, off_t off, | ||
330 | int count, int *eof, void *data); | ||
331 | extern int ac97_probe_codec(struct ac97_codec *); | 329 | extern int ac97_probe_codec(struct ac97_codec *); |
332 | extern unsigned int ac97_set_adc_rate(struct ac97_codec *codec, unsigned int rate); | ||
333 | extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate); | ||
334 | 330 | ||
335 | extern struct ac97_codec *ac97_alloc_codec(void); | 331 | extern struct ac97_codec *ac97_alloc_codec(void); |
336 | extern void ac97_release_codec(struct ac97_codec *codec); | 332 | extern void ac97_release_codec(struct ac97_codec *codec); |
@@ -363,7 +359,4 @@ struct ac97_quirk { | |||
363 | int type; /* quirk type above */ | 359 | int type; /* quirk type above */ |
364 | }; | 360 | }; |
365 | 361 | ||
366 | struct pci_dev; | ||
367 | extern int ac97_tune_hardware(struct pci_dev *pdev, struct ac97_quirk *quirk, int override); | ||
368 | |||
369 | #endif /* _AC97_CODEC_H_ */ | 362 | #endif /* _AC97_CODEC_H_ */ |
diff --git a/include/linux/acct.h b/include/linux/acct.h index 302eb727ecb8..e8cae54e8d88 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
@@ -173,7 +173,11 @@ typedef struct acct acct_t; | |||
173 | static inline u32 jiffies_to_AHZ(unsigned long x) | 173 | static inline u32 jiffies_to_AHZ(unsigned long x) |
174 | { | 174 | { |
175 | #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 | 175 | #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 |
176 | # if HZ < AHZ | ||
177 | return x * (AHZ / HZ); | ||
178 | # else | ||
176 | return x / (HZ / AHZ); | 179 | return x / (HZ / AHZ); |
180 | # endif | ||
177 | #else | 181 | #else |
178 | u64 tmp = (u64)x * TICK_NSEC; | 182 | u64 tmp = (u64)x * TICK_NSEC; |
179 | do_div(tmp, (NSEC_PER_SEC / AHZ)); | 183 | do_div(tmp, (NSEC_PER_SEC / AHZ)); |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 63f2e6ed698f..ddbe7efe590e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #ifndef _LINUX_ACPI_H | 25 | #ifndef _LINUX_ACPI_H |
26 | #define _LINUX_ACPI_H | 26 | #define _LINUX_ACPI_H |
27 | 27 | ||
28 | #include <linux/ioport.h> /* for struct resource */ | ||
28 | 29 | ||
29 | #ifdef CONFIG_ACPI | 30 | #ifdef CONFIG_ACPI |
30 | 31 | ||
@@ -43,8 +44,6 @@ | |||
43 | #include <linux/dmi.h> | 44 | #include <linux/dmi.h> |
44 | 45 | ||
45 | 46 | ||
46 | #ifdef CONFIG_ACPI | ||
47 | |||
48 | enum acpi_irq_model_id { | 47 | enum acpi_irq_model_id { |
49 | ACPI_IRQ_MODEL_PIC = 0, | 48 | ACPI_IRQ_MODEL_PIC = 0, |
50 | ACPI_IRQ_MODEL_IOAPIC, | 49 | ACPI_IRQ_MODEL_IOAPIC, |
@@ -80,7 +79,6 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table); | |||
80 | typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); | 79 | typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); |
81 | 80 | ||
82 | char * __acpi_map_table (unsigned long phys_addr, unsigned long size); | 81 | char * __acpi_map_table (unsigned long phys_addr, unsigned long size); |
83 | unsigned long acpi_find_rsdp (void); | ||
84 | int acpi_boot_init (void); | 82 | int acpi_boot_init (void); |
85 | int acpi_boot_table_init (void); | 83 | int acpi_boot_table_init (void); |
86 | int acpi_numa_init (void); | 84 | int acpi_numa_init (void); |
@@ -115,8 +113,8 @@ int acpi_unmap_lsapic(int cpu); | |||
115 | 113 | ||
116 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); | 114 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); |
117 | int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); | 115 | int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); |
118 | 116 | void acpi_irq_stats_init(void); | |
119 | extern int acpi_mp_config; | 117 | extern u32 acpi_irq_handled; |
120 | 118 | ||
121 | extern struct acpi_mcfg_allocation *pci_mmcfg_config; | 119 | extern struct acpi_mcfg_allocation *pci_mmcfg_config; |
122 | extern int pci_mmcfg_config_num; | 120 | extern int pci_mmcfg_config_num; |
@@ -124,12 +122,6 @@ extern int pci_mmcfg_config_num; | |||
124 | extern int sbf_port; | 122 | extern int sbf_port; |
125 | extern unsigned long acpi_realmode_flags; | 123 | extern unsigned long acpi_realmode_flags; |
126 | 124 | ||
127 | #else /* !CONFIG_ACPI */ | ||
128 | |||
129 | #define acpi_mp_config 0 | ||
130 | |||
131 | #endif /* !CONFIG_ACPI */ | ||
132 | |||
133 | int acpi_register_gsi (u32 gsi, int triggering, int polarity); | 125 | int acpi_register_gsi (u32 gsi, int triggering, int polarity); |
134 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); | 126 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); |
135 | 127 | ||
@@ -145,8 +137,6 @@ extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity); | |||
145 | */ | 137 | */ |
146 | void acpi_unregister_gsi (u32 gsi); | 138 | void acpi_unregister_gsi (u32 gsi); |
147 | 139 | ||
148 | #ifdef CONFIG_ACPI | ||
149 | |||
150 | struct acpi_prt_entry { | 140 | struct acpi_prt_entry { |
151 | struct list_head node; | 141 | struct list_head node; |
152 | struct acpi_pci_id id; | 142 | struct acpi_pci_id id; |
@@ -179,8 +169,6 @@ struct acpi_pci_driver { | |||
179 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); | 169 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); |
180 | void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); | 170 | void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); |
181 | 171 | ||
182 | #endif /* CONFIG_ACPI */ | ||
183 | |||
184 | #ifdef CONFIG_ACPI_EC | 172 | #ifdef CONFIG_ACPI_EC |
185 | 173 | ||
186 | extern int ec_read(u8 addr, u8 *val); | 174 | extern int ec_read(u8 addr, u8 *val); |
@@ -192,6 +180,26 @@ extern int ec_transaction(u8 command, | |||
192 | 180 | ||
193 | #endif /*CONFIG_ACPI_EC*/ | 181 | #endif /*CONFIG_ACPI_EC*/ |
194 | 182 | ||
183 | #if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE) | ||
184 | |||
185 | typedef void (*wmi_notify_handler) (u32 value, void *context); | ||
186 | |||
187 | extern acpi_status wmi_evaluate_method(const char *guid, u8 instance, | ||
188 | u32 method_id, | ||
189 | const struct acpi_buffer *in, | ||
190 | struct acpi_buffer *out); | ||
191 | extern acpi_status wmi_query_block(const char *guid, u8 instance, | ||
192 | struct acpi_buffer *out); | ||
193 | extern acpi_status wmi_set_block(const char *guid, u8 instance, | ||
194 | const struct acpi_buffer *in); | ||
195 | extern acpi_status wmi_install_notify_handler(const char *guid, | ||
196 | wmi_notify_handler handler, void *data); | ||
197 | extern acpi_status wmi_remove_notify_handler(const char *guid); | ||
198 | extern acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out); | ||
199 | extern bool wmi_has_guid(const char *guid); | ||
200 | |||
201 | #endif /* CONFIG_ACPI_WMI */ | ||
202 | |||
195 | extern int acpi_blacklisted(void); | 203 | extern int acpi_blacklisted(void); |
196 | #ifdef CONFIG_DMI | 204 | #ifdef CONFIG_DMI |
197 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); | 205 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); |
@@ -217,6 +225,13 @@ extern int pnpacpi_disabled; | |||
217 | #define PXM_INVAL (-1) | 225 | #define PXM_INVAL (-1) |
218 | #define NID_INVAL (-1) | 226 | #define NID_INVAL (-1) |
219 | 227 | ||
228 | int acpi_check_resource_conflict(struct resource *res); | ||
229 | |||
230 | int acpi_check_region(resource_size_t start, resource_size_t n, | ||
231 | const char *name); | ||
232 | int acpi_check_mem_region(resource_size_t start, resource_size_t n, | ||
233 | const char *name); | ||
234 | |||
220 | #else /* CONFIG_ACPI */ | 235 | #else /* CONFIG_ACPI */ |
221 | 236 | ||
222 | static inline int acpi_boot_init(void) | 237 | static inline int acpi_boot_init(void) |
@@ -229,5 +244,22 @@ static inline int acpi_boot_table_init(void) | |||
229 | return 0; | 244 | return 0; |
230 | } | 245 | } |
231 | 246 | ||
247 | static inline int acpi_check_resource_conflict(struct resource *res) | ||
248 | { | ||
249 | return 0; | ||
250 | } | ||
251 | |||
252 | static inline int acpi_check_region(resource_size_t start, resource_size_t n, | ||
253 | const char *name) | ||
254 | { | ||
255 | return 0; | ||
256 | } | ||
257 | |||
258 | static inline int acpi_check_mem_region(resource_size_t start, | ||
259 | resource_size_t n, const char *name) | ||
260 | { | ||
261 | return 0; | ||
262 | } | ||
263 | |||
232 | #endif /* !CONFIG_ACPI */ | 264 | #endif /* !CONFIG_ACPI */ |
233 | #endif /*_LINUX_ACPI_H*/ | 265 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index abc521cfb084..03e34547d489 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h | |||
@@ -109,6 +109,7 @@ extern int agp_unbind_memory(struct agp_memory *); | |||
109 | extern void agp_enable(struct agp_bridge_data *, u32); | 109 | extern void agp_enable(struct agp_bridge_data *, u32); |
110 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); | 110 | extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); |
111 | extern void agp_backend_release(struct agp_bridge_data *); | 111 | extern void agp_backend_release(struct agp_bridge_data *); |
112 | extern void agp_flush_chipset(struct agp_bridge_data *); | ||
112 | 113 | ||
113 | #endif /* __KERNEL__ */ | 114 | #endif /* __KERNEL__ */ |
114 | #endif /* _AGP_BACKEND_H */ | 115 | #endif /* _AGP_BACKEND_H */ |
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h index 09fbf7e5a6cb..62aef589eb94 100644 --- a/include/linux/agpgart.h +++ b/include/linux/agpgart.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int) | 38 | #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int) |
39 | #define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*) | 39 | #define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*) |
40 | #define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*) | 40 | #define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*) |
41 | #define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10) | ||
41 | 42 | ||
42 | #define AGP_DEVICE "/dev/agpgart" | 43 | #define AGP_DEVICE "/dev/agpgart" |
43 | 44 | ||
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h index bdca3f1b3213..eb640f0acfac 100644 --- a/include/linux/async_tx.h +++ b/include/linux/async_tx.h | |||
@@ -47,7 +47,6 @@ struct dma_chan_ref { | |||
47 | * address is an implied source, whereas the asynchronous case it must be listed | 47 | * address is an implied source, whereas the asynchronous case it must be listed |
48 | * as a source. The destination address must be the first address in the source | 48 | * as a source. The destination address must be the first address in the source |
49 | * array. | 49 | * array. |
50 | * @ASYNC_TX_ASSUME_COHERENT: skip cache maintenance operations | ||
51 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a | 50 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a |
52 | * dependency chain | 51 | * dependency chain |
53 | * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. | 52 | * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. |
@@ -55,7 +54,6 @@ struct dma_chan_ref { | |||
55 | enum async_tx_flags { | 54 | enum async_tx_flags { |
56 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), | 55 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), |
57 | ASYNC_TX_XOR_DROP_DST = (1 << 1), | 56 | ASYNC_TX_XOR_DROP_DST = (1 << 1), |
58 | ASYNC_TX_ASSUME_COHERENT = (1 << 2), | ||
59 | ASYNC_TX_ACK = (1 << 3), | 57 | ASYNC_TX_ACK = (1 << 3), |
60 | ASYNC_TX_DEP_ACK = (1 << 4), | 58 | ASYNC_TX_DEP_ACK = (1 << 4), |
61 | }; | 59 | }; |
@@ -64,9 +62,15 @@ enum async_tx_flags { | |||
64 | void async_tx_issue_pending_all(void); | 62 | void async_tx_issue_pending_all(void); |
65 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); | 63 | enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); |
66 | void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx); | 64 | void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx); |
65 | #ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL | ||
66 | #include <asm/async_tx.h> | ||
67 | #else | ||
68 | #define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \ | ||
69 | __async_tx_find_channel(dep, type) | ||
67 | struct dma_chan * | 70 | struct dma_chan * |
68 | async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | 71 | __async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, |
69 | enum dma_transaction_type tx_type); | 72 | enum dma_transaction_type tx_type); |
73 | #endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */ | ||
70 | #else | 74 | #else |
71 | static inline void async_tx_issue_pending_all(void) | 75 | static inline void async_tx_issue_pending_all(void) |
72 | { | 76 | { |
@@ -88,7 +92,8 @@ async_tx_run_dependencies(struct dma_async_tx_descriptor *tx, | |||
88 | 92 | ||
89 | static inline struct dma_chan * | 93 | static inline struct dma_chan * |
90 | async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | 94 | async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, |
91 | enum dma_transaction_type tx_type) | 95 | enum dma_transaction_type tx_type, struct page **dst, int dst_count, |
96 | struct page **src, int src_count, size_t len) | ||
92 | { | 97 | { |
93 | return NULL; | 98 | return NULL; |
94 | } | 99 | } |
diff --git a/include/linux/pata_platform.h b/include/linux/ata_platform.h index 6a7a92db294c..b856a2a590d9 100644 --- a/include/linux/pata_platform.h +++ b/include/linux/ata_platform.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __LINUX_PATA_PLATFORM_H | 1 | #ifndef __LINUX_ATA_PLATFORM_H |
2 | #define __LINUX_PATA_PLATFORM_H | 2 | #define __LINUX_ATA_PLATFORM_H |
3 | 3 | ||
4 | struct pata_platform_info { | 4 | struct pata_platform_info { |
5 | /* | 5 | /* |
@@ -24,4 +24,11 @@ extern int __devinit __pata_platform_probe(struct device *dev, | |||
24 | 24 | ||
25 | extern int __devexit __pata_platform_remove(struct device *dev); | 25 | extern int __devexit __pata_platform_remove(struct device *dev); |
26 | 26 | ||
27 | #endif /* __LINUX_PATA_PLATFORM_H */ | 27 | /* |
28 | * Marvell SATA private data | ||
29 | */ | ||
30 | struct mv_sata_platform_data { | ||
31 | int n_ports; /* number of sata ports */ | ||
32 | }; | ||
33 | |||
34 | #endif /* __LINUX_ATA_PLATFORM_H */ | ||
diff --git a/include/linux/atmel_pwm.h b/include/linux/atmel_pwm.h new file mode 100644 index 000000000000..ea04abb3db8e --- /dev/null +++ b/include/linux/atmel_pwm.h | |||
@@ -0,0 +1,70 @@ | |||
1 | #ifndef __LINUX_ATMEL_PWM_H | ||
2 | #define __LINUX_ATMEL_PWM_H | ||
3 | |||
4 | /** | ||
5 | * struct pwm_channel - driver handle to a PWM channel | ||
6 | * @regs: base of this channel's registers | ||
7 | * @index: number of this channel (0..31) | ||
8 | * @mck: base clock rate, which can be prescaled and maybe subdivided | ||
9 | * | ||
10 | * Drivers initialize a pwm_channel structure using pwm_channel_alloc(). | ||
11 | * Then they configure its clock rate (derived from MCK), alignment, | ||
12 | * polarity, and duty cycle by writing directly to the channel registers, | ||
13 | * before enabling the channel by calling pwm_channel_enable(). | ||
14 | * | ||
15 | * After emitting a PWM signal for the desired length of time, drivers | ||
16 | * may then pwm_channel_disable() or pwm_channel_free(). Both of these | ||
17 | * disable the channel, but when it's freed the IRQ is deconfigured and | ||
18 | * the channel must later be re-allocated and reconfigured. | ||
19 | * | ||
20 | * Note that if the period or duty cycle need to be changed while the | ||
21 | * PWM channel is operating, drivers must use the PWM_CUPD double buffer | ||
22 | * mechanism, either polling until they change or getting implicitly | ||
23 | * notified through a once-per-period interrupt handler. | ||
24 | */ | ||
25 | struct pwm_channel { | ||
26 | void __iomem *regs; | ||
27 | unsigned index; | ||
28 | unsigned long mck; | ||
29 | }; | ||
30 | |||
31 | extern int pwm_channel_alloc(int index, struct pwm_channel *ch); | ||
32 | extern int pwm_channel_free(struct pwm_channel *ch); | ||
33 | |||
34 | extern int pwm_clk_alloc(unsigned prescale, unsigned div); | ||
35 | extern void pwm_clk_free(unsigned clk); | ||
36 | |||
37 | extern int __pwm_channel_onoff(struct pwm_channel *ch, int enabled); | ||
38 | |||
39 | #define pwm_channel_enable(ch) __pwm_channel_onoff((ch), 1) | ||
40 | #define pwm_channel_disable(ch) __pwm_channel_onoff((ch), 0) | ||
41 | |||
42 | /* periodic interrupts, mostly for CUPD changes to period or cycle */ | ||
43 | extern int pwm_channel_handler(struct pwm_channel *ch, | ||
44 | void (*handler)(struct pwm_channel *ch)); | ||
45 | |||
46 | /* per-channel registers (banked at pwm_channel->regs) */ | ||
47 | #define PWM_CMR 0x00 /* mode register */ | ||
48 | #define PWM_CPR_CPD (1 << 10) /* set: CUPD modifies period */ | ||
49 | #define PWM_CPR_CPOL (1 << 9) /* set: idle high */ | ||
50 | #define PWM_CPR_CALG (1 << 8) /* set: center align */ | ||
51 | #define PWM_CPR_CPRE (0xf << 0) /* mask: rate is mck/(2^pre) */ | ||
52 | #define PWM_CPR_CLKA (0xb << 0) /* rate CLKA */ | ||
53 | #define PWM_CPR_CLKB (0xc << 0) /* rate CLKB */ | ||
54 | #define PWM_CDTY 0x04 /* duty cycle (max of CPRD) */ | ||
55 | #define PWM_CPRD 0x08 /* period (count up from zero) */ | ||
56 | #define PWM_CCNT 0x0c /* counter (20 bits?) */ | ||
57 | #define PWM_CUPD 0x10 /* update CPRD (or CDTY) next period */ | ||
58 | |||
59 | static inline void | ||
60 | pwm_channel_writel(struct pwm_channel *pwmc, unsigned offset, u32 val) | ||
61 | { | ||
62 | __raw_writel(val, pwmc->regs + offset); | ||
63 | } | ||
64 | |||
65 | static inline u32 pwm_channel_readl(struct pwm_channel *pwmc, unsigned offset) | ||
66 | { | ||
67 | return __raw_readl(pwmc->regs + offset); | ||
68 | } | ||
69 | |||
70 | #endif /* __LINUX_ATMEL_PWM_H */ | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 90392a9d7a9c..e1888cc5b8ae 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -137,7 +137,9 @@ enum rq_flag_bits { | |||
137 | #define BLK_MAX_CDB 16 | 137 | #define BLK_MAX_CDB 16 |
138 | 138 | ||
139 | /* | 139 | /* |
140 | * try to put the fields that are referenced together in the same cacheline | 140 | * try to put the fields that are referenced together in the same cacheline. |
141 | * if you modify this structure, be sure to check block/blk-core.c:rq_init() | ||
142 | * as well! | ||
141 | */ | 143 | */ |
142 | struct request { | 144 | struct request { |
143 | struct list_head queuelist; | 145 | struct list_head queuelist; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 0365ec9fc0c9..4e4e340592fb 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -60,8 +60,20 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata, | |||
60 | unsigned long goal, | 60 | unsigned long goal, |
61 | unsigned long limit); | 61 | unsigned long limit); |
62 | 62 | ||
63 | /* | ||
64 | * flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | ||
65 | * the architecture-specific code should honor this) | ||
66 | */ | ||
67 | #define BOOTMEM_DEFAULT 0 | ||
68 | #define BOOTMEM_EXCLUSIVE (1<<0) | ||
69 | |||
63 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 70 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
64 | extern void reserve_bootmem(unsigned long addr, unsigned long size); | 71 | /* |
72 | * If flags is 0, then the return value is always 0 (success). If | ||
73 | * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the | ||
74 | * memory already was reserved. | ||
75 | */ | ||
76 | extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | ||
65 | #define alloc_bootmem(x) \ | 77 | #define alloc_bootmem(x) \ |
66 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 78 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
67 | #define alloc_bootmem_low(x) \ | 79 | #define alloc_bootmem_low(x) \ |
@@ -84,7 +96,8 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat, | |||
84 | unsigned long endpfn); | 96 | unsigned long endpfn); |
85 | extern void reserve_bootmem_node(pg_data_t *pgdat, | 97 | extern void reserve_bootmem_node(pg_data_t *pgdat, |
86 | unsigned long physaddr, | 98 | unsigned long physaddr, |
87 | unsigned long size); | 99 | unsigned long size, |
100 | int flags); | ||
88 | extern void free_bootmem_node(pg_data_t *pgdat, | 101 | extern void free_bootmem_node(pg_data_t *pgdat, |
89 | unsigned long addr, | 102 | unsigned long addr, |
90 | unsigned long size); | 103 | unsigned long size); |
diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h index 3dc715b02500..d3771551fdd9 100644 --- a/include/linux/byteorder/generic.h +++ b/include/linux/byteorder/generic.h | |||
@@ -146,6 +146,36 @@ | |||
146 | #define htons(x) ___htons(x) | 146 | #define htons(x) ___htons(x) |
147 | #define ntohs(x) ___ntohs(x) | 147 | #define ntohs(x) ___ntohs(x) |
148 | 148 | ||
149 | static inline void le16_add_cpu(__le16 *var, u16 val) | ||
150 | { | ||
151 | *var = cpu_to_le16(le16_to_cpu(*var) + val); | ||
152 | } | ||
153 | |||
154 | static inline void le32_add_cpu(__le32 *var, u32 val) | ||
155 | { | ||
156 | *var = cpu_to_le32(le32_to_cpu(*var) + val); | ||
157 | } | ||
158 | |||
159 | static inline void le64_add_cpu(__le64 *var, u64 val) | ||
160 | { | ||
161 | *var = cpu_to_le64(le64_to_cpu(*var) + val); | ||
162 | } | ||
163 | |||
164 | static inline void be16_add_cpu(__be16 *var, u16 val) | ||
165 | { | ||
166 | *var = cpu_to_be16(be16_to_cpu(*var) + val); | ||
167 | } | ||
168 | |||
169 | static inline void be32_add_cpu(__be32 *var, u32 val) | ||
170 | { | ||
171 | *var = cpu_to_be32(be32_to_cpu(*var) + val); | ||
172 | } | ||
173 | |||
174 | static inline void be64_add_cpu(__be64 *var, u64 val) | ||
175 | { | ||
176 | *var = cpu_to_be64(be64_to_cpu(*var) + val); | ||
177 | } | ||
178 | |||
149 | #endif /* KERNEL */ | 179 | #endif /* KERNEL */ |
150 | 180 | ||
151 | #endif /* _LINUX_BYTEORDER_GENERIC_H */ | 181 | #endif /* _LINUX_BYTEORDER_GENERIC_H */ |
diff --git a/include/linux/capability.h b/include/linux/capability.h index bb017edffd56..7d50ff6d269f 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -14,7 +14,6 @@ | |||
14 | #define _LINUX_CAPABILITY_H | 14 | #define _LINUX_CAPABILITY_H |
15 | 15 | ||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/compiler.h> | ||
18 | 17 | ||
19 | struct task_struct; | 18 | struct task_struct; |
20 | 19 | ||
@@ -23,13 +22,20 @@ struct task_struct; | |||
23 | kernel might be somewhat backwards compatible, but don't bet on | 22 | kernel might be somewhat backwards compatible, but don't bet on |
24 | it. */ | 23 | it. */ |
25 | 24 | ||
26 | /* XXX - Note, cap_t, is defined by POSIX to be an "opaque" pointer to | 25 | /* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to |
27 | a set of three capability sets. The transposition of 3*the | 26 | a set of three capability sets. The transposition of 3*the |
28 | following structure to such a composite is better handled in a user | 27 | following structure to such a composite is better handled in a user |
29 | library since the draft standard requires the use of malloc/free | 28 | library since the draft standard requires the use of malloc/free |
30 | etc.. */ | 29 | etc.. */ |
31 | 30 | ||
32 | #define _LINUX_CAPABILITY_VERSION 0x19980330 | 31 | #define _LINUX_CAPABILITY_VERSION_1 0x19980330 |
32 | #define _LINUX_CAPABILITY_U32S_1 1 | ||
33 | |||
34 | #define _LINUX_CAPABILITY_VERSION_2 0x20071026 | ||
35 | #define _LINUX_CAPABILITY_U32S_2 2 | ||
36 | |||
37 | #define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_2 | ||
38 | #define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_2 | ||
33 | 39 | ||
34 | typedef struct __user_cap_header_struct { | 40 | typedef struct __user_cap_header_struct { |
35 | __u32 version; | 41 | __u32 version; |
@@ -42,41 +48,42 @@ typedef struct __user_cap_data_struct { | |||
42 | __u32 inheritable; | 48 | __u32 inheritable; |
43 | } __user *cap_user_data_t; | 49 | } __user *cap_user_data_t; |
44 | 50 | ||
51 | |||
45 | #define XATTR_CAPS_SUFFIX "capability" | 52 | #define XATTR_CAPS_SUFFIX "capability" |
46 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | 53 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX |
47 | 54 | ||
48 | #define XATTR_CAPS_SZ (3*sizeof(__le32)) | ||
49 | #define VFS_CAP_REVISION_MASK 0xFF000000 | 55 | #define VFS_CAP_REVISION_MASK 0xFF000000 |
56 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK | ||
57 | #define VFS_CAP_FLAGS_EFFECTIVE 0x000001 | ||
58 | |||
50 | #define VFS_CAP_REVISION_1 0x01000000 | 59 | #define VFS_CAP_REVISION_1 0x01000000 |
60 | #define VFS_CAP_U32_1 1 | ||
61 | #define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1)) | ||
51 | 62 | ||
52 | #define VFS_CAP_REVISION VFS_CAP_REVISION_1 | 63 | #define VFS_CAP_REVISION_2 0x02000000 |
64 | #define VFS_CAP_U32_2 2 | ||
65 | #define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2)) | ||
66 | |||
67 | #define XATTR_CAPS_SZ XATTR_CAPS_SZ_2 | ||
68 | #define VFS_CAP_U32 VFS_CAP_U32_2 | ||
69 | #define VFS_CAP_REVISION VFS_CAP_REVISION_2 | ||
53 | 70 | ||
54 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK | ||
55 | #define VFS_CAP_FLAGS_EFFECTIVE 0x000001 | ||
56 | 71 | ||
57 | struct vfs_cap_data { | 72 | struct vfs_cap_data { |
58 | __u32 magic_etc; /* Little endian */ | 73 | __le32 magic_etc; /* Little endian */ |
59 | __u32 permitted; /* Little endian */ | 74 | struct { |
60 | __u32 inheritable; /* Little endian */ | 75 | __le32 permitted; /* Little endian */ |
76 | __le32 inheritable; /* Little endian */ | ||
77 | } data[VFS_CAP_U32]; | ||
61 | }; | 78 | }; |
62 | 79 | ||
63 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
64 | 81 | ||
65 | /* #define STRICT_CAP_T_TYPECHECKS */ | ||
66 | |||
67 | #ifdef STRICT_CAP_T_TYPECHECKS | ||
68 | |||
69 | typedef struct kernel_cap_struct { | 82 | typedef struct kernel_cap_struct { |
70 | __u32 cap; | 83 | __u32 cap[_LINUX_CAPABILITY_U32S]; |
71 | } kernel_cap_t; | 84 | } kernel_cap_t; |
72 | 85 | ||
73 | #else | 86 | #define _USER_CAP_HEADER_SIZE (sizeof(struct __user_cap_header_struct)) |
74 | |||
75 | typedef __u32 kernel_cap_t; | ||
76 | |||
77 | #endif | ||
78 | |||
79 | #define _USER_CAP_HEADER_SIZE (2*sizeof(__u32)) | ||
80 | #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) | 87 | #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) |
81 | 88 | ||
82 | #endif | 89 | #endif |
@@ -119,10 +126,6 @@ typedef __u32 kernel_cap_t; | |||
119 | 126 | ||
120 | #define CAP_FSETID 4 | 127 | #define CAP_FSETID 4 |
121 | 128 | ||
122 | /* Used to decide between falling back on the old suser() or fsuser(). */ | ||
123 | |||
124 | #define CAP_FS_MASK 0x1f | ||
125 | |||
126 | /* Overrides the restriction that the real or effective user ID of a | 129 | /* Overrides the restriction that the real or effective user ID of a |
127 | process sending a signal must match the real or effective user ID | 130 | process sending a signal must match the real or effective user ID |
128 | of the process receiving the signal. */ | 131 | of the process receiving the signal. */ |
@@ -145,8 +148,14 @@ typedef __u32 kernel_cap_t; | |||
145 | ** Linux-specific capabilities | 148 | ** Linux-specific capabilities |
146 | **/ | 149 | **/ |
147 | 150 | ||
148 | /* Transfer any capability in your permitted set to any pid, | 151 | /* Without VFS support for capabilities: |
149 | remove any capability in your permitted set from any pid */ | 152 | * Transfer any capability in your permitted set to any pid, |
153 | * remove any capability in your permitted set from any pid | ||
154 | * With VFS support for capabilities (neither of above, but) | ||
155 | * Add any capability from current's capability bounding set | ||
156 | * to the current process' inheritable set | ||
157 | * Allow taking bits out of capability bounding set | ||
158 | */ | ||
150 | 159 | ||
151 | #define CAP_SETPCAP 8 | 160 | #define CAP_SETPCAP 8 |
152 | 161 | ||
@@ -195,7 +204,6 @@ typedef __u32 kernel_cap_t; | |||
195 | #define CAP_IPC_OWNER 15 | 204 | #define CAP_IPC_OWNER 15 |
196 | 205 | ||
197 | /* Insert and remove kernel modules - modify kernel without limit */ | 206 | /* Insert and remove kernel modules - modify kernel without limit */ |
198 | /* Modify cap_bset */ | ||
199 | #define CAP_SYS_MODULE 16 | 207 | #define CAP_SYS_MODULE 16 |
200 | 208 | ||
201 | /* Allow ioperm/iopl access */ | 209 | /* Allow ioperm/iopl access */ |
@@ -307,74 +315,183 @@ typedef __u32 kernel_cap_t; | |||
307 | 315 | ||
308 | #define CAP_SETFCAP 31 | 316 | #define CAP_SETFCAP 31 |
309 | 317 | ||
318 | /* Override MAC access. | ||
319 | The base kernel enforces no MAC policy. | ||
320 | An LSM may enforce a MAC policy, and if it does and it chooses | ||
321 | to implement capability based overrides of that policy, this is | ||
322 | the capability it should use to do so. */ | ||
323 | |||
324 | #define CAP_MAC_OVERRIDE 32 | ||
325 | |||
326 | /* Allow MAC configuration or state changes. | ||
327 | The base kernel requires no MAC configuration. | ||
328 | An LSM may enforce a MAC policy, and if it does and it chooses | ||
329 | to implement capability based checks on modifications to that | ||
330 | policy or the data required to maintain it, this is the | ||
331 | capability it should use to do so. */ | ||
332 | |||
333 | #define CAP_MAC_ADMIN 33 | ||
334 | |||
335 | #define CAP_LAST_CAP CAP_MAC_ADMIN | ||
336 | |||
337 | #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP) | ||
338 | |||
339 | /* | ||
340 | * Bit location of each capability (used by user-space library and kernel) | ||
341 | */ | ||
342 | |||
343 | #define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */ | ||
344 | #define CAP_TO_MASK(x) (1 << ((x) & 31)) /* mask for indexed __u32 */ | ||
345 | |||
310 | #ifdef __KERNEL__ | 346 | #ifdef __KERNEL__ |
311 | 347 | ||
312 | /* | 348 | /* |
313 | * Internal kernel functions only | 349 | * Internal kernel functions only |
314 | */ | 350 | */ |
315 | 351 | ||
316 | #ifdef STRICT_CAP_T_TYPECHECKS | 352 | #define CAP_FOR_EACH_U32(__capi) \ |
353 | for (__capi = 0; __capi < _LINUX_CAPABILITY_U32S; ++__capi) | ||
354 | |||
355 | # define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \ | ||
356 | | CAP_TO_MASK(CAP_DAC_OVERRIDE) \ | ||
357 | | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \ | ||
358 | | CAP_TO_MASK(CAP_FOWNER) \ | ||
359 | | CAP_TO_MASK(CAP_FSETID)) | ||
360 | |||
361 | # define CAP_FS_MASK_B1 (CAP_TO_MASK(CAP_MAC_OVERRIDE)) | ||
362 | |||
363 | #if _LINUX_CAPABILITY_U32S != 2 | ||
364 | # error Fix up hand-coded capability macro initializers | ||
365 | #else /* HAND-CODED capability initializers */ | ||
366 | |||
367 | # define CAP_EMPTY_SET {{ 0, 0 }} | ||
368 | # define CAP_FULL_SET {{ ~0, ~0 }} | ||
369 | # define CAP_INIT_EFF_SET {{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }} | ||
370 | # define CAP_FS_SET {{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } } | ||
371 | # define CAP_NFSD_SET {{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \ | ||
372 | CAP_FS_MASK_B1 } } | ||
373 | |||
374 | #endif /* _LINUX_CAPABILITY_U32S != 2 */ | ||
375 | |||
376 | #define CAP_INIT_INH_SET CAP_EMPTY_SET | ||
377 | |||
378 | # define cap_clear(c) do { (c) = __cap_empty_set; } while (0) | ||
379 | # define cap_set_full(c) do { (c) = __cap_full_set; } while (0) | ||
380 | # define cap_set_init_eff(c) do { (c) = __cap_init_eff_set; } while (0) | ||
381 | |||
382 | #define cap_raise(c, flag) ((c).cap[CAP_TO_INDEX(flag)] |= CAP_TO_MASK(flag)) | ||
383 | #define cap_lower(c, flag) ((c).cap[CAP_TO_INDEX(flag)] &= ~CAP_TO_MASK(flag)) | ||
384 | #define cap_raised(c, flag) ((c).cap[CAP_TO_INDEX(flag)] & CAP_TO_MASK(flag)) | ||
385 | |||
386 | #define CAP_BOP_ALL(c, a, b, OP) \ | ||
387 | do { \ | ||
388 | unsigned __capi; \ | ||
389 | CAP_FOR_EACH_U32(__capi) { \ | ||
390 | c.cap[__capi] = a.cap[__capi] OP b.cap[__capi]; \ | ||
391 | } \ | ||
392 | } while (0) | ||
393 | |||
394 | #define CAP_UOP_ALL(c, a, OP) \ | ||
395 | do { \ | ||
396 | unsigned __capi; \ | ||
397 | CAP_FOR_EACH_U32(__capi) { \ | ||
398 | c.cap[__capi] = OP a.cap[__capi]; \ | ||
399 | } \ | ||
400 | } while (0) | ||
401 | |||
402 | static inline kernel_cap_t cap_combine(const kernel_cap_t a, | ||
403 | const kernel_cap_t b) | ||
404 | { | ||
405 | kernel_cap_t dest; | ||
406 | CAP_BOP_ALL(dest, a, b, |); | ||
407 | return dest; | ||
408 | } | ||
317 | 409 | ||
318 | #define to_cap_t(x) { x } | 410 | static inline kernel_cap_t cap_intersect(const kernel_cap_t a, |
319 | #define cap_t(x) (x).cap | 411 | const kernel_cap_t b) |
412 | { | ||
413 | kernel_cap_t dest; | ||
414 | CAP_BOP_ALL(dest, a, b, &); | ||
415 | return dest; | ||
416 | } | ||
320 | 417 | ||
321 | #else | 418 | static inline kernel_cap_t cap_drop(const kernel_cap_t a, |
419 | const kernel_cap_t drop) | ||
420 | { | ||
421 | kernel_cap_t dest; | ||
422 | CAP_BOP_ALL(dest, a, drop, &~); | ||
423 | return dest; | ||
424 | } | ||
322 | 425 | ||
323 | #define to_cap_t(x) (x) | 426 | static inline kernel_cap_t cap_invert(const kernel_cap_t c) |
324 | #define cap_t(x) (x) | 427 | { |
428 | kernel_cap_t dest; | ||
429 | CAP_UOP_ALL(dest, c, ~); | ||
430 | return dest; | ||
431 | } | ||
325 | 432 | ||
326 | #endif | 433 | static inline int cap_isclear(const kernel_cap_t a) |
434 | { | ||
435 | unsigned __capi; | ||
436 | CAP_FOR_EACH_U32(__capi) { | ||
437 | if (a.cap[__capi] != 0) | ||
438 | return 0; | ||
439 | } | ||
440 | return 1; | ||
441 | } | ||
327 | 442 | ||
328 | #define CAP_EMPTY_SET to_cap_t(0) | 443 | static inline int cap_issubset(const kernel_cap_t a, const kernel_cap_t set) |
329 | #define CAP_FULL_SET to_cap_t(~0) | 444 | { |
330 | #define CAP_INIT_EFF_SET to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP)) | 445 | kernel_cap_t dest; |
331 | #define CAP_INIT_INH_SET to_cap_t(0) | 446 | dest = cap_drop(a, set); |
447 | return cap_isclear(dest); | ||
448 | } | ||
332 | 449 | ||
333 | #define CAP_TO_MASK(x) (1 << (x)) | 450 | /* Used to decide between falling back on the old suser() or fsuser(). */ |
334 | #define cap_raise(c, flag) (cap_t(c) |= CAP_TO_MASK(flag)) | ||
335 | #define cap_lower(c, flag) (cap_t(c) &= ~CAP_TO_MASK(flag)) | ||
336 | #define cap_raised(c, flag) (cap_t(c) & CAP_TO_MASK(flag)) | ||
337 | 451 | ||
338 | static inline kernel_cap_t cap_combine(kernel_cap_t a, kernel_cap_t b) | 452 | static inline int cap_is_fs_cap(int cap) |
339 | { | 453 | { |
340 | kernel_cap_t dest; | 454 | const kernel_cap_t __cap_fs_set = CAP_FS_SET; |
341 | cap_t(dest) = cap_t(a) | cap_t(b); | 455 | return !!(CAP_TO_MASK(cap) & __cap_fs_set.cap[CAP_TO_INDEX(cap)]); |
342 | return dest; | ||
343 | } | 456 | } |
344 | 457 | ||
345 | static inline kernel_cap_t cap_intersect(kernel_cap_t a, kernel_cap_t b) | 458 | static inline kernel_cap_t cap_drop_fs_set(const kernel_cap_t a) |
346 | { | 459 | { |
347 | kernel_cap_t dest; | 460 | const kernel_cap_t __cap_fs_set = CAP_FS_SET; |
348 | cap_t(dest) = cap_t(a) & cap_t(b); | 461 | return cap_drop(a, __cap_fs_set); |
349 | return dest; | ||
350 | } | 462 | } |
351 | 463 | ||
352 | static inline kernel_cap_t cap_drop(kernel_cap_t a, kernel_cap_t drop) | 464 | static inline kernel_cap_t cap_raise_fs_set(const kernel_cap_t a, |
465 | const kernel_cap_t permitted) | ||
353 | { | 466 | { |
354 | kernel_cap_t dest; | 467 | const kernel_cap_t __cap_fs_set = CAP_FS_SET; |
355 | cap_t(dest) = cap_t(a) & ~cap_t(drop); | 468 | return cap_combine(a, |
356 | return dest; | 469 | cap_intersect(permitted, __cap_fs_set)); |
357 | } | 470 | } |
358 | 471 | ||
359 | static inline kernel_cap_t cap_invert(kernel_cap_t c) | 472 | static inline kernel_cap_t cap_drop_nfsd_set(const kernel_cap_t a) |
360 | { | 473 | { |
361 | kernel_cap_t dest; | 474 | const kernel_cap_t __cap_fs_set = CAP_NFSD_SET; |
362 | cap_t(dest) = ~cap_t(c); | 475 | return cap_drop(a, __cap_fs_set); |
363 | return dest; | ||
364 | } | 476 | } |
365 | 477 | ||
366 | #define cap_isclear(c) (!cap_t(c)) | 478 | static inline kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a, |
367 | #define cap_issubset(a,set) (!(cap_t(a) & ~cap_t(set))) | 479 | const kernel_cap_t permitted) |
368 | 480 | { | |
369 | #define cap_clear(c) do { cap_t(c) = 0; } while(0) | 481 | const kernel_cap_t __cap_nfsd_set = CAP_NFSD_SET; |
370 | #define cap_set_full(c) do { cap_t(c) = ~0; } while(0) | 482 | return cap_combine(a, |
371 | #define cap_mask(c,mask) do { cap_t(c) &= cap_t(mask); } while(0) | 483 | cap_intersect(permitted, __cap_nfsd_set)); |
484 | } | ||
372 | 485 | ||
373 | #define cap_is_fs_cap(c) (CAP_TO_MASK(c) & CAP_FS_MASK) | 486 | extern const kernel_cap_t __cap_empty_set; |
487 | extern const kernel_cap_t __cap_full_set; | ||
488 | extern const kernel_cap_t __cap_init_eff_set; | ||
374 | 489 | ||
375 | int capable(int cap); | 490 | int capable(int cap); |
376 | int __capable(struct task_struct *t, int cap); | 491 | int __capable(struct task_struct *t, int cap); |
377 | 492 | ||
493 | extern long cap_prctl_drop(unsigned long cap); | ||
494 | |||
378 | #endif /* __KERNEL__ */ | 495 | #endif /* __KERNEL__ */ |
379 | 496 | ||
380 | #endif /* !_LINUX_CAPABILITY_H */ | 497 | #endif /* !_LINUX_CAPABILITY_H */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 87479328d46d..ff9055fc3d2a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/nodemask.h> | 14 | #include <linux/nodemask.h> |
15 | #include <linux/rcupdate.h> | 15 | #include <linux/rcupdate.h> |
16 | #include <linux/cgroupstats.h> | 16 | #include <linux/cgroupstats.h> |
17 | #include <linux/prio_heap.h> | ||
17 | 18 | ||
18 | #ifdef CONFIG_CGROUPS | 19 | #ifdef CONFIG_CGROUPS |
19 | 20 | ||
@@ -207,6 +208,14 @@ struct cftype { | |||
207 | int (*release) (struct inode *inode, struct file *file); | 208 | int (*release) (struct inode *inode, struct file *file); |
208 | }; | 209 | }; |
209 | 210 | ||
211 | struct cgroup_scanner { | ||
212 | struct cgroup *cg; | ||
213 | int (*test_task)(struct task_struct *p, struct cgroup_scanner *scan); | ||
214 | void (*process_task)(struct task_struct *p, | ||
215 | struct cgroup_scanner *scan); | ||
216 | struct ptr_heap *heap; | ||
217 | }; | ||
218 | |||
210 | /* Add a new file to the given cgroup directory. Should only be | 219 | /* Add a new file to the given cgroup directory. Should only be |
211 | * called by subsystems from within a populate() method */ | 220 | * called by subsystems from within a populate() method */ |
212 | int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, | 221 | int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, |
@@ -233,6 +242,7 @@ int cgroup_is_descendant(const struct cgroup *cont); | |||
233 | struct cgroup_subsys { | 242 | struct cgroup_subsys { |
234 | struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, | 243 | struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, |
235 | struct cgroup *cont); | 244 | struct cgroup *cont); |
245 | void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cont); | ||
236 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); | 246 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); |
237 | int (*can_attach)(struct cgroup_subsys *ss, | 247 | int (*can_attach)(struct cgroup_subsys *ss, |
238 | struct cgroup *cont, struct task_struct *tsk); | 248 | struct cgroup *cont, struct task_struct *tsk); |
@@ -298,11 +308,17 @@ struct cgroup_iter { | |||
298 | * returns NULL or until you want to end the iteration | 308 | * returns NULL or until you want to end the iteration |
299 | * | 309 | * |
300 | * 3) call cgroup_iter_end() to destroy the iterator. | 310 | * 3) call cgroup_iter_end() to destroy the iterator. |
311 | * | ||
312 | * Or, call cgroup_scan_tasks() to iterate through every task in a cpuset. | ||
313 | * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task() | ||
314 | * callback, but not while calling the process_task() callback. | ||
301 | */ | 315 | */ |
302 | void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); | 316 | void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); |
303 | struct task_struct *cgroup_iter_next(struct cgroup *cont, | 317 | struct task_struct *cgroup_iter_next(struct cgroup *cont, |
304 | struct cgroup_iter *it); | 318 | struct cgroup_iter *it); |
305 | void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); | 319 | void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); |
320 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | ||
321 | int cgroup_attach_task(struct cgroup *, struct task_struct *); | ||
306 | 322 | ||
307 | #else /* !CONFIG_CGROUPS */ | 323 | #else /* !CONFIG_CGROUPS */ |
308 | 324 | ||
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 9ec43186ba80..228235c5ae53 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -37,3 +37,8 @@ SUBSYS(cpuacct) | |||
37 | 37 | ||
38 | /* */ | 38 | /* */ |
39 | 39 | ||
40 | #ifdef CONFIG_CGROUP_MEM_CONT | ||
41 | SUBSYS(mem_cgroup) | ||
42 | #endif | ||
43 | |||
44 | /* */ | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index d38655f2be70..a671dbff7a1f 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -257,16 +257,8 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, | |||
257 | /* | 257 | /* |
258 | * epoll (fs/eventpoll.c) compat bits follow ... | 258 | * epoll (fs/eventpoll.c) compat bits follow ... |
259 | */ | 259 | */ |
260 | #ifndef CONFIG_HAS_COMPAT_EPOLL_EVENT | ||
261 | struct epoll_event; | 260 | struct epoll_event; |
262 | #define compat_epoll_event epoll_event | 261 | #define compat_epoll_event epoll_event |
263 | #else | ||
264 | asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd, | ||
265 | struct compat_epoll_event __user *event); | ||
266 | asmlinkage long compat_sys_epoll_wait(int epfd, | ||
267 | struct compat_epoll_event __user *events, | ||
268 | int maxevents, int timeout); | ||
269 | #endif | ||
270 | asmlinkage long compat_sys_epoll_pwait(int epfd, | 262 | asmlinkage long compat_sys_epoll_pwait(int epfd, |
271 | struct compat_epoll_event __user *events, | 263 | struct compat_epoll_event __user *events, |
272 | int maxevents, int timeout, | 264 | int maxevents, int timeout, |
@@ -279,8 +271,11 @@ asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, | |||
279 | asmlinkage long compat_sys_signalfd(int ufd, | 271 | asmlinkage long compat_sys_signalfd(int ufd, |
280 | const compat_sigset_t __user *sigmask, | 272 | const compat_sigset_t __user *sigmask, |
281 | compat_size_t sigsetsize); | 273 | compat_size_t sigsetsize); |
282 | asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags, | 274 | asmlinkage long compat_sys_timerfd_settime(int ufd, int flags, |
283 | const struct compat_itimerspec __user *utmr); | 275 | const struct compat_itimerspec __user *utmr, |
276 | struct compat_itimerspec __user *otmr); | ||
277 | asmlinkage long compat_sys_timerfd_gettime(int ufd, | ||
278 | struct compat_itimerspec __user *otmr); | ||
284 | 279 | ||
285 | #endif /* CONFIG_COMPAT */ | 280 | #endif /* CONFIG_COMPAT */ |
286 | #endif /* _LINUX_COMPAT_H */ | 281 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 23932d7741a9..ddd8652fc3f3 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -167,6 +167,10 @@ struct cpufreq_governor { | |||
167 | char name[CPUFREQ_NAME_LEN]; | 167 | char name[CPUFREQ_NAME_LEN]; |
168 | int (*governor) (struct cpufreq_policy *policy, | 168 | int (*governor) (struct cpufreq_policy *policy, |
169 | unsigned int event); | 169 | unsigned int event); |
170 | ssize_t (*show_setspeed) (struct cpufreq_policy *policy, | ||
171 | char *buf); | ||
172 | int (*store_setspeed) (struct cpufreq_policy *policy, | ||
173 | unsigned int freq); | ||
170 | unsigned int max_transition_latency; /* HW must be able to switch to | 174 | unsigned int max_transition_latency; /* HW must be able to switch to |
171 | next freq faster than this value in nano secs or we | 175 | next freq faster than this value in nano secs or we |
172 | will fallback to performance governor */ | 176 | will fallback to performance governor */ |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index c4e00161a247..385d45b616db 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -46,9 +46,10 @@ struct cpuidle_state { | |||
46 | /* Idle State Flags */ | 46 | /* Idle State Flags */ |
47 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ | 47 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ |
48 | #define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ | 48 | #define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ |
49 | #define CPUIDLE_FLAG_SHALLOW (0x10) /* low latency, minimal savings */ | 49 | #define CPUIDLE_FLAG_POLL (0x10) /* no latency, no savings */ |
50 | #define CPUIDLE_FLAG_BALANCED (0x20) /* medium latency, moderate savings */ | 50 | #define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */ |
51 | #define CPUIDLE_FLAG_DEEP (0x40) /* high latency, large savings */ | 51 | #define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ |
52 | #define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ | ||
52 | 53 | ||
53 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | 54 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) |
54 | 55 | ||
@@ -79,7 +80,7 @@ struct cpuidle_state_kobj { | |||
79 | }; | 80 | }; |
80 | 81 | ||
81 | struct cpuidle_device { | 82 | struct cpuidle_device { |
82 | int enabled:1; | 83 | unsigned int enabled:1; |
83 | unsigned int cpu; | 84 | unsigned int cpu; |
84 | 85 | ||
85 | int last_residency; | 86 | int last_residency; |
@@ -178,4 +179,10 @@ static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { } | |||
178 | 179 | ||
179 | #endif | 180 | #endif |
180 | 181 | ||
182 | #ifdef CONFIG_ARCH_HAS_CPU_RELAX | ||
183 | #define CPUIDLE_DRIVER_STATE_START 1 | ||
184 | #else | ||
185 | #define CPUIDLE_DRIVER_STATE_START 0 | ||
186 | #endif | ||
187 | |||
181 | #endif /* _LINUX_CPUIDLE_H */ | 188 | #endif /* _LINUX_CPUIDLE_H */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index ecae585ec3da..f8c9a2752f06 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -57,7 +57,9 @@ extern int cpuset_memory_pressure_enabled; | |||
57 | extern void __cpuset_memory_pressure_bump(void); | 57 | extern void __cpuset_memory_pressure_bump(void); |
58 | 58 | ||
59 | extern const struct file_operations proc_cpuset_operations; | 59 | extern const struct file_operations proc_cpuset_operations; |
60 | extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); | 60 | struct seq_file; |
61 | extern void cpuset_task_status_allowed(struct seq_file *m, | ||
62 | struct task_struct *task); | ||
61 | 63 | ||
62 | extern void cpuset_lock(void); | 64 | extern void cpuset_lock(void); |
63 | extern void cpuset_unlock(void); | 65 | extern void cpuset_unlock(void); |
@@ -126,10 +128,9 @@ static inline int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, | |||
126 | 128 | ||
127 | static inline void cpuset_memory_pressure_bump(void) {} | 129 | static inline void cpuset_memory_pressure_bump(void) {} |
128 | 130 | ||
129 | static inline char *cpuset_task_status_allowed(struct task_struct *task, | 131 | static inline void cpuset_task_status_allowed(struct seq_file *m, |
130 | char *buffer) | 132 | struct task_struct *task) |
131 | { | 133 | { |
132 | return buffer; | ||
133 | } | 134 | } |
134 | 135 | ||
135 | static inline void cpuset_lock(void) {} | 136 | static inline void cpuset_lock(void) {} |
diff --git a/include/linux/dca.h b/include/linux/dca.h index 83eaecc6f8ab..af61cd1f37e9 100644 --- a/include/linux/dca.h +++ b/include/linux/dca.h | |||
@@ -11,7 +11,7 @@ void dca_unregister_notify(struct notifier_block *nb); | |||
11 | 11 | ||
12 | struct dca_provider { | 12 | struct dca_provider { |
13 | struct dca_ops *ops; | 13 | struct dca_ops *ops; |
14 | struct class_device *cd; | 14 | struct device *cd; |
15 | int id; | 15 | int id; |
16 | }; | 16 | }; |
17 | 17 | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index e765e191663d..cb784579956b 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -110,15 +110,15 @@ struct target_type { | |||
110 | }; | 110 | }; |
111 | 111 | ||
112 | struct io_restrictions { | 112 | struct io_restrictions { |
113 | unsigned int max_sectors; | 113 | unsigned long bounce_pfn; |
114 | unsigned short max_phys_segments; | 114 | unsigned long seg_boundary_mask; |
115 | unsigned short max_hw_segments; | 115 | unsigned max_hw_sectors; |
116 | unsigned short hardsect_size; | 116 | unsigned max_sectors; |
117 | unsigned int max_segment_size; | 117 | unsigned max_segment_size; |
118 | unsigned int max_hw_sectors; | 118 | unsigned short hardsect_size; |
119 | unsigned long seg_boundary_mask; | 119 | unsigned short max_hw_segments; |
120 | unsigned long bounce_pfn; | 120 | unsigned short max_phys_segments; |
121 | unsigned char no_cluster; /* inverted so that 0 is default */ | 121 | unsigned char no_cluster; /* inverted so that 0 is default */ |
122 | }; | 122 | }; |
123 | 123 | ||
124 | struct dm_target { | 124 | struct dm_target { |
diff --git a/include/linux/device.h b/include/linux/device.h index 479c0b31593c..2258d89bf523 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -410,6 +410,15 @@ extern int devres_release_group(struct device *dev, void *id); | |||
410 | extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); | 410 | extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); |
411 | extern void devm_kfree(struct device *dev, void *p); | 411 | extern void devm_kfree(struct device *dev, void *p); |
412 | 412 | ||
413 | struct device_dma_parameters { | ||
414 | /* | ||
415 | * a low level driver may set these to teach IOMMU code about | ||
416 | * sg limitations. | ||
417 | */ | ||
418 | unsigned int max_segment_size; | ||
419 | unsigned long segment_boundary_mask; | ||
420 | }; | ||
421 | |||
413 | struct device { | 422 | struct device { |
414 | struct klist klist_children; | 423 | struct klist klist_children; |
415 | struct klist_node knode_parent; /* node in sibling list */ | 424 | struct klist_node knode_parent; /* node in sibling list */ |
@@ -445,6 +454,8 @@ struct device { | |||
445 | 64 bit addresses for consistent | 454 | 64 bit addresses for consistent |
446 | allocations such descriptors. */ | 455 | allocations such descriptors. */ |
447 | 456 | ||
457 | struct device_dma_parameters *dma_parms; | ||
458 | |||
448 | struct list_head dma_pools; /* dma pools (if dma'ble) */ | 459 | struct list_head dma_pools; /* dma pools (if dma'ble) */ |
449 | 460 | ||
450 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem | 461 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 523281c5b7f5..b03c41bbfa14 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -232,36 +232,6 @@ enum { | |||
232 | DM_DEV_SET_GEOMETRY_CMD | 232 | DM_DEV_SET_GEOMETRY_CMD |
233 | }; | 233 | }; |
234 | 234 | ||
235 | /* | ||
236 | * The dm_ioctl struct passed into the ioctl is just the header | ||
237 | * on a larger chunk of memory. On x86-64 and other | ||
238 | * architectures the dm-ioctl struct will be padded to an 8 byte | ||
239 | * boundary so the size will be different, which would change the | ||
240 | * ioctl code - yes I really messed up. This hack forces these | ||
241 | * architectures to have the correct ioctl code. | ||
242 | */ | ||
243 | #ifdef CONFIG_COMPAT | ||
244 | typedef char ioctl_struct[308]; | ||
245 | #define DM_VERSION_32 _IOWR(DM_IOCTL, DM_VERSION_CMD, ioctl_struct) | ||
246 | #define DM_REMOVE_ALL_32 _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, ioctl_struct) | ||
247 | #define DM_LIST_DEVICES_32 _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, ioctl_struct) | ||
248 | |||
249 | #define DM_DEV_CREATE_32 _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, ioctl_struct) | ||
250 | #define DM_DEV_REMOVE_32 _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, ioctl_struct) | ||
251 | #define DM_DEV_RENAME_32 _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, ioctl_struct) | ||
252 | #define DM_DEV_SUSPEND_32 _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, ioctl_struct) | ||
253 | #define DM_DEV_STATUS_32 _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, ioctl_struct) | ||
254 | #define DM_DEV_WAIT_32 _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, ioctl_struct) | ||
255 | |||
256 | #define DM_TABLE_LOAD_32 _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, ioctl_struct) | ||
257 | #define DM_TABLE_CLEAR_32 _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, ioctl_struct) | ||
258 | #define DM_TABLE_DEPS_32 _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, ioctl_struct) | ||
259 | #define DM_TABLE_STATUS_32 _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, ioctl_struct) | ||
260 | #define DM_LIST_VERSIONS_32 _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, ioctl_struct) | ||
261 | #define DM_TARGET_MSG_32 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, ioctl_struct) | ||
262 | #define DM_DEV_SET_GEOMETRY_32 _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, ioctl_struct) | ||
263 | #endif | ||
264 | |||
265 | #define DM_IOCTL 0xfd | 235 | #define DM_IOCTL 0xfd |
266 | 236 | ||
267 | #define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl) | 237 | #define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl) |
@@ -286,9 +256,9 @@ typedef char ioctl_struct[308]; | |||
286 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 256 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
287 | 257 | ||
288 | #define DM_VERSION_MAJOR 4 | 258 | #define DM_VERSION_MAJOR 4 |
289 | #define DM_VERSION_MINOR 12 | 259 | #define DM_VERSION_MINOR 13 |
290 | #define DM_VERSION_PATCHLEVEL 0 | 260 | #define DM_VERSION_PATCHLEVEL 0 |
291 | #define DM_VERSION_EXTRA "-ioctl (2007-10-02)" | 261 | #define DM_VERSION_EXTRA "-ioctl (2007-10-18)" |
292 | 262 | ||
293 | /* Status bits */ | 263 | /* Status bits */ |
294 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 264 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 4470950892be..332030709623 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -60,6 +60,36 @@ static inline int is_device_dma_capable(struct device *dev) | |||
60 | 60 | ||
61 | extern u64 dma_get_required_mask(struct device *dev); | 61 | extern u64 dma_get_required_mask(struct device *dev); |
62 | 62 | ||
63 | static inline unsigned int dma_get_max_seg_size(struct device *dev) | ||
64 | { | ||
65 | return dev->dma_parms ? dev->dma_parms->max_segment_size : 65536; | ||
66 | } | ||
67 | |||
68 | static inline unsigned int dma_set_max_seg_size(struct device *dev, | ||
69 | unsigned int size) | ||
70 | { | ||
71 | if (dev->dma_parms) { | ||
72 | dev->dma_parms->max_segment_size = size; | ||
73 | return 0; | ||
74 | } else | ||
75 | return -EIO; | ||
76 | } | ||
77 | |||
78 | static inline unsigned long dma_get_seg_boundary(struct device *dev) | ||
79 | { | ||
80 | return dev->dma_parms ? | ||
81 | dev->dma_parms->segment_boundary_mask : 0xffffffff; | ||
82 | } | ||
83 | |||
84 | static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask) | ||
85 | { | ||
86 | if (dev->dma_parms) { | ||
87 | dev->dma_parms->segment_boundary_mask = mask; | ||
88 | return 0; | ||
89 | } else | ||
90 | return -EIO; | ||
91 | } | ||
92 | |||
63 | /* flags for the coherent memory api */ | 93 | /* flags for the coherent memory api */ |
64 | #define DMA_MEMORY_MAP 0x01 | 94 | #define DMA_MEMORY_MAP 0x01 |
65 | #define DMA_MEMORY_IO 0x02 | 95 | #define DMA_MEMORY_IO 0x02 |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 5c84bf897593..acbb364674ff 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -95,6 +95,15 @@ enum dma_transaction_type { | |||
95 | #define DMA_TX_TYPE_END (DMA_INTERRUPT + 1) | 95 | #define DMA_TX_TYPE_END (DMA_INTERRUPT + 1) |
96 | 96 | ||
97 | /** | 97 | /** |
98 | * enum dma_prep_flags - DMA flags to augment operation preparation | ||
99 | * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of | ||
100 | * this transaction | ||
101 | */ | ||
102 | enum dma_prep_flags { | ||
103 | DMA_PREP_INTERRUPT = (1 << 0), | ||
104 | }; | ||
105 | |||
106 | /** | ||
98 | * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. | 107 | * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. |
99 | * See linux/cpumask.h | 108 | * See linux/cpumask.h |
100 | */ | 109 | */ |
@@ -209,8 +218,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param); | |||
209 | * descriptors | 218 | * descriptors |
210 | * @chan: target channel for this operation | 219 | * @chan: target channel for this operation |
211 | * @tx_submit: set the prepared descriptor(s) to be executed by the engine | 220 | * @tx_submit: set the prepared descriptor(s) to be executed by the engine |
212 | * @tx_set_dest: set a destination address in a hardware descriptor | ||
213 | * @tx_set_src: set a source address in a hardware descriptor | ||
214 | * @callback: routine to call after this operation is complete | 221 | * @callback: routine to call after this operation is complete |
215 | * @callback_param: general parameter to pass to the callback routine | 222 | * @callback_param: general parameter to pass to the callback routine |
216 | * ---async_tx api specific fields--- | 223 | * ---async_tx api specific fields--- |
@@ -227,10 +234,6 @@ struct dma_async_tx_descriptor { | |||
227 | struct list_head tx_list; | 234 | struct list_head tx_list; |
228 | struct dma_chan *chan; | 235 | struct dma_chan *chan; |
229 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); | 236 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); |
230 | void (*tx_set_dest)(dma_addr_t addr, | ||
231 | struct dma_async_tx_descriptor *tx, int index); | ||
232 | void (*tx_set_src)(dma_addr_t addr, | ||
233 | struct dma_async_tx_descriptor *tx, int index); | ||
234 | dma_async_tx_callback callback; | 237 | dma_async_tx_callback callback; |
235 | void *callback_param; | 238 | void *callback_param; |
236 | struct list_head depend_list; | 239 | struct list_head depend_list; |
@@ -279,15 +282,17 @@ struct dma_device { | |||
279 | void (*device_free_chan_resources)(struct dma_chan *chan); | 282 | void (*device_free_chan_resources)(struct dma_chan *chan); |
280 | 283 | ||
281 | struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( | 284 | struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( |
282 | struct dma_chan *chan, size_t len, int int_en); | 285 | struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, |
286 | size_t len, unsigned long flags); | ||
283 | struct dma_async_tx_descriptor *(*device_prep_dma_xor)( | 287 | struct dma_async_tx_descriptor *(*device_prep_dma_xor)( |
284 | struct dma_chan *chan, unsigned int src_cnt, size_t len, | 288 | struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src, |
285 | int int_en); | 289 | unsigned int src_cnt, size_t len, unsigned long flags); |
286 | struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( | 290 | struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( |
287 | struct dma_chan *chan, unsigned int src_cnt, size_t len, | 291 | struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt, |
288 | u32 *result, int int_en); | 292 | size_t len, u32 *result, unsigned long flags); |
289 | struct dma_async_tx_descriptor *(*device_prep_dma_memset)( | 293 | struct dma_async_tx_descriptor *(*device_prep_dma_memset)( |
290 | struct dma_chan *chan, int value, size_t len, int int_en); | 294 | struct dma_chan *chan, dma_addr_t dest, int value, size_t len, |
295 | unsigned long flags); | ||
291 | struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( | 296 | struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( |
292 | struct dma_chan *chan); | 297 | struct dma_chan *chan); |
293 | 298 | ||
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index ffb6439cb5e6..56c73b847551 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -28,7 +28,7 @@ | |||
28 | #ifdef CONFIG_DMAR | 28 | #ifdef CONFIG_DMAR |
29 | struct intel_iommu; | 29 | struct intel_iommu; |
30 | 30 | ||
31 | extern char *dmar_get_fault_reason(u8 fault_reason); | 31 | extern const char *dmar_get_fault_reason(u8 fault_reason); |
32 | 32 | ||
33 | /* Can't use the common MSI interrupt functions | 33 | /* Can't use the common MSI interrupt functions |
34 | * since DMAR is not a pci device | 34 | * since DMAR is not a pci device |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 5b42a659a308..325acdf5c462 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -35,8 +35,11 @@ enum dmi_device_type { | |||
35 | DMI_DEV_TYPE_ETHERNET, | 35 | DMI_DEV_TYPE_ETHERNET, |
36 | DMI_DEV_TYPE_TOKENRING, | 36 | DMI_DEV_TYPE_TOKENRING, |
37 | DMI_DEV_TYPE_SOUND, | 37 | DMI_DEV_TYPE_SOUND, |
38 | DMI_DEV_TYPE_PATA, | ||
39 | DMI_DEV_TYPE_SATA, | ||
40 | DMI_DEV_TYPE_SAS, | ||
38 | DMI_DEV_TYPE_IPMI = -1, | 41 | DMI_DEV_TYPE_IPMI = -1, |
39 | DMI_DEV_TYPE_OEM_STRING = -2 | 42 | DMI_DEV_TYPE_OEM_STRING = -2, |
40 | }; | 43 | }; |
41 | 44 | ||
42 | struct dmi_header { | 45 | struct dmi_header { |
@@ -79,7 +82,7 @@ extern void dmi_scan_machine(void); | |||
79 | extern int dmi_get_year(int field); | 82 | extern int dmi_get_year(int field); |
80 | extern int dmi_name_in_vendors(const char *str); | 83 | extern int dmi_name_in_vendors(const char *str); |
81 | extern int dmi_available; | 84 | extern int dmi_available; |
82 | extern char *dmi_get_slot(int slot); | 85 | extern int dmi_walk(void (*decode)(const struct dmi_header *)); |
83 | 86 | ||
84 | #else | 87 | #else |
85 | 88 | ||
@@ -90,7 +93,8 @@ static inline const struct dmi_device * dmi_find_device(int type, const char *na | |||
90 | static inline int dmi_get_year(int year) { return 0; } | 93 | static inline int dmi_get_year(int year) { return 0; } |
91 | static inline int dmi_name_in_vendors(const char *s) { return 0; } | 94 | static inline int dmi_name_in_vendors(const char *s) { return 0; } |
92 | #define dmi_available 0 | 95 | #define dmi_available 0 |
93 | static inline char *dmi_get_slot(int slot) { return NULL; } | 96 | static inline int dmi_walk(void (*decode)(const struct dmi_header *)) |
97 | { return -1; } | ||
94 | 98 | ||
95 | #endif | 99 | #endif |
96 | 100 | ||
diff --git a/include/linux/ds1wm.h b/include/linux/ds1wm.h index 31f6e3c427fb..d3c65e48a2e7 100644 --- a/include/linux/ds1wm.h +++ b/include/linux/ds1wm.h | |||
@@ -6,6 +6,7 @@ struct ds1wm_platform_data { | |||
6 | * e.g. on h5xxx and h2200 this is 2 | 6 | * e.g. on h5xxx and h2200 this is 2 |
7 | * (registers aligned to 4-byte boundaries), | 7 | * (registers aligned to 4-byte boundaries), |
8 | * while on hx4700 this is 1 */ | 8 | * while on hx4700 this is 1 */ |
9 | int active_high; | ||
9 | void (*enable)(struct platform_device *pdev); | 10 | void (*enable)(struct platform_device *pdev); |
10 | void (*disable)(struct platform_device *pdev); | 11 | void (*disable)(struct platform_device *pdev); |
11 | }; | 12 | }; |
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index dd57fe523e97..a695d63a07af 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h | |||
@@ -41,7 +41,7 @@ extern const struct inode_operations efs_dir_inode_operations; | |||
41 | extern const struct file_operations efs_dir_operations; | 41 | extern const struct file_operations efs_dir_operations; |
42 | extern const struct address_space_operations efs_symlink_aops; | 42 | extern const struct address_space_operations efs_symlink_aops; |
43 | 43 | ||
44 | extern void efs_read_inode(struct inode *); | 44 | extern struct inode *efs_iget(struct super_block *, unsigned long); |
45 | extern efs_block_t efs_map_block(struct inode *, efs_block_t); | 45 | extern efs_block_t efs_map_block(struct inode *, efs_block_t); |
46 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); | 46 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); |
47 | 47 | ||
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h index 5834e843a946..18bea78fe47b 100644 --- a/include/linux/elf-em.h +++ b/include/linux/elf-em.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #define EM_V850 87 /* NEC v850 */ | 31 | #define EM_V850 87 /* NEC v850 */ |
32 | #define EM_M32R 88 /* Renesas M32R */ | 32 | #define EM_M32R 88 /* Renesas M32R */ |
33 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ | 33 | #define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ |
34 | #define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */ | ||
34 | #define EM_BLACKFIN 106 /* ADI Blackfin Processor */ | 35 | #define EM_BLACKFIN 106 /* ADI Blackfin Processor */ |
35 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ | 36 | #define EM_FRV 0x5441 /* Fujitsu FR-V */ |
36 | #define EM_AVR32 0x18ad /* Atmel AVR32 */ | 37 | #define EM_AVR32 0x18ad /* Atmel AVR32 */ |
@@ -47,6 +48,8 @@ | |||
47 | #define EM_CYGNUS_M32R 0x9041 | 48 | #define EM_CYGNUS_M32R 0x9041 |
48 | /* This is the old interim value for S/390 architecture */ | 49 | /* This is the old interim value for S/390 architecture */ |
49 | #define EM_S390_OLD 0xA390 | 50 | #define EM_S390_OLD 0xA390 |
51 | /* Also Panasonic/MEI MN10300, AM33 */ | ||
52 | #define EM_CYGNUS_MN10300 0xbeef | ||
50 | 53 | ||
51 | 54 | ||
52 | #endif /* _LINUX_ELF_EM_H */ | 55 | #endif /* _LINUX_ELF_EM_H */ |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 7ceb24d87c1a..bad1b16ec49a 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -3,7 +3,9 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/elf-em.h> | 5 | #include <linux/elf-em.h> |
6 | #ifdef __KERNEL__ | ||
6 | #include <asm/elf.h> | 7 | #include <asm/elf.h> |
8 | #endif | ||
7 | 9 | ||
8 | struct file; | 10 | struct file; |
9 | 11 | ||
@@ -355,6 +357,7 @@ typedef struct elf64_shdr { | |||
355 | #define NT_AUXV 6 | 357 | #define NT_AUXV 6 |
356 | #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ | 358 | #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ |
357 | #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ | 359 | #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ |
360 | #define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ | ||
358 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ | 361 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ |
359 | 362 | ||
360 | 363 | ||
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 9631dddae348..5ca54d77079f 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h | |||
@@ -4,7 +4,9 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/signal.h> | 5 | #include <linux/signal.h> |
6 | #include <linux/time.h> | 6 | #include <linux/time.h> |
7 | #ifdef __KERNEL__ | ||
7 | #include <linux/user.h> | 8 | #include <linux/user.h> |
9 | #endif | ||
8 | #include <linux/ptrace.h> | 10 | #include <linux/ptrace.h> |
9 | 11 | ||
10 | struct elf_siginfo | 12 | struct elf_siginfo |
@@ -14,7 +16,9 @@ struct elf_siginfo | |||
14 | int si_errno; /* errno */ | 16 | int si_errno; /* errno */ |
15 | }; | 17 | }; |
16 | 18 | ||
19 | #ifdef __KERNEL__ | ||
17 | #include <asm/elf.h> | 20 | #include <asm/elf.h> |
21 | #endif | ||
18 | 22 | ||
19 | #ifndef __KERNEL__ | 23 | #ifndef __KERNEL__ |
20 | typedef elf_greg_t greg_t; | 24 | typedef elf_greg_t greg_t; |
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h new file mode 100644 index 000000000000..a5978f18ca40 --- /dev/null +++ b/include/linux/enclosure.h | |||
@@ -0,0 +1,129 @@ | |||
1 | /* | ||
2 | * Enclosure Services | ||
3 | * | ||
4 | * Copyright (C) 2008 James Bottomley <James.Bottomley@HansenPartnership.com> | ||
5 | * | ||
6 | **----------------------------------------------------------------------------- | ||
7 | ** | ||
8 | ** This program is free software; you can redistribute it and/or | ||
9 | ** modify it under the terms of the GNU General Public License | ||
10 | ** version 2 as published by the Free Software Foundation. | ||
11 | ** | ||
12 | ** This program is distributed in the hope that it will be useful, | ||
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | ** GNU General Public License for more details. | ||
16 | ** | ||
17 | ** You should have received a copy of the GNU General Public License | ||
18 | ** along with this program; if not, write to the Free Software | ||
19 | ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | ** | ||
21 | **----------------------------------------------------------------------------- | ||
22 | */ | ||
23 | #ifndef _LINUX_ENCLOSURE_H_ | ||
24 | #define _LINUX_ENCLOSURE_H_ | ||
25 | |||
26 | #include <linux/device.h> | ||
27 | #include <linux/list.h> | ||
28 | |||
29 | /* A few generic types ... taken from ses-2 */ | ||
30 | enum enclosure_component_type { | ||
31 | ENCLOSURE_COMPONENT_DEVICE = 0x01, | ||
32 | ENCLOSURE_COMPONENT_ARRAY_DEVICE = 0x17, | ||
33 | }; | ||
34 | |||
35 | /* ses-2 common element status */ | ||
36 | enum enclosure_status { | ||
37 | ENCLOSURE_STATUS_UNSUPPORTED = 0, | ||
38 | ENCLOSURE_STATUS_OK, | ||
39 | ENCLOSURE_STATUS_CRITICAL, | ||
40 | ENCLOSURE_STATUS_NON_CRITICAL, | ||
41 | ENCLOSURE_STATUS_UNRECOVERABLE, | ||
42 | ENCLOSURE_STATUS_NOT_INSTALLED, | ||
43 | ENCLOSURE_STATUS_UNKNOWN, | ||
44 | ENCLOSURE_STATUS_UNAVAILABLE, | ||
45 | }; | ||
46 | |||
47 | /* SFF-8485 activity light settings */ | ||
48 | enum enclosure_component_setting { | ||
49 | ENCLOSURE_SETTING_DISABLED = 0, | ||
50 | ENCLOSURE_SETTING_ENABLED = 1, | ||
51 | ENCLOSURE_SETTING_BLINK_A_ON_OFF = 2, | ||
52 | ENCLOSURE_SETTING_BLINK_A_OFF_ON = 3, | ||
53 | ENCLOSURE_SETTING_BLINK_B_ON_OFF = 6, | ||
54 | ENCLOSURE_SETTING_BLINK_B_OFF_ON = 7, | ||
55 | }; | ||
56 | |||
57 | struct enclosure_device; | ||
58 | struct enclosure_component; | ||
59 | struct enclosure_component_callbacks { | ||
60 | void (*get_status)(struct enclosure_device *, | ||
61 | struct enclosure_component *); | ||
62 | int (*set_status)(struct enclosure_device *, | ||
63 | struct enclosure_component *, | ||
64 | enum enclosure_status); | ||
65 | void (*get_fault)(struct enclosure_device *, | ||
66 | struct enclosure_component *); | ||
67 | int (*set_fault)(struct enclosure_device *, | ||
68 | struct enclosure_component *, | ||
69 | enum enclosure_component_setting); | ||
70 | void (*get_active)(struct enclosure_device *, | ||
71 | struct enclosure_component *); | ||
72 | int (*set_active)(struct enclosure_device *, | ||
73 | struct enclosure_component *, | ||
74 | enum enclosure_component_setting); | ||
75 | void (*get_locate)(struct enclosure_device *, | ||
76 | struct enclosure_component *); | ||
77 | int (*set_locate)(struct enclosure_device *, | ||
78 | struct enclosure_component *, | ||
79 | enum enclosure_component_setting); | ||
80 | }; | ||
81 | |||
82 | |||
83 | struct enclosure_component { | ||
84 | void *scratch; | ||
85 | struct class_device cdev; | ||
86 | enum enclosure_component_type type; | ||
87 | int number; | ||
88 | int fault; | ||
89 | int active; | ||
90 | int locate; | ||
91 | enum enclosure_status status; | ||
92 | }; | ||
93 | |||
94 | struct enclosure_device { | ||
95 | void *scratch; | ||
96 | struct list_head node; | ||
97 | struct class_device cdev; | ||
98 | struct enclosure_component_callbacks *cb; | ||
99 | int components; | ||
100 | struct enclosure_component component[0]; | ||
101 | }; | ||
102 | |||
103 | static inline struct enclosure_device * | ||
104 | to_enclosure_device(struct class_device *dev) | ||
105 | { | ||
106 | return container_of(dev, struct enclosure_device, cdev); | ||
107 | } | ||
108 | |||
109 | static inline struct enclosure_component * | ||
110 | to_enclosure_component(struct class_device *dev) | ||
111 | { | ||
112 | return container_of(dev, struct enclosure_component, cdev); | ||
113 | } | ||
114 | |||
115 | struct enclosure_device * | ||
116 | enclosure_register(struct device *, const char *, int, | ||
117 | struct enclosure_component_callbacks *); | ||
118 | void enclosure_unregister(struct enclosure_device *); | ||
119 | struct enclosure_component * | ||
120 | enclosure_component_register(struct enclosure_device *, unsigned int, | ||
121 | enum enclosure_component_type, const char *); | ||
122 | int enclosure_add_device(struct enclosure_device *enclosure, int component, | ||
123 | struct device *dev); | ||
124 | int enclosure_remove_device(struct enclosure_device *enclosure, int component); | ||
125 | struct enclosure_device *enclosure_find(struct device *dev); | ||
126 | int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *), | ||
127 | void *data); | ||
128 | |||
129 | #endif /* _LINUX_ENCLOSURE_H_ */ | ||
diff --git a/include/linux/err.h b/include/linux/err.h index 1ab1d44f8d3b..ec87f3142bf3 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
@@ -34,6 +34,19 @@ static inline long IS_ERR(const void *ptr) | |||
34 | return IS_ERR_VALUE((unsigned long)ptr); | 34 | return IS_ERR_VALUE((unsigned long)ptr); |
35 | } | 35 | } |
36 | 36 | ||
37 | /** | ||
38 | * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type | ||
39 | * @ptr: The pointer to cast. | ||
40 | * | ||
41 | * Explicitly cast an error-valued pointer to another pointer type in such a | ||
42 | * way as to make it clear that's what's going on. | ||
43 | */ | ||
44 | static inline void *ERR_CAST(const void *ptr) | ||
45 | { | ||
46 | /* cast away the const */ | ||
47 | return (void *) ptr; | ||
48 | } | ||
49 | |||
37 | #endif | 50 | #endif |
38 | 51 | ||
39 | #endif /* _LINUX_ERR_H */ | 52 | #endif /* _LINUX_ERR_H */ |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 241c01cb92b2..36c540396377 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -823,7 +823,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | |||
823 | sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, | 823 | sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, |
824 | int create, int extend_disksize); | 824 | int create, int extend_disksize); |
825 | 825 | ||
826 | extern void ext3_read_inode (struct inode *); | 826 | extern struct inode *ext3_iget(struct super_block *, unsigned long); |
827 | extern int ext3_write_inode (struct inode *, int); | 827 | extern int ext3_write_inode (struct inode *, int); |
828 | extern int ext3_setattr (struct dentry *, struct iattr *); | 828 | extern int ext3_setattr (struct dentry *, struct iattr *); |
829 | extern void ext3_delete_inode (struct inode *); | 829 | extern void ext3_delete_inode (struct inode *); |
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h index 1852313fc7c7..c4f635a4dd25 100644 --- a/include/linux/ext4_fs.h +++ b/include/linux/ext4_fs.h | |||
@@ -1024,7 +1024,7 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, | |||
1024 | struct buffer_head *bh_result, | 1024 | struct buffer_head *bh_result, |
1025 | int create, int extend_disksize); | 1025 | int create, int extend_disksize); |
1026 | 1026 | ||
1027 | extern void ext4_read_inode (struct inode *); | 1027 | extern struct inode *ext4_iget(struct super_block *, unsigned long); |
1028 | extern int ext4_write_inode (struct inode *, int); | 1028 | extern int ext4_write_inode (struct inode *, int); |
1029 | extern int ext4_setattr (struct dentry *, struct iattr *); | 1029 | extern int ext4_setattr (struct dentry *, struct iattr *); |
1030 | extern void ext4_delete_inode (struct inode *); | 1030 | extern void ext4_delete_inode (struct inode *); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 56bd421c1208..18cfbf76ec5b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | /* Fixed constants first: */ | 22 | /* Fixed constants first: */ |
23 | #undef NR_OPEN | 23 | #undef NR_OPEN |
24 | #define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */ | 24 | extern int sysctl_nr_open; |
25 | #define INR_OPEN 1024 /* Initial setting for nfile rlimits */ | 25 | #define INR_OPEN 1024 /* Initial setting for nfile rlimits */ |
26 | 26 | ||
27 | #define BLOCK_SIZE_BITS 10 | 27 | #define BLOCK_SIZE_BITS 10 |
@@ -977,7 +977,6 @@ extern int send_sigurg(struct fown_struct *fown); | |||
977 | extern struct list_head super_blocks; | 977 | extern struct list_head super_blocks; |
978 | extern spinlock_t sb_lock; | 978 | extern spinlock_t sb_lock; |
979 | 979 | ||
980 | #define sb_entry(list) list_entry((list), struct super_block, s_list) | ||
981 | #define S_BIAS (1<<30) | 980 | #define S_BIAS (1<<30) |
982 | struct super_block { | 981 | struct super_block { |
983 | struct list_head s_list; /* Keep this first */ | 982 | struct list_head s_list; /* Keep this first */ |
@@ -1039,6 +1038,12 @@ struct super_block { | |||
1039 | * in /proc/mounts will be "type.subtype" | 1038 | * in /proc/mounts will be "type.subtype" |
1040 | */ | 1039 | */ |
1041 | char *s_subtype; | 1040 | char *s_subtype; |
1041 | |||
1042 | /* | ||
1043 | * Saved mount options for lazy filesystems using | ||
1044 | * generic_show_options() | ||
1045 | */ | ||
1046 | char *s_options; | ||
1042 | }; | 1047 | }; |
1043 | 1048 | ||
1044 | extern struct timespec current_fs_time(struct super_block *sb); | 1049 | extern struct timespec current_fs_time(struct super_block *sb); |
@@ -1242,8 +1247,6 @@ struct super_operations { | |||
1242 | struct inode *(*alloc_inode)(struct super_block *sb); | 1247 | struct inode *(*alloc_inode)(struct super_block *sb); |
1243 | void (*destroy_inode)(struct inode *); | 1248 | void (*destroy_inode)(struct inode *); |
1244 | 1249 | ||
1245 | void (*read_inode) (struct inode *); | ||
1246 | |||
1247 | void (*dirty_inode) (struct inode *); | 1250 | void (*dirty_inode) (struct inode *); |
1248 | int (*write_inode) (struct inode *, int); | 1251 | int (*write_inode) (struct inode *, int); |
1249 | void (*put_inode) (struct inode *); | 1252 | void (*put_inode) (struct inode *); |
@@ -1279,8 +1282,10 @@ struct super_operations { | |||
1279 | * | 1282 | * |
1280 | * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. | 1283 | * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. |
1281 | * | 1284 | * |
1282 | * I_DIRTY_SYNC Inode itself is dirty. | 1285 | * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on |
1283 | * I_DIRTY_DATASYNC Data-related inode changes pending | 1286 | * fdatasync(). i_atime is the usual cause. |
1287 | * I_DIRTY_DATASYNC Inode is dirty and must be written on fdatasync(), f.e. | ||
1288 | * because i_size changed. | ||
1284 | * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. | 1289 | * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. |
1285 | * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both | 1290 | * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both |
1286 | * are cleared by unlock_new_inode(), called from iget(). | 1291 | * are cleared by unlock_new_inode(), called from iget(). |
@@ -1312,8 +1317,6 @@ struct super_operations { | |||
1312 | * purpose reduces latency and prevents some filesystem- | 1317 | * purpose reduces latency and prevents some filesystem- |
1313 | * specific deadlocks. | 1318 | * specific deadlocks. |
1314 | * | 1319 | * |
1315 | * Q: Why does I_DIRTY_DATASYNC exist? It appears as if it could be replaced | ||
1316 | * by (I_DIRTY_SYNC|I_DIRTY_PAGES). | ||
1317 | * Q: What is the difference between I_WILL_FREE and I_FREEING? | 1320 | * Q: What is the difference between I_WILL_FREE and I_FREEING? |
1318 | * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on | 1321 | * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on |
1319 | * I_CLEAR? If not, why? | 1322 | * I_CLEAR? If not, why? |
@@ -1621,7 +1624,6 @@ extern int register_chrdev(unsigned int, const char *, | |||
1621 | const struct file_operations *); | 1624 | const struct file_operations *); |
1622 | extern void unregister_chrdev(unsigned int, const char *); | 1625 | extern void unregister_chrdev(unsigned int, const char *); |
1623 | extern void unregister_chrdev_region(dev_t, unsigned); | 1626 | extern void unregister_chrdev_region(dev_t, unsigned); |
1624 | extern int chrdev_open(struct inode *, struct file *); | ||
1625 | extern void chrdev_show(struct seq_file *,off_t); | 1627 | extern void chrdev_show(struct seq_file *,off_t); |
1626 | 1628 | ||
1627 | /* fs/block_dev.c */ | 1629 | /* fs/block_dev.c */ |
@@ -1768,19 +1770,8 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te | |||
1768 | extern struct inode * iget_locked(struct super_block *, unsigned long); | 1770 | extern struct inode * iget_locked(struct super_block *, unsigned long); |
1769 | extern void unlock_new_inode(struct inode *); | 1771 | extern void unlock_new_inode(struct inode *); |
1770 | 1772 | ||
1771 | static inline struct inode *iget(struct super_block *sb, unsigned long ino) | ||
1772 | { | ||
1773 | struct inode *inode = iget_locked(sb, ino); | ||
1774 | |||
1775 | if (inode && (inode->i_state & I_NEW)) { | ||
1776 | sb->s_op->read_inode(inode); | ||
1777 | unlock_new_inode(inode); | ||
1778 | } | ||
1779 | |||
1780 | return inode; | ||
1781 | } | ||
1782 | |||
1783 | extern void __iget(struct inode * inode); | 1773 | extern void __iget(struct inode * inode); |
1774 | extern void iget_failed(struct inode *); | ||
1784 | extern void clear_inode(struct inode *); | 1775 | extern void clear_inode(struct inode *); |
1785 | extern void destroy_inode(struct inode *); | 1776 | extern void destroy_inode(struct inode *); |
1786 | extern struct inode *new_inode(struct super_block *); | 1777 | extern struct inode *new_inode(struct super_block *); |
@@ -1821,9 +1812,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | |||
1821 | unsigned long, loff_t, loff_t *, size_t, ssize_t); | 1812 | unsigned long, loff_t, loff_t *, size_t, ssize_t); |
1822 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); | 1813 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
1823 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); | 1814 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
1824 | extern void do_generic_mapping_read(struct address_space *mapping, | ||
1825 | struct file_ra_state *, struct file *, | ||
1826 | loff_t *, read_descriptor_t *, read_actor_t); | ||
1827 | extern int generic_segment_checks(const struct iovec *iov, | 1815 | extern int generic_segment_checks(const struct iovec *iov, |
1828 | unsigned long *nr_segs, size_t *count, int access_flags); | 1816 | unsigned long *nr_segs, size_t *count, int access_flags); |
1829 | 1817 | ||
@@ -1861,18 +1849,6 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from) | |||
1861 | } | 1849 | } |
1862 | #endif | 1850 | #endif |
1863 | 1851 | ||
1864 | static inline void do_generic_file_read(struct file * filp, loff_t *ppos, | ||
1865 | read_descriptor_t * desc, | ||
1866 | read_actor_t actor) | ||
1867 | { | ||
1868 | do_generic_mapping_read(filp->f_mapping, | ||
1869 | &filp->f_ra, | ||
1870 | filp, | ||
1871 | ppos, | ||
1872 | desc, | ||
1873 | actor); | ||
1874 | } | ||
1875 | |||
1876 | #ifdef CONFIG_BLOCK | 1852 | #ifdef CONFIG_BLOCK |
1877 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 1853 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
1878 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | 1854 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
@@ -1942,7 +1918,9 @@ extern int vfs_stat_fd(int dfd, char __user *, struct kstat *); | |||
1942 | extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *); | 1918 | extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *); |
1943 | extern int vfs_fstat(unsigned int, struct kstat *); | 1919 | extern int vfs_fstat(unsigned int, struct kstat *); |
1944 | 1920 | ||
1945 | extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); | 1921 | extern long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
1922 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | ||
1923 | unsigned long arg); | ||
1946 | 1924 | ||
1947 | extern void get_filesystem(struct file_system_type *fs); | 1925 | extern void get_filesystem(struct file_system_type *fs); |
1948 | extern void put_filesystem(struct file_system_type *fs); | 1926 | extern void put_filesystem(struct file_system_type *fs); |
@@ -1997,6 +1975,9 @@ extern int __must_check inode_setattr(struct inode *, struct iattr *); | |||
1997 | 1975 | ||
1998 | extern void file_update_time(struct file *file); | 1976 | extern void file_update_time(struct file *file); |
1999 | 1977 | ||
1978 | extern int generic_show_options(struct seq_file *m, struct vfsmount *mnt); | ||
1979 | extern void save_mount_options(struct super_block *sb, char *options); | ||
1980 | |||
2000 | static inline ino_t parent_ino(struct dentry *dentry) | 1981 | static inline ino_t parent_ino(struct dentry *dentry) |
2001 | { | 1982 | { |
2002 | ino_t res; | 1983 | ino_t res; |
@@ -2068,7 +2049,7 @@ static int __fops ## _open(struct inode *inode, struct file *file) \ | |||
2068 | static struct file_operations __fops = { \ | 2049 | static struct file_operations __fops = { \ |
2069 | .owner = THIS_MODULE, \ | 2050 | .owner = THIS_MODULE, \ |
2070 | .open = __fops ## _open, \ | 2051 | .open = __fops ## _open, \ |
2071 | .release = simple_attr_close, \ | 2052 | .release = simple_attr_release, \ |
2072 | .read = simple_attr_read, \ | 2053 | .read = simple_attr_read, \ |
2073 | .write = simple_attr_write, \ | 2054 | .write = simple_attr_write, \ |
2074 | }; | 2055 | }; |
@@ -2080,9 +2061,9 @@ __simple_attr_check_format(const char *fmt, ...) | |||
2080 | } | 2061 | } |
2081 | 2062 | ||
2082 | int simple_attr_open(struct inode *inode, struct file *file, | 2063 | int simple_attr_open(struct inode *inode, struct file *file, |
2083 | u64 (*get)(void *), void (*set)(void *, u64), | 2064 | int (*get)(void *, u64 *), int (*set)(void *, u64), |
2084 | const char *fmt); | 2065 | const char *fmt); |
2085 | int simple_attr_close(struct inode *inode, struct file *file); | 2066 | int simple_attr_release(struct inode *inode, struct file *file); |
2086 | ssize_t simple_attr_read(struct file *file, char __user *buf, | 2067 | ssize_t simple_attr_read(struct file *file, char __user *buf, |
2087 | size_t len, loff_t *ppos); | 2068 | size_t len, loff_t *ppos); |
2088 | ssize_t simple_attr_write(struct file *file, const char __user *buf, | 2069 | ssize_t simple_attr_write(struct file *file, const char __user *buf, |
@@ -2113,6 +2094,7 @@ struct ctl_table; | |||
2113 | int proc_nr_files(struct ctl_table *table, int write, struct file *filp, | 2094 | int proc_nr_files(struct ctl_table *table, int write, struct file *filp, |
2114 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2095 | void __user *buffer, size_t *lenp, loff_t *ppos); |
2115 | 2096 | ||
2097 | int get_filesystem_list(char * buf); | ||
2116 | 2098 | ||
2117 | #endif /* __KERNEL__ */ | 2099 | #endif /* __KERNEL__ */ |
2118 | #endif /* _LINUX_FS_H */ | 2100 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 2bd31fa623b6..d4b7c4ac72e6 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -92,6 +92,14 @@ static inline void fsnotify_inoderemove(struct inode *inode) | |||
92 | } | 92 | } |
93 | 93 | ||
94 | /* | 94 | /* |
95 | * fsnotify_link_count - inode's link count changed | ||
96 | */ | ||
97 | static inline void fsnotify_link_count(struct inode *inode) | ||
98 | { | ||
99 | inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL); | ||
100 | } | ||
101 | |||
102 | /* | ||
95 | * fsnotify_create - 'name' was linked in | 103 | * fsnotify_create - 'name' was linked in |
96 | */ | 104 | */ |
97 | static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) | 105 | static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) |
@@ -103,6 +111,20 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) | |||
103 | } | 111 | } |
104 | 112 | ||
105 | /* | 113 | /* |
114 | * fsnotify_link - new hardlink in 'inode' directory | ||
115 | * Note: We have to pass also the linked inode ptr as some filesystems leave | ||
116 | * new_dentry->d_inode NULL and instantiate inode pointer later | ||
117 | */ | ||
118 | static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry) | ||
119 | { | ||
120 | inode_dir_notify(dir, DN_CREATE); | ||
121 | inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name, | ||
122 | inode); | ||
123 | fsnotify_link_count(inode); | ||
124 | audit_inode_child(new_dentry->d_name.name, new_dentry, dir); | ||
125 | } | ||
126 | |||
127 | /* | ||
106 | * fsnotify_mkdir - directory 'name' was created | 128 | * fsnotify_mkdir - directory 'name' was created |
107 | */ | 129 | */ |
108 | static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | 130 | static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 1dbea0ac5693..09a3b18918c7 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -91,16 +91,31 @@ struct partition { | |||
91 | __le32 nr_sects; /* nr of sectors in partition */ | 91 | __le32 nr_sects; /* nr of sectors in partition */ |
92 | } __attribute__((packed)); | 92 | } __attribute__((packed)); |
93 | 93 | ||
94 | struct disk_stats { | ||
95 | unsigned long sectors[2]; /* READs and WRITEs */ | ||
96 | unsigned long ios[2]; | ||
97 | unsigned long merges[2]; | ||
98 | unsigned long ticks[2]; | ||
99 | unsigned long io_ticks; | ||
100 | unsigned long time_in_queue; | ||
101 | }; | ||
102 | |||
94 | struct hd_struct { | 103 | struct hd_struct { |
95 | sector_t start_sect; | 104 | sector_t start_sect; |
96 | sector_t nr_sects; | 105 | sector_t nr_sects; |
97 | struct device dev; | 106 | struct device dev; |
98 | struct kobject *holder_dir; | 107 | struct kobject *holder_dir; |
99 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ | ||
100 | int policy, partno; | 108 | int policy, partno; |
101 | #ifdef CONFIG_FAIL_MAKE_REQUEST | 109 | #ifdef CONFIG_FAIL_MAKE_REQUEST |
102 | int make_it_fail; | 110 | int make_it_fail; |
103 | #endif | 111 | #endif |
112 | unsigned long stamp; | ||
113 | int in_flight; | ||
114 | #ifdef CONFIG_SMP | ||
115 | struct disk_stats *dkstats; | ||
116 | #else | ||
117 | struct disk_stats dkstats; | ||
118 | #endif | ||
104 | }; | 119 | }; |
105 | 120 | ||
106 | #define GENHD_FL_REMOVABLE 1 | 121 | #define GENHD_FL_REMOVABLE 1 |
@@ -111,15 +126,7 @@ struct hd_struct { | |||
111 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 126 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
112 | #define GENHD_FL_FAIL 64 | 127 | #define GENHD_FL_FAIL 64 |
113 | 128 | ||
114 | struct disk_stats { | 129 | |
115 | unsigned long sectors[2]; /* READs and WRITEs */ | ||
116 | unsigned long ios[2]; | ||
117 | unsigned long merges[2]; | ||
118 | unsigned long ticks[2]; | ||
119 | unsigned long io_ticks; | ||
120 | unsigned long time_in_queue; | ||
121 | }; | ||
122 | |||
123 | struct gendisk { | 130 | struct gendisk { |
124 | int major; /* major number of driver */ | 131 | int major; /* major number of driver */ |
125 | int first_minor; | 132 | int first_minor; |
@@ -158,6 +165,20 @@ struct gendisk { | |||
158 | * The __ variants should only be called in critical sections. The full | 165 | * The __ variants should only be called in critical sections. The full |
159 | * variants disable/enable preemption. | 166 | * variants disable/enable preemption. |
160 | */ | 167 | */ |
168 | static inline struct hd_struct *get_part(struct gendisk *gendiskp, | ||
169 | sector_t sector) | ||
170 | { | ||
171 | struct hd_struct *part; | ||
172 | int i; | ||
173 | for (i = 0; i < gendiskp->minors - 1; i++) { | ||
174 | part = gendiskp->part[i]; | ||
175 | if (part && part->start_sect <= sector | ||
176 | && sector < part->start_sect + part->nr_sects) | ||
177 | return part; | ||
178 | } | ||
179 | return NULL; | ||
180 | } | ||
181 | |||
161 | #ifdef CONFIG_SMP | 182 | #ifdef CONFIG_SMP |
162 | #define __disk_stat_add(gendiskp, field, addnd) \ | 183 | #define __disk_stat_add(gendiskp, field, addnd) \ |
163 | (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd) | 184 | (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd) |
@@ -177,15 +198,62 @@ static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { | |||
177 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, | 198 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, |
178 | sizeof (struct disk_stats)); | 199 | sizeof (struct disk_stats)); |
179 | } | 200 | } |
201 | |||
202 | #define __part_stat_add(part, field, addnd) \ | ||
203 | (per_cpu_ptr(part->dkstats, smp_processor_id())->field += addnd) | ||
204 | |||
205 | #define __all_stat_add(gendiskp, field, addnd, sector) \ | ||
206 | ({ \ | ||
207 | struct hd_struct *part = get_part(gendiskp, sector); \ | ||
208 | if (part) \ | ||
209 | __part_stat_add(part, field, addnd); \ | ||
210 | __disk_stat_add(gendiskp, field, addnd); \ | ||
211 | }) | ||
212 | |||
213 | #define part_stat_read(part, field) \ | ||
214 | ({ \ | ||
215 | typeof(part->dkstats->field) res = 0; \ | ||
216 | int i; \ | ||
217 | for_each_possible_cpu(i) \ | ||
218 | res += per_cpu_ptr(part->dkstats, i)->field; \ | ||
219 | res; \ | ||
220 | }) | ||
221 | |||
222 | static inline void part_stat_set_all(struct hd_struct *part, int value) { | ||
223 | int i; | ||
224 | for_each_possible_cpu(i) | ||
225 | memset(per_cpu_ptr(part->dkstats, i), value, | ||
226 | sizeof(struct disk_stats)); | ||
227 | } | ||
180 | 228 | ||
181 | #else | 229 | #else |
182 | #define __disk_stat_add(gendiskp, field, addnd) \ | 230 | #define __disk_stat_add(gendiskp, field, addnd) \ |
183 | (gendiskp->dkstats.field += addnd) | 231 | (gendiskp->dkstats.field += addnd) |
184 | #define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) | 232 | #define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) |
185 | 233 | ||
186 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { | 234 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) |
235 | { | ||
187 | memset(&gendiskp->dkstats, value, sizeof (struct disk_stats)); | 236 | memset(&gendiskp->dkstats, value, sizeof (struct disk_stats)); |
188 | } | 237 | } |
238 | |||
239 | #define __part_stat_add(part, field, addnd) \ | ||
240 | (part->dkstats.field += addnd) | ||
241 | |||
242 | #define __all_stat_add(gendiskp, field, addnd, sector) \ | ||
243 | ({ \ | ||
244 | struct hd_struct *part = get_part(gendiskp, sector); \ | ||
245 | if (part) \ | ||
246 | part->dkstats.field += addnd; \ | ||
247 | __disk_stat_add(gendiskp, field, addnd); \ | ||
248 | }) | ||
249 | |||
250 | #define part_stat_read(part, field) (part->dkstats.field) | ||
251 | |||
252 | static inline void part_stat_set_all(struct hd_struct *part, int value) | ||
253 | { | ||
254 | memset(&part->dkstats, value, sizeof(struct disk_stats)); | ||
255 | } | ||
256 | |||
189 | #endif | 257 | #endif |
190 | 258 | ||
191 | #define disk_stat_add(gendiskp, field, addnd) \ | 259 | #define disk_stat_add(gendiskp, field, addnd) \ |
@@ -206,6 +274,45 @@ static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { | |||
206 | #define disk_stat_sub(gendiskp, field, subnd) \ | 274 | #define disk_stat_sub(gendiskp, field, subnd) \ |
207 | disk_stat_add(gendiskp, field, -subnd) | 275 | disk_stat_add(gendiskp, field, -subnd) |
208 | 276 | ||
277 | #define part_stat_add(gendiskp, field, addnd) \ | ||
278 | do { \ | ||
279 | preempt_disable(); \ | ||
280 | __part_stat_add(gendiskp, field, addnd);\ | ||
281 | preempt_enable(); \ | ||
282 | } while (0) | ||
283 | |||
284 | #define __part_stat_dec(gendiskp, field) __part_stat_add(gendiskp, field, -1) | ||
285 | #define part_stat_dec(gendiskp, field) part_stat_add(gendiskp, field, -1) | ||
286 | |||
287 | #define __part_stat_inc(gendiskp, field) __part_stat_add(gendiskp, field, 1) | ||
288 | #define part_stat_inc(gendiskp, field) part_stat_add(gendiskp, field, 1) | ||
289 | |||
290 | #define __part_stat_sub(gendiskp, field, subnd) \ | ||
291 | __part_stat_add(gendiskp, field, -subnd) | ||
292 | #define part_stat_sub(gendiskp, field, subnd) \ | ||
293 | part_stat_add(gendiskp, field, -subnd) | ||
294 | |||
295 | #define all_stat_add(gendiskp, field, addnd, sector) \ | ||
296 | do { \ | ||
297 | preempt_disable(); \ | ||
298 | __all_stat_add(gendiskp, field, addnd, sector); \ | ||
299 | preempt_enable(); \ | ||
300 | } while (0) | ||
301 | |||
302 | #define __all_stat_dec(gendiskp, field, sector) \ | ||
303 | __all_stat_add(gendiskp, field, -1, sector) | ||
304 | #define all_stat_dec(gendiskp, field, sector) \ | ||
305 | all_stat_add(gendiskp, field, -1, sector) | ||
306 | |||
307 | #define __all_stat_inc(gendiskp, field, sector) \ | ||
308 | __all_stat_add(gendiskp, field, 1, sector) | ||
309 | #define all_stat_inc(gendiskp, field, sector) \ | ||
310 | all_stat_add(gendiskp, field, 1, sector) | ||
311 | |||
312 | #define __all_stat_sub(gendiskp, field, subnd, sector) \ | ||
313 | __all_stat_add(gendiskp, field, -subnd, sector) | ||
314 | #define all_stat_sub(gendiskp, field, subnd, sector) \ | ||
315 | all_stat_add(gendiskp, field, -subnd, sector) | ||
209 | 316 | ||
210 | /* Inlines to alloc and free disk stats in struct gendisk */ | 317 | /* Inlines to alloc and free disk stats in struct gendisk */ |
211 | #ifdef CONFIG_SMP | 318 | #ifdef CONFIG_SMP |
@@ -221,6 +328,20 @@ static inline void free_disk_stats(struct gendisk *disk) | |||
221 | { | 328 | { |
222 | free_percpu(disk->dkstats); | 329 | free_percpu(disk->dkstats); |
223 | } | 330 | } |
331 | |||
332 | static inline int init_part_stats(struct hd_struct *part) | ||
333 | { | ||
334 | part->dkstats = alloc_percpu(struct disk_stats); | ||
335 | if (!part->dkstats) | ||
336 | return 0; | ||
337 | return 1; | ||
338 | } | ||
339 | |||
340 | static inline void free_part_stats(struct hd_struct *part) | ||
341 | { | ||
342 | free_percpu(part->dkstats); | ||
343 | } | ||
344 | |||
224 | #else /* CONFIG_SMP */ | 345 | #else /* CONFIG_SMP */ |
225 | static inline int init_disk_stats(struct gendisk *disk) | 346 | static inline int init_disk_stats(struct gendisk *disk) |
226 | { | 347 | { |
@@ -230,10 +351,20 @@ static inline int init_disk_stats(struct gendisk *disk) | |||
230 | static inline void free_disk_stats(struct gendisk *disk) | 351 | static inline void free_disk_stats(struct gendisk *disk) |
231 | { | 352 | { |
232 | } | 353 | } |
354 | |||
355 | static inline int init_part_stats(struct hd_struct *part) | ||
356 | { | ||
357 | return 1; | ||
358 | } | ||
359 | |||
360 | static inline void free_part_stats(struct hd_struct *part) | ||
361 | { | ||
362 | } | ||
233 | #endif /* CONFIG_SMP */ | 363 | #endif /* CONFIG_SMP */ |
234 | 364 | ||
235 | /* drivers/block/ll_rw_blk.c */ | 365 | /* drivers/block/ll_rw_blk.c */ |
236 | extern void disk_round_stats(struct gendisk *disk); | 366 | extern void disk_round_stats(struct gendisk *disk); |
367 | extern void part_round_stats(struct hd_struct *part); | ||
237 | 368 | ||
238 | /* drivers/block/genhd.c */ | 369 | /* drivers/block/genhd.c */ |
239 | extern int get_blkdev_list(char *, int); | 370 | extern int get_blkdev_list(char *, int); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 7e93a9ae7064..0c6ce515185d 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -228,5 +228,7 @@ extern void FASTCALL(free_cold_page(struct page *page)); | |||
228 | 228 | ||
229 | void page_alloc_init(void); | 229 | void page_alloc_init(void); |
230 | void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); | 230 | void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); |
231 | void drain_all_pages(void); | ||
232 | void drain_local_pages(void *dummy); | ||
231 | 233 | ||
232 | #endif /* __LINUX_GFP_H */ | 234 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/hash.h b/include/linux/hash.h index acf17bb8e7f9..06d25c189cc5 100644 --- a/include/linux/hash.h +++ b/include/linux/hash.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifndef _LINUX_HASH_H | 1 | #ifndef _LINUX_HASH_H |
2 | #define _LINUX_HASH_H | 2 | #define _LINUX_HASH_H |
3 | /* Fast hashing routine for a long. | 3 | /* Fast hashing routine for ints, longs and pointers. |
4 | (C) 2002 William Lee Irwin III, IBM */ | 4 | (C) 2002 William Lee Irwin III, IBM */ |
5 | 5 | ||
6 | /* | 6 | /* |
@@ -13,23 +13,30 @@ | |||
13 | * them can use shifts and additions instead of multiplications for | 13 | * them can use shifts and additions instead of multiplications for |
14 | * machines where multiplications are slow. | 14 | * machines where multiplications are slow. |
15 | */ | 15 | */ |
16 | #if BITS_PER_LONG == 32 | 16 | |
17 | #include <asm/types.h> | ||
18 | |||
17 | /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ | 19 | /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ |
18 | #define GOLDEN_RATIO_PRIME 0x9e370001UL | 20 | #define GOLDEN_RATIO_PRIME_32 0x9e370001UL |
19 | #elif BITS_PER_LONG == 64 | ||
20 | /* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */ | 21 | /* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */ |
21 | #define GOLDEN_RATIO_PRIME 0x9e37fffffffc0001UL | 22 | #define GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001UL |
23 | |||
24 | #if BITS_PER_LONG == 32 | ||
25 | #define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_32 | ||
26 | #define hash_long(val, bits) hash_32(val, bits) | ||
27 | #elif BITS_PER_LONG == 64 | ||
28 | #define hash_long(val, bits) hash_64(val, bits) | ||
29 | #define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_64 | ||
22 | #else | 30 | #else |
23 | #error Define GOLDEN_RATIO_PRIME for your wordsize. | 31 | #error Wordsize not 32 or 64 |
24 | #endif | 32 | #endif |
25 | 33 | ||
26 | static inline unsigned long hash_long(unsigned long val, unsigned int bits) | 34 | static inline u64 hash_64(u64 val, unsigned int bits) |
27 | { | 35 | { |
28 | unsigned long hash = val; | 36 | u64 hash = val; |
29 | 37 | ||
30 | #if BITS_PER_LONG == 64 | ||
31 | /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ | 38 | /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ |
32 | unsigned long n = hash; | 39 | u64 n = hash; |
33 | n <<= 18; | 40 | n <<= 18; |
34 | hash -= n; | 41 | hash -= n; |
35 | n <<= 33; | 42 | n <<= 33; |
@@ -42,15 +49,20 @@ static inline unsigned long hash_long(unsigned long val, unsigned int bits) | |||
42 | hash += n; | 49 | hash += n; |
43 | n <<= 2; | 50 | n <<= 2; |
44 | hash += n; | 51 | hash += n; |
45 | #else | 52 | |
53 | /* High bits are more random, so use them. */ | ||
54 | return hash >> (64 - bits); | ||
55 | } | ||
56 | |||
57 | static inline u32 hash_32(u32 val, unsigned int bits) | ||
58 | { | ||
46 | /* On some cpus multiply is faster, on others gcc will do shifts */ | 59 | /* On some cpus multiply is faster, on others gcc will do shifts */ |
47 | hash *= GOLDEN_RATIO_PRIME; | 60 | u32 hash = val * GOLDEN_RATIO_PRIME_32; |
48 | #endif | ||
49 | 61 | ||
50 | /* High bits are more random, so use them. */ | 62 | /* High bits are more random, so use them. */ |
51 | return hash >> (BITS_PER_LONG - bits); | 63 | return hash >> (32 - bits); |
52 | } | 64 | } |
53 | 65 | ||
54 | static inline unsigned long hash_ptr(void *ptr, unsigned int bits) | 66 | static inline unsigned long hash_ptr(void *ptr, unsigned int bits) |
55 | { | 67 | { |
56 | return hash_long((unsigned long)ptr, bits); | 68 | return hash_long((unsigned long)ptr, bits); |
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h index b436be7a7fff..2177ee5b2fe2 100644 --- a/include/linux/hayesesp.h +++ b/include/linux/hayesesp.h | |||
@@ -71,7 +71,6 @@ struct hayes_esp_config { | |||
71 | #define ESP_STAT_NEVER_DMA 0x08 | 71 | #define ESP_STAT_NEVER_DMA 0x08 |
72 | #define ESP_STAT_USE_PIO 0x10 | 72 | #define ESP_STAT_USE_PIO 0x10 |
73 | 73 | ||
74 | #define ESP_EVENT_WRITE_WAKEUP 0 | ||
75 | #define ESP_MAGIC 0x53ee | 74 | #define ESP_MAGIC 0x53ee |
76 | #define ESP_XMIT_SIZE 4096 | 75 | #define ESP_XMIT_SIZE 4096 |
77 | 76 | ||
@@ -92,7 +91,6 @@ struct esp_struct { | |||
92 | unsigned short closing_wait2; | 91 | unsigned short closing_wait2; |
93 | int IER; /* Interrupt Enable Register */ | 92 | int IER; /* Interrupt Enable Register */ |
94 | int MCR; /* Modem control register */ | 93 | int MCR; /* Modem control register */ |
95 | unsigned long event; | ||
96 | unsigned long last_active; | 94 | unsigned long last_active; |
97 | int line; | 95 | int line; |
98 | int count; /* # of fd on device */ | 96 | int count; /* # of fd on device */ |
@@ -101,8 +99,6 @@ struct esp_struct { | |||
101 | int xmit_head; | 99 | int xmit_head; |
102 | int xmit_tail; | 100 | int xmit_tail; |
103 | int xmit_cnt; | 101 | int xmit_cnt; |
104 | struct work_struct tqueue; | ||
105 | struct work_struct tqueue_hangup; | ||
106 | wait_queue_head_t open_wait; | 102 | wait_queue_head_t open_wait; |
107 | wait_queue_head_t close_wait; | 103 | wait_queue_head_t close_wait; |
108 | wait_queue_head_t delta_msr_wait; | 104 | wait_queue_head_t delta_msr_wait; |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index db390c511ada..6115545a5b9c 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -26,13 +26,6 @@ | |||
26 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
27 | #include <linux/hdlc/ioctl.h> | 27 | #include <linux/hdlc/ioctl.h> |
28 | 28 | ||
29 | |||
30 | /* Used by all network devices here, pointed to by netdev_priv(dev) */ | ||
31 | struct hdlc_device_desc { | ||
32 | int (*netif_rx)(struct sk_buff *skb); | ||
33 | struct net_device_stats stats; | ||
34 | }; | ||
35 | |||
36 | /* This structure is a private property of HDLC protocols. | 29 | /* This structure is a private property of HDLC protocols. |
37 | Hardware drivers have no interest here */ | 30 | Hardware drivers have no interest here */ |
38 | 31 | ||
@@ -44,12 +37,15 @@ struct hdlc_proto { | |||
44 | void (*detach)(struct net_device *dev); | 37 | void (*detach)(struct net_device *dev); |
45 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); | 38 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); |
46 | __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); | 39 | __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); |
40 | int (*netif_rx)(struct sk_buff *skb); | ||
47 | struct module *module; | 41 | struct module *module; |
48 | struct hdlc_proto *next; /* next protocol in the list */ | 42 | struct hdlc_proto *next; /* next protocol in the list */ |
49 | }; | 43 | }; |
50 | 44 | ||
51 | 45 | ||
46 | /* Pointed to by dev->priv */ | ||
52 | typedef struct hdlc_device { | 47 | typedef struct hdlc_device { |
48 | struct net_device_stats stats; | ||
53 | /* used by HDLC layer to take control over HDLC device from hw driver*/ | 49 | /* used by HDLC layer to take control over HDLC device from hw driver*/ |
54 | int (*attach)(struct net_device *dev, | 50 | int (*attach)(struct net_device *dev, |
55 | unsigned short encoding, unsigned short parity); | 51 | unsigned short encoding, unsigned short parity); |
@@ -83,18 +79,11 @@ void unregister_hdlc_protocol(struct hdlc_proto *proto); | |||
83 | 79 | ||
84 | struct net_device *alloc_hdlcdev(void *priv); | 80 | struct net_device *alloc_hdlcdev(void *priv); |
85 | 81 | ||
86 | 82 | static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev) | |
87 | static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev) | ||
88 | { | ||
89 | return netdev_priv(dev); | ||
90 | } | ||
91 | |||
92 | static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev) | ||
93 | { | 83 | { |
94 | return netdev_priv(dev) + sizeof(struct hdlc_device_desc); | 84 | return dev->priv; |
95 | } | 85 | } |
96 | 86 | ||
97 | |||
98 | static __inline__ void debug_frame(const struct sk_buff *skb) | 87 | static __inline__ void debug_frame(const struct sk_buff *skb) |
99 | { | 88 | { |
100 | int i; | 89 | int i; |
@@ -116,13 +105,13 @@ int hdlc_open(struct net_device *dev); | |||
116 | void hdlc_close(struct net_device *dev); | 105 | void hdlc_close(struct net_device *dev); |
117 | 106 | ||
118 | int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, | 107 | int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, |
119 | int (*rx)(struct sk_buff *skb), size_t size); | 108 | size_t size); |
120 | /* May be used by hardware driver to gain control over HDLC device */ | 109 | /* May be used by hardware driver to gain control over HDLC device */ |
121 | void detach_hdlc_protocol(struct net_device *dev); | 110 | void detach_hdlc_protocol(struct net_device *dev); |
122 | 111 | ||
123 | static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) | 112 | static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) |
124 | { | 113 | { |
125 | return &dev_to_desc(dev)->stats; | 114 | return &dev_to_hdlc(dev)->stats; |
126 | } | 115 | } |
127 | 116 | ||
128 | 117 | ||
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 1fcb0033179e..7dcbc82f3b7b 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -68,8 +68,6 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr) | |||
68 | void *addr = kmap_atomic(page, KM_USER0); | 68 | void *addr = kmap_atomic(page, KM_USER0); |
69 | clear_user_page(addr, vaddr, page); | 69 | clear_user_page(addr, vaddr, page); |
70 | kunmap_atomic(addr, KM_USER0); | 70 | kunmap_atomic(addr, KM_USER0); |
71 | /* Make sure this page is cleared on other CPU's too before using it */ | ||
72 | smp_wmb(); | ||
73 | } | 71 | } |
74 | 72 | ||
75 | #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE | 73 | #ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE |
@@ -124,28 +122,40 @@ static inline void clear_highpage(struct page *page) | |||
124 | kunmap_atomic(kaddr, KM_USER0); | 122 | kunmap_atomic(kaddr, KM_USER0); |
125 | } | 123 | } |
126 | 124 | ||
127 | /* | 125 | static inline void zero_user_segments(struct page *page, |
128 | * Same but also flushes aliased cache contents to RAM. | 126 | unsigned start1, unsigned end1, |
129 | * | 127 | unsigned start2, unsigned end2) |
130 | * This must be a macro because KM_USER0 and friends aren't defined if | 128 | { |
131 | * !CONFIG_HIGHMEM | 129 | void *kaddr = kmap_atomic(page, KM_USER0); |
132 | */ | 130 | |
133 | #define zero_user_page(page, offset, size, km_type) \ | 131 | BUG_ON(end1 > PAGE_SIZE || end2 > PAGE_SIZE); |
134 | do { \ | 132 | |
135 | void *kaddr; \ | 133 | if (end1 > start1) |
136 | \ | 134 | memset(kaddr + start1, 0, end1 - start1); |
137 | BUG_ON((offset) + (size) > PAGE_SIZE); \ | 135 | |
138 | \ | 136 | if (end2 > start2) |
139 | kaddr = kmap_atomic(page, km_type); \ | 137 | memset(kaddr + start2, 0, end2 - start2); |
140 | memset((char *)kaddr + (offset), 0, (size)); \ | 138 | |
141 | flush_dcache_page(page); \ | 139 | kunmap_atomic(kaddr, KM_USER0); |
142 | kunmap_atomic(kaddr, (km_type)); \ | 140 | flush_dcache_page(page); |
143 | } while (0) | 141 | } |
142 | |||
143 | static inline void zero_user_segment(struct page *page, | ||
144 | unsigned start, unsigned end) | ||
145 | { | ||
146 | zero_user_segments(page, start, end, 0, 0); | ||
147 | } | ||
148 | |||
149 | static inline void zero_user(struct page *page, | ||
150 | unsigned start, unsigned size) | ||
151 | { | ||
152 | zero_user_segments(page, start, start + size, 0, 0); | ||
153 | } | ||
144 | 154 | ||
145 | static inline void __deprecated memclear_highpage_flush(struct page *page, | 155 | static inline void __deprecated memclear_highpage_flush(struct page *page, |
146 | unsigned int offset, unsigned int size) | 156 | unsigned int offset, unsigned int size) |
147 | { | 157 | { |
148 | zero_user_page(page, offset, size, KM_USER0); | 158 | zero_user(page, offset, size); |
149 | } | 159 | } |
150 | 160 | ||
151 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE | 161 | #ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE |
@@ -160,8 +170,6 @@ static inline void copy_user_highpage(struct page *to, struct page *from, | |||
160 | copy_user_page(vto, vfrom, vaddr, to); | 170 | copy_user_page(vto, vfrom, vaddr, to); |
161 | kunmap_atomic(vfrom, KM_USER0); | 171 | kunmap_atomic(vfrom, KM_USER0); |
162 | kunmap_atomic(vto, KM_USER1); | 172 | kunmap_atomic(vto, KM_USER1); |
163 | /* Make sure this page is cleared on other CPU's too before using it */ | ||
164 | smp_wmb(); | ||
165 | } | 173 | } |
166 | 174 | ||
167 | #endif | 175 | #endif |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index f79dcba4b2c1..600fc3bcf63e 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -78,7 +78,7 @@ enum hrtimer_cb_mode { | |||
78 | * as otherwise the timer could be removed before the softirq code finishes the | 78 | * as otherwise the timer could be removed before the softirq code finishes the |
79 | * the handling of the timer. | 79 | * the handling of the timer. |
80 | * | 80 | * |
81 | * The HRTIMER_STATE_ENQUEUE bit is always or'ed to the current state to | 81 | * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state to |
82 | * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario. | 82 | * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario. |
83 | * | 83 | * |
84 | * All state transitions are protected by cpu_base->lock. | 84 | * All state transitions are protected by cpu_base->lock. |
@@ -225,11 +225,14 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer) | |||
225 | * idea of the (in)accuracy of timers. Timer values are rounded up to | 225 | * idea of the (in)accuracy of timers. Timer values are rounded up to |
226 | * this resolution values. | 226 | * this resolution values. |
227 | */ | 227 | */ |
228 | # define KTIME_HIGH_RES (ktime_t) { .tv64 = 1 } | 228 | # define HIGH_RES_NSEC 1 |
229 | # define KTIME_HIGH_RES (ktime_t) { .tv64 = HIGH_RES_NSEC } | ||
230 | # define MONOTONIC_RES_NSEC HIGH_RES_NSEC | ||
229 | # define KTIME_MONOTONIC_RES KTIME_HIGH_RES | 231 | # define KTIME_MONOTONIC_RES KTIME_HIGH_RES |
230 | 232 | ||
231 | #else | 233 | #else |
232 | 234 | ||
235 | # define MONOTONIC_RES_NSEC LOW_RES_NSEC | ||
233 | # define KTIME_MONOTONIC_RES KTIME_LOW_RES | 236 | # define KTIME_MONOTONIC_RES KTIME_LOW_RES |
234 | 237 | ||
235 | /* | 238 | /* |
@@ -301,9 +304,16 @@ static inline int hrtimer_is_queued(struct hrtimer *timer) | |||
301 | } | 304 | } |
302 | 305 | ||
303 | /* Forward a hrtimer so it expires after now: */ | 306 | /* Forward a hrtimer so it expires after now: */ |
304 | extern unsigned long | 307 | extern u64 |
305 | hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); | 308 | hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); |
306 | 309 | ||
310 | /* Forward a hrtimer so it expires after the hrtimer's current now */ | ||
311 | static inline u64 hrtimer_forward_now(struct hrtimer *timer, | ||
312 | ktime_t interval) | ||
313 | { | ||
314 | return hrtimer_forward(timer, timer->base->get_time(), interval); | ||
315 | } | ||
316 | |||
307 | /* Precise sleep: */ | 317 | /* Precise sleep: */ |
308 | extern long hrtimer_nanosleep(struct timespec *rqtp, | 318 | extern long hrtimer_nanosleep(struct timespec *rqtp, |
309 | struct timespec *rmtp, | 319 | struct timespec *rmtp, |
@@ -322,9 +332,9 @@ extern void hrtimer_run_pending(void); | |||
322 | extern void __init hrtimers_init(void); | 332 | extern void __init hrtimers_init(void); |
323 | 333 | ||
324 | #if BITS_PER_LONG < 64 | 334 | #if BITS_PER_LONG < 64 |
325 | extern unsigned long ktime_divns(const ktime_t kt, s64 div); | 335 | extern u64 ktime_divns(const ktime_t kt, s64 div); |
326 | #else /* BITS_PER_LONG < 64 */ | 336 | #else /* BITS_PER_LONG < 64 */ |
327 | # define ktime_divns(kt, div) (unsigned long)((kt).tv64 / (div)) | 337 | # define ktime_divns(kt, div) (u64)((kt).tv64 / (div)) |
328 | #endif | 338 | #endif |
329 | 339 | ||
330 | /* Show pending timers: */ | 340 | /* Show pending timers: */ |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 30d606afcafe..7ca198b379af 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -17,6 +17,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
17 | } | 17 | } |
18 | 18 | ||
19 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 19 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
20 | int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | ||
20 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 21 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
21 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 22 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
22 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); | 23 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); |
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index 85d11916e9ea..42131820bb89 100644 --- a/include/linux/hw_random.h +++ b/include/linux/hw_random.h | |||
@@ -44,7 +44,15 @@ struct hwrng { | |||
44 | /** Register a new Hardware Random Number Generator driver. */ | 44 | /** Register a new Hardware Random Number Generator driver. */ |
45 | extern int hwrng_register(struct hwrng *rng); | 45 | extern int hwrng_register(struct hwrng *rng); |
46 | /** Unregister a Hardware Random Number Generator driver. */ | 46 | /** Unregister a Hardware Random Number Generator driver. */ |
47 | extern void hwrng_unregister(struct hwrng *rng); | 47 | extern void __hwrng_unregister(struct hwrng *rng, bool suspended); |
48 | static inline void hwrng_unregister(struct hwrng *rng) | ||
49 | { | ||
50 | __hwrng_unregister(rng, false); | ||
51 | } | ||
52 | static inline void hwrng_unregister_suspended(struct hwrng *rng) | ||
53 | { | ||
54 | __hwrng_unregister(rng, true); | ||
55 | } | ||
48 | 56 | ||
49 | #endif /* __KERNEL__ */ | 57 | #endif /* __KERNEL__ */ |
50 | #endif /* LINUX_HWRANDOM_H_ */ | 58 | #endif /* LINUX_HWRANDOM_H_ */ |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index f922b060158b..b979112f74e0 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -96,42 +96,6 @@ | |||
96 | 96 | ||
97 | #define I2C_DRIVERID_I2CDEV 900 | 97 | #define I2C_DRIVERID_I2CDEV 900 |
98 | 98 | ||
99 | /* IDs -- Use DRIVERIDs 1000-1999 for sensors. | ||
100 | These were originally in sensors.h in the lm_sensors package */ | ||
101 | #define I2C_DRIVERID_LM78 1002 | ||
102 | #define I2C_DRIVERID_LM75 1003 | ||
103 | #define I2C_DRIVERID_GL518 1004 | ||
104 | #define I2C_DRIVERID_EEPROM 1005 | ||
105 | #define I2C_DRIVERID_W83781D 1006 | ||
106 | #define I2C_DRIVERID_LM80 1007 | ||
107 | #define I2C_DRIVERID_ADM1021 1008 | ||
108 | #define I2C_DRIVERID_ADM9240 1009 | ||
109 | #define I2C_DRIVERID_LTC1710 1010 | ||
110 | #define I2C_DRIVERID_BT869 1013 | ||
111 | #define I2C_DRIVERID_MAXILIFE 1014 | ||
112 | #define I2C_DRIVERID_MATORB 1015 | ||
113 | #define I2C_DRIVERID_GL520 1016 | ||
114 | #define I2C_DRIVERID_THMC50 1017 | ||
115 | #define I2C_DRIVERID_ADM1025 1020 | ||
116 | #define I2C_DRIVERID_LM87 1021 | ||
117 | #define I2C_DRIVERID_PCF8574 1022 | ||
118 | #define I2C_DRIVERID_MTP008 1023 | ||
119 | #define I2C_DRIVERID_DS1621 1024 | ||
120 | #define I2C_DRIVERID_ADM1024 1025 | ||
121 | #define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */ | ||
122 | #define I2C_DRIVERID_FSCPOS 1028 | ||
123 | #define I2C_DRIVERID_FSCSCY 1029 | ||
124 | #define I2C_DRIVERID_PCF8591 1030 | ||
125 | #define I2C_DRIVERID_LM92 1033 | ||
126 | #define I2C_DRIVERID_SMARTBATT 1035 | ||
127 | #define I2C_DRIVERID_BMCSENSORS 1036 | ||
128 | #define I2C_DRIVERID_FS451 1037 | ||
129 | #define I2C_DRIVERID_LM85 1039 | ||
130 | #define I2C_DRIVERID_LM83 1040 | ||
131 | #define I2C_DRIVERID_LM90 1042 | ||
132 | #define I2C_DRIVERID_ASB100 1043 | ||
133 | #define I2C_DRIVERID_FSCHER 1046 | ||
134 | #define I2C_DRIVERID_W83L785TS 1047 | ||
135 | #define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */ | 99 | #define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */ |
136 | 100 | ||
137 | /* | 101 | /* |
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h new file mode 100644 index 000000000000..3c7361217df8 --- /dev/null +++ b/include/linux/i2c/pca953x.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* platform data for the PCA9539 16-bit I/O expander driver */ | ||
2 | |||
3 | struct pca953x_platform_data { | ||
4 | /* number of the first GPIO */ | ||
5 | unsigned gpio_base; | ||
6 | |||
7 | /* initial polarity inversion setting */ | ||
8 | uint16_t invert; | ||
9 | |||
10 | void *context; /* param to setup/teardown */ | ||
11 | |||
12 | int (*setup)(struct i2c_client *client, | ||
13 | unsigned gpio, unsigned ngpio, | ||
14 | void *context); | ||
15 | int (*teardown)(struct i2c_client *client, | ||
16 | unsigned gpio, unsigned ngpio, | ||
17 | void *context); | ||
18 | }; | ||
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h new file mode 100644 index 000000000000..ba8ea6e16476 --- /dev/null +++ b/include/linux/i2c/pcf857x.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef __LINUX_PCF857X_H | ||
2 | #define __LINUX_PCF857X_H | ||
3 | |||
4 | /** | ||
5 | * struct pcf857x_platform_data - data to set up pcf857x driver | ||
6 | * @gpio_base: number of the chip's first GPIO | ||
7 | * @n_latch: optional bit-inverse of initial register value; if | ||
8 | * you leave this initialized to zero the driver will act | ||
9 | * like the chip was just reset | ||
10 | * @setup: optional callback issued once the GPIOs are valid | ||
11 | * @teardown: optional callback issued before the GPIOs are invalidated | ||
12 | * @context: optional parameter passed to setup() and teardown() | ||
13 | * | ||
14 | * In addition to the I2C_BOARD_INFO() state appropriate to each chip, | ||
15 | * the i2c_board_info used with the pcf875x driver must provide the | ||
16 | * chip "type" ("pcf8574", "pcf8574a", "pcf8575", "pcf8575c") and its | ||
17 | * platform_data (pointer to one of these structures) with at least | ||
18 | * the gpio_base value initialized. | ||
19 | * | ||
20 | * The @setup callback may be used with the kind of board-specific glue | ||
21 | * which hands the (now-valid) GPIOs to other drivers, or which puts | ||
22 | * devices in their initial states using these GPIOs. | ||
23 | * | ||
24 | * These GPIO chips are only "quasi-bidirectional"; read the chip specs | ||
25 | * to understand the behavior. They don't have separate registers to | ||
26 | * record which pins are used for input or output, record which output | ||
27 | * values are driven, or provide access to input values. That must be | ||
28 | * inferred by reading the chip's value and knowing the last value written | ||
29 | * to it. If you leave n_latch initialized to zero, that last written | ||
30 | * value is presumed to be all ones (as if the chip were just reset). | ||
31 | */ | ||
32 | struct pcf857x_platform_data { | ||
33 | unsigned gpio_base; | ||
34 | unsigned n_latch; | ||
35 | |||
36 | int (*setup)(struct i2c_client *client, | ||
37 | int gpio, unsigned ngpio, | ||
38 | void *context); | ||
39 | int (*teardown)(struct i2c_client *client, | ||
40 | int gpio, unsigned ngpio, | ||
41 | void *context); | ||
42 | void *context; | ||
43 | }; | ||
44 | |||
45 | #endif /* __LINUX_PCF857X_H */ | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 367c17084a28..acec99da832d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -115,10 +115,6 @@ typedef unsigned char byte; /* used everywhere */ | |||
115 | #define SATA_ERROR_OFFSET (1) | 115 | #define SATA_ERROR_OFFSET (1) |
116 | #define SATA_CONTROL_OFFSET (2) | 116 | #define SATA_CONTROL_OFFSET (2) |
117 | 117 | ||
118 | #define SATA_MISC_OFFSET (0) | ||
119 | #define SATA_PHY_OFFSET (1) | ||
120 | #define SATA_IEN_OFFSET (2) | ||
121 | |||
122 | /* | 118 | /* |
123 | * Our Physical Region Descriptor (PRD) table should be large enough | 119 | * Our Physical Region Descriptor (PRD) table should be large enough |
124 | * to handle the biggest I/O request we are likely to see. Since requests | 120 | * to handle the biggest I/O request we are likely to see. Since requests |
@@ -173,7 +169,7 @@ enum { ide_unknown, ide_generic, ide_pci, | |||
173 | ide_rz1000, ide_trm290, | 169 | ide_rz1000, ide_trm290, |
174 | ide_cmd646, ide_cy82c693, ide_4drives, | 170 | ide_cmd646, ide_cy82c693, ide_4drives, |
175 | ide_pmac, ide_etrax100, ide_acorn, | 171 | ide_pmac, ide_etrax100, ide_acorn, |
176 | ide_au1xxx, ide_forced | 172 | ide_au1xxx, ide_palm3710, ide_forced |
177 | }; | 173 | }; |
178 | 174 | ||
179 | typedef u8 hwif_chipset_t; | 175 | typedef u8 hwif_chipset_t; |
@@ -198,17 +194,6 @@ struct ide_drive_s; | |||
198 | int ide_register_hw(hw_regs_t *, void (*)(struct ide_drive_s *), | 194 | int ide_register_hw(hw_regs_t *, void (*)(struct ide_drive_s *), |
199 | struct hwif_s **); | 195 | struct hwif_s **); |
200 | 196 | ||
201 | void ide_setup_ports( hw_regs_t *hw, | ||
202 | unsigned long base, | ||
203 | int *offsets, | ||
204 | unsigned long ctrl, | ||
205 | unsigned long intr, | ||
206 | ide_ack_intr_t *ack_intr, | ||
207 | #if 0 | ||
208 | ide_io_ops_t *iops, | ||
209 | #endif | ||
210 | int irq); | ||
211 | |||
212 | static inline void ide_std_init_ports(hw_regs_t *hw, | 197 | static inline void ide_std_init_ports(hw_regs_t *hw, |
213 | unsigned long io_addr, | 198 | unsigned long io_addr, |
214 | unsigned long ctl_addr) | 199 | unsigned long ctl_addr) |
@@ -473,7 +458,6 @@ typedef struct hwif_s { | |||
473 | /* task file registers for pata and sata */ | 458 | /* task file registers for pata and sata */ |
474 | unsigned long io_ports[IDE_NR_PORTS]; | 459 | unsigned long io_ports[IDE_NR_PORTS]; |
475 | unsigned long sata_scr[SATA_NR_PORTS]; | 460 | unsigned long sata_scr[SATA_NR_PORTS]; |
476 | unsigned long sata_misc[SATA_NR_PORTS]; | ||
477 | 461 | ||
478 | ide_drive_t drives[MAX_DRIVES]; /* drive info */ | 462 | ide_drive_t drives[MAX_DRIVES]; /* drive info */ |
479 | 463 | ||
@@ -1014,7 +998,8 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o | |||
1014 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); | 998 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); |
1015 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 999 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1016 | 1000 | ||
1017 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1001 | /* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */ |
1002 | #if defined(CONFIG_BLK_DEV_IDEPCI) && defined(CONFIG_BLK_DEV_IDEDMA_PCI) | ||
1018 | void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | 1003 | void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); |
1019 | #else | 1004 | #else |
1020 | static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, | 1005 | static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, |
@@ -1324,4 +1309,25 @@ static inline void ide_set_irq(ide_drive_t *drive, int on) | |||
1324 | drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG); | 1309 | drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG); |
1325 | } | 1310 | } |
1326 | 1311 | ||
1312 | static inline u8 ide_read_status(ide_drive_t *drive) | ||
1313 | { | ||
1314 | ide_hwif_t *hwif = drive->hwif; | ||
1315 | |||
1316 | return hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); | ||
1317 | } | ||
1318 | |||
1319 | static inline u8 ide_read_altstatus(ide_drive_t *drive) | ||
1320 | { | ||
1321 | ide_hwif_t *hwif = drive->hwif; | ||
1322 | |||
1323 | return hwif->INB(hwif->io_ports[IDE_CONTROL_OFFSET]); | ||
1324 | } | ||
1325 | |||
1326 | static inline u8 ide_read_error(ide_drive_t *drive) | ||
1327 | { | ||
1328 | ide_hwif_t *hwif = drive->hwif; | ||
1329 | |||
1330 | return hwif->INB(hwif->io_ports[IDE_ERROR_OFFSET]); | ||
1331 | } | ||
1332 | |||
1327 | #endif /* _IDE_H */ | 1333 | #endif /* _IDE_H */ |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 34f40efc7607..79504b22a932 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -327,7 +327,7 @@ static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short t | |||
327 | * | 327 | * |
328 | * Returns error if the skb is not of VLAN type | 328 | * Returns error if the skb is not of VLAN type |
329 | */ | 329 | */ |
330 | static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) | 330 | static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) |
331 | { | 331 | { |
332 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; | 332 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; |
333 | 333 | ||
@@ -347,7 +347,8 @@ static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) | |||
347 | * | 347 | * |
348 | * Returns error if @skb->cb[] is not set correctly | 348 | * Returns error if @skb->cb[] is not set correctly |
349 | */ | 349 | */ |
350 | static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *tag) | 350 | static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, |
351 | unsigned short *tag) | ||
351 | { | 352 | { |
352 | struct vlan_skb_tx_cookie *cookie; | 353 | struct vlan_skb_tx_cookie *cookie; |
353 | 354 | ||
@@ -370,7 +371,7 @@ static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *ta | |||
370 | * | 371 | * |
371 | * Returns error if the skb is not VLAN tagged | 372 | * Returns error if the skb is not VLAN tagged |
372 | */ | 373 | */ |
373 | static inline int vlan_get_tag(struct sk_buff *skb, unsigned short *tag) | 374 | static inline int vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) |
374 | { | 375 | { |
375 | if (skb->dev->features & NETIF_F_HW_VLAN_TX) { | 376 | if (skb->dev->features & NETIF_F_HW_VLAN_TX) { |
376 | return __vlan_hwaccel_get_tag(skb, tag); | 377 | return __vlan_hwaccel_get_tag(skb, tag); |
diff --git a/include/linux/init.h b/include/linux/init.h index 90cdbbbbe077..a404a0055dd7 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -110,6 +110,7 @@ | |||
110 | #define __FINIT .previous | 110 | #define __FINIT .previous |
111 | 111 | ||
112 | #define __INITDATA .section ".init.data","aw" | 112 | #define __INITDATA .section ".init.data","aw" |
113 | #define __FINITDATA .previous | ||
113 | 114 | ||
114 | #define __DEVINIT .section ".devinit.text", "ax" | 115 | #define __DEVINIT .section ".devinit.text", "ax" |
115 | #define __DEVINITDATA .section ".devinit.data", "aw" | 116 | #define __DEVINITDATA .section ".devinit.data", "aw" |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index f42663eaf655..1f74e1d7415f 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -121,6 +121,18 @@ extern struct group_info init_groups; | |||
121 | #else | 121 | #else |
122 | #define INIT_IDS | 122 | #define INIT_IDS |
123 | #endif | 123 | #endif |
124 | |||
125 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
126 | /* | ||
127 | * Because of the reduced scope of CAP_SETPCAP when filesystem | ||
128 | * capabilities are in effect, it is safe to allow CAP_SETPCAP to | ||
129 | * be available in the default configuration. | ||
130 | */ | ||
131 | # define CAP_INIT_BSET CAP_FULL_SET | ||
132 | #else | ||
133 | # define CAP_INIT_BSET CAP_INIT_EFF_SET | ||
134 | #endif | ||
135 | |||
124 | /* | 136 | /* |
125 | * INIT_TASK is used to set up the first task table, touch at | 137 | * INIT_TASK is used to set up the first task table, touch at |
126 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 138 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
@@ -156,6 +168,7 @@ extern struct group_info init_groups; | |||
156 | .cap_effective = CAP_INIT_EFF_SET, \ | 168 | .cap_effective = CAP_INIT_EFF_SET, \ |
157 | .cap_inheritable = CAP_INIT_INH_SET, \ | 169 | .cap_inheritable = CAP_INIT_INH_SET, \ |
158 | .cap_permitted = CAP_FULL_SET, \ | 170 | .cap_permitted = CAP_FULL_SET, \ |
171 | .cap_bset = CAP_INIT_BSET, \ | ||
159 | .keep_capabilities = 0, \ | 172 | .keep_capabilities = 0, \ |
160 | .user = INIT_USER, \ | 173 | .user = INIT_USER, \ |
161 | .comm = "swapper", \ | 174 | .comm = "swapper", \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 056a17a4f34f..1bdc39a8c76c 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1020,7 +1020,6 @@ struct ff_effect { | |||
1020 | * @going_away: marks devices that are in a middle of unregistering and | 1020 | * @going_away: marks devices that are in a middle of unregistering and |
1021 | * causes input_open_device*() fail with -ENODEV. | 1021 | * causes input_open_device*() fail with -ENODEV. |
1022 | * @dev: driver model's view of this device | 1022 | * @dev: driver model's view of this device |
1023 | * @cdev: union for struct device pointer | ||
1024 | * @h_list: list of input handles associated with the device. When | 1023 | * @h_list: list of input handles associated with the device. When |
1025 | * accessing the list dev->mutex must be held | 1024 | * accessing the list dev->mutex must be held |
1026 | * @node: used to place the device onto input_dev_list | 1025 | * @node: used to place the device onto input_dev_list |
@@ -1085,9 +1084,6 @@ struct input_dev { | |||
1085 | int going_away; | 1084 | int going_away; |
1086 | 1085 | ||
1087 | struct device dev; | 1086 | struct device dev; |
1088 | union { /* temporarily so while we switching to struct device */ | ||
1089 | struct device *dev; | ||
1090 | } cdev; | ||
1091 | 1087 | ||
1092 | struct list_head h_list; | 1088 | struct list_head h_list; |
1093 | struct list_head node; | 1089 | struct list_head node; |
@@ -1311,6 +1307,9 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
1311 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); | 1307 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); |
1312 | } | 1308 | } |
1313 | 1309 | ||
1310 | int input_get_keycode(struct input_dev *dev, int scancode, int *keycode); | ||
1311 | int input_set_keycode(struct input_dev *dev, int scancode, int keycode); | ||
1312 | |||
1314 | extern struct class input_class; | 1313 | extern struct class input_class; |
1315 | 1314 | ||
1316 | /** | 1315 | /** |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index c3db4a00f1fa..dea7598aeff4 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -444,4 +444,6 @@ static inline void init_irq_proc(void) | |||
444 | } | 444 | } |
445 | #endif | 445 | #endif |
446 | 446 | ||
447 | int show_interrupts(struct seq_file *p, void *v); | ||
448 | |||
447 | #endif | 449 | #endif |
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h new file mode 100644 index 000000000000..4dd4c04ff2f4 --- /dev/null +++ b/include/linux/iommu-helper.h | |||
@@ -0,0 +1,7 @@ | |||
1 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | ||
2 | unsigned long start, unsigned int nr, | ||
3 | unsigned long shift, | ||
4 | unsigned long boundary_size, | ||
5 | unsigned long align_mask); | ||
6 | extern void iommu_area_free(unsigned long *map, unsigned long start, | ||
7 | unsigned int nr); | ||
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index 408696ea5189..b8826107b518 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
@@ -100,58 +100,6 @@ struct kern_ipc_perm | |||
100 | void *security; | 100 | void *security; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | struct ipc_ids; | ||
104 | struct ipc_namespace { | ||
105 | struct kref kref; | ||
106 | struct ipc_ids *ids[3]; | ||
107 | |||
108 | int sem_ctls[4]; | ||
109 | int used_sems; | ||
110 | |||
111 | int msg_ctlmax; | ||
112 | int msg_ctlmnb; | ||
113 | int msg_ctlmni; | ||
114 | atomic_t msg_bytes; | ||
115 | atomic_t msg_hdrs; | ||
116 | |||
117 | size_t shm_ctlmax; | ||
118 | size_t shm_ctlall; | ||
119 | int shm_ctlmni; | ||
120 | int shm_tot; | ||
121 | }; | ||
122 | |||
123 | extern struct ipc_namespace init_ipc_ns; | ||
124 | |||
125 | #ifdef CONFIG_SYSVIPC | ||
126 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | ||
127 | extern void free_ipc_ns(struct kref *kref); | ||
128 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | ||
129 | struct ipc_namespace *ns); | ||
130 | #else | ||
131 | #define INIT_IPC_NS(ns) | ||
132 | static inline struct ipc_namespace *copy_ipcs(unsigned long flags, | ||
133 | struct ipc_namespace *ns) | ||
134 | { | ||
135 | return ns; | ||
136 | } | ||
137 | #endif | ||
138 | |||
139 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | ||
140 | { | ||
141 | #ifdef CONFIG_SYSVIPC | ||
142 | if (ns) | ||
143 | kref_get(&ns->kref); | ||
144 | #endif | ||
145 | return ns; | ||
146 | } | ||
147 | |||
148 | static inline void put_ipc_ns(struct ipc_namespace *ns) | ||
149 | { | ||
150 | #ifdef CONFIG_SYSVIPC | ||
151 | kref_put(&ns->kref, free_ipc_ns); | ||
152 | #endif | ||
153 | } | ||
154 | |||
155 | #endif /* __KERNEL__ */ | 103 | #endif /* __KERNEL__ */ |
156 | 104 | ||
157 | #endif /* _LINUX_IPC_H */ | 105 | #endif /* _LINUX_IPC_H */ |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h new file mode 100644 index 000000000000..e4451d1da753 --- /dev/null +++ b/include/linux/ipc_namespace.h | |||
@@ -0,0 +1,81 @@ | |||
1 | #ifndef __IPC_NAMESPACE_H__ | ||
2 | #define __IPC_NAMESPACE_H__ | ||
3 | |||
4 | #include <linux/err.h> | ||
5 | #include <linux/idr.h> | ||
6 | #include <linux/rwsem.h> | ||
7 | |||
8 | struct ipc_ids { | ||
9 | int in_use; | ||
10 | unsigned short seq; | ||
11 | unsigned short seq_max; | ||
12 | struct rw_semaphore rw_mutex; | ||
13 | struct idr ipcs_idr; | ||
14 | }; | ||
15 | |||
16 | struct ipc_namespace { | ||
17 | struct kref kref; | ||
18 | struct ipc_ids ids[3]; | ||
19 | |||
20 | int sem_ctls[4]; | ||
21 | int used_sems; | ||
22 | |||
23 | int msg_ctlmax; | ||
24 | int msg_ctlmnb; | ||
25 | int msg_ctlmni; | ||
26 | atomic_t msg_bytes; | ||
27 | atomic_t msg_hdrs; | ||
28 | |||
29 | size_t shm_ctlmax; | ||
30 | size_t shm_ctlall; | ||
31 | int shm_ctlmni; | ||
32 | int shm_tot; | ||
33 | }; | ||
34 | |||
35 | extern struct ipc_namespace init_ipc_ns; | ||
36 | |||
37 | #ifdef CONFIG_SYSVIPC | ||
38 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | ||
39 | #else | ||
40 | #define INIT_IPC_NS(ns) | ||
41 | #endif | ||
42 | |||
43 | #if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS) | ||
44 | extern void free_ipc_ns(struct kref *kref); | ||
45 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | ||
46 | struct ipc_namespace *ns); | ||
47 | extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, | ||
48 | void (*free)(struct ipc_namespace *, | ||
49 | struct kern_ipc_perm *)); | ||
50 | |||
51 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | ||
52 | { | ||
53 | if (ns) | ||
54 | kref_get(&ns->kref); | ||
55 | return ns; | ||
56 | } | ||
57 | |||
58 | static inline void put_ipc_ns(struct ipc_namespace *ns) | ||
59 | { | ||
60 | kref_put(&ns->kref, free_ipc_ns); | ||
61 | } | ||
62 | #else | ||
63 | static inline struct ipc_namespace *copy_ipcs(unsigned long flags, | ||
64 | struct ipc_namespace *ns) | ||
65 | { | ||
66 | if (flags & CLONE_NEWIPC) | ||
67 | return ERR_PTR(-EINVAL); | ||
68 | |||
69 | return ns; | ||
70 | } | ||
71 | |||
72 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | ||
73 | { | ||
74 | return ns; | ||
75 | } | ||
76 | |||
77 | static inline void put_ipc_ns(struct ipc_namespace *ns) | ||
78 | { | ||
79 | } | ||
80 | #endif | ||
81 | #endif | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index 4669be080617..bfd9efb5cb49 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <asm/irq_regs.h> | 25 | #include <asm/irq_regs.h> |
26 | 26 | ||
27 | struct irq_desc; | 27 | struct irq_desc; |
28 | typedef void fastcall (*irq_flow_handler_t)(unsigned int irq, | 28 | typedef void (*irq_flow_handler_t)(unsigned int irq, |
29 | struct irq_desc *desc); | 29 | struct irq_desc *desc); |
30 | 30 | ||
31 | 31 | ||
@@ -276,19 +276,19 @@ extern int handle_IRQ_event(unsigned int irq, struct irqaction *action); | |||
276 | * Built-in IRQ handlers for various IRQ types, | 276 | * Built-in IRQ handlers for various IRQ types, |
277 | * callable via desc->chip->handle_irq() | 277 | * callable via desc->chip->handle_irq() |
278 | */ | 278 | */ |
279 | extern void fastcall handle_level_irq(unsigned int irq, struct irq_desc *desc); | 279 | extern void handle_level_irq(unsigned int irq, struct irq_desc *desc); |
280 | extern void fastcall handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); | 280 | extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); |
281 | extern void fastcall handle_edge_irq(unsigned int irq, struct irq_desc *desc); | 281 | extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc); |
282 | extern void fastcall handle_simple_irq(unsigned int irq, struct irq_desc *desc); | 282 | extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc); |
283 | extern void fastcall handle_percpu_irq(unsigned int irq, struct irq_desc *desc); | 283 | extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc); |
284 | extern void fastcall handle_bad_irq(unsigned int irq, struct irq_desc *desc); | 284 | extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); |
285 | 285 | ||
286 | /* | 286 | /* |
287 | * Monolithic do_IRQ implementation. | 287 | * Monolithic do_IRQ implementation. |
288 | * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) | 288 | * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) |
289 | */ | 289 | */ |
290 | #ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ | 290 | #ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ |
291 | extern fastcall unsigned int __do_IRQ(unsigned int irq); | 291 | extern unsigned int __do_IRQ(unsigned int irq); |
292 | #endif | 292 | #endif |
293 | 293 | ||
294 | /* | 294 | /* |
@@ -367,6 +367,9 @@ set_irq_chained_handler(unsigned int irq, | |||
367 | __set_irq_handler(irq, handle, 1, NULL); | 367 | __set_irq_handler(irq, handle, 1, NULL); |
368 | } | 368 | } |
369 | 369 | ||
370 | extern void set_irq_noprobe(unsigned int irq); | ||
371 | extern void set_irq_probe(unsigned int irq); | ||
372 | |||
370 | /* Handle dynamic irq creation and destruction */ | 373 | /* Handle dynamic irq creation and destruction */ |
371 | extern int create_irq(void); | 374 | extern int create_irq(void); |
372 | extern void destroy_irq(unsigned int irq); | 375 | extern void destroy_irq(unsigned int irq); |
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index d0ecc8eebfbf..9cb2855bb170 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -507,7 +507,6 @@ typedef struct modem_info { | |||
507 | struct ktermios normal_termios; /* For saving termios structs */ | 507 | struct ktermios normal_termios; /* For saving termios structs */ |
508 | struct ktermios callout_termios; | 508 | struct ktermios callout_termios; |
509 | wait_queue_head_t open_wait, close_wait; | 509 | wait_queue_head_t open_wait, close_wait; |
510 | struct semaphore write_sem; | ||
511 | spinlock_t readlock; | 510 | spinlock_t readlock; |
512 | } modem_info; | 511 | } modem_info; |
513 | 512 | ||
diff --git a/include/linux/isicom.h b/include/linux/isicom.h index 45b3d48f0978..8f4c71759d73 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h | |||
@@ -37,8 +37,6 @@ | |||
37 | #define BOARD_COUNT 4 | 37 | #define BOARD_COUNT 4 |
38 | #define PORT_COUNT (BOARD_COUNT*16) | 38 | #define PORT_COUNT (BOARD_COUNT*16) |
39 | 39 | ||
40 | #define SERIAL_TYPE_NORMAL 1 | ||
41 | |||
42 | /* character sizes */ | 40 | /* character sizes */ |
43 | 41 | ||
44 | #define ISICOM_CS5 0x0000 | 42 | #define ISICOM_CS5 0x0000 |
diff --git a/include/linux/istallion.h b/include/linux/istallion.h index 106a5e85e5c4..5a84fe944b74 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h | |||
@@ -71,7 +71,6 @@ struct stliport { | |||
71 | wait_queue_head_t open_wait; | 71 | wait_queue_head_t open_wait; |
72 | wait_queue_head_t close_wait; | 72 | wait_queue_head_t close_wait; |
73 | wait_queue_head_t raw_wait; | 73 | wait_queue_head_t raw_wait; |
74 | struct work_struct tqhangup; | ||
75 | struct asysigs asig; | 74 | struct asysigs asig; |
76 | unsigned long addr; | 75 | unsigned long addr; |
77 | unsigned long rxoffset; | 76 | unsigned long rxoffset; |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index d9ecd13393b0..b18fd3b9b835 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/lockdep.h> | 33 | #include <linux/lockdep.h> |
34 | 34 | ||
35 | #include <asm/semaphore.h> | 35 | #include <asm/semaphore.h> |
36 | #endif | ||
37 | 36 | ||
38 | #define journal_oom_retry 1 | 37 | #define journal_oom_retry 1 |
39 | 38 | ||
@@ -84,7 +83,6 @@ static inline void jbd_free(void *ptr, size_t size) | |||
84 | 83 | ||
85 | #define JFS_MIN_JOURNAL_BLOCKS 1024 | 84 | #define JFS_MIN_JOURNAL_BLOCKS 1024 |
86 | 85 | ||
87 | #ifdef __KERNEL__ | ||
88 | 86 | ||
89 | /** | 87 | /** |
90 | * typedef handle_t - The handle_t type represents a single atomic update being performed by some process. | 88 | * typedef handle_t - The handle_t type represents a single atomic update being performed by some process. |
@@ -924,7 +922,6 @@ extern int journal_recover (journal_t *journal); | |||
924 | extern int journal_wipe (journal_t *, int); | 922 | extern int journal_wipe (journal_t *, int); |
925 | extern int journal_skip_recovery (journal_t *); | 923 | extern int journal_skip_recovery (journal_t *); |
926 | extern void journal_update_superblock (journal_t *, int); | 924 | extern void journal_update_superblock (journal_t *, int); |
927 | extern void __journal_abort_hard (journal_t *); | ||
928 | extern void journal_abort (journal_t *, int); | 925 | extern void journal_abort (journal_t *, int); |
929 | extern int journal_errno (journal_t *); | 926 | extern int journal_errno (journal_t *); |
930 | extern void journal_ack_err (journal_t *); | 927 | extern void journal_ack_err (journal_t *); |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 7ba9e47bf061..e0b5b684d83f 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -42,7 +42,7 @@ | |||
42 | /* LATCH is used in the interval timer and ftape setup. */ | 42 | /* LATCH is used in the interval timer and ftape setup. */ |
43 | #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ | 43 | #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ |
44 | 44 | ||
45 | /* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can | 45 | /* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, then we can |
46 | * improve accuracy by shifting LSH bits, hence calculating: | 46 | * improve accuracy by shifting LSH bits, hence calculating: |
47 | * (NOM << LSH) / DEN | 47 | * (NOM << LSH) / DEN |
48 | * This however means trouble for large NOM, because (NOM << LSH) may no | 48 | * This however means trouble for large NOM, because (NOM << LSH) may no |
@@ -160,7 +160,7 @@ extern unsigned long preset_lpj; | |||
160 | * We want to do realistic conversions of time so we need to use the same | 160 | * We want to do realistic conversions of time so we need to use the same |
161 | * values the update wall clock code uses as the jiffies size. This value | 161 | * values the update wall clock code uses as the jiffies size. This value |
162 | * is: TICK_NSEC (which is defined in timex.h). This | 162 | * is: TICK_NSEC (which is defined in timex.h). This |
163 | * is a constant and is in nanoseconds. We will used scaled math | 163 | * is a constant and is in nanoseconds. We will use scaled math |
164 | * with a set of scales defined here as SEC_JIFFIE_SC, USEC_JIFFIE_SC and | 164 | * with a set of scales defined here as SEC_JIFFIE_SC, USEC_JIFFIE_SC and |
165 | * NSEC_JIFFIE_SC. Note that these defines contain nothing but | 165 | * NSEC_JIFFIE_SC. Note that these defines contain nothing but |
166 | * constants and so are computed at compile time. SHIFT_HZ (computed in | 166 | * constants and so are computed at compile time. SHIFT_HZ (computed in |
@@ -204,7 +204,7 @@ extern unsigned long preset_lpj; | |||
204 | * operator if the result is a long long AND at least one of the | 204 | * operator if the result is a long long AND at least one of the |
205 | * operands is cast to long long (usually just prior to the "*" so as | 205 | * operands is cast to long long (usually just prior to the "*" so as |
206 | * not to confuse it into thinking it really has a 64-bit operand, | 206 | * not to confuse it into thinking it really has a 64-bit operand, |
207 | * which, buy the way, it can do, but it take more code and at least 2 | 207 | * which, buy the way, it can do, but it takes more code and at least 2 |
208 | * mpys). | 208 | * mpys). |
209 | 209 | ||
210 | * We also need to be aware that one second in nanoseconds is only a | 210 | * We also need to be aware that one second in nanoseconds is only a |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index ff356b2ee478..2df44e773270 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -35,7 +35,7 @@ extern const char linux_proc_banner[]; | |||
35 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) | 35 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) |
36 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) | 36 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) |
37 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) | 37 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) |
38 | #define IS_ALIGNED(x,a) (((x) % ((typeof(x))(a))) == 0) | 38 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) |
39 | 39 | ||
40 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) | 40 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) |
41 | 41 | ||
@@ -133,7 +133,7 @@ NORET_TYPE void panic(const char * fmt, ...) | |||
133 | extern void oops_enter(void); | 133 | extern void oops_enter(void); |
134 | extern void oops_exit(void); | 134 | extern void oops_exit(void); |
135 | extern int oops_may_print(void); | 135 | extern int oops_may_print(void); |
136 | fastcall NORET_TYPE void do_exit(long error_code) | 136 | NORET_TYPE void do_exit(long error_code) |
137 | ATTRIB_NORET; | 137 | ATTRIB_NORET; |
138 | NORET_TYPE void complete_and_exit(struct completion *, long) | 138 | NORET_TYPE void complete_and_exit(struct completion *, long) |
139 | ATTRIB_NORET; | 139 | ATTRIB_NORET; |
@@ -141,6 +141,10 @@ extern unsigned long simple_strtoul(const char *,char **,unsigned int); | |||
141 | extern long simple_strtol(const char *,char **,unsigned int); | 141 | extern long simple_strtol(const char *,char **,unsigned int); |
142 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); | 142 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); |
143 | extern long long simple_strtoll(const char *,char **,unsigned int); | 143 | extern long long simple_strtoll(const char *,char **,unsigned int); |
144 | extern int strict_strtoul(const char *, unsigned int, unsigned long *); | ||
145 | extern int strict_strtol(const char *, unsigned int, long *); | ||
146 | extern int strict_strtoull(const char *, unsigned int, unsigned long long *); | ||
147 | extern int strict_strtoll(const char *, unsigned int, long long *); | ||
144 | extern int sprintf(char * buf, const char * fmt, ...) | 148 | extern int sprintf(char * buf, const char * fmt, ...) |
145 | __attribute__ ((format (printf, 2, 3))); | 149 | __attribute__ ((format (printf, 2, 3))); |
146 | extern int vsprintf(char *buf, const char *, va_list) | 150 | extern int vsprintf(char *buf, const char *, va_list) |
@@ -172,8 +176,6 @@ extern int kernel_text_address(unsigned long addr); | |||
172 | struct pid; | 176 | struct pid; |
173 | extern struct pid *session_of_pgrp(struct pid *pgrp); | 177 | extern struct pid *session_of_pgrp(struct pid *pgrp); |
174 | 178 | ||
175 | extern void dump_thread(struct pt_regs *regs, struct user *dump); | ||
176 | |||
177 | #ifdef CONFIG_PRINTK | 179 | #ifdef CONFIG_PRINTK |
178 | asmlinkage int vprintk(const char *fmt, va_list args) | 180 | asmlinkage int vprintk(const char *fmt, va_list args) |
179 | __attribute__ ((format (printf, 1, 0))); | 181 | __attribute__ ((format (printf, 1, 0))); |
@@ -182,6 +184,13 @@ asmlinkage int printk(const char * fmt, ...) | |||
182 | extern int log_buf_get_len(void); | 184 | extern int log_buf_get_len(void); |
183 | extern int log_buf_read(int idx); | 185 | extern int log_buf_read(int idx); |
184 | extern int log_buf_copy(char *dest, int idx, int len); | 186 | extern int log_buf_copy(char *dest, int idx, int len); |
187 | |||
188 | extern int printk_ratelimit_jiffies; | ||
189 | extern int printk_ratelimit_burst; | ||
190 | extern int printk_ratelimit(void); | ||
191 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | ||
192 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
193 | unsigned int interval_msec); | ||
185 | #else | 194 | #else |
186 | static inline int vprintk(const char *s, va_list args) | 195 | static inline int vprintk(const char *s, va_list args) |
187 | __attribute__ ((format (printf, 1, 0))); | 196 | __attribute__ ((format (printf, 1, 0))); |
@@ -192,6 +201,12 @@ static inline int __cold printk(const char *s, ...) { return 0; } | |||
192 | static inline int log_buf_get_len(void) { return 0; } | 201 | static inline int log_buf_get_len(void) { return 0; } |
193 | static inline int log_buf_read(int idx) { return 0; } | 202 | static inline int log_buf_read(int idx) { return 0; } |
194 | static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } | 203 | static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } |
204 | static inline int printk_ratelimit(void) { return 0; } | ||
205 | static inline int __printk_ratelimit(int ratelimit_jiffies, \ | ||
206 | int ratelimit_burst) { return 0; } | ||
207 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
208 | unsigned int interval_msec) \ | ||
209 | { return false; } | ||
195 | #endif | 210 | #endif |
196 | 211 | ||
197 | extern void __attribute__((format(printf, 1, 2))) | 212 | extern void __attribute__((format(printf, 1, 2))) |
@@ -199,11 +214,6 @@ extern void __attribute__((format(printf, 1, 2))) | |||
199 | 214 | ||
200 | unsigned long int_sqrt(unsigned long); | 215 | unsigned long int_sqrt(unsigned long); |
201 | 216 | ||
202 | extern int printk_ratelimit(void); | ||
203 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | ||
204 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
205 | unsigned int interval_msec); | ||
206 | |||
207 | static inline void console_silent(void) | 217 | static inline void console_silent(void) |
208 | { | 218 | { |
209 | console_loglevel = 0; | 219 | console_loglevel = 0; |
@@ -224,6 +234,7 @@ extern int panic_on_unrecovered_nmi; | |||
224 | extern int tainted; | 234 | extern int tainted; |
225 | extern const char *print_tainted(void); | 235 | extern const char *print_tainted(void); |
226 | extern void add_taint(unsigned); | 236 | extern void add_taint(unsigned); |
237 | extern int root_mountflags; | ||
227 | 238 | ||
228 | /* Values used for system_state */ | 239 | /* Values used for system_state */ |
229 | extern enum system_states { | 240 | extern enum system_states { |
@@ -243,6 +254,7 @@ extern enum system_states { | |||
243 | #define TAINT_BAD_PAGE (1<<5) | 254 | #define TAINT_BAD_PAGE (1<<5) |
244 | #define TAINT_USER (1<<6) | 255 | #define TAINT_USER (1<<6) |
245 | #define TAINT_DIE (1<<7) | 256 | #define TAINT_DIE (1<<7) |
257 | #define TAINT_OVERRIDDEN_ACPI_TABLE (1<<8) | ||
246 | 258 | ||
247 | extern void dump_stack(void) __cold; | 259 | extern void dump_stack(void) __cold; |
248 | 260 | ||
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 2d9c448d8c52..3265968cd2cd 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -127,17 +127,21 @@ void vmcoreinfo_append_str(const char *fmt, ...) | |||
127 | __attribute__ ((format (printf, 1, 2))); | 127 | __attribute__ ((format (printf, 1, 2))); |
128 | unsigned long paddr_vmcoreinfo_note(void); | 128 | unsigned long paddr_vmcoreinfo_note(void); |
129 | 129 | ||
130 | #define VMCOREINFO_OSRELEASE(name) \ | ||
131 | vmcoreinfo_append_str("OSRELEASE=%s\n", #name) | ||
132 | #define VMCOREINFO_PAGESIZE(value) \ | ||
133 | vmcoreinfo_append_str("PAGESIZE=%ld\n", value) | ||
130 | #define VMCOREINFO_SYMBOL(name) \ | 134 | #define VMCOREINFO_SYMBOL(name) \ |
131 | vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) | 135 | vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) |
132 | #define VMCOREINFO_SIZE(name) \ | 136 | #define VMCOREINFO_SIZE(name) \ |
133 | vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ | 137 | vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ |
134 | (unsigned long)sizeof(struct name)) | ||
135 | #define VMCOREINFO_TYPEDEF_SIZE(name) \ | ||
136 | vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ | ||
137 | (unsigned long)sizeof(name)) | 138 | (unsigned long)sizeof(name)) |
139 | #define VMCOREINFO_STRUCT_SIZE(name) \ | ||
140 | vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ | ||
141 | (unsigned long)sizeof(struct name)) | ||
138 | #define VMCOREINFO_OFFSET(name, field) \ | 142 | #define VMCOREINFO_OFFSET(name, field) \ |
139 | vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ | 143 | vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ |
140 | (unsigned long)&(((struct name *)0)->field)) | 144 | (unsigned long)offsetof(struct name, field)) |
141 | #define VMCOREINFO_LENGTH(name, value) \ | 145 | #define VMCOREINFO_LENGTH(name, value) \ |
142 | vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) | 146 | vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) |
143 | #define VMCOREINFO_NUMBER(name) \ | 147 | #define VMCOREINFO_NUMBER(name) \ |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 6168c0a44172..4a6ce82ba039 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -152,8 +152,10 @@ static inline int arch_trampoline_kprobe(struct kprobe *p) | |||
152 | struct kretprobe { | 152 | struct kretprobe { |
153 | struct kprobe kp; | 153 | struct kprobe kp; |
154 | kretprobe_handler_t handler; | 154 | kretprobe_handler_t handler; |
155 | kretprobe_handler_t entry_handler; | ||
155 | int maxactive; | 156 | int maxactive; |
156 | int nmissed; | 157 | int nmissed; |
158 | size_t data_size; | ||
157 | struct hlist_head free_instances; | 159 | struct hlist_head free_instances; |
158 | struct hlist_head used_instances; | 160 | struct hlist_head used_instances; |
159 | }; | 161 | }; |
@@ -164,6 +166,7 @@ struct kretprobe_instance { | |||
164 | struct kretprobe *rp; | 166 | struct kretprobe *rp; |
165 | kprobe_opcode_t *ret_addr; | 167 | kprobe_opcode_t *ret_addr; |
166 | struct task_struct *task; | 168 | struct task_struct *task; |
169 | char data[0]; | ||
167 | }; | 170 | }; |
168 | 171 | ||
169 | struct kretprobe_blackpoint { | 172 | struct kretprobe_blackpoint { |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index a6ddec141f96..36c542b70c6d 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -316,7 +316,8 @@ static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec) | |||
316 | * idea of the (in)accuracy of timers. Timer values are rounded up to | 316 | * idea of the (in)accuracy of timers. Timer values are rounded up to |
317 | * this resolution values. | 317 | * this resolution values. |
318 | */ | 318 | */ |
319 | #define KTIME_LOW_RES (ktime_t){ .tv64 = TICK_NSEC } | 319 | #define LOW_RES_NSEC TICK_NSEC |
320 | #define KTIME_LOW_RES (ktime_t){ .tv64 = LOW_RES_NSEC } | ||
320 | 321 | ||
321 | /* Get the monotonic time in timespec format: */ | 322 | /* Get the monotonic time in timespec format: */ |
322 | extern void ktime_get_ts(struct timespec *ts); | 323 | extern void ktime_get_ts(struct timespec *ts); |
diff --git a/include/linux/latency.h b/include/linux/latency.h deleted file mode 100644 index c08b52bb55b0..000000000000 --- a/include/linux/latency.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /* | ||
2 | * latency.h: Explicit system-wide latency-expectation infrastructure | ||
3 | * | ||
4 | * (C) Copyright 2006 Intel Corporation | ||
5 | * Author: Arjan van de Ven <arjan@linux.intel.com> | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _INCLUDE_GUARD_LATENCY_H_ | ||
10 | #define _INCLUDE_GUARD_LATENCY_H_ | ||
11 | |||
12 | #include <linux/notifier.h> | ||
13 | |||
14 | void set_acceptable_latency(char *identifier, int usecs); | ||
15 | void modify_acceptable_latency(char *identifier, int usecs); | ||
16 | void remove_acceptable_latency(char *identifier); | ||
17 | void synchronize_acceptable_latency(void); | ||
18 | int system_latency_constraint(void); | ||
19 | |||
20 | int register_latency_notifier(struct notifier_block * nb); | ||
21 | int unregister_latency_notifier(struct notifier_block * nb); | ||
22 | |||
23 | #define INFINITE_LATENCY 1000000 | ||
24 | |||
25 | #endif | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index b4130ff58d0c..0201f6f51cea 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -38,6 +38,11 @@ struct led_classdev { | |||
38 | void (*brightness_set)(struct led_classdev *led_cdev, | 38 | void (*brightness_set)(struct led_classdev *led_cdev, |
39 | enum led_brightness brightness); | 39 | enum led_brightness brightness); |
40 | 40 | ||
41 | /* Activate hardware accelerated blink */ | ||
42 | int (*blink_set)(struct led_classdev *led_cdev, | ||
43 | unsigned long *delay_on, | ||
44 | unsigned long *delay_off); | ||
45 | |||
41 | struct device *dev; | 46 | struct device *dev; |
42 | struct list_head node; /* LED Device list */ | 47 | struct list_head node; /* LED Device list */ |
43 | char *default_trigger; /* Trigger to use */ | 48 | char *default_trigger; /* Trigger to use */ |
@@ -54,7 +59,15 @@ struct led_classdev { | |||
54 | 59 | ||
55 | extern int led_classdev_register(struct device *parent, | 60 | extern int led_classdev_register(struct device *parent, |
56 | struct led_classdev *led_cdev); | 61 | struct led_classdev *led_cdev); |
57 | extern void led_classdev_unregister(struct led_classdev *led_cdev); | 62 | extern void __led_classdev_unregister(struct led_classdev *led_cdev, bool sus); |
63 | static inline void led_classdev_unregister(struct led_classdev *lcd) | ||
64 | { | ||
65 | __led_classdev_unregister(lcd, false); | ||
66 | } | ||
67 | static inline void led_classdev_unregister_suspended(struct led_classdev *lcd) | ||
68 | { | ||
69 | __led_classdev_unregister(lcd, true); | ||
70 | } | ||
58 | extern void led_classdev_suspend(struct led_classdev *led_cdev); | 71 | extern void led_classdev_suspend(struct led_classdev *led_cdev); |
59 | extern void led_classdev_resume(struct led_classdev *led_cdev); | 72 | extern void led_classdev_resume(struct led_classdev *led_cdev); |
60 | 73 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 4374c4277780..bc5a8d0c7090 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -457,7 +457,6 @@ struct ata_queued_cmd { | |||
457 | unsigned long flags; /* ATA_QCFLAG_xxx */ | 457 | unsigned long flags; /* ATA_QCFLAG_xxx */ |
458 | unsigned int tag; | 458 | unsigned int tag; |
459 | unsigned int n_elem; | 459 | unsigned int n_elem; |
460 | unsigned int n_iter; | ||
461 | unsigned int mapped_n_elem; | 460 | unsigned int mapped_n_elem; |
462 | 461 | ||
463 | int dma_dir; | 462 | int dma_dir; |
@@ -1367,7 +1366,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) | |||
1367 | qc->nbytes = qc->raw_nbytes = qc->curbytes = 0; | 1366 | qc->nbytes = qc->raw_nbytes = qc->curbytes = 0; |
1368 | qc->n_elem = 0; | 1367 | qc->n_elem = 0; |
1369 | qc->mapped_n_elem = 0; | 1368 | qc->mapped_n_elem = 0; |
1370 | qc->n_iter = 0; | ||
1371 | qc->err_mask = 0; | 1369 | qc->err_mask = 0; |
1372 | qc->pad_len = 0; | 1370 | qc->pad_len = 0; |
1373 | qc->last_sg = NULL; | 1371 | qc->last_sg = NULL; |
diff --git a/include/linux/log2.h b/include/linux/log2.h index c8cf5e8ef171..25b808631cd9 100644 --- a/include/linux/log2.h +++ b/include/linux/log2.h | |||
@@ -190,4 +190,20 @@ unsigned long __rounddown_pow_of_two(unsigned long n) | |||
190 | __rounddown_pow_of_two(n) \ | 190 | __rounddown_pow_of_two(n) \ |
191 | ) | 191 | ) |
192 | 192 | ||
193 | /** | ||
194 | * order_base_2 - calculate the (rounded up) base 2 order of the argument | ||
195 | * @n: parameter | ||
196 | * | ||
197 | * The first few values calculated by this routine: | ||
198 | * ob2(0) = 0 | ||
199 | * ob2(1) = 0 | ||
200 | * ob2(2) = 1 | ||
201 | * ob2(3) = 2 | ||
202 | * ob2(4) = 2 | ||
203 | * ob2(5) = 3 | ||
204 | * ... and so on. | ||
205 | */ | ||
206 | |||
207 | #define order_base_2(n) ilog2(roundup_pow_of_two(n)) | ||
208 | |||
193 | #endif /* _LINUX_LOG2_H */ | 209 | #endif /* _LINUX_LOG2_H */ |
diff --git a/include/linux/loop.h b/include/linux/loop.h index 26a0a103898f..46169a7b559b 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -76,6 +76,7 @@ struct loop_device { | |||
76 | enum { | 76 | enum { |
77 | LO_FLAGS_READ_ONLY = 1, | 77 | LO_FLAGS_READ_ONLY = 1, |
78 | LO_FLAGS_USE_AOPS = 2, | 78 | LO_FLAGS_USE_AOPS = 2, |
79 | LO_FLAGS_AUTOCLEAR = 4, | ||
79 | }; | 80 | }; |
80 | 81 | ||
81 | #include <asm/posix_types.h> /* for __kernel_old_dev_t */ | 82 | #include <asm/posix_types.h> /* for __kernel_old_dev_t */ |
diff --git a/include/linux/lp.h b/include/linux/lp.h index 7059b6b9878a..0df024bfd6f0 100644 --- a/include/linux/lp.h +++ b/include/linux/lp.h | |||
@@ -99,7 +99,7 @@ | |||
99 | #ifdef __KERNEL__ | 99 | #ifdef __KERNEL__ |
100 | 100 | ||
101 | #include <linux/wait.h> | 101 | #include <linux/wait.h> |
102 | #include <asm/semaphore.h> | 102 | #include <linux/mutex.h> |
103 | 103 | ||
104 | /* Magic numbers for defining port-device mappings */ | 104 | /* Magic numbers for defining port-device mappings */ |
105 | #define LP_PARPORT_UNSPEC -4 | 105 | #define LP_PARPORT_UNSPEC -4 |
@@ -145,7 +145,7 @@ struct lp_struct { | |||
145 | #endif | 145 | #endif |
146 | wait_queue_head_t waitq; | 146 | wait_queue_head_t waitq; |
147 | unsigned int last_error; | 147 | unsigned int last_error; |
148 | struct semaphore port_mutex; | 148 | struct mutex port_mutex; |
149 | wait_queue_head_t dataq; | 149 | wait_queue_head_t dataq; |
150 | long timeout; | 150 | long timeout; |
151 | unsigned int best_mode; | 151 | unsigned int best_mode; |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h new file mode 100644 index 000000000000..9815951ec995 --- /dev/null +++ b/include/linux/memcontrol.h | |||
@@ -0,0 +1,190 @@ | |||
1 | /* memcontrol.h - Memory Controller | ||
2 | * | ||
3 | * Copyright IBM Corporation, 2007 | ||
4 | * Author Balbir Singh <balbir@linux.vnet.ibm.com> | ||
5 | * | ||
6 | * Copyright 2007 OpenVZ SWsoft Inc | ||
7 | * Author: Pavel Emelianov <xemul@openvz.org> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | */ | ||
19 | |||
20 | #ifndef _LINUX_MEMCONTROL_H | ||
21 | #define _LINUX_MEMCONTROL_H | ||
22 | |||
23 | #include <linux/rcupdate.h> | ||
24 | #include <linux/mm.h> | ||
25 | |||
26 | struct mem_cgroup; | ||
27 | struct page_cgroup; | ||
28 | struct page; | ||
29 | struct mm_struct; | ||
30 | |||
31 | #ifdef CONFIG_CGROUP_MEM_CONT | ||
32 | |||
33 | extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p); | ||
34 | extern void mm_free_cgroup(struct mm_struct *mm); | ||
35 | extern void page_assign_page_cgroup(struct page *page, | ||
36 | struct page_cgroup *pc); | ||
37 | extern struct page_cgroup *page_get_page_cgroup(struct page *page); | ||
38 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | ||
39 | gfp_t gfp_mask); | ||
40 | extern void mem_cgroup_uncharge(struct page_cgroup *pc); | ||
41 | extern void mem_cgroup_uncharge_page(struct page *page); | ||
42 | extern void mem_cgroup_move_lists(struct page_cgroup *pc, bool active); | ||
43 | extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | ||
44 | struct list_head *dst, | ||
45 | unsigned long *scanned, int order, | ||
46 | int mode, struct zone *z, | ||
47 | struct mem_cgroup *mem_cont, | ||
48 | int active); | ||
49 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | ||
50 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | ||
51 | gfp_t gfp_mask); | ||
52 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | ||
53 | |||
54 | static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm) | ||
55 | { | ||
56 | return rcu_dereference(mm->mem_cgroup); | ||
57 | } | ||
58 | |||
59 | extern int mem_cgroup_prepare_migration(struct page *page); | ||
60 | extern void mem_cgroup_end_migration(struct page *page); | ||
61 | extern void mem_cgroup_page_migration(struct page *page, struct page *newpage); | ||
62 | |||
63 | /* | ||
64 | * For memory reclaim. | ||
65 | */ | ||
66 | extern int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem); | ||
67 | extern long mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem); | ||
68 | |||
69 | extern int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem); | ||
70 | extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | ||
71 | int priority); | ||
72 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | ||
73 | int priority); | ||
74 | |||
75 | extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem, | ||
76 | struct zone *zone, int priority); | ||
77 | extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, | ||
78 | struct zone *zone, int priority); | ||
79 | |||
80 | #else /* CONFIG_CGROUP_MEM_CONT */ | ||
81 | static inline void mm_init_cgroup(struct mm_struct *mm, | ||
82 | struct task_struct *p) | ||
83 | { | ||
84 | } | ||
85 | |||
86 | static inline void mm_free_cgroup(struct mm_struct *mm) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | static inline void page_assign_page_cgroup(struct page *page, | ||
91 | struct page_cgroup *pc) | ||
92 | { | ||
93 | } | ||
94 | |||
95 | static inline struct page_cgroup *page_get_page_cgroup(struct page *page) | ||
96 | { | ||
97 | return NULL; | ||
98 | } | ||
99 | |||
100 | static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm, | ||
101 | gfp_t gfp_mask) | ||
102 | { | ||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | static inline void mem_cgroup_uncharge(struct page_cgroup *pc) | ||
107 | { | ||
108 | } | ||
109 | |||
110 | static inline void mem_cgroup_uncharge_page(struct page *page) | ||
111 | { | ||
112 | } | ||
113 | |||
114 | static inline void mem_cgroup_move_lists(struct page_cgroup *pc, | ||
115 | bool active) | ||
116 | { | ||
117 | } | ||
118 | |||
119 | static inline int mem_cgroup_cache_charge(struct page *page, | ||
120 | struct mm_struct *mm, | ||
121 | gfp_t gfp_mask) | ||
122 | { | ||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm) | ||
127 | { | ||
128 | return NULL; | ||
129 | } | ||
130 | |||
131 | static inline int task_in_mem_cgroup(struct task_struct *task, | ||
132 | const struct mem_cgroup *mem) | ||
133 | { | ||
134 | return 1; | ||
135 | } | ||
136 | |||
137 | static inline int mem_cgroup_prepare_migration(struct page *page) | ||
138 | { | ||
139 | return 0; | ||
140 | } | ||
141 | |||
142 | static inline void mem_cgroup_end_migration(struct page *page) | ||
143 | { | ||
144 | } | ||
145 | |||
146 | static inline void | ||
147 | mem_cgroup_page_migration(struct page *page, struct page *newpage) | ||
148 | { | ||
149 | } | ||
150 | |||
151 | static inline int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem) | ||
152 | { | ||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | static inline int mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem) | ||
157 | { | ||
158 | return 0; | ||
159 | } | ||
160 | |||
161 | static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) | ||
162 | { | ||
163 | return 0; | ||
164 | } | ||
165 | |||
166 | static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | ||
167 | int priority) | ||
168 | { | ||
169 | } | ||
170 | |||
171 | static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | ||
172 | int priority) | ||
173 | { | ||
174 | } | ||
175 | |||
176 | static inline long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem, | ||
177 | struct zone *zone, int priority) | ||
178 | { | ||
179 | return 0; | ||
180 | } | ||
181 | |||
182 | static inline long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, | ||
183 | struct zone *zone, int priority) | ||
184 | { | ||
185 | return 0; | ||
186 | } | ||
187 | #endif /* CONFIG_CGROUP_MEM_CONT */ | ||
188 | |||
189 | #endif /* _LINUX_MEMCONTROL_H */ | ||
190 | |||
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h new file mode 100644 index 000000000000..4ab2162db13b --- /dev/null +++ b/include/linux/mfd/asic3.h | |||
@@ -0,0 +1,497 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/asic3.h | ||
3 | * | ||
4 | * Compaq ASIC3 headers. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * Copyright 2001 Compaq Computer Corporation. | ||
11 | * Copyright 2007 OpendHand. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASIC3_H__ | ||
15 | #define __ASIC3_H__ | ||
16 | |||
17 | #include <linux/types.h> | ||
18 | |||
19 | struct asic3 { | ||
20 | void __iomem *mapping; | ||
21 | unsigned int bus_shift; | ||
22 | unsigned int irq_nr; | ||
23 | unsigned int irq_base; | ||
24 | spinlock_t lock; | ||
25 | u16 irq_bothedge[4]; | ||
26 | struct device *dev; | ||
27 | }; | ||
28 | |||
29 | struct asic3_platform_data { | ||
30 | struct { | ||
31 | u32 dir; | ||
32 | u32 init; | ||
33 | u32 sleep_mask; | ||
34 | u32 sleep_out; | ||
35 | u32 batt_fault_out; | ||
36 | u32 sleep_conf; | ||
37 | u32 alt_function; | ||
38 | } gpio_a, gpio_b, gpio_c, gpio_d; | ||
39 | |||
40 | unsigned int bus_shift; | ||
41 | |||
42 | unsigned int irq_base; | ||
43 | |||
44 | struct platform_device **children; | ||
45 | unsigned int n_children; | ||
46 | }; | ||
47 | |||
48 | int asic3_gpio_get_value(struct asic3 *asic, unsigned gpio); | ||
49 | void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val); | ||
50 | |||
51 | #define ASIC3_NUM_GPIO_BANKS 4 | ||
52 | #define ASIC3_GPIOS_PER_BANK 16 | ||
53 | #define ASIC3_NUM_GPIOS 64 | ||
54 | #define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 | ||
55 | |||
56 | #define ASIC3_GPIO_BANK_A 0 | ||
57 | #define ASIC3_GPIO_BANK_B 1 | ||
58 | #define ASIC3_GPIO_BANK_C 2 | ||
59 | #define ASIC3_GPIO_BANK_D 3 | ||
60 | |||
61 | #define ASIC3_GPIO(bank, gpio) \ | ||
62 | ((ASIC3_GPIOS_PER_BANK * ASIC3_GPIO_BANK_##bank) + (gpio)) | ||
63 | #define ASIC3_GPIO_bit(gpio) (1 << (gpio & 0xf)) | ||
64 | /* All offsets below are specified with this address bus shift */ | ||
65 | #define ASIC3_DEFAULT_ADDR_SHIFT 2 | ||
66 | |||
67 | #define ASIC3_OFFSET(base, reg) (ASIC3_##base##_Base + ASIC3_##base##_##reg) | ||
68 | #define ASIC3_GPIO_OFFSET(base, reg) \ | ||
69 | (ASIC3_GPIO_##base##_Base + ASIC3_GPIO_##reg) | ||
70 | |||
71 | #define ASIC3_GPIO_A_Base 0x0000 | ||
72 | #define ASIC3_GPIO_B_Base 0x0100 | ||
73 | #define ASIC3_GPIO_C_Base 0x0200 | ||
74 | #define ASIC3_GPIO_D_Base 0x0300 | ||
75 | |||
76 | #define ASIC3_GPIO_Mask 0x00 /* R/W 0:don't mask */ | ||
77 | #define ASIC3_GPIO_Direction 0x04 /* R/W 0:input */ | ||
78 | #define ASIC3_GPIO_Out 0x08 /* R/W 0:output low */ | ||
79 | #define ASIC3_GPIO_TriggerType 0x0c /* R/W 0:level */ | ||
80 | #define ASIC3_GPIO_EdgeTrigger 0x10 /* R/W 0:falling */ | ||
81 | #define ASIC3_GPIO_LevelTrigger 0x14 /* R/W 0:low level detect */ | ||
82 | #define ASIC3_GPIO_SleepMask 0x18 /* R/W 0:don't mask in sleep mode */ | ||
83 | #define ASIC3_GPIO_SleepOut 0x1c /* R/W level 0:low in sleep mode */ | ||
84 | #define ASIC3_GPIO_BattFaultOut 0x20 /* R/W level 0:low in batt_fault */ | ||
85 | #define ASIC3_GPIO_IntStatus 0x24 /* R/W 0:none, 1:detect */ | ||
86 | #define ASIC3_GPIO_AltFunction 0x28 /* R/W 1:LED register control */ | ||
87 | #define ASIC3_GPIO_SleepConf 0x2c /* | ||
88 | * R/W bit 1: autosleep | ||
89 | * 0: disable gposlpout in normal mode, | ||
90 | * enable gposlpout in sleep mode. | ||
91 | */ | ||
92 | #define ASIC3_GPIO_Status 0x30 /* R Pin status */ | ||
93 | |||
94 | #define ASIC3_SPI_Base 0x0400 | ||
95 | #define ASIC3_SPI_Control 0x0000 | ||
96 | #define ASIC3_SPI_TxData 0x0004 | ||
97 | #define ASIC3_SPI_RxData 0x0008 | ||
98 | #define ASIC3_SPI_Int 0x000c | ||
99 | #define ASIC3_SPI_Status 0x0010 | ||
100 | |||
101 | #define SPI_CONTROL_SPR(clk) ((clk) & 0x0f) /* Clock rate */ | ||
102 | |||
103 | #define ASIC3_PWM_0_Base 0x0500 | ||
104 | #define ASIC3_PWM_1_Base 0x0600 | ||
105 | #define ASIC3_PWM_TimeBase 0x0000 | ||
106 | #define ASIC3_PWM_PeriodTime 0x0004 | ||
107 | #define ASIC3_PWM_DutyTime 0x0008 | ||
108 | |||
109 | #define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */ | ||
110 | #define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */ | ||
111 | |||
112 | #define ASIC3_LED_0_Base 0x0700 | ||
113 | #define ASIC3_LED_1_Base 0x0800 | ||
114 | #define ASIC3_LED_2_Base 0x0900 | ||
115 | #define ASIC3_LED_TimeBase 0x0000 /* R/W 7 bits */ | ||
116 | #define ASIC3_LED_PeriodTime 0x0004 /* R/W 12 bits */ | ||
117 | #define ASIC3_LED_DutyTime 0x0008 /* R/W 12 bits */ | ||
118 | #define ASIC3_LED_AutoStopCount 0x000c /* R/W 16 bits */ | ||
119 | |||
120 | /* LED TimeBase bits - match ASIC2 */ | ||
121 | #define LED_TBS 0x0f /* Low 4 bits sets time base, max = 13 */ | ||
122 | /* Note: max = 5 on hx4700 */ | ||
123 | /* 0: maximum time base */ | ||
124 | /* 1: maximum time base / 2 */ | ||
125 | /* n: maximum time base / 2^n */ | ||
126 | |||
127 | #define LED_EN (1 << 4) /* LED ON/OFF 0:off, 1:on */ | ||
128 | #define LED_AUTOSTOP (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */ | ||
129 | #define LED_ALWAYS (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */ | ||
130 | |||
131 | #define ASIC3_CLOCK_Base 0x0A00 | ||
132 | #define ASIC3_CLOCK_CDEX 0x00 | ||
133 | #define ASIC3_CLOCK_SEL 0x04 | ||
134 | |||
135 | #define CLOCK_CDEX_SOURCE (1 << 0) /* 2 bits */ | ||
136 | #define CLOCK_CDEX_SOURCE0 (1 << 0) | ||
137 | #define CLOCK_CDEX_SOURCE1 (1 << 1) | ||
138 | #define CLOCK_CDEX_SPI (1 << 2) | ||
139 | #define CLOCK_CDEX_OWM (1 << 3) | ||
140 | #define CLOCK_CDEX_PWM0 (1 << 4) | ||
141 | #define CLOCK_CDEX_PWM1 (1 << 5) | ||
142 | #define CLOCK_CDEX_LED0 (1 << 6) | ||
143 | #define CLOCK_CDEX_LED1 (1 << 7) | ||
144 | #define CLOCK_CDEX_LED2 (1 << 8) | ||
145 | |||
146 | /* Clocks settings: 1 for 24.576 MHz, 0 for 12.288Mhz */ | ||
147 | #define CLOCK_CDEX_SD_HOST (1 << 9) /* R/W: SD host clock source */ | ||
148 | #define CLOCK_CDEX_SD_BUS (1 << 10) /* R/W: SD bus clock source ctrl */ | ||
149 | #define CLOCK_CDEX_SMBUS (1 << 11) | ||
150 | #define CLOCK_CDEX_CONTROL_CX (1 << 12) | ||
151 | |||
152 | #define CLOCK_CDEX_EX0 (1 << 13) /* R/W: 32.768 kHz crystal */ | ||
153 | #define CLOCK_CDEX_EX1 (1 << 14) /* R/W: 24.576 MHz crystal */ | ||
154 | |||
155 | #define CLOCK_SEL_SD_HCLK_SEL (1 << 0) /* R/W: SDIO host clock select */ | ||
156 | #define CLOCK_SEL_SD_BCLK_SEL (1 << 1) /* R/W: SDIO bus clock select */ | ||
157 | |||
158 | /* R/W: INT clock source control (32.768 kHz) */ | ||
159 | #define CLOCK_SEL_CX (1 << 2) | ||
160 | |||
161 | |||
162 | #define ASIC3_INTR_Base 0x0B00 | ||
163 | |||
164 | #define ASIC3_INTR_IntMask 0x00 /* Interrupt mask control */ | ||
165 | #define ASIC3_INTR_PIntStat 0x04 /* Peripheral interrupt status */ | ||
166 | #define ASIC3_INTR_IntCPS 0x08 /* Interrupt timer clock pre-scale */ | ||
167 | #define ASIC3_INTR_IntTBS 0x0c /* Interrupt timer set */ | ||
168 | |||
169 | #define ASIC3_INTMASK_GINTMASK (1 << 0) /* Global INTs mask 1:enable */ | ||
170 | #define ASIC3_INTMASK_GINTEL (1 << 1) /* 1: rising edge, 0: hi level */ | ||
171 | #define ASIC3_INTMASK_MASK0 (1 << 2) | ||
172 | #define ASIC3_INTMASK_MASK1 (1 << 3) | ||
173 | #define ASIC3_INTMASK_MASK2 (1 << 4) | ||
174 | #define ASIC3_INTMASK_MASK3 (1 << 5) | ||
175 | #define ASIC3_INTMASK_MASK4 (1 << 6) | ||
176 | #define ASIC3_INTMASK_MASK5 (1 << 7) | ||
177 | |||
178 | #define ASIC3_INTR_PERIPHERAL_A (1 << 0) | ||
179 | #define ASIC3_INTR_PERIPHERAL_B (1 << 1) | ||
180 | #define ASIC3_INTR_PERIPHERAL_C (1 << 2) | ||
181 | #define ASIC3_INTR_PERIPHERAL_D (1 << 3) | ||
182 | #define ASIC3_INTR_LED0 (1 << 4) | ||
183 | #define ASIC3_INTR_LED1 (1 << 5) | ||
184 | #define ASIC3_INTR_LED2 (1 << 6) | ||
185 | #define ASIC3_INTR_SPI (1 << 7) | ||
186 | #define ASIC3_INTR_SMBUS (1 << 8) | ||
187 | #define ASIC3_INTR_OWM (1 << 9) | ||
188 | |||
189 | #define ASIC3_INTR_CPS(x) ((x)&0x0f) /* 4 bits, max 14 */ | ||
190 | #define ASIC3_INTR_CPS_SET (1 << 4) /* Time base enable */ | ||
191 | |||
192 | |||
193 | /* Basic control of the SD ASIC */ | ||
194 | #define ASIC3_SDHWCTRL_Base 0x0E00 | ||
195 | #define ASIC3_SDHWCTRL_SDConf 0x00 | ||
196 | |||
197 | #define ASIC3_SDHWCTRL_SUSPEND (1 << 0) /* 1=suspend all SD operations */ | ||
198 | #define ASIC3_SDHWCTRL_CLKSEL (1 << 1) /* 1=SDICK, 0=HCLK */ | ||
199 | #define ASIC3_SDHWCTRL_PCLR (1 << 2) /* All registers of SDIO cleared */ | ||
200 | #define ASIC3_SDHWCTRL_LEVCD (1 << 3) /* SD card detection: 0:low */ | ||
201 | |||
202 | /* SD card write protection: 0=high */ | ||
203 | #define ASIC3_SDHWCTRL_LEVWP (1 << 4) | ||
204 | #define ASIC3_SDHWCTRL_SDLED (1 << 5) /* SD card LED signal 0=disable */ | ||
205 | |||
206 | /* SD card power supply ctrl 1=enable */ | ||
207 | #define ASIC3_SDHWCTRL_SDPWR (1 << 6) | ||
208 | |||
209 | #define ASIC3_EXTCF_Base 0x1100 | ||
210 | |||
211 | #define ASIC3_EXTCF_Select 0x00 | ||
212 | #define ASIC3_EXTCF_Reset 0x04 | ||
213 | |||
214 | #define ASIC3_EXTCF_SMOD0 (1 << 0) /* slot number of mode 0 */ | ||
215 | #define ASIC3_EXTCF_SMOD1 (1 << 1) /* slot number of mode 1 */ | ||
216 | #define ASIC3_EXTCF_SMOD2 (1 << 2) /* slot number of mode 2 */ | ||
217 | #define ASIC3_EXTCF_OWM_EN (1 << 4) /* enable onewire module */ | ||
218 | #define ASIC3_EXTCF_OWM_SMB (1 << 5) /* OWM bus selection */ | ||
219 | #define ASIC3_EXTCF_OWM_RESET (1 << 6) /* ?? used by OWM and CF */ | ||
220 | #define ASIC3_EXTCF_CF0_SLEEP_MODE (1 << 7) /* CF0 sleep state */ | ||
221 | #define ASIC3_EXTCF_CF1_SLEEP_MODE (1 << 8) /* CF1 sleep state */ | ||
222 | #define ASIC3_EXTCF_CF0_PWAIT_EN (1 << 10) /* CF0 PWAIT_n control */ | ||
223 | #define ASIC3_EXTCF_CF1_PWAIT_EN (1 << 11) /* CF1 PWAIT_n control */ | ||
224 | #define ASIC3_EXTCF_CF0_BUF_EN (1 << 12) /* CF0 buffer control */ | ||
225 | #define ASIC3_EXTCF_CF1_BUF_EN (1 << 13) /* CF1 buffer control */ | ||
226 | #define ASIC3_EXTCF_SD_MEM_ENABLE (1 << 14) | ||
227 | #define ASIC3_EXTCF_CF_SLEEP (1 << 15) /* CF sleep mode control */ | ||
228 | |||
229 | /********************************************* | ||
230 | * The Onewire interface registers | ||
231 | * | ||
232 | * OWM_CMD | ||
233 | * OWM_DAT | ||
234 | * OWM_INTR | ||
235 | * OWM_INTEN | ||
236 | * OWM_CLKDIV | ||
237 | * | ||
238 | *********************************************/ | ||
239 | |||
240 | #define ASIC3_OWM_Base 0xC00 | ||
241 | |||
242 | #define ASIC3_OWM_CMD 0x00 | ||
243 | #define ASIC3_OWM_DAT 0x04 | ||
244 | #define ASIC3_OWM_INTR 0x08 | ||
245 | #define ASIC3_OWM_INTEN 0x0C | ||
246 | #define ASIC3_OWM_CLKDIV 0x10 | ||
247 | |||
248 | #define ASIC3_OWM_CMD_ONEWR (1 << 0) | ||
249 | #define ASIC3_OWM_CMD_SRA (1 << 1) | ||
250 | #define ASIC3_OWM_CMD_DQO (1 << 2) | ||
251 | #define ASIC3_OWM_CMD_DQI (1 << 3) | ||
252 | |||
253 | #define ASIC3_OWM_INTR_PD (1 << 0) | ||
254 | #define ASIC3_OWM_INTR_PDR (1 << 1) | ||
255 | #define ASIC3_OWM_INTR_TBE (1 << 2) | ||
256 | #define ASIC3_OWM_INTR_TEMP (1 << 3) | ||
257 | #define ASIC3_OWM_INTR_RBF (1 << 4) | ||
258 | |||
259 | #define ASIC3_OWM_INTEN_EPD (1 << 0) | ||
260 | #define ASIC3_OWM_INTEN_IAS (1 << 1) | ||
261 | #define ASIC3_OWM_INTEN_ETBE (1 << 2) | ||
262 | #define ASIC3_OWM_INTEN_ETMT (1 << 3) | ||
263 | #define ASIC3_OWM_INTEN_ERBF (1 << 4) | ||
264 | |||
265 | #define ASIC3_OWM_CLKDIV_PRE (3 << 0) /* two bits wide at bit 0 */ | ||
266 | #define ASIC3_OWM_CLKDIV_DIV (7 << 2) /* 3 bits wide at bit 2 */ | ||
267 | |||
268 | |||
269 | /***************************************************************************** | ||
270 | * The SD configuration registers are at a completely different location | ||
271 | * in memory. They are divided into three sets of registers: | ||
272 | * | ||
273 | * SD_CONFIG Core configuration register | ||
274 | * SD_CTRL Control registers for SD operations | ||
275 | * SDIO_CTRL Control registers for SDIO operations | ||
276 | * | ||
277 | *****************************************************************************/ | ||
278 | #define ASIC3_SD_CONFIG_Base 0x0400 /* Assumes 32 bit addressing */ | ||
279 | |||
280 | #define ASIC3_SD_CONFIG_Command 0x08 /* R/W: Command */ | ||
281 | |||
282 | /* [0:8] SD Control Register Base Address */ | ||
283 | #define ASIC3_SD_CONFIG_Addr0 0x20 | ||
284 | |||
285 | /* [9:31] SD Control Register Base Address */ | ||
286 | #define ASIC3_SD_CONFIG_Addr1 0x24 | ||
287 | |||
288 | /* R/O: interrupt assigned to pin */ | ||
289 | #define ASIC3_SD_CONFIG_IntPin 0x78 | ||
290 | |||
291 | /* | ||
292 | * Set to 0x1f to clock SD controller, 0 otherwise. | ||
293 | * At 0x82 - Gated Clock Ctrl | ||
294 | */ | ||
295 | #define ASIC3_SD_CONFIG_ClkStop 0x80 | ||
296 | |||
297 | /* Control clock of SD controller */ | ||
298 | #define ASIC3_SD_CONFIG_ClockMode 0x84 | ||
299 | #define ASIC3_SD_CONFIG_SDHC_PinStatus 0x88 /* R/0: SD pins status */ | ||
300 | #define ASIC3_SD_CONFIG_SDHC_Power1 0x90 /* Power1 - manual pwr ctrl */ | ||
301 | |||
302 | /* auto power up after card inserted */ | ||
303 | #define ASIC3_SD_CONFIG_SDHC_Power2 0x92 | ||
304 | |||
305 | /* auto power down when card removed */ | ||
306 | #define ASIC3_SD_CONFIG_SDHC_Power3 0x94 | ||
307 | #define ASIC3_SD_CONFIG_SDHC_CardDetect 0x98 | ||
308 | #define ASIC3_SD_CONFIG_SDHC_Slot 0xA0 /* R/O: support slot number */ | ||
309 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk1 0x1E0 /* Not used */ | ||
310 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk2 0x1E2 /* Not used*/ | ||
311 | |||
312 | /* GPIO Output Reg. , at 0x1EA - GPIO Output Enable Reg. */ | ||
313 | #define ASIC3_SD_CONFIG_SDHC_GPIO_OutAndEnable 0x1E8 | ||
314 | #define ASIC3_SD_CONFIG_SDHC_GPIO_Status 0x1EC /* GPIO Status Reg. */ | ||
315 | |||
316 | /* Bit 1: double buffer/single buffer */ | ||
317 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk3 0x1F0 | ||
318 | |||
319 | /* Memory access enable (set to 1 to access SD Controller) */ | ||
320 | #define SD_CONFIG_COMMAND_MAE (1<<1) | ||
321 | |||
322 | #define SD_CONFIG_CLK_ENABLE_ALL 0x1f | ||
323 | |||
324 | #define SD_CONFIG_POWER1_PC_33V 0x0200 /* Set for 3.3 volts */ | ||
325 | #define SD_CONFIG_POWER1_PC_OFF 0x0000 /* Turn off power */ | ||
326 | |||
327 | /* two bits - number of cycles for card detection */ | ||
328 | #define SD_CONFIG_CARDDETECTMODE_CLK ((x) & 0x3) | ||
329 | |||
330 | |||
331 | #define ASIC3_SD_CTRL_Base 0x1000 | ||
332 | |||
333 | #define ASIC3_SD_CTRL_Cmd 0x00 | ||
334 | #define ASIC3_SD_CTRL_Arg0 0x08 | ||
335 | #define ASIC3_SD_CTRL_Arg1 0x0C | ||
336 | #define ASIC3_SD_CTRL_StopInternal 0x10 | ||
337 | #define ASIC3_SD_CTRL_TransferSectorCount 0x14 | ||
338 | #define ASIC3_SD_CTRL_Response0 0x18 | ||
339 | #define ASIC3_SD_CTRL_Response1 0x1C | ||
340 | #define ASIC3_SD_CTRL_Response2 0x20 | ||
341 | #define ASIC3_SD_CTRL_Response3 0x24 | ||
342 | #define ASIC3_SD_CTRL_Response4 0x28 | ||
343 | #define ASIC3_SD_CTRL_Response5 0x2C | ||
344 | #define ASIC3_SD_CTRL_Response6 0x30 | ||
345 | #define ASIC3_SD_CTRL_Response7 0x34 | ||
346 | #define ASIC3_SD_CTRL_CardStatus 0x38 | ||
347 | #define ASIC3_SD_CTRL_BufferCtrl 0x3C | ||
348 | #define ASIC3_SD_CTRL_IntMaskCard 0x40 | ||
349 | #define ASIC3_SD_CTRL_IntMaskBuffer 0x44 | ||
350 | #define ASIC3_SD_CTRL_CardClockCtrl 0x48 | ||
351 | #define ASIC3_SD_CTRL_MemCardXferDataLen 0x4C | ||
352 | #define ASIC3_SD_CTRL_MemCardOptionSetup 0x50 | ||
353 | #define ASIC3_SD_CTRL_ErrorStatus0 0x58 | ||
354 | #define ASIC3_SD_CTRL_ErrorStatus1 0x5C | ||
355 | #define ASIC3_SD_CTRL_DataPort 0x60 | ||
356 | #define ASIC3_SD_CTRL_TransactionCtrl 0x68 | ||
357 | #define ASIC3_SD_CTRL_SoftwareReset 0x1C0 | ||
358 | |||
359 | #define SD_CTRL_SOFTWARE_RESET_CLEAR (1<<0) | ||
360 | |||
361 | #define SD_CTRL_TRANSACTIONCONTROL_SET (1<<8) | ||
362 | |||
363 | #define SD_CTRL_CARDCLOCKCONTROL_FOR_SD_CARD (1<<15) | ||
364 | #define SD_CTRL_CARDCLOCKCONTROL_ENABLE_CLOCK (1<<8) | ||
365 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_512 (1<<7) | ||
366 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_256 (1<<6) | ||
367 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_128 (1<<5) | ||
368 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_64 (1<<4) | ||
369 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_32 (1<<3) | ||
370 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_16 (1<<2) | ||
371 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_8 (1<<1) | ||
372 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_4 (1<<0) | ||
373 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_2 (0<<0) | ||
374 | |||
375 | #define MEM_CARD_OPTION_REQUIRED 0x000e | ||
376 | #define MEM_CARD_OPTION_DATA_RESPONSE_TIMEOUT(x) (((x) & 0x0f) << 4) | ||
377 | #define MEM_CARD_OPTION_C2_MODULE_NOT_PRESENT (1<<14) | ||
378 | #define MEM_CARD_OPTION_DATA_XFR_WIDTH_1 (1<<15) | ||
379 | #define MEM_CARD_OPTION_DATA_XFR_WIDTH_4 0 | ||
380 | |||
381 | #define SD_CTRL_COMMAND_INDEX(x) ((x) & 0x3f) | ||
382 | #define SD_CTRL_COMMAND_TYPE_CMD (0 << 6) | ||
383 | #define SD_CTRL_COMMAND_TYPE_ACMD (1 << 6) | ||
384 | #define SD_CTRL_COMMAND_TYPE_AUTHENTICATION (2 << 6) | ||
385 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_NORMAL (0 << 8) | ||
386 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1 (4 << 8) | ||
387 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1B (5 << 8) | ||
388 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R2 (6 << 8) | ||
389 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R3 (7 << 8) | ||
390 | #define SD_CTRL_COMMAND_DATA_PRESENT (1 << 11) | ||
391 | #define SD_CTRL_COMMAND_TRANSFER_READ (1 << 12) | ||
392 | #define SD_CTRL_COMMAND_TRANSFER_WRITE (0 << 12) | ||
393 | #define SD_CTRL_COMMAND_MULTI_BLOCK (1 << 13) | ||
394 | #define SD_CTRL_COMMAND_SECURITY_CMD (1 << 14) | ||
395 | |||
396 | #define SD_CTRL_STOP_INTERNAL_ISSSUE_CMD12 (1 << 0) | ||
397 | #define SD_CTRL_STOP_INTERNAL_AUTO_ISSUE_CMD12 (1 << 8) | ||
398 | |||
399 | #define SD_CTRL_CARDSTATUS_RESPONSE_END (1 << 0) | ||
400 | #define SD_CTRL_CARDSTATUS_RW_END (1 << 2) | ||
401 | #define SD_CTRL_CARDSTATUS_CARD_REMOVED_0 (1 << 3) | ||
402 | #define SD_CTRL_CARDSTATUS_CARD_INSERTED_0 (1 << 4) | ||
403 | #define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_0 (1 << 5) | ||
404 | #define SD_CTRL_CARDSTATUS_WRITE_PROTECT (1 << 7) | ||
405 | #define SD_CTRL_CARDSTATUS_CARD_REMOVED_3 (1 << 8) | ||
406 | #define SD_CTRL_CARDSTATUS_CARD_INSERTED_3 (1 << 9) | ||
407 | #define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_3 (1 << 10) | ||
408 | |||
409 | #define SD_CTRL_BUFFERSTATUS_CMD_INDEX_ERROR (1 << 0) | ||
410 | #define SD_CTRL_BUFFERSTATUS_CRC_ERROR (1 << 1) | ||
411 | #define SD_CTRL_BUFFERSTATUS_STOP_BIT_END_ERROR (1 << 2) | ||
412 | #define SD_CTRL_BUFFERSTATUS_DATA_TIMEOUT (1 << 3) | ||
413 | #define SD_CTRL_BUFFERSTATUS_BUFFER_OVERFLOW (1 << 4) | ||
414 | #define SD_CTRL_BUFFERSTATUS_BUFFER_UNDERFLOW (1 << 5) | ||
415 | #define SD_CTRL_BUFFERSTATUS_CMD_TIMEOUT (1 << 6) | ||
416 | #define SD_CTRL_BUFFERSTATUS_UNK7 (1 << 7) | ||
417 | #define SD_CTRL_BUFFERSTATUS_BUFFER_READ_ENABLE (1 << 8) | ||
418 | #define SD_CTRL_BUFFERSTATUS_BUFFER_WRITE_ENABLE (1 << 9) | ||
419 | #define SD_CTRL_BUFFERSTATUS_ILLEGAL_FUNCTION (1 << 13) | ||
420 | #define SD_CTRL_BUFFERSTATUS_CMD_BUSY (1 << 14) | ||
421 | #define SD_CTRL_BUFFERSTATUS_ILLEGAL_ACCESS (1 << 15) | ||
422 | |||
423 | #define SD_CTRL_INTMASKCARD_RESPONSE_END (1 << 0) | ||
424 | #define SD_CTRL_INTMASKCARD_RW_END (1 << 2) | ||
425 | #define SD_CTRL_INTMASKCARD_CARD_REMOVED_0 (1 << 3) | ||
426 | #define SD_CTRL_INTMASKCARD_CARD_INSERTED_0 (1 << 4) | ||
427 | #define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_0 (1 << 5) | ||
428 | #define SD_CTRL_INTMASKCARD_UNK6 (1 << 6) | ||
429 | #define SD_CTRL_INTMASKCARD_WRITE_PROTECT (1 << 7) | ||
430 | #define SD_CTRL_INTMASKCARD_CARD_REMOVED_3 (1 << 8) | ||
431 | #define SD_CTRL_INTMASKCARD_CARD_INSERTED_3 (1 << 9) | ||
432 | #define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_3 (1 << 10) | ||
433 | |||
434 | #define SD_CTRL_INTMASKBUFFER_CMD_INDEX_ERROR (1 << 0) | ||
435 | #define SD_CTRL_INTMASKBUFFER_CRC_ERROR (1 << 1) | ||
436 | #define SD_CTRL_INTMASKBUFFER_STOP_BIT_END_ERROR (1 << 2) | ||
437 | #define SD_CTRL_INTMASKBUFFER_DATA_TIMEOUT (1 << 3) | ||
438 | #define SD_CTRL_INTMASKBUFFER_BUFFER_OVERFLOW (1 << 4) | ||
439 | #define SD_CTRL_INTMASKBUFFER_BUFFER_UNDERFLOW (1 << 5) | ||
440 | #define SD_CTRL_INTMASKBUFFER_CMD_TIMEOUT (1 << 6) | ||
441 | #define SD_CTRL_INTMASKBUFFER_UNK7 (1 << 7) | ||
442 | #define SD_CTRL_INTMASKBUFFER_BUFFER_READ_ENABLE (1 << 8) | ||
443 | #define SD_CTRL_INTMASKBUFFER_BUFFER_WRITE_ENABLE (1 << 9) | ||
444 | #define SD_CTRL_INTMASKBUFFER_ILLEGAL_FUNCTION (1 << 13) | ||
445 | #define SD_CTRL_INTMASKBUFFER_CMD_BUSY (1 << 14) | ||
446 | #define SD_CTRL_INTMASKBUFFER_ILLEGAL_ACCESS (1 << 15) | ||
447 | |||
448 | #define SD_CTRL_DETAIL0_RESPONSE_CMD_ERROR (1 << 0) | ||
449 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 2) | ||
450 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_CMD12 (1 << 3) | ||
451 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_READ_DATA (1 << 4) | ||
452 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_WRITE_CRC_STATUS (1 << 5) | ||
453 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 8) | ||
454 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_CMD12 (1 << 9) | ||
455 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_READ_DATA (1 << 10) | ||
456 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_WRITE_CMD (1 << 11) | ||
457 | |||
458 | #define SD_CTRL_DETAIL1_NO_CMD_RESPONSE (1 << 0) | ||
459 | #define SD_CTRL_DETAIL1_TIMEOUT_READ_DATA (1 << 4) | ||
460 | #define SD_CTRL_DETAIL1_TIMEOUT_CRS_STATUS (1 << 5) | ||
461 | #define SD_CTRL_DETAIL1_TIMEOUT_CRC_BUSY (1 << 6) | ||
462 | |||
463 | #define ASIC3_SDIO_CTRL_Base 0x1200 | ||
464 | |||
465 | #define ASIC3_SDIO_CTRL_Cmd 0x00 | ||
466 | #define ASIC3_SDIO_CTRL_CardPortSel 0x04 | ||
467 | #define ASIC3_SDIO_CTRL_Arg0 0x08 | ||
468 | #define ASIC3_SDIO_CTRL_Arg1 0x0C | ||
469 | #define ASIC3_SDIO_CTRL_TransferBlockCount 0x14 | ||
470 | #define ASIC3_SDIO_CTRL_Response0 0x18 | ||
471 | #define ASIC3_SDIO_CTRL_Response1 0x1C | ||
472 | #define ASIC3_SDIO_CTRL_Response2 0x20 | ||
473 | #define ASIC3_SDIO_CTRL_Response3 0x24 | ||
474 | #define ASIC3_SDIO_CTRL_Response4 0x28 | ||
475 | #define ASIC3_SDIO_CTRL_Response5 0x2C | ||
476 | #define ASIC3_SDIO_CTRL_Response6 0x30 | ||
477 | #define ASIC3_SDIO_CTRL_Response7 0x34 | ||
478 | #define ASIC3_SDIO_CTRL_CardStatus 0x38 | ||
479 | #define ASIC3_SDIO_CTRL_BufferCtrl 0x3C | ||
480 | #define ASIC3_SDIO_CTRL_IntMaskCard 0x40 | ||
481 | #define ASIC3_SDIO_CTRL_IntMaskBuffer 0x44 | ||
482 | #define ASIC3_SDIO_CTRL_CardXferDataLen 0x4C | ||
483 | #define ASIC3_SDIO_CTRL_CardOptionSetup 0x50 | ||
484 | #define ASIC3_SDIO_CTRL_ErrorStatus0 0x54 | ||
485 | #define ASIC3_SDIO_CTRL_ErrorStatus1 0x58 | ||
486 | #define ASIC3_SDIO_CTRL_DataPort 0x60 | ||
487 | #define ASIC3_SDIO_CTRL_TransactionCtrl 0x68 | ||
488 | #define ASIC3_SDIO_CTRL_CardIntCtrl 0x6C | ||
489 | #define ASIC3_SDIO_CTRL_ClocknWaitCtrl 0x70 | ||
490 | #define ASIC3_SDIO_CTRL_HostInformation 0x74 | ||
491 | #define ASIC3_SDIO_CTRL_ErrorCtrl 0x78 | ||
492 | #define ASIC3_SDIO_CTRL_LEDCtrl 0x7C | ||
493 | #define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 | ||
494 | |||
495 | #define ASIC3_MAP_SIZE 0x2000 | ||
496 | |||
497 | #endif /* __ASIC3_H__ */ | ||
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index dff9ea32606a..24b30b9b4f8a 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -43,7 +43,15 @@ struct miscdevice { | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | extern int misc_register(struct miscdevice * misc); | 45 | extern int misc_register(struct miscdevice * misc); |
46 | extern int misc_deregister(struct miscdevice * misc); | 46 | extern int __misc_deregister(struct miscdevice *misc, bool suspended); |
47 | static inline int misc_deregister(struct miscdevice *misc) | ||
48 | { | ||
49 | return __misc_deregister(misc, false); | ||
50 | } | ||
51 | static inline int misc_deregister_suspended(struct miscdevice *misc) | ||
52 | { | ||
53 | return __misc_deregister(misc, true); | ||
54 | } | ||
47 | 55 | ||
48 | #define MODULE_ALIAS_MISCDEV(minor) \ | 56 | #define MODULE_ALIAS_MISCDEV(minor) \ |
49 | MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \ | 57 | MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \ |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 222815d91c40..6cdf813cd478 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -133,6 +133,11 @@ enum { | |||
133 | MLX4_STAT_RATE_OFFSET = 5 | 133 | MLX4_STAT_RATE_OFFSET = 5 |
134 | }; | 134 | }; |
135 | 135 | ||
136 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) | ||
137 | { | ||
138 | return (major << 32) | (minor << 16) | subminor; | ||
139 | } | ||
140 | |||
136 | struct mlx4_caps { | 141 | struct mlx4_caps { |
137 | u64 fw_ver; | 142 | u64 fw_ver; |
138 | int num_ports; | 143 | int num_ports; |
@@ -189,10 +194,8 @@ struct mlx4_buf_list { | |||
189 | }; | 194 | }; |
190 | 195 | ||
191 | struct mlx4_buf { | 196 | struct mlx4_buf { |
192 | union { | 197 | struct mlx4_buf_list direct; |
193 | struct mlx4_buf_list direct; | 198 | struct mlx4_buf_list *page_list; |
194 | struct mlx4_buf_list *page_list; | ||
195 | } u; | ||
196 | int nbufs; | 199 | int nbufs; |
197 | int npages; | 200 | int npages; |
198 | int page_shift; | 201 | int page_shift; |
@@ -308,6 +311,14 @@ struct mlx4_init_port_param { | |||
308 | int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, | 311 | int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, |
309 | struct mlx4_buf *buf); | 312 | struct mlx4_buf *buf); |
310 | void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); | 313 | void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); |
314 | static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset) | ||
315 | { | ||
316 | if (BITS_PER_LONG == 64 || buf->nbufs == 1) | ||
317 | return buf->direct.buf + offset; | ||
318 | else | ||
319 | return buf->page_list[offset >> PAGE_SHIFT].buf + | ||
320 | (offset & (PAGE_SIZE - 1)); | ||
321 | } | ||
311 | 322 | ||
312 | int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); | 323 | int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); |
313 | void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); | 324 | void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index 3968b943259a..09a2230923f2 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -154,7 +154,11 @@ struct mlx4_qp_context { | |||
154 | u32 reserved5[10]; | 154 | u32 reserved5[10]; |
155 | }; | 155 | }; |
156 | 156 | ||
157 | /* Which firmware version adds support for NEC (NoErrorCompletion) bit */ | ||
158 | #define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232) | ||
159 | |||
157 | enum { | 160 | enum { |
161 | MLX4_WQE_CTRL_NEC = 1 << 29, | ||
158 | MLX4_WQE_CTRL_FENCE = 1 << 6, | 162 | MLX4_WQE_CTRL_FENCE = 1 << 6, |
159 | MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, | 163 | MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, |
160 | MLX4_WQE_CTRL_SOLICITED = 1 << 1, | 164 | MLX4_WQE_CTRL_SOLICITED = 1 << 1, |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 1bba6789a50a..e8abb3814209 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -227,10 +227,22 @@ static inline int put_page_testzero(struct page *page) | |||
227 | */ | 227 | */ |
228 | static inline int get_page_unless_zero(struct page *page) | 228 | static inline int get_page_unless_zero(struct page *page) |
229 | { | 229 | { |
230 | VM_BUG_ON(PageCompound(page)); | 230 | VM_BUG_ON(PageTail(page)); |
231 | return atomic_inc_not_zero(&page->_count); | 231 | return atomic_inc_not_zero(&page->_count); |
232 | } | 232 | } |
233 | 233 | ||
234 | /* Support for virtually mapped pages */ | ||
235 | struct page *vmalloc_to_page(const void *addr); | ||
236 | unsigned long vmalloc_to_pfn(const void *addr); | ||
237 | |||
238 | /* Determine if an address is within the vmalloc range */ | ||
239 | static inline int is_vmalloc_addr(const void *x) | ||
240 | { | ||
241 | unsigned long addr = (unsigned long)x; | ||
242 | |||
243 | return addr >= VMALLOC_START && addr < VMALLOC_END; | ||
244 | } | ||
245 | |||
234 | static inline struct page *compound_head(struct page *page) | 246 | static inline struct page *compound_head(struct page *page) |
235 | { | 247 | { |
236 | if (unlikely(PageTail(page))) | 248 | if (unlikely(PageTail(page))) |
@@ -706,6 +718,28 @@ unsigned long unmap_vmas(struct mmu_gather **tlb, | |||
706 | struct vm_area_struct *start_vma, unsigned long start_addr, | 718 | struct vm_area_struct *start_vma, unsigned long start_addr, |
707 | unsigned long end_addr, unsigned long *nr_accounted, | 719 | unsigned long end_addr, unsigned long *nr_accounted, |
708 | struct zap_details *); | 720 | struct zap_details *); |
721 | |||
722 | /** | ||
723 | * mm_walk - callbacks for walk_page_range | ||
724 | * @pgd_entry: if set, called for each non-empty PGD (top-level) entry | ||
725 | * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry | ||
726 | * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry | ||
727 | * @pte_entry: if set, called for each non-empty PTE (4th-level) entry | ||
728 | * @pte_hole: if set, called for each hole at all levels | ||
729 | * | ||
730 | * (see walk_page_range for more details) | ||
731 | */ | ||
732 | struct mm_walk { | ||
733 | int (*pgd_entry)(pgd_t *, unsigned long, unsigned long, void *); | ||
734 | int (*pud_entry)(pud_t *, unsigned long, unsigned long, void *); | ||
735 | int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, void *); | ||
736 | int (*pte_entry)(pte_t *, unsigned long, unsigned long, void *); | ||
737 | int (*pte_hole)(unsigned long, unsigned long, void *); | ||
738 | }; | ||
739 | |||
740 | int walk_page_range(const struct mm_struct *, unsigned long addr, | ||
741 | unsigned long end, const struct mm_walk *walk, | ||
742 | void *private); | ||
709 | void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | 743 | void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, |
710 | unsigned long end, unsigned long floor, unsigned long ceiling); | 744 | unsigned long end, unsigned long floor, unsigned long ceiling); |
711 | void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, | 745 | void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, |
@@ -860,6 +894,18 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a | |||
860 | #define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;}) | 894 | #define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;}) |
861 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | 895 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ |
862 | 896 | ||
897 | static inline void pgtable_page_ctor(struct page *page) | ||
898 | { | ||
899 | pte_lock_init(page); | ||
900 | inc_zone_page_state(page, NR_PAGETABLE); | ||
901 | } | ||
902 | |||
903 | static inline void pgtable_page_dtor(struct page *page) | ||
904 | { | ||
905 | pte_lock_deinit(page); | ||
906 | dec_zone_page_state(page, NR_PAGETABLE); | ||
907 | } | ||
908 | |||
863 | #define pte_offset_map_lock(mm, pmd, address, ptlp) \ | 909 | #define pte_offset_map_lock(mm, pmd, address, ptlp) \ |
864 | ({ \ | 910 | ({ \ |
865 | spinlock_t *__ptl = pte_lockptr(mm, pmd); \ | 911 | spinlock_t *__ptl = pte_lockptr(mm, pmd); \ |
@@ -1089,8 +1135,6 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma) | |||
1089 | 1135 | ||
1090 | pgprot_t vm_get_page_prot(unsigned long vm_flags); | 1136 | pgprot_t vm_get_page_prot(unsigned long vm_flags); |
1091 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); | 1137 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); |
1092 | struct page *vmalloc_to_page(void *addr); | ||
1093 | unsigned long vmalloc_to_pfn(void *addr); | ||
1094 | int remap_pfn_range(struct vm_area_struct *, unsigned long addr, | 1138 | int remap_pfn_range(struct vm_area_struct *, unsigned long addr, |
1095 | unsigned long pfn, unsigned long size, pgprot_t); | 1139 | unsigned long pfn, unsigned long size, pgprot_t); |
1096 | int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); | 1140 | int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); |
@@ -1104,7 +1148,7 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
1104 | #define FOLL_GET 0x04 /* do get_page on page */ | 1148 | #define FOLL_GET 0x04 /* do get_page on page */ |
1105 | #define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ | 1149 | #define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ |
1106 | 1150 | ||
1107 | typedef int (*pte_fn_t)(pte_t *pte, struct page *pmd_page, unsigned long addr, | 1151 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, |
1108 | void *data); | 1152 | void *data); |
1109 | extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, | 1153 | extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, |
1110 | unsigned long size, pte_fn_t fn, void *data); | 1154 | unsigned long size, pte_fn_t fn, void *data); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index f4c03e0b355e..bfee0bd1d435 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -64,7 +64,10 @@ struct page { | |||
64 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | 64 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS |
65 | spinlock_t ptl; | 65 | spinlock_t ptl; |
66 | #endif | 66 | #endif |
67 | struct kmem_cache *slab; /* SLUB: Pointer to slab */ | 67 | struct { |
68 | struct kmem_cache *slab; /* SLUB: Pointer to slab */ | ||
69 | void *end; /* SLUB: end marker */ | ||
70 | }; | ||
68 | struct page *first_page; /* Compound tail pages */ | 71 | struct page *first_page; /* Compound tail pages */ |
69 | }; | 72 | }; |
70 | union { | 73 | union { |
@@ -88,6 +91,9 @@ struct page { | |||
88 | void *virtual; /* Kernel virtual address (NULL if | 91 | void *virtual; /* Kernel virtual address (NULL if |
89 | not kmapped, ie. highmem) */ | 92 | not kmapped, ie. highmem) */ |
90 | #endif /* WANT_PAGE_VIRTUAL */ | 93 | #endif /* WANT_PAGE_VIRTUAL */ |
94 | #ifdef CONFIG_CGROUP_MEM_CONT | ||
95 | unsigned long page_cgroup; | ||
96 | #endif | ||
91 | }; | 97 | }; |
92 | 98 | ||
93 | /* | 99 | /* |
@@ -219,6 +225,9 @@ struct mm_struct { | |||
219 | /* aio bits */ | 225 | /* aio bits */ |
220 | rwlock_t ioctx_list_lock; | 226 | rwlock_t ioctx_list_lock; |
221 | struct kioctx *ioctx_list; | 227 | struct kioctx *ioctx_list; |
228 | #ifdef CONFIG_CGROUP_MEM_CONT | ||
229 | struct mem_cgroup *mem_cgroup; | ||
230 | #endif | ||
222 | }; | 231 | }; |
223 | 232 | ||
224 | #endif /* _LINUX_MM_TYPES_H */ | 233 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 4c4522a51a3b..8d8d1977736e 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -113,7 +113,7 @@ struct per_cpu_pages { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | struct per_cpu_pageset { | 115 | struct per_cpu_pageset { |
116 | struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ | 116 | struct per_cpu_pages pcp; |
117 | #ifdef CONFIG_NUMA | 117 | #ifdef CONFIG_NUMA |
118 | s8 expire; | 118 | s8 expire; |
119 | #endif | 119 | #endif |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index e9fddb42f26c..139d49d2f078 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -343,7 +343,8 @@ struct sdio_device_id { | |||
343 | __u8 class; /* Standard interface or SDIO_ANY_ID */ | 343 | __u8 class; /* Standard interface or SDIO_ANY_ID */ |
344 | __u16 vendor; /* Vendor or SDIO_ANY_ID */ | 344 | __u16 vendor; /* Vendor or SDIO_ANY_ID */ |
345 | __u16 device; /* Device ID or SDIO_ANY_ID */ | 345 | __u16 device; /* Device ID or SDIO_ANY_ID */ |
346 | kernel_ulong_t driver_data; /* Data private to the driver */ | 346 | kernel_ulong_t driver_data /* Data private to the driver */ |
347 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
347 | }; | 348 | }; |
348 | 349 | ||
349 | /* SSB core, see drivers/ssb/ */ | 350 | /* SSB core, see drivers/ssb/ */ |
diff --git a/include/linux/module.h b/include/linux/module.h index ac481e2094fd..ac28e8761e84 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -449,7 +449,7 @@ static inline void __module_get(struct module *module) | |||
449 | /* For kallsyms to ask for address resolution. namebuf should be at | 449 | /* For kallsyms to ask for address resolution. namebuf should be at |
450 | * least KSYM_NAME_LEN long: a pointer to namebuf is returned if | 450 | * least KSYM_NAME_LEN long: a pointer to namebuf is returned if |
451 | * found, otherwise NULL. */ | 451 | * found, otherwise NULL. */ |
452 | char *module_address_lookup(unsigned long addr, | 452 | const char *module_address_lookup(unsigned long addr, |
453 | unsigned long *symbolsize, | 453 | unsigned long *symbolsize, |
454 | unsigned long *offset, | 454 | unsigned long *offset, |
455 | char **modname, | 455 | char **modname, |
@@ -519,7 +519,7 @@ static inline void module_put(struct module *module) | |||
519 | #define module_name(mod) "kernel" | 519 | #define module_name(mod) "kernel" |
520 | 520 | ||
521 | /* For kallsyms to ask for address resolution. NULL means not found. */ | 521 | /* For kallsyms to ask for address resolution. NULL means not found. */ |
522 | static inline char *module_address_lookup(unsigned long addr, | 522 | static inline const char *module_address_lookup(unsigned long addr, |
523 | unsigned long *symbolsize, | 523 | unsigned long *symbolsize, |
524 | unsigned long *offset, | 524 | unsigned long *offset, |
525 | char **modname, | 525 | char **modname, |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index e17c5343cf51..b0ddf4b25862 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -98,6 +98,18 @@ static inline int cfi_interleave_supported(int i) | |||
98 | #define CFI_DEVICETYPE_X32 (32 / 8) | 98 | #define CFI_DEVICETYPE_X32 (32 / 8) |
99 | #define CFI_DEVICETYPE_X64 (64 / 8) | 99 | #define CFI_DEVICETYPE_X64 (64 / 8) |
100 | 100 | ||
101 | |||
102 | /* Device Interface Code Assignments from the "Common Flash Memory Interface | ||
103 | * Publication 100" dated December 1, 2001. | ||
104 | */ | ||
105 | #define CFI_INTERFACE_X8_ASYNC 0x0000 | ||
106 | #define CFI_INTERFACE_X16_ASYNC 0x0001 | ||
107 | #define CFI_INTERFACE_X8_BY_X16_ASYNC 0x0002 | ||
108 | #define CFI_INTERFACE_X32_ASYNC 0x0003 | ||
109 | #define CFI_INTERFACE_X16_BY_X32_ASYNC 0x0005 | ||
110 | #define CFI_INTERFACE_NOT_ALLOWED 0xffff | ||
111 | |||
112 | |||
101 | /* NB: We keep these structures in memory in HOST byteorder, except | 113 | /* NB: We keep these structures in memory in HOST byteorder, except |
102 | * where individually noted. | 114 | * where individually noted. |
103 | */ | 115 | */ |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 783fc983417c..0a13bb35f044 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -152,6 +152,15 @@ struct mtd_info { | |||
152 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | 152 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); |
153 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | 153 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); |
154 | 154 | ||
155 | /* In blackbox flight recorder like scenarios we want to make successful | ||
156 | writes in interrupt context. panic_write() is only intended to be | ||
157 | called when its known the kernel is about to panic and we need the | ||
158 | write to succeed. Since the kernel is not going to be running for much | ||
159 | longer, this function can break locks and delay to ensure the write | ||
160 | succeeds (but not sleep). */ | ||
161 | |||
162 | int (*panic_write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | ||
163 | |||
155 | int (*read_oob) (struct mtd_info *mtd, loff_t from, | 164 | int (*read_oob) (struct mtd_info *mtd, loff_t from, |
156 | struct mtd_oob_ops *ops); | 165 | struct mtd_oob_ops *ops); |
157 | int (*write_oob) (struct mtd_info *mtd, loff_t to, | 166 | int (*write_oob) (struct mtd_info *mtd, loff_t to, |
diff --git a/include/linux/mtd/mtdram.h b/include/linux/mtd/mtdram.h new file mode 100644 index 000000000000..04fdc07b7353 --- /dev/null +++ b/include/linux/mtd/mtdram.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __MTD_MTDRAM_H__ | ||
2 | #define __MTD_MTDRAM_H__ | ||
3 | |||
4 | #include <linux/mtd/mtd.h> | ||
5 | int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, | ||
6 | unsigned long size, char *name); | ||
7 | |||
8 | #endif /* __MTD_MTDRAM_H__ */ | ||
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index c46161f4eee3..d1b310c92eb4 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -67,6 +67,7 @@ | |||
67 | /* | 67 | /* |
68 | * Device ID Register F001h (R) | 68 | * Device ID Register F001h (R) |
69 | */ | 69 | */ |
70 | #define ONENAND_DEVICE_DENSITY_MASK (0xf) | ||
70 | #define ONENAND_DEVICE_DENSITY_SHIFT (4) | 71 | #define ONENAND_DEVICE_DENSITY_SHIFT (4) |
71 | #define ONENAND_DEVICE_IS_DDP (1 << 3) | 72 | #define ONENAND_DEVICE_IS_DDP (1 << 3) |
72 | #define ONENAND_DEVICE_IS_DEMUX (1 << 2) | 73 | #define ONENAND_DEVICE_IS_DEMUX (1 << 2) |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index da6b3d6f12a7..7c37d7e55abc 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -71,5 +71,12 @@ extern int parse_mtd_partitions(struct mtd_info *master, const char **types, | |||
71 | 71 | ||
72 | #define put_partition_parser(p) do { module_put((p)->owner); } while(0) | 72 | #define put_partition_parser(p) do { module_put((p)->owner); } while(0) |
73 | 73 | ||
74 | #endif | 74 | struct device; |
75 | struct device_node; | ||
76 | |||
77 | int __devinit of_mtd_parse_partitions(struct device *dev, | ||
78 | struct mtd_info *mtd, | ||
79 | struct device_node *node, | ||
80 | struct mtd_partition **pparts); | ||
75 | 81 | ||
82 | #endif | ||
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 3d967b6b120a..f71201d0f3e7 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
@@ -26,23 +26,6 @@ | |||
26 | #include <mtd/ubi-user.h> | 26 | #include <mtd/ubi-user.h> |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * UBI data type hint constants. | ||
30 | * | ||
31 | * UBI_LONGTERM: long-term data | ||
32 | * UBI_SHORTTERM: short-term data | ||
33 | * UBI_UNKNOWN: data persistence is unknown | ||
34 | * | ||
35 | * These constants are used when data is written to UBI volumes in order to | ||
36 | * help the UBI wear-leveling unit to find more appropriate physical | ||
37 | * eraseblocks. | ||
38 | */ | ||
39 | enum { | ||
40 | UBI_LONGTERM = 1, | ||
41 | UBI_SHORTTERM, | ||
42 | UBI_UNKNOWN | ||
43 | }; | ||
44 | |||
45 | /* | ||
46 | * enum ubi_open_mode - UBI volume open mode constants. | 29 | * enum ubi_open_mode - UBI volume open mode constants. |
47 | * | 30 | * |
48 | * UBI_READONLY: read-only mode | 31 | * UBI_READONLY: read-only mode |
@@ -167,6 +150,7 @@ int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, | |||
167 | int len, int dtype); | 150 | int len, int dtype); |
168 | int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum); | 151 | int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum); |
169 | int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum); | 152 | int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum); |
153 | int ubi_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype); | ||
170 | int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum); | 154 | int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum); |
171 | 155 | ||
172 | /* | 156 | /* |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 05c590352dd7..bc6da10ceee0 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -112,7 +112,7 @@ extern void __mutex_init(struct mutex *lock, const char *name, | |||
112 | * | 112 | * |
113 | * Returns 1 if the mutex is locked, 0 if unlocked. | 113 | * Returns 1 if the mutex is locked, 0 if unlocked. |
114 | */ | 114 | */ |
115 | static inline int fastcall mutex_is_locked(struct mutex *lock) | 115 | static inline int mutex_is_locked(struct mutex *lock) |
116 | { | 116 | { |
117 | return atomic_read(&lock->count) != 1; | 117 | return atomic_read(&lock->count) != 1; |
118 | } | 118 | } |
@@ -132,9 +132,9 @@ extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | |||
132 | #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) | 132 | #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) |
133 | #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) | 133 | #define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) |
134 | #else | 134 | #else |
135 | extern void fastcall mutex_lock(struct mutex *lock); | 135 | extern void mutex_lock(struct mutex *lock); |
136 | extern int __must_check fastcall mutex_lock_interruptible(struct mutex *lock); | 136 | extern int __must_check mutex_lock_interruptible(struct mutex *lock); |
137 | extern int __must_check fastcall mutex_lock_killable(struct mutex *lock); | 137 | extern int __must_check mutex_lock_killable(struct mutex *lock); |
138 | 138 | ||
139 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) | 139 | # define mutex_lock_nested(lock, subclass) mutex_lock(lock) |
140 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) | 140 | # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) |
@@ -145,7 +145,7 @@ extern int __must_check fastcall mutex_lock_killable(struct mutex *lock); | |||
145 | * NOTE: mutex_trylock() follows the spin_trylock() convention, | 145 | * NOTE: mutex_trylock() follows the spin_trylock() convention, |
146 | * not the down_trylock() convention! | 146 | * not the down_trylock() convention! |
147 | */ | 147 | */ |
148 | extern int fastcall mutex_trylock(struct mutex *lock); | 148 | extern int mutex_trylock(struct mutex *lock); |
149 | extern void fastcall mutex_unlock(struct mutex *lock); | 149 | extern void mutex_unlock(struct mutex *lock); |
150 | 150 | ||
151 | #endif | 151 | #endif |
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index cc2b47240a8f..986572081e19 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h | |||
@@ -35,7 +35,6 @@ enum { | |||
35 | }; | 35 | }; |
36 | 36 | ||
37 | #define nbd_cmd(req) ((req)->cmd[0]) | 37 | #define nbd_cmd(req) ((req)->cmd[0]) |
38 | #define MAX_NBD 128 | ||
39 | 38 | ||
40 | /* userspace doesn't need the nbd_device structure */ | 39 | /* userspace doesn't need the nbd_device structure */ |
41 | #ifdef __KERNEL__ | 40 | #ifdef __KERNEL__ |
diff --git a/include/linux/nubus.h b/include/linux/nubus.h index cdb3e9b8db54..c4355076d1a5 100644 --- a/include/linux/nubus.h +++ b/include/linux/nubus.h | |||
@@ -132,10 +132,12 @@ enum nubus_drhw { | |||
132 | NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */ | 132 | NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */ |
133 | NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */ | 133 | NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */ |
134 | NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */ | 134 | NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */ |
135 | NUBUS_DRHW_RASTER_24LXI = 0x02A0, /* RasterOps 8/24 XLi */ | 135 | NUBUS_DRHW_RASTER_24XLI = 0x02A0, /* RasterOps 8/24 XLi */ |
136 | NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */ | 136 | NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */ |
137 | NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */ | 137 | NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */ |
138 | NUBUS_DRHW_RASTER_24XLTV = 0x02B7, /* RasterOps 24XLTV */ | ||
138 | NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */ | 139 | NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */ |
140 | NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */ | ||
139 | NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */ | 141 | NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */ |
140 | NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */ | 142 | NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */ |
141 | NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */ | 143 | NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */ |
diff --git a/include/linux/of.h b/include/linux/of.h index b5f33efcb8e2..6981016dcc25 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -50,6 +50,7 @@ extern struct device_node *of_find_matching_node(struct device_node *from, | |||
50 | extern struct device_node *of_find_node_by_path(const char *path); | 50 | extern struct device_node *of_find_node_by_path(const char *path); |
51 | extern struct device_node *of_find_node_by_phandle(phandle handle); | 51 | extern struct device_node *of_find_node_by_phandle(phandle handle); |
52 | extern struct device_node *of_get_parent(const struct device_node *node); | 52 | extern struct device_node *of_get_parent(const struct device_node *node); |
53 | extern struct device_node *of_get_next_parent(struct device_node *node); | ||
53 | extern struct device_node *of_get_next_child(const struct device_node *node, | 54 | extern struct device_node *of_get_next_child(const struct device_node *node, |
54 | struct device_node *prev); | 55 | struct device_node *prev); |
55 | #define for_each_child_of_node(parent, child) \ | 56 | #define for_each_child_of_node(parent, child) \ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 209d3a47f50f..bbad43fb8181 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -131,16 +131,52 @@ | |||
131 | #define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags) | 131 | #define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags) |
132 | #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) | 132 | #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) |
133 | 133 | ||
134 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) | 134 | static inline int PageUptodate(struct page *page) |
135 | { | ||
136 | int ret = test_bit(PG_uptodate, &(page)->flags); | ||
137 | |||
138 | /* | ||
139 | * Must ensure that the data we read out of the page is loaded | ||
140 | * _after_ we've loaded page->flags to check for PageUptodate. | ||
141 | * We can skip the barrier if the page is not uptodate, because | ||
142 | * we wouldn't be reading anything from it. | ||
143 | * | ||
144 | * See SetPageUptodate() for the other side of the story. | ||
145 | */ | ||
146 | if (ret) | ||
147 | smp_rmb(); | ||
148 | |||
149 | return ret; | ||
150 | } | ||
151 | |||
152 | static inline void __SetPageUptodate(struct page *page) | ||
153 | { | ||
154 | smp_wmb(); | ||
155 | __set_bit(PG_uptodate, &(page)->flags); | ||
135 | #ifdef CONFIG_S390 | 156 | #ifdef CONFIG_S390 |
157 | page_clear_dirty(page); | ||
158 | #endif | ||
159 | } | ||
160 | |||
136 | static inline void SetPageUptodate(struct page *page) | 161 | static inline void SetPageUptodate(struct page *page) |
137 | { | 162 | { |
163 | #ifdef CONFIG_S390 | ||
138 | if (!test_and_set_bit(PG_uptodate, &page->flags)) | 164 | if (!test_and_set_bit(PG_uptodate, &page->flags)) |
139 | page_clear_dirty(page); | 165 | page_clear_dirty(page); |
140 | } | ||
141 | #else | 166 | #else |
142 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) | 167 | /* |
168 | * Memory barrier must be issued before setting the PG_uptodate bit, | ||
169 | * so that all previous stores issued in order to bring the page | ||
170 | * uptodate are actually visible before PageUptodate becomes true. | ||
171 | * | ||
172 | * s390 doesn't need an explicit smp_wmb here because the test and | ||
173 | * set bit already provides full barriers. | ||
174 | */ | ||
175 | smp_wmb(); | ||
176 | set_bit(PG_uptodate, &(page)->flags); | ||
143 | #endif | 177 | #endif |
178 | } | ||
179 | |||
144 | #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) | 180 | #define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) |
145 | 181 | ||
146 | #define PageDirty(page) test_bit(PG_dirty, &(page)->flags) | 182 | #define PageDirty(page) test_bit(PG_dirty, &(page)->flags) |
diff --git a/include/linux/pci.h b/include/linux/pci.h index cee75c0ff6e7..7215d3b1f4af 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -159,6 +159,8 @@ struct pci_dev { | |||
159 | this if your device has broken DMA | 159 | this if your device has broken DMA |
160 | or supports 64-bit transfers. */ | 160 | or supports 64-bit transfers. */ |
161 | 161 | ||
162 | struct device_dma_parameters dma_parms; | ||
163 | |||
162 | pci_power_t current_state; /* Current operating state. In ACPI-speak, | 164 | pci_power_t current_state; /* Current operating state. In ACPI-speak, |
163 | this is D0-D3, D0 being fully functional, | 165 | this is D0-D3, D0 being fully functional, |
164 | and D3 being off. */ | 166 | and D3 being off. */ |
@@ -580,6 +582,8 @@ void pci_intx(struct pci_dev *dev, int enable); | |||
580 | void pci_msi_off(struct pci_dev *dev); | 582 | void pci_msi_off(struct pci_dev *dev); |
581 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | 583 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); |
582 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | 584 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); |
585 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); | ||
586 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); | ||
583 | int pcix_get_max_mmrbc(struct pci_dev *dev); | 587 | int pcix_get_max_mmrbc(struct pci_dev *dev); |
584 | int pcix_get_mmrbc(struct pci_dev *dev); | 588 | int pcix_get_mmrbc(struct pci_dev *dev); |
585 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); | 589 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); |
@@ -822,6 +826,18 @@ static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | |||
822 | return -EIO; | 826 | return -EIO; |
823 | } | 827 | } |
824 | 828 | ||
829 | static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, | ||
830 | unsigned int size) | ||
831 | { | ||
832 | return -EIO; | ||
833 | } | ||
834 | |||
835 | static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, | ||
836 | unsigned long mask) | ||
837 | { | ||
838 | return -EIO; | ||
839 | } | ||
840 | |||
825 | static inline int pci_assign_resource(struct pci_dev *dev, int i) | 841 | static inline int pci_assign_resource(struct pci_dev *dev, int i) |
826 | { | 842 | { |
827 | return -EBUSY; | 843 | return -EBUSY; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 41f6f28690f6..df6dd79a0d3b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1765,6 +1765,7 @@ | |||
1765 | #define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 | 1765 | #define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 |
1766 | #define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 | 1766 | #define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 |
1767 | #define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 | 1767 | #define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 |
1768 | #define PCI_DEVICE_ID_QUATECH_SPPXP_100 0x0278 | ||
1768 | 1769 | ||
1769 | #define PCI_VENDOR_ID_SEALEVEL 0x135e | 1770 | #define PCI_VENDOR_ID_SEALEVEL 0x135e |
1770 | #define PCI_DEVICE_ID_SEALEVEL_U530 0x7101 | 1771 | #define PCI_DEVICE_ID_SEALEVEL_U530 0x7101 |
@@ -2043,6 +2044,23 @@ | |||
2043 | #define PCI_VENDOR_ID_QUICKNET 0x15e2 | 2044 | #define PCI_VENDOR_ID_QUICKNET 0x15e2 |
2044 | #define PCI_DEVICE_ID_QUICKNET_XJ 0x0500 | 2045 | #define PCI_DEVICE_ID_QUICKNET_XJ 0x0500 |
2045 | 2046 | ||
2047 | /* | ||
2048 | * ADDI-DATA GmbH communication cards <info@addi-data.com> | ||
2049 | */ | ||
2050 | #define PCI_VENDOR_ID_ADDIDATA_OLD 0x10E8 | ||
2051 | #define PCI_VENDOR_ID_ADDIDATA 0x15B8 | ||
2052 | #define PCI_DEVICE_ID_ADDIDATA_APCI7500 0x7000 | ||
2053 | #define PCI_DEVICE_ID_ADDIDATA_APCI7420 0x7001 | ||
2054 | #define PCI_DEVICE_ID_ADDIDATA_APCI7300 0x7002 | ||
2055 | #define PCI_DEVICE_ID_ADDIDATA_APCI7800 0x818E | ||
2056 | #define PCI_DEVICE_ID_ADDIDATA_APCI7500_2 0x7009 | ||
2057 | #define PCI_DEVICE_ID_ADDIDATA_APCI7420_2 0x700A | ||
2058 | #define PCI_DEVICE_ID_ADDIDATA_APCI7300_2 0x700B | ||
2059 | #define PCI_DEVICE_ID_ADDIDATA_APCI7500_3 0x700C | ||
2060 | #define PCI_DEVICE_ID_ADDIDATA_APCI7420_3 0x700D | ||
2061 | #define PCI_DEVICE_ID_ADDIDATA_APCI7300_3 0x700E | ||
2062 | #define PCI_DEVICE_ID_ADDIDATA_APCI7800_3 0x700F | ||
2063 | |||
2046 | #define PCI_VENDOR_ID_PDC 0x15e9 | 2064 | #define PCI_VENDOR_ID_PDC 0x15e9 |
2047 | 2065 | ||
2048 | #define PCI_VENDOR_ID_FARSITE 0x1619 | 2066 | #define PCI_VENDOR_ID_FARSITE 0x1619 |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 50faa0ea28e4..1ac969724bb2 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -54,7 +54,7 @@ | |||
54 | #ifdef CONFIG_SMP | 54 | #ifdef CONFIG_SMP |
55 | 55 | ||
56 | struct percpu_data { | 56 | struct percpu_data { |
57 | void *ptrs[NR_CPUS]; | 57 | void *ptrs[1]; |
58 | }; | 58 | }; |
59 | 59 | ||
60 | #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) | 60 | #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) |
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index 6db69ff5d83e..700725ddcaae 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h | |||
@@ -298,6 +298,7 @@ struct sadb_x_sec_ctx { | |||
298 | #define SADB_X_EALG_BLOWFISHCBC 7 | 298 | #define SADB_X_EALG_BLOWFISHCBC 7 |
299 | #define SADB_EALG_NULL 11 | 299 | #define SADB_EALG_NULL 11 |
300 | #define SADB_X_EALG_AESCBC 12 | 300 | #define SADB_X_EALG_AESCBC 12 |
301 | #define SADB_X_EALG_AESCTR 13 | ||
301 | #define SADB_X_EALG_AES_CCM_ICV8 14 | 302 | #define SADB_X_EALG_AES_CCM_ICV8 14 |
302 | #define SADB_X_EALG_AES_CCM_ICV12 15 | 303 | #define SADB_X_EALG_AES_CCM_ICV12 15 |
303 | #define SADB_X_EALG_AES_CCM_ICV16 16 | 304 | #define SADB_X_EALG_AES_CCM_ICV16 16 |
diff --git a/include/linux/pid.h b/include/linux/pid.h index e29a900a8499..f84d532b5d23 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -118,18 +118,17 @@ extern struct pid *find_pid(int nr); | |||
118 | */ | 118 | */ |
119 | extern struct pid *find_get_pid(int nr); | 119 | extern struct pid *find_get_pid(int nr); |
120 | extern struct pid *find_ge_pid(int nr, struct pid_namespace *); | 120 | extern struct pid *find_ge_pid(int nr, struct pid_namespace *); |
121 | int next_pidmap(struct pid_namespace *pid_ns, int last); | ||
121 | 122 | ||
122 | extern struct pid *alloc_pid(struct pid_namespace *ns); | 123 | extern struct pid *alloc_pid(struct pid_namespace *ns); |
123 | extern void FASTCALL(free_pid(struct pid *pid)); | 124 | extern void FASTCALL(free_pid(struct pid *pid)); |
124 | extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); | ||
125 | 125 | ||
126 | /* | 126 | /* |
127 | * the helpers to get the pid's id seen from different namespaces | 127 | * the helpers to get the pid's id seen from different namespaces |
128 | * | 128 | * |
129 | * pid_nr() : global id, i.e. the id seen from the init namespace; | 129 | * pid_nr() : global id, i.e. the id seen from the init namespace; |
130 | * pid_vnr() : virtual id, i.e. the id seen from the namespace this pid | 130 | * pid_vnr() : virtual id, i.e. the id seen from the pid namespace of |
131 | * belongs to. this only makes sence when called in the | 131 | * current. |
132 | * context of the task that belongs to the same namespace; | ||
133 | * pid_nr_ns() : id seen from the ns specified. | 132 | * pid_nr_ns() : id seen from the ns specified. |
134 | * | 133 | * |
135 | * see also task_xid_nr() etc in include/linux/sched.h | 134 | * see also task_xid_nr() etc in include/linux/sched.h |
@@ -144,14 +143,7 @@ static inline pid_t pid_nr(struct pid *pid) | |||
144 | } | 143 | } |
145 | 144 | ||
146 | pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns); | 145 | pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns); |
147 | 146 | pid_t pid_vnr(struct pid *pid); | |
148 | static inline pid_t pid_vnr(struct pid *pid) | ||
149 | { | ||
150 | pid_t nr = 0; | ||
151 | if (pid) | ||
152 | nr = pid->numbers[pid->level].nr; | ||
153 | return nr; | ||
154 | } | ||
155 | 147 | ||
156 | #define do_each_pid_task(pid, type, task) \ | 148 | #define do_each_pid_task(pid, type, task) \ |
157 | do { \ | 149 | do { \ |
@@ -160,7 +152,13 @@ static inline pid_t pid_vnr(struct pid *pid) | |||
160 | hlist_for_each_entry_rcu((task), pos___, \ | 152 | hlist_for_each_entry_rcu((task), pos___, \ |
161 | &pid->tasks[type], pids[type].node) { | 153 | &pid->tasks[type], pids[type].node) { |
162 | 154 | ||
155 | /* | ||
156 | * Both old and new leaders may be attached to | ||
157 | * the same pid in the middle of de_thread(). | ||
158 | */ | ||
163 | #define while_each_pid_task(pid, type, task) \ | 159 | #define while_each_pid_task(pid, type, task) \ |
160 | if (type == PIDTYPE_PID) \ | ||
161 | break; \ | ||
164 | } \ | 162 | } \ |
165 | } while (0) | 163 | } while (0) |
166 | 164 | ||
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 1689e28483e4..fcd61fa2c833 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
@@ -39,6 +39,7 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns) | |||
39 | 39 | ||
40 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); | 40 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); |
41 | extern void free_pid_ns(struct kref *kref); | 41 | extern void free_pid_ns(struct kref *kref); |
42 | extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); | ||
42 | 43 | ||
43 | static inline void put_pid_ns(struct pid_namespace *ns) | 44 | static inline void put_pid_ns(struct pid_namespace *ns) |
44 | { | 45 | { |
@@ -66,6 +67,11 @@ static inline void put_pid_ns(struct pid_namespace *ns) | |||
66 | { | 67 | { |
67 | } | 68 | } |
68 | 69 | ||
70 | |||
71 | static inline void zap_pid_ns_processes(struct pid_namespace *ns) | ||
72 | { | ||
73 | BUG(); | ||
74 | } | ||
69 | #endif /* CONFIG_PID_NS */ | 75 | #endif /* CONFIG_PID_NS */ |
70 | 76 | ||
71 | static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) | 77 | static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) |
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 40fac8c4559d..28dfc61cf79e 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h | |||
@@ -348,6 +348,7 @@ enum | |||
348 | FLOW_KEY_RTCLASSID, | 348 | FLOW_KEY_RTCLASSID, |
349 | FLOW_KEY_SKUID, | 349 | FLOW_KEY_SKUID, |
350 | FLOW_KEY_SKGID, | 350 | FLOW_KEY_SKGID, |
351 | FLOW_KEY_VLAN_TAG, | ||
351 | __FLOW_KEY_MAX, | 352 | __FLOW_KEY_MAX, |
352 | }; | 353 | }; |
353 | 354 | ||
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h new file mode 100644 index 000000000000..2e4e97bd19f7 --- /dev/null +++ b/include/linux/pm_qos_params.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* interface for the pm_qos_power infrastructure of the linux kernel. | ||
2 | * | ||
3 | * Mark Gross | ||
4 | */ | ||
5 | #include <linux/list.h> | ||
6 | #include <linux/notifier.h> | ||
7 | #include <linux/miscdevice.h> | ||
8 | |||
9 | #define PM_QOS_RESERVED 0 | ||
10 | #define PM_QOS_CPU_DMA_LATENCY 1 | ||
11 | #define PM_QOS_NETWORK_LATENCY 2 | ||
12 | #define PM_QOS_NETWORK_THROUGHPUT 3 | ||
13 | |||
14 | #define PM_QOS_NUM_CLASSES 4 | ||
15 | #define PM_QOS_DEFAULT_VALUE -1 | ||
16 | |||
17 | int pm_qos_add_requirement(int qos, char *name, s32 value); | ||
18 | int pm_qos_update_requirement(int qos, char *name, s32 new_value); | ||
19 | void pm_qos_remove_requirement(int qos, char *name); | ||
20 | |||
21 | int pm_qos_requirement(int qos); | ||
22 | |||
23 | int pm_qos_add_notifier(int qos, struct notifier_block *notifier); | ||
24 | int pm_qos_remove_notifier(int qos, struct notifier_block *notifier); | ||
25 | |||
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index b9339d8b95bc..cd6332b88829 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -258,6 +258,7 @@ extern struct pnp_protocol isapnp_protocol; | |||
258 | #else | 258 | #else |
259 | #define pnp_device_is_isapnp(dev) 0 | 259 | #define pnp_device_is_isapnp(dev) 0 |
260 | #endif | 260 | #endif |
261 | extern struct mutex pnp_res_mutex; | ||
261 | 262 | ||
262 | #ifdef CONFIG_PNPBIOS | 263 | #ifdef CONFIG_PNPBIOS |
263 | extern struct pnp_protocol pnpbios_protocol; | 264 | extern struct pnp_protocol pnpbios_protocol; |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 5cbf3e371012..68ed19ccf1f7 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -94,6 +94,7 @@ enum power_supply_property { | |||
94 | /* Properties of type `const char *' */ | 94 | /* Properties of type `const char *' */ |
95 | POWER_SUPPLY_PROP_MODEL_NAME, | 95 | POWER_SUPPLY_PROP_MODEL_NAME, |
96 | POWER_SUPPLY_PROP_MANUFACTURER, | 96 | POWER_SUPPLY_PROP_MANUFACTURER, |
97 | POWER_SUPPLY_PROP_SERIAL_NUMBER, | ||
97 | }; | 98 | }; |
98 | 99 | ||
99 | enum power_supply_type { | 100 | enum power_supply_type { |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index e2eff9079fe9..3800639775ae 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
@@ -63,4 +63,8 @@ | |||
63 | #define PR_GET_SECCOMP 21 | 63 | #define PR_GET_SECCOMP 21 |
64 | #define PR_SET_SECCOMP 22 | 64 | #define PR_SET_SECCOMP 22 |
65 | 65 | ||
66 | /* Get/set the capability bounding set */ | ||
67 | #define PR_CAPBSET_READ 23 | ||
68 | #define PR_CAPBSET_DROP 24 | ||
69 | |||
66 | #endif /* _LINUX_PRCTL_H */ | 70 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 484988ed301e..23f0c54175cd 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -11,8 +11,8 @@ | |||
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | 12 | ||
13 | #ifdef CONFIG_DEBUG_PREEMPT | 13 | #ifdef CONFIG_DEBUG_PREEMPT |
14 | extern void fastcall add_preempt_count(int val); | 14 | extern void add_preempt_count(int val); |
15 | extern void fastcall sub_preempt_count(int val); | 15 | extern void sub_preempt_count(int val); |
16 | #else | 16 | #else |
17 | # define add_preempt_count(val) do { preempt_count() += (val); } while (0) | 17 | # define add_preempt_count(val) do { preempt_count() += (val); } while (0) |
18 | # define sub_preempt_count(val) do { preempt_count() -= (val); } while (0) | 18 | # define sub_preempt_count(val) do { preempt_count() -= (val); } while (0) |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 8f92546b403d..d6a4f69bdc92 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -19,6 +19,8 @@ struct completion; | |||
19 | */ | 19 | */ |
20 | #define FIRST_PROCESS_ENTRY 256 | 20 | #define FIRST_PROCESS_ENTRY 256 |
21 | 21 | ||
22 | /* Worst case buffer size needed for holding an integer. */ | ||
23 | #define PROC_NUMBUF 13 | ||
22 | 24 | ||
23 | /* | 25 | /* |
24 | * We always define these enumerators | 26 | * We always define these enumerators |
@@ -116,7 +118,7 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct | |||
116 | int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); | 118 | int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); |
117 | unsigned long task_vsize(struct mm_struct *); | 119 | unsigned long task_vsize(struct mm_struct *); |
118 | int task_statm(struct mm_struct *, int *, int *, int *, int *); | 120 | int task_statm(struct mm_struct *, int *, int *, int *, int *); |
119 | char *task_mem(struct mm_struct *, char *); | 121 | void task_mem(struct seq_file *, struct mm_struct *); |
120 | void clear_refs_smap(struct mm_struct *mm); | 122 | void clear_refs_smap(struct mm_struct *mm); |
121 | 123 | ||
122 | struct proc_dir_entry *de_get(struct proc_dir_entry *de); | 124 | struct proc_dir_entry *de_get(struct proc_dir_entry *de); |
@@ -124,6 +126,9 @@ void de_put(struct proc_dir_entry *de); | |||
124 | 126 | ||
125 | extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, | 127 | extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, |
126 | struct proc_dir_entry *parent); | 128 | struct proc_dir_entry *parent); |
129 | struct proc_dir_entry *proc_create(const char *name, mode_t mode, | ||
130 | struct proc_dir_entry *parent, | ||
131 | const struct file_operations *proc_fops); | ||
127 | extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); | 132 | extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); |
128 | 133 | ||
129 | extern struct vfsmount *proc_mnt; | 134 | extern struct vfsmount *proc_mnt; |
@@ -218,7 +223,12 @@ static inline void proc_flush_task(struct task_struct *task) | |||
218 | 223 | ||
219 | static inline struct proc_dir_entry *create_proc_entry(const char *name, | 224 | static inline struct proc_dir_entry *create_proc_entry(const char *name, |
220 | mode_t mode, struct proc_dir_entry *parent) { return NULL; } | 225 | mode_t mode, struct proc_dir_entry *parent) { return NULL; } |
221 | 226 | static inline struct proc_dir_entry *proc_create(const char *name, | |
227 | mode_t mode, struct proc_dir_entry *parent, | ||
228 | const struct file_operations *proc_fops) | ||
229 | { | ||
230 | return NULL; | ||
231 | } | ||
222 | #define remove_proc_entry(name, parent) do {} while (0) | 232 | #define remove_proc_entry(name, parent) do {} while (0) |
223 | 233 | ||
224 | static inline struct proc_dir_entry *proc_symlink(const char *name, | 234 | static inline struct proc_dir_entry *proc_symlink(const char *name, |
@@ -261,6 +271,9 @@ extern void kclist_add(struct kcore_list *, void *, size_t); | |||
261 | union proc_op { | 271 | union proc_op { |
262 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); | 272 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); |
263 | int (*proc_read)(struct task_struct *task, char *page); | 273 | int (*proc_read)(struct task_struct *task, char *page); |
274 | int (*proc_show)(struct seq_file *m, | ||
275 | struct pid_namespace *ns, struct pid *pid, | ||
276 | struct task_struct *task); | ||
264 | }; | 277 | }; |
265 | 278 | ||
266 | struct proc_inode { | 279 | struct proc_inode { |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 515bff053de8..ebe0c17039cf 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -67,7 +67,6 @@ | |||
67 | #define PT_TRACE_EXEC 0x00000080 | 67 | #define PT_TRACE_EXEC 0x00000080 |
68 | #define PT_TRACE_VFORK_DONE 0x00000100 | 68 | #define PT_TRACE_VFORK_DONE 0x00000100 |
69 | #define PT_TRACE_EXIT 0x00000200 | 69 | #define PT_TRACE_EXIT 0x00000200 |
70 | #define PT_ATTACHED 0x00000400 /* parent != real_parent */ | ||
71 | 70 | ||
72 | #define PT_TRACE_MASK 0x000003f4 | 71 | #define PT_TRACE_MASK 0x000003f4 |
73 | 72 | ||
@@ -204,6 +203,41 @@ static inline void user_enable_block_step(struct task_struct *task) | |||
204 | } | 203 | } |
205 | #endif /* arch_has_block_step */ | 204 | #endif /* arch_has_block_step */ |
206 | 205 | ||
206 | #ifndef arch_ptrace_stop_needed | ||
207 | /** | ||
208 | * arch_ptrace_stop_needed - Decide whether arch_ptrace_stop() should be called | ||
209 | * @code: current->exit_code value ptrace will stop with | ||
210 | * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with | ||
211 | * | ||
212 | * This is called with the siglock held, to decide whether or not it's | ||
213 | * necessary to release the siglock and call arch_ptrace_stop() with the | ||
214 | * same @code and @info arguments. It can be defined to a constant if | ||
215 | * arch_ptrace_stop() is never required, or always is. On machines where | ||
216 | * this makes sense, it should be defined to a quick test to optimize out | ||
217 | * calling arch_ptrace_stop() when it would be superfluous. For example, | ||
218 | * if the thread has not been back to user mode since the last stop, the | ||
219 | * thread state might indicate that nothing needs to be done. | ||
220 | */ | ||
221 | #define arch_ptrace_stop_needed(code, info) (0) | ||
222 | #endif | ||
223 | |||
224 | #ifndef arch_ptrace_stop | ||
225 | /** | ||
226 | * arch_ptrace_stop - Do machine-specific work before stopping for ptrace | ||
227 | * @code: current->exit_code value ptrace will stop with | ||
228 | * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with | ||
229 | * | ||
230 | * This is called with no locks held when arch_ptrace_stop_needed() has | ||
231 | * just returned nonzero. It is allowed to block, e.g. for user memory | ||
232 | * access. The arch can have machine-specific work to be done before | ||
233 | * ptrace stops. On ia64, register backing store gets written back to user | ||
234 | * memory here. Since this can be costly (requires dropping the siglock), | ||
235 | * we only do it when the arch requires it for this particular stop, as | ||
236 | * indicated by arch_ptrace_stop_needed(). | ||
237 | */ | ||
238 | #define arch_ptrace_stop(code, info) do { } while (0) | ||
239 | #endif | ||
240 | |||
207 | #endif | 241 | #endif |
208 | 242 | ||
209 | #endif | 243 | #endif |
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h index 19bc9b8b6191..34a196ee7941 100644 --- a/include/linux/qnx4_fs.h +++ b/include/linux/qnx4_fs.h | |||
@@ -110,6 +110,7 @@ struct qnx4_inode_info { | |||
110 | struct inode vfs_inode; | 110 | struct inode vfs_inode; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | extern struct inode *qnx4_iget(struct super_block *, unsigned long); | ||
113 | extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd); | 114 | extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd); |
114 | extern unsigned long qnx4_count_free_blocks(struct super_block *sb); | 115 | extern unsigned long qnx4_count_free_blocks(struct super_block *sb); |
115 | extern unsigned long qnx4_block_map(struct inode *inode, long iblock); | 116 | extern unsigned long qnx4_block_map(struct inode *inode, long iblock); |
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 306a1d1a5af0..e51b531cd0b2 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -244,6 +244,8 @@ struct bitmap { | |||
244 | */ | 244 | */ |
245 | unsigned long daemon_lastrun; /* jiffies of last run */ | 245 | unsigned long daemon_lastrun; /* jiffies of last run */ |
246 | unsigned long daemon_sleep; /* how many seconds between updates? */ | 246 | unsigned long daemon_sleep; /* how many seconds between updates? */ |
247 | unsigned long last_end_sync; /* when we lasted called end_sync to | ||
248 | * update bitmap with resync progress */ | ||
247 | 249 | ||
248 | atomic_t pending_writes; /* pending writes to the bitmap file */ | 250 | atomic_t pending_writes; /* pending writes to the bitmap file */ |
249 | wait_queue_head_t write_wait; | 251 | wait_queue_head_t write_wait; |
@@ -275,6 +277,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, | |||
275 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); | 277 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); |
276 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); | 278 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); |
277 | void bitmap_close_sync(struct bitmap *bitmap); | 279 | void bitmap_close_sync(struct bitmap *bitmap); |
280 | void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector); | ||
278 | 281 | ||
279 | void bitmap_unplug(struct bitmap *bitmap); | 282 | void bitmap_unplug(struct bitmap *bitmap); |
280 | void bitmap_daemon_work(struct bitmap *bitmap); | 283 | void bitmap_daemon_work(struct bitmap *bitmap); |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index dcb729244f47..85a068bab625 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -81,6 +81,8 @@ struct mdk_rdev_s | |||
81 | #define In_sync 2 /* device is in_sync with rest of array */ | 81 | #define In_sync 2 /* device is in_sync with rest of array */ |
82 | #define WriteMostly 4 /* Avoid reading if at all possible */ | 82 | #define WriteMostly 4 /* Avoid reading if at all possible */ |
83 | #define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */ | 83 | #define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */ |
84 | #define AllReserved 6 /* If whole device is reserved for | ||
85 | * one array */ | ||
84 | 86 | ||
85 | int desc_nr; /* descriptor index in the superblock */ | 87 | int desc_nr; /* descriptor index in the superblock */ |
86 | int raid_disk; /* role of device in array */ | 88 | int raid_disk; /* role of device in array */ |
@@ -130,6 +132,9 @@ struct mddev_s | |||
130 | minor_version, | 132 | minor_version, |
131 | patch_version; | 133 | patch_version; |
132 | int persistent; | 134 | int persistent; |
135 | int external; /* metadata is | ||
136 | * managed externally */ | ||
137 | char metadata_type[17]; /* externally set*/ | ||
133 | int chunk_size; | 138 | int chunk_size; |
134 | time_t ctime, utime; | 139 | time_t ctime, utime; |
135 | int level, layout; | 140 | int level, layout; |
@@ -216,6 +221,8 @@ struct mddev_s | |||
216 | atomic_t recovery_active; /* blocks scheduled, but not written */ | 221 | atomic_t recovery_active; /* blocks scheduled, but not written */ |
217 | wait_queue_head_t recovery_wait; | 222 | wait_queue_head_t recovery_wait; |
218 | sector_t recovery_cp; | 223 | sector_t recovery_cp; |
224 | sector_t resync_max; /* resync should pause | ||
225 | * when it gets here */ | ||
219 | 226 | ||
220 | spinlock_t write_lock; | 227 | spinlock_t write_lock; |
221 | wait_queue_head_t sb_wait; /* for waiting on superblock updates */ | 228 | wait_queue_head_t sb_wait; /* for waiting on superblock updates */ |
@@ -306,23 +313,17 @@ static inline char * mdname (mddev_t * mddev) | |||
306 | * iterates through some rdev ringlist. It's safe to remove the | 313 | * iterates through some rdev ringlist. It's safe to remove the |
307 | * current 'rdev'. Dont touch 'tmp' though. | 314 | * current 'rdev'. Dont touch 'tmp' though. |
308 | */ | 315 | */ |
309 | #define ITERATE_RDEV_GENERIC(head,rdev,tmp) \ | 316 | #define rdev_for_each_list(rdev, tmp, list) \ |
310 | \ | 317 | \ |
311 | for ((tmp) = (head).next; \ | 318 | for ((tmp) = (list).next; \ |
312 | (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ | 319 | (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ |
313 | (tmp) = (tmp)->next, (tmp)->prev != &(head) \ | 320 | (tmp) = (tmp)->next, (tmp)->prev != &(list) \ |
314 | ; ) | 321 | ; ) |
315 | /* | 322 | /* |
316 | * iterates through the 'same array disks' ringlist | 323 | * iterates through the 'same array disks' ringlist |
317 | */ | 324 | */ |
318 | #define ITERATE_RDEV(mddev,rdev,tmp) \ | 325 | #define rdev_for_each(rdev, tmp, mddev) \ |
319 | ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp) | 326 | rdev_for_each_list(rdev, tmp, (mddev)->disks) |
320 | |||
321 | /* | ||
322 | * Iterates through 'pending RAID disks' | ||
323 | */ | ||
324 | #define ITERATE_RDEV_PENDING(rdev,tmp) \ | ||
325 | ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp) | ||
326 | 327 | ||
327 | typedef struct mdk_thread_s { | 328 | typedef struct mdk_thread_s { |
328 | void (*run) (mddev_t *mddev); | 329 | void (*run) (mddev_t *mddev); |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index d32c14de270e..37a642c54871 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -174,10 +174,13 @@ struct rcu_head { | |||
174 | * code. | 174 | * code. |
175 | */ | 175 | */ |
176 | 176 | ||
177 | #define rcu_assign_pointer(p, v) ({ \ | 177 | #define rcu_assign_pointer(p, v) \ |
178 | smp_wmb(); \ | 178 | ({ \ |
179 | (p) = (v); \ | 179 | if (!__builtin_constant_p(v) || \ |
180 | }) | 180 | ((v) != NULL)) \ |
181 | smp_wmb(); \ | ||
182 | (p) = (v); \ | ||
183 | }) | ||
181 | 184 | ||
182 | /** | 185 | /** |
183 | * synchronize_sched - block until all CPUs have exited any non-preemptive | 186 | * synchronize_sched - block until all CPUs have exited any non-preemptive |
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h index ece8eb3e4151..60c2a033b19e 100644 --- a/include/linux/rcupreempt.h +++ b/include/linux/rcupreempt.h | |||
@@ -46,8 +46,8 @@ | |||
46 | #define rcu_bh_qsctr_inc(cpu) | 46 | #define rcu_bh_qsctr_inc(cpu) |
47 | #define call_rcu_bh(head, rcu) call_rcu(head, rcu) | 47 | #define call_rcu_bh(head, rcu) call_rcu(head, rcu) |
48 | 48 | ||
49 | extern void __rcu_read_lock(void); | 49 | extern void __rcu_read_lock(void) __acquires(RCU); |
50 | extern void __rcu_read_unlock(void); | 50 | extern void __rcu_read_unlock(void) __releases(RCU); |
51 | extern int rcu_pending(int cpu); | 51 | extern int rcu_pending(int cpu); |
52 | extern int rcu_needs_cpu(int cpu); | 52 | extern int rcu_needs_cpu(int cpu); |
53 | 53 | ||
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 85ea63f462af..b93b541cf111 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -59,8 +59,6 @@ extern void machine_crash_shutdown(struct pt_regs *); | |||
59 | * Architecture independent implemenations of sys_reboot commands. | 59 | * Architecture independent implemenations of sys_reboot commands. |
60 | */ | 60 | */ |
61 | 61 | ||
62 | extern void kernel_shutdown_prepare(enum system_states state); | ||
63 | |||
64 | extern void kernel_restart(char *cmd); | 62 | extern void kernel_restart(char *cmd); |
65 | extern void kernel_halt(void); | 63 | extern void kernel_halt(void); |
66 | extern void kernel_power_off(void); | 64 | extern void kernel_power_off(void); |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 422eab4958a6..8e7eff2cd0ab 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -287,7 +287,7 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb) | |||
287 | 287 | ||
288 | /* Don't trust REISERFS_SB(sb)->s_bmap_nr, it's a u16 | 288 | /* Don't trust REISERFS_SB(sb)->s_bmap_nr, it's a u16 |
289 | * which overflows on large file systems. */ | 289 | * which overflows on large file systems. */ |
290 | static inline u32 reiserfs_bmap_count(struct super_block *sb) | 290 | static inline __u32 reiserfs_bmap_count(struct super_block *sb) |
291 | { | 291 | { |
292 | return (SB_BLOCK_COUNT(sb) - 1) / (sb->s_blocksize * 8) + 1; | 292 | return (SB_BLOCK_COUNT(sb) - 1) / (sb->s_blocksize * 8) + 1; |
293 | } | 293 | } |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h new file mode 100644 index 000000000000..61363ce896d5 --- /dev/null +++ b/include/linux/res_counter.h | |||
@@ -0,0 +1,127 @@ | |||
1 | #ifndef __RES_COUNTER_H__ | ||
2 | #define __RES_COUNTER_H__ | ||
3 | |||
4 | /* | ||
5 | * Resource Counters | ||
6 | * Contain common data types and routines for resource accounting | ||
7 | * | ||
8 | * Copyright 2007 OpenVZ SWsoft Inc | ||
9 | * | ||
10 | * Author: Pavel Emelianov <xemul@openvz.org> | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/cgroup.h> | ||
15 | |||
16 | /* | ||
17 | * The core object. the cgroup that wishes to account for some | ||
18 | * resource may include this counter into its structures and use | ||
19 | * the helpers described beyond | ||
20 | */ | ||
21 | |||
22 | struct res_counter { | ||
23 | /* | ||
24 | * the current resource consumption level | ||
25 | */ | ||
26 | unsigned long long usage; | ||
27 | /* | ||
28 | * the limit that usage cannot exceed | ||
29 | */ | ||
30 | unsigned long long limit; | ||
31 | /* | ||
32 | * the number of unsuccessful attempts to consume the resource | ||
33 | */ | ||
34 | unsigned long long failcnt; | ||
35 | /* | ||
36 | * the lock to protect all of the above. | ||
37 | * the routines below consider this to be IRQ-safe | ||
38 | */ | ||
39 | spinlock_t lock; | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * Helpers to interact with userspace | ||
44 | * res_counter_read/_write - put/get the specified fields from the | ||
45 | * res_counter struct to/from the user | ||
46 | * | ||
47 | * @counter: the counter in question | ||
48 | * @member: the field to work with (see RES_xxx below) | ||
49 | * @buf: the buffer to opeate on,... | ||
50 | * @nbytes: its size... | ||
51 | * @pos: and the offset. | ||
52 | */ | ||
53 | |||
54 | ssize_t res_counter_read(struct res_counter *counter, int member, | ||
55 | const char __user *buf, size_t nbytes, loff_t *pos, | ||
56 | int (*read_strategy)(unsigned long long val, char *s)); | ||
57 | ssize_t res_counter_write(struct res_counter *counter, int member, | ||
58 | const char __user *buf, size_t nbytes, loff_t *pos, | ||
59 | int (*write_strategy)(char *buf, unsigned long long *val)); | ||
60 | |||
61 | /* | ||
62 | * the field descriptors. one for each member of res_counter | ||
63 | */ | ||
64 | |||
65 | enum { | ||
66 | RES_USAGE, | ||
67 | RES_LIMIT, | ||
68 | RES_FAILCNT, | ||
69 | }; | ||
70 | |||
71 | /* | ||
72 | * helpers for accounting | ||
73 | */ | ||
74 | |||
75 | void res_counter_init(struct res_counter *counter); | ||
76 | |||
77 | /* | ||
78 | * charge - try to consume more resource. | ||
79 | * | ||
80 | * @counter: the counter | ||
81 | * @val: the amount of the resource. each controller defines its own | ||
82 | * units, e.g. numbers, bytes, Kbytes, etc | ||
83 | * | ||
84 | * returns 0 on success and <0 if the counter->usage will exceed the | ||
85 | * counter->limit _locked call expects the counter->lock to be taken | ||
86 | */ | ||
87 | |||
88 | int res_counter_charge_locked(struct res_counter *counter, unsigned long val); | ||
89 | int res_counter_charge(struct res_counter *counter, unsigned long val); | ||
90 | |||
91 | /* | ||
92 | * uncharge - tell that some portion of the resource is released | ||
93 | * | ||
94 | * @counter: the counter | ||
95 | * @val: the amount of the resource | ||
96 | * | ||
97 | * these calls check for usage underflow and show a warning on the console | ||
98 | * _locked call expects the counter->lock to be taken | ||
99 | */ | ||
100 | |||
101 | void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val); | ||
102 | void res_counter_uncharge(struct res_counter *counter, unsigned long val); | ||
103 | |||
104 | static inline bool res_counter_limit_check_locked(struct res_counter *cnt) | ||
105 | { | ||
106 | if (cnt->usage < cnt->limit) | ||
107 | return true; | ||
108 | |||
109 | return false; | ||
110 | } | ||
111 | |||
112 | /* | ||
113 | * Helper function to detect if the cgroup is within it's limit or | ||
114 | * not. It's currently called from cgroup_rss_prepare() | ||
115 | */ | ||
116 | static inline bool res_counter_check_under_limit(struct res_counter *cnt) | ||
117 | { | ||
118 | bool ret; | ||
119 | unsigned long flags; | ||
120 | |||
121 | spin_lock_irqsave(&cnt->lock, flags); | ||
122 | ret = res_counter_limit_check_locked(cnt); | ||
123 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
124 | return ret; | ||
125 | } | ||
126 | |||
127 | #endif | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 97347f22fc20..1383692ac5bd 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include <linux/spinlock.h> | 10 | #include <linux/spinlock.h> |
11 | #include <linux/memcontrol.h> | ||
11 | 12 | ||
12 | /* | 13 | /* |
13 | * The anon_vma heads a list of private "related" vmas, to scan if | 14 | * The anon_vma heads a list of private "related" vmas, to scan if |
@@ -86,7 +87,7 @@ static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma, | |||
86 | /* | 87 | /* |
87 | * Called from mm/vmscan.c to handle paging out | 88 | * Called from mm/vmscan.c to handle paging out |
88 | */ | 89 | */ |
89 | int page_referenced(struct page *, int is_locked); | 90 | int page_referenced(struct page *, int is_locked, struct mem_cgroup *cnt); |
90 | int try_to_unmap(struct page *, int ignore_refs); | 91 | int try_to_unmap(struct page *, int ignore_refs); |
91 | 92 | ||
92 | /* | 93 | /* |
@@ -114,7 +115,7 @@ int page_mkclean(struct page *); | |||
114 | #define anon_vma_prepare(vma) (0) | 115 | #define anon_vma_prepare(vma) (0) |
115 | #define anon_vma_link(vma) do {} while (0) | 116 | #define anon_vma_link(vma) do {} while (0) |
116 | 117 | ||
117 | #define page_referenced(page,l) TestClearPageReferenced(page) | 118 | #define page_referenced(page,l,cnt) TestClearPageReferenced(page) |
118 | #define try_to_unmap(page, refs) SWAP_FAIL | 119 | #define try_to_unmap(page, refs) SWAP_FAIL |
119 | 120 | ||
120 | static inline int page_mkclean(struct page *page) | 121 | static inline int page_mkclean(struct page *page) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index af6947e69b40..00e144117326 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -92,6 +92,7 @@ struct sched_param { | |||
92 | 92 | ||
93 | #include <asm/processor.h> | 93 | #include <asm/processor.h> |
94 | 94 | ||
95 | struct mem_cgroup; | ||
95 | struct exec_domain; | 96 | struct exec_domain; |
96 | struct futex_pi_state; | 97 | struct futex_pi_state; |
97 | struct robust_list_head; | 98 | struct robust_list_head; |
@@ -459,7 +460,7 @@ struct signal_struct { | |||
459 | 460 | ||
460 | /* ITIMER_REAL timer for the process */ | 461 | /* ITIMER_REAL timer for the process */ |
461 | struct hrtimer real_timer; | 462 | struct hrtimer real_timer; |
462 | struct task_struct *tsk; | 463 | struct pid *leader_pid; |
463 | ktime_t it_real_incr; | 464 | ktime_t it_real_incr; |
464 | 465 | ||
465 | /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ | 466 | /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ |
@@ -555,6 +556,13 @@ struct signal_struct { | |||
555 | #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ | 556 | #define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ |
556 | #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ | 557 | #define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ |
557 | 558 | ||
559 | /* If true, all threads except ->group_exit_task have pending SIGKILL */ | ||
560 | static inline int signal_group_exit(const struct signal_struct *sig) | ||
561 | { | ||
562 | return (sig->flags & SIGNAL_GROUP_EXIT) || | ||
563 | (sig->group_exit_task != NULL); | ||
564 | } | ||
565 | |||
558 | /* | 566 | /* |
559 | * Some day this will be a full-fledged user tracking system.. | 567 | * Some day this will be a full-fledged user tracking system.. |
560 | */ | 568 | */ |
@@ -803,7 +811,7 @@ static inline int above_background_load(void) | |||
803 | 811 | ||
804 | struct io_context; /* See blkdev.h */ | 812 | struct io_context; /* See blkdev.h */ |
805 | #define NGROUPS_SMALL 32 | 813 | #define NGROUPS_SMALL 32 |
806 | #define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t))) | 814 | #define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t))) |
807 | struct group_info { | 815 | struct group_info { |
808 | int ngroups; | 816 | int ngroups; |
809 | atomic_t usage; | 817 | atomic_t usage; |
@@ -1091,7 +1099,7 @@ struct task_struct { | |||
1091 | uid_t uid,euid,suid,fsuid; | 1099 | uid_t uid,euid,suid,fsuid; |
1092 | gid_t gid,egid,sgid,fsgid; | 1100 | gid_t gid,egid,sgid,fsgid; |
1093 | struct group_info *group_info; | 1101 | struct group_info *group_info; |
1094 | kernel_cap_t cap_effective, cap_inheritable, cap_permitted; | 1102 | kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset; |
1095 | unsigned keep_capabilities:1; | 1103 | unsigned keep_capabilities:1; |
1096 | struct user_struct *user; | 1104 | struct user_struct *user; |
1097 | #ifdef CONFIG_KEYS | 1105 | #ifdef CONFIG_KEYS |
@@ -1324,9 +1332,8 @@ struct pid_namespace; | |||
1324 | * from various namespaces | 1332 | * from various namespaces |
1325 | * | 1333 | * |
1326 | * task_xid_nr() : global id, i.e. the id seen from the init namespace; | 1334 | * task_xid_nr() : global id, i.e. the id seen from the init namespace; |
1327 | * task_xid_vnr() : virtual id, i.e. the id seen from the namespace the task | 1335 | * task_xid_vnr() : virtual id, i.e. the id seen from the pid namespace of |
1328 | * belongs to. this only makes sence when called in the | 1336 | * current. |
1329 | * context of the task that belongs to the same namespace; | ||
1330 | * task_xid_nr_ns() : id seen from the ns specified; | 1337 | * task_xid_nr_ns() : id seen from the ns specified; |
1331 | * | 1338 | * |
1332 | * set_task_vxid() : assigns a virtual id to a task; | 1339 | * set_task_vxid() : assigns a virtual id to a task; |
@@ -1624,7 +1631,7 @@ extern struct task_struct *find_task_by_vpid(pid_t nr); | |||
1624 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, | 1631 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, |
1625 | struct pid_namespace *ns); | 1632 | struct pid_namespace *ns); |
1626 | 1633 | ||
1627 | extern void __set_special_pids(pid_t session, pid_t pgrp); | 1634 | extern void __set_special_pids(struct pid *pid); |
1628 | 1635 | ||
1629 | /* per-UID process charging. */ | 1636 | /* per-UID process charging. */ |
1630 | extern struct user_struct * alloc_uid(struct user_namespace *, uid_t); | 1637 | extern struct user_struct * alloc_uid(struct user_namespace *, uid_t); |
@@ -1679,11 +1686,9 @@ extern void block_all_signals(int (*notifier)(void *priv), void *priv, | |||
1679 | extern void unblock_all_signals(void); | 1686 | extern void unblock_all_signals(void); |
1680 | extern void release_task(struct task_struct * p); | 1687 | extern void release_task(struct task_struct * p); |
1681 | extern int send_sig_info(int, struct siginfo *, struct task_struct *); | 1688 | extern int send_sig_info(int, struct siginfo *, struct task_struct *); |
1682 | extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); | ||
1683 | extern int force_sigsegv(int, struct task_struct *); | 1689 | extern int force_sigsegv(int, struct task_struct *); |
1684 | extern int force_sig_info(int, struct siginfo *, struct task_struct *); | 1690 | extern int force_sig_info(int, struct siginfo *, struct task_struct *); |
1685 | extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | 1691 | extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); |
1686 | extern int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | ||
1687 | extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); | 1692 | extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); |
1688 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); | 1693 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); |
1689 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | 1694 | extern int kill_pgrp(struct pid *pid, int sig, int priv); |
@@ -1770,7 +1775,7 @@ extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned lon | |||
1770 | struct task_struct *fork_idle(int); | 1775 | struct task_struct *fork_idle(int); |
1771 | 1776 | ||
1772 | extern void set_task_comm(struct task_struct *tsk, char *from); | 1777 | extern void set_task_comm(struct task_struct *tsk, char *from); |
1773 | extern void get_task_comm(char *to, struct task_struct *tsk); | 1778 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
1774 | 1779 | ||
1775 | #ifdef CONFIG_SMP | 1780 | #ifdef CONFIG_SMP |
1776 | extern void wait_task_inactive(struct task_struct * p); | 1781 | extern void wait_task_inactive(struct task_struct * p); |
@@ -2080,6 +2085,10 @@ static inline void migration_init(void) | |||
2080 | } | 2085 | } |
2081 | #endif | 2086 | #endif |
2082 | 2087 | ||
2088 | #ifndef TASK_SIZE_OF | ||
2089 | #define TASK_SIZE_OF(tsk) TASK_SIZE | ||
2090 | #endif | ||
2091 | |||
2083 | #endif /* __KERNEL__ */ | 2092 | #endif /* __KERNEL__ */ |
2084 | 2093 | ||
2085 | #endif | 2094 | #endif |
diff --git a/include/linux/security.h b/include/linux/security.h index d24974262dc6..fe52cdeab0a6 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -40,11 +40,6 @@ | |||
40 | #define ROOTCONTEXT_MNT 0x04 | 40 | #define ROOTCONTEXT_MNT 0x04 |
41 | #define DEFCONTEXT_MNT 0x08 | 41 | #define DEFCONTEXT_MNT 0x08 |
42 | 42 | ||
43 | /* | ||
44 | * Bounding set | ||
45 | */ | ||
46 | extern kernel_cap_t cap_bset; | ||
47 | |||
48 | extern unsigned securebits; | 43 | extern unsigned securebits; |
49 | 44 | ||
50 | struct ctl_table; | 45 | struct ctl_table; |
@@ -423,15 +418,12 @@ struct request_sock; | |||
423 | * identified by @name for @dentry. | 418 | * identified by @name for @dentry. |
424 | * Return 0 if permission is granted. | 419 | * Return 0 if permission is granted. |
425 | * @inode_getsecurity: | 420 | * @inode_getsecurity: |
426 | * Copy the extended attribute representation of the security label | 421 | * Retrieve a copy of the extended attribute representation of the |
427 | * associated with @name for @inode into @buffer. @buffer may be | 422 | * security label associated with @name for @inode via @buffer. Note that |
428 | * NULL to request the size of the buffer required. @size indicates | 423 | * @name is the remainder of the attribute name after the security prefix |
429 | * the size of @buffer in bytes. Note that @name is the remainder | 424 | * has been removed. @alloc is used to specify of the call should return a |
430 | * of the attribute name after the security. prefix has been removed. | 425 | * value via the buffer or just the value length Return size of buffer on |
431 | * @err is the return value from the preceding fs getxattr call, | 426 | * success. |
432 | * and can be used by the security module to determine whether it | ||
433 | * should try and canonicalize the attribute value. | ||
434 | * Return number of bytes used/required on success. | ||
435 | * @inode_setsecurity: | 427 | * @inode_setsecurity: |
436 | * Set the security label associated with @name for @inode from the | 428 | * Set the security label associated with @name for @inode from the |
437 | * extended attribute value @value. @size indicates the size of the | 429 | * extended attribute value @value. @size indicates the size of the |
@@ -1304,7 +1296,7 @@ struct security_operations { | |||
1304 | int (*inode_removexattr) (struct dentry *dentry, char *name); | 1296 | int (*inode_removexattr) (struct dentry *dentry, char *name); |
1305 | int (*inode_need_killpriv) (struct dentry *dentry); | 1297 | int (*inode_need_killpriv) (struct dentry *dentry); |
1306 | int (*inode_killpriv) (struct dentry *dentry); | 1298 | int (*inode_killpriv) (struct dentry *dentry); |
1307 | int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err); | 1299 | int (*inode_getsecurity)(const struct inode *inode, const char *name, void **buffer, bool alloc); |
1308 | int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); | 1300 | int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); |
1309 | int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); | 1301 | int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); |
1310 | 1302 | ||
@@ -1565,7 +1557,7 @@ int security_inode_listxattr(struct dentry *dentry); | |||
1565 | int security_inode_removexattr(struct dentry *dentry, char *name); | 1557 | int security_inode_removexattr(struct dentry *dentry, char *name); |
1566 | int security_inode_need_killpriv(struct dentry *dentry); | 1558 | int security_inode_need_killpriv(struct dentry *dentry); |
1567 | int security_inode_killpriv(struct dentry *dentry); | 1559 | int security_inode_killpriv(struct dentry *dentry); |
1568 | int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err); | 1560 | int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc); |
1569 | int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags); | 1561 | int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags); |
1570 | int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size); | 1562 | int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size); |
1571 | int security_file_permission(struct file *file, int mask); | 1563 | int security_file_permission(struct file *file, int mask); |
@@ -1967,7 +1959,7 @@ static inline int security_inode_killpriv(struct dentry *dentry) | |||
1967 | return cap_inode_killpriv(dentry); | 1959 | return cap_inode_killpriv(dentry); |
1968 | } | 1960 | } |
1969 | 1961 | ||
1970 | static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) | 1962 | static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc) |
1971 | { | 1963 | { |
1972 | return -EOPNOTSUPP; | 1964 | return -EOPNOTSUPP; |
1973 | } | 1965 | } |
diff --git a/include/linux/serial167.h b/include/linux/serial167.h index 71b6df2516a6..59c81b708562 100644 --- a/include/linux/serial167.h +++ b/include/linux/serial167.h | |||
@@ -37,7 +37,6 @@ struct cyclades_port { | |||
37 | int ignore_status_mask; | 37 | int ignore_status_mask; |
38 | int close_delay; | 38 | int close_delay; |
39 | int IER; /* Interrupt Enable Register */ | 39 | int IER; /* Interrupt Enable Register */ |
40 | unsigned long event; | ||
41 | unsigned long last_active; | 40 | unsigned long last_active; |
42 | int count; /* # of fd on device */ | 41 | int count; /* # of fd on device */ |
43 | int x_char; /* to be pushed out ASAP */ | 42 | int x_char; /* to be pushed out ASAP */ |
@@ -49,7 +48,6 @@ struct cyclades_port { | |||
49 | int xmit_cnt; | 48 | int xmit_cnt; |
50 | int default_threshold; | 49 | int default_threshold; |
51 | int default_timeout; | 50 | int default_timeout; |
52 | struct work_struct tqueue; | ||
53 | wait_queue_head_t open_wait; | 51 | wait_queue_head_t open_wait; |
54 | wait_queue_head_t close_wait; | 52 | wait_queue_head_t close_wait; |
55 | struct cyclades_monitor mon; | 53 | struct cyclades_monitor mon; |
@@ -67,18 +65,6 @@ struct cyclades_port { | |||
67 | #define CYGETDEFTIMEOUT 0x435908 | 65 | #define CYGETDEFTIMEOUT 0x435908 |
68 | #define CYSETDEFTIMEOUT 0x435909 | 66 | #define CYSETDEFTIMEOUT 0x435909 |
69 | 67 | ||
70 | /* | ||
71 | * Events are used to schedule things to happen at timer-interrupt | ||
72 | * time, instead of at cy interrupt time. | ||
73 | */ | ||
74 | #define Cy_EVENT_READ_PROCESS 0 | ||
75 | #define Cy_EVENT_WRITE_WAKEUP 1 | ||
76 | #define Cy_EVENT_HANGUP 2 | ||
77 | #define Cy_EVENT_BREAK 3 | ||
78 | #define Cy_EVENT_OPEN_WAKEUP 4 | ||
79 | |||
80 | |||
81 | |||
82 | #define CyMaxChipsPerCard 1 | 68 | #define CyMaxChipsPerCard 1 |
83 | 69 | ||
84 | /**** cd2401 registers ****/ | 70 | /**** cd2401 registers ****/ |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index afe0f6d9b9bc..00b65c0a82ca 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -23,6 +23,7 @@ struct plat_serial8250_port { | |||
23 | resource_size_t mapbase; /* resource base */ | 23 | resource_size_t mapbase; /* resource base */ |
24 | unsigned int irq; /* interrupt number */ | 24 | unsigned int irq; /* interrupt number */ |
25 | unsigned int uartclk; /* UART clock rate */ | 25 | unsigned int uartclk; /* UART clock rate */ |
26 | void *private_data; | ||
26 | unsigned char regshift; /* register shift */ | 27 | unsigned char regshift; /* register shift */ |
27 | unsigned char iotype; /* UPIO_* */ | 28 | unsigned char iotype; /* UPIO_* */ |
28 | unsigned char hub6; | 29 | unsigned char hub6; |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 9963f81fea9a..1a0b6cf83ff1 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -150,6 +150,10 @@ | |||
150 | #define PORT_MCF 78 | 150 | #define PORT_MCF 78 |
151 | 151 | ||
152 | 152 | ||
153 | /* MN10300 on-chip UART numbers */ | ||
154 | #define PORT_MN10300 80 | ||
155 | #define PORT_MN10300_CTS 81 | ||
156 | |||
153 | #ifdef __KERNEL__ | 157 | #ifdef __KERNEL__ |
154 | 158 | ||
155 | #include <linux/compiler.h> | 159 | #include <linux/compiler.h> |
diff --git a/include/linux/shm.h b/include/linux/shm.h index eeaed921a1dc..eca6235a46c0 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -3,7 +3,11 @@ | |||
3 | 3 | ||
4 | #include <linux/ipc.h> | 4 | #include <linux/ipc.h> |
5 | #include <linux/errno.h> | 5 | #include <linux/errno.h> |
6 | #ifdef __KERNEL__ | ||
6 | #include <asm/page.h> | 7 | #include <asm/page.h> |
8 | #else | ||
9 | #include <unistd.h> | ||
10 | #endif | ||
7 | 11 | ||
8 | /* | 12 | /* |
9 | * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can | 13 | * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can |
@@ -13,7 +17,11 @@ | |||
13 | #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ | 17 | #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ |
14 | #define SHMMIN 1 /* min shared seg size (bytes) */ | 18 | #define SHMMIN 1 /* min shared seg size (bytes) */ |
15 | #define SHMMNI 4096 /* max num of segs system wide */ | 19 | #define SHMMNI 4096 /* max num of segs system wide */ |
20 | #ifdef __KERNEL__ | ||
16 | #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ | 21 | #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ |
22 | #else | ||
23 | #define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16)) | ||
24 | #endif | ||
17 | #define SHMSEG SHMMNI /* max shared segs per process */ | 25 | #define SHMSEG SHMMNI /* max shared segs per process */ |
18 | 26 | ||
19 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index f3c51899117f..8d5fb36ea047 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -30,9 +30,12 @@ struct shmem_sb_info { | |||
30 | unsigned long free_blocks; /* How many are left for allocation */ | 30 | unsigned long free_blocks; /* How many are left for allocation */ |
31 | unsigned long max_inodes; /* How many inodes are allowed */ | 31 | unsigned long max_inodes; /* How many inodes are allowed */ |
32 | unsigned long free_inodes; /* How many are left for allocation */ | 32 | unsigned long free_inodes; /* How many are left for allocation */ |
33 | spinlock_t stat_lock; /* Serialize shmem_sb_info changes */ | ||
34 | uid_t uid; /* Mount uid for root directory */ | ||
35 | gid_t gid; /* Mount gid for root directory */ | ||
36 | mode_t mode; /* Mount mode for root directory */ | ||
33 | int policy; /* Default NUMA memory alloc policy */ | 37 | int policy; /* Default NUMA memory alloc policy */ |
34 | nodemask_t policy_nodes; /* nodemask for preferred and bind */ | 38 | nodemask_t policy_nodes; /* nodemask for preferred and bind */ |
35 | spinlock_t stat_lock; | ||
36 | }; | 39 | }; |
37 | 40 | ||
38 | static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | 41 | static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) |
diff --git a/include/linux/signal.h b/include/linux/signal.h index 0ae338866240..42d2e0a948f4 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -241,6 +241,7 @@ extern int show_unhandled_signals; | |||
241 | 241 | ||
242 | struct pt_regs; | 242 | struct pt_regs; |
243 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 243 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); |
244 | extern void exit_signals(struct task_struct *tsk); | ||
244 | 245 | ||
245 | extern struct kmem_cache *sighand_cachep; | 246 | extern struct kmem_cache *sighand_cachep; |
246 | 247 | ||
@@ -371,6 +372,8 @@ int unhandled_signal(struct task_struct *tsk, int sig); | |||
371 | (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \ | 372 | (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \ |
372 | (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL) | 373 | (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL) |
373 | 374 | ||
375 | void signals_init(void); | ||
376 | |||
374 | #endif /* __KERNEL__ */ | 377 | #endif /* __KERNEL__ */ |
375 | 378 | ||
376 | #endif /* _LINUX_SIGNAL_H */ | 379 | #endif /* _LINUX_SIGNAL_H */ |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index ddb1a706b144..5e6d3d634d5b 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -11,12 +11,35 @@ | |||
11 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
12 | #include <linux/kobject.h> | 12 | #include <linux/kobject.h> |
13 | 13 | ||
14 | enum stat_item { | ||
15 | ALLOC_FASTPATH, /* Allocation from cpu slab */ | ||
16 | ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ | ||
17 | FREE_FASTPATH, /* Free to cpu slub */ | ||
18 | FREE_SLOWPATH, /* Freeing not to cpu slab */ | ||
19 | FREE_FROZEN, /* Freeing to frozen slab */ | ||
20 | FREE_ADD_PARTIAL, /* Freeing moves slab to partial list */ | ||
21 | FREE_REMOVE_PARTIAL, /* Freeing removes last object */ | ||
22 | ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */ | ||
23 | ALLOC_SLAB, /* Cpu slab acquired from page allocator */ | ||
24 | ALLOC_REFILL, /* Refill cpu slab from slab freelist */ | ||
25 | FREE_SLAB, /* Slab freed to the page allocator */ | ||
26 | CPUSLAB_FLUSH, /* Abandoning of the cpu slab */ | ||
27 | DEACTIVATE_FULL, /* Cpu slab was full when deactivated */ | ||
28 | DEACTIVATE_EMPTY, /* Cpu slab was empty when deactivated */ | ||
29 | DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ | ||
30 | DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ | ||
31 | DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ | ||
32 | NR_SLUB_STAT_ITEMS }; | ||
33 | |||
14 | struct kmem_cache_cpu { | 34 | struct kmem_cache_cpu { |
15 | void **freelist; /* Pointer to first free per cpu object */ | 35 | void **freelist; /* Pointer to first free per cpu object */ |
16 | struct page *page; /* The slab from which we are allocating */ | 36 | struct page *page; /* The slab from which we are allocating */ |
17 | int node; /* The node of the page (or -1 for debug) */ | 37 | int node; /* The node of the page (or -1 for debug) */ |
18 | unsigned int offset; /* Freepointer offset (in word units) */ | 38 | unsigned int offset; /* Freepointer offset (in word units) */ |
19 | unsigned int objsize; /* Size of an object (from kmem_cache) */ | 39 | unsigned int objsize; /* Size of an object (from kmem_cache) */ |
40 | #ifdef CONFIG_SLUB_STATS | ||
41 | unsigned stat[NR_SLUB_STAT_ITEMS]; | ||
42 | #endif | ||
20 | }; | 43 | }; |
21 | 44 | ||
22 | struct kmem_cache_node { | 45 | struct kmem_cache_node { |
diff --git a/include/linux/sm501.h b/include/linux/sm501.h index 9e3aaad6fe4d..932a9efee8a5 100644 --- a/include/linux/sm501.h +++ b/include/linux/sm501.h | |||
@@ -70,6 +70,8 @@ extern unsigned long sm501_gpio_get(struct device *dev, | |||
70 | #define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) | 70 | #define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) |
71 | #define SM501FB_FLAG_USE_HWCURSOR (1<<2) | 71 | #define SM501FB_FLAG_USE_HWCURSOR (1<<2) |
72 | #define SM501FB_FLAG_USE_HWACCEL (1<<3) | 72 | #define SM501FB_FLAG_USE_HWACCEL (1<<3) |
73 | #define SM501FB_FLAG_PANEL_USE_FPEN (1<<4) | ||
74 | #define SM501FB_FLAG_PANEL_USE_VBIASEN (1<<5) | ||
73 | 75 | ||
74 | struct sm501_platdata_fbsub { | 76 | struct sm501_platdata_fbsub { |
75 | struct fb_videomode *def_mode; | 77 | struct fb_videomode *def_mode; |
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 40c7b5d993b9..f41ffd7c2dd9 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h | |||
@@ -101,6 +101,8 @@ | |||
101 | #define SONYPI_EVENT_FNKEY_RELEASED 59 | 101 | #define SONYPI_EVENT_FNKEY_RELEASED 59 |
102 | #define SONYPI_EVENT_WIRELESS_ON 60 | 102 | #define SONYPI_EVENT_WIRELESS_ON 60 |
103 | #define SONYPI_EVENT_WIRELESS_OFF 61 | 103 | #define SONYPI_EVENT_WIRELESS_OFF 61 |
104 | #define SONYPI_EVENT_ZOOM_IN_PRESSED 62 | ||
105 | #define SONYPI_EVENT_ZOOM_OUT_PRESSED 63 | ||
104 | 106 | ||
105 | /* get/set brightness */ | 107 | /* get/set brightness */ |
106 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) | 108 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) |
diff --git a/include/linux/spi/mcp23s08.h b/include/linux/spi/mcp23s08.h new file mode 100644 index 000000000000..835ddf47d45c --- /dev/null +++ b/include/linux/spi/mcp23s08.h | |||
@@ -0,0 +1,24 @@ | |||
1 | |||
2 | /* FIXME driver should be able to handle all four slaves that | ||
3 | * can be hooked up to each chipselect, as well as IRQs... | ||
4 | */ | ||
5 | |||
6 | struct mcp23s08_platform_data { | ||
7 | /* four slaves can share one SPI chipselect */ | ||
8 | u8 slave; | ||
9 | |||
10 | /* number assigned to the first GPIO */ | ||
11 | unsigned base; | ||
12 | |||
13 | /* pins with pullups */ | ||
14 | u8 pullups; | ||
15 | |||
16 | void *context; /* param to setup/teardown */ | ||
17 | |||
18 | int (*setup)(struct spi_device *spi, | ||
19 | int gpio, unsigned ngpio, | ||
20 | void *context); | ||
21 | int (*teardown)(struct spi_device *spi, | ||
22 | int gpio, unsigned ngpio, | ||
23 | void *context); | ||
24 | }; | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 124449733c55..576a5f77d3bd 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -71,7 +71,7 @@ | |||
71 | #define LOCK_SECTION_END \ | 71 | #define LOCK_SECTION_END \ |
72 | ".previous\n\t" | 72 | ".previous\n\t" |
73 | 73 | ||
74 | #define __lockfunc fastcall __attribute__((section(".spinlock.text"))) | 74 | #define __lockfunc __attribute__((section(".spinlock.text"))) |
75 | 75 | ||
76 | /* | 76 | /* |
77 | * Pull the raw_spinlock_t and raw_rwlock_t definitions: | 77 | * Pull the raw_spinlock_t and raw_rwlock_t definitions: |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index e18f5c23b930..9d5da8b2ccf9 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -373,6 +373,15 @@ void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state) | |||
373 | if (sdev->bus->bustype == SSB_BUSTYPE_PCI) | 373 | if (sdev->bus->bustype == SSB_BUSTYPE_PCI) |
374 | pci_set_power_state(sdev->bus->host_pci, state); | 374 | pci_set_power_state(sdev->bus->host_pci, state); |
375 | } | 375 | } |
376 | #else | ||
377 | static inline void ssb_pcihost_unregister(struct pci_driver *driver) | ||
378 | { | ||
379 | } | ||
380 | |||
381 | static inline | ||
382 | void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state) | ||
383 | { | ||
384 | } | ||
376 | #endif /* CONFIG_SSB_PCIHOST */ | 385 | #endif /* CONFIG_SSB_PCIHOST */ |
377 | 386 | ||
378 | 387 | ||
diff --git a/include/linux/stallion.h b/include/linux/stallion.h index 94b4a10b912f..0424d75a5aaa 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h | |||
@@ -95,7 +95,6 @@ struct stlport { | |||
95 | struct tty_struct *tty; | 95 | struct tty_struct *tty; |
96 | wait_queue_head_t open_wait; | 96 | wait_queue_head_t open_wait; |
97 | wait_queue_head_t close_wait; | 97 | wait_queue_head_t close_wait; |
98 | struct work_struct tqueue; | ||
99 | comstats_t stats; | 98 | comstats_t stats; |
100 | struct stlrq tx; | 99 | struct stlrq tx; |
101 | }; | 100 | }; |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 646ce2d068d4..1d7d4c5797ee 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -130,7 +130,6 @@ struct pbe { | |||
130 | }; | 130 | }; |
131 | 131 | ||
132 | /* mm/page_alloc.c */ | 132 | /* mm/page_alloc.c */ |
133 | extern void drain_local_pages(void); | ||
134 | extern void mark_free_pages(struct zone *zone); | 133 | extern void mark_free_pages(struct zone *zone); |
135 | 134 | ||
136 | /** | 135 | /** |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 4f3838adbb30..3ca5c4bd6d3f 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/linkage.h> | 5 | #include <linux/linkage.h> |
6 | #include <linux/mmzone.h> | 6 | #include <linux/mmzone.h> |
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
8 | #include <linux/memcontrol.h> | ||
8 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
9 | 10 | ||
10 | #include <asm/atomic.h> | 11 | #include <asm/atomic.h> |
@@ -158,9 +159,6 @@ struct swap_list_t { | |||
158 | /* Swap 50% full? Release swapcache more aggressively.. */ | 159 | /* Swap 50% full? Release swapcache more aggressively.. */ |
159 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) | 160 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) |
160 | 161 | ||
161 | /* linux/mm/memory.c */ | ||
162 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); | ||
163 | |||
164 | /* linux/mm/page_alloc.c */ | 162 | /* linux/mm/page_alloc.c */ |
165 | extern unsigned long totalram_pages; | 163 | extern unsigned long totalram_pages; |
166 | extern unsigned long totalreserve_pages; | 164 | extern unsigned long totalreserve_pages; |
@@ -185,6 +183,9 @@ extern void swap_setup(void); | |||
185 | /* linux/mm/vmscan.c */ | 183 | /* linux/mm/vmscan.c */ |
186 | extern unsigned long try_to_free_pages(struct zone **zones, int order, | 184 | extern unsigned long try_to_free_pages(struct zone **zones, int order, |
187 | gfp_t gfp_mask); | 185 | gfp_t gfp_mask); |
186 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | ||
187 | gfp_t gfp_mask); | ||
188 | extern int __isolate_lru_page(struct page *page, int mode); | ||
188 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 189 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
189 | extern int vm_swappiness; | 190 | extern int vm_swappiness; |
190 | extern int remove_mapping(struct address_space *mapping, struct page *page); | 191 | extern int remove_mapping(struct address_space *mapping, struct page *page); |
@@ -223,16 +224,17 @@ extern struct address_space swapper_space; | |||
223 | #define total_swapcache_pages swapper_space.nrpages | 224 | #define total_swapcache_pages swapper_space.nrpages |
224 | extern void show_swap_cache_info(void); | 225 | extern void show_swap_cache_info(void); |
225 | extern int add_to_swap(struct page *, gfp_t); | 226 | extern int add_to_swap(struct page *, gfp_t); |
227 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); | ||
226 | extern void __delete_from_swap_cache(struct page *); | 228 | extern void __delete_from_swap_cache(struct page *); |
227 | extern void delete_from_swap_cache(struct page *); | 229 | extern void delete_from_swap_cache(struct page *); |
228 | extern int move_to_swap_cache(struct page *, swp_entry_t); | ||
229 | extern int move_from_swap_cache(struct page *, unsigned long, | ||
230 | struct address_space *); | ||
231 | extern void free_page_and_swap_cache(struct page *); | 230 | extern void free_page_and_swap_cache(struct page *); |
232 | extern void free_pages_and_swap_cache(struct page **, int); | 231 | extern void free_pages_and_swap_cache(struct page **, int); |
233 | extern struct page * lookup_swap_cache(swp_entry_t); | 232 | extern struct page *lookup_swap_cache(swp_entry_t); |
234 | extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *vma, | 233 | extern struct page *read_swap_cache_async(swp_entry_t, gfp_t, |
235 | unsigned long addr); | 234 | struct vm_area_struct *vma, unsigned long addr); |
235 | extern struct page *swapin_readahead(swp_entry_t, gfp_t, | ||
236 | struct vm_area_struct *vma, unsigned long addr); | ||
237 | |||
236 | /* linux/mm/swapfile.c */ | 238 | /* linux/mm/swapfile.c */ |
237 | extern long total_swap_pages; | 239 | extern long total_swap_pages; |
238 | extern unsigned int nr_swapfiles; | 240 | extern unsigned int nr_swapfiles; |
@@ -306,7 +308,7 @@ static inline void swap_free(swp_entry_t swp) | |||
306 | { | 308 | { |
307 | } | 309 | } |
308 | 310 | ||
309 | static inline struct page *read_swap_cache_async(swp_entry_t swp, | 311 | static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, |
310 | struct vm_area_struct *vma, unsigned long addr) | 312 | struct vm_area_struct *vma, unsigned long addr) |
311 | { | 313 | { |
312 | return NULL; | 314 | return NULL; |
@@ -317,22 +319,12 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp) | |||
317 | return NULL; | 319 | return NULL; |
318 | } | 320 | } |
319 | 321 | ||
320 | static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset) | ||
321 | { | ||
322 | return 0; | ||
323 | } | ||
324 | |||
325 | #define can_share_swap_page(p) (page_mapcount(p) == 1) | 322 | #define can_share_swap_page(p) (page_mapcount(p) == 1) |
326 | 323 | ||
327 | static inline int move_to_swap_cache(struct page *page, swp_entry_t entry) | 324 | static inline int add_to_swap_cache(struct page *page, swp_entry_t entry, |
328 | { | 325 | gfp_t gfp_mask) |
329 | return 1; | ||
330 | } | ||
331 | |||
332 | static inline int move_from_swap_cache(struct page *page, unsigned long index, | ||
333 | struct address_space *mapping) | ||
334 | { | 326 | { |
335 | return 1; | 327 | return -1; |
336 | } | 328 | } |
337 | 329 | ||
338 | static inline void __delete_from_swap_cache(struct page *page) | 330 | static inline void __delete_from_swap_cache(struct page *page) |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index ceb6cc5ceebb..7bf2d149d209 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -42,6 +42,12 @@ static inline pgoff_t swp_offset(swp_entry_t entry) | |||
42 | return entry.val & SWP_OFFSET_MASK(entry); | 42 | return entry.val & SWP_OFFSET_MASK(entry); |
43 | } | 43 | } |
44 | 44 | ||
45 | /* check whether a pte points to a swap entry */ | ||
46 | static inline int is_swap_pte(pte_t pte) | ||
47 | { | ||
48 | return !pte_none(pte) && !pte_present(pte) && !pte_file(pte); | ||
49 | } | ||
50 | |||
45 | /* | 51 | /* |
46 | * Convert the arch-dependent pte representation of a swp_entry_t into an | 52 | * Convert the arch-dependent pte representation of a swp_entry_t into an |
47 | * arch-independent swp_entry_t. | 53 | * arch-independent swp_entry_t. |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 61def7c8fbb3..4c2577bd1c85 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -607,8 +607,11 @@ asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, | |||
607 | size_t len); | 607 | size_t len); |
608 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); | 608 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); |
609 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); | 609 | asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); |
610 | asmlinkage long sys_timerfd(int ufd, int clockid, int flags, | 610 | asmlinkage long sys_timerfd_create(int clockid, int flags); |
611 | const struct itimerspec __user *utmr); | 611 | asmlinkage long sys_timerfd_settime(int ufd, int flags, |
612 | const struct itimerspec __user *utmr, | ||
613 | struct itimerspec __user *otmr); | ||
614 | asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); | ||
612 | asmlinkage long sys_eventfd(unsigned int count); | 615 | asmlinkage long sys_eventfd(unsigned int count); |
613 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); | 616 | asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); |
614 | 617 | ||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index bf4ae4e138f7..571f01d20a86 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -102,7 +102,6 @@ enum | |||
102 | KERN_NODENAME=7, | 102 | KERN_NODENAME=7, |
103 | KERN_DOMAINNAME=8, | 103 | KERN_DOMAINNAME=8, |
104 | 104 | ||
105 | KERN_CAP_BSET=14, /* int: capability bounding set */ | ||
106 | KERN_PANIC=15, /* int: panic timeout */ | 105 | KERN_PANIC=15, /* int: panic timeout */ |
107 | KERN_REALROOTDEV=16, /* real root device to mount after initrd */ | 106 | KERN_REALROOTDEV=16, /* real root device to mount after initrd */ |
108 | 107 | ||
@@ -965,8 +964,6 @@ extern int proc_dostring(struct ctl_table *, int, struct file *, | |||
965 | void __user *, size_t *, loff_t *); | 964 | void __user *, size_t *, loff_t *); |
966 | extern int proc_dointvec(struct ctl_table *, int, struct file *, | 965 | extern int proc_dointvec(struct ctl_table *, int, struct file *, |
967 | void __user *, size_t *, loff_t *); | 966 | void __user *, size_t *, loff_t *); |
968 | extern int proc_dointvec_bset(struct ctl_table *, int, struct file *, | ||
969 | void __user *, size_t *, loff_t *); | ||
970 | extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *, | 967 | extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *, |
971 | void __user *, size_t *, loff_t *); | 968 | void __user *, size_t *, loff_t *); |
972 | extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *, | 969 | extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *, |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h new file mode 100644 index 000000000000..bba7712cadc7 --- /dev/null +++ b/include/linux/thermal.h | |||
@@ -0,0 +1,94 @@ | |||
1 | /* | ||
2 | * thermal.h ($Revision: 0 $) | ||
3 | * | ||
4 | * Copyright (C) 2008 Intel Corp | ||
5 | * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com> | ||
6 | * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com> | ||
7 | * | ||
8 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; version 2 of the License. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
21 | * | ||
22 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
23 | */ | ||
24 | |||
25 | #ifndef __THERMAL_H__ | ||
26 | #define __THERMAL_H__ | ||
27 | |||
28 | #include <linux/idr.h> | ||
29 | #include <linux/device.h> | ||
30 | |||
31 | struct thermal_zone_device; | ||
32 | struct thermal_cooling_device; | ||
33 | |||
34 | struct thermal_zone_device_ops { | ||
35 | int (*bind) (struct thermal_zone_device *, | ||
36 | struct thermal_cooling_device *); | ||
37 | int (*unbind) (struct thermal_zone_device *, | ||
38 | struct thermal_cooling_device *); | ||
39 | int (*get_temp) (struct thermal_zone_device *, char *); | ||
40 | int (*get_mode) (struct thermal_zone_device *, char *); | ||
41 | int (*set_mode) (struct thermal_zone_device *, const char *); | ||
42 | int (*get_trip_type) (struct thermal_zone_device *, int, char *); | ||
43 | int (*get_trip_temp) (struct thermal_zone_device *, int, char *); | ||
44 | }; | ||
45 | |||
46 | struct thermal_cooling_device_ops { | ||
47 | int (*get_max_state) (struct thermal_cooling_device *, char *); | ||
48 | int (*get_cur_state) (struct thermal_cooling_device *, char *); | ||
49 | int (*set_cur_state) (struct thermal_cooling_device *, unsigned int); | ||
50 | }; | ||
51 | |||
52 | #define THERMAL_TRIPS_NONE -1 | ||
53 | #define THERMAL_MAX_TRIPS 10 | ||
54 | #define THERMAL_NAME_LENGTH 20 | ||
55 | struct thermal_cooling_device { | ||
56 | int id; | ||
57 | char type[THERMAL_NAME_LENGTH]; | ||
58 | struct device device; | ||
59 | void *devdata; | ||
60 | struct thermal_cooling_device_ops *ops; | ||
61 | struct list_head node; | ||
62 | }; | ||
63 | |||
64 | #define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \ | ||
65 | ((long)t-2732+5)/10 : ((long)t-2732-5)/10) | ||
66 | #define CELSIUS_TO_KELVIN(t) ((t)*10+2732) | ||
67 | |||
68 | struct thermal_zone_device { | ||
69 | int id; | ||
70 | char type[THERMAL_NAME_LENGTH]; | ||
71 | struct device device; | ||
72 | void *devdata; | ||
73 | int trips; | ||
74 | struct thermal_zone_device_ops *ops; | ||
75 | struct list_head cooling_devices; | ||
76 | struct idr idr; | ||
77 | struct mutex lock; /* protect cooling devices list */ | ||
78 | struct list_head node; | ||
79 | }; | ||
80 | |||
81 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, | ||
82 | struct thermal_zone_device_ops *); | ||
83 | void thermal_zone_device_unregister(struct thermal_zone_device *); | ||
84 | |||
85 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, | ||
86 | struct thermal_cooling_device *); | ||
87 | int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, | ||
88 | struct thermal_cooling_device *); | ||
89 | |||
90 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | ||
91 | struct thermal_cooling_device_ops *); | ||
92 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | ||
93 | |||
94 | #endif /* __THERMAL_H__ */ | ||
diff --git a/include/linux/time.h b/include/linux/time.h index ceaab9fff155..2091a19f1655 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -120,7 +120,7 @@ extern void getboottime(struct timespec *ts); | |||
120 | extern void monotonic_to_bootbased(struct timespec *ts); | 120 | extern void monotonic_to_bootbased(struct timespec *ts); |
121 | 121 | ||
122 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 122 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
123 | extern int timekeeping_is_continuous(void); | 123 | extern int timekeeping_valid_for_hres(void); |
124 | extern void update_wall_time(void); | 124 | extern void update_wall_time(void); |
125 | extern void update_xtime_cache(u64 nsec); | 125 | extern void update_xtime_cache(u64 nsec); |
126 | 126 | ||
diff --git a/include/linux/timer.h b/include/linux/timer.h index de0e71359ede..979fefdeb862 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -35,8 +35,8 @@ extern struct tvec_base boot_tvec_bases; | |||
35 | struct timer_list _name = \ | 35 | struct timer_list _name = \ |
36 | TIMER_INITIALIZER(_function, _expires, _data) | 36 | TIMER_INITIALIZER(_function, _expires, _data) |
37 | 37 | ||
38 | void fastcall init_timer(struct timer_list * timer); | 38 | void init_timer(struct timer_list *timer); |
39 | void fastcall init_timer_deferrable(struct timer_list *timer); | 39 | void init_timer_deferrable(struct timer_list *timer); |
40 | 40 | ||
41 | static inline void setup_timer(struct timer_list * timer, | 41 | static inline void setup_timer(struct timer_list * timer, |
42 | void (*function)(unsigned long), | 42 | void (*function)(unsigned long), |
@@ -124,8 +124,6 @@ static inline void timer_stats_timer_clear_start_info(struct timer_list *timer) | |||
124 | } | 124 | } |
125 | #endif | 125 | #endif |
126 | 126 | ||
127 | extern void delayed_work_timer_fn(unsigned long __data); | ||
128 | |||
129 | /** | 127 | /** |
130 | * add_timer - start a timer | 128 | * add_timer - start a timer |
131 | * @timer: the timer to be added | 129 | * @timer: the timer to be added |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 24c6a2b59511..8ea3e71ba7fa 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -244,6 +244,8 @@ extern int do_adjtimex(struct timex *); | |||
244 | /* Don't use! Compatibility define for existing users. */ | 244 | /* Don't use! Compatibility define for existing users. */ |
245 | #define tickadj (500/HZ ? : 1) | 245 | #define tickadj (500/HZ ? : 1) |
246 | 246 | ||
247 | int read_current_timer(unsigned long *timer_val); | ||
248 | |||
247 | #endif /* KERNEL */ | 249 | #endif /* KERNEL */ |
248 | 250 | ||
249 | #endif /* LINUX_TIMEX_H */ | 251 | #endif /* LINUX_TIMEX_H */ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 402de892b3ed..dd8e08fe8855 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -53,13 +53,6 @@ | |||
53 | */ | 53 | */ |
54 | #define __DISABLED_CHAR '\0' | 54 | #define __DISABLED_CHAR '\0' |
55 | 55 | ||
56 | /* | ||
57 | * This is the flip buffer used for the tty driver. The buffer is | ||
58 | * located in the tty structure, and is used as a high speed interface | ||
59 | * between the tty driver and the tty line discipline. | ||
60 | */ | ||
61 | #define TTY_FLIPBUF_SIZE 512 | ||
62 | |||
63 | struct tty_buffer { | 56 | struct tty_buffer { |
64 | struct tty_buffer *next; | 57 | struct tty_buffer *next; |
65 | char *char_buf_ptr; | 58 | char *char_buf_ptr; |
@@ -74,7 +67,6 @@ struct tty_buffer { | |||
74 | 67 | ||
75 | struct tty_bufhead { | 68 | struct tty_bufhead { |
76 | struct delayed_work work; | 69 | struct delayed_work work; |
77 | struct semaphore pty_sem; | ||
78 | spinlock_t lock; | 70 | spinlock_t lock; |
79 | struct tty_buffer *head; /* Queue head */ | 71 | struct tty_buffer *head; /* Queue head */ |
80 | struct tty_buffer *tail; /* Active buffer */ | 72 | struct tty_buffer *tail; /* Active buffer */ |
diff --git a/include/linux/types.h b/include/linux/types.h index b94c0e4efe24..9dc2346627b4 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -53,7 +53,7 @@ typedef __kernel_uid_t uid_t; | |||
53 | typedef __kernel_gid_t gid_t; | 53 | typedef __kernel_gid_t gid_t; |
54 | #endif /* __KERNEL__ */ | 54 | #endif /* __KERNEL__ */ |
55 | 55 | ||
56 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) | 56 | #if defined(__GNUC__) |
57 | typedef __kernel_loff_t loff_t; | 57 | typedef __kernel_loff_t loff_t; |
58 | #endif | 58 | #endif |
59 | 59 | ||
@@ -119,7 +119,7 @@ typedef __u8 uint8_t; | |||
119 | typedef __u16 uint16_t; | 119 | typedef __u16 uint16_t; |
120 | typedef __u32 uint32_t; | 120 | typedef __u32 uint32_t; |
121 | 121 | ||
122 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) | 122 | #if defined(__GNUC__) |
123 | typedef __u64 uint64_t; | 123 | typedef __u64 uint64_t; |
124 | typedef __u64 u_int64_t; | 124 | typedef __u64 u_int64_t; |
125 | typedef __s64 int64_t; | 125 | typedef __s64 int64_t; |
@@ -181,7 +181,7 @@ typedef __u16 __bitwise __le16; | |||
181 | typedef __u16 __bitwise __be16; | 181 | typedef __u16 __bitwise __be16; |
182 | typedef __u32 __bitwise __le32; | 182 | typedef __u32 __bitwise __le32; |
183 | typedef __u32 __bitwise __be32; | 183 | typedef __u32 __bitwise __be32; |
184 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) | 184 | #if defined(__GNUC__) |
185 | typedef __u64 __bitwise __le64; | 185 | typedef __u64 __bitwise __le64; |
186 | typedef __u64 __bitwise __be64; | 186 | typedef __u64 __bitwise __be64; |
187 | #endif | 187 | #endif |
diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h index 36c684e1b110..aa88654eb76b 100644 --- a/include/linux/udf_fs.h +++ b/include/linux/udf_fs.h | |||
@@ -32,18 +32,15 @@ | |||
32 | #define UDF_PREALLOCATE | 32 | #define UDF_PREALLOCATE |
33 | #define UDF_DEFAULT_PREALLOC_BLOCKS 8 | 33 | #define UDF_DEFAULT_PREALLOC_BLOCKS 8 |
34 | 34 | ||
35 | #define UDFFS_DATE "2004/29/09" | ||
36 | #define UDFFS_VERSION "0.9.8.1" | ||
37 | |||
38 | #undef UDFFS_DEBUG | 35 | #undef UDFFS_DEBUG |
39 | 36 | ||
40 | #ifdef UDFFS_DEBUG | 37 | #ifdef UDFFS_DEBUG |
41 | #define udf_debug(f, a...) \ | 38 | #define udf_debug(f, a...) \ |
42 | { \ | 39 | do { \ |
43 | printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \ | 40 | printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \ |
44 | __FILE__, __LINE__, __FUNCTION__); \ | 41 | __FILE__, __LINE__, __FUNCTION__); \ |
45 | printk (f, ##a); \ | 42 | printk (f, ##a); \ |
46 | } | 43 | } while (0) |
47 | #else | 44 | #else |
48 | #define udf_debug(f, a...) /**/ | 45 | #define udf_debug(f, a...) /**/ |
49 | #endif | 46 | #endif |
diff --git a/include/linux/udf_fs_sb.h b/include/linux/udf_fs_sb.h index 80ae9ef940dc..9bc47352b6b4 100644 --- a/include/linux/udf_fs_sb.h +++ b/include/linux/udf_fs_sb.h | |||
@@ -75,7 +75,7 @@ struct udf_part_map | |||
75 | struct udf_sb_info | 75 | struct udf_sb_info |
76 | { | 76 | { |
77 | struct udf_part_map *s_partmaps; | 77 | struct udf_part_map *s_partmaps; |
78 | __u8 s_volident[32]; | 78 | __u8 s_volume_ident[32]; |
79 | 79 | ||
80 | /* Overall info */ | 80 | /* Overall info */ |
81 | __u16 s_partitions; | 81 | __u16 s_partitions; |
@@ -84,9 +84,9 @@ struct udf_sb_info | |||
84 | /* Sector headers */ | 84 | /* Sector headers */ |
85 | __s32 s_session; | 85 | __s32 s_session; |
86 | __u32 s_anchor[4]; | 86 | __u32 s_anchor[4]; |
87 | __u32 s_lastblock; | 87 | __u32 s_last_block; |
88 | 88 | ||
89 | struct buffer_head *s_lvidbh; | 89 | struct buffer_head *s_lvid_bh; |
90 | 90 | ||
91 | /* Default permissions */ | 91 | /* Default permissions */ |
92 | mode_t s_umask; | 92 | mode_t s_umask; |
@@ -94,10 +94,10 @@ struct udf_sb_info | |||
94 | uid_t s_uid; | 94 | uid_t s_uid; |
95 | 95 | ||
96 | /* Root Info */ | 96 | /* Root Info */ |
97 | struct timespec s_recordtime; | 97 | struct timespec s_record_time; |
98 | 98 | ||
99 | /* Fileset Info */ | 99 | /* Fileset Info */ |
100 | __u16 s_serialnum; | 100 | __u16 s_serial_number; |
101 | 101 | ||
102 | /* highest UDF revision we have recorded to this media */ | 102 | /* highest UDF revision we have recorded to this media */ |
103 | __u16 s_udfrev; | 103 | __u16 s_udfrev; |
@@ -109,7 +109,7 @@ struct udf_sb_info | |||
109 | struct nls_table *s_nls_map; | 109 | struct nls_table *s_nls_map; |
110 | 110 | ||
111 | /* VAT inode */ | 111 | /* VAT inode */ |
112 | struct inode *s_vat; | 112 | struct inode *s_vat_inode; |
113 | 113 | ||
114 | struct mutex s_alloc_mutex; | 114 | struct mutex s_alloc_mutex; |
115 | }; | 115 | }; |
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h deleted file mode 100644 index 10b854d3561f..000000000000 --- a/include/linux/ufs_fs.h +++ /dev/null | |||
@@ -1,953 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/ufs_fs.h | ||
3 | * | ||
4 | * Copyright (C) 1996 | ||
5 | * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu) | ||
6 | * Laboratory for Computer Science Research Computing Facility | ||
7 | * Rutgers, The State University of New Jersey | ||
8 | * | ||
9 | * Clean swab support by Fare <fare@tunes.org> | ||
10 | * just hope no one is using NNUUXXI on __?64 structure elements | ||
11 | * 64-bit clean thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl> | ||
12 | * | ||
13 | * 4.4BSD (FreeBSD) support added on February 1st 1998 by | ||
14 | * Niels Kristian Bech Jensen <nkbj@image.dk> partially based | ||
15 | * on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>. | ||
16 | * | ||
17 | * NeXTstep support added on February 5th 1998 by | ||
18 | * Niels Kristian Bech Jensen <nkbj@image.dk>. | ||
19 | * | ||
20 | * Write support by Daniel Pirkl <daniel.pirkl@email.cz> | ||
21 | * | ||
22 | * HP/UX hfs filesystem support added by | ||
23 | * Martin K. Petersen <mkp@mkp.net>, August 1999 | ||
24 | * | ||
25 | * UFS2 (of FreeBSD 5.x) support added by | ||
26 | * Niraj Kumar <niraj17@iitbombay.org> , Jan 2004 | ||
27 | * | ||
28 | */ | ||
29 | |||
30 | #ifndef __LINUX_UFS_FS_H | ||
31 | #define __LINUX_UFS_FS_H | ||
32 | |||
33 | #include <linux/types.h> | ||
34 | #include <linux/kernel.h> | ||
35 | #include <linux/stat.h> | ||
36 | #include <linux/fs.h> | ||
37 | |||
38 | #ifndef __KERNEL__ | ||
39 | typedef __u64 __fs64; | ||
40 | typedef __u32 __fs32; | ||
41 | typedef __u16 __fs16; | ||
42 | #else | ||
43 | #include <asm/div64.h> | ||
44 | typedef __u64 __bitwise __fs64; | ||
45 | typedef __u32 __bitwise __fs32; | ||
46 | typedef __u16 __bitwise __fs16; | ||
47 | #endif | ||
48 | |||
49 | #define UFS_BBLOCK 0 | ||
50 | #define UFS_BBSIZE 8192 | ||
51 | #define UFS_SBLOCK 8192 | ||
52 | #define UFS_SBSIZE 8192 | ||
53 | |||
54 | #define UFS_SECTOR_SIZE 512 | ||
55 | #define UFS_SECTOR_BITS 9 | ||
56 | #define UFS_MAGIC 0x00011954 | ||
57 | #define UFS2_MAGIC 0x19540119 | ||
58 | #define UFS_CIGAM 0x54190100 /* byteswapped MAGIC */ | ||
59 | |||
60 | /* Copied from FreeBSD */ | ||
61 | /* | ||
62 | * Each disk drive contains some number of filesystems. | ||
63 | * A filesystem consists of a number of cylinder groups. | ||
64 | * Each cylinder group has inodes and data. | ||
65 | * | ||
66 | * A filesystem is described by its super-block, which in turn | ||
67 | * describes the cylinder groups. The super-block is critical | ||
68 | * data and is replicated in each cylinder group to protect against | ||
69 | * catastrophic loss. This is done at `newfs' time and the critical | ||
70 | * super-block data does not change, so the copies need not be | ||
71 | * referenced further unless disaster strikes. | ||
72 | * | ||
73 | * For filesystem fs, the offsets of the various blocks of interest | ||
74 | * are given in the super block as: | ||
75 | * [fs->fs_sblkno] Super-block | ||
76 | * [fs->fs_cblkno] Cylinder group block | ||
77 | * [fs->fs_iblkno] Inode blocks | ||
78 | * [fs->fs_dblkno] Data blocks | ||
79 | * The beginning of cylinder group cg in fs, is given by | ||
80 | * the ``cgbase(fs, cg)'' macro. | ||
81 | * | ||
82 | * Depending on the architecture and the media, the superblock may | ||
83 | * reside in any one of four places. For tiny media where every block | ||
84 | * counts, it is placed at the very front of the partition. Historically, | ||
85 | * UFS1 placed it 8K from the front to leave room for the disk label and | ||
86 | * a small bootstrap. For UFS2 it got moved to 64K from the front to leave | ||
87 | * room for the disk label and a bigger bootstrap, and for really piggy | ||
88 | * systems we check at 256K from the front if the first three fail. In | ||
89 | * all cases the size of the superblock will be SBLOCKSIZE. All values are | ||
90 | * given in byte-offset form, so they do not imply a sector size. The | ||
91 | * SBLOCKSEARCH specifies the order in which the locations should be searched. | ||
92 | */ | ||
93 | #define SBLOCK_FLOPPY 0 | ||
94 | #define SBLOCK_UFS1 8192 | ||
95 | #define SBLOCK_UFS2 65536 | ||
96 | #define SBLOCK_PIGGY 262144 | ||
97 | #define SBLOCKSIZE 8192 | ||
98 | #define SBLOCKSEARCH \ | ||
99 | { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 } | ||
100 | |||
101 | |||
102 | /* HP specific MAGIC values */ | ||
103 | |||
104 | #define UFS_MAGIC_LFN 0x00095014 /* fs supports filenames > 14 chars */ | ||
105 | #define UFS_CIGAM_LFN 0x14500900 /* srahc 41 < semanelif stroppus sf */ | ||
106 | |||
107 | #define UFS_MAGIC_SEC 0x00612195 /* B1 security fs */ | ||
108 | #define UFS_CIGAM_SEC 0x95216100 | ||
109 | |||
110 | #define UFS_MAGIC_FEA 0x00195612 /* fs_featurebits supported */ | ||
111 | #define UFS_CIGAM_FEA 0x12561900 | ||
112 | |||
113 | #define UFS_MAGIC_4GB 0x05231994 /* fs > 4 GB && fs_featurebits */ | ||
114 | #define UFS_CIGAM_4GB 0x94192305 | ||
115 | |||
116 | /* Seems somebody at HP goofed here. B1 and lfs are both 0x2 !?! */ | ||
117 | #define UFS_FSF_LFN 0x00000001 /* long file names */ | ||
118 | #define UFS_FSF_B1 0x00000002 /* B1 security */ | ||
119 | #define UFS_FSF_LFS 0x00000002 /* large files */ | ||
120 | #define UFS_FSF_LUID 0x00000004 /* large UIDs */ | ||
121 | |||
122 | /* End of HP stuff */ | ||
123 | |||
124 | |||
125 | #define UFS_BSIZE 8192 | ||
126 | #define UFS_MINBSIZE 4096 | ||
127 | #define UFS_FSIZE 1024 | ||
128 | #define UFS_MAXFRAG (UFS_BSIZE / UFS_FSIZE) | ||
129 | |||
130 | #define UFS_NDADDR 12 | ||
131 | #define UFS_NINDIR 3 | ||
132 | |||
133 | #define UFS_IND_BLOCK (UFS_NDADDR + 0) | ||
134 | #define UFS_DIND_BLOCK (UFS_NDADDR + 1) | ||
135 | #define UFS_TIND_BLOCK (UFS_NDADDR + 2) | ||
136 | |||
137 | #define UFS_NDIR_FRAGMENT (UFS_NDADDR << uspi->s_fpbshift) | ||
138 | #define UFS_IND_FRAGMENT (UFS_IND_BLOCK << uspi->s_fpbshift) | ||
139 | #define UFS_DIND_FRAGMENT (UFS_DIND_BLOCK << uspi->s_fpbshift) | ||
140 | #define UFS_TIND_FRAGMENT (UFS_TIND_BLOCK << uspi->s_fpbshift) | ||
141 | |||
142 | #define UFS_ROOTINO 2 | ||
143 | #define UFS_FIRST_INO (UFS_ROOTINO + 1) | ||
144 | |||
145 | #define UFS_USEEFT ((__u16)65535) | ||
146 | |||
147 | #define UFS_FSOK 0x7c269d38 | ||
148 | #define UFS_FSACTIVE ((__s8)0x00) | ||
149 | #define UFS_FSCLEAN ((__s8)0x01) | ||
150 | #define UFS_FSSTABLE ((__s8)0x02) | ||
151 | #define UFS_FSOSF1 ((__s8)0x03) /* is this correct for DEC OSF/1? */ | ||
152 | #define UFS_FSBAD ((__s8)0xff) | ||
153 | |||
154 | /* From here to next blank line, s_flags for ufs_sb_info */ | ||
155 | /* directory entry encoding */ | ||
156 | #define UFS_DE_MASK 0x00000010 /* mask for the following */ | ||
157 | #define UFS_DE_OLD 0x00000000 | ||
158 | #define UFS_DE_44BSD 0x00000010 | ||
159 | /* uid encoding */ | ||
160 | #define UFS_UID_MASK 0x00000060 /* mask for the following */ | ||
161 | #define UFS_UID_OLD 0x00000000 | ||
162 | #define UFS_UID_44BSD 0x00000020 | ||
163 | #define UFS_UID_EFT 0x00000040 | ||
164 | /* superblock state encoding */ | ||
165 | #define UFS_ST_MASK 0x00000700 /* mask for the following */ | ||
166 | #define UFS_ST_OLD 0x00000000 | ||
167 | #define UFS_ST_44BSD 0x00000100 | ||
168 | #define UFS_ST_SUN 0x00000200 /* Solaris */ | ||
169 | #define UFS_ST_SUNOS 0x00000300 | ||
170 | #define UFS_ST_SUNx86 0x00000400 /* Solaris x86 */ | ||
171 | /*cylinder group encoding */ | ||
172 | #define UFS_CG_MASK 0x00003000 /* mask for the following */ | ||
173 | #define UFS_CG_OLD 0x00000000 | ||
174 | #define UFS_CG_44BSD 0x00002000 | ||
175 | #define UFS_CG_SUN 0x00001000 | ||
176 | /* filesystem type encoding */ | ||
177 | #define UFS_TYPE_MASK 0x00010000 /* mask for the following */ | ||
178 | #define UFS_TYPE_UFS1 0x00000000 | ||
179 | #define UFS_TYPE_UFS2 0x00010000 | ||
180 | |||
181 | |||
182 | /* fs_inodefmt options */ | ||
183 | #define UFS_42INODEFMT -1 | ||
184 | #define UFS_44INODEFMT 2 | ||
185 | |||
186 | /* | ||
187 | * MINFREE gives the minimum acceptable percentage of file system | ||
188 | * blocks which may be free. If the freelist drops below this level | ||
189 | * only the superuser may continue to allocate blocks. This may | ||
190 | * be set to 0 if no reserve of free blocks is deemed necessary, | ||
191 | * however throughput drops by fifty percent if the file system | ||
192 | * is run at between 95% and 100% full; thus the minimum default | ||
193 | * value of fs_minfree is 5%. However, to get good clustering | ||
194 | * performance, 10% is a better choice. hence we use 10% as our | ||
195 | * default value. With 10% free space, fragmentation is not a | ||
196 | * problem, so we choose to optimize for time. | ||
197 | */ | ||
198 | #define UFS_MINFREE 5 | ||
199 | #define UFS_DEFAULTOPT UFS_OPTTIME | ||
200 | |||
201 | /* | ||
202 | * Turn file system block numbers into disk block addresses. | ||
203 | * This maps file system blocks to device size blocks. | ||
204 | */ | ||
205 | #define ufs_fsbtodb(uspi, b) ((b) << (uspi)->s_fsbtodb) | ||
206 | #define ufs_dbtofsb(uspi, b) ((b) >> (uspi)->s_fsbtodb) | ||
207 | |||
208 | /* | ||
209 | * Cylinder group macros to locate things in cylinder groups. | ||
210 | * They calc file system addresses of cylinder group data structures. | ||
211 | */ | ||
212 | #define ufs_cgbase(c) (uspi->s_fpg * (c)) | ||
213 | #define ufs_cgstart(c) ((uspi)->fs_magic == UFS2_MAGIC ? ufs_cgbase(c) : \ | ||
214 | (ufs_cgbase(c) + uspi->s_cgoffset * ((c) & ~uspi->s_cgmask))) | ||
215 | #define ufs_cgsblock(c) (ufs_cgstart(c) + uspi->s_sblkno) /* super blk */ | ||
216 | #define ufs_cgcmin(c) (ufs_cgstart(c) + uspi->s_cblkno) /* cg block */ | ||
217 | #define ufs_cgimin(c) (ufs_cgstart(c) + uspi->s_iblkno) /* inode blk */ | ||
218 | #define ufs_cgdmin(c) (ufs_cgstart(c) + uspi->s_dblkno) /* 1st data */ | ||
219 | |||
220 | /* | ||
221 | * Macros for handling inode numbers: | ||
222 | * inode number to file system block offset. | ||
223 | * inode number to cylinder group number. | ||
224 | * inode number to file system block address. | ||
225 | */ | ||
226 | #define ufs_inotocg(x) ((x) / uspi->s_ipg) | ||
227 | #define ufs_inotocgoff(x) ((x) % uspi->s_ipg) | ||
228 | #define ufs_inotofsba(x) (((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf) | ||
229 | #define ufs_inotofsbo(x) ((x) % uspi->s_inopf) | ||
230 | |||
231 | /* | ||
232 | * Compute the cylinder and rotational position of a cyl block addr. | ||
233 | */ | ||
234 | #define ufs_cbtocylno(bno) \ | ||
235 | ((bno) * uspi->s_nspf / uspi->s_spc) | ||
236 | #define ufs_cbtorpos(bno) \ | ||
237 | ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \ | ||
238 | * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \ | ||
239 | % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \ | ||
240 | * uspi->s_nrpos) / uspi->s_npsect) | ||
241 | |||
242 | /* | ||
243 | * The following macros optimize certain frequently calculated | ||
244 | * quantities by using shifts and masks in place of divisions | ||
245 | * modulos and multiplications. | ||
246 | */ | ||
247 | #define ufs_blkoff(loc) ((loc) & uspi->s_qbmask) | ||
248 | #define ufs_fragoff(loc) ((loc) & uspi->s_qfmask) | ||
249 | #define ufs_lblktosize(blk) ((blk) << uspi->s_bshift) | ||
250 | #define ufs_lblkno(loc) ((loc) >> uspi->s_bshift) | ||
251 | #define ufs_numfrags(loc) ((loc) >> uspi->s_fshift) | ||
252 | #define ufs_blkroundup(size) (((size) + uspi->s_qbmask) & uspi->s_bmask) | ||
253 | #define ufs_fragroundup(size) (((size) + uspi->s_qfmask) & uspi->s_fmask) | ||
254 | #define ufs_fragstoblks(frags) ((frags) >> uspi->s_fpbshift) | ||
255 | #define ufs_blkstofrags(blks) ((blks) << uspi->s_fpbshift) | ||
256 | #define ufs_fragnum(fsb) ((fsb) & uspi->s_fpbmask) | ||
257 | #define ufs_blknum(fsb) ((fsb) & ~uspi->s_fpbmask) | ||
258 | |||
259 | #define UFS_MAXNAMLEN 255 | ||
260 | #define UFS_MAXMNTLEN 512 | ||
261 | #define UFS2_MAXMNTLEN 468 | ||
262 | #define UFS2_MAXVOLLEN 32 | ||
263 | #define UFS_MAXCSBUFS 31 | ||
264 | #define UFS_LINK_MAX 32000 | ||
265 | /* | ||
266 | #define UFS2_NOCSPTRS ((128 / sizeof(void *)) - 4) | ||
267 | */ | ||
268 | #define UFS2_NOCSPTRS 28 | ||
269 | |||
270 | /* | ||
271 | * UFS_DIR_PAD defines the directory entries boundaries | ||
272 | * (must be a multiple of 4) | ||
273 | */ | ||
274 | #define UFS_DIR_PAD 4 | ||
275 | #define UFS_DIR_ROUND (UFS_DIR_PAD - 1) | ||
276 | #define UFS_DIR_REC_LEN(name_len) (((name_len) + 1 + 8 + UFS_DIR_ROUND) & ~UFS_DIR_ROUND) | ||
277 | |||
278 | struct ufs_timeval { | ||
279 | __fs32 tv_sec; | ||
280 | __fs32 tv_usec; | ||
281 | }; | ||
282 | |||
283 | struct ufs_dir_entry { | ||
284 | __fs32 d_ino; /* inode number of this entry */ | ||
285 | __fs16 d_reclen; /* length of this entry */ | ||
286 | union { | ||
287 | __fs16 d_namlen; /* actual length of d_name */ | ||
288 | struct { | ||
289 | __u8 d_type; /* file type */ | ||
290 | __u8 d_namlen; /* length of string in d_name */ | ||
291 | } d_44; | ||
292 | } d_u; | ||
293 | __u8 d_name[UFS_MAXNAMLEN + 1]; /* file name */ | ||
294 | }; | ||
295 | |||
296 | struct ufs_csum { | ||
297 | __fs32 cs_ndir; /* number of directories */ | ||
298 | __fs32 cs_nbfree; /* number of free blocks */ | ||
299 | __fs32 cs_nifree; /* number of free inodes */ | ||
300 | __fs32 cs_nffree; /* number of free frags */ | ||
301 | }; | ||
302 | struct ufs2_csum_total { | ||
303 | __fs64 cs_ndir; /* number of directories */ | ||
304 | __fs64 cs_nbfree; /* number of free blocks */ | ||
305 | __fs64 cs_nifree; /* number of free inodes */ | ||
306 | __fs64 cs_nffree; /* number of free frags */ | ||
307 | __fs64 cs_numclusters; /* number of free clusters */ | ||
308 | __fs64 cs_spare[3]; /* future expansion */ | ||
309 | }; | ||
310 | |||
311 | struct ufs_csum_core { | ||
312 | __u64 cs_ndir; /* number of directories */ | ||
313 | __u64 cs_nbfree; /* number of free blocks */ | ||
314 | __u64 cs_nifree; /* number of free inodes */ | ||
315 | __u64 cs_nffree; /* number of free frags */ | ||
316 | __u64 cs_numclusters; /* number of free clusters */ | ||
317 | }; | ||
318 | |||
319 | /* | ||
320 | * File system flags | ||
321 | */ | ||
322 | #define UFS_UNCLEAN 0x01 /* file system not clean at mount (unused) */ | ||
323 | #define UFS_DOSOFTDEP 0x02 /* file system using soft dependencies */ | ||
324 | #define UFS_NEEDSFSCK 0x04 /* needs sync fsck (FreeBSD compat, unused) */ | ||
325 | #define UFS_INDEXDIRS 0x08 /* kernel supports indexed directories */ | ||
326 | #define UFS_ACLS 0x10 /* file system has ACLs enabled */ | ||
327 | #define UFS_MULTILABEL 0x20 /* file system is MAC multi-label */ | ||
328 | #define UFS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */ | ||
329 | |||
330 | #if 0 | ||
331 | /* | ||
332 | * This is the actual superblock, as it is laid out on the disk. | ||
333 | * Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and | ||
334 | * it may occupy several blocks, use | ||
335 | * struct ufs_super_block_(first,second,third) instead. | ||
336 | */ | ||
337 | struct ufs_super_block { | ||
338 | union { | ||
339 | struct { | ||
340 | __fs32 fs_link; /* UNUSED */ | ||
341 | } fs_42; | ||
342 | struct { | ||
343 | __fs32 fs_state; /* file system state flag */ | ||
344 | } fs_sun; | ||
345 | } fs_u0; | ||
346 | __fs32 fs_rlink; /* UNUSED */ | ||
347 | __fs32 fs_sblkno; /* addr of super-block in filesys */ | ||
348 | __fs32 fs_cblkno; /* offset of cyl-block in filesys */ | ||
349 | __fs32 fs_iblkno; /* offset of inode-blocks in filesys */ | ||
350 | __fs32 fs_dblkno; /* offset of first data after cg */ | ||
351 | __fs32 fs_cgoffset; /* cylinder group offset in cylinder */ | ||
352 | __fs32 fs_cgmask; /* used to calc mod fs_ntrak */ | ||
353 | __fs32 fs_time; /* last time written -- time_t */ | ||
354 | __fs32 fs_size; /* number of blocks in fs */ | ||
355 | __fs32 fs_dsize; /* number of data blocks in fs */ | ||
356 | __fs32 fs_ncg; /* number of cylinder groups */ | ||
357 | __fs32 fs_bsize; /* size of basic blocks in fs */ | ||
358 | __fs32 fs_fsize; /* size of frag blocks in fs */ | ||
359 | __fs32 fs_frag; /* number of frags in a block in fs */ | ||
360 | /* these are configuration parameters */ | ||
361 | __fs32 fs_minfree; /* minimum percentage of free blocks */ | ||
362 | __fs32 fs_rotdelay; /* num of ms for optimal next block */ | ||
363 | __fs32 fs_rps; /* disk revolutions per second */ | ||
364 | /* these fields can be computed from the others */ | ||
365 | __fs32 fs_bmask; /* ``blkoff'' calc of blk offsets */ | ||
366 | __fs32 fs_fmask; /* ``fragoff'' calc of frag offsets */ | ||
367 | __fs32 fs_bshift; /* ``lblkno'' calc of logical blkno */ | ||
368 | __fs32 fs_fshift; /* ``numfrags'' calc number of frags */ | ||
369 | /* these are configuration parameters */ | ||
370 | __fs32 fs_maxcontig; /* max number of contiguous blks */ | ||
371 | __fs32 fs_maxbpg; /* max number of blks per cyl group */ | ||
372 | /* these fields can be computed from the others */ | ||
373 | __fs32 fs_fragshift; /* block to frag shift */ | ||
374 | __fs32 fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */ | ||
375 | __fs32 fs_sbsize; /* actual size of super block */ | ||
376 | __fs32 fs_csmask; /* csum block offset */ | ||
377 | __fs32 fs_csshift; /* csum block number */ | ||
378 | __fs32 fs_nindir; /* value of NINDIR */ | ||
379 | __fs32 fs_inopb; /* value of INOPB */ | ||
380 | __fs32 fs_nspf; /* value of NSPF */ | ||
381 | /* yet another configuration parameter */ | ||
382 | __fs32 fs_optim; /* optimization preference, see below */ | ||
383 | /* these fields are derived from the hardware */ | ||
384 | union { | ||
385 | struct { | ||
386 | __fs32 fs_npsect; /* # sectors/track including spares */ | ||
387 | } fs_sun; | ||
388 | struct { | ||
389 | __fs32 fs_state; /* file system state time stamp */ | ||
390 | } fs_sunx86; | ||
391 | } fs_u1; | ||
392 | __fs32 fs_interleave; /* hardware sector interleave */ | ||
393 | __fs32 fs_trackskew; /* sector 0 skew, per track */ | ||
394 | /* a unique id for this filesystem (currently unused and unmaintained) */ | ||
395 | /* In 4.3 Tahoe this space is used by fs_headswitch and fs_trkseek */ | ||
396 | /* Neither of those fields is used in the Tahoe code right now but */ | ||
397 | /* there could be problems if they are. */ | ||
398 | __fs32 fs_id[2]; /* file system id */ | ||
399 | /* sizes determined by number of cylinder groups and their sizes */ | ||
400 | __fs32 fs_csaddr; /* blk addr of cyl grp summary area */ | ||
401 | __fs32 fs_cssize; /* size of cyl grp summary area */ | ||
402 | __fs32 fs_cgsize; /* cylinder group size */ | ||
403 | /* these fields are derived from the hardware */ | ||
404 | __fs32 fs_ntrak; /* tracks per cylinder */ | ||
405 | __fs32 fs_nsect; /* sectors per track */ | ||
406 | __fs32 fs_spc; /* sectors per cylinder */ | ||
407 | /* this comes from the disk driver partitioning */ | ||
408 | __fs32 fs_ncyl; /* cylinders in file system */ | ||
409 | /* these fields can be computed from the others */ | ||
410 | __fs32 fs_cpg; /* cylinders per group */ | ||
411 | __fs32 fs_ipg; /* inodes per cylinder group */ | ||
412 | __fs32 fs_fpg; /* blocks per group * fs_frag */ | ||
413 | /* this data must be re-computed after crashes */ | ||
414 | struct ufs_csum fs_cstotal; /* cylinder summary information */ | ||
415 | /* these fields are cleared at mount time */ | ||
416 | __s8 fs_fmod; /* super block modified flag */ | ||
417 | __s8 fs_clean; /* file system is clean flag */ | ||
418 | __s8 fs_ronly; /* mounted read-only flag */ | ||
419 | __s8 fs_flags; | ||
420 | union { | ||
421 | struct { | ||
422 | __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */ | ||
423 | __fs32 fs_cgrotor; /* last cg searched */ | ||
424 | __fs32 fs_csp[UFS_MAXCSBUFS];/*list of fs_cs info buffers */ | ||
425 | __fs32 fs_maxcluster; | ||
426 | __fs32 fs_cpc; /* cyl per cycle in postbl */ | ||
427 | __fs16 fs_opostbl[16][8]; /* old rotation block list head */ | ||
428 | } fs_u1; | ||
429 | struct { | ||
430 | __s8 fs_fsmnt[UFS2_MAXMNTLEN]; /* name mounted on */ | ||
431 | __u8 fs_volname[UFS2_MAXVOLLEN]; /* volume name */ | ||
432 | __fs64 fs_swuid; /* system-wide uid */ | ||
433 | __fs32 fs_pad; /* due to alignment of fs_swuid */ | ||
434 | __fs32 fs_cgrotor; /* last cg searched */ | ||
435 | __fs32 fs_ocsp[UFS2_NOCSPTRS]; /*list of fs_cs info buffers */ | ||
436 | __fs32 fs_contigdirs;/*# of contiguously allocated dirs */ | ||
437 | __fs32 fs_csp; /* cg summary info buffer for fs_cs */ | ||
438 | __fs32 fs_maxcluster; | ||
439 | __fs32 fs_active;/* used by snapshots to track fs */ | ||
440 | __fs32 fs_old_cpc; /* cyl per cycle in postbl */ | ||
441 | __fs32 fs_maxbsize;/*maximum blocking factor permitted */ | ||
442 | __fs64 fs_sparecon64[17];/*old rotation block list head */ | ||
443 | __fs64 fs_sblockloc; /* byte offset of standard superblock */ | ||
444 | struct ufs2_csum_total fs_cstotal;/*cylinder summary information*/ | ||
445 | struct ufs_timeval fs_time; /* last time written */ | ||
446 | __fs64 fs_size; /* number of blocks in fs */ | ||
447 | __fs64 fs_dsize; /* number of data blocks in fs */ | ||
448 | __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ | ||
449 | __fs64 fs_pendingblocks;/* blocks in process of being freed */ | ||
450 | __fs32 fs_pendinginodes;/*inodes in process of being freed */ | ||
451 | } fs_u2; | ||
452 | } fs_u11; | ||
453 | union { | ||
454 | struct { | ||
455 | __fs32 fs_sparecon[53];/* reserved for future constants */ | ||
456 | __fs32 fs_reclaim; | ||
457 | __fs32 fs_sparecon2[1]; | ||
458 | __fs32 fs_state; /* file system state time stamp */ | ||
459 | __fs32 fs_qbmask[2]; /* ~usb_bmask */ | ||
460 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ | ||
461 | } fs_sun; | ||
462 | struct { | ||
463 | __fs32 fs_sparecon[53];/* reserved for future constants */ | ||
464 | __fs32 fs_reclaim; | ||
465 | __fs32 fs_sparecon2[1]; | ||
466 | __fs32 fs_npsect; /* # sectors/track including spares */ | ||
467 | __fs32 fs_qbmask[2]; /* ~usb_bmask */ | ||
468 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ | ||
469 | } fs_sunx86; | ||
470 | struct { | ||
471 | __fs32 fs_sparecon[50];/* reserved for future constants */ | ||
472 | __fs32 fs_contigsumsize;/* size of cluster summary array */ | ||
473 | __fs32 fs_maxsymlinklen;/* max length of an internal symlink */ | ||
474 | __fs32 fs_inodefmt; /* format of on-disk inodes */ | ||
475 | __fs32 fs_maxfilesize[2]; /* max representable file size */ | ||
476 | __fs32 fs_qbmask[2]; /* ~usb_bmask */ | ||
477 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ | ||
478 | __fs32 fs_state; /* file system state time stamp */ | ||
479 | } fs_44; | ||
480 | } fs_u2; | ||
481 | __fs32 fs_postblformat; /* format of positional layout tables */ | ||
482 | __fs32 fs_nrpos; /* number of rotational positions */ | ||
483 | __fs32 fs_postbloff; /* (__s16) rotation block list head */ | ||
484 | __fs32 fs_rotbloff; /* (__u8) blocks for each rotation */ | ||
485 | __fs32 fs_magic; /* magic number */ | ||
486 | __u8 fs_space[1]; /* list of blocks for each rotation */ | ||
487 | }; | ||
488 | #endif/*struct ufs_super_block*/ | ||
489 | |||
490 | /* | ||
491 | * Preference for optimization. | ||
492 | */ | ||
493 | #define UFS_OPTTIME 0 /* minimize allocation time */ | ||
494 | #define UFS_OPTSPACE 1 /* minimize disk fragmentation */ | ||
495 | |||
496 | /* | ||
497 | * Rotational layout table format types | ||
498 | */ | ||
499 | #define UFS_42POSTBLFMT -1 /* 4.2BSD rotational table format */ | ||
500 | #define UFS_DYNAMICPOSTBLFMT 1 /* dynamic rotational table format */ | ||
501 | |||
502 | /* | ||
503 | * Convert cylinder group to base address of its global summary info. | ||
504 | */ | ||
505 | #define fs_cs(indx) s_csp[(indx)] | ||
506 | |||
507 | /* | ||
508 | * Cylinder group block for a file system. | ||
509 | * | ||
510 | * Writable fields in the cylinder group are protected by the associated | ||
511 | * super block lock fs->fs_lock. | ||
512 | */ | ||
513 | #define CG_MAGIC 0x090255 | ||
514 | #define ufs_cg_chkmagic(sb, ucg) \ | ||
515 | (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC) | ||
516 | /* | ||
517 | * Macros for access to old cylinder group array structures | ||
518 | */ | ||
519 | #define ufs_ocg_blktot(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_btot) | ||
520 | #define ufs_ocg_blks(sb, ucg, cylno) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_b[cylno]) | ||
521 | #define ufs_ocg_inosused(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_iused) | ||
522 | #define ufs_ocg_blksfree(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_free) | ||
523 | #define ufs_ocg_chkmagic(sb, ucg) \ | ||
524 | (fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_magic) == CG_MAGIC) | ||
525 | |||
526 | /* | ||
527 | * size of this structure is 172 B | ||
528 | */ | ||
529 | struct ufs_cylinder_group { | ||
530 | __fs32 cg_link; /* linked list of cyl groups */ | ||
531 | __fs32 cg_magic; /* magic number */ | ||
532 | __fs32 cg_time; /* time last written */ | ||
533 | __fs32 cg_cgx; /* we are the cgx'th cylinder group */ | ||
534 | __fs16 cg_ncyl; /* number of cyl's this cg */ | ||
535 | __fs16 cg_niblk; /* number of inode blocks this cg */ | ||
536 | __fs32 cg_ndblk; /* number of data blocks this cg */ | ||
537 | struct ufs_csum cg_cs; /* cylinder summary information */ | ||
538 | __fs32 cg_rotor; /* position of last used block */ | ||
539 | __fs32 cg_frotor; /* position of last used frag */ | ||
540 | __fs32 cg_irotor; /* position of last used inode */ | ||
541 | __fs32 cg_frsum[UFS_MAXFRAG]; /* counts of available frags */ | ||
542 | __fs32 cg_btotoff; /* (__u32) block totals per cylinder */ | ||
543 | __fs32 cg_boff; /* (short) free block positions */ | ||
544 | __fs32 cg_iusedoff; /* (char) used inode map */ | ||
545 | __fs32 cg_freeoff; /* (u_char) free block map */ | ||
546 | __fs32 cg_nextfreeoff; /* (u_char) next available space */ | ||
547 | union { | ||
548 | struct { | ||
549 | __fs32 cg_clustersumoff; /* (u_int32) counts of avail clusters */ | ||
550 | __fs32 cg_clusteroff; /* (u_int8) free cluster map */ | ||
551 | __fs32 cg_nclusterblks; /* number of clusters this cg */ | ||
552 | __fs32 cg_sparecon[13]; /* reserved for future use */ | ||
553 | } cg_44; | ||
554 | struct { | ||
555 | __fs32 cg_clustersumoff;/* (u_int32) counts of avail clusters */ | ||
556 | __fs32 cg_clusteroff; /* (u_int8) free cluster map */ | ||
557 | __fs32 cg_nclusterblks;/* number of clusters this cg */ | ||
558 | __fs32 cg_niblk; /* number of inode blocks this cg */ | ||
559 | __fs32 cg_initediblk; /* last initialized inode */ | ||
560 | __fs32 cg_sparecon32[3];/* reserved for future use */ | ||
561 | __fs64 cg_time; /* time last written */ | ||
562 | __fs64 cg_sparecon[3]; /* reserved for future use */ | ||
563 | } cg_u2; | ||
564 | __fs32 cg_sparecon[16]; /* reserved for future use */ | ||
565 | } cg_u; | ||
566 | __u8 cg_space[1]; /* space for cylinder group maps */ | ||
567 | /* actually longer */ | ||
568 | }; | ||
569 | |||
570 | /* Historic Cylinder group info */ | ||
571 | struct ufs_old_cylinder_group { | ||
572 | __fs32 cg_link; /* linked list of cyl groups */ | ||
573 | __fs32 cg_rlink; /* for incore cyl groups */ | ||
574 | __fs32 cg_time; /* time last written */ | ||
575 | __fs32 cg_cgx; /* we are the cgx'th cylinder group */ | ||
576 | __fs16 cg_ncyl; /* number of cyl's this cg */ | ||
577 | __fs16 cg_niblk; /* number of inode blocks this cg */ | ||
578 | __fs32 cg_ndblk; /* number of data blocks this cg */ | ||
579 | struct ufs_csum cg_cs; /* cylinder summary information */ | ||
580 | __fs32 cg_rotor; /* position of last used block */ | ||
581 | __fs32 cg_frotor; /* position of last used frag */ | ||
582 | __fs32 cg_irotor; /* position of last used inode */ | ||
583 | __fs32 cg_frsum[8]; /* counts of available frags */ | ||
584 | __fs32 cg_btot[32]; /* block totals per cylinder */ | ||
585 | __fs16 cg_b[32][8]; /* positions of free blocks */ | ||
586 | __u8 cg_iused[256]; /* used inode map */ | ||
587 | __fs32 cg_magic; /* magic number */ | ||
588 | __u8 cg_free[1]; /* free block map */ | ||
589 | /* actually longer */ | ||
590 | }; | ||
591 | |||
592 | /* | ||
593 | * structure of an on-disk inode | ||
594 | */ | ||
595 | struct ufs_inode { | ||
596 | __fs16 ui_mode; /* 0x0 */ | ||
597 | __fs16 ui_nlink; /* 0x2 */ | ||
598 | union { | ||
599 | struct { | ||
600 | __fs16 ui_suid; /* 0x4 */ | ||
601 | __fs16 ui_sgid; /* 0x6 */ | ||
602 | } oldids; | ||
603 | __fs32 ui_inumber; /* 0x4 lsf: inode number */ | ||
604 | __fs32 ui_author; /* 0x4 GNU HURD: author */ | ||
605 | } ui_u1; | ||
606 | __fs64 ui_size; /* 0x8 */ | ||
607 | struct ufs_timeval ui_atime; /* 0x10 access */ | ||
608 | struct ufs_timeval ui_mtime; /* 0x18 modification */ | ||
609 | struct ufs_timeval ui_ctime; /* 0x20 creation */ | ||
610 | union { | ||
611 | struct { | ||
612 | __fs32 ui_db[UFS_NDADDR];/* 0x28 data blocks */ | ||
613 | __fs32 ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */ | ||
614 | } ui_addr; | ||
615 | __u8 ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */ | ||
616 | } ui_u2; | ||
617 | __fs32 ui_flags; /* 0x64 immutable, append-only... */ | ||
618 | __fs32 ui_blocks; /* 0x68 blocks in use */ | ||
619 | __fs32 ui_gen; /* 0x6c like ext2 i_version, for NFS support */ | ||
620 | union { | ||
621 | struct { | ||
622 | __fs32 ui_shadow; /* 0x70 shadow inode with security data */ | ||
623 | __fs32 ui_uid; /* 0x74 long EFT version of uid */ | ||
624 | __fs32 ui_gid; /* 0x78 long EFT version of gid */ | ||
625 | __fs32 ui_oeftflag; /* 0x7c reserved */ | ||
626 | } ui_sun; | ||
627 | struct { | ||
628 | __fs32 ui_uid; /* 0x70 File owner */ | ||
629 | __fs32 ui_gid; /* 0x74 File group */ | ||
630 | __fs32 ui_spare[2]; /* 0x78 reserved */ | ||
631 | } ui_44; | ||
632 | struct { | ||
633 | __fs32 ui_uid; /* 0x70 */ | ||
634 | __fs32 ui_gid; /* 0x74 */ | ||
635 | __fs16 ui_modeh; /* 0x78 mode high bits */ | ||
636 | __fs16 ui_spare; /* 0x7A unused */ | ||
637 | __fs32 ui_trans; /* 0x7c filesystem translator */ | ||
638 | } ui_hurd; | ||
639 | } ui_u3; | ||
640 | }; | ||
641 | |||
642 | #define UFS_NXADDR 2 /* External addresses in inode. */ | ||
643 | struct ufs2_inode { | ||
644 | __fs16 ui_mode; /* 0: IFMT, permissions; see below. */ | ||
645 | __fs16 ui_nlink; /* 2: File link count. */ | ||
646 | __fs32 ui_uid; /* 4: File owner. */ | ||
647 | __fs32 ui_gid; /* 8: File group. */ | ||
648 | __fs32 ui_blksize; /* 12: Inode blocksize. */ | ||
649 | __fs64 ui_size; /* 16: File byte count. */ | ||
650 | __fs64 ui_blocks; /* 24: Bytes actually held. */ | ||
651 | __fs64 ui_atime; /* 32: Last access time. */ | ||
652 | __fs64 ui_mtime; /* 40: Last modified time. */ | ||
653 | __fs64 ui_ctime; /* 48: Last inode change time. */ | ||
654 | __fs64 ui_birthtime; /* 56: Inode creation time. */ | ||
655 | __fs32 ui_mtimensec; /* 64: Last modified time. */ | ||
656 | __fs32 ui_atimensec; /* 68: Last access time. */ | ||
657 | __fs32 ui_ctimensec; /* 72: Last inode change time. */ | ||
658 | __fs32 ui_birthnsec; /* 76: Inode creation time. */ | ||
659 | __fs32 ui_gen; /* 80: Generation number. */ | ||
660 | __fs32 ui_kernflags; /* 84: Kernel flags. */ | ||
661 | __fs32 ui_flags; /* 88: Status flags (chflags). */ | ||
662 | __fs32 ui_extsize; /* 92: External attributes block. */ | ||
663 | __fs64 ui_extb[UFS_NXADDR];/* 96: External attributes block. */ | ||
664 | union { | ||
665 | struct { | ||
666 | __fs64 ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */ | ||
667 | __fs64 ui_ib[UFS_NINDIR];/* 208: Indirect disk blocks.*/ | ||
668 | } ui_addr; | ||
669 | __u8 ui_symlink[2*4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */ | ||
670 | } ui_u2; | ||
671 | __fs64 ui_spare[3]; /* 232: Reserved; currently unused */ | ||
672 | }; | ||
673 | |||
674 | |||
675 | /* FreeBSD has these in sys/stat.h */ | ||
676 | /* ui_flags that can be set by a file owner */ | ||
677 | #define UFS_UF_SETTABLE 0x0000ffff | ||
678 | #define UFS_UF_NODUMP 0x00000001 /* do not dump */ | ||
679 | #define UFS_UF_IMMUTABLE 0x00000002 /* immutable (can't "change") */ | ||
680 | #define UFS_UF_APPEND 0x00000004 /* append-only */ | ||
681 | #define UFS_UF_OPAQUE 0x00000008 /* directory is opaque (unionfs) */ | ||
682 | #define UFS_UF_NOUNLINK 0x00000010 /* can't be removed or renamed */ | ||
683 | /* ui_flags that only root can set */ | ||
684 | #define UFS_SF_SETTABLE 0xffff0000 | ||
685 | #define UFS_SF_ARCHIVED 0x00010000 /* archived */ | ||
686 | #define UFS_SF_IMMUTABLE 0x00020000 /* immutable (can't "change") */ | ||
687 | #define UFS_SF_APPEND 0x00040000 /* append-only */ | ||
688 | #define UFS_SF_NOUNLINK 0x00100000 /* can't be removed or renamed */ | ||
689 | |||
690 | /* | ||
691 | * This structure is used for reading disk structures larger | ||
692 | * than the size of fragment. | ||
693 | */ | ||
694 | struct ufs_buffer_head { | ||
695 | __u64 fragment; /* first fragment */ | ||
696 | __u64 count; /* number of fragments */ | ||
697 | struct buffer_head * bh[UFS_MAXFRAG]; /* buffers */ | ||
698 | }; | ||
699 | |||
700 | struct ufs_cg_private_info { | ||
701 | struct ufs_buffer_head c_ubh; | ||
702 | __u32 c_cgx; /* number of cylidner group */ | ||
703 | __u16 c_ncyl; /* number of cyl's this cg */ | ||
704 | __u16 c_niblk; /* number of inode blocks this cg */ | ||
705 | __u32 c_ndblk; /* number of data blocks this cg */ | ||
706 | __u32 c_rotor; /* position of last used block */ | ||
707 | __u32 c_frotor; /* position of last used frag */ | ||
708 | __u32 c_irotor; /* position of last used inode */ | ||
709 | __u32 c_btotoff; /* (__u32) block totals per cylinder */ | ||
710 | __u32 c_boff; /* (short) free block positions */ | ||
711 | __u32 c_iusedoff; /* (char) used inode map */ | ||
712 | __u32 c_freeoff; /* (u_char) free block map */ | ||
713 | __u32 c_nextfreeoff; /* (u_char) next available space */ | ||
714 | __u32 c_clustersumoff;/* (u_int32) counts of avail clusters */ | ||
715 | __u32 c_clusteroff; /* (u_int8) free cluster map */ | ||
716 | __u32 c_nclusterblks; /* number of clusters this cg */ | ||
717 | }; | ||
718 | |||
719 | |||
720 | struct ufs_sb_private_info { | ||
721 | struct ufs_buffer_head s_ubh; /* buffer containing super block */ | ||
722 | struct ufs_csum_core cs_total; | ||
723 | __u32 s_sblkno; /* offset of super-blocks in filesys */ | ||
724 | __u32 s_cblkno; /* offset of cg-block in filesys */ | ||
725 | __u32 s_iblkno; /* offset of inode-blocks in filesys */ | ||
726 | __u32 s_dblkno; /* offset of first data after cg */ | ||
727 | __u32 s_cgoffset; /* cylinder group offset in cylinder */ | ||
728 | __u32 s_cgmask; /* used to calc mod fs_ntrak */ | ||
729 | __u32 s_size; /* number of blocks (fragments) in fs */ | ||
730 | __u32 s_dsize; /* number of data blocks in fs */ | ||
731 | __u64 s_u2_size; /* ufs2: number of blocks (fragments) in fs */ | ||
732 | __u64 s_u2_dsize; /*ufs2: number of data blocks in fs */ | ||
733 | __u32 s_ncg; /* number of cylinder groups */ | ||
734 | __u32 s_bsize; /* size of basic blocks */ | ||
735 | __u32 s_fsize; /* size of fragments */ | ||
736 | __u32 s_fpb; /* fragments per block */ | ||
737 | __u32 s_minfree; /* minimum percentage of free blocks */ | ||
738 | __u32 s_bmask; /* `blkoff'' calc of blk offsets */ | ||
739 | __u32 s_fmask; /* s_fsize mask */ | ||
740 | __u32 s_bshift; /* `lblkno'' calc of logical blkno */ | ||
741 | __u32 s_fshift; /* s_fsize shift */ | ||
742 | __u32 s_fpbshift; /* fragments per block shift */ | ||
743 | __u32 s_fsbtodb; /* fsbtodb and dbtofsb shift constant */ | ||
744 | __u32 s_sbsize; /* actual size of super block */ | ||
745 | __u32 s_csmask; /* csum block offset */ | ||
746 | __u32 s_csshift; /* csum block number */ | ||
747 | __u32 s_nindir; /* value of NINDIR */ | ||
748 | __u32 s_inopb; /* value of INOPB */ | ||
749 | __u32 s_nspf; /* value of NSPF */ | ||
750 | __u32 s_npsect; /* # sectors/track including spares */ | ||
751 | __u32 s_interleave; /* hardware sector interleave */ | ||
752 | __u32 s_trackskew; /* sector 0 skew, per track */ | ||
753 | __u64 s_csaddr; /* blk addr of cyl grp summary area */ | ||
754 | __u32 s_cssize; /* size of cyl grp summary area */ | ||
755 | __u32 s_cgsize; /* cylinder group size */ | ||
756 | __u32 s_ntrak; /* tracks per cylinder */ | ||
757 | __u32 s_nsect; /* sectors per track */ | ||
758 | __u32 s_spc; /* sectors per cylinder */ | ||
759 | __u32 s_ipg; /* inodes per cylinder group */ | ||
760 | __u32 s_fpg; /* fragments per group */ | ||
761 | __u32 s_cpc; /* cyl per cycle in postbl */ | ||
762 | __s32 s_contigsumsize;/* size of cluster summary array, 44bsd */ | ||
763 | __s64 s_qbmask; /* ~usb_bmask */ | ||
764 | __s64 s_qfmask; /* ~usb_fmask */ | ||
765 | __s32 s_postblformat; /* format of positional layout tables */ | ||
766 | __s32 s_nrpos; /* number of rotational positions */ | ||
767 | __s32 s_postbloff; /* (__s16) rotation block list head */ | ||
768 | __s32 s_rotbloff; /* (__u8) blocks for each rotation */ | ||
769 | |||
770 | __u32 s_fpbmask; /* fragments per block mask */ | ||
771 | __u32 s_apb; /* address per block */ | ||
772 | __u32 s_2apb; /* address per block^2 */ | ||
773 | __u32 s_3apb; /* address per block^3 */ | ||
774 | __u32 s_apbmask; /* address per block mask */ | ||
775 | __u32 s_apbshift; /* address per block shift */ | ||
776 | __u32 s_2apbshift; /* address per block shift * 2 */ | ||
777 | __u32 s_3apbshift; /* address per block shift * 3 */ | ||
778 | __u32 s_nspfshift; /* number of sector per fragment shift */ | ||
779 | __u32 s_nspb; /* number of sector per block */ | ||
780 | __u32 s_inopf; /* inodes per fragment */ | ||
781 | __u32 s_sbbase; /* offset of NeXTstep superblock */ | ||
782 | __u32 s_bpf; /* bits per fragment */ | ||
783 | __u32 s_bpfshift; /* bits per fragment shift*/ | ||
784 | __u32 s_bpfmask; /* bits per fragment mask */ | ||
785 | |||
786 | __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */ | ||
787 | __s32 fs_magic; /* filesystem magic */ | ||
788 | unsigned int s_dirblksize; | ||
789 | }; | ||
790 | |||
791 | /* | ||
792 | * Sizes of this structures are: | ||
793 | * ufs_super_block_first 512 | ||
794 | * ufs_super_block_second 512 | ||
795 | * ufs_super_block_third 356 | ||
796 | */ | ||
797 | struct ufs_super_block_first { | ||
798 | union { | ||
799 | struct { | ||
800 | __fs32 fs_link; /* UNUSED */ | ||
801 | } fs_42; | ||
802 | struct { | ||
803 | __fs32 fs_state; /* file system state flag */ | ||
804 | } fs_sun; | ||
805 | } fs_u0; | ||
806 | __fs32 fs_rlink; | ||
807 | __fs32 fs_sblkno; | ||
808 | __fs32 fs_cblkno; | ||
809 | __fs32 fs_iblkno; | ||
810 | __fs32 fs_dblkno; | ||
811 | __fs32 fs_cgoffset; | ||
812 | __fs32 fs_cgmask; | ||
813 | __fs32 fs_time; | ||
814 | __fs32 fs_size; | ||
815 | __fs32 fs_dsize; | ||
816 | __fs32 fs_ncg; | ||
817 | __fs32 fs_bsize; | ||
818 | __fs32 fs_fsize; | ||
819 | __fs32 fs_frag; | ||
820 | __fs32 fs_minfree; | ||
821 | __fs32 fs_rotdelay; | ||
822 | __fs32 fs_rps; | ||
823 | __fs32 fs_bmask; | ||
824 | __fs32 fs_fmask; | ||
825 | __fs32 fs_bshift; | ||
826 | __fs32 fs_fshift; | ||
827 | __fs32 fs_maxcontig; | ||
828 | __fs32 fs_maxbpg; | ||
829 | __fs32 fs_fragshift; | ||
830 | __fs32 fs_fsbtodb; | ||
831 | __fs32 fs_sbsize; | ||
832 | __fs32 fs_csmask; | ||
833 | __fs32 fs_csshift; | ||
834 | __fs32 fs_nindir; | ||
835 | __fs32 fs_inopb; | ||
836 | __fs32 fs_nspf; | ||
837 | __fs32 fs_optim; | ||
838 | union { | ||
839 | struct { | ||
840 | __fs32 fs_npsect; | ||
841 | } fs_sun; | ||
842 | struct { | ||
843 | __fs32 fs_state; | ||
844 | } fs_sunx86; | ||
845 | } fs_u1; | ||
846 | __fs32 fs_interleave; | ||
847 | __fs32 fs_trackskew; | ||
848 | __fs32 fs_id[2]; | ||
849 | __fs32 fs_csaddr; | ||
850 | __fs32 fs_cssize; | ||
851 | __fs32 fs_cgsize; | ||
852 | __fs32 fs_ntrak; | ||
853 | __fs32 fs_nsect; | ||
854 | __fs32 fs_spc; | ||
855 | __fs32 fs_ncyl; | ||
856 | __fs32 fs_cpg; | ||
857 | __fs32 fs_ipg; | ||
858 | __fs32 fs_fpg; | ||
859 | struct ufs_csum fs_cstotal; | ||
860 | __s8 fs_fmod; | ||
861 | __s8 fs_clean; | ||
862 | __s8 fs_ronly; | ||
863 | __s8 fs_flags; | ||
864 | __s8 fs_fsmnt[UFS_MAXMNTLEN - 212]; | ||
865 | |||
866 | }; | ||
867 | |||
868 | struct ufs_super_block_second { | ||
869 | union { | ||
870 | struct { | ||
871 | __s8 fs_fsmnt[212]; | ||
872 | __fs32 fs_cgrotor; | ||
873 | __fs32 fs_csp[UFS_MAXCSBUFS]; | ||
874 | __fs32 fs_maxcluster; | ||
875 | __fs32 fs_cpc; | ||
876 | __fs16 fs_opostbl[82]; | ||
877 | } fs_u1; | ||
878 | struct { | ||
879 | __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212]; | ||
880 | __u8 fs_volname[UFS2_MAXVOLLEN]; | ||
881 | __fs64 fs_swuid; | ||
882 | __fs32 fs_pad; | ||
883 | __fs32 fs_cgrotor; | ||
884 | __fs32 fs_ocsp[UFS2_NOCSPTRS]; | ||
885 | __fs32 fs_contigdirs; | ||
886 | __fs32 fs_csp; | ||
887 | __fs32 fs_maxcluster; | ||
888 | __fs32 fs_active; | ||
889 | __fs32 fs_old_cpc; | ||
890 | __fs32 fs_maxbsize; | ||
891 | __fs64 fs_sparecon64[17]; | ||
892 | __fs64 fs_sblockloc; | ||
893 | __fs64 cs_ndir; | ||
894 | __fs64 cs_nbfree; | ||
895 | } fs_u2; | ||
896 | } fs_un; | ||
897 | }; | ||
898 | |||
899 | struct ufs_super_block_third { | ||
900 | union { | ||
901 | struct { | ||
902 | __fs16 fs_opostbl[46]; | ||
903 | } fs_u1; | ||
904 | struct { | ||
905 | __fs64 cs_nifree; /* number of free inodes */ | ||
906 | __fs64 cs_nffree; /* number of free frags */ | ||
907 | __fs64 cs_numclusters; /* number of free clusters */ | ||
908 | __fs64 cs_spare[3]; /* future expansion */ | ||
909 | struct ufs_timeval fs_time; /* last time written */ | ||
910 | __fs64 fs_size; /* number of blocks in fs */ | ||
911 | __fs64 fs_dsize; /* number of data blocks in fs */ | ||
912 | __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ | ||
913 | __fs64 fs_pendingblocks;/* blocks in process of being freed */ | ||
914 | __fs32 fs_pendinginodes;/*inodes in process of being freed */ | ||
915 | } __attribute__ ((packed)) fs_u2; | ||
916 | } fs_un1; | ||
917 | union { | ||
918 | struct { | ||
919 | __fs32 fs_sparecon[53];/* reserved for future constants */ | ||
920 | __fs32 fs_reclaim; | ||
921 | __fs32 fs_sparecon2[1]; | ||
922 | __fs32 fs_state; /* file system state time stamp */ | ||
923 | __fs32 fs_qbmask[2]; /* ~usb_bmask */ | ||
924 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ | ||
925 | } fs_sun; | ||
926 | struct { | ||
927 | __fs32 fs_sparecon[53];/* reserved for future constants */ | ||
928 | __fs32 fs_reclaim; | ||
929 | __fs32 fs_sparecon2[1]; | ||
930 | __fs32 fs_npsect; /* # sectors/track including spares */ | ||
931 | __fs32 fs_qbmask[2]; /* ~usb_bmask */ | ||
932 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ | ||
933 | } fs_sunx86; | ||
934 | struct { | ||
935 | __fs32 fs_sparecon[50];/* reserved for future constants */ | ||
936 | __fs32 fs_contigsumsize;/* size of cluster summary array */ | ||
937 | __fs32 fs_maxsymlinklen;/* max length of an internal symlink */ | ||
938 | __fs32 fs_inodefmt; /* format of on-disk inodes */ | ||
939 | __fs32 fs_maxfilesize[2]; /* max representable file size */ | ||
940 | __fs32 fs_qbmask[2]; /* ~usb_bmask */ | ||
941 | __fs32 fs_qfmask[2]; /* ~usb_fmask */ | ||
942 | __fs32 fs_state; /* file system state time stamp */ | ||
943 | } fs_44; | ||
944 | } fs_un2; | ||
945 | __fs32 fs_postblformat; | ||
946 | __fs32 fs_nrpos; | ||
947 | __fs32 fs_postbloff; | ||
948 | __fs32 fs_rotbloff; | ||
949 | __fs32 fs_magic; | ||
950 | __u8 fs_space[1]; | ||
951 | }; | ||
952 | |||
953 | #endif /* __LINUX_UFS_FS_H */ | ||
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 923db99175f2..11232676bfff 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -35,6 +35,7 @@ struct new_utsname { | |||
35 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
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 <asm/atomic.h> | 39 | #include <asm/atomic.h> |
39 | 40 | ||
40 | struct uts_namespace { | 41 | struct uts_namespace { |
@@ -43,6 +44,7 @@ struct uts_namespace { | |||
43 | }; | 44 | }; |
44 | extern struct uts_namespace init_uts_ns; | 45 | extern struct uts_namespace init_uts_ns; |
45 | 46 | ||
47 | #ifdef CONFIG_UTS_NS | ||
46 | static inline void get_uts_ns(struct uts_namespace *ns) | 48 | static inline void get_uts_ns(struct uts_namespace *ns) |
47 | { | 49 | { |
48 | kref_get(&ns->kref); | 50 | kref_get(&ns->kref); |
@@ -56,6 +58,25 @@ static inline void put_uts_ns(struct uts_namespace *ns) | |||
56 | { | 58 | { |
57 | kref_put(&ns->kref, free_uts_ns); | 59 | kref_put(&ns->kref, free_uts_ns); |
58 | } | 60 | } |
61 | #else | ||
62 | static inline void get_uts_ns(struct uts_namespace *ns) | ||
63 | { | ||
64 | } | ||
65 | |||
66 | static inline void put_uts_ns(struct uts_namespace *ns) | ||
67 | { | ||
68 | } | ||
69 | |||
70 | static inline struct uts_namespace *copy_utsname(unsigned long flags, | ||
71 | struct uts_namespace *ns) | ||
72 | { | ||
73 | if (flags & CLONE_NEWUTS) | ||
74 | return ERR_PTR(-EINVAL); | ||
75 | |||
76 | return ns; | ||
77 | } | ||
78 | #endif | ||
79 | |||
59 | static inline struct new_utsname *utsname(void) | 80 | static inline struct new_utsname *utsname(void) |
60 | { | 81 | { |
61 | return ¤t->nsproxy->uts_ns->name; | 82 | return ¤t->nsproxy->uts_ns->name; |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 89338b468d0d..ce8e7da05807 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -45,11 +45,11 @@ extern void *vmalloc_32_user(unsigned long size); | |||
45 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 45 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
46 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, | 46 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, |
47 | pgprot_t prot); | 47 | pgprot_t prot); |
48 | extern void vfree(void *addr); | 48 | extern void vfree(const void *addr); |
49 | 49 | ||
50 | extern void *vmap(struct page **pages, unsigned int count, | 50 | extern void *vmap(struct page **pages, unsigned int count, |
51 | unsigned long flags, pgprot_t prot); | 51 | unsigned long flags, pgprot_t prot); |
52 | extern void vunmap(void *addr); | 52 | extern void vunmap(const void *addr); |
53 | 53 | ||
54 | extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, | 54 | extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, |
55 | unsigned long pgoff); | 55 | unsigned long pgoff); |
@@ -71,7 +71,7 @@ extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | |||
71 | extern struct vm_struct *get_vm_area_node(unsigned long size, | 71 | extern struct vm_struct *get_vm_area_node(unsigned long size, |
72 | unsigned long flags, int node, | 72 | unsigned long flags, int node, |
73 | gfp_t gfp_mask); | 73 | gfp_t gfp_mask); |
74 | extern struct vm_struct *remove_vm_area(void *addr); | 74 | extern struct vm_struct *remove_vm_area(const void *addr); |
75 | 75 | ||
76 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 76 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
77 | struct page ***pages); | 77 | struct page ***pages); |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index feb5e99a1079..9448ffbdcbf6 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -77,6 +77,7 @@ void change_console(struct vc_data *new_vc); | |||
77 | void reset_vc(struct vc_data *vc); | 77 | void reset_vc(struct vc_data *vc); |
78 | extern int unbind_con_driver(const struct consw *csw, int first, int last, | 78 | extern int unbind_con_driver(const struct consw *csw, int first, int last, |
79 | int deflt); | 79 | int deflt); |
80 | int vty_init(void); | ||
80 | 81 | ||
81 | /* | 82 | /* |
82 | * vc_screen.c shares this temporary buffer with the console write code so that | 83 | * vc_screen.c shares this temporary buffer with the console write code so that |
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h new file mode 100644 index 000000000000..9797fec7748a --- /dev/null +++ b/include/linux/w1-gpio.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * w1-gpio interface to platform code | ||
3 | * | ||
4 | * Copyright (C) 2007 Ville Syrjala <syrjala@sci.fi> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 | ||
8 | * as published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef _LINUX_W1_GPIO_H | ||
11 | #define _LINUX_W1_GPIO_H | ||
12 | |||
13 | /** | ||
14 | * struct w1_gpio_platform_data - Platform-dependent data for w1-gpio | ||
15 | * @pin: GPIO pin to use | ||
16 | * @is_open_drain: GPIO pin is configured as open drain | ||
17 | */ | ||
18 | struct w1_gpio_platform_data { | ||
19 | unsigned int pin; | ||
20 | unsigned int is_open_drain:1; | ||
21 | }; | ||
22 | |||
23 | #endif /* _LINUX_W1_GPIO_H */ | ||
diff --git a/include/linux/wait.h b/include/linux/wait.h index 1f4fb0a81ecd..33a2aa9e02f2 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -162,6 +162,22 @@ wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int)); | |||
162 | #define wake_up_interruptible_all(x) __wake_up(x, TASK_INTERRUPTIBLE, 0, NULL) | 162 | #define wake_up_interruptible_all(x) __wake_up(x, TASK_INTERRUPTIBLE, 0, NULL) |
163 | #define wake_up_interruptible_sync(x) __wake_up_sync((x), TASK_INTERRUPTIBLE, 1) | 163 | #define wake_up_interruptible_sync(x) __wake_up_sync((x), TASK_INTERRUPTIBLE, 1) |
164 | 164 | ||
165 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
166 | /* | ||
167 | * macro to avoid include hell | ||
168 | */ | ||
169 | #define wake_up_nested(x, s) \ | ||
170 | do { \ | ||
171 | unsigned long flags; \ | ||
172 | \ | ||
173 | spin_lock_irqsave_nested(&(x)->lock, flags, (s)); \ | ||
174 | wake_up_locked(x); \ | ||
175 | spin_unlock_irqrestore(&(x)->lock, flags); \ | ||
176 | } while (0) | ||
177 | #else | ||
178 | #define wake_up_nested(x, s) wake_up(x) | ||
179 | #endif | ||
180 | |||
165 | #define __wait_event(wq, condition) \ | 181 | #define __wait_event(wq, condition) \ |
166 | do { \ | 182 | do { \ |
167 | DEFINE_WAIT(__wait); \ | 183 | DEFINE_WAIT(__wait); \ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index c6148bbf1250..b7b3362f7717 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -62,6 +62,7 @@ struct writeback_control { | |||
62 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 62 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
63 | unsigned for_writepages:1; /* This is a writepages() call */ | 63 | unsigned for_writepages:1; /* This is a writepages() call */ |
64 | unsigned range_cyclic:1; /* range_start is cyclic */ | 64 | unsigned range_cyclic:1; /* range_start is cyclic */ |
65 | unsigned more_io:1; /* more io to be dispatched */ | ||
65 | }; | 66 | }; |
66 | 67 | ||
67 | /* | 68 | /* |
@@ -100,6 +101,7 @@ extern int dirty_background_ratio; | |||
100 | extern int vm_dirty_ratio; | 101 | extern int vm_dirty_ratio; |
101 | extern int dirty_writeback_interval; | 102 | extern int dirty_writeback_interval; |
102 | extern int dirty_expire_interval; | 103 | extern int dirty_expire_interval; |
104 | extern int vm_highmem_is_dirtyable; | ||
103 | extern int block_dump; | 105 | extern int block_dump; |
104 | extern int laptop_mode; | 106 | extern int laptop_mode; |
105 | 107 | ||
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index def131a5ac70..df6b95d2218e 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -46,6 +46,7 @@ struct xattr_handler { | |||
46 | size_t size, int flags); | 46 | size_t size, int flags); |
47 | }; | 47 | }; |
48 | 48 | ||
49 | ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); | ||
49 | ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); | 50 | ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); |
50 | ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); | 51 | ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); |
51 | int vfs_setxattr(struct dentry *, char *, void *, size_t, int); | 52 | int vfs_setxattr(struct dentry *, char *, void *, size_t, int); |