diff options
Diffstat (limited to 'include')
169 files changed, 3257 insertions, 1869 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 3cd9ccdcbd8f..54508ccea023 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -242,6 +242,8 @@ struct acpi_device_perf { | |||
242 | struct acpi_device_wakeup_flags { | 242 | struct acpi_device_wakeup_flags { |
243 | u8 valid:1; /* Can successfully enable wakeup? */ | 243 | u8 valid:1; /* Can successfully enable wakeup? */ |
244 | u8 run_wake:1; /* Run-Wake GPE devices */ | 244 | u8 run_wake:1; /* Run-Wake GPE devices */ |
245 | u8 always_enabled:1; /* Run-wake devices that are always enabled */ | ||
246 | u8 notifier_present:1; /* Wake-up notify handler has been installed */ | ||
245 | }; | 247 | }; |
246 | 248 | ||
247 | struct acpi_device_wakeup_state { | 249 | struct acpi_device_wakeup_state { |
@@ -256,6 +258,7 @@ struct acpi_device_wakeup { | |||
256 | struct acpi_device_wakeup_state state; | 258 | struct acpi_device_wakeup_state state; |
257 | struct acpi_device_wakeup_flags flags; | 259 | struct acpi_device_wakeup_flags flags; |
258 | int prepare_count; | 260 | int prepare_count; |
261 | int run_wake_count; | ||
259 | }; | 262 | }; |
260 | 263 | ||
261 | /* Device */ | 264 | /* Device */ |
@@ -386,6 +389,9 @@ acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | |||
386 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); | 389 | struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); |
387 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) | 390 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) |
388 | 391 | ||
392 | int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); | ||
393 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); | ||
394 | |||
389 | #ifdef CONFIG_PM_SLEEP | 395 | #ifdef CONFIG_PM_SLEEP |
390 | int acpi_pm_device_sleep_state(struct device *, int *); | 396 | int acpi_pm_device_sleep_state(struct device *, int *); |
391 | int acpi_pm_device_sleep_wake(struct device *, bool); | 397 | int acpi_pm_device_sleep_wake(struct device *, bool); |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index f4906f6568d4..3a4767c01c5f 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -104,6 +104,7 @@ int acpi_pci_bind_root(struct acpi_device *device); | |||
104 | 104 | ||
105 | struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, | 105 | struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, |
106 | int bus); | 106 | int bus); |
107 | void pci_acpi_crs_quirks(void); | ||
107 | 108 | ||
108 | /* -------------------------------------------------------------------------- | 109 | /* -------------------------------------------------------------------------- |
109 | Processor | 110 | Processor |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 86e9735a96bd..3988f93b9c66 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -281,11 +281,11 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); | |||
281 | /* | 281 | /* |
282 | * GPE Interfaces | 282 | * GPE Interfaces |
283 | */ | 283 | */ |
284 | acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type); | 284 | acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action); |
285 | 285 | ||
286 | acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); | 286 | acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type); |
287 | 287 | ||
288 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); | 288 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type); |
289 | 289 | ||
290 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); | 290 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); |
291 | 291 | ||
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 153f12dc3373..73af40863371 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -668,15 +668,16 @@ typedef u32 acpi_event_status; | |||
668 | 668 | ||
669 | /* | 669 | /* |
670 | * GPE info flags - Per GPE | 670 | * GPE info flags - Per GPE |
671 | * +-+-+-+---+---+-+ | 671 | * +-+-+-+---+-+-+-+ |
672 | * |7|6|5|4:3|2:1|0| | 672 | * |7|6|5|4:3|2|1|0| |
673 | * +-+-+-+---+---+-+ | 673 | * +-+-+-+---+-+-+-+ |
674 | * | | | | | | | 674 | * | | | | | | | |
675 | * | | | | | +--- Interrupt type: Edge or Level Triggered | 675 | * | | | | | | +--- Interrupt type: Edge or Level Triggered |
676 | * | | | | +--- Type: Wake-only, Runtime-only, or wake/runtime | 676 | * | | | | | +--- GPE can wake the system |
677 | * | | | | +--- Unused | ||
677 | * | | | +--- Type of dispatch -- to method, handler, or none | 678 | * | | | +--- Type of dispatch -- to method, handler, or none |
678 | * | | +--- Enabled for runtime? | 679 | * | | +--- Unused |
679 | * | +--- Enabled for wake? | 680 | * | +--- Unused |
680 | * +--- Unused | 681 | * +--- Unused |
681 | */ | 682 | */ |
682 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01 | 683 | #define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01 |
@@ -687,22 +688,13 @@ typedef u32 acpi_event_status; | |||
687 | #define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06 | 688 | #define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06 |
688 | #define ACPI_GPE_TYPE_WAKE (u8) 0x02 | 689 | #define ACPI_GPE_TYPE_WAKE (u8) 0x02 |
689 | #define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */ | 690 | #define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */ |
691 | #define ACPI_GPE_CAN_WAKE (u8) 0x02 | ||
690 | 692 | ||
691 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x18 | 693 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x18 |
692 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08 | 694 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08 |
693 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x10 | 695 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x10 |
694 | #define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */ | 696 | #define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */ |
695 | 697 | ||
696 | #define ACPI_GPE_RUN_ENABLE_MASK (u8) 0x20 | ||
697 | #define ACPI_GPE_RUN_ENABLED (u8) 0x20 | ||
698 | #define ACPI_GPE_RUN_DISABLED (u8) 0x00 /* Default */ | ||
699 | |||
700 | #define ACPI_GPE_WAKE_ENABLE_MASK (u8) 0x40 | ||
701 | #define ACPI_GPE_WAKE_ENABLED (u8) 0x40 | ||
702 | #define ACPI_GPE_WAKE_DISABLED (u8) 0x00 /* Default */ | ||
703 | |||
704 | #define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */ | ||
705 | |||
706 | /* | 698 | /* |
707 | * Flags for GPE and Lock interfaces | 699 | * Flags for GPE and Lock interfaces |
708 | */ | 700 | */ |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 9d7febde10a1..09469971472f 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -152,7 +152,7 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) | |||
152 | #include <linux/hardirq.h> | 152 | #include <linux/hardirq.h> |
153 | #define ACPI_PREEMPTION_POINT() \ | 153 | #define ACPI_PREEMPTION_POINT() \ |
154 | do { \ | 154 | do { \ |
155 | if (!in_atomic_preempt_off()) \ | 155 | if (!in_atomic_preempt_off() && !irqs_disabled()) \ |
156 | cond_resched(); \ | 156 | cond_resched(); \ |
157 | } while (0) | 157 | } while (0) |
158 | 158 | ||
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 29245c6b5c0e..0ea5ef4eb6a9 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -224,8 +224,6 @@ struct acpi_processor { | |||
224 | struct acpi_processor_throttling throttling; | 224 | struct acpi_processor_throttling throttling; |
225 | struct acpi_processor_limit limit; | 225 | struct acpi_processor_limit limit; |
226 | struct thermal_cooling_device *cdev; | 226 | struct thermal_cooling_device *cdev; |
227 | /* the _PDC objects for this processor, if any */ | ||
228 | struct acpi_object_list *pdc; | ||
229 | }; | 227 | }; |
230 | 228 | ||
231 | struct acpi_processor_errata { | 229 | struct acpi_processor_errata { |
@@ -257,9 +255,6 @@ int acpi_processor_notify_smm(struct module *calling_module); | |||
257 | DECLARE_PER_CPU(struct acpi_processor *, processors); | 255 | DECLARE_PER_CPU(struct acpi_processor *, processors); |
258 | extern struct acpi_processor_errata errata; | 256 | extern struct acpi_processor_errata errata; |
259 | 257 | ||
260 | void arch_acpi_processor_init_pdc(struct acpi_processor *pr); | ||
261 | void arch_acpi_processor_cleanup_pdc(struct acpi_processor *pr); | ||
262 | |||
263 | #ifdef ARCH_HAS_POWER_INIT | 258 | #ifdef ARCH_HAS_POWER_INIT |
264 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, | 259 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, |
265 | unsigned int cpu); | 260 | unsigned int cpu); |
@@ -325,6 +320,9 @@ static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) | |||
325 | 320 | ||
326 | #endif /* CONFIG_CPU_FREQ */ | 321 | #endif /* CONFIG_CPU_FREQ */ |
327 | 322 | ||
323 | /* in processor_pdc.c */ | ||
324 | void acpi_processor_set_pdc(acpi_handle handle); | ||
325 | |||
328 | /* in processor_throttling.c */ | 326 | /* in processor_throttling.c */ |
329 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | 327 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); |
330 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); | 328 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); |
diff --git a/include/crypto/md5.h b/include/crypto/md5.h new file mode 100644 index 000000000000..65f299b08b0d --- /dev/null +++ b/include/crypto/md5.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _CRYPTO_MD5_H | ||
2 | #define _CRYPTO_MD5_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | #define MD5_DIGEST_SIZE 16 | ||
7 | #define MD5_HMAC_BLOCK_SIZE 64 | ||
8 | #define MD5_BLOCK_WORDS 16 | ||
9 | #define MD5_HASH_WORDS 4 | ||
10 | |||
11 | struct md5_state { | ||
12 | u32 hash[MD5_HASH_WORDS]; | ||
13 | u32 block[MD5_BLOCK_WORDS]; | ||
14 | u64 byte_count; | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/include/crypto/pcrypt.h b/include/crypto/pcrypt.h new file mode 100644 index 000000000000..d7d8bd8c6edc --- /dev/null +++ b/include/crypto/pcrypt.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * pcrypt - Parallel crypto engine. | ||
3 | * | ||
4 | * Copyright (C) 2009 secunet Security Networks AG | ||
5 | * Copyright (C) 2009 Steffen Klassert <steffen.klassert@secunet.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms and conditions of the GNU General Public License, | ||
9 | * version 2, as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _CRYPTO_PCRYPT_H | ||
22 | #define _CRYPTO_PCRYPT_H | ||
23 | |||
24 | #include <linux/crypto.h> | ||
25 | #include <linux/kernel.h> | ||
26 | #include <linux/padata.h> | ||
27 | |||
28 | struct pcrypt_request { | ||
29 | struct padata_priv padata; | ||
30 | void *data; | ||
31 | void *__ctx[] CRYPTO_MINALIGN_ATTR; | ||
32 | }; | ||
33 | |||
34 | static inline void *pcrypt_request_ctx(struct pcrypt_request *req) | ||
35 | { | ||
36 | return req->__ctx; | ||
37 | } | ||
38 | |||
39 | static inline | ||
40 | struct padata_priv *pcrypt_request_padata(struct pcrypt_request *req) | ||
41 | { | ||
42 | return &req->padata; | ||
43 | } | ||
44 | |||
45 | static inline | ||
46 | struct pcrypt_request *pcrypt_padata_request(struct padata_priv *padata) | ||
47 | { | ||
48 | return container_of(padata, struct pcrypt_request, padata); | ||
49 | } | ||
50 | |||
51 | #endif | ||
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 19ef8ebdc662..ffac157fb5b2 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -296,6 +296,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, | |||
296 | #define DRM_MASTER 0x2 | 296 | #define DRM_MASTER 0x2 |
297 | #define DRM_ROOT_ONLY 0x4 | 297 | #define DRM_ROOT_ONLY 0x4 |
298 | #define DRM_CONTROL_ALLOW 0x8 | 298 | #define DRM_CONTROL_ALLOW 0x8 |
299 | #define DRM_UNLOCKED 0x10 | ||
299 | 300 | ||
300 | struct drm_ioctl_desc { | 301 | struct drm_ioctl_desc { |
301 | unsigned int cmd; | 302 | unsigned int cmd; |
@@ -1128,8 +1129,8 @@ static inline int drm_mtrr_del(int handle, unsigned long offset, | |||
1128 | /* Driver support (drm_drv.h) */ | 1129 | /* Driver support (drm_drv.h) */ |
1129 | extern int drm_init(struct drm_driver *driver); | 1130 | extern int drm_init(struct drm_driver *driver); |
1130 | extern void drm_exit(struct drm_driver *driver); | 1131 | extern void drm_exit(struct drm_driver *driver); |
1131 | extern int drm_ioctl(struct inode *inode, struct file *filp, | 1132 | extern long drm_ioctl(struct file *filp, |
1132 | unsigned int cmd, unsigned long arg); | 1133 | unsigned int cmd, unsigned long arg); |
1133 | extern long drm_compat_ioctl(struct file *filp, | 1134 | extern long drm_compat_ioctl(struct file *filp, |
1134 | unsigned int cmd, unsigned long arg); | 1135 | unsigned int cmd, unsigned long arg); |
1135 | extern int drm_lastclose(struct drm_device *dev); | 1136 | extern int drm_lastclose(struct drm_device *dev); |
@@ -1407,7 +1408,7 @@ extern int drm_ati_pcigart_cleanup(struct drm_device *dev, | |||
1407 | struct drm_ati_pcigart_info * gart_info); | 1408 | struct drm_ati_pcigart_info * gart_info); |
1408 | 1409 | ||
1409 | extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, | 1410 | extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, |
1410 | size_t align, dma_addr_t maxaddr); | 1411 | size_t align); |
1411 | extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); | 1412 | extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
1412 | extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); | 1413 | extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
1413 | 1414 | ||
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 43009bc2e757..c5ba1636613c 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h | |||
@@ -85,7 +85,7 @@ struct drm_mode_modeinfo { | |||
85 | __u16 hdisplay, hsync_start, hsync_end, htotal, hskew; | 85 | __u16 hdisplay, hsync_start, hsync_end, htotal, hskew; |
86 | __u16 vdisplay, vsync_start, vsync_end, vtotal, vscan; | 86 | __u16 vdisplay, vsync_start, vsync_end, vtotal, vscan; |
87 | 87 | ||
88 | __u32 vrefresh; /* vertical refresh * 1000 */ | 88 | __u32 vrefresh; |
89 | 89 | ||
90 | __u32 flags; | 90 | __u32 flags; |
91 | __u32 type; | 91 | __u32 type; |
@@ -160,6 +160,7 @@ struct drm_mode_get_encoder { | |||
160 | #define DRM_MODE_CONNECTOR_HDMIA 11 | 160 | #define DRM_MODE_CONNECTOR_HDMIA 11 |
161 | #define DRM_MODE_CONNECTOR_HDMIB 12 | 161 | #define DRM_MODE_CONNECTOR_HDMIB 12 |
162 | #define DRM_MODE_CONNECTOR_TV 13 | 162 | #define DRM_MODE_CONNECTOR_TV 13 |
163 | #define DRM_MODE_CONNECTOR_eDP 14 | ||
163 | 164 | ||
164 | struct drm_mode_get_connector { | 165 | struct drm_mode_get_connector { |
165 | 166 | ||
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index ec3f5e80a5df..b64a8d7cdf6d 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -188,6 +188,7 @@ typedef struct _drm_i915_sarea { | |||
188 | #define DRM_I915_GEM_MADVISE 0x26 | 188 | #define DRM_I915_GEM_MADVISE 0x26 |
189 | #define DRM_I915_OVERLAY_PUT_IMAGE 0x27 | 189 | #define DRM_I915_OVERLAY_PUT_IMAGE 0x27 |
190 | #define DRM_I915_OVERLAY_ATTRS 0x28 | 190 | #define DRM_I915_OVERLAY_ATTRS 0x28 |
191 | #define DRM_I915_GEM_EXECBUFFER2 0x29 | ||
191 | 192 | ||
192 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | 193 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
193 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | 194 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
@@ -207,6 +208,7 @@ typedef struct _drm_i915_sarea { | |||
207 | #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) | 208 | #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) |
208 | #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) | 209 | #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) |
209 | #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) | 210 | #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) |
211 | #define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) | ||
210 | #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) | 212 | #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) |
211 | #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) | 213 | #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) |
212 | #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) | 214 | #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) |
@@ -272,6 +274,7 @@ typedef struct drm_i915_irq_wait { | |||
272 | #define I915_PARAM_NUM_FENCES_AVAIL 6 | 274 | #define I915_PARAM_NUM_FENCES_AVAIL 6 |
273 | #define I915_PARAM_HAS_OVERLAY 7 | 275 | #define I915_PARAM_HAS_OVERLAY 7 |
274 | #define I915_PARAM_HAS_PAGEFLIPPING 8 | 276 | #define I915_PARAM_HAS_PAGEFLIPPING 8 |
277 | #define I915_PARAM_HAS_EXECBUF2 9 | ||
275 | 278 | ||
276 | typedef struct drm_i915_getparam { | 279 | typedef struct drm_i915_getparam { |
277 | int param; | 280 | int param; |
@@ -567,6 +570,57 @@ struct drm_i915_gem_execbuffer { | |||
567 | __u64 cliprects_ptr; | 570 | __u64 cliprects_ptr; |
568 | }; | 571 | }; |
569 | 572 | ||
573 | struct drm_i915_gem_exec_object2 { | ||
574 | /** | ||
575 | * User's handle for a buffer to be bound into the GTT for this | ||
576 | * operation. | ||
577 | */ | ||
578 | __u32 handle; | ||
579 | |||
580 | /** Number of relocations to be performed on this buffer */ | ||
581 | __u32 relocation_count; | ||
582 | /** | ||
583 | * Pointer to array of struct drm_i915_gem_relocation_entry containing | ||
584 | * the relocations to be performed in this buffer. | ||
585 | */ | ||
586 | __u64 relocs_ptr; | ||
587 | |||
588 | /** Required alignment in graphics aperture */ | ||
589 | __u64 alignment; | ||
590 | |||
591 | /** | ||
592 | * Returned value of the updated offset of the object, for future | ||
593 | * presumed_offset writes. | ||
594 | */ | ||
595 | __u64 offset; | ||
596 | |||
597 | #define EXEC_OBJECT_NEEDS_FENCE (1<<0) | ||
598 | __u64 flags; | ||
599 | __u64 rsvd1; | ||
600 | __u64 rsvd2; | ||
601 | }; | ||
602 | |||
603 | struct drm_i915_gem_execbuffer2 { | ||
604 | /** | ||
605 | * List of gem_exec_object2 structs | ||
606 | */ | ||
607 | __u64 buffers_ptr; | ||
608 | __u32 buffer_count; | ||
609 | |||
610 | /** Offset in the batchbuffer to start execution from. */ | ||
611 | __u32 batch_start_offset; | ||
612 | /** Bytes used in batchbuffer from batch_start_offset */ | ||
613 | __u32 batch_len; | ||
614 | __u32 DR1; | ||
615 | __u32 DR4; | ||
616 | __u32 num_cliprects; | ||
617 | /** This is a struct drm_clip_rect *cliprects */ | ||
618 | __u64 cliprects_ptr; | ||
619 | __u64 flags; /* currently unused */ | ||
620 | __u64 rsvd1; | ||
621 | __u64 rsvd2; | ||
622 | }; | ||
623 | |||
570 | struct drm_i915_gem_pin { | 624 | struct drm_i915_gem_pin { |
571 | /** Handle of the buffer to be pinned. */ | 625 | /** Handle of the buffer to be pinned. */ |
572 | __u32 handle; | 626 | __u32 handle; |
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h index 1e67c441ea82..f745948b61e4 100644 --- a/include/drm/nouveau_drm.h +++ b/include/drm/nouveau_drm.h | |||
@@ -77,6 +77,7 @@ struct drm_nouveau_gpuobj_free { | |||
77 | #define NOUVEAU_GETPARAM_PCI_PHYSICAL 10 | 77 | #define NOUVEAU_GETPARAM_PCI_PHYSICAL 10 |
78 | #define NOUVEAU_GETPARAM_CHIPSET_ID 11 | 78 | #define NOUVEAU_GETPARAM_CHIPSET_ID 11 |
79 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 | 79 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 |
80 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 | ||
80 | struct drm_nouveau_getparam { | 81 | struct drm_nouveau_getparam { |
81 | uint64_t param; | 82 | uint64_t param; |
82 | uint64_t value; | 83 | uint64_t value; |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index ff7664e0c3cd..4c4e0f8375b3 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -353,6 +353,11 @@ struct ttm_bo_driver { | |||
353 | /* notify the driver we are taking a fault on this BO | 353 | /* notify the driver we are taking a fault on this BO |
354 | * and have reserved it */ | 354 | * and have reserved it */ |
355 | void (*fault_reserve_notify)(struct ttm_buffer_object *bo); | 355 | void (*fault_reserve_notify)(struct ttm_buffer_object *bo); |
356 | |||
357 | /** | ||
358 | * notify the driver that we're about to swap out this bo | ||
359 | */ | ||
360 | void (*swap_notify) (struct ttm_buffer_object *bo); | ||
356 | }; | 361 | }; |
357 | 362 | ||
358 | /** | 363 | /** |
diff --git a/include/drm/vmwgfx_drm.h b/include/drm/vmwgfx_drm.h index 2be7e1249b6f..c7645f480d12 100644 --- a/include/drm/vmwgfx_drm.h +++ b/include/drm/vmwgfx_drm.h | |||
@@ -68,7 +68,8 @@ | |||
68 | #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1 | 68 | #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1 |
69 | #define DRM_VMW_PARAM_3D 2 | 69 | #define DRM_VMW_PARAM_3D 2 |
70 | #define DRM_VMW_PARAM_FIFO_OFFSET 3 | 70 | #define DRM_VMW_PARAM_FIFO_OFFSET 3 |
71 | 71 | #define DRM_VMW_PARAM_HW_CAPS 4 | |
72 | #define DRM_VMW_PARAM_FIFO_CAPS 5 | ||
72 | 73 | ||
73 | /** | 74 | /** |
74 | * struct drm_vmw_getparam_arg | 75 | * struct drm_vmw_getparam_arg |
@@ -181,6 +182,8 @@ struct drm_vmw_context_arg { | |||
181 | * The size of the array should equal the total number of mipmap levels. | 182 | * The size of the array should equal the total number of mipmap levels. |
182 | * @shareable: Boolean whether other clients (as identified by file descriptors) | 183 | * @shareable: Boolean whether other clients (as identified by file descriptors) |
183 | * may reference this surface. | 184 | * may reference this surface. |
185 | * @scanout: Boolean whether the surface is intended to be used as a | ||
186 | * scanout. | ||
184 | * | 187 | * |
185 | * Input data to the DRM_VMW_CREATE_SURFACE Ioctl. | 188 | * Input data to the DRM_VMW_CREATE_SURFACE Ioctl. |
186 | * Output data from the DRM_VMW_REF_SURFACE Ioctl. | 189 | * Output data from the DRM_VMW_REF_SURFACE Ioctl. |
@@ -192,7 +195,7 @@ struct drm_vmw_surface_create_req { | |||
192 | uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES]; | 195 | uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES]; |
193 | uint64_t size_addr; | 196 | uint64_t size_addr; |
194 | int32_t shareable; | 197 | int32_t shareable; |
195 | uint32_t pad64; | 198 | int32_t scanout; |
196 | }; | 199 | }; |
197 | 200 | ||
198 | /** | 201 | /** |
@@ -295,17 +298,28 @@ union drm_vmw_surface_reference_arg { | |||
295 | * | 298 | * |
296 | * @commands: User-space address of a command buffer cast to an uint64_t. | 299 | * @commands: User-space address of a command buffer cast to an uint64_t. |
297 | * @command-size: Size in bytes of the command buffer. | 300 | * @command-size: Size in bytes of the command buffer. |
301 | * @throttle-us: Sleep until software is less than @throttle_us | ||
302 | * microseconds ahead of hardware. The driver may round this value | ||
303 | * to the nearest kernel tick. | ||
298 | * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an | 304 | * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an |
299 | * uint64_t. | 305 | * uint64_t. |
306 | * @version: Allows expanding the execbuf ioctl parameters without breaking | ||
307 | * backwards compatibility, since user-space will always tell the kernel | ||
308 | * which version it uses. | ||
309 | * @flags: Execbuf flags. None currently. | ||
300 | * | 310 | * |
301 | * Argument to the DRM_VMW_EXECBUF Ioctl. | 311 | * Argument to the DRM_VMW_EXECBUF Ioctl. |
302 | */ | 312 | */ |
303 | 313 | ||
314 | #define DRM_VMW_EXECBUF_VERSION 0 | ||
315 | |||
304 | struct drm_vmw_execbuf_arg { | 316 | struct drm_vmw_execbuf_arg { |
305 | uint64_t commands; | 317 | uint64_t commands; |
306 | uint32_t command_size; | 318 | uint32_t command_size; |
307 | uint32_t pad64; | 319 | uint32_t throttle_us; |
308 | uint64_t fence_rep; | 320 | uint64_t fence_rep; |
321 | uint32_t version; | ||
322 | uint32_t flags; | ||
309 | }; | 323 | }; |
310 | 324 | ||
311 | /** | 325 | /** |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index ce945d4845fc..b926afe8c03e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -80,7 +80,7 @@ char * __acpi_map_table (unsigned long phys_addr, unsigned long size); | |||
80 | void __acpi_unmap_table(char *map, unsigned long size); | 80 | void __acpi_unmap_table(char *map, unsigned long size); |
81 | int early_acpi_boot_init(void); | 81 | int early_acpi_boot_init(void); |
82 | int acpi_boot_init (void); | 82 | int acpi_boot_init (void); |
83 | int acpi_boot_table_init (void); | 83 | void acpi_boot_table_init (void); |
84 | int acpi_mps_check (void); | 84 | int acpi_mps_check (void); |
85 | int acpi_numa_init (void); | 85 | int acpi_numa_init (void); |
86 | 86 | ||
@@ -251,6 +251,7 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n, | |||
251 | void __init acpi_no_s4_hw_signature(void); | 251 | void __init acpi_no_s4_hw_signature(void); |
252 | void __init acpi_old_suspend_ordering(void); | 252 | void __init acpi_old_suspend_ordering(void); |
253 | void __init acpi_s4_no_nvs(void); | 253 | void __init acpi_s4_no_nvs(void); |
254 | void __init acpi_set_sci_en_on_resume(void); | ||
254 | #endif /* CONFIG_PM_SLEEP */ | 255 | #endif /* CONFIG_PM_SLEEP */ |
255 | 256 | ||
256 | struct acpi_osc_context { | 257 | struct acpi_osc_context { |
@@ -320,9 +321,9 @@ static inline int acpi_boot_init(void) | |||
320 | return 0; | 321 | return 0; |
321 | } | 322 | } |
322 | 323 | ||
323 | static inline int acpi_boot_table_init(void) | 324 | static inline void acpi_boot_table_init(void) |
324 | { | 325 | { |
325 | return 0; | 326 | return; |
326 | } | 327 | } |
327 | 328 | ||
328 | static inline int acpi_mps_check(void) | 329 | static inline int acpi_mps_check(void) |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index ab94335b4bb9..6816be6c3f77 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -1,5 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm-arm/hardware/amba.h | 2 | * linux/include/amba/bus.h |
3 | * | ||
4 | * This device type deals with ARM PrimeCells and anything else that | ||
5 | * presents a proper CID (0xB105F00D) at the end of the I/O register | ||
6 | * region or that is derived from a PrimeCell. | ||
3 | * | 7 | * |
4 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. | 8 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. |
5 | * | 9 | * |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 38a6948ce0c2..20f31567ccee 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -647,9 +647,9 @@ static inline int ata_id_has_large_logical_sectors(const u16 *id) | |||
647 | return id[ATA_ID_SECTOR_SIZE] & (1 << 13); | 647 | return id[ATA_ID_SECTOR_SIZE] & (1 << 13); |
648 | } | 648 | } |
649 | 649 | ||
650 | static inline u8 ata_id_logical_per_physical_sectors(const u16 *id) | 650 | static inline u16 ata_id_logical_per_physical_sectors(const u16 *id) |
651 | { | 651 | { |
652 | return id[ATA_ID_SECTOR_SIZE] & 0xf; | 652 | return 1 << (id[ATA_ID_SECTOR_SIZE] & 0xf); |
653 | } | 653 | } |
654 | 654 | ||
655 | static inline int ata_id_has_lba48(const u16 *id) | 655 | static inline int ata_id_has_lba48(const u16 *id) |
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 0f5f57858a23..8c4f884db6b4 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
@@ -36,18 +36,18 @@ struct backlight_device; | |||
36 | struct fb_info; | 36 | struct fb_info; |
37 | 37 | ||
38 | struct backlight_ops { | 38 | struct backlight_ops { |
39 | unsigned int options; | 39 | const unsigned int options; |
40 | 40 | ||
41 | #define BL_CORE_SUSPENDRESUME (1 << 0) | 41 | #define BL_CORE_SUSPENDRESUME (1 << 0) |
42 | 42 | ||
43 | /* Notify the backlight driver some property has changed */ | 43 | /* Notify the backlight driver some property has changed */ |
44 | int (*update_status)(struct backlight_device *); | 44 | int (* const update_status)(struct backlight_device *); |
45 | /* Return the current backlight brightness (accounting for power, | 45 | /* Return the current backlight brightness (accounting for power, |
46 | fb_blank etc.) */ | 46 | fb_blank etc.) */ |
47 | int (*get_brightness)(struct backlight_device *); | 47 | int (* const get_brightness)(struct backlight_device *); |
48 | /* Check if given framebuffer device is the one bound to this backlight; | 48 | /* Check if given framebuffer device is the one bound to this backlight; |
49 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ | 49 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ |
50 | int (*check_fb)(struct fb_info *); | 50 | int (* const check_fb)(struct fb_info *); |
51 | }; | 51 | }; |
52 | 52 | ||
53 | /* This structure defines all the properties of a backlight */ | 53 | /* This structure defines all the properties of a backlight */ |
@@ -86,7 +86,7 @@ struct backlight_device { | |||
86 | registered this device has been unloaded, and if class_get_devdata() | 86 | registered this device has been unloaded, and if class_get_devdata() |
87 | points to something in the body of that driver, it is also invalid. */ | 87 | points to something in the body of that driver, it is also invalid. */ |
88 | struct mutex ops_lock; | 88 | struct mutex ops_lock; |
89 | struct backlight_ops *ops; | 89 | const struct backlight_ops *ops; |
90 | 90 | ||
91 | /* The framebuffer notifier block */ | 91 | /* The framebuffer notifier block */ |
92 | struct notifier_block fb_notif; | 92 | struct notifier_block fb_notif; |
@@ -103,7 +103,7 @@ static inline void backlight_update_status(struct backlight_device *bd) | |||
103 | } | 103 | } |
104 | 104 | ||
105 | extern struct backlight_device *backlight_device_register(const char *name, | 105 | extern struct backlight_device *backlight_device_register(const char *name, |
106 | struct device *dev, void *devdata, struct backlight_ops *ops); | 106 | struct device *dev, void *devdata, const struct backlight_ops *ops); |
107 | extern void backlight_device_unregister(struct backlight_device *bd); | 107 | extern void backlight_device_unregister(struct backlight_device *bd); |
108 | extern void backlight_force_update(struct backlight_device *bd, | 108 | extern void backlight_force_update(struct backlight_device *bd, |
109 | enum backlight_update_reason reason); | 109 | enum backlight_update_reason reason); |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index aece486ac734..89c6249fc561 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -68,6 +68,14 @@ struct linux_binprm{ | |||
68 | 68 | ||
69 | #define BINPRM_MAX_RECURSION 4 | 69 | #define BINPRM_MAX_RECURSION 4 |
70 | 70 | ||
71 | /* Function parameter for binfmt->coredump */ | ||
72 | struct coredump_params { | ||
73 | long signr; | ||
74 | struct pt_regs *regs; | ||
75 | struct file *file; | ||
76 | unsigned long limit; | ||
77 | }; | ||
78 | |||
71 | /* | 79 | /* |
72 | * This structure defines the functions that are used to load the binary formats that | 80 | * This structure defines the functions that are used to load the binary formats that |
73 | * linux accepts. | 81 | * linux accepts. |
@@ -77,7 +85,7 @@ struct linux_binfmt { | |||
77 | struct module *module; | 85 | struct module *module; |
78 | int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); | 86 | int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); |
79 | int (*load_shlib)(struct file *); | 87 | int (*load_shlib)(struct file *); |
80 | int (*core_dump)(long signr, struct pt_regs *regs, struct file *file, unsigned long limit); | 88 | int (*core_dump)(struct coredump_params *cprm); |
81 | unsigned long min_coredump; /* minimal dump size */ | 89 | unsigned long min_coredump; /* minimal dump size */ |
82 | int hasvdso; | 90 | int hasvdso; |
83 | }; | 91 | }; |
@@ -101,6 +109,7 @@ extern int prepare_binprm(struct linux_binprm *); | |||
101 | extern int __must_check remove_arg_zero(struct linux_binprm *); | 109 | extern int __must_check remove_arg_zero(struct linux_binprm *); |
102 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); | 110 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); |
103 | extern int flush_old_exec(struct linux_binprm * bprm); | 111 | extern int flush_old_exec(struct linux_binprm * bprm); |
112 | extern void setup_new_exec(struct linux_binprm * bprm); | ||
104 | 113 | ||
105 | extern int suid_dumpable; | 114 | extern int suid_dumpable; |
106 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ | 115 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index c05a29cb9bb2..25b8b2f33ae9 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -25,7 +25,7 @@ | |||
25 | static __inline__ int get_bitmask_order(unsigned int count) | 25 | static __inline__ int get_bitmask_order(unsigned int count) |
26 | { | 26 | { |
27 | int order; | 27 | int order; |
28 | 28 | ||
29 | order = fls(count); | 29 | order = fls(count); |
30 | return order; /* We could be slightly more clever with -1 here... */ | 30 | return order; /* We could be slightly more clever with -1 here... */ |
31 | } | 31 | } |
@@ -33,7 +33,7 @@ static __inline__ int get_bitmask_order(unsigned int count) | |||
33 | static __inline__ int get_count_order(unsigned int count) | 33 | static __inline__ int get_count_order(unsigned int count) |
34 | { | 34 | { |
35 | int order; | 35 | int order; |
36 | 36 | ||
37 | order = fls(count) - 1; | 37 | order = fls(count) - 1; |
38 | if (count & (count - 1)) | 38 | if (count & (count - 1)) |
39 | order++; | 39 | order++; |
@@ -45,6 +45,31 @@ static inline unsigned long hweight_long(unsigned long w) | |||
45 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); | 45 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); |
46 | } | 46 | } |
47 | 47 | ||
48 | /* | ||
49 | * Clearly slow versions of the hweightN() functions, their benefit is | ||
50 | * of course compile time evaluation of constant arguments. | ||
51 | */ | ||
52 | #define HWEIGHT8(w) \ | ||
53 | ( BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + \ | ||
54 | (!!((w) & (1ULL << 0))) + \ | ||
55 | (!!((w) & (1ULL << 1))) + \ | ||
56 | (!!((w) & (1ULL << 2))) + \ | ||
57 | (!!((w) & (1ULL << 3))) + \ | ||
58 | (!!((w) & (1ULL << 4))) + \ | ||
59 | (!!((w) & (1ULL << 5))) + \ | ||
60 | (!!((w) & (1ULL << 6))) + \ | ||
61 | (!!((w) & (1ULL << 7))) ) | ||
62 | |||
63 | #define HWEIGHT16(w) (HWEIGHT8(w) + HWEIGHT8((w) >> 8)) | ||
64 | #define HWEIGHT32(w) (HWEIGHT16(w) + HWEIGHT16((w) >> 16)) | ||
65 | #define HWEIGHT64(w) (HWEIGHT32(w) + HWEIGHT32((w) >> 32)) | ||
66 | |||
67 | /* | ||
68 | * Type invariant version that simply casts things to the | ||
69 | * largest type. | ||
70 | */ | ||
71 | #define HWEIGHT(w) HWEIGHT64((u64)(w)) | ||
72 | |||
48 | /** | 73 | /** |
49 | * rol32 - rotate a 32-bit value left | 74 | * rol32 - rotate a 32-bit value left |
50 | * @word: value to rotate | 75 | * @word: value to rotate |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 784a919aa0d0..1896e868854f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -461,8 +461,7 @@ struct request_queue | |||
461 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 461 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
462 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 462 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
463 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 463 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ |
464 | #define QUEUE_FLAG_CQ 16 /* hardware does queuing */ | 464 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ |
465 | #define QUEUE_FLAG_DISCARD 17 /* supports DISCARD */ | ||
466 | 465 | ||
467 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 466 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
468 | (1 << QUEUE_FLAG_CLUSTER) | \ | 467 | (1 << QUEUE_FLAG_CLUSTER) | \ |
@@ -586,7 +585,6 @@ enum { | |||
586 | 585 | ||
587 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | 586 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) |
588 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 587 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
589 | #define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags) | ||
590 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 588 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
591 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 589 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
592 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | 590 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) |
@@ -845,7 +843,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev) | |||
845 | * blk_rq_err_bytes() : bytes left till the next error boundary | 843 | * blk_rq_err_bytes() : bytes left till the next error boundary |
846 | * blk_rq_sectors() : sectors left in the entire request | 844 | * blk_rq_sectors() : sectors left in the entire request |
847 | * blk_rq_cur_sectors() : sectors left in the current segment | 845 | * blk_rq_cur_sectors() : sectors left in the current segment |
848 | * blk_rq_err_sectors() : sectors left till the next error boundary | ||
849 | */ | 846 | */ |
850 | static inline sector_t blk_rq_pos(const struct request *rq) | 847 | static inline sector_t blk_rq_pos(const struct request *rq) |
851 | { | 848 | { |
@@ -874,11 +871,6 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) | |||
874 | return blk_rq_cur_bytes(rq) >> 9; | 871 | return blk_rq_cur_bytes(rq) >> 9; |
875 | } | 872 | } |
876 | 873 | ||
877 | static inline unsigned int blk_rq_err_sectors(const struct request *rq) | ||
878 | { | ||
879 | return blk_rq_err_bytes(rq) >> 9; | ||
880 | } | ||
881 | |||
882 | /* | 874 | /* |
883 | * Request issue related functions. | 875 | * Request issue related functions. |
884 | */ | 876 | */ |
@@ -944,6 +936,8 @@ extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); | |||
944 | extern void blk_set_default_limits(struct queue_limits *lim); | 936 | extern void blk_set_default_limits(struct queue_limits *lim); |
945 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | 937 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, |
946 | sector_t offset); | 938 | sector_t offset); |
939 | extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev, | ||
940 | sector_t offset); | ||
947 | extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, | 941 | extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, |
948 | sector_t offset); | 942 | sector_t offset); |
949 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); | 943 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); |
@@ -1116,11 +1110,18 @@ static inline int queue_alignment_offset(struct request_queue *q) | |||
1116 | return q->limits.alignment_offset; | 1110 | return q->limits.alignment_offset; |
1117 | } | 1111 | } |
1118 | 1112 | ||
1113 | static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t offset) | ||
1114 | { | ||
1115 | unsigned int granularity = max(lim->physical_block_size, lim->io_min); | ||
1116 | |||
1117 | offset &= granularity - 1; | ||
1118 | return (granularity + lim->alignment_offset - offset) & (granularity - 1); | ||
1119 | } | ||
1120 | |||
1119 | static inline int queue_sector_alignment_offset(struct request_queue *q, | 1121 | static inline int queue_sector_alignment_offset(struct request_queue *q, |
1120 | sector_t sector) | 1122 | sector_t sector) |
1121 | { | 1123 | { |
1122 | return ((sector << 9) - q->limits.alignment_offset) | 1124 | return queue_limit_alignment_offset(&q->limits, sector << 9); |
1123 | & (q->limits.io_min - 1); | ||
1124 | } | 1125 | } |
1125 | 1126 | ||
1126 | static inline int bdev_alignment_offset(struct block_device *bdev) | 1127 | static inline int bdev_alignment_offset(struct block_device *bdev) |
@@ -1147,8 +1148,11 @@ static inline int queue_discard_alignment(struct request_queue *q) | |||
1147 | static inline int queue_sector_discard_alignment(struct request_queue *q, | 1148 | static inline int queue_sector_discard_alignment(struct request_queue *q, |
1148 | sector_t sector) | 1149 | sector_t sector) |
1149 | { | 1150 | { |
1150 | return ((sector << 9) - q->limits.discard_alignment) | 1151 | struct queue_limits *lim = &q->limits; |
1151 | & (q->limits.discard_granularity - 1); | 1152 | unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); |
1153 | |||
1154 | return (lim->discard_granularity + lim->discard_alignment - alignment) | ||
1155 | & (lim->discard_granularity - 1); | ||
1152 | } | 1156 | } |
1153 | 1157 | ||
1154 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) | 1158 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 0008dee66514..c9bbcb2a75ae 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -28,6 +28,7 @@ struct css_id; | |||
28 | extern int cgroup_init_early(void); | 28 | extern int cgroup_init_early(void); |
29 | extern int cgroup_init(void); | 29 | extern int cgroup_init(void); |
30 | extern void cgroup_lock(void); | 30 | extern void cgroup_lock(void); |
31 | extern int cgroup_lock_is_held(void); | ||
31 | extern bool cgroup_lock_live_group(struct cgroup *cgrp); | 32 | extern bool cgroup_lock_live_group(struct cgroup *cgrp); |
32 | extern void cgroup_unlock(void); | 33 | extern void cgroup_unlock(void); |
33 | extern void cgroup_fork(struct task_struct *p); | 34 | extern void cgroup_fork(struct task_struct *p); |
@@ -486,7 +487,9 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( | |||
486 | static inline struct cgroup_subsys_state *task_subsys_state( | 487 | static inline struct cgroup_subsys_state *task_subsys_state( |
487 | struct task_struct *task, int subsys_id) | 488 | struct task_struct *task, int subsys_id) |
488 | { | 489 | { |
489 | return rcu_dereference(task->cgroups->subsys[subsys_id]); | 490 | return rcu_dereference_check(task->cgroups->subsys[subsys_id], |
491 | rcu_read_lock_held() || | ||
492 | cgroup_lock_is_held()); | ||
490 | } | 493 | } |
491 | 494 | ||
492 | static inline struct cgroup* task_cgroup(struct task_struct *task, | 495 | static inline struct cgroup* task_cgroup(struct task_struct *task, |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5be3dab4a695..188fcae10a99 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -15,6 +15,7 @@ | |||
15 | # define __acquire(x) __context__(x,1) | 15 | # define __acquire(x) __context__(x,1) |
16 | # define __release(x) __context__(x,-1) | 16 | # define __release(x) __context__(x,-1) |
17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) | 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) |
18 | # define __percpu __attribute__((noderef, address_space(3))) | ||
18 | extern void __chk_user_ptr(const volatile void __user *); | 19 | extern void __chk_user_ptr(const volatile void __user *); |
19 | extern void __chk_io_ptr(const volatile void __iomem *); | 20 | extern void __chk_io_ptr(const volatile void __iomem *); |
20 | #else | 21 | #else |
@@ -32,6 +33,7 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
32 | # define __acquire(x) (void)0 | 33 | # define __acquire(x) (void)0 |
33 | # define __release(x) (void)0 | 34 | # define __release(x) (void)0 |
34 | # define __cond_lock(x,c) (c) | 35 | # define __cond_lock(x,c) (c) |
36 | # define __percpu | ||
35 | #endif | 37 | #endif |
36 | 38 | ||
37 | #ifdef __KERNEL__ | 39 | #ifdef __KERNEL__ |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 72ba63eb83c5..3a779ffba60b 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -24,9 +24,6 @@ | |||
24 | 24 | ||
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | 26 | ||
27 | #define CN_IDX_CONNECTOR 0xffffffff | ||
28 | #define CN_VAL_CONNECTOR 0xffffffff | ||
29 | |||
30 | /* | 27 | /* |
31 | * Process Events connector unique ids -- used for message routing | 28 | * Process Events connector unique ids -- used for message routing |
32 | */ | 29 | */ |
@@ -75,30 +72,6 @@ struct cn_msg { | |||
75 | __u8 data[0]; | 72 | __u8 data[0]; |
76 | }; | 73 | }; |
77 | 74 | ||
78 | /* | ||
79 | * Notify structure - requests notification about | ||
80 | * registering/unregistering idx/val in range [first, first+range]. | ||
81 | */ | ||
82 | struct cn_notify_req { | ||
83 | __u32 first; | ||
84 | __u32 range; | ||
85 | }; | ||
86 | |||
87 | /* | ||
88 | * Main notification control message | ||
89 | * *_notify_num - number of appropriate cn_notify_req structures after | ||
90 | * this struct. | ||
91 | * group - notification receiver's idx. | ||
92 | * len - total length of the attached data. | ||
93 | */ | ||
94 | struct cn_ctl_msg { | ||
95 | __u32 idx_notify_num; | ||
96 | __u32 val_notify_num; | ||
97 | __u32 group; | ||
98 | __u32 len; | ||
99 | __u8 data[0]; | ||
100 | }; | ||
101 | |||
102 | #ifdef __KERNEL__ | 75 | #ifdef __KERNEL__ |
103 | 76 | ||
104 | #include <asm/atomic.h> | 77 | #include <asm/atomic.h> |
@@ -151,11 +124,6 @@ struct cn_callback_entry { | |||
151 | u32 seq, group; | 124 | u32 seq, group; |
152 | }; | 125 | }; |
153 | 126 | ||
154 | struct cn_ctl_entry { | ||
155 | struct list_head notify_entry; | ||
156 | struct cn_ctl_msg *msg; | ||
157 | }; | ||
158 | |||
159 | struct cn_dev { | 127 | struct cn_dev { |
160 | struct cb_id id; | 128 | struct cb_id id; |
161 | 129 | ||
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index d77b54733c5b..dbcee7647d9a 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -143,6 +143,8 @@ static inline unsigned int cpumask_any_but(const struct cpumask *mask, | |||
143 | 143 | ||
144 | #define for_each_cpu(cpu, mask) \ | 144 | #define for_each_cpu(cpu, mask) \ |
145 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | 145 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) |
146 | #define for_each_cpu_not(cpu, mask) \ | ||
147 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
146 | #define for_each_cpu_and(cpu, mask, and) \ | 148 | #define for_each_cpu_and(cpu, mask, and) \ |
147 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) | 149 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) |
148 | #else | 150 | #else |
@@ -203,6 +205,18 @@ int cpumask_any_but(const struct cpumask *mask, unsigned int cpu); | |||
203 | (cpu) < nr_cpu_ids;) | 205 | (cpu) < nr_cpu_ids;) |
204 | 206 | ||
205 | /** | 207 | /** |
208 | * for_each_cpu_not - iterate over every cpu in a complemented mask | ||
209 | * @cpu: the (optionally unsigned) integer iterator | ||
210 | * @mask: the cpumask pointer | ||
211 | * | ||
212 | * After the loop, cpu is >= nr_cpu_ids. | ||
213 | */ | ||
214 | #define for_each_cpu_not(cpu, mask) \ | ||
215 | for ((cpu) = -1; \ | ||
216 | (cpu) = cpumask_next_zero((cpu), (mask)), \ | ||
217 | (cpu) < nr_cpu_ids;) | ||
218 | |||
219 | /** | ||
206 | * for_each_cpu_and - iterate over every cpu in both masks | 220 | * for_each_cpu_and - iterate over every cpu in both masks |
207 | * @cpu: the (optionally unsigned) integer iterator | 221 | * @cpu: the (optionally unsigned) integer iterator |
208 | * @mask: the first cpumask pointer | 222 | * @mask: the first cpumask pointer |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 4e3387a89cb9..4db09f89b637 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -280,7 +280,7 @@ static inline void put_cred(const struct cred *_cred) | |||
280 | * task or by holding tasklist_lock to prevent it from being unlinked. | 280 | * task or by holding tasklist_lock to prevent it from being unlinked. |
281 | */ | 281 | */ |
282 | #define __task_cred(task) \ | 282 | #define __task_cred(task) \ |
283 | ((const struct cred *)(rcu_dereference((task)->real_cred))) | 283 | ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_is_held(&tasklist_lock)))) |
284 | 284 | ||
285 | /** | 285 | /** |
286 | * get_task_cred - Get another task's objective credentials | 286 | * get_task_cred - Get another task's objective credentials |
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index 12ff8c3f1d05..5032b9a31ae7 100644 --- a/include/linux/decompress/mm.h +++ b/include/linux/decompress/mm.h | |||
@@ -25,7 +25,7 @@ static void *malloc(int size) | |||
25 | void *p; | 25 | void *p; |
26 | 26 | ||
27 | if (size < 0) | 27 | if (size < 0) |
28 | error("Malloc error"); | 28 | return NULL; |
29 | if (!malloc_ptr) | 29 | if (!malloc_ptr) |
30 | malloc_ptr = free_mem_ptr; | 30 | malloc_ptr = free_mem_ptr; |
31 | 31 | ||
@@ -35,7 +35,7 @@ static void *malloc(int size) | |||
35 | malloc_ptr += size; | 35 | malloc_ptr += size; |
36 | 36 | ||
37 | if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr) | 37 | if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr) |
38 | error("Out of memory"); | 38 | return NULL; |
39 | 39 | ||
40 | malloc_count++; | 40 | malloc_count++; |
41 | return p; | 41 | return p; |
diff --git a/include/linux/decompress/unlzo.h b/include/linux/decompress/unlzo.h new file mode 100644 index 000000000000..987229752519 --- /dev/null +++ b/include/linux/decompress/unlzo.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef DECOMPRESS_UNLZO_H | ||
2 | #define DECOMPRESS_UNLZO_H | ||
3 | |||
4 | int unlzo(unsigned char *inbuf, int len, | ||
5 | int(*fill)(void*, unsigned int), | ||
6 | int(*flush)(void*, unsigned int), | ||
7 | unsigned char *output, | ||
8 | int *pos, | ||
9 | void(*error)(char *x)); | ||
10 | #endif | ||
diff --git a/include/linux/device.h b/include/linux/device.h index 2a73d9bcbc9c..b30527db3ac0 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -166,9 +166,9 @@ struct driver_attribute driver_attr_##_name = \ | |||
166 | __ATTR(_name, _mode, _show, _store) | 166 | __ATTR(_name, _mode, _show, _store) |
167 | 167 | ||
168 | extern int __must_check driver_create_file(struct device_driver *driver, | 168 | extern int __must_check driver_create_file(struct device_driver *driver, |
169 | struct driver_attribute *attr); | 169 | const struct driver_attribute *attr); |
170 | extern void driver_remove_file(struct device_driver *driver, | 170 | extern void driver_remove_file(struct device_driver *driver, |
171 | struct driver_attribute *attr); | 171 | const struct driver_attribute *attr); |
172 | 172 | ||
173 | extern int __must_check driver_add_kobj(struct device_driver *drv, | 173 | extern int __must_check driver_add_kobj(struct device_driver *drv, |
174 | struct kobject *kobj, | 174 | struct kobject *kobj, |
@@ -319,13 +319,13 @@ struct device_attribute { | |||
319 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) | 319 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) |
320 | 320 | ||
321 | extern int __must_check device_create_file(struct device *device, | 321 | extern int __must_check device_create_file(struct device *device, |
322 | struct device_attribute *entry); | 322 | const struct device_attribute *entry); |
323 | extern void device_remove_file(struct device *dev, | 323 | extern void device_remove_file(struct device *dev, |
324 | struct device_attribute *attr); | 324 | const struct device_attribute *attr); |
325 | extern int __must_check device_create_bin_file(struct device *dev, | 325 | extern int __must_check device_create_bin_file(struct device *dev, |
326 | struct bin_attribute *attr); | 326 | const struct bin_attribute *attr); |
327 | extern void device_remove_bin_file(struct device *dev, | 327 | extern void device_remove_bin_file(struct device *dev, |
328 | struct bin_attribute *attr); | 328 | const struct bin_attribute *attr); |
329 | extern int device_schedule_callback_owner(struct device *dev, | 329 | extern int device_schedule_callback_owner(struct device *dev, |
330 | void (*func)(struct device *dev), struct module *owner); | 330 | void (*func)(struct device *dev), struct module *owner); |
331 | 331 | ||
@@ -472,6 +472,23 @@ static inline int device_is_registered(struct device *dev) | |||
472 | return dev->kobj.state_in_sysfs; | 472 | return dev->kobj.state_in_sysfs; |
473 | } | 473 | } |
474 | 474 | ||
475 | static inline void device_enable_async_suspend(struct device *dev) | ||
476 | { | ||
477 | if (dev->power.status == DPM_ON) | ||
478 | dev->power.async_suspend = true; | ||
479 | } | ||
480 | |||
481 | static inline void device_disable_async_suspend(struct device *dev) | ||
482 | { | ||
483 | if (dev->power.status == DPM_ON) | ||
484 | dev->power.async_suspend = false; | ||
485 | } | ||
486 | |||
487 | static inline bool device_async_suspend_enabled(struct device *dev) | ||
488 | { | ||
489 | return !!dev->power.async_suspend; | ||
490 | } | ||
491 | |||
475 | void driver_init(void); | 492 | void driver_init(void); |
476 | 493 | ||
477 | /* | 494 | /* |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index e84f4733cb55..78962272338a 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -53,7 +53,7 @@ | |||
53 | 53 | ||
54 | 54 | ||
55 | extern const char *drbd_buildtag(void); | 55 | extern const char *drbd_buildtag(void); |
56 | #define REL_VERSION "8.3.6" | 56 | #define REL_VERSION "8.3.7" |
57 | #define API_VERSION 88 | 57 | #define API_VERSION 88 |
58 | #define PRO_VERSION_MIN 86 | 58 | #define PRO_VERSION_MIN 86 |
59 | #define PRO_VERSION_MAX 91 | 59 | #define PRO_VERSION_MAX 91 |
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h index db5721ad50d1..a4d82f895994 100644 --- a/include/linux/drbd_nl.h +++ b/include/linux/drbd_nl.h | |||
@@ -69,6 +69,7 @@ NL_PACKET(disconnect, 6, ) | |||
69 | 69 | ||
70 | NL_PACKET(resize, 7, | 70 | NL_PACKET(resize, 7, |
71 | NL_INT64( 29, T_MAY_IGNORE, resize_size) | 71 | NL_INT64( 29, T_MAY_IGNORE, resize_size) |
72 | NL_BIT( 68, T_MAY_IGNORE, resize_force) | ||
72 | ) | 73 | ) |
73 | 74 | ||
74 | NL_PACKET(syncer_conf, 8, | 75 | NL_PACKET(syncer_conf, 8, |
diff --git a/include/linux/dst.h b/include/linux/dst.h deleted file mode 100644 index e26fed84b1aa..000000000000 --- a/include/linux/dst.h +++ /dev/null | |||
@@ -1,587 +0,0 @@ | |||
1 | /* | ||
2 | * 2007+ Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef __DST_H | ||
17 | #define __DST_H | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | #include <linux/connector.h> | ||
21 | |||
22 | #define DST_NAMELEN 32 | ||
23 | #define DST_NAME "dst" | ||
24 | |||
25 | enum { | ||
26 | /* Remove node with given id from storage */ | ||
27 | DST_DEL_NODE = 0, | ||
28 | /* Add remote node with given id to the storage */ | ||
29 | DST_ADD_REMOTE, | ||
30 | /* Add local node with given id to the storage to be exported and used by remote peers */ | ||
31 | DST_ADD_EXPORT, | ||
32 | /* Crypto initialization command (hash/cipher used to protect the connection) */ | ||
33 | DST_CRYPTO, | ||
34 | /* Security attributes for given connection (permissions for example) */ | ||
35 | DST_SECURITY, | ||
36 | /* Register given node in the block layer subsystem */ | ||
37 | DST_START, | ||
38 | DST_CMD_MAX | ||
39 | }; | ||
40 | |||
41 | struct dst_ctl | ||
42 | { | ||
43 | /* Storage name */ | ||
44 | char name[DST_NAMELEN]; | ||
45 | /* Command flags */ | ||
46 | __u32 flags; | ||
47 | /* Command itself (see above) */ | ||
48 | __u32 cmd; | ||
49 | /* Maximum number of pages per single request in this device */ | ||
50 | __u32 max_pages; | ||
51 | /* Stale/error transaction scanning timeout in milliseconds */ | ||
52 | __u32 trans_scan_timeout; | ||
53 | /* Maximum number of retry sends before completing transaction as broken */ | ||
54 | __u32 trans_max_retries; | ||
55 | /* Storage size */ | ||
56 | __u64 size; | ||
57 | }; | ||
58 | |||
59 | /* Reply command carries completion status */ | ||
60 | struct dst_ctl_ack | ||
61 | { | ||
62 | struct cn_msg msg; | ||
63 | int error; | ||
64 | int unused[3]; | ||
65 | }; | ||
66 | |||
67 | /* | ||
68 | * Unfortunaltely socket address structure is not exported to userspace | ||
69 | * and is redefined there. | ||
70 | */ | ||
71 | #define SADDR_MAX_DATA 128 | ||
72 | |||
73 | struct saddr { | ||
74 | /* address family, AF_xxx */ | ||
75 | unsigned short sa_family; | ||
76 | /* 14 bytes of protocol address */ | ||
77 | char sa_data[SADDR_MAX_DATA]; | ||
78 | /* Number of bytes used in sa_data */ | ||
79 | unsigned short sa_data_len; | ||
80 | }; | ||
81 | |||
82 | /* Address structure */ | ||
83 | struct dst_network_ctl | ||
84 | { | ||
85 | /* Socket type: datagram, stream...*/ | ||
86 | unsigned int type; | ||
87 | /* Let me guess, is it a Jupiter diameter? */ | ||
88 | unsigned int proto; | ||
89 | /* Peer's address */ | ||
90 | struct saddr addr; | ||
91 | }; | ||
92 | |||
93 | struct dst_crypto_ctl | ||
94 | { | ||
95 | /* Cipher and hash names */ | ||
96 | char cipher_algo[DST_NAMELEN]; | ||
97 | char hash_algo[DST_NAMELEN]; | ||
98 | |||
99 | /* Key sizes. Can be zero for digest for example */ | ||
100 | unsigned int cipher_keysize, hash_keysize; | ||
101 | /* Alignment. Calculated by the DST itself. */ | ||
102 | unsigned int crypto_attached_size; | ||
103 | /* Number of threads to perform crypto operations */ | ||
104 | int thread_num; | ||
105 | }; | ||
106 | |||
107 | /* Export security attributes have this bits checked in when client connects */ | ||
108 | #define DST_PERM_READ (1<<0) | ||
109 | #define DST_PERM_WRITE (1<<1) | ||
110 | |||
111 | /* | ||
112 | * Right now it is simple model, where each remote address | ||
113 | * is assigned to set of permissions it is allowed to perform. | ||
114 | * In real world block device does not know anything but | ||
115 | * reading and writing, so it should be more than enough. | ||
116 | */ | ||
117 | struct dst_secure_user | ||
118 | { | ||
119 | unsigned int permissions; | ||
120 | struct saddr addr; | ||
121 | }; | ||
122 | |||
123 | /* | ||
124 | * Export control command: device to export and network address to accept | ||
125 | * clients to work with given device | ||
126 | */ | ||
127 | struct dst_export_ctl | ||
128 | { | ||
129 | char device[DST_NAMELEN]; | ||
130 | struct dst_network_ctl ctl; | ||
131 | }; | ||
132 | |||
133 | enum { | ||
134 | DST_CFG = 1, /* Request remote configuration */ | ||
135 | DST_IO, /* IO command */ | ||
136 | DST_IO_RESPONSE, /* IO response */ | ||
137 | DST_PING, /* Keepalive message */ | ||
138 | DST_NCMD_MAX, | ||
139 | }; | ||
140 | |||
141 | struct dst_cmd | ||
142 | { | ||
143 | /* Network command itself, see above */ | ||
144 | __u32 cmd; | ||
145 | /* | ||
146 | * Size of the attached data | ||
147 | * (in most cases, for READ command it means how many bytes were requested) | ||
148 | */ | ||
149 | __u32 size; | ||
150 | /* Crypto size: number of attached bytes with digest/hmac */ | ||
151 | __u32 csize; | ||
152 | /* Here we can carry secret data */ | ||
153 | __u32 reserved; | ||
154 | /* Read/write bits, see how they are encoded in bio structure */ | ||
155 | __u64 rw; | ||
156 | /* BIO flags */ | ||
157 | __u64 flags; | ||
158 | /* Unique command id (like transaction ID) */ | ||
159 | __u64 id; | ||
160 | /* Sector to start IO from */ | ||
161 | __u64 sector; | ||
162 | /* Hash data is placed after this header */ | ||
163 | __u8 hash[0]; | ||
164 | }; | ||
165 | |||
166 | /* | ||
167 | * Convert command to/from network byte order. | ||
168 | * We do not use hton*() functions, since there is | ||
169 | * no 64-bit implementation. | ||
170 | */ | ||
171 | static inline void dst_convert_cmd(struct dst_cmd *c) | ||
172 | { | ||
173 | c->cmd = __cpu_to_be32(c->cmd); | ||
174 | c->csize = __cpu_to_be32(c->csize); | ||
175 | c->size = __cpu_to_be32(c->size); | ||
176 | c->sector = __cpu_to_be64(c->sector); | ||
177 | c->id = __cpu_to_be64(c->id); | ||
178 | c->flags = __cpu_to_be64(c->flags); | ||
179 | c->rw = __cpu_to_be64(c->rw); | ||
180 | } | ||
181 | |||
182 | /* Transaction id */ | ||
183 | typedef __u64 dst_gen_t; | ||
184 | |||
185 | #ifdef __KERNEL__ | ||
186 | |||
187 | #include <linux/blkdev.h> | ||
188 | #include <linux/bio.h> | ||
189 | #include <linux/device.h> | ||
190 | #include <linux/mempool.h> | ||
191 | #include <linux/net.h> | ||
192 | #include <linux/poll.h> | ||
193 | #include <linux/rbtree.h> | ||
194 | |||
195 | #ifdef CONFIG_DST_DEBUG | ||
196 | #define dprintk(f, a...) printk(KERN_NOTICE f, ##a) | ||
197 | #else | ||
198 | static inline void __attribute__ ((format (printf, 1, 2))) | ||
199 | dprintk(const char *fmt, ...) {} | ||
200 | #endif | ||
201 | |||
202 | struct dst_node; | ||
203 | |||
204 | struct dst_trans | ||
205 | { | ||
206 | /* DST node we are working with */ | ||
207 | struct dst_node *n; | ||
208 | |||
209 | /* Entry inside transaction tree */ | ||
210 | struct rb_node trans_entry; | ||
211 | |||
212 | /* Merlin kills this transaction when this memory cell equals zero */ | ||
213 | atomic_t refcnt; | ||
214 | |||
215 | /* How this transaction should be processed by crypto engine */ | ||
216 | short enc; | ||
217 | /* How many times this transaction was resent */ | ||
218 | short retries; | ||
219 | /* Completion status */ | ||
220 | int error; | ||
221 | |||
222 | /* When did we send it to the remote peer */ | ||
223 | long send_time; | ||
224 | |||
225 | /* My name is... | ||
226 | * Well, computers does not speak, they have unique id instead */ | ||
227 | dst_gen_t gen; | ||
228 | |||
229 | /* Block IO we are working with */ | ||
230 | struct bio *bio; | ||
231 | |||
232 | /* Network command for above block IO request */ | ||
233 | struct dst_cmd cmd; | ||
234 | }; | ||
235 | |||
236 | struct dst_crypto_engine | ||
237 | { | ||
238 | /* What should we do with all block requests */ | ||
239 | struct crypto_hash *hash; | ||
240 | struct crypto_ablkcipher *cipher; | ||
241 | |||
242 | /* Pool of pages used to encrypt data into before sending */ | ||
243 | int page_num; | ||
244 | struct page **pages; | ||
245 | |||
246 | /* What to do with current request */ | ||
247 | int enc; | ||
248 | /* Who we are and where do we go */ | ||
249 | struct scatterlist *src, *dst; | ||
250 | |||
251 | /* Maximum timeout waiting for encryption to be completed */ | ||
252 | long timeout; | ||
253 | /* IV is a 64-bit sequential counter */ | ||
254 | u64 iv; | ||
255 | |||
256 | /* Secret data */ | ||
257 | void *private; | ||
258 | |||
259 | /* Cached temporary data lives here */ | ||
260 | int size; | ||
261 | void *data; | ||
262 | }; | ||
263 | |||
264 | struct dst_state | ||
265 | { | ||
266 | /* The main state protection */ | ||
267 | struct mutex state_lock; | ||
268 | |||
269 | /* Polling machinery for sockets */ | ||
270 | wait_queue_t wait; | ||
271 | wait_queue_head_t *whead; | ||
272 | /* Most of events are being waited here */ | ||
273 | wait_queue_head_t thread_wait; | ||
274 | |||
275 | /* Who owns this? */ | ||
276 | struct dst_node *node; | ||
277 | |||
278 | /* Network address for this state */ | ||
279 | struct dst_network_ctl ctl; | ||
280 | |||
281 | /* Permissions to work with: read-only or rw connection */ | ||
282 | u32 permissions; | ||
283 | |||
284 | /* Called when we need to clean private data */ | ||
285 | void (* cleanup)(struct dst_state *st); | ||
286 | |||
287 | /* Used by the server: BIO completion queues BIOs here */ | ||
288 | struct list_head request_list; | ||
289 | spinlock_t request_lock; | ||
290 | |||
291 | /* Guess what? No, it is not number of planets */ | ||
292 | atomic_t refcnt; | ||
293 | |||
294 | /* This flags is set when connection should be dropped */ | ||
295 | int need_exit; | ||
296 | |||
297 | /* | ||
298 | * Socket to work with. Second pointer is used for | ||
299 | * lockless check if socket was changed before performing | ||
300 | * next action (like working with cached polling result) | ||
301 | */ | ||
302 | struct socket *socket, *read_socket; | ||
303 | |||
304 | /* Cached preallocated data */ | ||
305 | void *data; | ||
306 | unsigned int size; | ||
307 | |||
308 | /* Currently processed command */ | ||
309 | struct dst_cmd cmd; | ||
310 | }; | ||
311 | |||
312 | struct dst_info | ||
313 | { | ||
314 | /* Device size */ | ||
315 | u64 size; | ||
316 | |||
317 | /* Local device name for export devices */ | ||
318 | char local[DST_NAMELEN]; | ||
319 | |||
320 | /* Network setup */ | ||
321 | struct dst_network_ctl net; | ||
322 | |||
323 | /* Sysfs bits use this */ | ||
324 | struct device device; | ||
325 | }; | ||
326 | |||
327 | struct dst_node | ||
328 | { | ||
329 | struct list_head node_entry; | ||
330 | |||
331 | /* Hi, my name is stored here */ | ||
332 | char name[DST_NAMELEN]; | ||
333 | /* My cache name is stored here */ | ||
334 | char cache_name[DST_NAMELEN]; | ||
335 | |||
336 | /* Block device attached to given node. | ||
337 | * Only valid for exporting nodes */ | ||
338 | struct block_device *bdev; | ||
339 | /* Network state machine for given peer */ | ||
340 | struct dst_state *state; | ||
341 | |||
342 | /* Block IO machinery */ | ||
343 | struct request_queue *queue; | ||
344 | struct gendisk *disk; | ||
345 | |||
346 | /* Number of threads in processing pool */ | ||
347 | int thread_num; | ||
348 | /* Maximum number of pages in single IO */ | ||
349 | int max_pages; | ||
350 | |||
351 | /* I'm that big in bytes */ | ||
352 | loff_t size; | ||
353 | |||
354 | /* Exported to userspace node information */ | ||
355 | struct dst_info *info; | ||
356 | |||
357 | /* | ||
358 | * Security attribute list. | ||
359 | * Used only by exporting node currently. | ||
360 | */ | ||
361 | struct list_head security_list; | ||
362 | struct mutex security_lock; | ||
363 | |||
364 | /* | ||
365 | * When this unerflows below zero, university collapses. | ||
366 | * But this will not happen, since node will be freed, | ||
367 | * when reference counter reaches zero. | ||
368 | */ | ||
369 | atomic_t refcnt; | ||
370 | |||
371 | /* How precisely should I be started? */ | ||
372 | int (*start)(struct dst_node *); | ||
373 | |||
374 | /* Crypto capabilities */ | ||
375 | struct dst_crypto_ctl crypto; | ||
376 | u8 *hash_key; | ||
377 | u8 *cipher_key; | ||
378 | |||
379 | /* Pool of processing thread */ | ||
380 | struct thread_pool *pool; | ||
381 | |||
382 | /* Transaction IDs live here */ | ||
383 | atomic_long_t gen; | ||
384 | |||
385 | /* | ||
386 | * How frequently and how many times transaction | ||
387 | * tree should be scanned to drop stale objects. | ||
388 | */ | ||
389 | long trans_scan_timeout; | ||
390 | int trans_max_retries; | ||
391 | |||
392 | /* Small gnomes live here */ | ||
393 | struct rb_root trans_root; | ||
394 | struct mutex trans_lock; | ||
395 | |||
396 | /* | ||
397 | * Transaction cache/memory pool. | ||
398 | * It is big enough to contain not only transaction | ||
399 | * itself, but additional crypto data (digest/hmac). | ||
400 | */ | ||
401 | struct kmem_cache *trans_cache; | ||
402 | mempool_t *trans_pool; | ||
403 | |||
404 | /* This entity scans transaction tree */ | ||
405 | struct delayed_work trans_work; | ||
406 | |||
407 | wait_queue_head_t wait; | ||
408 | }; | ||
409 | |||
410 | /* Kernel representation of the security attribute */ | ||
411 | struct dst_secure | ||
412 | { | ||
413 | struct list_head sec_entry; | ||
414 | struct dst_secure_user sec; | ||
415 | }; | ||
416 | |||
417 | int dst_process_bio(struct dst_node *n, struct bio *bio); | ||
418 | |||
419 | int dst_node_init_connected(struct dst_node *n, struct dst_network_ctl *r); | ||
420 | int dst_node_init_listened(struct dst_node *n, struct dst_export_ctl *le); | ||
421 | |||
422 | static inline struct dst_state *dst_state_get(struct dst_state *st) | ||
423 | { | ||
424 | BUG_ON(atomic_read(&st->refcnt) == 0); | ||
425 | atomic_inc(&st->refcnt); | ||
426 | return st; | ||
427 | } | ||
428 | |||
429 | void dst_state_put(struct dst_state *st); | ||
430 | |||
431 | struct dst_state *dst_state_alloc(struct dst_node *n); | ||
432 | int dst_state_socket_create(struct dst_state *st); | ||
433 | void dst_state_socket_release(struct dst_state *st); | ||
434 | |||
435 | void dst_state_exit_connected(struct dst_state *st); | ||
436 | |||
437 | int dst_state_schedule_receiver(struct dst_state *st); | ||
438 | |||
439 | void dst_dump_addr(struct socket *sk, struct sockaddr *sa, char *str); | ||
440 | |||
441 | static inline void dst_state_lock(struct dst_state *st) | ||
442 | { | ||
443 | mutex_lock(&st->state_lock); | ||
444 | } | ||
445 | |||
446 | static inline void dst_state_unlock(struct dst_state *st) | ||
447 | { | ||
448 | mutex_unlock(&st->state_lock); | ||
449 | } | ||
450 | |||
451 | void dst_poll_exit(struct dst_state *st); | ||
452 | int dst_poll_init(struct dst_state *st); | ||
453 | |||
454 | static inline unsigned int dst_state_poll(struct dst_state *st) | ||
455 | { | ||
456 | unsigned int revents = POLLHUP | POLLERR; | ||
457 | |||
458 | dst_state_lock(st); | ||
459 | if (st->socket) | ||
460 | revents = st->socket->ops->poll(NULL, st->socket, NULL); | ||
461 | dst_state_unlock(st); | ||
462 | |||
463 | return revents; | ||
464 | } | ||
465 | |||
466 | static inline int dst_thread_setup(void *private, void *data) | ||
467 | { | ||
468 | return 0; | ||
469 | } | ||
470 | |||
471 | void dst_node_put(struct dst_node *n); | ||
472 | |||
473 | static inline struct dst_node *dst_node_get(struct dst_node *n) | ||
474 | { | ||
475 | atomic_inc(&n->refcnt); | ||
476 | return n; | ||
477 | } | ||
478 | |||
479 | int dst_data_recv(struct dst_state *st, void *data, unsigned int size); | ||
480 | int dst_recv_cdata(struct dst_state *st, void *cdata); | ||
481 | int dst_data_send_header(struct socket *sock, | ||
482 | void *data, unsigned int size, int more); | ||
483 | |||
484 | int dst_send_bio(struct dst_state *st, struct dst_cmd *cmd, struct bio *bio); | ||
485 | |||
486 | int dst_process_io(struct dst_state *st); | ||
487 | int dst_export_crypto(struct dst_node *n, struct bio *bio); | ||
488 | int dst_export_send_bio(struct bio *bio); | ||
489 | int dst_start_export(struct dst_node *n); | ||
490 | |||
491 | int __init dst_export_init(void); | ||
492 | void dst_export_exit(void); | ||
493 | |||
494 | /* Private structure for export block IO requests */ | ||
495 | struct dst_export_priv | ||
496 | { | ||
497 | struct list_head request_entry; | ||
498 | struct dst_state *state; | ||
499 | struct bio *bio; | ||
500 | struct dst_cmd cmd; | ||
501 | }; | ||
502 | |||
503 | static inline void dst_trans_get(struct dst_trans *t) | ||
504 | { | ||
505 | atomic_inc(&t->refcnt); | ||
506 | } | ||
507 | |||
508 | struct dst_trans *dst_trans_search(struct dst_node *node, dst_gen_t gen); | ||
509 | int dst_trans_remove(struct dst_trans *t); | ||
510 | int dst_trans_remove_nolock(struct dst_trans *t); | ||
511 | void dst_trans_put(struct dst_trans *t); | ||
512 | |||
513 | /* | ||
514 | * Convert bio into network command. | ||
515 | */ | ||
516 | static inline void dst_bio_to_cmd(struct bio *bio, struct dst_cmd *cmd, | ||
517 | u32 command, u64 id) | ||
518 | { | ||
519 | cmd->cmd = command; | ||
520 | cmd->flags = (bio->bi_flags << BIO_POOL_BITS) >> BIO_POOL_BITS; | ||
521 | cmd->rw = bio->bi_rw; | ||
522 | cmd->size = bio->bi_size; | ||
523 | cmd->csize = 0; | ||
524 | cmd->id = id; | ||
525 | cmd->sector = bio->bi_sector; | ||
526 | }; | ||
527 | |||
528 | int dst_trans_send(struct dst_trans *t); | ||
529 | int dst_trans_crypto(struct dst_trans *t); | ||
530 | |||
531 | int dst_node_crypto_init(struct dst_node *n, struct dst_crypto_ctl *ctl); | ||
532 | void dst_node_crypto_exit(struct dst_node *n); | ||
533 | |||
534 | static inline int dst_need_crypto(struct dst_node *n) | ||
535 | { | ||
536 | struct dst_crypto_ctl *c = &n->crypto; | ||
537 | /* | ||
538 | * Logical OR is appropriate here, but boolean one produces | ||
539 | * more optimal code, so it is used instead. | ||
540 | */ | ||
541 | return (c->hash_algo[0] | c->cipher_algo[0]); | ||
542 | } | ||
543 | |||
544 | int dst_node_trans_init(struct dst_node *n, unsigned int size); | ||
545 | void dst_node_trans_exit(struct dst_node *n); | ||
546 | |||
547 | /* | ||
548 | * Pool of threads. | ||
549 | * Ready list contains threads currently free to be used, | ||
550 | * active one contains threads with some work scheduled for them. | ||
551 | * Caller can wait in given queue when thread is ready. | ||
552 | */ | ||
553 | struct thread_pool | ||
554 | { | ||
555 | int thread_num; | ||
556 | struct mutex thread_lock; | ||
557 | struct list_head ready_list, active_list; | ||
558 | |||
559 | wait_queue_head_t wait; | ||
560 | }; | ||
561 | |||
562 | void thread_pool_del_worker(struct thread_pool *p); | ||
563 | void thread_pool_del_worker_id(struct thread_pool *p, unsigned int id); | ||
564 | int thread_pool_add_worker(struct thread_pool *p, | ||
565 | char *name, | ||
566 | unsigned int id, | ||
567 | void *(* init)(void *data), | ||
568 | void (* cleanup)(void *data), | ||
569 | void *data); | ||
570 | |||
571 | void thread_pool_destroy(struct thread_pool *p); | ||
572 | struct thread_pool *thread_pool_create(int num, char *name, | ||
573 | void *(* init)(void *data), | ||
574 | void (* cleanup)(void *data), | ||
575 | void *data); | ||
576 | |||
577 | int thread_pool_schedule(struct thread_pool *p, | ||
578 | int (* setup)(void *stored_private, void *setup_data), | ||
579 | int (* action)(void *stored_private, void *setup_data), | ||
580 | void *setup_data, long timeout); | ||
581 | int thread_pool_schedule_private(struct thread_pool *p, | ||
582 | int (* setup)(void *private, void *data), | ||
583 | int (* action)(void *private, void *data), | ||
584 | void *data, long timeout, void *id); | ||
585 | |||
586 | #endif /* __KERNEL__ */ | ||
587 | #endif /* __DST_H */ | ||
diff --git a/include/linux/elf.h b/include/linux/elf.h index 90a4ed0ea0e5..ad990c5f63f6 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -349,7 +349,11 @@ typedef struct elf64_shdr { | |||
349 | #define ELF_OSABI ELFOSABI_NONE | 349 | #define ELF_OSABI ELFOSABI_NONE |
350 | #endif | 350 | #endif |
351 | 351 | ||
352 | /* Notes used in ET_CORE */ | 352 | /* |
353 | * Notes used in ET_CORE. Architectures export some of the arch register sets | ||
354 | * using the corresponding note types via the PTRACE_GETREGSET and | ||
355 | * PTRACE_SETREGSET requests. | ||
356 | */ | ||
353 | #define NT_PRSTATUS 1 | 357 | #define NT_PRSTATUS 1 |
354 | #define NT_PRFPREG 2 | 358 | #define NT_PRFPREG 2 |
355 | #define NT_PRPSINFO 3 | 359 | #define NT_PRPSINFO 3 |
@@ -361,7 +365,13 @@ typedef struct elf64_shdr { | |||
361 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ | 365 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ |
362 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ | 366 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ |
363 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ | 367 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ |
364 | #define NT_PRXSTATUS 0x300 /* s390 upper register halves */ | 368 | #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ |
369 | #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ | ||
370 | #define NT_S390_TIMER 0x301 /* s390 timer register */ | ||
371 | #define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */ | ||
372 | #define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ | ||
373 | #define NT_S390_CTRS 0x304 /* s390 control registers */ | ||
374 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ | ||
365 | 375 | ||
366 | 376 | ||
367 | /* Note header in a PT_NOTE section */ | 377 | /* Note header in a PT_NOTE section */ |
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h index 90d1c2184112..9a33c5f7e126 100644 --- a/include/linux/enclosure.h +++ b/include/linux/enclosure.h | |||
@@ -42,6 +42,8 @@ enum enclosure_status { | |||
42 | ENCLOSURE_STATUS_NOT_INSTALLED, | 42 | ENCLOSURE_STATUS_NOT_INSTALLED, |
43 | ENCLOSURE_STATUS_UNKNOWN, | 43 | ENCLOSURE_STATUS_UNKNOWN, |
44 | ENCLOSURE_STATUS_UNAVAILABLE, | 44 | ENCLOSURE_STATUS_UNAVAILABLE, |
45 | /* last element for counting purposes */ | ||
46 | ENCLOSURE_STATUS_MAX | ||
45 | }; | 47 | }; |
46 | 48 | ||
47 | /* SFF-8485 activity light settings */ | 49 | /* SFF-8485 activity light settings */ |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 94dd10366a78..91bb4f27238c 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/fcntl.h> | 11 | #include <linux/fcntl.h> |
12 | #include <linux/file.h> | 12 | #include <linux/file.h> |
13 | #include <linux/wait.h> | ||
13 | 14 | ||
14 | /* | 15 | /* |
15 | * CAREFUL: Check include/asm-generic/fcntl.h when defining | 16 | * CAREFUL: Check include/asm-generic/fcntl.h when defining |
@@ -34,6 +35,9 @@ struct file *eventfd_fget(int fd); | |||
34 | struct eventfd_ctx *eventfd_ctx_fdget(int fd); | 35 | struct eventfd_ctx *eventfd_ctx_fdget(int fd); |
35 | struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); | 36 | struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); |
36 | int eventfd_signal(struct eventfd_ctx *ctx, int n); | 37 | int eventfd_signal(struct eventfd_ctx *ctx, int n); |
38 | ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, __u64 *cnt); | ||
39 | int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_t *wait, | ||
40 | __u64 *cnt); | ||
37 | 41 | ||
38 | #else /* CONFIG_EVENTFD */ | 42 | #else /* CONFIG_EVENTFD */ |
39 | 43 | ||
@@ -61,6 +65,18 @@ static inline void eventfd_ctx_put(struct eventfd_ctx *ctx) | |||
61 | 65 | ||
62 | } | 66 | } |
63 | 67 | ||
68 | static inline ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, | ||
69 | __u64 *cnt) | ||
70 | { | ||
71 | return -ENOSYS; | ||
72 | } | ||
73 | |||
74 | static inline int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, | ||
75 | wait_queue_t *wait, __u64 *cnt) | ||
76 | { | ||
77 | return -ENOSYS; | ||
78 | } | ||
79 | |||
64 | #endif | 80 | #endif |
65 | 81 | ||
66 | #endif /* _LINUX_EVENTFD_H */ | 82 | #endif /* _LINUX_EVENTFD_H */ |
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index f07f34de2f0e..258088ab3c6b 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h | |||
@@ -72,6 +72,8 @@ struct ext3_sb_info { | |||
72 | struct inode * s_journal_inode; | 72 | struct inode * s_journal_inode; |
73 | struct journal_s * s_journal; | 73 | struct journal_s * s_journal; |
74 | struct list_head s_orphan; | 74 | struct list_head s_orphan; |
75 | struct mutex s_orphan_lock; | ||
76 | struct mutex s_resize_lock; | ||
75 | unsigned long s_commit_interval; | 77 | unsigned long s_commit_interval; |
76 | struct block_device *journal_bdev; | 78 | struct block_device *journal_bdev; |
77 | #ifdef CONFIG_JBD_DEBUG | 79 | #ifdef CONFIG_JBD_DEBUG |
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index cf82d519be40..d7b5ddca99c2 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h | |||
@@ -44,13 +44,13 @@ | |||
44 | 44 | ||
45 | #define EXT3_DATA_TRANS_BLOCKS(sb) (EXT3_SINGLEDATA_TRANS_BLOCKS + \ | 45 | #define EXT3_DATA_TRANS_BLOCKS(sb) (EXT3_SINGLEDATA_TRANS_BLOCKS + \ |
46 | EXT3_XATTR_TRANS_BLOCKS - 2 + \ | 46 | EXT3_XATTR_TRANS_BLOCKS - 2 + \ |
47 | 2*EXT3_QUOTA_TRANS_BLOCKS(sb)) | 47 | EXT3_MAXQUOTAS_TRANS_BLOCKS(sb)) |
48 | 48 | ||
49 | /* Delete operations potentially hit one directory's namespace plus an | 49 | /* Delete operations potentially hit one directory's namespace plus an |
50 | * entire inode, plus arbitrary amounts of bitmap/indirection data. Be | 50 | * entire inode, plus arbitrary amounts of bitmap/indirection data. Be |
51 | * generous. We can grow the delete transaction later if necessary. */ | 51 | * generous. We can grow the delete transaction later if necessary. */ |
52 | 52 | ||
53 | #define EXT3_DELETE_TRANS_BLOCKS(sb) (2 * EXT3_DATA_TRANS_BLOCKS(sb) + 64) | 53 | #define EXT3_DELETE_TRANS_BLOCKS(sb) (EXT3_MAXQUOTAS_TRANS_BLOCKS(sb) + 64) |
54 | 54 | ||
55 | /* Define an arbitrary limit for the amount of data we will anticipate | 55 | /* Define an arbitrary limit for the amount of data we will anticipate |
56 | * writing to any given transaction. For unbounded transactions such as | 56 | * writing to any given transaction. For unbounded transactions such as |
@@ -86,6 +86,9 @@ | |||
86 | #define EXT3_QUOTA_INIT_BLOCKS(sb) 0 | 86 | #define EXT3_QUOTA_INIT_BLOCKS(sb) 0 |
87 | #define EXT3_QUOTA_DEL_BLOCKS(sb) 0 | 87 | #define EXT3_QUOTA_DEL_BLOCKS(sb) 0 |
88 | #endif | 88 | #endif |
89 | #define EXT3_MAXQUOTAS_TRANS_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_TRANS_BLOCKS(sb)) | ||
90 | #define EXT3_MAXQUOTAS_INIT_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_INIT_BLOCKS(sb)) | ||
91 | #define EXT3_MAXQUOTAS_DEL_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_DEL_BLOCKS(sb)) | ||
89 | 92 | ||
90 | int | 93 | int |
91 | ext3_mark_iloc_dirty(handle_t *handle, | 94 | ext3_mark_iloc_dirty(handle_t *handle, |
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index a2ec74bc4812..013dc529e95f 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h | |||
@@ -57,7 +57,14 @@ struct files_struct { | |||
57 | struct file * fd_array[NR_OPEN_DEFAULT]; | 57 | struct file * fd_array[NR_OPEN_DEFAULT]; |
58 | }; | 58 | }; |
59 | 59 | ||
60 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) | 60 | #define rcu_dereference_check_fdtable(files, fdtfd) \ |
61 | (rcu_dereference_check((fdtfd), \ | ||
62 | rcu_read_lock_held() || \ | ||
63 | lockdep_is_held(&(files)->file_lock) || \ | ||
64 | atomic_read(&(files)->count) == 1)) | ||
65 | |||
66 | #define files_fdtable(files) \ | ||
67 | (rcu_dereference_check_fdtable((files), (files)->fdt)) | ||
61 | 68 | ||
62 | struct file_operations; | 69 | struct file_operations; |
63 | struct vfsmount; | 70 | struct vfsmount; |
@@ -78,7 +85,7 @@ static inline struct file * fcheck_files(struct files_struct *files, unsigned in | |||
78 | struct fdtable *fdt = files_fdtable(files); | 85 | struct fdtable *fdt = files_fdtable(files); |
79 | 86 | ||
80 | if (fd < fdt->max_fds) | 87 | if (fd < fdt->max_fds) |
81 | file = rcu_dereference(fdt->fd[fd]); | 88 | file = rcu_dereference_check_fdtable(files, fdt->fd[fd]); |
82 | return file; | 89 | return file; |
83 | } | 90 | } |
84 | 91 | ||
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h index 934e22d65801..d830747f5c0b 100644 --- a/include/linux/fiemap.h +++ b/include/linux/fiemap.h | |||
@@ -62,5 +62,7 @@ struct fiemap { | |||
62 | #define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively | 62 | #define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively |
63 | * support extents. Result | 63 | * support extents. Result |
64 | * merged for efficiency. */ | 64 | * merged for efficiency. */ |
65 | #define FIEMAP_EXTENT_SHARED 0x00002000 /* Space shared with other | ||
66 | * files. */ | ||
65 | 67 | ||
66 | #endif /* _LINUX_FIEMAP_H */ | 68 | #endif /* _LINUX_FIEMAP_H */ |
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index c6b3ca3af6df..520ecf86cbb3 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -340,6 +340,9 @@ struct fw_cdev_send_response { | |||
340 | * The @closure field is passed back to userspace in the response event. | 340 | * The @closure field is passed back to userspace in the response event. |
341 | * The @handle field is an out parameter, returning a handle to the allocated | 341 | * The @handle field is an out parameter, returning a handle to the allocated |
342 | * range to be used for later deallocation of the range. | 342 | * range to be used for later deallocation of the range. |
343 | * | ||
344 | * The address range is allocated on all local nodes. The address allocation | ||
345 | * is exclusive except for the FCP command and response registers. | ||
343 | */ | 346 | */ |
344 | struct fw_cdev_allocate { | 347 | struct fw_cdev_allocate { |
345 | __u64 offset; | 348 | __u64 offset; |
@@ -377,7 +380,7 @@ struct fw_cdev_initiate_bus_reset { | |||
377 | * @immediate: If non-zero, immediate key to insert before pointer | 380 | * @immediate: If non-zero, immediate key to insert before pointer |
378 | * @key: Upper 8 bits of root directory pointer | 381 | * @key: Upper 8 bits of root directory pointer |
379 | * @data: Userspace pointer to contents of descriptor block | 382 | * @data: Userspace pointer to contents of descriptor block |
380 | * @length: Length of descriptor block data, in bytes | 383 | * @length: Length of descriptor block data, in quadlets |
381 | * @handle: Handle to the descriptor, written by the kernel | 384 | * @handle: Handle to the descriptor, written by the kernel |
382 | * | 385 | * |
383 | * Add a descriptor block and optionally a preceding immediate key to the local | 386 | * Add a descriptor block and optionally a preceding immediate key to the local |
@@ -391,6 +394,8 @@ struct fw_cdev_initiate_bus_reset { | |||
391 | * If not 0, the @immediate field specifies an immediate key which will be | 394 | * If not 0, the @immediate field specifies an immediate key which will be |
392 | * inserted before the root directory pointer. | 395 | * inserted before the root directory pointer. |
393 | * | 396 | * |
397 | * @immediate, @key, and @data array elements are CPU-endian quadlets. | ||
398 | * | ||
394 | * If successful, the kernel adds the descriptor and writes back a handle to the | 399 | * If successful, the kernel adds the descriptor and writes back a handle to the |
395 | * kernel-side object to be used for later removal of the descriptor block and | 400 | * kernel-side object to be used for later removal of the descriptor block and |
396 | * immediate key. | 401 | * immediate key. |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 9416a461b696..a0e67150a729 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -248,8 +248,8 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, | |||
248 | void *data, size_t length, | 248 | void *data, size_t length, |
249 | void *callback_data); | 249 | void *callback_data); |
250 | /* | 250 | /* |
251 | * Important note: The callback must guarantee that either fw_send_response() | 251 | * Important note: Except for the FCP registers, the callback must guarantee |
252 | * or kfree() is called on the @request. | 252 | * that either fw_send_response() or kfree() is called on the @request. |
253 | */ | 253 | */ |
254 | typedef void (*fw_address_callback_t)(struct fw_card *card, | 254 | typedef void (*fw_address_callback_t)(struct fw_card *card, |
255 | struct fw_request *request, | 255 | struct fw_request *request, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index cca191933ff6..ebb1cd5bc241 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -729,6 +729,7 @@ struct inode { | |||
729 | uid_t i_uid; | 729 | uid_t i_uid; |
730 | gid_t i_gid; | 730 | gid_t i_gid; |
731 | dev_t i_rdev; | 731 | dev_t i_rdev; |
732 | unsigned int i_blkbits; | ||
732 | u64 i_version; | 733 | u64 i_version; |
733 | loff_t i_size; | 734 | loff_t i_size; |
734 | #ifdef __NEED_I_SIZE_ORDERED | 735 | #ifdef __NEED_I_SIZE_ORDERED |
@@ -738,7 +739,6 @@ struct inode { | |||
738 | struct timespec i_mtime; | 739 | struct timespec i_mtime; |
739 | struct timespec i_ctime; | 740 | struct timespec i_ctime; |
740 | blkcnt_t i_blocks; | 741 | blkcnt_t i_blocks; |
741 | unsigned int i_blkbits; | ||
742 | unsigned short i_bytes; | 742 | unsigned short i_bytes; |
743 | umode_t i_mode; | 743 | umode_t i_mode; |
744 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 744 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
@@ -1624,8 +1624,6 @@ struct super_operations { | |||
1624 | * on the bit address once it is done. | 1624 | * on the bit address once it is done. |
1625 | * | 1625 | * |
1626 | * Q: What is the difference between I_WILL_FREE and I_FREEING? | 1626 | * Q: What is the difference between I_WILL_FREE and I_FREEING? |
1627 | * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on | ||
1628 | * I_CLEAR? If not, why? | ||
1629 | */ | 1627 | */ |
1630 | #define I_DIRTY_SYNC 1 | 1628 | #define I_DIRTY_SYNC 1 |
1631 | #define I_DIRTY_DATASYNC 2 | 1629 | #define I_DIRTY_DATASYNC 2 |
@@ -2299,6 +2297,7 @@ extern const struct inode_operations page_symlink_inode_operations; | |||
2299 | extern int generic_readlink(struct dentry *, char __user *, int); | 2297 | extern int generic_readlink(struct dentry *, char __user *, int); |
2300 | extern void generic_fillattr(struct inode *, struct kstat *); | 2298 | extern void generic_fillattr(struct inode *, struct kstat *); |
2301 | extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 2299 | extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
2300 | void __inode_add_bytes(struct inode *inode, loff_t bytes); | ||
2302 | void inode_add_bytes(struct inode *inode, loff_t bytes); | 2301 | void inode_add_bytes(struct inode *inode, loff_t bytes); |
2303 | void inode_sub_bytes(struct inode *inode, loff_t bytes); | 2302 | void inode_sub_bytes(struct inode *inode, loff_t bytes); |
2304 | loff_t inode_get_bytes(struct inode *inode); | 2303 | loff_t inode_get_bytes(struct inode *inode); |
@@ -2464,5 +2463,8 @@ int proc_nr_files(struct ctl_table *table, int write, | |||
2464 | 2463 | ||
2465 | int __init get_filesystem_list(char *buf); | 2464 | int __init get_filesystem_list(char *buf); |
2466 | 2465 | ||
2466 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) | ||
2467 | #define OPEN_FMODE(flag) ((__force fmode_t)((flag + 1) & O_ACCMODE)) | ||
2468 | |||
2467 | #endif /* __KERNEL__ */ | 2469 | #endif /* __KERNEL__ */ |
2468 | #endif /* _LINUX_FS_H */ | 2470 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 0b4f97d24d7f..01e6adea07ec 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -134,6 +134,8 @@ extern void | |||
134 | unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops); | 134 | unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops); |
135 | extern void unregister_ftrace_function_probe_all(char *glob); | 135 | extern void unregister_ftrace_function_probe_all(char *glob); |
136 | 136 | ||
137 | extern int ftrace_text_reserved(void *start, void *end); | ||
138 | |||
137 | enum { | 139 | enum { |
138 | FTRACE_FL_FREE = (1 << 0), | 140 | FTRACE_FL_FREE = (1 << 0), |
139 | FTRACE_FL_FAILED = (1 << 1), | 141 | FTRACE_FL_FAILED = (1 << 1), |
@@ -141,7 +143,6 @@ enum { | |||
141 | FTRACE_FL_ENABLED = (1 << 3), | 143 | FTRACE_FL_ENABLED = (1 << 3), |
142 | FTRACE_FL_NOTRACE = (1 << 4), | 144 | FTRACE_FL_NOTRACE = (1 << 4), |
143 | FTRACE_FL_CONVERTED = (1 << 5), | 145 | FTRACE_FL_CONVERTED = (1 << 5), |
144 | FTRACE_FL_FROZEN = (1 << 6), | ||
145 | }; | 146 | }; |
146 | 147 | ||
147 | struct dyn_ftrace { | 148 | struct dyn_ftrace { |
@@ -250,6 +251,10 @@ static inline int unregister_ftrace_command(char *cmd_name) | |||
250 | { | 251 | { |
251 | return -EINVAL; | 252 | return -EINVAL; |
252 | } | 253 | } |
254 | static inline int ftrace_text_reserved(void *start, void *end) | ||
255 | { | ||
256 | return 0; | ||
257 | } | ||
253 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 258 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
254 | 259 | ||
255 | /* totally disable ftrace - can not re-enable after this */ | 260 | /* totally disable ftrace - can not re-enable after this */ |
@@ -511,4 +516,10 @@ static inline void trace_hw_branch_oops(void) {} | |||
511 | 516 | ||
512 | #endif /* CONFIG_HW_BRANCH_TRACER */ | 517 | #endif /* CONFIG_HW_BRANCH_TRACER */ |
513 | 518 | ||
519 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
520 | |||
521 | unsigned long arch_syscall_addr(int nr); | ||
522 | |||
523 | #endif /* CONFIG_FTRACE_SYSCALLS */ | ||
524 | |||
514 | #endif /* _LINUX_FTRACE_H */ | 525 | #endif /* _LINUX_FTRACE_H */ |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 2233c98d80df..6b7c444ab8f6 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/trace_seq.h> | 5 | #include <linux/trace_seq.h> |
6 | #include <linux/percpu.h> | 6 | #include <linux/percpu.h> |
7 | #include <linux/hardirq.h> | 7 | #include <linux/hardirq.h> |
8 | #include <linux/perf_event.h> | ||
8 | 9 | ||
9 | struct trace_array; | 10 | struct trace_array; |
10 | struct tracer; | 11 | struct tracer; |
@@ -121,9 +122,8 @@ struct ftrace_event_call { | |||
121 | int (*regfunc)(struct ftrace_event_call *); | 122 | int (*regfunc)(struct ftrace_event_call *); |
122 | void (*unregfunc)(struct ftrace_event_call *); | 123 | void (*unregfunc)(struct ftrace_event_call *); |
123 | int id; | 124 | int id; |
125 | const char *print_fmt; | ||
124 | int (*raw_init)(struct ftrace_event_call *); | 126 | int (*raw_init)(struct ftrace_event_call *); |
125 | int (*show_format)(struct ftrace_event_call *, | ||
126 | struct trace_seq *); | ||
127 | int (*define_fields)(struct ftrace_event_call *); | 127 | int (*define_fields)(struct ftrace_event_call *); |
128 | struct list_head fields; | 128 | struct list_head fields; |
129 | int filter_active; | 129 | int filter_active; |
@@ -138,9 +138,6 @@ struct ftrace_event_call { | |||
138 | 138 | ||
139 | #define FTRACE_MAX_PROFILE_SIZE 2048 | 139 | #define FTRACE_MAX_PROFILE_SIZE 2048 |
140 | 140 | ||
141 | extern char *perf_trace_buf; | ||
142 | extern char *perf_trace_buf_nmi; | ||
143 | |||
144 | #define MAX_FILTER_PRED 32 | 141 | #define MAX_FILTER_PRED 32 |
145 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 142 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
146 | 143 | ||
@@ -188,13 +185,27 @@ do { \ | |||
188 | __trace_printk(ip, fmt, ##args); \ | 185 | __trace_printk(ip, fmt, ##args); \ |
189 | } while (0) | 186 | } while (0) |
190 | 187 | ||
191 | #ifdef CONFIG_EVENT_PROFILE | 188 | #ifdef CONFIG_PERF_EVENTS |
192 | struct perf_event; | 189 | struct perf_event; |
193 | extern int ftrace_profile_enable(int event_id); | 190 | extern int ftrace_profile_enable(int event_id); |
194 | extern void ftrace_profile_disable(int event_id); | 191 | extern void ftrace_profile_disable(int event_id); |
195 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | 192 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, |
196 | char *filter_str); | 193 | char *filter_str); |
197 | extern void ftrace_profile_free_filter(struct perf_event *event); | 194 | extern void ftrace_profile_free_filter(struct perf_event *event); |
195 | extern void * | ||
196 | ftrace_perf_buf_prepare(int size, unsigned short type, int *rctxp, | ||
197 | unsigned long *irq_flags); | ||
198 | |||
199 | static inline void | ||
200 | ftrace_perf_buf_submit(void *raw_data, int size, int rctx, u64 addr, | ||
201 | u64 count, unsigned long irq_flags) | ||
202 | { | ||
203 | struct trace_entry *entry = raw_data; | ||
204 | |||
205 | perf_tp_event(entry->type, addr, count, raw_data, size); | ||
206 | perf_swevent_put_recursion_context(rctx); | ||
207 | local_irq_restore(irq_flags); | ||
208 | } | ||
198 | #endif | 209 | #endif |
199 | 210 | ||
200 | #endif /* _LINUX_FTRACE_EVENT_H */ | 211 | #endif /* _LINUX_FTRACE_EVENT_H */ |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index c6c0c41af35f..9717081c75ad 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -256,9 +256,9 @@ extern struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, | |||
256 | #define part_stat_read(part, field) \ | 256 | #define part_stat_read(part, field) \ |
257 | ({ \ | 257 | ({ \ |
258 | typeof((part)->dkstats->field) res = 0; \ | 258 | typeof((part)->dkstats->field) res = 0; \ |
259 | int i; \ | 259 | unsigned int _cpu; \ |
260 | for_each_possible_cpu(i) \ | 260 | for_each_possible_cpu(_cpu) \ |
261 | res += per_cpu_ptr((part)->dkstats, i)->field; \ | 261 | res += per_cpu_ptr((part)->dkstats, _cpu)->field; \ |
262 | res; \ | 262 | res; \ |
263 | }) | 263 | }) |
264 | 264 | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h index 87093652dda8..b1344ec4b7fc 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -501,7 +501,7 @@ struct hid_device { /* device report descriptor */ | |||
501 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); | 501 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); |
502 | 502 | ||
503 | /* handler for raw output data, used by hidraw */ | 503 | /* handler for raw output data, used by hidraw */ |
504 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); | 504 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char); |
505 | 505 | ||
506 | /* debugging support via debugfs */ | 506 | /* debugging support via debugfs */ |
507 | unsigned short debug; | 507 | unsigned short debug; |
@@ -663,7 +663,7 @@ struct hid_ll_driver { | |||
663 | 663 | ||
664 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ | 664 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ |
665 | /* We ignore a few input applications that are not widely used */ | 665 | /* We ignore a few input applications that are not widely used */ |
666 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002)) | 666 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006))) |
667 | 667 | ||
668 | /* HID core API */ | 668 | /* HID core API */ |
669 | 669 | ||
@@ -690,6 +690,7 @@ int hid_input_report(struct hid_device *, int type, u8 *, int, int); | |||
690 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); | 690 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); |
691 | void hid_output_report(struct hid_report *report, __u8 *data); | 691 | void hid_output_report(struct hid_report *report, __u8 *data); |
692 | struct hid_device *hid_allocate_device(void); | 692 | struct hid_device *hid_allocate_device(void); |
693 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); | ||
693 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); | 694 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); |
694 | int hid_check_keys_pressed(struct hid_device *hid); | 695 | int hid_check_keys_pressed(struct hid_device *hid); |
695 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); | 696 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 211ff4497269..74152c08ad07 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -17,6 +17,12 @@ static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page | |||
17 | static inline void flush_kernel_dcache_page(struct page *page) | 17 | static inline void flush_kernel_dcache_page(struct page *page) |
18 | { | 18 | { |
19 | } | 19 | } |
20 | static inline void flush_kernel_vmap_range(void *vaddr, int size) | ||
21 | { | ||
22 | } | ||
23 | static inline void invalidate_kernel_vmap_range(void *vaddr, int size) | ||
24 | { | ||
25 | } | ||
20 | #endif | 26 | #endif |
21 | 27 | ||
22 | #include <asm/kmap_types.h> | 28 | #include <asm/kmap_types.h> |
@@ -46,7 +52,7 @@ void kmap_flush_unused(void); | |||
46 | 52 | ||
47 | static inline unsigned int nr_free_highpages(void) { return 0; } | 53 | static inline unsigned int nr_free_highpages(void) { return 0; } |
48 | 54 | ||
49 | #define totalhigh_pages 0 | 55 | #define totalhigh_pages 0UL |
50 | 56 | ||
51 | #ifndef ARCH_HAS_KMAP | 57 | #ifndef ARCH_HAS_KMAP |
52 | static inline void *kmap(struct page *page) | 58 | static inline void *kmap(struct page *page) |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index 41235c93e4e9..5977b724f7c6 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -44,7 +44,7 @@ static inline int hw_breakpoint_type(struct perf_event *bp) | |||
44 | return bp->attr.bp_type; | 44 | return bp->attr.bp_type; |
45 | } | 45 | } |
46 | 46 | ||
47 | static inline int hw_breakpoint_len(struct perf_event *bp) | 47 | static inline unsigned long hw_breakpoint_len(struct perf_event *bp) |
48 | { | 48 | { |
49 | return bp->attr.bp_len; | 49 | return bp->attr.bp_len; |
50 | } | 50 | } |
@@ -75,6 +75,8 @@ extern int __register_perf_hw_breakpoint(struct perf_event *bp); | |||
75 | extern void unregister_hw_breakpoint(struct perf_event *bp); | 75 | extern void unregister_hw_breakpoint(struct perf_event *bp); |
76 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); | 76 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); |
77 | 77 | ||
78 | extern int dbg_reserve_bp_slot(struct perf_event *bp); | ||
79 | extern int dbg_release_bp_slot(struct perf_event *bp); | ||
78 | extern int reserve_bp_slot(struct perf_event *bp); | 80 | extern int reserve_bp_slot(struct perf_event *bp); |
79 | extern void release_bp_slot(struct perf_event *bp); | 81 | extern void release_bp_slot(struct perf_event *bp); |
80 | 82 | ||
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h index fc5db826b48e..02c9af374741 100644 --- a/include/linux/i2c/adp5588.h +++ b/include/linux/i2c/adp5588.h | |||
@@ -89,4 +89,16 @@ struct adp5588_kpad_platform_data { | |||
89 | unsigned short unlock_key2; /* Unlock Key 2 */ | 89 | unsigned short unlock_key2; /* Unlock Key 2 */ |
90 | }; | 90 | }; |
91 | 91 | ||
92 | struct adp5588_gpio_platform_data { | ||
93 | unsigned gpio_start; /* GPIO Chip base # */ | ||
94 | unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ | ||
95 | int (*setup)(struct i2c_client *client, | ||
96 | int gpio, unsigned ngpio, | ||
97 | void *context); | ||
98 | int (*teardown)(struct i2c_client *client, | ||
99 | int gpio, unsigned ngpio, | ||
100 | void *context); | ||
101 | void *context; | ||
102 | }; | ||
103 | |||
92 | #endif | 104 | #endif |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index d9724a28c0c2..163c840437d6 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -832,7 +832,7 @@ struct ieee80211_ht_cap { | |||
832 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | 832 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 |
833 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | 833 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 |
834 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | 834 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 |
835 | #define IEEE80211_HT_CAP_PSMP_SUPPORT 0x2000 | 835 | #define IEEE80211_HT_CAP_RESERVED 0x2000 |
836 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 | 836 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 |
837 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 | 837 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 |
838 | 838 | ||
diff --git a/include/linux/ima.h b/include/linux/ima.h index 99dc6d5cf7e5..975837e7d6c0 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h | |||
@@ -17,7 +17,7 @@ struct linux_binprm; | |||
17 | extern int ima_bprm_check(struct linux_binprm *bprm); | 17 | extern int ima_bprm_check(struct linux_binprm *bprm); |
18 | extern int ima_inode_alloc(struct inode *inode); | 18 | extern int ima_inode_alloc(struct inode *inode); |
19 | extern void ima_inode_free(struct inode *inode); | 19 | extern void ima_inode_free(struct inode *inode); |
20 | extern int ima_path_check(struct path *path, int mask); | 20 | extern int ima_file_check(struct file *file, int mask); |
21 | extern void ima_file_free(struct file *file); | 21 | extern void ima_file_free(struct file *file); |
22 | extern int ima_file_mmap(struct file *file, unsigned long prot); | 22 | extern int ima_file_mmap(struct file *file, unsigned long prot); |
23 | extern void ima_counts_get(struct file *file); | 23 | extern void ima_counts_get(struct file *file); |
@@ -38,7 +38,7 @@ static inline void ima_inode_free(struct inode *inode) | |||
38 | return; | 38 | return; |
39 | } | 39 | } |
40 | 40 | ||
41 | static inline int ima_path_check(struct path *path, int mask) | 41 | static inline int ima_file_check(struct file *file, int mask) |
42 | { | 42 | { |
43 | return 0; | 43 | return 0; |
44 | } | 44 | } |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 699e85c01a4d..b2304929434e 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -81,6 +81,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
81 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) | 81 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
82 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) | 82 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) |
83 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) | 83 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) |
84 | #define IN_DEV_SRC_VMARK(in_dev) IN_DEV_ORCONF((in_dev), SRC_VMARK) | ||
84 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ | 85 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ |
85 | ACCEPT_SOURCE_ROUTE) | 86 | ACCEPT_SOURCE_ROUTE) |
86 | #define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL) | 87 | #define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL) |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 5ed8b9c50355..abec69b63d7e 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -111,12 +111,6 @@ extern struct cred init_cred; | |||
111 | # define INIT_PERF_EVENTS(tsk) | 111 | # define INIT_PERF_EVENTS(tsk) |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | #ifdef CONFIG_FS_JOURNAL_INFO | ||
115 | #define INIT_JOURNAL_INFO .journal_info = NULL, | ||
116 | #else | ||
117 | #define INIT_JOURNAL_INFO | ||
118 | #endif | ||
119 | |||
120 | /* | 114 | /* |
121 | * INIT_TASK is used to set up the first task table, touch at | 115 | * INIT_TASK is used to set up the first task table, touch at |
122 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 116 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
@@ -168,6 +162,7 @@ extern struct cred init_cred; | |||
168 | .signal = {{0}}}, \ | 162 | .signal = {{0}}}, \ |
169 | .blocked = {{0}}, \ | 163 | .blocked = {{0}}, \ |
170 | .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ | 164 | .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ |
165 | .journal_info = NULL, \ | ||
171 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ | 166 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ |
172 | .fs_excl = ATOMIC_INIT(0), \ | 167 | .fs_excl = ATOMIC_INIT(0), \ |
173 | .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ | 168 | .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ |
@@ -178,7 +173,6 @@ extern struct cred init_cred; | |||
178 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ | 173 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ |
179 | }, \ | 174 | }, \ |
180 | .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ | 175 | .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ |
181 | INIT_JOURNAL_INFO \ | ||
182 | INIT_IDS \ | 176 | INIT_IDS \ |
183 | INIT_PERF_EVENTS(tsk) \ | 177 | INIT_PERF_EVENTS(tsk) \ |
184 | INIT_TRACE_IRQFLAGS \ | 178 | INIT_TRACE_IRQFLAGS \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 7be8a6537b57..f44ee9114401 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -376,6 +376,7 @@ struct input_absinfo { | |||
376 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ | 376 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ |
377 | 377 | ||
378 | #define KEY_WIMAX 246 | 378 | #define KEY_WIMAX 246 |
379 | #define KEY_RFKILL 247 /* Key that controls all radios */ | ||
379 | 380 | ||
380 | /* Range 248 - 255 is reserved for special needs of AT keyboard driver */ | 381 | /* Range 248 - 255 is reserved for special needs of AT keyboard driver */ |
381 | 382 | ||
@@ -597,6 +598,48 @@ struct input_absinfo { | |||
597 | 598 | ||
598 | #define KEY_CAMERA_FOCUS 0x210 | 599 | #define KEY_CAMERA_FOCUS 0x210 |
599 | 600 | ||
601 | #define BTN_TRIGGER_HAPPY 0x2c0 | ||
602 | #define BTN_TRIGGER_HAPPY1 0x2c0 | ||
603 | #define BTN_TRIGGER_HAPPY2 0x2c1 | ||
604 | #define BTN_TRIGGER_HAPPY3 0x2c2 | ||
605 | #define BTN_TRIGGER_HAPPY4 0x2c3 | ||
606 | #define BTN_TRIGGER_HAPPY5 0x2c4 | ||
607 | #define BTN_TRIGGER_HAPPY6 0x2c5 | ||
608 | #define BTN_TRIGGER_HAPPY7 0x2c6 | ||
609 | #define BTN_TRIGGER_HAPPY8 0x2c7 | ||
610 | #define BTN_TRIGGER_HAPPY9 0x2c8 | ||
611 | #define BTN_TRIGGER_HAPPY10 0x2c9 | ||
612 | #define BTN_TRIGGER_HAPPY11 0x2ca | ||
613 | #define BTN_TRIGGER_HAPPY12 0x2cb | ||
614 | #define BTN_TRIGGER_HAPPY13 0x2cc | ||
615 | #define BTN_TRIGGER_HAPPY14 0x2cd | ||
616 | #define BTN_TRIGGER_HAPPY15 0x2ce | ||
617 | #define BTN_TRIGGER_HAPPY16 0x2cf | ||
618 | #define BTN_TRIGGER_HAPPY17 0x2d0 | ||
619 | #define BTN_TRIGGER_HAPPY18 0x2d1 | ||
620 | #define BTN_TRIGGER_HAPPY19 0x2d2 | ||
621 | #define BTN_TRIGGER_HAPPY20 0x2d3 | ||
622 | #define BTN_TRIGGER_HAPPY21 0x2d4 | ||
623 | #define BTN_TRIGGER_HAPPY22 0x2d5 | ||
624 | #define BTN_TRIGGER_HAPPY23 0x2d6 | ||
625 | #define BTN_TRIGGER_HAPPY24 0x2d7 | ||
626 | #define BTN_TRIGGER_HAPPY25 0x2d8 | ||
627 | #define BTN_TRIGGER_HAPPY26 0x2d9 | ||
628 | #define BTN_TRIGGER_HAPPY27 0x2da | ||
629 | #define BTN_TRIGGER_HAPPY28 0x2db | ||
630 | #define BTN_TRIGGER_HAPPY29 0x2dc | ||
631 | #define BTN_TRIGGER_HAPPY30 0x2dd | ||
632 | #define BTN_TRIGGER_HAPPY31 0x2de | ||
633 | #define BTN_TRIGGER_HAPPY32 0x2df | ||
634 | #define BTN_TRIGGER_HAPPY33 0x2e0 | ||
635 | #define BTN_TRIGGER_HAPPY34 0x2e1 | ||
636 | #define BTN_TRIGGER_HAPPY35 0x2e2 | ||
637 | #define BTN_TRIGGER_HAPPY36 0x2e3 | ||
638 | #define BTN_TRIGGER_HAPPY37 0x2e4 | ||
639 | #define BTN_TRIGGER_HAPPY38 0x2e5 | ||
640 | #define BTN_TRIGGER_HAPPY39 0x2e6 | ||
641 | #define BTN_TRIGGER_HAPPY40 0x2e7 | ||
642 | |||
600 | /* We avoid low common keys in module aliases so they don't get huge. */ | 643 | /* We avoid low common keys in module aliases so they don't get huge. */ |
601 | #define KEY_MIN_INTERESTING KEY_MUTE | 644 | #define KEY_MIN_INTERESTING KEY_MUTE |
602 | #define KEY_MAX 0x2ff | 645 | #define KEY_MAX 0x2ff |
@@ -660,6 +703,7 @@ struct input_absinfo { | |||
660 | #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ | 703 | #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ |
661 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ | 704 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ |
662 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | 705 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ |
706 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ | ||
663 | 707 | ||
664 | #define ABS_MAX 0x3f | 708 | #define ABS_MAX 0x3f |
665 | #define ABS_CNT (ABS_MAX+1) | 709 | #define ABS_CNT (ABS_MAX+1) |
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index a63235996309..78ef023227d4 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
@@ -4,32 +4,6 @@ | |||
4 | #include <linux/radix-tree.h> | 4 | #include <linux/radix-tree.h> |
5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
6 | 6 | ||
7 | /* | ||
8 | * This is the per-process anticipatory I/O scheduler state. | ||
9 | */ | ||
10 | struct as_io_context { | ||
11 | spinlock_t lock; | ||
12 | |||
13 | void (*dtor)(struct as_io_context *aic); /* destructor */ | ||
14 | void (*exit)(struct as_io_context *aic); /* called on task exit */ | ||
15 | |||
16 | unsigned long state; | ||
17 | atomic_t nr_queued; /* queued reads & sync writes */ | ||
18 | atomic_t nr_dispatched; /* number of requests gone to the drivers */ | ||
19 | |||
20 | /* IO History tracking */ | ||
21 | /* Thinktime */ | ||
22 | unsigned long last_end_request; | ||
23 | unsigned long ttime_total; | ||
24 | unsigned long ttime_samples; | ||
25 | unsigned long ttime_mean; | ||
26 | /* Layout pattern */ | ||
27 | unsigned int seek_samples; | ||
28 | sector_t last_request_pos; | ||
29 | u64 seek_total; | ||
30 | sector_t seek_mean; | ||
31 | }; | ||
32 | |||
33 | struct cfq_queue; | 7 | struct cfq_queue; |
34 | struct cfq_io_context { | 8 | struct cfq_io_context { |
35 | void *key; | 9 | void *key; |
@@ -78,7 +52,6 @@ struct io_context { | |||
78 | unsigned long last_waited; /* Time last woken after wait for request */ | 52 | unsigned long last_waited; /* Time last woken after wait for request */ |
79 | int nr_batch_requests; /* Number of requests left in the batch */ | 53 | int nr_batch_requests; /* Number of requests left in the batch */ |
80 | 54 | ||
81 | struct as_io_context *aic; | ||
82 | struct radix_tree_root radix_root; | 55 | struct radix_tree_root radix_root; |
83 | struct hlist_head cic_list; | 56 | struct hlist_head cic_list; |
84 | void *ioc_data; | 57 | void *ioc_data; |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 7129504e053d..dda98410d588 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -112,6 +112,7 @@ extern struct resource iomem_resource; | |||
112 | 112 | ||
113 | extern int request_resource(struct resource *root, struct resource *new); | 113 | extern int request_resource(struct resource *root, struct resource *new); |
114 | extern int release_resource(struct resource *new); | 114 | extern int release_resource(struct resource *new); |
115 | void release_child_resources(struct resource *new); | ||
115 | extern void reserve_region_with_split(struct resource *root, | 116 | extern void reserve_region_with_split(struct resource *root, |
116 | resource_size_t start, resource_size_t end, | 117 | resource_size_t start, resource_size_t end, |
117 | const char *name); | 118 | const char *name); |
@@ -120,8 +121,10 @@ extern void insert_resource_expand_to_fit(struct resource *root, struct resource | |||
120 | extern int allocate_resource(struct resource *root, struct resource *new, | 121 | extern int allocate_resource(struct resource *root, struct resource *new, |
121 | resource_size_t size, resource_size_t min, | 122 | resource_size_t size, resource_size_t min, |
122 | resource_size_t max, resource_size_t align, | 123 | resource_size_t max, resource_size_t align, |
123 | void (*alignf)(void *, struct resource *, | 124 | resource_size_t (*alignf)(void *, |
124 | resource_size_t, resource_size_t), | 125 | const struct resource *, |
126 | resource_size_t, | ||
127 | resource_size_t), | ||
125 | void *alignf_data); | 128 | void *alignf_data); |
126 | int adjust_resource(struct resource *res, resource_size_t start, | 129 | int adjust_resource(struct resource *res, resource_size_t start, |
127 | resource_size_t size); | 130 | resource_size_t size); |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index f1011f7f3d41..638ce4554c76 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -653,6 +653,7 @@ struct transaction_s | |||
653 | * waiting for it to finish. | 653 | * waiting for it to finish. |
654 | */ | 654 | */ |
655 | unsigned int t_synchronous_commit:1; | 655 | unsigned int t_synchronous_commit:1; |
656 | unsigned int t_flushed_data_blocks:1; | ||
656 | 657 | ||
657 | /* | 658 | /* |
658 | * For use by the filesystem to store fs-specific data | 659 | * For use by the filesystem to store fs-specific data |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3fc9f5aab5f8..1221d2331a6d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -124,7 +124,7 @@ extern int _cond_resched(void); | |||
124 | #endif | 124 | #endif |
125 | 125 | ||
126 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | 126 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP |
127 | void __might_sleep(char *file, int line, int preempt_offset); | 127 | void __might_sleep(const char *file, int line, int preempt_offset); |
128 | /** | 128 | /** |
129 | * might_sleep - annotation for functions that can sleep | 129 | * might_sleep - annotation for functions that can sleep |
130 | * | 130 | * |
@@ -138,7 +138,8 @@ extern int _cond_resched(void); | |||
138 | # define might_sleep() \ | 138 | # define might_sleep() \ |
139 | do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) | 139 | do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) |
140 | #else | 140 | #else |
141 | static inline void __might_sleep(char *file, int line, int preempt_offset) { } | 141 | static inline void __might_sleep(const char *file, int line, |
142 | int preempt_offset) { } | ||
142 | # define might_sleep() do { might_resched(); } while (0) | 143 | # define might_sleep() do { might_resched(); } while (0) |
143 | #endif | 144 | #endif |
144 | 145 | ||
@@ -734,6 +735,10 @@ struct sysinfo { | |||
734 | /* Force a compilation error if condition is constant and true */ | 735 | /* Force a compilation error if condition is constant and true */ |
735 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) | 736 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) |
736 | 737 | ||
738 | /* Force a compilation error if a constant expression is not a power of 2 */ | ||
739 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ | ||
740 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) | ||
741 | |||
737 | /* Force a compilation error if condition is true, but also produce a | 742 | /* Force a compilation error if condition is true, but also produce a |
738 | result (of value 0 and type size_t), so the expression can be used | 743 | result (of value 0 and type size_t), so the expression can be used |
739 | e.g. in a structure initializer (or where-ever else comma expressions | 744 | e.g. in a structure initializer (or where-ever else comma expressions |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index ad6bdf5a5970..bc0fc795bd35 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * A simple kernel FIFO implementation. | 2 | * A generic kernel FIFO implementation. |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Stefani Seibold <stefani@seibold.net> | ||
4 | * Copyright (C) 2004 Stelian Pop <stelian@popies.net> | 5 | * Copyright (C) 2004 Stelian Pop <stelian@popies.net> |
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -18,6 +19,25 @@ | |||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | * | 20 | * |
20 | */ | 21 | */ |
22 | |||
23 | /* | ||
24 | * Howto porting drivers to the new generic fifo API: | ||
25 | * | ||
26 | * - Modify the declaration of the "struct kfifo *" object into a | ||
27 | * in-place "struct kfifo" object | ||
28 | * - Init the in-place object with kfifo_alloc() or kfifo_init() | ||
29 | * Note: The address of the in-place "struct kfifo" object must be | ||
30 | * passed as the first argument to this functions | ||
31 | * - Replace the use of __kfifo_put into kfifo_in and __kfifo_get | ||
32 | * into kfifo_out | ||
33 | * - Replace the use of kfifo_put into kfifo_in_locked and kfifo_get | ||
34 | * into kfifo_out_locked | ||
35 | * Note: the spinlock pointer formerly passed to kfifo_init/kfifo_alloc | ||
36 | * must be passed now to the kfifo_in_locked and kfifo_out_locked | ||
37 | * as the last parameter. | ||
38 | * - All formerly name __kfifo_* functions has been renamed into kfifo_* | ||
39 | */ | ||
40 | |||
21 | #ifndef _LINUX_KFIFO_H | 41 | #ifndef _LINUX_KFIFO_H |
22 | #define _LINUX_KFIFO_H | 42 | #define _LINUX_KFIFO_H |
23 | 43 | ||
@@ -29,26 +49,82 @@ struct kfifo { | |||
29 | unsigned int size; /* the size of the allocated buffer */ | 49 | unsigned int size; /* the size of the allocated buffer */ |
30 | unsigned int in; /* data is added at offset (in % size) */ | 50 | unsigned int in; /* data is added at offset (in % size) */ |
31 | unsigned int out; /* data is extracted from off. (out % size) */ | 51 | unsigned int out; /* data is extracted from off. (out % size) */ |
32 | spinlock_t *lock; /* protects concurrent modifications */ | ||
33 | }; | 52 | }; |
34 | 53 | ||
35 | extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, | 54 | /* |
36 | gfp_t gfp_mask, spinlock_t *lock); | 55 | * Macros for declaration and initialization of the kfifo datatype |
37 | extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, | 56 | */ |
38 | spinlock_t *lock); | 57 | |
58 | /* helper macro */ | ||
59 | #define __kfifo_initializer(s, b) \ | ||
60 | (struct kfifo) { \ | ||
61 | .size = s, \ | ||
62 | .in = 0, \ | ||
63 | .out = 0, \ | ||
64 | .buffer = b \ | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * DECLARE_KFIFO - macro to declare a kfifo and the associated buffer | ||
69 | * @name: name of the declared kfifo datatype | ||
70 | * @size: size of the fifo buffer. Must be a power of two. | ||
71 | * | ||
72 | * Note1: the macro can be used inside struct or union declaration | ||
73 | * Note2: the macro creates two objects: | ||
74 | * A kfifo object with the given name and a buffer for the kfifo | ||
75 | * object named name##kfifo_buffer | ||
76 | */ | ||
77 | #define DECLARE_KFIFO(name, size) \ | ||
78 | union { \ | ||
79 | struct kfifo name; \ | ||
80 | unsigned char name##kfifo_buffer[size + sizeof(struct kfifo)]; \ | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * INIT_KFIFO - Initialize a kfifo declared by DECLARE_KFIFO | ||
85 | * @name: name of the declared kfifo datatype | ||
86 | */ | ||
87 | #define INIT_KFIFO(name) \ | ||
88 | name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \ | ||
89 | sizeof(struct kfifo), name##kfifo_buffer) | ||
90 | |||
91 | /** | ||
92 | * DEFINE_KFIFO - macro to define and initialize a kfifo | ||
93 | * @name: name of the declared kfifo datatype | ||
94 | * @size: size of the fifo buffer. Must be a power of two. | ||
95 | * | ||
96 | * Note1: the macro can be used for global and local kfifo data type variables | ||
97 | * Note2: the macro creates two objects: | ||
98 | * A kfifo object with the given name and a buffer for the kfifo | ||
99 | * object named name##kfifo_buffer | ||
100 | */ | ||
101 | #define DEFINE_KFIFO(name, size) \ | ||
102 | unsigned char name##kfifo_buffer[size]; \ | ||
103 | struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer) | ||
104 | |||
105 | #undef __kfifo_initializer | ||
106 | |||
107 | extern void kfifo_init(struct kfifo *fifo, void *buffer, | ||
108 | unsigned int size); | ||
109 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, | ||
110 | gfp_t gfp_mask); | ||
39 | extern void kfifo_free(struct kfifo *fifo); | 111 | extern void kfifo_free(struct kfifo *fifo); |
40 | extern unsigned int __kfifo_put(struct kfifo *fifo, | 112 | extern unsigned int kfifo_in(struct kfifo *fifo, |
41 | const unsigned char *buffer, unsigned int len); | 113 | const void *from, unsigned int len); |
42 | extern unsigned int __kfifo_get(struct kfifo *fifo, | 114 | extern __must_check unsigned int kfifo_out(struct kfifo *fifo, |
43 | unsigned char *buffer, unsigned int len); | 115 | void *to, unsigned int len); |
116 | extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo, | ||
117 | void *to, unsigned int len, unsigned offset); | ||
44 | 118 | ||
45 | /** | 119 | /** |
46 | * __kfifo_reset - removes the entire FIFO contents, no locking version | 120 | * kfifo_initialized - Check if kfifo is initialized. |
47 | * @fifo: the fifo to be emptied. | 121 | * @fifo: fifo to check |
122 | * Return %true if FIFO is initialized, otherwise %false. | ||
123 | * Assumes the fifo was 0 before. | ||
48 | */ | 124 | */ |
49 | static inline void __kfifo_reset(struct kfifo *fifo) | 125 | static inline bool kfifo_initialized(struct kfifo *fifo) |
50 | { | 126 | { |
51 | fifo->in = fifo->out = 0; | 127 | return fifo->buffer != NULL; |
52 | } | 128 | } |
53 | 129 | ||
54 | /** | 130 | /** |
@@ -57,96 +133,484 @@ static inline void __kfifo_reset(struct kfifo *fifo) | |||
57 | */ | 133 | */ |
58 | static inline void kfifo_reset(struct kfifo *fifo) | 134 | static inline void kfifo_reset(struct kfifo *fifo) |
59 | { | 135 | { |
60 | unsigned long flags; | 136 | fifo->in = fifo->out = 0; |
137 | } | ||
61 | 138 | ||
62 | spin_lock_irqsave(fifo->lock, flags); | 139 | /** |
140 | * kfifo_reset_out - skip FIFO contents | ||
141 | * @fifo: the fifo to be emptied. | ||
142 | */ | ||
143 | static inline void kfifo_reset_out(struct kfifo *fifo) | ||
144 | { | ||
145 | smp_mb(); | ||
146 | fifo->out = fifo->in; | ||
147 | } | ||
63 | 148 | ||
64 | __kfifo_reset(fifo); | 149 | /** |
150 | * kfifo_size - returns the size of the fifo in bytes | ||
151 | * @fifo: the fifo to be used. | ||
152 | */ | ||
153 | static inline __must_check unsigned int kfifo_size(struct kfifo *fifo) | ||
154 | { | ||
155 | return fifo->size; | ||
156 | } | ||
65 | 157 | ||
66 | spin_unlock_irqrestore(fifo->lock, flags); | 158 | /** |
159 | * kfifo_len - returns the number of used bytes in the FIFO | ||
160 | * @fifo: the fifo to be used. | ||
161 | */ | ||
162 | static inline unsigned int kfifo_len(struct kfifo *fifo) | ||
163 | { | ||
164 | register unsigned int out; | ||
165 | |||
166 | out = fifo->out; | ||
167 | smp_rmb(); | ||
168 | return fifo->in - out; | ||
67 | } | 169 | } |
68 | 170 | ||
69 | /** | 171 | /** |
70 | * kfifo_put - puts some data into the FIFO | 172 | * kfifo_is_empty - returns true if the fifo is empty |
71 | * @fifo: the fifo to be used. | 173 | * @fifo: the fifo to be used. |
72 | * @buffer: the data to be added. | 174 | */ |
73 | * @len: the length of the data to be added. | 175 | static inline __must_check int kfifo_is_empty(struct kfifo *fifo) |
176 | { | ||
177 | return fifo->in == fifo->out; | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * kfifo_is_full - returns true if the fifo is full | ||
182 | * @fifo: the fifo to be used. | ||
183 | */ | ||
184 | static inline __must_check int kfifo_is_full(struct kfifo *fifo) | ||
185 | { | ||
186 | return kfifo_len(fifo) == kfifo_size(fifo); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * kfifo_avail - returns the number of bytes available in the FIFO | ||
191 | * @fifo: the fifo to be used. | ||
192 | */ | ||
193 | static inline __must_check unsigned int kfifo_avail(struct kfifo *fifo) | ||
194 | { | ||
195 | return kfifo_size(fifo) - kfifo_len(fifo); | ||
196 | } | ||
197 | |||
198 | /** | ||
199 | * kfifo_in_locked - puts some data into the FIFO using a spinlock for locking | ||
200 | * @fifo: the fifo to be used. | ||
201 | * @from: the data to be added. | ||
202 | * @n: the length of the data to be added. | ||
203 | * @lock: pointer to the spinlock to use for locking. | ||
74 | * | 204 | * |
75 | * This function copies at most @len bytes from the @buffer into | 205 | * This function copies at most @len bytes from the @from buffer into |
76 | * the FIFO depending on the free space, and returns the number of | 206 | * the FIFO depending on the free space, and returns the number of |
77 | * bytes copied. | 207 | * bytes copied. |
78 | */ | 208 | */ |
79 | static inline unsigned int kfifo_put(struct kfifo *fifo, | 209 | static inline unsigned int kfifo_in_locked(struct kfifo *fifo, |
80 | const unsigned char *buffer, unsigned int len) | 210 | const void *from, unsigned int n, spinlock_t *lock) |
81 | { | 211 | { |
82 | unsigned long flags; | 212 | unsigned long flags; |
83 | unsigned int ret; | 213 | unsigned int ret; |
84 | 214 | ||
85 | spin_lock_irqsave(fifo->lock, flags); | 215 | spin_lock_irqsave(lock, flags); |
86 | 216 | ||
87 | ret = __kfifo_put(fifo, buffer, len); | 217 | ret = kfifo_in(fifo, from, n); |
88 | 218 | ||
89 | spin_unlock_irqrestore(fifo->lock, flags); | 219 | spin_unlock_irqrestore(lock, flags); |
90 | 220 | ||
91 | return ret; | 221 | return ret; |
92 | } | 222 | } |
93 | 223 | ||
94 | /** | 224 | /** |
95 | * kfifo_get - gets some data from the FIFO | 225 | * kfifo_out_locked - gets some data from the FIFO using a spinlock for locking |
96 | * @fifo: the fifo to be used. | 226 | * @fifo: the fifo to be used. |
97 | * @buffer: where the data must be copied. | 227 | * @to: where the data must be copied. |
98 | * @len: the size of the destination buffer. | 228 | * @n: the size of the destination buffer. |
229 | * @lock: pointer to the spinlock to use for locking. | ||
99 | * | 230 | * |
100 | * This function copies at most @len bytes from the FIFO into the | 231 | * This function copies at most @len bytes from the FIFO into the |
101 | * @buffer and returns the number of copied bytes. | 232 | * @to buffer and returns the number of copied bytes. |
102 | */ | 233 | */ |
103 | static inline unsigned int kfifo_get(struct kfifo *fifo, | 234 | static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, |
104 | unsigned char *buffer, unsigned int len) | 235 | void *to, unsigned int n, spinlock_t *lock) |
105 | { | 236 | { |
106 | unsigned long flags; | 237 | unsigned long flags; |
107 | unsigned int ret; | 238 | unsigned int ret; |
108 | 239 | ||
109 | spin_lock_irqsave(fifo->lock, flags); | 240 | spin_lock_irqsave(lock, flags); |
241 | |||
242 | ret = kfifo_out(fifo, to, n); | ||
243 | |||
244 | spin_unlock_irqrestore(lock, flags); | ||
245 | |||
246 | return ret; | ||
247 | } | ||
248 | |||
249 | extern void kfifo_skip(struct kfifo *fifo, unsigned int len); | ||
250 | |||
251 | extern __must_check int kfifo_from_user(struct kfifo *fifo, | ||
252 | const void __user *from, unsigned int n, unsigned *lenout); | ||
253 | |||
254 | extern __must_check int kfifo_to_user(struct kfifo *fifo, | ||
255 | void __user *to, unsigned int n, unsigned *lenout); | ||
256 | |||
257 | /* | ||
258 | * __kfifo_add_out internal helper function for updating the out offset | ||
259 | */ | ||
260 | static inline void __kfifo_add_out(struct kfifo *fifo, | ||
261 | unsigned int off) | ||
262 | { | ||
263 | smp_mb(); | ||
264 | fifo->out += off; | ||
265 | } | ||
266 | |||
267 | /* | ||
268 | * __kfifo_add_in internal helper function for updating the in offset | ||
269 | */ | ||
270 | static inline void __kfifo_add_in(struct kfifo *fifo, | ||
271 | unsigned int off) | ||
272 | { | ||
273 | smp_wmb(); | ||
274 | fifo->in += off; | ||
275 | } | ||
276 | |||
277 | /* | ||
278 | * __kfifo_off internal helper function for calculating the index of a | ||
279 | * given offeset | ||
280 | */ | ||
281 | static inline unsigned int __kfifo_off(struct kfifo *fifo, unsigned int off) | ||
282 | { | ||
283 | return off & (fifo->size - 1); | ||
284 | } | ||
285 | |||
286 | /* | ||
287 | * __kfifo_peek_n internal helper function for determinate the length of | ||
288 | * the next record in the fifo | ||
289 | */ | ||
290 | static inline unsigned int __kfifo_peek_n(struct kfifo *fifo, | ||
291 | unsigned int recsize) | ||
292 | { | ||
293 | #define __KFIFO_GET(fifo, off, shift) \ | ||
294 | ((fifo)->buffer[__kfifo_off((fifo), (fifo)->out+(off))] << (shift)) | ||
295 | |||
296 | unsigned int l; | ||
297 | |||
298 | l = __KFIFO_GET(fifo, 0, 0); | ||
299 | |||
300 | if (--recsize) | ||
301 | l |= __KFIFO_GET(fifo, 1, 8); | ||
302 | |||
303 | return l; | ||
304 | #undef __KFIFO_GET | ||
305 | } | ||
306 | |||
307 | /* | ||
308 | * __kfifo_poke_n internal helper function for storing the length of | ||
309 | * the next record into the fifo | ||
310 | */ | ||
311 | static inline void __kfifo_poke_n(struct kfifo *fifo, | ||
312 | unsigned int recsize, unsigned int n) | ||
313 | { | ||
314 | #define __KFIFO_PUT(fifo, off, val, shift) \ | ||
315 | ( \ | ||
316 | (fifo)->buffer[__kfifo_off((fifo), (fifo)->in+(off))] = \ | ||
317 | (unsigned char)((val) >> (shift)) \ | ||
318 | ) | ||
319 | |||
320 | __KFIFO_PUT(fifo, 0, n, 0); | ||
321 | |||
322 | if (--recsize) | ||
323 | __KFIFO_PUT(fifo, 1, n, 8); | ||
324 | #undef __KFIFO_PUT | ||
325 | } | ||
326 | |||
327 | /* | ||
328 | * __kfifo_in_... internal functions for put date into the fifo | ||
329 | * do not call it directly, use kfifo_in_rec() instead | ||
330 | */ | ||
331 | extern unsigned int __kfifo_in_n(struct kfifo *fifo, | ||
332 | const void *from, unsigned int n, unsigned int recsize); | ||
110 | 333 | ||
111 | ret = __kfifo_get(fifo, buffer, len); | 334 | extern unsigned int __kfifo_in_generic(struct kfifo *fifo, |
335 | const void *from, unsigned int n, unsigned int recsize); | ||
112 | 336 | ||
113 | /* | 337 | static inline unsigned int __kfifo_in_rec(struct kfifo *fifo, |
114 | * optimization: if the FIFO is empty, set the indices to 0 | 338 | const void *from, unsigned int n, unsigned int recsize) |
115 | * so we don't wrap the next time | 339 | { |
116 | */ | 340 | unsigned int ret; |
117 | if (fifo->in == fifo->out) | ||
118 | fifo->in = fifo->out = 0; | ||
119 | 341 | ||
120 | spin_unlock_irqrestore(fifo->lock, flags); | 342 | ret = __kfifo_in_n(fifo, from, n, recsize); |
121 | 343 | ||
344 | if (likely(ret == 0)) { | ||
345 | if (recsize) | ||
346 | __kfifo_poke_n(fifo, recsize, n); | ||
347 | __kfifo_add_in(fifo, n + recsize); | ||
348 | } | ||
122 | return ret; | 349 | return ret; |
123 | } | 350 | } |
124 | 351 | ||
125 | /** | 352 | /** |
126 | * __kfifo_len - returns the number of bytes available in the FIFO, no locking version | 353 | * kfifo_in_rec - puts some record data into the FIFO |
127 | * @fifo: the fifo to be used. | 354 | * @fifo: the fifo to be used. |
355 | * @from: the data to be added. | ||
356 | * @n: the length of the data to be added. | ||
357 | * @recsize: size of record field | ||
358 | * | ||
359 | * This function copies @n bytes from the @from into the FIFO and returns | ||
360 | * the number of bytes which cannot be copied. | ||
361 | * A returned value greater than the @n value means that the record doesn't | ||
362 | * fit into the buffer. | ||
363 | * | ||
364 | * Note that with only one concurrent reader and one concurrent | ||
365 | * writer, you don't need extra locking to use these functions. | ||
366 | */ | ||
367 | static inline __must_check unsigned int kfifo_in_rec(struct kfifo *fifo, | ||
368 | void *from, unsigned int n, unsigned int recsize) | ||
369 | { | ||
370 | if (!__builtin_constant_p(recsize)) | ||
371 | return __kfifo_in_generic(fifo, from, n, recsize); | ||
372 | return __kfifo_in_rec(fifo, from, n, recsize); | ||
373 | } | ||
374 | |||
375 | /* | ||
376 | * __kfifo_out_... internal functions for get date from the fifo | ||
377 | * do not call it directly, use kfifo_out_rec() instead | ||
128 | */ | 378 | */ |
129 | static inline unsigned int __kfifo_len(struct kfifo *fifo) | 379 | extern unsigned int __kfifo_out_n(struct kfifo *fifo, |
380 | void *to, unsigned int reclen, unsigned int recsize); | ||
381 | |||
382 | extern unsigned int __kfifo_out_generic(struct kfifo *fifo, | ||
383 | void *to, unsigned int n, | ||
384 | unsigned int recsize, unsigned int *total); | ||
385 | |||
386 | static inline unsigned int __kfifo_out_rec(struct kfifo *fifo, | ||
387 | void *to, unsigned int n, unsigned int recsize, | ||
388 | unsigned int *total) | ||
130 | { | 389 | { |
131 | return fifo->in - fifo->out; | 390 | unsigned int l; |
391 | |||
392 | if (!recsize) { | ||
393 | l = n; | ||
394 | if (total) | ||
395 | *total = l; | ||
396 | } else { | ||
397 | l = __kfifo_peek_n(fifo, recsize); | ||
398 | if (total) | ||
399 | *total = l; | ||
400 | if (n < l) | ||
401 | return l; | ||
402 | } | ||
403 | |||
404 | return __kfifo_out_n(fifo, to, l, recsize); | ||
132 | } | 405 | } |
133 | 406 | ||
134 | /** | 407 | /** |
135 | * kfifo_len - returns the number of bytes available in the FIFO | 408 | * kfifo_out_rec - gets some record data from the FIFO |
136 | * @fifo: the fifo to be used. | 409 | * @fifo: the fifo to be used. |
410 | * @to: where the data must be copied. | ||
411 | * @n: the size of the destination buffer. | ||
412 | * @recsize: size of record field | ||
413 | * @total: pointer where the total number of to copied bytes should stored | ||
414 | * | ||
415 | * This function copies at most @n bytes from the FIFO to @to and returns the | ||
416 | * number of bytes which cannot be copied. | ||
417 | * A returned value greater than the @n value means that the record doesn't | ||
418 | * fit into the @to buffer. | ||
419 | * | ||
420 | * Note that with only one concurrent reader and one concurrent | ||
421 | * writer, you don't need extra locking to use these functions. | ||
137 | */ | 422 | */ |
138 | static inline unsigned int kfifo_len(struct kfifo *fifo) | 423 | static inline __must_check unsigned int kfifo_out_rec(struct kfifo *fifo, |
424 | void *to, unsigned int n, unsigned int recsize, | ||
425 | unsigned int *total) | ||
426 | |||
139 | { | 427 | { |
140 | unsigned long flags; | 428 | if (!__builtin_constant_p(recsize)) |
141 | unsigned int ret; | 429 | return __kfifo_out_generic(fifo, to, n, recsize, total); |
430 | return __kfifo_out_rec(fifo, to, n, recsize, total); | ||
431 | } | ||
142 | 432 | ||
143 | spin_lock_irqsave(fifo->lock, flags); | 433 | /* |
434 | * __kfifo_from_user_... internal functions for transfer from user space into | ||
435 | * the fifo. do not call it directly, use kfifo_from_user_rec() instead | ||
436 | */ | ||
437 | extern unsigned int __kfifo_from_user_n(struct kfifo *fifo, | ||
438 | const void __user *from, unsigned int n, unsigned int recsize); | ||
439 | |||
440 | extern unsigned int __kfifo_from_user_generic(struct kfifo *fifo, | ||
441 | const void __user *from, unsigned int n, unsigned int recsize); | ||
144 | 442 | ||
145 | ret = __kfifo_len(fifo); | 443 | static inline unsigned int __kfifo_from_user_rec(struct kfifo *fifo, |
444 | const void __user *from, unsigned int n, unsigned int recsize) | ||
445 | { | ||
446 | unsigned int ret; | ||
146 | 447 | ||
147 | spin_unlock_irqrestore(fifo->lock, flags); | 448 | ret = __kfifo_from_user_n(fifo, from, n, recsize); |
148 | 449 | ||
450 | if (likely(ret == 0)) { | ||
451 | if (recsize) | ||
452 | __kfifo_poke_n(fifo, recsize, n); | ||
453 | __kfifo_add_in(fifo, n + recsize); | ||
454 | } | ||
149 | return ret; | 455 | return ret; |
150 | } | 456 | } |
151 | 457 | ||
458 | /** | ||
459 | * kfifo_from_user_rec - puts some data from user space into the FIFO | ||
460 | * @fifo: the fifo to be used. | ||
461 | * @from: pointer to the data to be added. | ||
462 | * @n: the length of the data to be added. | ||
463 | * @recsize: size of record field | ||
464 | * | ||
465 | * This function copies @n bytes from the @from into the | ||
466 | * FIFO and returns the number of bytes which cannot be copied. | ||
467 | * | ||
468 | * If the returned value is equal or less the @n value, the copy_from_user() | ||
469 | * functions has failed. Otherwise the record doesn't fit into the buffer. | ||
470 | * | ||
471 | * Note that with only one concurrent reader and one concurrent | ||
472 | * writer, you don't need extra locking to use these functions. | ||
473 | */ | ||
474 | static inline __must_check unsigned int kfifo_from_user_rec(struct kfifo *fifo, | ||
475 | const void __user *from, unsigned int n, unsigned int recsize) | ||
476 | { | ||
477 | if (!__builtin_constant_p(recsize)) | ||
478 | return __kfifo_from_user_generic(fifo, from, n, recsize); | ||
479 | return __kfifo_from_user_rec(fifo, from, n, recsize); | ||
480 | } | ||
481 | |||
482 | /* | ||
483 | * __kfifo_to_user_... internal functions for transfer fifo data into user space | ||
484 | * do not call it directly, use kfifo_to_user_rec() instead | ||
485 | */ | ||
486 | extern unsigned int __kfifo_to_user_n(struct kfifo *fifo, | ||
487 | void __user *to, unsigned int n, unsigned int reclen, | ||
488 | unsigned int recsize); | ||
489 | |||
490 | extern unsigned int __kfifo_to_user_generic(struct kfifo *fifo, | ||
491 | void __user *to, unsigned int n, unsigned int recsize, | ||
492 | unsigned int *total); | ||
493 | |||
494 | static inline unsigned int __kfifo_to_user_rec(struct kfifo *fifo, | ||
495 | void __user *to, unsigned int n, | ||
496 | unsigned int recsize, unsigned int *total) | ||
497 | { | ||
498 | unsigned int l; | ||
499 | |||
500 | if (!recsize) { | ||
501 | l = n; | ||
502 | if (total) | ||
503 | *total = l; | ||
504 | } else { | ||
505 | l = __kfifo_peek_n(fifo, recsize); | ||
506 | if (total) | ||
507 | *total = l; | ||
508 | if (n < l) | ||
509 | return l; | ||
510 | } | ||
511 | |||
512 | return __kfifo_to_user_n(fifo, to, n, l, recsize); | ||
513 | } | ||
514 | |||
515 | /** | ||
516 | * kfifo_to_user_rec - gets data from the FIFO and write it to user space | ||
517 | * @fifo: the fifo to be used. | ||
518 | * @to: where the data must be copied. | ||
519 | * @n: the size of the destination buffer. | ||
520 | * @recsize: size of record field | ||
521 | * @total: pointer where the total number of to copied bytes should stored | ||
522 | * | ||
523 | * This function copies at most @n bytes from the FIFO to the @to. | ||
524 | * In case of an error, the function returns the number of bytes which cannot | ||
525 | * be copied. | ||
526 | * If the returned value is equal or less the @n value, the copy_to_user() | ||
527 | * functions has failed. Otherwise the record doesn't fit into the @to buffer. | ||
528 | * | ||
529 | * Note that with only one concurrent reader and one concurrent | ||
530 | * writer, you don't need extra locking to use these functions. | ||
531 | */ | ||
532 | static inline __must_check unsigned int kfifo_to_user_rec(struct kfifo *fifo, | ||
533 | void __user *to, unsigned int n, unsigned int recsize, | ||
534 | unsigned int *total) | ||
535 | { | ||
536 | if (!__builtin_constant_p(recsize)) | ||
537 | return __kfifo_to_user_generic(fifo, to, n, recsize, total); | ||
538 | return __kfifo_to_user_rec(fifo, to, n, recsize, total); | ||
539 | } | ||
540 | |||
541 | /* | ||
542 | * __kfifo_peek_... internal functions for peek into the next fifo record | ||
543 | * do not call it directly, use kfifo_peek_rec() instead | ||
544 | */ | ||
545 | extern unsigned int __kfifo_peek_generic(struct kfifo *fifo, | ||
546 | unsigned int recsize); | ||
547 | |||
548 | /** | ||
549 | * kfifo_peek_rec - gets the size of the next FIFO record data | ||
550 | * @fifo: the fifo to be used. | ||
551 | * @recsize: size of record field | ||
552 | * | ||
553 | * This function returns the size of the next FIFO record in number of bytes | ||
554 | */ | ||
555 | static inline __must_check unsigned int kfifo_peek_rec(struct kfifo *fifo, | ||
556 | unsigned int recsize) | ||
557 | { | ||
558 | if (!__builtin_constant_p(recsize)) | ||
559 | return __kfifo_peek_generic(fifo, recsize); | ||
560 | if (!recsize) | ||
561 | return kfifo_len(fifo); | ||
562 | return __kfifo_peek_n(fifo, recsize); | ||
563 | } | ||
564 | |||
565 | /* | ||
566 | * __kfifo_skip_... internal functions for skip the next fifo record | ||
567 | * do not call it directly, use kfifo_skip_rec() instead | ||
568 | */ | ||
569 | extern void __kfifo_skip_generic(struct kfifo *fifo, unsigned int recsize); | ||
570 | |||
571 | static inline void __kfifo_skip_rec(struct kfifo *fifo, | ||
572 | unsigned int recsize) | ||
573 | { | ||
574 | unsigned int l; | ||
575 | |||
576 | if (recsize) { | ||
577 | l = __kfifo_peek_n(fifo, recsize); | ||
578 | |||
579 | if (l + recsize <= kfifo_len(fifo)) { | ||
580 | __kfifo_add_out(fifo, l + recsize); | ||
581 | return; | ||
582 | } | ||
583 | } | ||
584 | kfifo_reset_out(fifo); | ||
585 | } | ||
586 | |||
587 | /** | ||
588 | * kfifo_skip_rec - skip the next fifo out record | ||
589 | * @fifo: the fifo to be used. | ||
590 | * @recsize: size of record field | ||
591 | * | ||
592 | * This function skips the next FIFO record | ||
593 | */ | ||
594 | static inline void kfifo_skip_rec(struct kfifo *fifo, | ||
595 | unsigned int recsize) | ||
596 | { | ||
597 | if (!__builtin_constant_p(recsize)) | ||
598 | __kfifo_skip_generic(fifo, recsize); | ||
599 | else | ||
600 | __kfifo_skip_rec(fifo, recsize); | ||
601 | } | ||
602 | |||
603 | /** | ||
604 | * kfifo_avail_rec - returns the number of bytes available in a record FIFO | ||
605 | * @fifo: the fifo to be used. | ||
606 | * @recsize: size of record field | ||
607 | */ | ||
608 | static inline __must_check unsigned int kfifo_avail_rec(struct kfifo *fifo, | ||
609 | unsigned int recsize) | ||
610 | { | ||
611 | unsigned int l = kfifo_size(fifo) - kfifo_len(fifo); | ||
612 | |||
613 | return (l > recsize) ? l - recsize : 0; | ||
614 | } | ||
615 | |||
152 | #endif | 616 | #endif |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 6adcc297e354..19ec41a183f5 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -29,8 +29,7 @@ struct pt_regs; | |||
29 | * | 29 | * |
30 | * On some architectures it is required to skip a breakpoint | 30 | * On some architectures it is required to skip a breakpoint |
31 | * exception when it occurs after a breakpoint has been removed. | 31 | * exception when it occurs after a breakpoint has been removed. |
32 | * This can be implemented in the architecture specific portion of | 32 | * This can be implemented in the architecture specific portion of kgdb. |
33 | * for kgdb. | ||
34 | */ | 33 | */ |
35 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); | 34 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); |
36 | 35 | ||
@@ -65,7 +64,7 @@ struct uart_port; | |||
65 | /** | 64 | /** |
66 | * kgdb_breakpoint - compiled in breakpoint | 65 | * kgdb_breakpoint - compiled in breakpoint |
67 | * | 66 | * |
68 | * This will be impelmented a static inline per architecture. This | 67 | * This will be implemented as a static inline per architecture. This |
69 | * function is called by the kgdb core to execute an architecture | 68 | * function is called by the kgdb core to execute an architecture |
70 | * specific trap to cause kgdb to enter the exception processing. | 69 | * specific trap to cause kgdb to enter the exception processing. |
71 | * | 70 | * |
@@ -190,7 +189,7 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code, | |||
190 | * @flags: Current IRQ state | 189 | * @flags: Current IRQ state |
191 | * | 190 | * |
192 | * On SMP systems, we need to get the attention of the other CPUs | 191 | * On SMP systems, we need to get the attention of the other CPUs |
193 | * and get them be in a known state. This should do what is needed | 192 | * and get them into a known state. This should do what is needed |
194 | * to get the other CPUs to call kgdb_wait(). Note that on some arches, | 193 | * to get the other CPUs to call kgdb_wait(). Note that on some arches, |
195 | * the NMI approach is not used for rounding up all the CPUs. For example, | 194 | * the NMI approach is not used for rounding up all the CPUs. For example, |
196 | * in case of MIPS, smp_call_function() is used to roundup CPUs. In | 195 | * in case of MIPS, smp_call_function() is used to roundup CPUs. In |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index e880d4cf9e22..08d7dc4ddf40 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
@@ -36,6 +36,56 @@ int kmemcheck_hide_addr(unsigned long address); | |||
36 | 36 | ||
37 | bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); | 37 | bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); |
38 | 38 | ||
39 | /* | ||
40 | * Bitfield annotations | ||
41 | * | ||
42 | * How to use: If you have a struct using bitfields, for example | ||
43 | * | ||
44 | * struct a { | ||
45 | * int x:8, y:8; | ||
46 | * }; | ||
47 | * | ||
48 | * then this should be rewritten as | ||
49 | * | ||
50 | * struct a { | ||
51 | * kmemcheck_bitfield_begin(flags); | ||
52 | * int x:8, y:8; | ||
53 | * kmemcheck_bitfield_end(flags); | ||
54 | * }; | ||
55 | * | ||
56 | * Now the "flags_begin" and "flags_end" members may be used to refer to the | ||
57 | * beginning and end, respectively, of the bitfield (and things like | ||
58 | * &x.flags_begin is allowed). As soon as the struct is allocated, the bit- | ||
59 | * fields should be annotated: | ||
60 | * | ||
61 | * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL); | ||
62 | * kmemcheck_annotate_bitfield(a, flags); | ||
63 | */ | ||
64 | #define kmemcheck_bitfield_begin(name) \ | ||
65 | int name##_begin[0]; | ||
66 | |||
67 | #define kmemcheck_bitfield_end(name) \ | ||
68 | int name##_end[0]; | ||
69 | |||
70 | #define kmemcheck_annotate_bitfield(ptr, name) \ | ||
71 | do { \ | ||
72 | int _n; \ | ||
73 | \ | ||
74 | if (!ptr) \ | ||
75 | break; \ | ||
76 | \ | ||
77 | _n = (long) &((ptr)->name##_end) \ | ||
78 | - (long) &((ptr)->name##_begin); \ | ||
79 | MAYBE_BUILD_BUG_ON(_n < 0); \ | ||
80 | \ | ||
81 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | ||
82 | } while (0) | ||
83 | |||
84 | #define kmemcheck_annotate_variable(var) \ | ||
85 | do { \ | ||
86 | kmemcheck_mark_initialized(&(var), sizeof(var)); \ | ||
87 | } while (0) \ | ||
88 | |||
39 | #else | 89 | #else |
40 | #define kmemcheck_enabled 0 | 90 | #define kmemcheck_enabled 0 |
41 | 91 | ||
@@ -106,60 +156,16 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | |||
106 | return true; | 156 | return true; |
107 | } | 157 | } |
108 | 158 | ||
109 | #endif /* CONFIG_KMEMCHECK */ | 159 | #define kmemcheck_bitfield_begin(name) |
110 | 160 | #define kmemcheck_bitfield_end(name) | |
111 | /* | 161 | #define kmemcheck_annotate_bitfield(ptr, name) \ |
112 | * Bitfield annotations | 162 | do { \ |
113 | * | 163 | } while (0) |
114 | * How to use: If you have a struct using bitfields, for example | ||
115 | * | ||
116 | * struct a { | ||
117 | * int x:8, y:8; | ||
118 | * }; | ||
119 | * | ||
120 | * then this should be rewritten as | ||
121 | * | ||
122 | * struct a { | ||
123 | * kmemcheck_bitfield_begin(flags); | ||
124 | * int x:8, y:8; | ||
125 | * kmemcheck_bitfield_end(flags); | ||
126 | * }; | ||
127 | * | ||
128 | * Now the "flags_begin" and "flags_end" members may be used to refer to the | ||
129 | * beginning and end, respectively, of the bitfield (and things like | ||
130 | * &x.flags_begin is allowed). As soon as the struct is allocated, the bit- | ||
131 | * fields should be annotated: | ||
132 | * | ||
133 | * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL); | ||
134 | * kmemcheck_annotate_bitfield(a, flags); | ||
135 | * | ||
136 | * Note: We provide the same definitions for both kmemcheck and non- | ||
137 | * kmemcheck kernels. This makes it harder to introduce accidental errors. It | ||
138 | * is also allowed to pass NULL pointers to kmemcheck_annotate_bitfield(). | ||
139 | */ | ||
140 | #define kmemcheck_bitfield_begin(name) \ | ||
141 | int name##_begin[0]; | ||
142 | |||
143 | #define kmemcheck_bitfield_end(name) \ | ||
144 | int name##_end[0]; | ||
145 | 164 | ||
146 | #define kmemcheck_annotate_bitfield(ptr, name) \ | 165 | #define kmemcheck_annotate_variable(var) \ |
147 | do { \ | 166 | do { \ |
148 | int _n; \ | ||
149 | \ | ||
150 | if (!ptr) \ | ||
151 | break; \ | ||
152 | \ | ||
153 | _n = (long) &((ptr)->name##_end) \ | ||
154 | - (long) &((ptr)->name##_begin); \ | ||
155 | MAYBE_BUILD_BUG_ON(_n < 0); \ | ||
156 | \ | ||
157 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | ||
158 | } while (0) | 167 | } while (0) |
159 | 168 | ||
160 | #define kmemcheck_annotate_variable(var) \ | 169 | #endif /* CONFIG_KMEMCHECK */ |
161 | do { \ | ||
162 | kmemcheck_mark_initialized(&(var), sizeof(var)); \ | ||
163 | } while (0) \ | ||
164 | 170 | ||
165 | #endif /* LINUX_KMEMCHECK_H */ | 171 | #endif /* LINUX_KMEMCHECK_H */ |
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h index 3c7497d46ee9..99d9a6766f7e 100644 --- a/include/linux/kmemleak.h +++ b/include/linux/kmemleak.h | |||
@@ -32,8 +32,7 @@ extern void kmemleak_padding(const void *ptr, unsigned long offset, | |||
32 | size_t size) __ref; | 32 | size_t size) __ref; |
33 | extern void kmemleak_not_leak(const void *ptr) __ref; | 33 | extern void kmemleak_not_leak(const void *ptr) __ref; |
34 | extern void kmemleak_ignore(const void *ptr) __ref; | 34 | extern void kmemleak_ignore(const void *ptr) __ref; |
35 | extern void kmemleak_scan_area(const void *ptr, unsigned long offset, | 35 | extern void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp) __ref; |
36 | size_t length, gfp_t gfp) __ref; | ||
37 | extern void kmemleak_no_scan(const void *ptr) __ref; | 36 | extern void kmemleak_no_scan(const void *ptr) __ref; |
38 | 37 | ||
39 | static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, | 38 | static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, |
@@ -84,8 +83,7 @@ static inline void kmemleak_not_leak(const void *ptr) | |||
84 | static inline void kmemleak_ignore(const void *ptr) | 83 | static inline void kmemleak_ignore(const void *ptr) |
85 | { | 84 | { |
86 | } | 85 | } |
87 | static inline void kmemleak_scan_area(const void *ptr, unsigned long offset, | 86 | static inline void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp) |
88 | size_t length, gfp_t gfp) | ||
89 | { | 87 | { |
90 | } | 88 | } |
91 | static inline void kmemleak_erase(void **ptr) | 89 | static inline void kmemleak_erase(void **ptr) |
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h index e32aa268efac..24b44145a886 100644 --- a/include/linux/kmsg_dump.h +++ b/include/linux/kmsg_dump.h | |||
@@ -17,6 +17,7 @@ | |||
17 | enum kmsg_dump_reason { | 17 | enum kmsg_dump_reason { |
18 | KMSG_DUMP_OOPS, | 18 | KMSG_DUMP_OOPS, |
19 | KMSG_DUMP_PANIC, | 19 | KMSG_DUMP_PANIC, |
20 | KMSG_DUMP_KEXEC, | ||
20 | }; | 21 | }; |
21 | 22 | ||
22 | /** | 23 | /** |
diff --git a/include/linux/leds-lp3944.h b/include/linux/leds-lp3944.h index afc9f9fd70f5..2618aa9063bc 100644 --- a/include/linux/leds-lp3944.h +++ b/include/linux/leds-lp3944.h | |||
@@ -12,9 +12,6 @@ | |||
12 | #ifndef __LINUX_LEDS_LP3944_H | 12 | #ifndef __LINUX_LEDS_LP3944_H |
13 | #define __LINUX_LEDS_LP3944_H | 13 | #define __LINUX_LEDS_LP3944_H |
14 | 14 | ||
15 | #include <linux/leds.h> | ||
16 | #include <linux/workqueue.h> | ||
17 | |||
18 | #define LP3944_LED0 0 | 15 | #define LP3944_LED0 0 |
19 | #define LP3944_LED1 1 | 16 | #define LP3944_LED1 1 |
20 | #define LP3944_LED2 2 | 17 | #define LP3944_LED2 2 |
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h index 96eea90f01a8..f158eb1149aa 100644 --- a/include/linux/leds-pca9532.h +++ b/include/linux/leds-pca9532.h | |||
@@ -32,7 +32,7 @@ struct pca9532_led { | |||
32 | struct i2c_client *client; | 32 | struct i2c_client *client; |
33 | char *name; | 33 | char *name; |
34 | struct led_classdev ldev; | 34 | struct led_classdev ldev; |
35 | struct work_struct work; | 35 | struct work_struct work; |
36 | enum pca9532_type type; | 36 | enum pca9532_type type; |
37 | enum pca9532_state state; | 37 | enum pca9532_state state; |
38 | }; | 38 | }; |
diff --git a/include/linux/leds-regulator.h b/include/linux/leds-regulator.h new file mode 100644 index 000000000000..5a8eb389aab8 --- /dev/null +++ b/include/linux/leds-regulator.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * leds-regulator.h - platform data structure for regulator driven LEDs. | ||
3 | * | ||
4 | * Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it> | ||
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 | */ | ||
11 | |||
12 | #ifndef __LINUX_LEDS_REGULATOR_H | ||
13 | #define __LINUX_LEDS_REGULATOR_H | ||
14 | |||
15 | /* | ||
16 | * Use "vled" as supply id when declaring the regulator consumer: | ||
17 | * | ||
18 | * static struct regulator_consumer_supply pcap_regulator_VVIB_consumers [] = { | ||
19 | * { .dev_name = "leds-regulator.0", supply = "vled" }, | ||
20 | * }; | ||
21 | * | ||
22 | * If you have several regulator driven LEDs, you can append a numerical id to | ||
23 | * .dev_name as done above, and use the same id when declaring the platform | ||
24 | * device: | ||
25 | * | ||
26 | * static struct led_regulator_platform_data a780_vibrator_data = { | ||
27 | * .name = "a780::vibrator", | ||
28 | * }; | ||
29 | * | ||
30 | * static struct platform_device a780_vibrator = { | ||
31 | * .name = "leds-regulator", | ||
32 | * .id = 0, | ||
33 | * .dev = { | ||
34 | * .platform_data = &a780_vibrator_data, | ||
35 | * }, | ||
36 | * }; | ||
37 | */ | ||
38 | |||
39 | #include <linux/leds.h> | ||
40 | |||
41 | struct led_regulator_platform_data { | ||
42 | char *name; /* LED name as expected by LED class */ | ||
43 | enum led_brightness brightness; /* initial brightness value */ | ||
44 | }; | ||
45 | |||
46 | #endif /* __LINUX_LEDS_REGULATOR_H */ | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 6a9c4ddd3d95..73112250862c 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -354,6 +354,9 @@ enum { | |||
354 | /* max tries if error condition is still set after ->error_handler */ | 354 | /* max tries if error condition is still set after ->error_handler */ |
355 | ATA_EH_MAX_TRIES = 5, | 355 | ATA_EH_MAX_TRIES = 5, |
356 | 356 | ||
357 | /* sometimes resuming a link requires several retries */ | ||
358 | ATA_LINK_RESUME_TRIES = 5, | ||
359 | |||
357 | /* how hard are we gonna try to probe/recover devices */ | 360 | /* how hard are we gonna try to probe/recover devices */ |
358 | ATA_PROBE_MAX_TRIES = 3, | 361 | ATA_PROBE_MAX_TRIES = 3, |
359 | ATA_EH_DEV_TRIES = 3, | 362 | ATA_EH_DEV_TRIES = 3, |
diff --git a/include/linux/list.h b/include/linux/list.h index 969f6e92d089..5d9c6558e8ab 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -206,6 +206,20 @@ static inline int list_empty_careful(const struct list_head *head) | |||
206 | } | 206 | } |
207 | 207 | ||
208 | /** | 208 | /** |
209 | * list_rotate_left - rotate the list to the left | ||
210 | * @head: the head of the list | ||
211 | */ | ||
212 | static inline void list_rotate_left(struct list_head *head) | ||
213 | { | ||
214 | struct list_head *first; | ||
215 | |||
216 | if (!list_empty(head)) { | ||
217 | first = head->next; | ||
218 | list_move_tail(first, head); | ||
219 | } | ||
220 | } | ||
221 | |||
222 | /** | ||
209 | * list_is_singular - tests whether a list has just one entry. | 223 | * list_is_singular - tests whether a list has just one entry. |
210 | * @head: the list to test. | 224 | * @head: the list to test. |
211 | */ | 225 | */ |
diff --git a/include/linux/list_sort.h b/include/linux/list_sort.h new file mode 100644 index 000000000000..1a2df2efb771 --- /dev/null +++ b/include/linux/list_sort.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef _LINUX_LIST_SORT_H | ||
2 | #define _LINUX_LIST_SORT_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct list_head; | ||
7 | |||
8 | void list_sort(void *priv, struct list_head *head, | ||
9 | int (*cmp)(void *priv, struct list_head *a, | ||
10 | struct list_head *b)); | ||
11 | #endif | ||
diff --git a/include/linux/lmb.h b/include/linux/lmb.h index ef82b8fcbddb..f3d14333ebed 100644 --- a/include/linux/lmb.h +++ b/include/linux/lmb.h | |||
@@ -42,6 +42,7 @@ extern void __init lmb_init(void); | |||
42 | extern void __init lmb_analyze(void); | 42 | extern void __init lmb_analyze(void); |
43 | extern long lmb_add(u64 base, u64 size); | 43 | extern long lmb_add(u64 base, u64 size); |
44 | extern long lmb_remove(u64 base, u64 size); | 44 | extern long lmb_remove(u64 base, u64 size); |
45 | extern long __init lmb_free(u64 base, u64 size); | ||
45 | extern long __init lmb_reserve(u64 base, u64 size); | 46 | extern long __init lmb_reserve(u64 base, u64 size); |
46 | extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid, | 47 | extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid, |
47 | u64 (*nid_range)(u64, u64, int *)); | 48 | u64 (*nid_range)(u64, u64, int *)); |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 9ccf0e286b2a..10206a87da19 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -534,4 +534,8 @@ do { \ | |||
534 | # define might_lock_read(lock) do { } while (0) | 534 | # define might_lock_read(lock) do { } while (0) |
535 | #endif | 535 | #endif |
536 | 536 | ||
537 | #ifdef CONFIG_PROVE_RCU | ||
538 | extern void lockdep_rcu_dereference(const char *file, const int line); | ||
539 | #endif | ||
540 | |||
537 | #endif /* __LINUX_LOCKDEP_H */ | 541 | #endif /* __LINUX_LOCKDEP_H */ |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 37fa19b34ef5..1adfe779eb99 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -50,6 +50,19 @@ struct memory_notify { | |||
50 | int status_change_nid; | 50 | int status_change_nid; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | /* | ||
54 | * During pageblock isolation, count the number of pages within the | ||
55 | * range [start_pfn, start_pfn + nr_pages) which are owned by code | ||
56 | * in the notifier chain. | ||
57 | */ | ||
58 | #define MEM_ISOLATE_COUNT (1<<0) | ||
59 | |||
60 | struct memory_isolate_notify { | ||
61 | unsigned long start_pfn; /* Start of range to check */ | ||
62 | unsigned int nr_pages; /* # pages in range to check */ | ||
63 | unsigned int pages_found; /* # pages owned found by callbacks */ | ||
64 | }; | ||
65 | |||
53 | struct notifier_block; | 66 | struct notifier_block; |
54 | struct mem_section; | 67 | struct mem_section; |
55 | 68 | ||
@@ -76,14 +89,28 @@ static inline int memory_notify(unsigned long val, void *v) | |||
76 | { | 89 | { |
77 | return 0; | 90 | return 0; |
78 | } | 91 | } |
92 | static inline int register_memory_isolate_notifier(struct notifier_block *nb) | ||
93 | { | ||
94 | return 0; | ||
95 | } | ||
96 | static inline void unregister_memory_isolate_notifier(struct notifier_block *nb) | ||
97 | { | ||
98 | } | ||
99 | static inline int memory_isolate_notify(unsigned long val, void *v) | ||
100 | { | ||
101 | return 0; | ||
102 | } | ||
79 | #else | 103 | #else |
80 | extern int register_memory_notifier(struct notifier_block *nb); | 104 | extern int register_memory_notifier(struct notifier_block *nb); |
81 | extern void unregister_memory_notifier(struct notifier_block *nb); | 105 | extern void unregister_memory_notifier(struct notifier_block *nb); |
106 | extern int register_memory_isolate_notifier(struct notifier_block *nb); | ||
107 | extern void unregister_memory_isolate_notifier(struct notifier_block *nb); | ||
82 | extern int register_new_memory(int, struct mem_section *); | 108 | extern int register_new_memory(int, struct mem_section *); |
83 | extern int unregister_memory_section(struct mem_section *); | 109 | extern int unregister_memory_section(struct mem_section *); |
84 | extern int memory_dev_init(void); | 110 | extern int memory_dev_init(void); |
85 | extern int remove_memory_block(unsigned long, struct mem_section *, int); | 111 | extern int remove_memory_block(unsigned long, struct mem_section *, int); |
86 | extern int memory_notify(unsigned long val, void *v); | 112 | extern int memory_notify(unsigned long val, void *v); |
113 | extern int memory_isolate_notify(unsigned long val, void *v); | ||
87 | extern struct memory_block *find_memory_block(struct mem_section *); | 114 | extern struct memory_block *find_memory_block(struct mem_section *); |
88 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | 115 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
89 | enum mem_add_context { BOOT, HOTPLUG }; | 116 | enum mem_add_context { BOOT, HOTPLUG }; |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 6b9c5d06690c..9cb1834deffa 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define MFD_TMIO_H | 2 | #define MFD_TMIO_H |
3 | 3 | ||
4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
5 | #include <linux/io.h> | ||
6 | #include <linux/platform_device.h> | ||
5 | 7 | ||
6 | #define tmio_ioread8(addr) readb(addr) | 8 | #define tmio_ioread8(addr) readb(addr) |
7 | #define tmio_ioread16(addr) readw(addr) | 9 | #define tmio_ioread16(addr) readw(addr) |
@@ -18,11 +20,48 @@ | |||
18 | writew((val) >> 16, (addr) + 2); \ | 20 | writew((val) >> 16, (addr) + 2); \ |
19 | } while (0) | 21 | } while (0) |
20 | 22 | ||
23 | #define CNF_CMD 0x04 | ||
24 | #define CNF_CTL_BASE 0x10 | ||
25 | #define CNF_INT_PIN 0x3d | ||
26 | #define CNF_STOP_CLK_CTL 0x40 | ||
27 | #define CNF_GCLK_CTL 0x41 | ||
28 | #define CNF_SD_CLK_MODE 0x42 | ||
29 | #define CNF_PIN_STATUS 0x44 | ||
30 | #define CNF_PWR_CTL_1 0x48 | ||
31 | #define CNF_PWR_CTL_2 0x49 | ||
32 | #define CNF_PWR_CTL_3 0x4a | ||
33 | #define CNF_CARD_DETECT_MODE 0x4c | ||
34 | #define CNF_SD_SLOT 0x50 | ||
35 | #define CNF_EXT_GCLK_CTL_1 0xf0 | ||
36 | #define CNF_EXT_GCLK_CTL_2 0xf1 | ||
37 | #define CNF_EXT_GCLK_CTL_3 0xf9 | ||
38 | #define CNF_SD_LED_EN_1 0xfa | ||
39 | #define CNF_SD_LED_EN_2 0xfe | ||
40 | |||
41 | #define SDCREN 0x2 /* Enable access to MMC CTL regs. (flag in COMMAND_REG)*/ | ||
42 | |||
43 | #define sd_config_write8(base, shift, reg, val) \ | ||
44 | tmio_iowrite8((val), (base) + ((reg) << (shift))) | ||
45 | #define sd_config_write16(base, shift, reg, val) \ | ||
46 | tmio_iowrite16((val), (base) + ((reg) << (shift))) | ||
47 | #define sd_config_write32(base, shift, reg, val) \ | ||
48 | do { \ | ||
49 | tmio_iowrite16((val), (base) + ((reg) << (shift))); \ | ||
50 | tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \ | ||
51 | } while (0) | ||
52 | |||
53 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | ||
54 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | ||
55 | void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); | ||
56 | void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); | ||
57 | |||
21 | /* | 58 | /* |
22 | * data for the MMC controller | 59 | * data for the MMC controller |
23 | */ | 60 | */ |
24 | struct tmio_mmc_data { | 61 | struct tmio_mmc_data { |
25 | const unsigned int hclk; | 62 | const unsigned int hclk; |
63 | void (*set_pwr)(struct platform_device *host, int state); | ||
64 | void (*set_clk_div)(struct platform_device *host, int state); | ||
26 | }; | 65 | }; |
27 | 66 | ||
28 | /* | 67 | /* |
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h index be3264e286e0..e786fe9841ef 100644 --- a/include/linux/mfd/wm8350/pmic.h +++ b/include/linux/mfd/wm8350/pmic.h | |||
@@ -666,20 +666,20 @@ | |||
666 | #define WM8350_ISINK_FLASH_DUR_64MS (1 << 8) | 666 | #define WM8350_ISINK_FLASH_DUR_64MS (1 << 8) |
667 | #define WM8350_ISINK_FLASH_DUR_96MS (2 << 8) | 667 | #define WM8350_ISINK_FLASH_DUR_96MS (2 << 8) |
668 | #define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8) | 668 | #define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8) |
669 | #define WM8350_ISINK_FLASH_ON_INSTANT (0 << 4) | 669 | #define WM8350_ISINK_FLASH_ON_INSTANT (0 << 0) |
670 | #define WM8350_ISINK_FLASH_ON_0_25S (1 << 4) | 670 | #define WM8350_ISINK_FLASH_ON_0_25S (1 << 0) |
671 | #define WM8350_ISINK_FLASH_ON_0_50S (2 << 4) | 671 | #define WM8350_ISINK_FLASH_ON_0_50S (2 << 0) |
672 | #define WM8350_ISINK_FLASH_ON_1_00S (3 << 4) | 672 | #define WM8350_ISINK_FLASH_ON_1_00S (3 << 0) |
673 | #define WM8350_ISINK_FLASH_ON_1_95S (1 << 4) | 673 | #define WM8350_ISINK_FLASH_ON_1_95S (1 << 0) |
674 | #define WM8350_ISINK_FLASH_ON_3_91S (2 << 4) | 674 | #define WM8350_ISINK_FLASH_ON_3_91S (2 << 0) |
675 | #define WM8350_ISINK_FLASH_ON_7_80S (3 << 4) | 675 | #define WM8350_ISINK_FLASH_ON_7_80S (3 << 0) |
676 | #define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 0) | 676 | #define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 4) |
677 | #define WM8350_ISINK_FLASH_OFF_0_25S (1 << 0) | 677 | #define WM8350_ISINK_FLASH_OFF_0_25S (1 << 4) |
678 | #define WM8350_ISINK_FLASH_OFF_0_50S (2 << 0) | 678 | #define WM8350_ISINK_FLASH_OFF_0_50S (2 << 4) |
679 | #define WM8350_ISINK_FLASH_OFF_1_00S (3 << 0) | 679 | #define WM8350_ISINK_FLASH_OFF_1_00S (3 << 4) |
680 | #define WM8350_ISINK_FLASH_OFF_1_95S (1 << 0) | 680 | #define WM8350_ISINK_FLASH_OFF_1_95S (1 << 4) |
681 | #define WM8350_ISINK_FLASH_OFF_3_91S (2 << 0) | 681 | #define WM8350_ISINK_FLASH_OFF_3_91S (2 << 4) |
682 | #define WM8350_ISINK_FLASH_OFF_7_80S (3 << 0) | 682 | #define WM8350_ISINK_FLASH_OFF_7_80S (3 << 4) |
683 | 683 | ||
684 | /* | 684 | /* |
685 | * Regulator Interrupts. | 685 | * Regulator Interrupts. |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 849b4a61bd8f..8b2fa8593c61 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -265,6 +265,8 @@ static inline int get_page_unless_zero(struct page *page) | |||
265 | return atomic_inc_not_zero(&page->_count); | 265 | return atomic_inc_not_zero(&page->_count); |
266 | } | 266 | } |
267 | 267 | ||
268 | extern int page_is_ram(unsigned long pfn); | ||
269 | |||
268 | /* Support for virtually mapped pages */ | 270 | /* Support for virtually mapped pages */ |
269 | struct page *vmalloc_to_page(const void *addr); | 271 | struct page *vmalloc_to_page(const void *addr); |
270 | unsigned long vmalloc_to_pfn(const void *addr); | 272 | unsigned long vmalloc_to_pfn(const void *addr); |
@@ -1037,6 +1039,9 @@ extern void add_active_range(unsigned int nid, unsigned long start_pfn, | |||
1037 | extern void remove_active_range(unsigned int nid, unsigned long start_pfn, | 1039 | extern void remove_active_range(unsigned int nid, unsigned long start_pfn, |
1038 | unsigned long end_pfn); | 1040 | unsigned long end_pfn); |
1039 | extern void remove_all_active_ranges(void); | 1041 | extern void remove_all_active_ranges(void); |
1042 | void sort_node_map(void); | ||
1043 | unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, | ||
1044 | unsigned long end_pfn); | ||
1040 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, | 1045 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, |
1041 | unsigned long end_pfn); | 1046 | unsigned long end_pfn); |
1042 | extern void get_pfn_range_for_nid(unsigned int nid, | 1047 | extern void get_pfn_range_for_nid(unsigned int nid, |
@@ -1086,6 +1091,7 @@ extern void zone_pcp_update(struct zone *zone); | |||
1086 | 1091 | ||
1087 | /* nommu.c */ | 1092 | /* nommu.c */ |
1088 | extern atomic_long_t mmap_pages_allocated; | 1093 | extern atomic_long_t mmap_pages_allocated; |
1094 | extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); | ||
1089 | 1095 | ||
1090 | /* prio_tree.c */ | 1096 | /* prio_tree.c */ |
1091 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); | 1097 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 84a524afb3dc..36f96271306c 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -122,7 +122,9 @@ struct vm_region { | |||
122 | unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ | 122 | unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ |
123 | struct file *vm_file; /* the backing file or NULL */ | 123 | struct file *vm_file; /* the backing file or NULL */ |
124 | 124 | ||
125 | atomic_t vm_usage; /* region usage count */ | 125 | int vm_usage; /* region usage count (access under nommu_region_sem) */ |
126 | bool vm_icache_flushed : 1; /* true if the icache has been flushed for | ||
127 | * this region */ | ||
126 | }; | 128 | }; |
127 | 129 | ||
128 | /* | 130 | /* |
@@ -203,10 +205,12 @@ struct mm_struct { | |||
203 | struct vm_area_struct * mmap; /* list of VMAs */ | 205 | struct vm_area_struct * mmap; /* list of VMAs */ |
204 | struct rb_root mm_rb; | 206 | struct rb_root mm_rb; |
205 | struct vm_area_struct * mmap_cache; /* last find_vma result */ | 207 | struct vm_area_struct * mmap_cache; /* last find_vma result */ |
208 | #ifdef CONFIG_MMU | ||
206 | unsigned long (*get_unmapped_area) (struct file *filp, | 209 | unsigned long (*get_unmapped_area) (struct file *filp, |
207 | unsigned long addr, unsigned long len, | 210 | unsigned long addr, unsigned long len, |
208 | unsigned long pgoff, unsigned long flags); | 211 | unsigned long pgoff, unsigned long flags); |
209 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); | 212 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); |
213 | #endif | ||
210 | unsigned long mmap_base; /* base of mmap area */ | 214 | unsigned long mmap_base; /* base of mmap area */ |
211 | unsigned long task_size; /* size of task vm space */ | 215 | unsigned long task_size; /* size of task vm space */ |
212 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ | 216 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ |
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h index d9ebf1037dfa..d74785c2393a 100644 --- a/include/linux/mnt_namespace.h +++ b/include/linux/mnt_namespace.h | |||
@@ -23,6 +23,7 @@ struct proc_mounts { | |||
23 | 23 | ||
24 | struct fs_struct; | 24 | struct fs_struct; |
25 | 25 | ||
26 | extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt); | ||
26 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, | 27 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, |
27 | struct fs_struct *); | 28 | struct fs_struct *); |
28 | extern void put_mnt_ns(struct mnt_namespace *ns); | 29 | extern void put_mnt_ns(struct mnt_namespace *ns); |
diff --git a/include/linux/mtd/pismo.h b/include/linux/mtd/pismo.h new file mode 100644 index 000000000000..8dfb7e1421c5 --- /dev/null +++ b/include/linux/mtd/pismo.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * PISMO memory driver - http://www.pismoworld.org/ | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License. | ||
7 | */ | ||
8 | #ifndef __LINUX_MTD_PISMO_H | ||
9 | #define __LINUX_MTD_PISMO_H | ||
10 | |||
11 | struct pismo_pdata { | ||
12 | void (*set_vpp)(void *, int); | ||
13 | void *vpp_data; | ||
14 | phys_addr_t cs_addrs[5]; | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h index e77c1cea404d..ab77609ec337 100644 --- a/include/linux/mtd/sh_flctl.h +++ b/include/linux/mtd/sh_flctl.h | |||
@@ -51,6 +51,8 @@ | |||
51 | #define _4ECCCNTEN (0x1 << 24) | 51 | #define _4ECCCNTEN (0x1 << 24) |
52 | #define _4ECCEN (0x1 << 23) | 52 | #define _4ECCEN (0x1 << 23) |
53 | #define _4ECCCORRECT (0x1 << 22) | 53 | #define _4ECCCORRECT (0x1 << 22) |
54 | #define SHBUSSEL (0x1 << 20) | ||
55 | #define SEL_16BIT (0x1 << 19) | ||
54 | #define SNAND_E (0x1 << 18) /* SNAND (0=512 1=2048)*/ | 56 | #define SNAND_E (0x1 << 18) /* SNAND (0=512 1=2048)*/ |
55 | #define QTSEL_E (0x1 << 17) | 57 | #define QTSEL_E (0x1 << 17) |
56 | #define ENDIAN (0x1 << 16) /* 1 = little endian */ | 58 | #define ENDIAN (0x1 << 16) /* 1 = little endian */ |
@@ -96,6 +98,7 @@ | |||
96 | struct sh_flctl { | 98 | struct sh_flctl { |
97 | struct mtd_info mtd; | 99 | struct mtd_info mtd; |
98 | struct nand_chip chip; | 100 | struct nand_chip chip; |
101 | struct platform_device *pdev; | ||
99 | void __iomem *reg; | 102 | void __iomem *reg; |
100 | 103 | ||
101 | uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */ | 104 | uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */ |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 028946750289..05b441d93642 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -72,8 +72,6 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *, | |||
72 | 72 | ||
73 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, | 73 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, |
74 | int (*open)(struct inode *, struct file *)); | 74 | int (*open)(struct inode *, struct file *)); |
75 | extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | ||
76 | extern void release_open_intent(struct nameidata *); | ||
77 | 75 | ||
78 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); | 76 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); |
79 | 77 | ||
diff --git a/include/linux/of.h b/include/linux/of.h index e7facd8fbce8..f6d9cbc39c9c 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -19,6 +19,11 @@ | |||
19 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
20 | #include <linux/kref.h> | 20 | #include <linux/kref.h> |
21 | #include <linux/mod_devicetable.h> | 21 | #include <linux/mod_devicetable.h> |
22 | #include <linux/spinlock.h> | ||
23 | |||
24 | #include <asm/byteorder.h> | ||
25 | |||
26 | #ifdef CONFIG_OF | ||
22 | 27 | ||
23 | typedef u32 phandle; | 28 | typedef u32 phandle; |
24 | typedef u32 ihandle; | 29 | typedef u32 ihandle; |
@@ -39,10 +44,7 @@ struct of_irq_controller; | |||
39 | struct device_node { | 44 | struct device_node { |
40 | const char *name; | 45 | const char *name; |
41 | const char *type; | 46 | const char *type; |
42 | phandle node; | 47 | phandle phandle; |
43 | #if !defined(CONFIG_SPARC) | ||
44 | phandle linux_phandle; | ||
45 | #endif | ||
46 | char *full_name; | 48 | char *full_name; |
47 | 49 | ||
48 | struct property *properties; | 50 | struct property *properties; |
@@ -63,6 +65,11 @@ struct device_node { | |||
63 | #endif | 65 | #endif |
64 | }; | 66 | }; |
65 | 67 | ||
68 | /* Pointer for first entry in chain of all nodes. */ | ||
69 | extern struct device_node *allnodes; | ||
70 | extern struct device_node *of_chosen; | ||
71 | extern rwlock_t devtree_lock; | ||
72 | |||
66 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | 73 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) |
67 | { | 74 | { |
68 | return test_bit(flag, &n->_flags); | 75 | return test_bit(flag, &n->_flags); |
@@ -73,12 +80,6 @@ static inline void of_node_set_flag(struct device_node *n, unsigned long flag) | |||
73 | set_bit(flag, &n->_flags); | 80 | set_bit(flag, &n->_flags); |
74 | } | 81 | } |
75 | 82 | ||
76 | static inline void | ||
77 | set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | ||
78 | { | ||
79 | dn->pde = de; | ||
80 | } | ||
81 | |||
82 | extern struct device_node *of_find_all_nodes(struct device_node *prev); | 83 | extern struct device_node *of_find_all_nodes(struct device_node *prev); |
83 | 84 | ||
84 | #if defined(CONFIG_SPARC) | 85 | #if defined(CONFIG_SPARC) |
@@ -101,26 +102,36 @@ extern void of_node_put(struct device_node *node); | |||
101 | */ | 102 | */ |
102 | 103 | ||
103 | /* Helper to read a big number; size is in cells (not bytes) */ | 104 | /* Helper to read a big number; size is in cells (not bytes) */ |
104 | static inline u64 of_read_number(const u32 *cell, int size) | 105 | static inline u64 of_read_number(const __be32 *cell, int size) |
105 | { | 106 | { |
106 | u64 r = 0; | 107 | u64 r = 0; |
107 | while (size--) | 108 | while (size--) |
108 | r = (r << 32) | *(cell++); | 109 | r = (r << 32) | be32_to_cpu(*(cell++)); |
109 | return r; | 110 | return r; |
110 | } | 111 | } |
111 | 112 | ||
112 | /* Like of_read_number, but we want an unsigned long result */ | 113 | /* Like of_read_number, but we want an unsigned long result */ |
113 | #ifdef CONFIG_PPC32 | 114 | static inline unsigned long of_read_ulong(const __be32 *cell, int size) |
114 | static inline unsigned long of_read_ulong(const u32 *cell, int size) | ||
115 | { | 115 | { |
116 | return cell[size-1]; | 116 | /* toss away upper bits if unsigned long is smaller than u64 */ |
117 | return of_read_number(cell, size); | ||
117 | } | 118 | } |
118 | #else | ||
119 | #define of_read_ulong(cell, size) of_read_number(cell, size) | ||
120 | #endif | ||
121 | 119 | ||
122 | #include <asm/prom.h> | 120 | #include <asm/prom.h> |
123 | 121 | ||
122 | /* Default #address and #size cells. Allow arch asm/prom.h to override */ | ||
123 | #if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT) | ||
124 | #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 | ||
125 | #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 | ||
126 | #endif | ||
127 | |||
128 | /* Default string compare functions, Allow arch asm/prom.h to override */ | ||
129 | #if !defined(of_compat_cmp) | ||
130 | #define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l)) | ||
131 | #define of_prop_cmp(s1, s2) strcmp((s1), (s2)) | ||
132 | #define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) | ||
133 | #endif | ||
134 | |||
124 | /* flag descriptions */ | 135 | /* flag descriptions */ |
125 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | 136 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ |
126 | #define OF_DETACHED 2 /* node has been detached from the device tree */ | 137 | #define OF_DETACHED 2 /* node has been detached from the device tree */ |
@@ -187,4 +198,19 @@ extern int of_parse_phandles_with_args(struct device_node *np, | |||
187 | const char *list_name, const char *cells_name, int index, | 198 | const char *list_name, const char *cells_name, int index, |
188 | struct device_node **out_node, const void **out_args); | 199 | struct device_node **out_node, const void **out_args); |
189 | 200 | ||
201 | extern int of_machine_is_compatible(const char *compat); | ||
202 | |||
203 | extern int prom_add_property(struct device_node* np, struct property* prop); | ||
204 | extern int prom_remove_property(struct device_node *np, struct property *prop); | ||
205 | extern int prom_update_property(struct device_node *np, | ||
206 | struct property *newprop, | ||
207 | struct property *oldprop); | ||
208 | |||
209 | #if defined(CONFIG_OF_DYNAMIC) | ||
210 | /* For updating the device tree at runtime */ | ||
211 | extern void of_attach_node(struct device_node *); | ||
212 | extern void of_detach_node(struct device_node *); | ||
213 | #endif | ||
214 | |||
215 | #endif /* CONFIG_OF */ | ||
190 | #endif /* _LINUX_OF_H */ | 216 | #endif /* _LINUX_OF_H */ |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 41d432b13553..a1ca92ccb0ff 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
@@ -42,45 +42,62 @@ | |||
42 | * ends when size is 0 | 42 | * ends when size is 0 |
43 | */ | 43 | */ |
44 | struct boot_param_header { | 44 | struct boot_param_header { |
45 | u32 magic; /* magic word OF_DT_HEADER */ | 45 | __be32 magic; /* magic word OF_DT_HEADER */ |
46 | u32 totalsize; /* total size of DT block */ | 46 | __be32 totalsize; /* total size of DT block */ |
47 | u32 off_dt_struct; /* offset to structure */ | 47 | __be32 off_dt_struct; /* offset to structure */ |
48 | u32 off_dt_strings; /* offset to strings */ | 48 | __be32 off_dt_strings; /* offset to strings */ |
49 | u32 off_mem_rsvmap; /* offset to memory reserve map */ | 49 | __be32 off_mem_rsvmap; /* offset to memory reserve map */ |
50 | u32 version; /* format version */ | 50 | __be32 version; /* format version */ |
51 | u32 last_comp_version; /* last compatible version */ | 51 | __be32 last_comp_version; /* last compatible version */ |
52 | /* version 2 fields below */ | 52 | /* version 2 fields below */ |
53 | u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ | 53 | __be32 boot_cpuid_phys; /* Physical CPU id we're booting on */ |
54 | /* version 3 fields below */ | 54 | /* version 3 fields below */ |
55 | u32 dt_strings_size; /* size of the DT strings block */ | 55 | __be32 dt_strings_size; /* size of the DT strings block */ |
56 | /* version 17 fields below */ | 56 | /* version 17 fields below */ |
57 | u32 dt_struct_size; /* size of the DT structure block */ | 57 | __be32 dt_struct_size; /* size of the DT structure block */ |
58 | }; | 58 | }; |
59 | 59 | ||
60 | /* TBD: Temporary export of fdt globals - remove when code fully merged */ | ||
61 | extern int __initdata dt_root_addr_cells; | ||
62 | extern int __initdata dt_root_size_cells; | ||
63 | extern struct boot_param_header *initial_boot_params; | ||
64 | |||
60 | /* For scanning the flat device-tree at boot time */ | 65 | /* For scanning the flat device-tree at boot time */ |
61 | extern int __init of_scan_flat_dt(int (*it)(unsigned long node, | 66 | extern char *find_flat_dt_string(u32 offset); |
62 | const char *uname, int depth, | 67 | extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname, |
63 | void *data), | 68 | int depth, void *data), |
64 | void *data); | 69 | void *data); |
65 | extern void __init *of_get_flat_dt_prop(unsigned long node, const char *name, | 70 | extern void *of_get_flat_dt_prop(unsigned long node, const char *name, |
66 | unsigned long *size); | 71 | unsigned long *size); |
67 | extern int __init of_flat_dt_is_compatible(unsigned long node, | 72 | extern int of_flat_dt_is_compatible(unsigned long node, const char *name); |
68 | const char *name); | 73 | extern unsigned long of_get_flat_dt_root(void); |
69 | extern unsigned long __init of_get_flat_dt_root(void); | 74 | extern void early_init_dt_scan_chosen_arch(unsigned long node); |
75 | extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, | ||
76 | int depth, void *data); | ||
77 | extern void early_init_dt_check_for_initrd(unsigned long node); | ||
78 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, | ||
79 | int depth, void *data); | ||
80 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); | ||
81 | extern u64 early_init_dt_alloc_memory_arch(u64 size, u64 align); | ||
82 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); | ||
83 | |||
84 | /* | ||
85 | * If BLK_DEV_INITRD, the fdt early init code will call this function, | ||
86 | * to be provided by the arch code. start and end are specified as | ||
87 | * physical addresses. | ||
88 | */ | ||
89 | #ifdef CONFIG_BLK_DEV_INITRD | ||
90 | extern void early_init_dt_setup_initrd_arch(unsigned long start, | ||
91 | unsigned long end); | ||
92 | #endif | ||
93 | |||
94 | /* Early flat tree scan hooks */ | ||
95 | extern int early_init_dt_scan_root(unsigned long node, const char *uname, | ||
96 | int depth, void *data); | ||
70 | 97 | ||
71 | /* Other Prototypes */ | 98 | /* Other Prototypes */ |
72 | extern void finish_device_tree(void); | ||
73 | extern void unflatten_device_tree(void); | 99 | extern void unflatten_device_tree(void); |
74 | extern void early_init_devtree(void *); | 100 | extern void early_init_devtree(void *); |
75 | extern int machine_is_compatible(const char *compat); | ||
76 | extern void print_properties(struct device_node *node); | ||
77 | extern int prom_n_intr_cells(struct device_node* np); | ||
78 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); | ||
79 | extern int prom_add_property(struct device_node* np, struct property* prop); | ||
80 | extern int prom_remove_property(struct device_node *np, struct property *prop); | ||
81 | extern int prom_update_property(struct device_node *np, | ||
82 | struct property *newprop, | ||
83 | struct property *oldprop); | ||
84 | 101 | ||
85 | #endif /* __ASSEMBLY__ */ | 102 | #endif /* __ASSEMBLY__ */ |
86 | #endif /* _LINUX_OF_FDT_H */ | 103 | #endif /* _LINUX_OF_FDT_H */ |
diff --git a/include/linux/padata.h b/include/linux/padata.h new file mode 100644 index 000000000000..51611da9c498 --- /dev/null +++ b/include/linux/padata.h | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * padata.h - header for the padata parallelization interface | ||
3 | * | ||
4 | * Copyright (C) 2008, 2009 secunet Security Networks AG | ||
5 | * Copyright (C) 2008, 2009 Steffen Klassert <steffen.klassert@secunet.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms and conditions of the GNU General Public License, | ||
9 | * version 2, as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef PADATA_H | ||
22 | #define PADATA_H | ||
23 | |||
24 | #include <linux/workqueue.h> | ||
25 | #include <linux/spinlock.h> | ||
26 | #include <linux/list.h> | ||
27 | |||
28 | struct padata_priv { | ||
29 | struct list_head list; | ||
30 | struct parallel_data *pd; | ||
31 | int cb_cpu; | ||
32 | int seq_nr; | ||
33 | int info; | ||
34 | void (*parallel)(struct padata_priv *padata); | ||
35 | void (*serial)(struct padata_priv *padata); | ||
36 | }; | ||
37 | |||
38 | struct padata_list { | ||
39 | struct list_head list; | ||
40 | spinlock_t lock; | ||
41 | }; | ||
42 | |||
43 | struct padata_queue { | ||
44 | struct padata_list parallel; | ||
45 | struct padata_list reorder; | ||
46 | struct padata_list serial; | ||
47 | struct work_struct pwork; | ||
48 | struct work_struct swork; | ||
49 | struct parallel_data *pd; | ||
50 | atomic_t num_obj; | ||
51 | int cpu_index; | ||
52 | }; | ||
53 | |||
54 | struct parallel_data { | ||
55 | struct padata_instance *pinst; | ||
56 | struct padata_queue *queue; | ||
57 | atomic_t seq_nr; | ||
58 | atomic_t reorder_objects; | ||
59 | atomic_t refcnt; | ||
60 | unsigned int max_seq_nr; | ||
61 | cpumask_var_t cpumask; | ||
62 | spinlock_t lock; | ||
63 | }; | ||
64 | |||
65 | struct padata_instance { | ||
66 | struct notifier_block cpu_notifier; | ||
67 | struct workqueue_struct *wq; | ||
68 | struct parallel_data *pd; | ||
69 | cpumask_var_t cpumask; | ||
70 | struct mutex lock; | ||
71 | u8 flags; | ||
72 | #define PADATA_INIT 1 | ||
73 | #define PADATA_RESET 2 | ||
74 | }; | ||
75 | |||
76 | extern struct padata_instance *padata_alloc(const struct cpumask *cpumask, | ||
77 | struct workqueue_struct *wq); | ||
78 | extern void padata_free(struct padata_instance *pinst); | ||
79 | extern int padata_do_parallel(struct padata_instance *pinst, | ||
80 | struct padata_priv *padata, int cb_cpu); | ||
81 | extern void padata_do_serial(struct padata_priv *padata); | ||
82 | extern int padata_set_cpumask(struct padata_instance *pinst, | ||
83 | cpumask_var_t cpumask); | ||
84 | extern int padata_add_cpu(struct padata_instance *pinst, int cpu); | ||
85 | extern int padata_remove_cpu(struct padata_instance *pinst, int cpu); | ||
86 | extern void padata_start(struct padata_instance *pinst); | ||
87 | extern void padata_stop(struct padata_instance *pinst); | ||
88 | #endif | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index ed5d7501e181..3c62ed408492 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -253,6 +253,8 @@ extern struct page * read_cache_page_async(struct address_space *mapping, | |||
253 | extern struct page * read_cache_page(struct address_space *mapping, | 253 | extern struct page * read_cache_page(struct address_space *mapping, |
254 | pgoff_t index, filler_t *filler, | 254 | pgoff_t index, filler_t *filler, |
255 | void *data); | 255 | void *data); |
256 | extern struct page * read_cache_page_gfp(struct address_space *mapping, | ||
257 | pgoff_t index, gfp_t gfp_mask); | ||
256 | extern int read_cache_pages(struct address_space *mapping, | 258 | extern int read_cache_pages(struct address_space *mapping, |
257 | struct list_head *pages, filler_t *filler, void *data); | 259 | struct list_head *pages, filler_t *filler, void *data); |
258 | 260 | ||
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 93a7c08f869d..c8b6473c5f42 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -11,6 +11,13 @@ | |||
11 | #include <linux/acpi.h> | 11 | #include <linux/acpi.h> |
12 | 12 | ||
13 | #ifdef CONFIG_ACPI | 13 | #ifdef CONFIG_ACPI |
14 | extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev, | ||
15 | struct pci_bus *pci_bus); | ||
16 | extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev); | ||
17 | extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev, | ||
18 | struct pci_dev *pci_dev); | ||
19 | extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev); | ||
20 | |||
14 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | 21 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) |
15 | { | 22 | { |
16 | struct pci_bus *pbus = pdev->bus; | 23 | struct pci_bus *pbus = pdev->bus; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index bf1e67080849..25813738c71a 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -187,6 +187,33 @@ enum pci_bus_flags { | |||
187 | PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, | 187 | PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, |
188 | }; | 188 | }; |
189 | 189 | ||
190 | /* Based on the PCI Hotplug Spec, but some values are made up by us */ | ||
191 | enum pci_bus_speed { | ||
192 | PCI_SPEED_33MHz = 0x00, | ||
193 | PCI_SPEED_66MHz = 0x01, | ||
194 | PCI_SPEED_66MHz_PCIX = 0x02, | ||
195 | PCI_SPEED_100MHz_PCIX = 0x03, | ||
196 | PCI_SPEED_133MHz_PCIX = 0x04, | ||
197 | PCI_SPEED_66MHz_PCIX_ECC = 0x05, | ||
198 | PCI_SPEED_100MHz_PCIX_ECC = 0x06, | ||
199 | PCI_SPEED_133MHz_PCIX_ECC = 0x07, | ||
200 | PCI_SPEED_66MHz_PCIX_266 = 0x09, | ||
201 | PCI_SPEED_100MHz_PCIX_266 = 0x0a, | ||
202 | PCI_SPEED_133MHz_PCIX_266 = 0x0b, | ||
203 | AGP_UNKNOWN = 0x0c, | ||
204 | AGP_1X = 0x0d, | ||
205 | AGP_2X = 0x0e, | ||
206 | AGP_4X = 0x0f, | ||
207 | AGP_8X = 0x10, | ||
208 | PCI_SPEED_66MHz_PCIX_533 = 0x11, | ||
209 | PCI_SPEED_100MHz_PCIX_533 = 0x12, | ||
210 | PCI_SPEED_133MHz_PCIX_533 = 0x13, | ||
211 | PCIE_SPEED_2_5GT = 0x14, | ||
212 | PCIE_SPEED_5_0GT = 0x15, | ||
213 | PCIE_SPEED_8_0GT = 0x16, | ||
214 | PCI_SPEED_UNKNOWN = 0xff, | ||
215 | }; | ||
216 | |||
190 | struct pci_cap_saved_state { | 217 | struct pci_cap_saved_state { |
191 | struct hlist_node next; | 218 | struct hlist_node next; |
192 | char cap_nr; | 219 | char cap_nr; |
@@ -239,10 +266,12 @@ struct pci_dev { | |||
239 | configuration space */ | 266 | configuration space */ |
240 | unsigned int pme_support:5; /* Bitmask of states from which PME# | 267 | unsigned int pme_support:5; /* Bitmask of states from which PME# |
241 | can be generated */ | 268 | can be generated */ |
269 | unsigned int pme_interrupt:1; | ||
242 | unsigned int d1_support:1; /* Low power state D1 is supported */ | 270 | unsigned int d1_support:1; /* Low power state D1 is supported */ |
243 | unsigned int d2_support:1; /* Low power state D2 is supported */ | 271 | unsigned int d2_support:1; /* Low power state D2 is supported */ |
244 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ | 272 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ |
245 | unsigned int wakeup_prepared:1; | 273 | unsigned int wakeup_prepared:1; |
274 | unsigned int d3_delay; /* D3->D0 transition time in ms */ | ||
246 | 275 | ||
247 | #ifdef CONFIG_PCIEASPM | 276 | #ifdef CONFIG_PCIEASPM |
248 | struct pcie_link_state *link_state; /* ASPM link state. */ | 277 | struct pcie_link_state *link_state; /* ASPM link state. */ |
@@ -274,7 +303,8 @@ struct pci_dev { | |||
274 | unsigned int msix_enabled:1; | 303 | unsigned int msix_enabled:1; |
275 | unsigned int ari_enabled:1; /* ARI forwarding */ | 304 | unsigned int ari_enabled:1; /* ARI forwarding */ |
276 | unsigned int is_managed:1; | 305 | unsigned int is_managed:1; |
277 | unsigned int is_pcie:1; | 306 | unsigned int is_pcie:1; /* Obsolete. Will be removed. |
307 | Use pci_is_pcie() instead */ | ||
278 | unsigned int needs_freset:1; /* Dev requires fundamental reset */ | 308 | unsigned int needs_freset:1; /* Dev requires fundamental reset */ |
279 | unsigned int state_saved:1; | 309 | unsigned int state_saved:1; |
280 | unsigned int is_physfn:1; | 310 | unsigned int is_physfn:1; |
@@ -334,9 +364,26 @@ static inline void pci_add_saved_cap(struct pci_dev *pci_dev, | |||
334 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); | 364 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); |
335 | } | 365 | } |
336 | 366 | ||
337 | #ifndef PCI_BUS_NUM_RESOURCES | 367 | /* |
338 | #define PCI_BUS_NUM_RESOURCES 16 | 368 | * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond |
339 | #endif | 369 | * to P2P or CardBus bridge windows) go in a table. Additional ones (for |
370 | * buses below host bridges or subtractive decode bridges) go in the list. | ||
371 | * Use pci_bus_for_each_resource() to iterate through all the resources. | ||
372 | */ | ||
373 | |||
374 | /* | ||
375 | * PCI_SUBTRACTIVE_DECODE means the bridge forwards the window implicitly | ||
376 | * and there's no way to program the bridge with the details of the window. | ||
377 | * This does not apply to ACPI _CRS windows, even with the _DEC subtractive- | ||
378 | * decode bit set, because they are explicit and can be programmed with _SRS. | ||
379 | */ | ||
380 | #define PCI_SUBTRACTIVE_DECODE 0x1 | ||
381 | |||
382 | struct pci_bus_resource { | ||
383 | struct list_head list; | ||
384 | struct resource *res; | ||
385 | unsigned int flags; | ||
386 | }; | ||
340 | 387 | ||
341 | #define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ | 388 | #define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ |
342 | 389 | ||
@@ -347,8 +394,8 @@ struct pci_bus { | |||
347 | struct list_head devices; /* list of devices on this bus */ | 394 | struct list_head devices; /* list of devices on this bus */ |
348 | struct pci_dev *self; /* bridge device as seen by parent */ | 395 | struct pci_dev *self; /* bridge device as seen by parent */ |
349 | struct list_head slots; /* list of slots on this bus */ | 396 | struct list_head slots; /* list of slots on this bus */ |
350 | struct resource *resource[PCI_BUS_NUM_RESOURCES]; | 397 | struct resource *resource[PCI_BRIDGE_RESOURCE_NUM]; |
351 | /* address space routed to this bus */ | 398 | struct list_head resources; /* address space routed to this bus */ |
352 | 399 | ||
353 | struct pci_ops *ops; /* configuration access functions */ | 400 | struct pci_ops *ops; /* configuration access functions */ |
354 | void *sysdata; /* hook for sys-specific extension */ | 401 | void *sysdata; /* hook for sys-specific extension */ |
@@ -358,6 +405,8 @@ struct pci_bus { | |||
358 | unsigned char primary; /* number of primary bridge */ | 405 | unsigned char primary; /* number of primary bridge */ |
359 | unsigned char secondary; /* number of secondary bridge */ | 406 | unsigned char secondary; /* number of secondary bridge */ |
360 | unsigned char subordinate; /* max number of subordinate buses */ | 407 | unsigned char subordinate; /* max number of subordinate buses */ |
408 | unsigned char max_bus_speed; /* enum pci_bus_speed */ | ||
409 | unsigned char cur_bus_speed; /* enum pci_bus_speed */ | ||
361 | 410 | ||
362 | char name[48]; | 411 | char name[48]; |
363 | 412 | ||
@@ -562,10 +611,14 @@ int __must_check pcibios_enable_device(struct pci_dev *, int mask); | |||
562 | char *pcibios_setup(char *str); | 611 | char *pcibios_setup(char *str); |
563 | 612 | ||
564 | /* Used only when drivers/pci/setup.c is used */ | 613 | /* Used only when drivers/pci/setup.c is used */ |
565 | void pcibios_align_resource(void *, struct resource *, resource_size_t, | 614 | resource_size_t pcibios_align_resource(void *, const struct resource *, |
615 | resource_size_t, | ||
566 | resource_size_t); | 616 | resource_size_t); |
567 | void pcibios_update_irq(struct pci_dev *, int irq); | 617 | void pcibios_update_irq(struct pci_dev *, int irq); |
568 | 618 | ||
619 | /* Weak but can be overriden by arch */ | ||
620 | void pci_fixup_cardbus(struct pci_bus *); | ||
621 | |||
569 | /* Generic PCI functions used internally */ | 622 | /* Generic PCI functions used internally */ |
570 | 623 | ||
571 | extern struct pci_bus *pci_find_bus(int domain, int busnr); | 624 | extern struct pci_bus *pci_find_bus(int domain, int busnr); |
@@ -585,6 +638,7 @@ struct pci_bus *pci_create_bus(struct device *parent, int bus, | |||
585 | struct pci_ops *ops, void *sysdata); | 638 | struct pci_ops *ops, void *sysdata); |
586 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, | 639 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, |
587 | int busnr); | 640 | int busnr); |
641 | void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); | ||
588 | struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, | 642 | struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, |
589 | const char *name, | 643 | const char *name, |
590 | struct hotplug_slot *hotplug); | 644 | struct hotplug_slot *hotplug); |
@@ -611,12 +665,6 @@ extern void pci_sort_breadthfirst(void); | |||
611 | 665 | ||
612 | /* Generic PCI functions exported to card drivers */ | 666 | /* Generic PCI functions exported to card drivers */ |
613 | 667 | ||
614 | #ifdef CONFIG_PCI_LEGACY | ||
615 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, | ||
616 | unsigned int device, | ||
617 | struct pci_dev *from); | ||
618 | #endif /* CONFIG_PCI_LEGACY */ | ||
619 | |||
620 | enum pci_lost_interrupt_reason { | 668 | enum pci_lost_interrupt_reason { |
621 | PCI_LOST_IRQ_NO_INFORMATION = 0, | 669 | PCI_LOST_IRQ_NO_INFORMATION = 0, |
622 | PCI_LOST_IRQ_DISABLE_MSI, | 670 | PCI_LOST_IRQ_DISABLE_MSI, |
@@ -746,11 +794,23 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | |||
746 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 794 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
747 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); | 795 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); |
748 | void pci_pme_active(struct pci_dev *dev, bool enable); | 796 | void pci_pme_active(struct pci_dev *dev, bool enable); |
749 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable); | 797 | int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
798 | bool runtime, bool enable); | ||
750 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); | 799 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); |
751 | pci_power_t pci_target_state(struct pci_dev *dev); | 800 | pci_power_t pci_target_state(struct pci_dev *dev); |
752 | int pci_prepare_to_sleep(struct pci_dev *dev); | 801 | int pci_prepare_to_sleep(struct pci_dev *dev); |
753 | int pci_back_from_sleep(struct pci_dev *dev); | 802 | int pci_back_from_sleep(struct pci_dev *dev); |
803 | bool pci_dev_run_wake(struct pci_dev *dev); | ||
804 | |||
805 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | ||
806 | bool enable) | ||
807 | { | ||
808 | return __pci_enable_wake(dev, state, false, enable); | ||
809 | } | ||
810 | |||
811 | /* For use by arch with custom probe code */ | ||
812 | void set_pcie_port_type(struct pci_dev *pdev); | ||
813 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); | ||
754 | 814 | ||
755 | /* Functions for PCI Hotplug drivers to use */ | 815 | /* Functions for PCI Hotplug drivers to use */ |
756 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 816 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
@@ -768,6 +828,7 @@ void pci_bus_assign_resources(const struct pci_bus *bus); | |||
768 | void pci_bus_size_bridges(struct pci_bus *bus); | 828 | void pci_bus_size_bridges(struct pci_bus *bus); |
769 | int pci_claim_resource(struct pci_dev *, int); | 829 | int pci_claim_resource(struct pci_dev *, int); |
770 | void pci_assign_unassigned_resources(void); | 830 | void pci_assign_unassigned_resources(void); |
831 | void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); | ||
771 | void pdev_enable_device(struct pci_dev *); | 832 | void pdev_enable_device(struct pci_dev *); |
772 | void pdev_sort_resources(struct pci_dev *, struct resource_list *); | 833 | void pdev_sort_resources(struct pci_dev *, struct resource_list *); |
773 | int pci_enable_resources(struct pci_dev *, int mask); | 834 | int pci_enable_resources(struct pci_dev *, int mask); |
@@ -785,12 +846,23 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); | |||
785 | void pci_release_selected_regions(struct pci_dev *, int); | 846 | void pci_release_selected_regions(struct pci_dev *, int); |
786 | 847 | ||
787 | /* drivers/pci/bus.c */ | 848 | /* drivers/pci/bus.c */ |
849 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); | ||
850 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); | ||
851 | void pci_bus_remove_resources(struct pci_bus *bus); | ||
852 | |||
853 | #define pci_bus_for_each_resource(bus, res, i) \ | ||
854 | for (i = 0; \ | ||
855 | (res = pci_bus_resource_n(bus, i)) || i < PCI_BRIDGE_RESOURCE_NUM; \ | ||
856 | i++) | ||
857 | |||
788 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, | 858 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, |
789 | struct resource *res, resource_size_t size, | 859 | struct resource *res, resource_size_t size, |
790 | resource_size_t align, resource_size_t min, | 860 | resource_size_t align, resource_size_t min, |
791 | unsigned int type_mask, | 861 | unsigned int type_mask, |
792 | void (*alignf)(void *, struct resource *, | 862 | resource_size_t (*alignf)(void *, |
793 | resource_size_t, resource_size_t), | 863 | const struct resource *, |
864 | resource_size_t, | ||
865 | resource_size_t), | ||
794 | void *alignf_data); | 866 | void *alignf_data); |
795 | void pci_enable_bridges(struct pci_bus *bus); | 867 | void pci_enable_bridges(struct pci_bus *bus); |
796 | 868 | ||
@@ -951,6 +1023,11 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
951 | } | 1023 | } |
952 | #endif /* CONFIG_PCI_DOMAINS */ | 1024 | #endif /* CONFIG_PCI_DOMAINS */ |
953 | 1025 | ||
1026 | /* some architectures require additional setup to direct VGA traffic */ | ||
1027 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, | ||
1028 | unsigned int command_bits, bool change_bridge); | ||
1029 | extern void pci_register_set_vga_state(arch_set_vga_state_t func); | ||
1030 | |||
954 | #else /* CONFIG_PCI is not enabled */ | 1031 | #else /* CONFIG_PCI is not enabled */ |
955 | 1032 | ||
956 | /* | 1033 | /* |
@@ -969,13 +1046,6 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
969 | _PCI_NOP_ALL(read, *) | 1046 | _PCI_NOP_ALL(read, *) |
970 | _PCI_NOP_ALL(write,) | 1047 | _PCI_NOP_ALL(write,) |
971 | 1048 | ||
972 | static inline struct pci_dev *pci_find_device(unsigned int vendor, | ||
973 | unsigned int device, | ||
974 | struct pci_dev *from) | ||
975 | { | ||
976 | return NULL; | ||
977 | } | ||
978 | |||
979 | static inline struct pci_dev *pci_get_device(unsigned int vendor, | 1049 | static inline struct pci_dev *pci_get_device(unsigned int vendor, |
980 | unsigned int device, | 1050 | unsigned int device, |
981 | struct pci_dev *from) | 1051 | struct pci_dev *from) |
@@ -1233,8 +1303,12 @@ enum pci_fixup_pass { | |||
1233 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1303 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
1234 | suspend##vendor##device##hook, vendor, device, hook) | 1304 | suspend##vendor##device##hook, vendor, device, hook) |
1235 | 1305 | ||
1236 | 1306 | #ifdef CONFIG_PCI_QUIRKS | |
1237 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 1307 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
1308 | #else | ||
1309 | static inline void pci_fixup_device(enum pci_fixup_pass pass, | ||
1310 | struct pci_dev *dev) {} | ||
1311 | #endif | ||
1238 | 1312 | ||
1239 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); | 1313 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); |
1240 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); | 1314 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 652ba797696d..5d09cbafa7db 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
@@ -28,26 +28,6 @@ | |||
28 | #ifndef _PCI_HOTPLUG_H | 28 | #ifndef _PCI_HOTPLUG_H |
29 | #define _PCI_HOTPLUG_H | 29 | #define _PCI_HOTPLUG_H |
30 | 30 | ||
31 | |||
32 | /* These values come from the PCI Hotplug Spec */ | ||
33 | enum pci_bus_speed { | ||
34 | PCI_SPEED_33MHz = 0x00, | ||
35 | PCI_SPEED_66MHz = 0x01, | ||
36 | PCI_SPEED_66MHz_PCIX = 0x02, | ||
37 | PCI_SPEED_100MHz_PCIX = 0x03, | ||
38 | PCI_SPEED_133MHz_PCIX = 0x04, | ||
39 | PCI_SPEED_66MHz_PCIX_ECC = 0x05, | ||
40 | PCI_SPEED_100MHz_PCIX_ECC = 0x06, | ||
41 | PCI_SPEED_133MHz_PCIX_ECC = 0x07, | ||
42 | PCI_SPEED_66MHz_PCIX_266 = 0x09, | ||
43 | PCI_SPEED_100MHz_PCIX_266 = 0x0a, | ||
44 | PCI_SPEED_133MHz_PCIX_266 = 0x0b, | ||
45 | PCI_SPEED_66MHz_PCIX_533 = 0x11, | ||
46 | PCI_SPEED_100MHz_PCIX_533 = 0x12, | ||
47 | PCI_SPEED_133MHz_PCIX_533 = 0x13, | ||
48 | PCI_SPEED_UNKNOWN = 0xff, | ||
49 | }; | ||
50 | |||
51 | /* These values come from the PCI Express Spec */ | 31 | /* These values come from the PCI Express Spec */ |
52 | enum pcie_link_width { | 32 | enum pcie_link_width { |
53 | PCIE_LNK_WIDTH_RESRV = 0x00, | 33 | PCIE_LNK_WIDTH_RESRV = 0x00, |
@@ -61,12 +41,6 @@ enum pcie_link_width { | |||
61 | PCIE_LNK_WIDTH_UNKNOWN = 0xFF, | 41 | PCIE_LNK_WIDTH_UNKNOWN = 0xFF, |
62 | }; | 42 | }; |
63 | 43 | ||
64 | enum pcie_link_speed { | ||
65 | PCIE_2_5GB = 0x14, | ||
66 | PCIE_5_0GB = 0x15, | ||
67 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, | ||
68 | }; | ||
69 | |||
70 | /** | 44 | /** |
71 | * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use | 45 | * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use |
72 | * @owner: The module owner of this structure | 46 | * @owner: The module owner of this structure |
@@ -89,12 +63,6 @@ enum pcie_link_speed { | |||
89 | * @get_adapter_status: Called to get see if an adapter is present in the slot or not. | 63 | * @get_adapter_status: Called to get see if an adapter is present in the slot or not. |
90 | * If this field is NULL, the value passed in the struct hotplug_slot_info | 64 | * If this field is NULL, the value passed in the struct hotplug_slot_info |
91 | * will be used when this value is requested by a user. | 65 | * will be used when this value is requested by a user. |
92 | * @get_max_bus_speed: Called to get the max bus speed for a slot. | ||
93 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
94 | * will be used when this value is requested by a user. | ||
95 | * @get_cur_bus_speed: Called to get the current bus speed for a slot. | ||
96 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
97 | * will be used when this value is requested by a user. | ||
98 | * | 66 | * |
99 | * The table of function pointers that is passed to the hotplug pci core by a | 67 | * The table of function pointers that is passed to the hotplug pci core by a |
100 | * hotplug pci driver. These functions are called by the hotplug pci core when | 68 | * hotplug pci driver. These functions are called by the hotplug pci core when |
@@ -112,17 +80,14 @@ struct hotplug_slot_ops { | |||
112 | int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); | 80 | int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); |
113 | int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); | 81 | int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); |
114 | int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); | 82 | int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); |
115 | int (*get_max_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value); | ||
116 | int (*get_cur_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value); | ||
117 | }; | 83 | }; |
118 | 84 | ||
119 | /** | 85 | /** |
120 | * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot | 86 | * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot |
121 | * @power: if power is enabled or not (1/0) | 87 | * @power_status: if power is enabled or not (1/0) |
122 | * @attention_status: if the attention light is enabled or not (1/0) | 88 | * @attention_status: if the attention light is enabled or not (1/0) |
123 | * @latch_status: if the latch (if any) is open or closed (1/0) | 89 | * @latch_status: if the latch (if any) is open or closed (1/0) |
124 | * @adapter_present: if there is a pci board present in the slot or not (1/0) | 90 | * @adapter_status: if there is a pci board present in the slot or not (1/0) |
125 | * @address: (domain << 16 | bus << 8 | dev) | ||
126 | * | 91 | * |
127 | * Used to notify the hotplug pci core of the status of a specific slot. | 92 | * Used to notify the hotplug pci core of the status of a specific slot. |
128 | */ | 93 | */ |
@@ -131,8 +96,6 @@ struct hotplug_slot_info { | |||
131 | u8 attention_status; | 96 | u8 attention_status; |
132 | u8 latch_status; | 97 | u8 latch_status; |
133 | u8 adapter_status; | 98 | u8 adapter_status; |
134 | enum pci_bus_speed max_bus_speed; | ||
135 | enum pci_bus_speed cur_bus_speed; | ||
136 | }; | 99 | }; |
137 | 100 | ||
138 | /** | 101 | /** |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index cca8a044e2b6..0be824320580 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2417,6 +2417,9 @@ | |||
2417 | #define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 | 2417 | #define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 |
2418 | #define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 | 2418 | #define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 |
2419 | #define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 | 2419 | #define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 |
2420 | #define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22 | ||
2421 | #define PCI_DEVICE_ID_INTEL_CPT_LPC1 0x1c42 | ||
2422 | #define PCI_DEVICE_ID_INTEL_CPT_LPC2 0x1c43 | ||
2420 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 2423 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
2421 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 | 2424 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 |
2422 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 | 2425 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index a7684a513994..794662b2be5d 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -98,9 +98,6 @@ static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount) | |||
98 | fbc->count = amount; | 98 | fbc->count = amount; |
99 | } | 99 | } |
100 | 100 | ||
101 | #define __percpu_counter_add(fbc, amount, batch) \ | ||
102 | percpu_counter_add(fbc, amount) | ||
103 | |||
104 | static inline void | 101 | static inline void |
105 | percpu_counter_add(struct percpu_counter *fbc, s64 amount) | 102 | percpu_counter_add(struct percpu_counter *fbc, s64 amount) |
106 | { | 103 | { |
@@ -109,6 +106,12 @@ percpu_counter_add(struct percpu_counter *fbc, s64 amount) | |||
109 | preempt_enable(); | 106 | preempt_enable(); |
110 | } | 107 | } |
111 | 108 | ||
109 | static inline void | ||
110 | __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch) | ||
111 | { | ||
112 | percpu_counter_add(fbc, amount); | ||
113 | } | ||
114 | |||
112 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) | 115 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) |
113 | { | 116 | { |
114 | return fbc->count; | 117 | return fbc->count; |
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h deleted file mode 100644 index e3fb25606706..000000000000 --- a/include/linux/perf_counter.h +++ /dev/null | |||
@@ -1,444 +0,0 @@ | |||
1 | /* | ||
2 | * NOTE: this file will be removed in a future kernel release, it is | ||
3 | * provided as a courtesy copy of user-space code that relies on the | ||
4 | * old (pre-rename) symbols and constants. | ||
5 | * | ||
6 | * Performance events: | ||
7 | * | ||
8 | * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de> | ||
9 | * Copyright (C) 2008-2009, Red Hat, Inc., Ingo Molnar | ||
10 | * Copyright (C) 2008-2009, Red Hat, Inc., Peter Zijlstra | ||
11 | * | ||
12 | * Data type definitions, declarations, prototypes. | ||
13 | * | ||
14 | * Started by: Thomas Gleixner and Ingo Molnar | ||
15 | * | ||
16 | * For licencing details see kernel-base/COPYING | ||
17 | */ | ||
18 | #ifndef _LINUX_PERF_COUNTER_H | ||
19 | #define _LINUX_PERF_COUNTER_H | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <linux/ioctl.h> | ||
23 | #include <asm/byteorder.h> | ||
24 | |||
25 | /* | ||
26 | * User-space ABI bits: | ||
27 | */ | ||
28 | |||
29 | /* | ||
30 | * attr.type | ||
31 | */ | ||
32 | enum perf_type_id { | ||
33 | PERF_TYPE_HARDWARE = 0, | ||
34 | PERF_TYPE_SOFTWARE = 1, | ||
35 | PERF_TYPE_TRACEPOINT = 2, | ||
36 | PERF_TYPE_HW_CACHE = 3, | ||
37 | PERF_TYPE_RAW = 4, | ||
38 | |||
39 | PERF_TYPE_MAX, /* non-ABI */ | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * Generalized performance counter event types, used by the | ||
44 | * attr.event_id parameter of the sys_perf_counter_open() | ||
45 | * syscall: | ||
46 | */ | ||
47 | enum perf_hw_id { | ||
48 | /* | ||
49 | * Common hardware events, generalized by the kernel: | ||
50 | */ | ||
51 | PERF_COUNT_HW_CPU_CYCLES = 0, | ||
52 | PERF_COUNT_HW_INSTRUCTIONS = 1, | ||
53 | PERF_COUNT_HW_CACHE_REFERENCES = 2, | ||
54 | PERF_COUNT_HW_CACHE_MISSES = 3, | ||
55 | PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4, | ||
56 | PERF_COUNT_HW_BRANCH_MISSES = 5, | ||
57 | PERF_COUNT_HW_BUS_CYCLES = 6, | ||
58 | |||
59 | PERF_COUNT_HW_MAX, /* non-ABI */ | ||
60 | }; | ||
61 | |||
62 | /* | ||
63 | * Generalized hardware cache counters: | ||
64 | * | ||
65 | * { L1-D, L1-I, LLC, ITLB, DTLB, BPU } x | ||
66 | * { read, write, prefetch } x | ||
67 | * { accesses, misses } | ||
68 | */ | ||
69 | enum perf_hw_cache_id { | ||
70 | PERF_COUNT_HW_CACHE_L1D = 0, | ||
71 | PERF_COUNT_HW_CACHE_L1I = 1, | ||
72 | PERF_COUNT_HW_CACHE_LL = 2, | ||
73 | PERF_COUNT_HW_CACHE_DTLB = 3, | ||
74 | PERF_COUNT_HW_CACHE_ITLB = 4, | ||
75 | PERF_COUNT_HW_CACHE_BPU = 5, | ||
76 | |||
77 | PERF_COUNT_HW_CACHE_MAX, /* non-ABI */ | ||
78 | }; | ||
79 | |||
80 | enum perf_hw_cache_op_id { | ||
81 | PERF_COUNT_HW_CACHE_OP_READ = 0, | ||
82 | PERF_COUNT_HW_CACHE_OP_WRITE = 1, | ||
83 | PERF_COUNT_HW_CACHE_OP_PREFETCH = 2, | ||
84 | |||
85 | PERF_COUNT_HW_CACHE_OP_MAX, /* non-ABI */ | ||
86 | }; | ||
87 | |||
88 | enum perf_hw_cache_op_result_id { | ||
89 | PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0, | ||
90 | PERF_COUNT_HW_CACHE_RESULT_MISS = 1, | ||
91 | |||
92 | PERF_COUNT_HW_CACHE_RESULT_MAX, /* non-ABI */ | ||
93 | }; | ||
94 | |||
95 | /* | ||
96 | * Special "software" counters provided by the kernel, even if the hardware | ||
97 | * does not support performance counters. These counters measure various | ||
98 | * physical and sw events of the kernel (and allow the profiling of them as | ||
99 | * well): | ||
100 | */ | ||
101 | enum perf_sw_ids { | ||
102 | PERF_COUNT_SW_CPU_CLOCK = 0, | ||
103 | PERF_COUNT_SW_TASK_CLOCK = 1, | ||
104 | PERF_COUNT_SW_PAGE_FAULTS = 2, | ||
105 | PERF_COUNT_SW_CONTEXT_SWITCHES = 3, | ||
106 | PERF_COUNT_SW_CPU_MIGRATIONS = 4, | ||
107 | PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, | ||
108 | PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, | ||
109 | PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, | ||
110 | PERF_COUNT_SW_EMULATION_FAULTS = 8, | ||
111 | |||
112 | PERF_COUNT_SW_MAX, /* non-ABI */ | ||
113 | }; | ||
114 | |||
115 | /* | ||
116 | * Bits that can be set in attr.sample_type to request information | ||
117 | * in the overflow packets. | ||
118 | */ | ||
119 | enum perf_counter_sample_format { | ||
120 | PERF_SAMPLE_IP = 1U << 0, | ||
121 | PERF_SAMPLE_TID = 1U << 1, | ||
122 | PERF_SAMPLE_TIME = 1U << 2, | ||
123 | PERF_SAMPLE_ADDR = 1U << 3, | ||
124 | PERF_SAMPLE_READ = 1U << 4, | ||
125 | PERF_SAMPLE_CALLCHAIN = 1U << 5, | ||
126 | PERF_SAMPLE_ID = 1U << 6, | ||
127 | PERF_SAMPLE_CPU = 1U << 7, | ||
128 | PERF_SAMPLE_PERIOD = 1U << 8, | ||
129 | PERF_SAMPLE_STREAM_ID = 1U << 9, | ||
130 | PERF_SAMPLE_RAW = 1U << 10, | ||
131 | |||
132 | PERF_SAMPLE_MAX = 1U << 11, /* non-ABI */ | ||
133 | }; | ||
134 | |||
135 | /* | ||
136 | * The format of the data returned by read() on a perf counter fd, | ||
137 | * as specified by attr.read_format: | ||
138 | * | ||
139 | * struct read_format { | ||
140 | * { u64 value; | ||
141 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
142 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
143 | * { u64 id; } && PERF_FORMAT_ID | ||
144 | * } && !PERF_FORMAT_GROUP | ||
145 | * | ||
146 | * { u64 nr; | ||
147 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
148 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
149 | * { u64 value; | ||
150 | * { u64 id; } && PERF_FORMAT_ID | ||
151 | * } cntr[nr]; | ||
152 | * } && PERF_FORMAT_GROUP | ||
153 | * }; | ||
154 | */ | ||
155 | enum perf_counter_read_format { | ||
156 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, | ||
157 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, | ||
158 | PERF_FORMAT_ID = 1U << 2, | ||
159 | PERF_FORMAT_GROUP = 1U << 3, | ||
160 | |||
161 | PERF_FORMAT_MAX = 1U << 4, /* non-ABI */ | ||
162 | }; | ||
163 | |||
164 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ | ||
165 | |||
166 | /* | ||
167 | * Hardware event to monitor via a performance monitoring counter: | ||
168 | */ | ||
169 | struct perf_counter_attr { | ||
170 | |||
171 | /* | ||
172 | * Major type: hardware/software/tracepoint/etc. | ||
173 | */ | ||
174 | __u32 type; | ||
175 | |||
176 | /* | ||
177 | * Size of the attr structure, for fwd/bwd compat. | ||
178 | */ | ||
179 | __u32 size; | ||
180 | |||
181 | /* | ||
182 | * Type specific configuration information. | ||
183 | */ | ||
184 | __u64 config; | ||
185 | |||
186 | union { | ||
187 | __u64 sample_period; | ||
188 | __u64 sample_freq; | ||
189 | }; | ||
190 | |||
191 | __u64 sample_type; | ||
192 | __u64 read_format; | ||
193 | |||
194 | __u64 disabled : 1, /* off by default */ | ||
195 | inherit : 1, /* children inherit it */ | ||
196 | pinned : 1, /* must always be on PMU */ | ||
197 | exclusive : 1, /* only group on PMU */ | ||
198 | exclude_user : 1, /* don't count user */ | ||
199 | exclude_kernel : 1, /* ditto kernel */ | ||
200 | exclude_hv : 1, /* ditto hypervisor */ | ||
201 | exclude_idle : 1, /* don't count when idle */ | ||
202 | mmap : 1, /* include mmap data */ | ||
203 | comm : 1, /* include comm data */ | ||
204 | freq : 1, /* use freq, not period */ | ||
205 | inherit_stat : 1, /* per task counts */ | ||
206 | enable_on_exec : 1, /* next exec enables */ | ||
207 | task : 1, /* trace fork/exit */ | ||
208 | watermark : 1, /* wakeup_watermark */ | ||
209 | |||
210 | __reserved_1 : 49; | ||
211 | |||
212 | union { | ||
213 | __u32 wakeup_events; /* wakeup every n events */ | ||
214 | __u32 wakeup_watermark; /* bytes before wakeup */ | ||
215 | }; | ||
216 | __u32 __reserved_2; | ||
217 | |||
218 | __u64 __reserved_3; | ||
219 | }; | ||
220 | |||
221 | /* | ||
222 | * Ioctls that can be done on a perf counter fd: | ||
223 | */ | ||
224 | #define PERF_COUNTER_IOC_ENABLE _IO ('$', 0) | ||
225 | #define PERF_COUNTER_IOC_DISABLE _IO ('$', 1) | ||
226 | #define PERF_COUNTER_IOC_REFRESH _IO ('$', 2) | ||
227 | #define PERF_COUNTER_IOC_RESET _IO ('$', 3) | ||
228 | #define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) | ||
229 | #define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5) | ||
230 | #define PERF_COUNTER_IOC_SET_FILTER _IOW('$', 6, char *) | ||
231 | |||
232 | enum perf_counter_ioc_flags { | ||
233 | PERF_IOC_FLAG_GROUP = 1U << 0, | ||
234 | }; | ||
235 | |||
236 | /* | ||
237 | * Structure of the page that can be mapped via mmap | ||
238 | */ | ||
239 | struct perf_counter_mmap_page { | ||
240 | __u32 version; /* version number of this structure */ | ||
241 | __u32 compat_version; /* lowest version this is compat with */ | ||
242 | |||
243 | /* | ||
244 | * Bits needed to read the hw counters in user-space. | ||
245 | * | ||
246 | * u32 seq; | ||
247 | * s64 count; | ||
248 | * | ||
249 | * do { | ||
250 | * seq = pc->lock; | ||
251 | * | ||
252 | * barrier() | ||
253 | * if (pc->index) { | ||
254 | * count = pmc_read(pc->index - 1); | ||
255 | * count += pc->offset; | ||
256 | * } else | ||
257 | * goto regular_read; | ||
258 | * | ||
259 | * barrier(); | ||
260 | * } while (pc->lock != seq); | ||
261 | * | ||
262 | * NOTE: for obvious reason this only works on self-monitoring | ||
263 | * processes. | ||
264 | */ | ||
265 | __u32 lock; /* seqlock for synchronization */ | ||
266 | __u32 index; /* hardware counter identifier */ | ||
267 | __s64 offset; /* add to hardware counter value */ | ||
268 | __u64 time_enabled; /* time counter active */ | ||
269 | __u64 time_running; /* time counter on cpu */ | ||
270 | |||
271 | /* | ||
272 | * Hole for extension of the self monitor capabilities | ||
273 | */ | ||
274 | |||
275 | __u64 __reserved[123]; /* align to 1k */ | ||
276 | |||
277 | /* | ||
278 | * Control data for the mmap() data buffer. | ||
279 | * | ||
280 | * User-space reading the @data_head value should issue an rmb(), on | ||
281 | * SMP capable platforms, after reading this value -- see | ||
282 | * perf_counter_wakeup(). | ||
283 | * | ||
284 | * When the mapping is PROT_WRITE the @data_tail value should be | ||
285 | * written by userspace to reflect the last read data. In this case | ||
286 | * the kernel will not over-write unread data. | ||
287 | */ | ||
288 | __u64 data_head; /* head in the data section */ | ||
289 | __u64 data_tail; /* user-space written tail */ | ||
290 | }; | ||
291 | |||
292 | #define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0) | ||
293 | #define PERF_EVENT_MISC_CPUMODE_UNKNOWN (0 << 0) | ||
294 | #define PERF_EVENT_MISC_KERNEL (1 << 0) | ||
295 | #define PERF_EVENT_MISC_USER (2 << 0) | ||
296 | #define PERF_EVENT_MISC_HYPERVISOR (3 << 0) | ||
297 | |||
298 | struct perf_event_header { | ||
299 | __u32 type; | ||
300 | __u16 misc; | ||
301 | __u16 size; | ||
302 | }; | ||
303 | |||
304 | enum perf_event_type { | ||
305 | |||
306 | /* | ||
307 | * The MMAP events record the PROT_EXEC mappings so that we can | ||
308 | * correlate userspace IPs to code. They have the following structure: | ||
309 | * | ||
310 | * struct { | ||
311 | * struct perf_event_header header; | ||
312 | * | ||
313 | * u32 pid, tid; | ||
314 | * u64 addr; | ||
315 | * u64 len; | ||
316 | * u64 pgoff; | ||
317 | * char filename[]; | ||
318 | * }; | ||
319 | */ | ||
320 | PERF_EVENT_MMAP = 1, | ||
321 | |||
322 | /* | ||
323 | * struct { | ||
324 | * struct perf_event_header header; | ||
325 | * u64 id; | ||
326 | * u64 lost; | ||
327 | * }; | ||
328 | */ | ||
329 | PERF_EVENT_LOST = 2, | ||
330 | |||
331 | /* | ||
332 | * struct { | ||
333 | * struct perf_event_header header; | ||
334 | * | ||
335 | * u32 pid, tid; | ||
336 | * char comm[]; | ||
337 | * }; | ||
338 | */ | ||
339 | PERF_EVENT_COMM = 3, | ||
340 | |||
341 | /* | ||
342 | * struct { | ||
343 | * struct perf_event_header header; | ||
344 | * u32 pid, ppid; | ||
345 | * u32 tid, ptid; | ||
346 | * u64 time; | ||
347 | * }; | ||
348 | */ | ||
349 | PERF_EVENT_EXIT = 4, | ||
350 | |||
351 | /* | ||
352 | * struct { | ||
353 | * struct perf_event_header header; | ||
354 | * u64 time; | ||
355 | * u64 id; | ||
356 | * u64 stream_id; | ||
357 | * }; | ||
358 | */ | ||
359 | PERF_EVENT_THROTTLE = 5, | ||
360 | PERF_EVENT_UNTHROTTLE = 6, | ||
361 | |||
362 | /* | ||
363 | * struct { | ||
364 | * struct perf_event_header header; | ||
365 | * u32 pid, ppid; | ||
366 | * u32 tid, ptid; | ||
367 | * u64 time; | ||
368 | * }; | ||
369 | */ | ||
370 | PERF_EVENT_FORK = 7, | ||
371 | |||
372 | /* | ||
373 | * struct { | ||
374 | * struct perf_event_header header; | ||
375 | * u32 pid, tid; | ||
376 | * | ||
377 | * struct read_format values; | ||
378 | * }; | ||
379 | */ | ||
380 | PERF_EVENT_READ = 8, | ||
381 | |||
382 | /* | ||
383 | * struct { | ||
384 | * struct perf_event_header header; | ||
385 | * | ||
386 | * { u64 ip; } && PERF_SAMPLE_IP | ||
387 | * { u32 pid, tid; } && PERF_SAMPLE_TID | ||
388 | * { u64 time; } && PERF_SAMPLE_TIME | ||
389 | * { u64 addr; } && PERF_SAMPLE_ADDR | ||
390 | * { u64 id; } && PERF_SAMPLE_ID | ||
391 | * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID | ||
392 | * { u32 cpu, res; } && PERF_SAMPLE_CPU | ||
393 | * { u64 period; } && PERF_SAMPLE_PERIOD | ||
394 | * | ||
395 | * { struct read_format values; } && PERF_SAMPLE_READ | ||
396 | * | ||
397 | * { u64 nr, | ||
398 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN | ||
399 | * | ||
400 | * # | ||
401 | * # The RAW record below is opaque data wrt the ABI | ||
402 | * # | ||
403 | * # That is, the ABI doesn't make any promises wrt to | ||
404 | * # the stability of its content, it may vary depending | ||
405 | * # on event, hardware, kernel version and phase of | ||
406 | * # the moon. | ||
407 | * # | ||
408 | * # In other words, PERF_SAMPLE_RAW contents are not an ABI. | ||
409 | * # | ||
410 | * | ||
411 | * { u32 size; | ||
412 | * char data[size];}&& PERF_SAMPLE_RAW | ||
413 | * }; | ||
414 | */ | ||
415 | PERF_EVENT_SAMPLE = 9, | ||
416 | |||
417 | PERF_EVENT_MAX, /* non-ABI */ | ||
418 | }; | ||
419 | |||
420 | enum perf_callchain_context { | ||
421 | PERF_CONTEXT_HV = (__u64)-32, | ||
422 | PERF_CONTEXT_KERNEL = (__u64)-128, | ||
423 | PERF_CONTEXT_USER = (__u64)-512, | ||
424 | |||
425 | PERF_CONTEXT_GUEST = (__u64)-2048, | ||
426 | PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176, | ||
427 | PERF_CONTEXT_GUEST_USER = (__u64)-2560, | ||
428 | |||
429 | PERF_CONTEXT_MAX = (__u64)-4095, | ||
430 | }; | ||
431 | |||
432 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | ||
433 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | ||
434 | |||
435 | /* | ||
436 | * In case some app still references the old symbols: | ||
437 | */ | ||
438 | |||
439 | #define __NR_perf_counter_open __NR_perf_event_open | ||
440 | |||
441 | #define PR_TASK_PERF_COUNTERS_DISABLE PR_TASK_PERF_EVENTS_DISABLE | ||
442 | #define PR_TASK_PERF_COUNTERS_ENABLE PR_TASK_PERF_EVENTS_ENABLE | ||
443 | |||
444 | #endif /* _LINUX_PERF_COUNTER_H */ | ||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index c66b34f75eea..7b18b4fd5df7 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -211,11 +211,9 @@ struct perf_event_attr { | |||
211 | __u32 wakeup_watermark; /* bytes before wakeup */ | 211 | __u32 wakeup_watermark; /* bytes before wakeup */ |
212 | }; | 212 | }; |
213 | 213 | ||
214 | __u32 __reserved_2; | ||
215 | |||
216 | __u64 bp_addr; | ||
217 | __u32 bp_type; | 214 | __u32 bp_type; |
218 | __u32 bp_len; | 215 | __u64 bp_addr; |
216 | __u64 bp_len; | ||
219 | }; | 217 | }; |
220 | 218 | ||
221 | /* | 219 | /* |
@@ -290,7 +288,7 @@ struct perf_event_mmap_page { | |||
290 | }; | 288 | }; |
291 | 289 | ||
292 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) | 290 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) |
293 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) | 291 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) |
294 | #define PERF_RECORD_MISC_KERNEL (1 << 0) | 292 | #define PERF_RECORD_MISC_KERNEL (1 << 0) |
295 | #define PERF_RECORD_MISC_USER (2 << 0) | 293 | #define PERF_RECORD_MISC_USER (2 << 0) |
296 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) | 294 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) |
@@ -356,8 +354,8 @@ enum perf_event_type { | |||
356 | * u64 stream_id; | 354 | * u64 stream_id; |
357 | * }; | 355 | * }; |
358 | */ | 356 | */ |
359 | PERF_RECORD_THROTTLE = 5, | 357 | PERF_RECORD_THROTTLE = 5, |
360 | PERF_RECORD_UNTHROTTLE = 6, | 358 | PERF_RECORD_UNTHROTTLE = 6, |
361 | 359 | ||
362 | /* | 360 | /* |
363 | * struct { | 361 | * struct { |
@@ -371,10 +369,10 @@ enum perf_event_type { | |||
371 | 369 | ||
372 | /* | 370 | /* |
373 | * struct { | 371 | * struct { |
374 | * struct perf_event_header header; | 372 | * struct perf_event_header header; |
375 | * u32 pid, tid; | 373 | * u32 pid, tid; |
376 | * | 374 | * |
377 | * struct read_format values; | 375 | * struct read_format values; |
378 | * }; | 376 | * }; |
379 | */ | 377 | */ |
380 | PERF_RECORD_READ = 8, | 378 | PERF_RECORD_READ = 8, |
@@ -412,7 +410,7 @@ enum perf_event_type { | |||
412 | * char data[size];}&& PERF_SAMPLE_RAW | 410 | * char data[size];}&& PERF_SAMPLE_RAW |
413 | * }; | 411 | * }; |
414 | */ | 412 | */ |
415 | PERF_RECORD_SAMPLE = 9, | 413 | PERF_RECORD_SAMPLE = 9, |
416 | 414 | ||
417 | PERF_RECORD_MAX, /* non-ABI */ | 415 | PERF_RECORD_MAX, /* non-ABI */ |
418 | }; | 416 | }; |
@@ -478,9 +476,11 @@ struct hw_perf_event { | |||
478 | union { | 476 | union { |
479 | struct { /* hardware */ | 477 | struct { /* hardware */ |
480 | u64 config; | 478 | u64 config; |
479 | u64 last_tag; | ||
481 | unsigned long config_base; | 480 | unsigned long config_base; |
482 | unsigned long event_base; | 481 | unsigned long event_base; |
483 | int idx; | 482 | int idx; |
483 | int last_cpu; | ||
484 | }; | 484 | }; |
485 | struct { /* software */ | 485 | struct { /* software */ |
486 | s64 remaining; | 486 | s64 remaining; |
@@ -498,9 +498,8 @@ struct hw_perf_event { | |||
498 | atomic64_t period_left; | 498 | atomic64_t period_left; |
499 | u64 interrupts; | 499 | u64 interrupts; |
500 | 500 | ||
501 | u64 freq_count; | 501 | u64 freq_time_stamp; |
502 | u64 freq_interrupts; | 502 | u64 freq_count_stamp; |
503 | u64 freq_stamp; | ||
504 | #endif | 503 | #endif |
505 | }; | 504 | }; |
506 | 505 | ||
@@ -512,6 +511,8 @@ struct perf_event; | |||
512 | struct pmu { | 511 | struct pmu { |
513 | int (*enable) (struct perf_event *event); | 512 | int (*enable) (struct perf_event *event); |
514 | void (*disable) (struct perf_event *event); | 513 | void (*disable) (struct perf_event *event); |
514 | int (*start) (struct perf_event *event); | ||
515 | void (*stop) (struct perf_event *event); | ||
515 | void (*read) (struct perf_event *event); | 516 | void (*read) (struct perf_event *event); |
516 | void (*unthrottle) (struct perf_event *event); | 517 | void (*unthrottle) (struct perf_event *event); |
517 | }; | 518 | }; |
@@ -565,6 +566,10 @@ typedef void (*perf_overflow_handler_t)(struct perf_event *, int, | |||
565 | struct perf_sample_data *, | 566 | struct perf_sample_data *, |
566 | struct pt_regs *regs); | 567 | struct pt_regs *regs); |
567 | 568 | ||
569 | enum perf_group_flag { | ||
570 | PERF_GROUP_SOFTWARE = 0x1, | ||
571 | }; | ||
572 | |||
568 | /** | 573 | /** |
569 | * struct perf_event - performance event kernel representation: | 574 | * struct perf_event - performance event kernel representation: |
570 | */ | 575 | */ |
@@ -574,6 +579,7 @@ struct perf_event { | |||
574 | struct list_head event_entry; | 579 | struct list_head event_entry; |
575 | struct list_head sibling_list; | 580 | struct list_head sibling_list; |
576 | int nr_siblings; | 581 | int nr_siblings; |
582 | int group_flags; | ||
577 | struct perf_event *group_leader; | 583 | struct perf_event *group_leader; |
578 | struct perf_event *output; | 584 | struct perf_event *output; |
579 | const struct pmu *pmu; | 585 | const struct pmu *pmu; |
@@ -658,7 +664,7 @@ struct perf_event { | |||
658 | 664 | ||
659 | perf_overflow_handler_t overflow_handler; | 665 | perf_overflow_handler_t overflow_handler; |
660 | 666 | ||
661 | #ifdef CONFIG_EVENT_PROFILE | 667 | #ifdef CONFIG_EVENT_TRACING |
662 | struct event_filter *filter; | 668 | struct event_filter *filter; |
663 | #endif | 669 | #endif |
664 | 670 | ||
@@ -683,7 +689,8 @@ struct perf_event_context { | |||
683 | */ | 689 | */ |
684 | struct mutex mutex; | 690 | struct mutex mutex; |
685 | 691 | ||
686 | struct list_head group_list; | 692 | struct list_head pinned_groups; |
693 | struct list_head flexible_groups; | ||
687 | struct list_head event_list; | 694 | struct list_head event_list; |
688 | int nr_events; | 695 | int nr_events; |
689 | int nr_active; | 696 | int nr_active; |
@@ -746,10 +753,9 @@ extern int perf_max_events; | |||
746 | 753 | ||
747 | extern const struct pmu *hw_perf_event_init(struct perf_event *event); | 754 | extern const struct pmu *hw_perf_event_init(struct perf_event *event); |
748 | 755 | ||
749 | extern void perf_event_task_sched_in(struct task_struct *task, int cpu); | 756 | extern void perf_event_task_sched_in(struct task_struct *task); |
750 | extern void perf_event_task_sched_out(struct task_struct *task, | 757 | extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); |
751 | struct task_struct *next, int cpu); | 758 | extern void perf_event_task_tick(struct task_struct *task); |
752 | extern void perf_event_task_tick(struct task_struct *task, int cpu); | ||
753 | extern int perf_event_init_task(struct task_struct *child); | 759 | extern int perf_event_init_task(struct task_struct *child); |
754 | extern void perf_event_exit_task(struct task_struct *child); | 760 | extern void perf_event_exit_task(struct task_struct *child); |
755 | extern void perf_event_free_task(struct task_struct *task); | 761 | extern void perf_event_free_task(struct task_struct *task); |
@@ -764,7 +770,7 @@ extern int perf_event_task_disable(void); | |||
764 | extern int perf_event_task_enable(void); | 770 | extern int perf_event_task_enable(void); |
765 | extern int hw_perf_group_sched_in(struct perf_event *group_leader, | 771 | extern int hw_perf_group_sched_in(struct perf_event *group_leader, |
766 | struct perf_cpu_context *cpuctx, | 772 | struct perf_cpu_context *cpuctx, |
767 | struct perf_event_context *ctx, int cpu); | 773 | struct perf_event_context *ctx); |
768 | extern void perf_event_update_userpage(struct perf_event *event); | 774 | extern void perf_event_update_userpage(struct perf_event *event); |
769 | extern int perf_event_release_kernel(struct perf_event *event); | 775 | extern int perf_event_release_kernel(struct perf_event *event); |
770 | extern struct perf_event * | 776 | extern struct perf_event * |
@@ -814,9 +820,14 @@ extern int perf_event_overflow(struct perf_event *event, int nmi, | |||
814 | */ | 820 | */ |
815 | static inline int is_software_event(struct perf_event *event) | 821 | static inline int is_software_event(struct perf_event *event) |
816 | { | 822 | { |
817 | return (event->attr.type != PERF_TYPE_RAW) && | 823 | switch (event->attr.type) { |
818 | (event->attr.type != PERF_TYPE_HARDWARE) && | 824 | case PERF_TYPE_SOFTWARE: |
819 | (event->attr.type != PERF_TYPE_HW_CACHE); | 825 | case PERF_TYPE_TRACEPOINT: |
826 | /* for now the breakpoint stuff also works as software event */ | ||
827 | case PERF_TYPE_BREAKPOINT: | ||
828 | return 1; | ||
829 | } | ||
830 | return 0; | ||
820 | } | 831 | } |
821 | 832 | ||
822 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | 833 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; |
@@ -848,8 +859,7 @@ extern int sysctl_perf_event_mlock; | |||
848 | extern int sysctl_perf_event_sample_rate; | 859 | extern int sysctl_perf_event_sample_rate; |
849 | 860 | ||
850 | extern void perf_event_init(void); | 861 | extern void perf_event_init(void); |
851 | extern void perf_tp_event(int event_id, u64 addr, u64 count, | 862 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size); |
852 | void *record, int entry_size); | ||
853 | extern void perf_bp_event(struct perf_event *event, void *data); | 863 | extern void perf_bp_event(struct perf_event *event, void *data); |
854 | 864 | ||
855 | #ifndef perf_misc_flags | 865 | #ifndef perf_misc_flags |
@@ -870,12 +880,12 @@ extern void perf_event_enable(struct perf_event *event); | |||
870 | extern void perf_event_disable(struct perf_event *event); | 880 | extern void perf_event_disable(struct perf_event *event); |
871 | #else | 881 | #else |
872 | static inline void | 882 | static inline void |
873 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } | 883 | perf_event_task_sched_in(struct task_struct *task) { } |
874 | static inline void | 884 | static inline void |
875 | perf_event_task_sched_out(struct task_struct *task, | 885 | perf_event_task_sched_out(struct task_struct *task, |
876 | struct task_struct *next, int cpu) { } | 886 | struct task_struct *next) { } |
877 | static inline void | 887 | static inline void |
878 | perf_event_task_tick(struct task_struct *task, int cpu) { } | 888 | perf_event_task_tick(struct task_struct *task) { } |
879 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } | 889 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } |
880 | static inline void perf_event_exit_task(struct task_struct *child) { } | 890 | static inline void perf_event_exit_task(struct task_struct *child) { } |
881 | static inline void perf_event_free_task(struct task_struct *task) { } | 891 | static inline void perf_event_free_task(struct task_struct *task) { } |
@@ -890,13 +900,13 @@ static inline void | |||
890 | perf_sw_event(u32 event_id, u64 nr, int nmi, | 900 | perf_sw_event(u32 event_id, u64 nr, int nmi, |
891 | struct pt_regs *regs, u64 addr) { } | 901 | struct pt_regs *regs, u64 addr) { } |
892 | static inline void | 902 | static inline void |
893 | perf_bp_event(struct perf_event *event, void *data) { } | 903 | perf_bp_event(struct perf_event *event, void *data) { } |
894 | 904 | ||
895 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 905 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
896 | static inline void perf_event_comm(struct task_struct *tsk) { } | 906 | static inline void perf_event_comm(struct task_struct *tsk) { } |
897 | static inline void perf_event_fork(struct task_struct *tsk) { } | 907 | static inline void perf_event_fork(struct task_struct *tsk) { } |
898 | static inline void perf_event_init(void) { } | 908 | static inline void perf_event_init(void) { } |
899 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 909 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
900 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 910 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
901 | static inline void perf_event_enable(struct perf_event *event) { } | 911 | static inline void perf_event_enable(struct perf_event *event) { } |
902 | static inline void perf_event_disable(struct perf_event *event) { } | 912 | static inline void perf_event_disable(struct perf_event *event) { } |
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index 228b0b6306b0..0b80c806631f 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h | |||
@@ -315,6 +315,7 @@ struct sadb_x_kmaddress { | |||
315 | #define SADB_X_EALG_AES_GCM_ICV12 19 | 315 | #define SADB_X_EALG_AES_GCM_ICV12 19 |
316 | #define SADB_X_EALG_AES_GCM_ICV16 20 | 316 | #define SADB_X_EALG_AES_GCM_ICV16 20 |
317 | #define SADB_X_EALG_CAMELLIACBC 22 | 317 | #define SADB_X_EALG_CAMELLIACBC 22 |
318 | #define SADB_X_EALG_NULL_AES_GMAC 23 | ||
318 | #define SADB_EALG_MAX 253 /* last EALG */ | 319 | #define SADB_EALG_MAX 253 /* last EALG */ |
319 | /* private allocations should use 249-255 (RFC2407) */ | 320 | /* private allocations should use 249-255 (RFC2407) */ |
320 | #define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ | 321 | #define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index b1368b8f6572..6a7eb402165d 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -447,6 +447,7 @@ struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | |||
447 | int phy_device_register(struct phy_device *phy); | 447 | int phy_device_register(struct phy_device *phy); |
448 | int phy_clear_interrupt(struct phy_device *phydev); | 448 | int phy_clear_interrupt(struct phy_device *phydev); |
449 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | 449 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); |
450 | int phy_init_hw(struct phy_device *phydev); | ||
450 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | 451 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, |
451 | u32 flags, phy_interface_t interface); | 452 | u32 flags, phy_interface_t interface); |
452 | struct phy_device * phy_attach(struct net_device *dev, | 453 | struct phy_device * phy_attach(struct net_device *dev, |
@@ -484,6 +485,7 @@ void phy_driver_unregister(struct phy_driver *drv); | |||
484 | int phy_driver_register(struct phy_driver *new_driver); | 485 | int phy_driver_register(struct phy_driver *new_driver); |
485 | void phy_prepare_link(struct phy_device *phydev, | 486 | void phy_prepare_link(struct phy_device *phydev, |
486 | void (*adjust_link)(struct net_device *)); | 487 | void (*adjust_link)(struct net_device *)); |
488 | void phy_state_machine(struct work_struct *work); | ||
487 | void phy_start_machine(struct phy_device *phydev, | 489 | void phy_start_machine(struct phy_device *phydev, |
488 | void (*handler)(struct net_device *)); | 490 | void (*handler)(struct net_device *)); |
489 | void phy_stop_machine(struct phy_device *phydev); | 491 | void phy_stop_machine(struct phy_device *phydev); |
diff --git a/include/linux/plist.h b/include/linux/plist.h index 8227f717c70f..6898985e7b38 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h | |||
@@ -45,7 +45,7 @@ | |||
45 | * the insertion of new nodes. There are no nodes with duplicate | 45 | * the insertion of new nodes. There are no nodes with duplicate |
46 | * priorites on the list. | 46 | * priorites on the list. |
47 | * | 47 | * |
48 | * The nodes on the node_list is ordered by priority and can contain | 48 | * The nodes on the node_list are ordered by priority and can contain |
49 | * entries which have the same priority. Those entries are ordered | 49 | * entries which have the same priority. Those entries are ordered |
50 | * FIFO | 50 | * FIFO |
51 | * | 51 | * |
@@ -265,7 +265,7 @@ static inline int plist_node_empty(const struct plist_node *node) | |||
265 | * | 265 | * |
266 | * Assumes the plist is _not_ empty. | 266 | * Assumes the plist is _not_ empty. |
267 | */ | 267 | */ |
268 | static inline struct plist_node* plist_first(const struct plist_head *head) | 268 | static inline struct plist_node *plist_first(const struct plist_head *head) |
269 | { | 269 | { |
270 | return list_entry(head->node_list.next, | 270 | return list_entry(head->node_list.next, |
271 | struct plist_node, plist.node_list); | 271 | struct plist_node, plist.node_list); |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 198b8f9fe05e..e80df06ad22a 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
27 | #include <linux/wait.h> | 27 | #include <linux/wait.h> |
28 | #include <linux/timer.h> | 28 | #include <linux/timer.h> |
29 | #include <linux/completion.h> | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * Callbacks for platform drivers to implement. | 32 | * Callbacks for platform drivers to implement. |
@@ -412,9 +413,11 @@ struct dev_pm_info { | |||
412 | pm_message_t power_state; | 413 | pm_message_t power_state; |
413 | unsigned int can_wakeup:1; | 414 | unsigned int can_wakeup:1; |
414 | unsigned int should_wakeup:1; | 415 | unsigned int should_wakeup:1; |
416 | unsigned async_suspend:1; | ||
415 | enum dpm_state status; /* Owned by the PM core */ | 417 | enum dpm_state status; /* Owned by the PM core */ |
416 | #ifdef CONFIG_PM_SLEEP | 418 | #ifdef CONFIG_PM_SLEEP |
417 | struct list_head entry; | 419 | struct list_head entry; |
420 | struct completion completion; | ||
418 | #endif | 421 | #endif |
419 | #ifdef CONFIG_PM_RUNTIME | 422 | #ifdef CONFIG_PM_RUNTIME |
420 | struct timer_list suspend_timer; | 423 | struct timer_list suspend_timer; |
@@ -430,6 +433,7 @@ struct dev_pm_info { | |||
430 | unsigned int request_pending:1; | 433 | unsigned int request_pending:1; |
431 | unsigned int deferred_resume:1; | 434 | unsigned int deferred_resume:1; |
432 | unsigned int run_wake:1; | 435 | unsigned int run_wake:1; |
436 | unsigned int runtime_auto:1; | ||
433 | enum rpm_request request; | 437 | enum rpm_request request; |
434 | enum rpm_status runtime_status; | 438 | enum rpm_status runtime_status; |
435 | int runtime_error; | 439 | int runtime_error; |
@@ -508,6 +512,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
508 | __suspend_report_result(__func__, fn, ret); \ | 512 | __suspend_report_result(__func__, fn, ret); \ |
509 | } while (0) | 513 | } while (0) |
510 | 514 | ||
515 | extern void device_pm_wait_for_dev(struct device *sub, struct device *dev); | ||
511 | #else /* !CONFIG_PM_SLEEP */ | 516 | #else /* !CONFIG_PM_SLEEP */ |
512 | 517 | ||
513 | #define device_pm_lock() do {} while (0) | 518 | #define device_pm_lock() do {} while (0) |
@@ -520,6 +525,7 @@ static inline int dpm_suspend_start(pm_message_t state) | |||
520 | 525 | ||
521 | #define suspend_report_result(fn, ret) do {} while (0) | 526 | #define suspend_report_result(fn, ret) do {} while (0) |
522 | 527 | ||
528 | static inline void device_pm_wait_for_dev(struct device *a, struct device *b) {} | ||
523 | #endif /* !CONFIG_PM_SLEEP */ | 529 | #endif /* !CONFIG_PM_SLEEP */ |
524 | 530 | ||
525 | /* How to reorder dpm_list after device_move() */ | 531 | /* How to reorder dpm_list after device_move() */ |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 370ce0a6fe4a..7d773aac5314 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -28,6 +28,8 @@ extern int __pm_runtime_set_status(struct device *dev, unsigned int status); | |||
28 | extern int pm_runtime_barrier(struct device *dev); | 28 | extern int pm_runtime_barrier(struct device *dev); |
29 | extern void pm_runtime_enable(struct device *dev); | 29 | extern void pm_runtime_enable(struct device *dev); |
30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
31 | extern void pm_runtime_allow(struct device *dev); | ||
32 | extern void pm_runtime_forbid(struct device *dev); | ||
31 | 33 | ||
32 | static inline bool pm_children_suspended(struct device *dev) | 34 | static inline bool pm_children_suspended(struct device *dev) |
33 | { | 35 | { |
@@ -78,6 +80,8 @@ static inline int __pm_runtime_set_status(struct device *dev, | |||
78 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } | 80 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } |
79 | static inline void pm_runtime_enable(struct device *dev) {} | 81 | static inline void pm_runtime_enable(struct device *dev) {} |
80 | static inline void __pm_runtime_disable(struct device *dev, bool c) {} | 82 | static inline void __pm_runtime_disable(struct device *dev, bool c) {} |
83 | static inline void pm_runtime_allow(struct device *dev) {} | ||
84 | static inline void pm_runtime_forbid(struct device *dev) {} | ||
81 | 85 | ||
82 | static inline bool pm_children_suspended(struct device *dev) { return false; } | 86 | static inline bool pm_children_suspended(struct device *dev) { return false; } |
83 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} | 87 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} |
diff --git a/include/linux/poison.h b/include/linux/poison.h index 7fc194aef8c2..2110a81c5e2a 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
@@ -2,13 +2,25 @@ | |||
2 | #define _LINUX_POISON_H | 2 | #define _LINUX_POISON_H |
3 | 3 | ||
4 | /********** include/linux/list.h **********/ | 4 | /********** include/linux/list.h **********/ |
5 | |||
6 | /* | ||
7 | * Architectures might want to move the poison pointer offset | ||
8 | * into some well-recognized area such as 0xdead000000000000, | ||
9 | * that is also not mappable by user-space exploits: | ||
10 | */ | ||
11 | #ifdef CONFIG_ILLEGAL_POINTER_VALUE | ||
12 | # define POISON_POINTER_DELTA _AC(CONFIG_ILLEGAL_POINTER_VALUE, UL) | ||
13 | #else | ||
14 | # define POISON_POINTER_DELTA 0 | ||
15 | #endif | ||
16 | |||
5 | /* | 17 | /* |
6 | * These are non-NULL pointers that will result in page faults | 18 | * These are non-NULL pointers that will result in page faults |
7 | * under normal circumstances, used to verify that nobody uses | 19 | * under normal circumstances, used to verify that nobody uses |
8 | * non-initialized list entries. | 20 | * non-initialized list entries. |
9 | */ | 21 | */ |
10 | #define LIST_POISON1 ((void *) 0x00100100) | 22 | #define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA) |
11 | #define LIST_POISON2 ((void *) 0x00200200) | 23 | #define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA) |
12 | 24 | ||
13 | /********** include/linux/timer.h **********/ | 25 | /********** include/linux/timer.h **********/ |
14 | /* | 26 | /* |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 56f2d63a5cbb..c5eab89da51e 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -27,6 +27,26 @@ | |||
27 | #define PTRACE_GETSIGINFO 0x4202 | 27 | #define PTRACE_GETSIGINFO 0x4202 |
28 | #define PTRACE_SETSIGINFO 0x4203 | 28 | #define PTRACE_SETSIGINFO 0x4203 |
29 | 29 | ||
30 | /* | ||
31 | * Generic ptrace interface that exports the architecture specific regsets | ||
32 | * using the corresponding NT_* types (which are also used in the core dump). | ||
33 | * Please note that the NT_PRSTATUS note type in a core dump contains a full | ||
34 | * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the | ||
35 | * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the | ||
36 | * other user_regset flavors, the user_regset layout and the ELF core dump note | ||
37 | * payload are exactly the same layout. | ||
38 | * | ||
39 | * This interface usage is as follows: | ||
40 | * struct iovec iov = { buf, len}; | ||
41 | * | ||
42 | * ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov); | ||
43 | * | ||
44 | * On the successful completion, iov.len will be updated by the kernel, | ||
45 | * specifying how much the kernel has written/read to/from the user's iov.buf. | ||
46 | */ | ||
47 | #define PTRACE_GETREGSET 0x4204 | ||
48 | #define PTRACE_SETREGSET 0x4205 | ||
49 | |||
30 | /* options set using PTRACE_SETOPTIONS */ | 50 | /* options set using PTRACE_SETOPTIONS */ |
31 | #define PTRACE_O_TRACESYSGOOD 0x00000001 | 51 | #define PTRACE_O_TRACESYSGOOD 0x00000001 |
32 | #define PTRACE_O_TRACEFORK 0x00000002 | 52 | #define PTRACE_O_TRACEFORK 0x00000002 |
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index 7a9754c96775..01b3d759f1fc 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h | |||
@@ -10,7 +10,7 @@ struct platform_pwm_backlight_data { | |||
10 | unsigned int dft_brightness; | 10 | unsigned int dft_brightness; |
11 | unsigned int pwm_period_ns; | 11 | unsigned int pwm_period_ns; |
12 | int (*init)(struct device *dev); | 12 | int (*init)(struct device *dev); |
13 | int (*notify)(int brightness); | 13 | int (*notify)(struct device *dev, int brightness); |
14 | void (*exit)(struct device *dev); | 14 | void (*exit)(struct device *dev); |
15 | }; | 15 | }; |
16 | 16 | ||
diff --git a/include/linux/quota.h b/include/linux/quota.h index e70e62194243..a6861f117480 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -315,8 +315,9 @@ struct dquot_operations { | |||
315 | int (*claim_space) (struct inode *, qsize_t); | 315 | int (*claim_space) (struct inode *, qsize_t); |
316 | /* release rsved quota for delayed alloc */ | 316 | /* release rsved quota for delayed alloc */ |
317 | void (*release_rsv) (struct inode *, qsize_t); | 317 | void (*release_rsv) (struct inode *, qsize_t); |
318 | /* get reserved quota for delayed alloc */ | 318 | /* get reserved quota for delayed alloc, value returned is managed by |
319 | qsize_t (*get_reserved_space) (struct inode *); | 319 | * quota code only */ |
320 | qsize_t *(*get_reserved_space) (struct inode *); | ||
320 | }; | 321 | }; |
321 | 322 | ||
322 | /* Operations handling requests from userspace */ | 323 | /* Operations handling requests from userspace */ |
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h index 6b537f1ac96c..31e1ff69efc8 100644 --- a/include/linux/raid_class.h +++ b/include/linux/raid_class.h | |||
@@ -32,6 +32,7 @@ enum raid_level { | |||
32 | RAID_LEVEL_0, | 32 | RAID_LEVEL_0, |
33 | RAID_LEVEL_1, | 33 | RAID_LEVEL_1, |
34 | RAID_LEVEL_10, | 34 | RAID_LEVEL_10, |
35 | RAID_LEVEL_1E, | ||
35 | RAID_LEVEL_3, | 36 | RAID_LEVEL_3, |
36 | RAID_LEVEL_4, | 37 | RAID_LEVEL_4, |
37 | RAID_LEVEL_5, | 38 | RAID_LEVEL_5, |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 1bf0f708c4fc..779d70749beb 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -208,7 +208,7 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
208 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). | 208 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). |
209 | */ | 209 | */ |
210 | #define list_entry_rcu(ptr, type, member) \ | 210 | #define list_entry_rcu(ptr, type, member) \ |
211 | container_of(rcu_dereference(ptr), type, member) | 211 | container_of(rcu_dereference_raw(ptr), type, member) |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * list_first_entry_rcu - get the first element from a list | 214 | * list_first_entry_rcu - get the first element from a list |
@@ -225,9 +225,9 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
225 | list_entry_rcu((ptr)->next, type, member) | 225 | list_entry_rcu((ptr)->next, type, member) |
226 | 226 | ||
227 | #define __list_for_each_rcu(pos, head) \ | 227 | #define __list_for_each_rcu(pos, head) \ |
228 | for (pos = rcu_dereference((head)->next); \ | 228 | for (pos = rcu_dereference_raw((head)->next); \ |
229 | pos != (head); \ | 229 | pos != (head); \ |
230 | pos = rcu_dereference(pos->next)) | 230 | pos = rcu_dereference_raw(pos->next)) |
231 | 231 | ||
232 | /** | 232 | /** |
233 | * list_for_each_entry_rcu - iterate over rcu list of given type | 233 | * list_for_each_entry_rcu - iterate over rcu list of given type |
@@ -257,9 +257,9 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
257 | * as long as the traversal is guarded by rcu_read_lock(). | 257 | * as long as the traversal is guarded by rcu_read_lock(). |
258 | */ | 258 | */ |
259 | #define list_for_each_continue_rcu(pos, head) \ | 259 | #define list_for_each_continue_rcu(pos, head) \ |
260 | for ((pos) = rcu_dereference((pos)->next); \ | 260 | for ((pos) = rcu_dereference_raw((pos)->next); \ |
261 | prefetch((pos)->next), (pos) != (head); \ | 261 | prefetch((pos)->next), (pos) != (head); \ |
262 | (pos) = rcu_dereference((pos)->next)) | 262 | (pos) = rcu_dereference_raw((pos)->next)) |
263 | 263 | ||
264 | /** | 264 | /** |
265 | * list_for_each_entry_continue_rcu - continue iteration over list of given type | 265 | * list_for_each_entry_continue_rcu - continue iteration over list of given type |
@@ -418,10 +418,10 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
418 | * as long as the traversal is guarded by rcu_read_lock(). | 418 | * as long as the traversal is guarded by rcu_read_lock(). |
419 | */ | 419 | */ |
420 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ | 420 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ |
421 | for (pos = rcu_dereference((head)->first); \ | 421 | for (pos = rcu_dereference_raw((head)->first); \ |
422 | pos && ({ prefetch(pos->next); 1; }) && \ | 422 | pos && ({ prefetch(pos->next); 1; }) && \ |
423 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 423 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
424 | pos = rcu_dereference(pos->next)) | 424 | pos = rcu_dereference_raw(pos->next)) |
425 | 425 | ||
426 | #endif /* __KERNEL__ */ | 426 | #endif /* __KERNEL__ */ |
427 | #endif | 427 | #endif |
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h index 589a40919f01..b70ffe53cb9f 100644 --- a/include/linux/rculist_nulls.h +++ b/include/linux/rculist_nulls.h | |||
@@ -101,10 +101,10 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, | |||
101 | * | 101 | * |
102 | */ | 102 | */ |
103 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ | 103 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ |
104 | for (pos = rcu_dereference((head)->first); \ | 104 | for (pos = rcu_dereference_raw((head)->first); \ |
105 | (!is_a_nulls(pos)) && \ | 105 | (!is_a_nulls(pos)) && \ |
106 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ | 106 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ |
107 | pos = rcu_dereference(pos->next)) | 107 | pos = rcu_dereference_raw(pos->next)) |
108 | 108 | ||
109 | #endif | 109 | #endif |
110 | #endif | 110 | #endif |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 24440f4bf476..c84373626336 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -62,6 +62,8 @@ extern int sched_expedited_torture_stats(char *page); | |||
62 | 62 | ||
63 | /* Internal to kernel */ | 63 | /* Internal to kernel */ |
64 | extern void rcu_init(void); | 64 | extern void rcu_init(void); |
65 | extern int rcu_scheduler_active; | ||
66 | extern void rcu_scheduler_starting(void); | ||
65 | 67 | ||
66 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 68 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
67 | #include <linux/rcutree.h> | 69 | #include <linux/rcutree.h> |
@@ -78,14 +80,120 @@ extern void rcu_init(void); | |||
78 | } while (0) | 80 | } while (0) |
79 | 81 | ||
80 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 82 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
83 | |||
81 | extern struct lockdep_map rcu_lock_map; | 84 | extern struct lockdep_map rcu_lock_map; |
82 | # define rcu_read_acquire() \ | 85 | # define rcu_read_acquire() \ |
83 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) | 86 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) |
84 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) | 87 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) |
85 | #else | 88 | |
86 | # define rcu_read_acquire() do { } while (0) | 89 | extern struct lockdep_map rcu_bh_lock_map; |
87 | # define rcu_read_release() do { } while (0) | 90 | # define rcu_read_acquire_bh() \ |
88 | #endif | 91 | lock_acquire(&rcu_bh_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) |
92 | # define rcu_read_release_bh() lock_release(&rcu_bh_lock_map, 1, _THIS_IP_) | ||
93 | |||
94 | extern struct lockdep_map rcu_sched_lock_map; | ||
95 | # define rcu_read_acquire_sched() \ | ||
96 | lock_acquire(&rcu_sched_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) | ||
97 | # define rcu_read_release_sched() \ | ||
98 | lock_release(&rcu_sched_lock_map, 1, _THIS_IP_) | ||
99 | |||
100 | /** | ||
101 | * rcu_read_lock_held - might we be in RCU read-side critical section? | ||
102 | * | ||
103 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in | ||
104 | * an RCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, | ||
105 | * this assumes we are in an RCU read-side critical section unless it can | ||
106 | * prove otherwise. | ||
107 | */ | ||
108 | static inline int rcu_read_lock_held(void) | ||
109 | { | ||
110 | if (debug_locks) | ||
111 | return lock_is_held(&rcu_lock_map); | ||
112 | return 1; | ||
113 | } | ||
114 | |||
115 | /** | ||
116 | * rcu_read_lock_bh_held - might we be in RCU-bh read-side critical section? | ||
117 | * | ||
118 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in | ||
119 | * an RCU-bh read-side critical section. In absence of CONFIG_PROVE_LOCKING, | ||
120 | * this assumes we are in an RCU-bh read-side critical section unless it can | ||
121 | * prove otherwise. | ||
122 | */ | ||
123 | static inline int rcu_read_lock_bh_held(void) | ||
124 | { | ||
125 | if (debug_locks) | ||
126 | return lock_is_held(&rcu_bh_lock_map); | ||
127 | return 1; | ||
128 | } | ||
129 | |||
130 | /** | ||
131 | * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section? | ||
132 | * | ||
133 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in an | ||
134 | * RCU-sched read-side critical section. In absence of CONFIG_PROVE_LOCKING, | ||
135 | * this assumes we are in an RCU-sched read-side critical section unless it | ||
136 | * can prove otherwise. Note that disabling of preemption (including | ||
137 | * disabling irqs) counts as an RCU-sched read-side critical section. | ||
138 | */ | ||
139 | static inline int rcu_read_lock_sched_held(void) | ||
140 | { | ||
141 | int lockdep_opinion = 0; | ||
142 | |||
143 | if (debug_locks) | ||
144 | lockdep_opinion = lock_is_held(&rcu_sched_lock_map); | ||
145 | return lockdep_opinion || preempt_count() != 0 || !rcu_scheduler_active; | ||
146 | } | ||
147 | |||
148 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
149 | |||
150 | # define rcu_read_acquire() do { } while (0) | ||
151 | # define rcu_read_release() do { } while (0) | ||
152 | # define rcu_read_acquire_bh() do { } while (0) | ||
153 | # define rcu_read_release_bh() do { } while (0) | ||
154 | # define rcu_read_acquire_sched() do { } while (0) | ||
155 | # define rcu_read_release_sched() do { } while (0) | ||
156 | |||
157 | static inline int rcu_read_lock_held(void) | ||
158 | { | ||
159 | return 1; | ||
160 | } | ||
161 | |||
162 | static inline int rcu_read_lock_bh_held(void) | ||
163 | { | ||
164 | return 1; | ||
165 | } | ||
166 | |||
167 | static inline int rcu_read_lock_sched_held(void) | ||
168 | { | ||
169 | return preempt_count() != 0 || !rcu_scheduler_active; | ||
170 | } | ||
171 | |||
172 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
173 | |||
174 | #ifdef CONFIG_PROVE_RCU | ||
175 | |||
176 | /** | ||
177 | * rcu_dereference_check - rcu_dereference with debug checking | ||
178 | * | ||
179 | * Do an rcu_dereference(), but check that the context is correct. | ||
180 | * For example, rcu_dereference_check(gp, rcu_read_lock_held()) to | ||
181 | * ensure that the rcu_dereference_check() executes within an RCU | ||
182 | * read-side critical section. It is also possible to check for | ||
183 | * locks being held, for example, by using lockdep_is_held(). | ||
184 | */ | ||
185 | #define rcu_dereference_check(p, c) \ | ||
186 | ({ \ | ||
187 | if (debug_locks && !(c)) \ | ||
188 | lockdep_rcu_dereference(__FILE__, __LINE__); \ | ||
189 | rcu_dereference_raw(p); \ | ||
190 | }) | ||
191 | |||
192 | #else /* #ifdef CONFIG_PROVE_RCU */ | ||
193 | |||
194 | #define rcu_dereference_check(p, c) rcu_dereference_raw(p) | ||
195 | |||
196 | #endif /* #else #ifdef CONFIG_PROVE_RCU */ | ||
89 | 197 | ||
90 | /** | 198 | /** |
91 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. | 199 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. |
@@ -160,7 +268,7 @@ static inline void rcu_read_lock_bh(void) | |||
160 | { | 268 | { |
161 | __rcu_read_lock_bh(); | 269 | __rcu_read_lock_bh(); |
162 | __acquire(RCU_BH); | 270 | __acquire(RCU_BH); |
163 | rcu_read_acquire(); | 271 | rcu_read_acquire_bh(); |
164 | } | 272 | } |
165 | 273 | ||
166 | /* | 274 | /* |
@@ -170,7 +278,7 @@ static inline void rcu_read_lock_bh(void) | |||
170 | */ | 278 | */ |
171 | static inline void rcu_read_unlock_bh(void) | 279 | static inline void rcu_read_unlock_bh(void) |
172 | { | 280 | { |
173 | rcu_read_release(); | 281 | rcu_read_release_bh(); |
174 | __release(RCU_BH); | 282 | __release(RCU_BH); |
175 | __rcu_read_unlock_bh(); | 283 | __rcu_read_unlock_bh(); |
176 | } | 284 | } |
@@ -188,7 +296,7 @@ static inline void rcu_read_lock_sched(void) | |||
188 | { | 296 | { |
189 | preempt_disable(); | 297 | preempt_disable(); |
190 | __acquire(RCU_SCHED); | 298 | __acquire(RCU_SCHED); |
191 | rcu_read_acquire(); | 299 | rcu_read_acquire_sched(); |
192 | } | 300 | } |
193 | 301 | ||
194 | /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ | 302 | /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ |
@@ -205,7 +313,7 @@ static inline notrace void rcu_read_lock_sched_notrace(void) | |||
205 | */ | 313 | */ |
206 | static inline void rcu_read_unlock_sched(void) | 314 | static inline void rcu_read_unlock_sched(void) |
207 | { | 315 | { |
208 | rcu_read_release(); | 316 | rcu_read_release_sched(); |
209 | __release(RCU_SCHED); | 317 | __release(RCU_SCHED); |
210 | preempt_enable(); | 318 | preempt_enable(); |
211 | } | 319 | } |
@@ -219,22 +327,49 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
219 | 327 | ||
220 | 328 | ||
221 | /** | 329 | /** |
222 | * rcu_dereference - fetch an RCU-protected pointer in an | 330 | * rcu_dereference_raw - fetch an RCU-protected pointer |
223 | * RCU read-side critical section. This pointer may later | 331 | * |
224 | * be safely dereferenced. | 332 | * The caller must be within some flavor of RCU read-side critical |
333 | * section, or must be otherwise preventing the pointer from changing, | ||
334 | * for example, by holding an appropriate lock. This pointer may later | ||
335 | * be safely dereferenced. It is the caller's responsibility to have | ||
336 | * done the right thing, as this primitive does no checking of any kind. | ||
225 | * | 337 | * |
226 | * Inserts memory barriers on architectures that require them | 338 | * Inserts memory barriers on architectures that require them |
227 | * (currently only the Alpha), and, more importantly, documents | 339 | * (currently only the Alpha), and, more importantly, documents |
228 | * exactly which pointers are protected by RCU. | 340 | * exactly which pointers are protected by RCU. |
229 | */ | 341 | */ |
230 | 342 | #define rcu_dereference_raw(p) ({ \ | |
231 | #define rcu_dereference(p) ({ \ | ||
232 | typeof(p) _________p1 = ACCESS_ONCE(p); \ | 343 | typeof(p) _________p1 = ACCESS_ONCE(p); \ |
233 | smp_read_barrier_depends(); \ | 344 | smp_read_barrier_depends(); \ |
234 | (_________p1); \ | 345 | (_________p1); \ |
235 | }) | 346 | }) |
236 | 347 | ||
237 | /** | 348 | /** |
349 | * rcu_dereference - fetch an RCU-protected pointer, checking for RCU | ||
350 | * | ||
351 | * Makes rcu_dereference_check() do the dirty work. | ||
352 | */ | ||
353 | #define rcu_dereference(p) \ | ||
354 | rcu_dereference_check(p, rcu_read_lock_held()) | ||
355 | |||
356 | /** | ||
357 | * rcu_dereference_bh - fetch an RCU-protected pointer, checking for RCU-bh | ||
358 | * | ||
359 | * Makes rcu_dereference_check() do the dirty work. | ||
360 | */ | ||
361 | #define rcu_dereference_bh(p) \ | ||
362 | rcu_dereference_check(p, rcu_read_lock_bh_held()) | ||
363 | |||
364 | /** | ||
365 | * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched | ||
366 | * | ||
367 | * Makes rcu_dereference_check() do the dirty work. | ||
368 | */ | ||
369 | #define rcu_dereference_sched(p) \ | ||
370 | rcu_dereference_check(p, rcu_read_lock_sched_held()) | ||
371 | |||
372 | /** | ||
238 | * rcu_assign_pointer - assign (publicize) a pointer to a newly | 373 | * rcu_assign_pointer - assign (publicize) a pointer to a newly |
239 | * initialized structure that will be dereferenced by RCU read-side | 374 | * initialized structure that will be dereferenced by RCU read-side |
240 | * critical sections. Returns the value assigned. | 375 | * critical sections. Returns the value assigned. |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index c4ba9a78721e..a5195875480a 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -62,6 +62,18 @@ static inline long rcu_batches_completed_bh(void) | |||
62 | 62 | ||
63 | extern int rcu_expedited_torture_stats(char *page); | 63 | extern int rcu_expedited_torture_stats(char *page); |
64 | 64 | ||
65 | static inline void rcu_force_quiescent_state(void) | ||
66 | { | ||
67 | } | ||
68 | |||
69 | static inline void rcu_bh_force_quiescent_state(void) | ||
70 | { | ||
71 | } | ||
72 | |||
73 | static inline void rcu_sched_force_quiescent_state(void) | ||
74 | { | ||
75 | } | ||
76 | |||
65 | #define synchronize_rcu synchronize_sched | 77 | #define synchronize_rcu synchronize_sched |
66 | 78 | ||
67 | static inline void synchronize_rcu_expedited(void) | 79 | static inline void synchronize_rcu_expedited(void) |
@@ -93,12 +105,13 @@ static inline void rcu_exit_nohz(void) | |||
93 | 105 | ||
94 | #endif /* #else #ifdef CONFIG_NO_HZ */ | 106 | #endif /* #else #ifdef CONFIG_NO_HZ */ |
95 | 107 | ||
96 | static inline void rcu_scheduler_starting(void) | 108 | static inline void exit_rcu(void) |
97 | { | 109 | { |
98 | } | 110 | } |
99 | 111 | ||
100 | static inline void exit_rcu(void) | 112 | static inline int rcu_preempt_depth(void) |
101 | { | 113 | { |
114 | return 0; | ||
102 | } | 115 | } |
103 | 116 | ||
104 | #endif /* __LINUX_RCUTINY_H */ | 117 | #endif /* __LINUX_RCUTINY_H */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index c93eee5911b0..42cc3a04779e 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -35,7 +35,6 @@ struct notifier_block; | |||
35 | extern void rcu_sched_qs(int cpu); | 35 | extern void rcu_sched_qs(int cpu); |
36 | extern void rcu_bh_qs(int cpu); | 36 | extern void rcu_bh_qs(int cpu); |
37 | extern int rcu_needs_cpu(int cpu); | 37 | extern int rcu_needs_cpu(int cpu); |
38 | extern void rcu_scheduler_starting(void); | ||
39 | extern int rcu_expedited_torture_stats(char *page); | 38 | extern int rcu_expedited_torture_stats(char *page); |
40 | 39 | ||
41 | #ifdef CONFIG_TREE_PREEMPT_RCU | 40 | #ifdef CONFIG_TREE_PREEMPT_RCU |
@@ -45,6 +44,12 @@ extern void __rcu_read_unlock(void); | |||
45 | extern void synchronize_rcu(void); | 44 | extern void synchronize_rcu(void); |
46 | extern void exit_rcu(void); | 45 | extern void exit_rcu(void); |
47 | 46 | ||
47 | /* | ||
48 | * Defined as macro as it is a very low level header | ||
49 | * included from areas that don't even know about current | ||
50 | */ | ||
51 | #define rcu_preempt_depth() (current->rcu_read_lock_nesting) | ||
52 | |||
48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 53 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
49 | 54 | ||
50 | static inline void __rcu_read_lock(void) | 55 | static inline void __rcu_read_lock(void) |
@@ -63,6 +68,11 @@ static inline void exit_rcu(void) | |||
63 | { | 68 | { |
64 | } | 69 | } |
65 | 70 | ||
71 | static inline int rcu_preempt_depth(void) | ||
72 | { | ||
73 | return 0; | ||
74 | } | ||
75 | |||
66 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ | 76 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ |
67 | 77 | ||
68 | static inline void __rcu_read_lock_bh(void) | 78 | static inline void __rcu_read_lock_bh(void) |
@@ -88,6 +98,9 @@ extern void rcu_check_callbacks(int cpu, int user); | |||
88 | extern long rcu_batches_completed(void); | 98 | extern long rcu_batches_completed(void); |
89 | extern long rcu_batches_completed_bh(void); | 99 | extern long rcu_batches_completed_bh(void); |
90 | extern long rcu_batches_completed_sched(void); | 100 | extern long rcu_batches_completed_sched(void); |
101 | extern void rcu_force_quiescent_state(void); | ||
102 | extern void rcu_bh_force_quiescent_state(void); | ||
103 | extern void rcu_sched_force_quiescent_state(void); | ||
91 | 104 | ||
92 | #ifdef CONFIG_NO_HZ | 105 | #ifdef CONFIG_NO_HZ |
93 | void rcu_enter_nohz(void); | 106 | void rcu_enter_nohz(void); |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index c96c1858fe2c..1ba3cf6edfbb 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -62,6 +62,12 @@ void reiserfs_write_unlock(struct super_block *s); | |||
62 | int reiserfs_write_lock_once(struct super_block *s); | 62 | int reiserfs_write_lock_once(struct super_block *s); |
63 | void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); | 63 | void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); |
64 | 64 | ||
65 | #ifdef CONFIG_REISERFS_CHECK | ||
66 | void reiserfs_lock_check_recursive(struct super_block *s); | ||
67 | #else | ||
68 | static inline void reiserfs_lock_check_recursive(struct super_block *s) { } | ||
69 | #endif | ||
70 | |||
65 | /* | 71 | /* |
66 | * Several mutexes depend on the write lock. | 72 | * Several mutexes depend on the write lock. |
67 | * However sometimes we want to relax the write lock while we hold | 73 | * However sometimes we want to relax the write lock while we hold |
@@ -92,11 +98,31 @@ void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); | |||
92 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, | 98 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, |
93 | struct super_block *s) | 99 | struct super_block *s) |
94 | { | 100 | { |
101 | reiserfs_lock_check_recursive(s); | ||
95 | reiserfs_write_unlock(s); | 102 | reiserfs_write_unlock(s); |
96 | mutex_lock(m); | 103 | mutex_lock(m); |
97 | reiserfs_write_lock(s); | 104 | reiserfs_write_lock(s); |
98 | } | 105 | } |
99 | 106 | ||
107 | static inline void | ||
108 | reiserfs_mutex_lock_nested_safe(struct mutex *m, unsigned int subclass, | ||
109 | struct super_block *s) | ||
110 | { | ||
111 | reiserfs_lock_check_recursive(s); | ||
112 | reiserfs_write_unlock(s); | ||
113 | mutex_lock_nested(m, subclass); | ||
114 | reiserfs_write_lock(s); | ||
115 | } | ||
116 | |||
117 | static inline void | ||
118 | reiserfs_down_read_safe(struct rw_semaphore *sem, struct super_block *s) | ||
119 | { | ||
120 | reiserfs_lock_check_recursive(s); | ||
121 | reiserfs_write_unlock(s); | ||
122 | down_read(sem); | ||
123 | reiserfs_write_lock(s); | ||
124 | } | ||
125 | |||
100 | /* | 126 | /* |
101 | * When we schedule, we usually want to also release the write lock, | 127 | * When we schedule, we usually want to also release the write lock, |
102 | * according to the previous bkl based locking scheme of reiserfs. | 128 | * according to the previous bkl based locking scheme of reiserfs. |
diff --git a/include/linux/resource.h b/include/linux/resource.h index 40fc7e626082..f1e914eefeab 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
@@ -3,8 +3,6 @@ | |||
3 | 3 | ||
4 | #include <linux/time.h> | 4 | #include <linux/time.h> |
5 | 5 | ||
6 | struct task_struct; | ||
7 | |||
8 | /* | 6 | /* |
9 | * Resource control/accounting header file for linux | 7 | * Resource control/accounting header file for linux |
10 | */ | 8 | */ |
@@ -70,6 +68,12 @@ struct rlimit { | |||
70 | */ | 68 | */ |
71 | #include <asm/resource.h> | 69 | #include <asm/resource.h> |
72 | 70 | ||
71 | #ifdef __KERNEL__ | ||
72 | |||
73 | struct task_struct; | ||
74 | |||
73 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); | 75 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); |
74 | 76 | ||
77 | #endif /* __KERNEL__ */ | ||
78 | |||
75 | #endif | 79 | #endif |
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h index c9ba2fdf807d..bc8c3881c729 100644 --- a/include/linux/resume-trace.h +++ b/include/linux/resume-trace.h | |||
@@ -6,6 +6,11 @@ | |||
6 | 6 | ||
7 | extern int pm_trace_enabled; | 7 | extern int pm_trace_enabled; |
8 | 8 | ||
9 | static inline int pm_trace_is_enabled(void) | ||
10 | { | ||
11 | return pm_trace_enabled; | ||
12 | } | ||
13 | |||
9 | struct device; | 14 | struct device; |
10 | extern void set_trace_device(struct device *); | 15 | extern void set_trace_device(struct device *); |
11 | extern void generate_resume_trace(const void *tracedata, unsigned int user); | 16 | extern void generate_resume_trace(const void *tracedata, unsigned int user); |
@@ -17,6 +22,8 @@ extern void generate_resume_trace(const void *tracedata, unsigned int user); | |||
17 | 22 | ||
18 | #else | 23 | #else |
19 | 24 | ||
25 | static inline int pm_trace_is_enabled(void) { return 0; } | ||
26 | |||
20 | #define TRACE_DEVICE(dev) do { } while (0) | 27 | #define TRACE_DEVICE(dev) do { } while (0) |
21 | #define TRACE_RESUME(dev) do { } while (0) | 28 | #define TRACE_RESUME(dev) do { } while (0) |
22 | 29 | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 05330fc5b436..5c52fa43785c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -735,6 +735,9 @@ extern void rtnl_lock(void); | |||
735 | extern void rtnl_unlock(void); | 735 | extern void rtnl_unlock(void); |
736 | extern int rtnl_trylock(void); | 736 | extern int rtnl_trylock(void); |
737 | extern int rtnl_is_locked(void); | 737 | extern int rtnl_is_locked(void); |
738 | #ifdef CONFIG_PROVE_LOCKING | ||
739 | extern int lockdep_rtnl_is_held(void); | ||
740 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ | ||
738 | 741 | ||
739 | extern void rtnetlink_init(void); | 742 | extern void rtnetlink_init(void); |
740 | extern void __rtnl_unlock(void); | 743 | extern void __rtnl_unlock(void); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 244c287a5ac1..0eef87b58ea5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -192,6 +192,12 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
192 | #define TASK_DEAD 64 | 192 | #define TASK_DEAD 64 |
193 | #define TASK_WAKEKILL 128 | 193 | #define TASK_WAKEKILL 128 |
194 | #define TASK_WAKING 256 | 194 | #define TASK_WAKING 256 |
195 | #define TASK_STATE_MAX 512 | ||
196 | |||
197 | #define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW" | ||
198 | |||
199 | extern char ___assert_task_state[1 - 2*!!( | ||
200 | sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)]; | ||
195 | 201 | ||
196 | /* Convenience macros for the sake of set_task_state */ | 202 | /* Convenience macros for the sake of set_task_state */ |
197 | #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) | 203 | #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) |
@@ -304,6 +310,7 @@ extern void sched_show_task(struct task_struct *p); | |||
304 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 310 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
305 | extern void softlockup_tick(void); | 311 | extern void softlockup_tick(void); |
306 | extern void touch_softlockup_watchdog(void); | 312 | extern void touch_softlockup_watchdog(void); |
313 | extern void touch_softlockup_watchdog_sync(void); | ||
307 | extern void touch_all_softlockup_watchdogs(void); | 314 | extern void touch_all_softlockup_watchdogs(void); |
308 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, | 315 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, |
309 | void __user *buffer, | 316 | void __user *buffer, |
@@ -317,6 +324,9 @@ static inline void softlockup_tick(void) | |||
317 | static inline void touch_softlockup_watchdog(void) | 324 | static inline void touch_softlockup_watchdog(void) |
318 | { | 325 | { |
319 | } | 326 | } |
327 | static inline void touch_softlockup_watchdog_sync(void) | ||
328 | { | ||
329 | } | ||
320 | static inline void touch_all_softlockup_watchdogs(void) | 330 | static inline void touch_all_softlockup_watchdogs(void) |
321 | { | 331 | { |
322 | } | 332 | } |
@@ -371,6 +381,8 @@ extern int sysctl_max_map_count; | |||
371 | 381 | ||
372 | #include <linux/aio.h> | 382 | #include <linux/aio.h> |
373 | 383 | ||
384 | #ifdef CONFIG_MMU | ||
385 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
374 | extern unsigned long | 386 | extern unsigned long |
375 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, | 387 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, |
376 | unsigned long, unsigned long); | 388 | unsigned long, unsigned long); |
@@ -380,6 +392,9 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |||
380 | unsigned long flags); | 392 | unsigned long flags); |
381 | extern void arch_unmap_area(struct mm_struct *, unsigned long); | 393 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
382 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | 394 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); |
395 | #else | ||
396 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | ||
397 | #endif | ||
383 | 398 | ||
384 | #if USE_SPLIT_PTLOCKS | 399 | #if USE_SPLIT_PTLOCKS |
385 | /* | 400 | /* |
@@ -725,14 +740,6 @@ struct user_struct { | |||
725 | uid_t uid; | 740 | uid_t uid; |
726 | struct user_namespace *user_ns; | 741 | struct user_namespace *user_ns; |
727 | 742 | ||
728 | #ifdef CONFIG_USER_SCHED | ||
729 | struct task_group *tg; | ||
730 | #ifdef CONFIG_SYSFS | ||
731 | struct kobject kobj; | ||
732 | struct delayed_work work; | ||
733 | #endif | ||
734 | #endif | ||
735 | |||
736 | #ifdef CONFIG_PERF_EVENTS | 743 | #ifdef CONFIG_PERF_EVENTS |
737 | atomic_long_t locked_vm; | 744 | atomic_long_t locked_vm; |
738 | #endif | 745 | #endif |
@@ -863,7 +870,10 @@ static inline int sd_balance_for_mc_power(void) | |||
863 | if (sched_smt_power_savings) | 870 | if (sched_smt_power_savings) |
864 | return SD_POWERSAVINGS_BALANCE; | 871 | return SD_POWERSAVINGS_BALANCE; |
865 | 872 | ||
866 | return SD_PREFER_SIBLING; | 873 | if (!sched_mc_power_savings) |
874 | return SD_PREFER_SIBLING; | ||
875 | |||
876 | return 0; | ||
867 | } | 877 | } |
868 | 878 | ||
869 | static inline int sd_balance_for_package_power(void) | 879 | static inline int sd_balance_for_package_power(void) |
@@ -1069,7 +1079,8 @@ struct sched_domain; | |||
1069 | struct sched_class { | 1079 | struct sched_class { |
1070 | const struct sched_class *next; | 1080 | const struct sched_class *next; |
1071 | 1081 | ||
1072 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup); | 1082 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup, |
1083 | bool head); | ||
1073 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); | 1084 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); |
1074 | void (*yield_task) (struct rq *rq); | 1085 | void (*yield_task) (struct rq *rq); |
1075 | 1086 | ||
@@ -1081,17 +1092,10 @@ struct sched_class { | |||
1081 | #ifdef CONFIG_SMP | 1092 | #ifdef CONFIG_SMP |
1082 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); | 1093 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); |
1083 | 1094 | ||
1084 | unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, | ||
1085 | struct rq *busiest, unsigned long max_load_move, | ||
1086 | struct sched_domain *sd, enum cpu_idle_type idle, | ||
1087 | int *all_pinned, int *this_best_prio); | ||
1088 | |||
1089 | int (*move_one_task) (struct rq *this_rq, int this_cpu, | ||
1090 | struct rq *busiest, struct sched_domain *sd, | ||
1091 | enum cpu_idle_type idle); | ||
1092 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | 1095 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
1093 | void (*post_schedule) (struct rq *this_rq); | 1096 | void (*post_schedule) (struct rq *this_rq); |
1094 | void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); | 1097 | void (*task_waking) (struct rq *this_rq, struct task_struct *task); |
1098 | void (*task_woken) (struct rq *this_rq, struct task_struct *task); | ||
1095 | 1099 | ||
1096 | void (*set_cpus_allowed)(struct task_struct *p, | 1100 | void (*set_cpus_allowed)(struct task_struct *p, |
1097 | const struct cpumask *newmask); | 1101 | const struct cpumask *newmask); |
@@ -1115,7 +1119,7 @@ struct sched_class { | |||
1115 | struct task_struct *task); | 1119 | struct task_struct *task); |
1116 | 1120 | ||
1117 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1121 | #ifdef CONFIG_FAIR_GROUP_SCHED |
1118 | void (*moved_group) (struct task_struct *p); | 1122 | void (*moved_group) (struct task_struct *p, int on_rq); |
1119 | #endif | 1123 | #endif |
1120 | }; | 1124 | }; |
1121 | 1125 | ||
@@ -1357,7 +1361,7 @@ struct task_struct { | |||
1357 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1361 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
1358 | - access with [gs]et_task_comm (which lock | 1362 | - access with [gs]et_task_comm (which lock |
1359 | it with task_lock()) | 1363 | it with task_lock()) |
1360 | - initialized normally by flush_old_exec */ | 1364 | - initialized normally by setup_new_exec */ |
1361 | /* file system info */ | 1365 | /* file system info */ |
1362 | int link_count, total_link_count; | 1366 | int link_count, total_link_count; |
1363 | #ifdef CONFIG_SYSVIPC | 1367 | #ifdef CONFIG_SYSVIPC |
@@ -1446,10 +1450,8 @@ struct task_struct { | |||
1446 | gfp_t lockdep_reclaim_gfp; | 1450 | gfp_t lockdep_reclaim_gfp; |
1447 | #endif | 1451 | #endif |
1448 | 1452 | ||
1449 | #ifdef CONFIG_FS_JOURNAL_INFO | ||
1450 | /* journalling filesystem info */ | 1453 | /* journalling filesystem info */ |
1451 | void *journal_info; | 1454 | void *journal_info; |
1452 | #endif | ||
1453 | 1455 | ||
1454 | /* stacked block device info */ | 1456 | /* stacked block device info */ |
1455 | struct bio *bio_list, **bio_tail; | 1457 | struct bio *bio_list, **bio_tail; |
@@ -1555,7 +1557,7 @@ struct task_struct { | |||
1555 | }; | 1557 | }; |
1556 | 1558 | ||
1557 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1559 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
1558 | #define tsk_cpumask(tsk) (&(tsk)->cpus_allowed) | 1560 | #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) |
1559 | 1561 | ||
1560 | /* | 1562 | /* |
1561 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | 1563 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT |
@@ -2486,8 +2488,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | |||
2486 | 2488 | ||
2487 | #endif /* CONFIG_SMP */ | 2489 | #endif /* CONFIG_SMP */ |
2488 | 2490 | ||
2489 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
2490 | |||
2491 | #ifdef CONFIG_TRACING | 2491 | #ifdef CONFIG_TRACING |
2492 | extern void | 2492 | extern void |
2493 | __trace_special(void *__tr, void *__data, | 2493 | __trace_special(void *__tr, void *__data, |
@@ -2505,13 +2505,9 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask); | |||
2505 | 2505 | ||
2506 | extern void normalize_rt_tasks(void); | 2506 | extern void normalize_rt_tasks(void); |
2507 | 2507 | ||
2508 | #ifdef CONFIG_GROUP_SCHED | 2508 | #ifdef CONFIG_CGROUP_SCHED |
2509 | 2509 | ||
2510 | extern struct task_group init_task_group; | 2510 | extern struct task_group init_task_group; |
2511 | #ifdef CONFIG_USER_SCHED | ||
2512 | extern struct task_group root_task_group; | ||
2513 | extern void set_tg_uid(struct user_struct *user); | ||
2514 | #endif | ||
2515 | 2511 | ||
2516 | extern struct task_group *sched_create_group(struct task_group *parent); | 2512 | extern struct task_group *sched_create_group(struct task_group *parent); |
2517 | extern void sched_destroy_group(struct task_group *tg); | 2513 | extern void sched_destroy_group(struct task_group *tg); |
@@ -2596,7 +2592,27 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p) | |||
2596 | } | 2592 | } |
2597 | #endif /* CONFIG_MM_OWNER */ | 2593 | #endif /* CONFIG_MM_OWNER */ |
2598 | 2594 | ||
2599 | #define TASK_STATE_TO_CHAR_STR "RSDTtZX" | 2595 | static inline unsigned long task_rlimit(const struct task_struct *tsk, |
2596 | unsigned int limit) | ||
2597 | { | ||
2598 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur); | ||
2599 | } | ||
2600 | |||
2601 | static inline unsigned long task_rlimit_max(const struct task_struct *tsk, | ||
2602 | unsigned int limit) | ||
2603 | { | ||
2604 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max); | ||
2605 | } | ||
2606 | |||
2607 | static inline unsigned long rlimit(unsigned int limit) | ||
2608 | { | ||
2609 | return task_rlimit(current, limit); | ||
2610 | } | ||
2611 | |||
2612 | static inline unsigned long rlimit_max(unsigned int limit) | ||
2613 | { | ||
2614 | return task_rlimit_max(current, limit); | ||
2615 | } | ||
2600 | 2616 | ||
2601 | #endif /* __KERNEL__ */ | 2617 | #endif /* __KERNEL__ */ |
2602 | 2618 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index 466cbadbd1ef..2c627d361c02 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -95,8 +95,13 @@ struct seq_file; | |||
95 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | 95 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); |
96 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); | 96 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); |
97 | 97 | ||
98 | #ifdef CONFIG_MMU | ||
98 | extern unsigned long mmap_min_addr; | 99 | extern unsigned long mmap_min_addr; |
99 | extern unsigned long dac_mmap_min_addr; | 100 | extern unsigned long dac_mmap_min_addr; |
101 | #else | ||
102 | #define dac_mmap_min_addr 0UL | ||
103 | #endif | ||
104 | |||
100 | /* | 105 | /* |
101 | * Values used in the task_security_ops calls | 106 | * Values used in the task_security_ops calls |
102 | */ | 107 | */ |
@@ -121,6 +126,7 @@ struct request_sock; | |||
121 | #define LSM_UNSAFE_PTRACE 2 | 126 | #define LSM_UNSAFE_PTRACE 2 |
122 | #define LSM_UNSAFE_PTRACE_CAP 4 | 127 | #define LSM_UNSAFE_PTRACE_CAP 4 |
123 | 128 | ||
129 | #ifdef CONFIG_MMU | ||
124 | /* | 130 | /* |
125 | * If a hint addr is less than mmap_min_addr change hint to be as | 131 | * If a hint addr is less than mmap_min_addr change hint to be as |
126 | * low as possible but still greater than mmap_min_addr | 132 | * low as possible but still greater than mmap_min_addr |
@@ -135,6 +141,7 @@ static inline unsigned long round_hint_to_min(unsigned long hint) | |||
135 | } | 141 | } |
136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, | 142 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, |
137 | void __user *buffer, size_t *lenp, loff_t *ppos); | 143 | void __user *buffer, size_t *lenp, loff_t *ppos); |
144 | #endif | ||
138 | 145 | ||
139 | #ifdef CONFIG_SECURITY | 146 | #ifdef CONFIG_SECURITY |
140 | 147 | ||
diff --git a/include/linux/serio.h b/include/linux/serio.h index e2f3044d4a4a..813d26c247ec 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -136,25 +136,6 @@ static inline void serio_continue_rx(struct serio *serio) | |||
136 | spin_unlock_irq(&serio->lock); | 136 | spin_unlock_irq(&serio->lock); |
137 | } | 137 | } |
138 | 138 | ||
139 | /* | ||
140 | * Use the following functions to pin serio's driver in process context | ||
141 | */ | ||
142 | static inline int serio_pin_driver(struct serio *serio) | ||
143 | { | ||
144 | return mutex_lock_interruptible(&serio->drv_mutex); | ||
145 | } | ||
146 | |||
147 | static inline void serio_pin_driver_uninterruptible(struct serio *serio) | ||
148 | { | ||
149 | mutex_lock(&serio->drv_mutex); | ||
150 | } | ||
151 | |||
152 | static inline void serio_unpin_driver(struct serio *serio) | ||
153 | { | ||
154 | mutex_unlock(&serio->drv_mutex); | ||
155 | } | ||
156 | |||
157 | |||
158 | #endif | 139 | #endif |
159 | 140 | ||
160 | /* | 141 | /* |
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index 4ef246f14654..51d288d8ac88 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
@@ -45,7 +45,7 @@ struct intc_sense_reg { | |||
45 | #define INTC_SMP(stride, nr) | 45 | #define INTC_SMP(stride, nr) |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | struct intc_desc { | 48 | struct intc_hw_desc { |
49 | struct intc_vect *vectors; | 49 | struct intc_vect *vectors; |
50 | unsigned int nr_vectors; | 50 | unsigned int nr_vectors; |
51 | struct intc_group *groups; | 51 | struct intc_group *groups; |
@@ -56,29 +56,40 @@ struct intc_desc { | |||
56 | unsigned int nr_prio_regs; | 56 | unsigned int nr_prio_regs; |
57 | struct intc_sense_reg *sense_regs; | 57 | struct intc_sense_reg *sense_regs; |
58 | unsigned int nr_sense_regs; | 58 | unsigned int nr_sense_regs; |
59 | char *name; | ||
60 | struct intc_mask_reg *ack_regs; | 59 | struct intc_mask_reg *ack_regs; |
61 | unsigned int nr_ack_regs; | 60 | unsigned int nr_ack_regs; |
62 | }; | 61 | }; |
63 | 62 | ||
64 | #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) | 63 | #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) |
64 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ | ||
65 | prio_regs, sense_regs, ack_regs) \ | ||
66 | { \ | ||
67 | _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ | ||
68 | _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ | ||
69 | _INTC_ARRAY(sense_regs), _INTC_ARRAY(ack_regs), \ | ||
70 | } | ||
71 | |||
72 | struct intc_desc { | ||
73 | char *name; | ||
74 | intc_enum force_enable; | ||
75 | intc_enum force_disable; | ||
76 | struct intc_hw_desc hw; | ||
77 | }; | ||
78 | |||
65 | #define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \ | 79 | #define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \ |
66 | mask_regs, prio_regs, sense_regs) \ | 80 | mask_regs, prio_regs, sense_regs) \ |
67 | struct intc_desc symbol __initdata = { \ | 81 | struct intc_desc symbol __initdata = { \ |
68 | _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ | 82 | .name = chipname, \ |
69 | _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ | 83 | .hw = INTC_HW_DESC(vectors, groups, mask_regs, \ |
70 | _INTC_ARRAY(sense_regs), \ | 84 | prio_regs, sense_regs, NULL), \ |
71 | chipname, \ | ||
72 | } | 85 | } |
73 | 86 | ||
74 | #define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \ | 87 | #define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \ |
75 | mask_regs, prio_regs, sense_regs, ack_regs) \ | 88 | mask_regs, prio_regs, sense_regs, ack_regs) \ |
76 | struct intc_desc symbol __initdata = { \ | 89 | struct intc_desc symbol __initdata = { \ |
77 | _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ | 90 | .name = chipname, \ |
78 | _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ | 91 | .hw = INTC_HW_DESC(vectors, groups, mask_regs, \ |
79 | _INTC_ARRAY(sense_regs), \ | 92 | prio_regs, sense_regs, ack_regs), \ |
80 | chipname, \ | ||
81 | _INTC_ARRAY(ack_regs), \ | ||
82 | } | 93 | } |
83 | 94 | ||
84 | void __init register_intc_controller(struct intc_desc *desc); | 95 | void __init register_intc_controller(struct intc_desc *desc); |
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 34c4475ac4a2..4f95c1aac2fd 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h | |||
@@ -111,6 +111,7 @@ | |||
111 | #define SONYPI_EVENT_VOLUME_INC_PRESSED 69 | 111 | #define SONYPI_EVENT_VOLUME_INC_PRESSED 69 |
112 | #define SONYPI_EVENT_VOLUME_DEC_PRESSED 70 | 112 | #define SONYPI_EVENT_VOLUME_DEC_PRESSED 70 |
113 | #define SONYPI_EVENT_BRIGHTNESS_PRESSED 71 | 113 | #define SONYPI_EVENT_BRIGHTNESS_PRESSED 71 |
114 | #define SONYPI_EVENT_MEDIA_PRESSED 72 | ||
114 | 115 | ||
115 | /* get/set brightness */ | 116 | /* get/set brightness */ |
116 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) | 117 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) |
diff --git a/include/linux/spi/ad7879.h b/include/linux/spi/ad7879.h index 4231104c9afa..6334cee1a3be 100644 --- a/include/linux/spi/ad7879.h +++ b/include/linux/spi/ad7879.h | |||
@@ -28,8 +28,12 @@ struct ad7879_platform_data { | |||
28 | * 1 = 4, 2 = 8, 3 = 16 (median > averaging) | 28 | * 1 = 4, 2 = 8, 3 = 16 (median > averaging) |
29 | */ | 29 | */ |
30 | u8 median; | 30 | u8 median; |
31 | /* 1 = AUX/VBAT/GPIO set to GPIO Output */ | 31 | /* 1 = AUX/VBAT/GPIO export GPIO to gpiolib |
32 | u8 gpio_output; | 32 | * requires CONFIG_GPIOLIB |
33 | /* Initial GPIO pin state (valid if gpio_output = 1) */ | 33 | */ |
34 | u8 gpio_default; | 34 | bool gpio_export; |
35 | /* identifies the first GPIO number handled by this chip; | ||
36 | * or, if negative, requests dynamic ID allocation. | ||
37 | */ | ||
38 | s32 gpio_base; | ||
35 | }; | 39 | }; |
diff --git a/include/linux/spi/dw_spi.h b/include/linux/spi/dw_spi.h new file mode 100644 index 000000000000..cc813f95a2f2 --- /dev/null +++ b/include/linux/spi/dw_spi.h | |||
@@ -0,0 +1,217 @@ | |||
1 | #ifndef DW_SPI_HEADER_H | ||
2 | #define DW_SPI_HEADER_H | ||
3 | #include <linux/io.h> | ||
4 | |||
5 | /* Bit fields in CTRLR0 */ | ||
6 | #define SPI_DFS_OFFSET 0 | ||
7 | |||
8 | #define SPI_FRF_OFFSET 4 | ||
9 | #define SPI_FRF_SPI 0x0 | ||
10 | #define SPI_FRF_SSP 0x1 | ||
11 | #define SPI_FRF_MICROWIRE 0x2 | ||
12 | #define SPI_FRF_RESV 0x3 | ||
13 | |||
14 | #define SPI_MODE_OFFSET 6 | ||
15 | #define SPI_SCPH_OFFSET 6 | ||
16 | #define SPI_SCOL_OFFSET 7 | ||
17 | #define SPI_TMOD_OFFSET 8 | ||
18 | #define SPI_TMOD_TR 0x0 /* xmit & recv */ | ||
19 | #define SPI_TMOD_TO 0x1 /* xmit only */ | ||
20 | #define SPI_TMOD_RO 0x2 /* recv only */ | ||
21 | #define SPI_TMOD_EPROMREAD 0x3 /* eeprom read mode */ | ||
22 | |||
23 | #define SPI_SLVOE_OFFSET 10 | ||
24 | #define SPI_SRL_OFFSET 11 | ||
25 | #define SPI_CFS_OFFSET 12 | ||
26 | |||
27 | /* Bit fields in SR, 7 bits */ | ||
28 | #define SR_MASK 0x7f /* cover 7 bits */ | ||
29 | #define SR_BUSY (1 << 0) | ||
30 | #define SR_TF_NOT_FULL (1 << 1) | ||
31 | #define SR_TF_EMPT (1 << 2) | ||
32 | #define SR_RF_NOT_EMPT (1 << 3) | ||
33 | #define SR_RF_FULL (1 << 4) | ||
34 | #define SR_TX_ERR (1 << 5) | ||
35 | #define SR_DCOL (1 << 6) | ||
36 | |||
37 | /* Bit fields in ISR, IMR, RISR, 7 bits */ | ||
38 | #define SPI_INT_TXEI (1 << 0) | ||
39 | #define SPI_INT_TXOI (1 << 1) | ||
40 | #define SPI_INT_RXUI (1 << 2) | ||
41 | #define SPI_INT_RXOI (1 << 3) | ||
42 | #define SPI_INT_RXFI (1 << 4) | ||
43 | #define SPI_INT_MSTI (1 << 5) | ||
44 | |||
45 | /* TX RX interrupt level threshhold, max can be 256 */ | ||
46 | #define SPI_INT_THRESHOLD 32 | ||
47 | |||
48 | enum dw_ssi_type { | ||
49 | SSI_MOTO_SPI = 0, | ||
50 | SSI_TI_SSP, | ||
51 | SSI_NS_MICROWIRE, | ||
52 | }; | ||
53 | |||
54 | struct dw_spi_reg { | ||
55 | u32 ctrl0; | ||
56 | u32 ctrl1; | ||
57 | u32 ssienr; | ||
58 | u32 mwcr; | ||
59 | u32 ser; | ||
60 | u32 baudr; | ||
61 | u32 txfltr; | ||
62 | u32 rxfltr; | ||
63 | u32 txflr; | ||
64 | u32 rxflr; | ||
65 | u32 sr; | ||
66 | u32 imr; | ||
67 | u32 isr; | ||
68 | u32 risr; | ||
69 | u32 txoicr; | ||
70 | u32 rxoicr; | ||
71 | u32 rxuicr; | ||
72 | u32 msticr; | ||
73 | u32 icr; | ||
74 | u32 dmacr; | ||
75 | u32 dmatdlr; | ||
76 | u32 dmardlr; | ||
77 | u32 idr; | ||
78 | u32 version; | ||
79 | u32 dr; /* Currently oper as 32 bits, | ||
80 | though only low 16 bits matters */ | ||
81 | } __packed; | ||
82 | |||
83 | struct dw_spi { | ||
84 | struct spi_master *master; | ||
85 | struct spi_device *cur_dev; | ||
86 | struct device *parent_dev; | ||
87 | enum dw_ssi_type type; | ||
88 | |||
89 | void __iomem *regs; | ||
90 | unsigned long paddr; | ||
91 | u32 iolen; | ||
92 | int irq; | ||
93 | u32 fifo_len; /* depth of the FIFO buffer */ | ||
94 | u32 max_freq; /* max bus freq supported */ | ||
95 | |||
96 | u16 bus_num; | ||
97 | u16 num_cs; /* supported slave numbers */ | ||
98 | |||
99 | /* Driver message queue */ | ||
100 | struct workqueue_struct *workqueue; | ||
101 | struct work_struct pump_messages; | ||
102 | spinlock_t lock; | ||
103 | struct list_head queue; | ||
104 | int busy; | ||
105 | int run; | ||
106 | |||
107 | /* Message Transfer pump */ | ||
108 | struct tasklet_struct pump_transfers; | ||
109 | |||
110 | /* Current message transfer state info */ | ||
111 | struct spi_message *cur_msg; | ||
112 | struct spi_transfer *cur_transfer; | ||
113 | struct chip_data *cur_chip; | ||
114 | struct chip_data *prev_chip; | ||
115 | size_t len; | ||
116 | void *tx; | ||
117 | void *tx_end; | ||
118 | void *rx; | ||
119 | void *rx_end; | ||
120 | int dma_mapped; | ||
121 | dma_addr_t rx_dma; | ||
122 | dma_addr_t tx_dma; | ||
123 | size_t rx_map_len; | ||
124 | size_t tx_map_len; | ||
125 | u8 n_bytes; /* current is a 1/2 bytes op */ | ||
126 | u8 max_bits_per_word; /* maxim is 16b */ | ||
127 | u32 dma_width; | ||
128 | int cs_change; | ||
129 | int (*write)(struct dw_spi *dws); | ||
130 | int (*read)(struct dw_spi *dws); | ||
131 | irqreturn_t (*transfer_handler)(struct dw_spi *dws); | ||
132 | void (*cs_control)(u32 command); | ||
133 | |||
134 | /* Dma info */ | ||
135 | int dma_inited; | ||
136 | struct dma_chan *txchan; | ||
137 | struct dma_chan *rxchan; | ||
138 | int txdma_done; | ||
139 | int rxdma_done; | ||
140 | u64 tx_param; | ||
141 | u64 rx_param; | ||
142 | struct device *dma_dev; | ||
143 | dma_addr_t dma_addr; | ||
144 | |||
145 | /* Bus interface info */ | ||
146 | void *priv; | ||
147 | #ifdef CONFIG_DEBUG_FS | ||
148 | struct dentry *debugfs; | ||
149 | #endif | ||
150 | }; | ||
151 | |||
152 | #define dw_readl(dw, name) \ | ||
153 | __raw_readl(&(((struct dw_spi_reg *)dw->regs)->name)) | ||
154 | #define dw_writel(dw, name, val) \ | ||
155 | __raw_writel((val), &(((struct dw_spi_reg *)dw->regs)->name)) | ||
156 | #define dw_readw(dw, name) \ | ||
157 | __raw_readw(&(((struct dw_spi_reg *)dw->regs)->name)) | ||
158 | #define dw_writew(dw, name, val) \ | ||
159 | __raw_writew((val), &(((struct dw_spi_reg *)dw->regs)->name)) | ||
160 | |||
161 | static inline void spi_enable_chip(struct dw_spi *dws, int enable) | ||
162 | { | ||
163 | dw_writel(dws, ssienr, (enable ? 1 : 0)); | ||
164 | } | ||
165 | |||
166 | static inline void spi_set_clk(struct dw_spi *dws, u16 div) | ||
167 | { | ||
168 | dw_writel(dws, baudr, div); | ||
169 | } | ||
170 | |||
171 | static inline void spi_chip_sel(struct dw_spi *dws, u16 cs) | ||
172 | { | ||
173 | if (cs > dws->num_cs) | ||
174 | return; | ||
175 | |||
176 | if (dws->cs_control) | ||
177 | dws->cs_control(1); | ||
178 | |||
179 | dw_writel(dws, ser, 1 << cs); | ||
180 | } | ||
181 | |||
182 | /* Disable IRQ bits */ | ||
183 | static inline void spi_mask_intr(struct dw_spi *dws, u32 mask) | ||
184 | { | ||
185 | u32 new_mask; | ||
186 | |||
187 | new_mask = dw_readl(dws, imr) & ~mask; | ||
188 | dw_writel(dws, imr, new_mask); | ||
189 | } | ||
190 | |||
191 | /* Enable IRQ bits */ | ||
192 | static inline void spi_umask_intr(struct dw_spi *dws, u32 mask) | ||
193 | { | ||
194 | u32 new_mask; | ||
195 | |||
196 | new_mask = dw_readl(dws, imr) | mask; | ||
197 | dw_writel(dws, imr, new_mask); | ||
198 | } | ||
199 | |||
200 | /* | ||
201 | * Each SPI slave device to work with dw_api controller should | ||
202 | * has such a structure claiming its working mode (PIO/DMA etc), | ||
203 | * which can be save in the "controller_data" member of the | ||
204 | * struct spi_device | ||
205 | */ | ||
206 | struct dw_spi_chip { | ||
207 | u8 poll_mode; /* 0 for contoller polling mode */ | ||
208 | u8 type; /* SPI/SSP/Micrwire */ | ||
209 | u8 enable_dma; | ||
210 | void (*cs_control)(u32 command); | ||
211 | }; | ||
212 | |||
213 | extern int dw_spi_add_host(struct dw_spi *dws); | ||
214 | extern void dw_spi_remove_host(struct dw_spi *dws); | ||
215 | extern int dw_spi_suspend_host(struct dw_spi *dws); | ||
216 | extern int dw_spi_resume_host(struct dw_spi *dws); | ||
217 | #endif /* DW_SPI_HEADER_H */ | ||
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 4765d97dcafb..3084f80909cd 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -35,6 +35,9 @@ struct srcu_struct { | |||
35 | int completed; | 35 | int completed; |
36 | struct srcu_struct_array *per_cpu_ref; | 36 | struct srcu_struct_array *per_cpu_ref; |
37 | struct mutex mutex; | 37 | struct mutex mutex; |
38 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
39 | struct lockdep_map dep_map; | ||
40 | #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
38 | }; | 41 | }; |
39 | 42 | ||
40 | #ifndef CONFIG_PREEMPT | 43 | #ifndef CONFIG_PREEMPT |
@@ -43,12 +46,100 @@ struct srcu_struct { | |||
43 | #define srcu_barrier() | 46 | #define srcu_barrier() |
44 | #endif /* #else #ifndef CONFIG_PREEMPT */ | 47 | #endif /* #else #ifndef CONFIG_PREEMPT */ |
45 | 48 | ||
49 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
50 | |||
51 | int __init_srcu_struct(struct srcu_struct *sp, const char *name, | ||
52 | struct lock_class_key *key); | ||
53 | |||
54 | #define init_srcu_struct(sp) \ | ||
55 | ({ \ | ||
56 | static struct lock_class_key __srcu_key; \ | ||
57 | \ | ||
58 | __init_srcu_struct((sp), #sp, &__srcu_key); \ | ||
59 | }) | ||
60 | |||
61 | # define srcu_read_acquire(sp) \ | ||
62 | lock_acquire(&(sp)->dep_map, 0, 0, 2, 1, NULL, _THIS_IP_) | ||
63 | # define srcu_read_release(sp) \ | ||
64 | lock_release(&(sp)->dep_map, 1, _THIS_IP_) | ||
65 | |||
66 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
67 | |||
46 | int init_srcu_struct(struct srcu_struct *sp); | 68 | int init_srcu_struct(struct srcu_struct *sp); |
69 | |||
70 | # define srcu_read_acquire(sp) do { } while (0) | ||
71 | # define srcu_read_release(sp) do { } while (0) | ||
72 | |||
73 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
74 | |||
47 | void cleanup_srcu_struct(struct srcu_struct *sp); | 75 | void cleanup_srcu_struct(struct srcu_struct *sp); |
48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); | 76 | int __srcu_read_lock(struct srcu_struct *sp) __acquires(sp); |
49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); | 77 | void __srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); |
50 | void synchronize_srcu(struct srcu_struct *sp); | 78 | void synchronize_srcu(struct srcu_struct *sp); |
51 | void synchronize_srcu_expedited(struct srcu_struct *sp); | 79 | void synchronize_srcu_expedited(struct srcu_struct *sp); |
52 | long srcu_batches_completed(struct srcu_struct *sp); | 80 | long srcu_batches_completed(struct srcu_struct *sp); |
53 | 81 | ||
82 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
83 | |||
84 | /** | ||
85 | * srcu_read_lock_held - might we be in SRCU read-side critical section? | ||
86 | * | ||
87 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in | ||
88 | * an SRCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, | ||
89 | * this assumes we are in an SRCU read-side critical section unless it can | ||
90 | * prove otherwise. | ||
91 | */ | ||
92 | static inline int srcu_read_lock_held(struct srcu_struct *sp) | ||
93 | { | ||
94 | if (debug_locks) | ||
95 | return lock_is_held(&sp->dep_map); | ||
96 | return 1; | ||
97 | } | ||
98 | |||
99 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
100 | |||
101 | static inline int srcu_read_lock_held(struct srcu_struct *sp) | ||
102 | { | ||
103 | return 1; | ||
104 | } | ||
105 | |||
106 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
107 | |||
108 | /** | ||
109 | * srcu_dereference - fetch SRCU-protected pointer with checking | ||
110 | * | ||
111 | * Makes rcu_dereference_check() do the dirty work. | ||
112 | */ | ||
113 | #define srcu_dereference(p, sp) \ | ||
114 | rcu_dereference_check(p, srcu_read_lock_held(sp)) | ||
115 | |||
116 | /** | ||
117 | * srcu_read_lock - register a new reader for an SRCU-protected structure. | ||
118 | * @sp: srcu_struct in which to register the new reader. | ||
119 | * | ||
120 | * Enter an SRCU read-side critical section. Note that SRCU read-side | ||
121 | * critical sections may be nested. | ||
122 | */ | ||
123 | static inline int srcu_read_lock(struct srcu_struct *sp) __acquires(sp) | ||
124 | { | ||
125 | int retval = __srcu_read_lock(sp); | ||
126 | |||
127 | srcu_read_acquire(sp); | ||
128 | return retval; | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * srcu_read_unlock - unregister a old reader from an SRCU-protected structure. | ||
133 | * @sp: srcu_struct in which to unregister the old reader. | ||
134 | * @idx: return value from corresponding srcu_read_lock(). | ||
135 | * | ||
136 | * Exit an SRCU read-side critical section. | ||
137 | */ | ||
138 | static inline void srcu_read_unlock(struct srcu_struct *sp, int idx) | ||
139 | __releases(sp) | ||
140 | { | ||
141 | srcu_read_release(sp); | ||
142 | __srcu_read_unlock(sp, idx); | ||
143 | } | ||
144 | |||
54 | #endif | 145 | #endif |
diff --git a/include/linux/string.h b/include/linux/string.h index 651839a2a755..a716ee2a8adb 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -72,7 +72,10 @@ static inline __must_check char *strstrip(char *str) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | #ifndef __HAVE_ARCH_STRSTR | 74 | #ifndef __HAVE_ARCH_STRSTR |
75 | extern char * strstr(const char *,const char *); | 75 | extern char * strstr(const char *, const char *); |
76 | #endif | ||
77 | #ifndef __HAVE_ARCH_STRNSTR | ||
78 | extern char * strnstr(const char *, const char *, size_t); | ||
76 | #endif | 79 | #endif |
77 | #ifndef __HAVE_ARCH_STRLEN | 80 | #ifndef __HAVE_ARCH_STRLEN |
78 | extern __kernel_size_t strlen(const char *); | 81 | extern __kernel_size_t strlen(const char *); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 65793e90d6f6..8126f239edf0 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -99,7 +99,7 @@ struct perf_event_attr; | |||
99 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) | 99 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) |
100 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | 100 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) |
101 | 101 | ||
102 | #ifdef CONFIG_EVENT_PROFILE | 102 | #ifdef CONFIG_PERF_EVENTS |
103 | 103 | ||
104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
105 | .profile_enable = prof_sysenter_enable, \ | 105 | .profile_enable = prof_sysenter_enable, \ |
@@ -113,7 +113,7 @@ struct perf_event_attr; | |||
113 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) | 113 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) |
114 | #define TRACE_SYS_EXIT_PROFILE(sname) | 114 | #define TRACE_SYS_EXIT_PROFILE(sname) |
115 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) | 115 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) |
116 | #endif | 116 | #endif /* CONFIG_PERF_EVENTS */ |
117 | 117 | ||
118 | #ifdef CONFIG_FTRACE_SYSCALLS | 118 | #ifdef CONFIG_FTRACE_SYSCALLS |
119 | #define __SC_STR_ADECL1(t, a) #a | 119 | #define __SC_STR_ADECL1(t, a) #a |
@@ -132,7 +132,8 @@ struct perf_event_attr; | |||
132 | 132 | ||
133 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 133 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
134 | static const struct syscall_metadata __syscall_meta_##sname; \ | 134 | static const struct syscall_metadata __syscall_meta_##sname; \ |
135 | static struct ftrace_event_call event_enter_##sname; \ | 135 | static struct ftrace_event_call \ |
136 | __attribute__((__aligned__(4))) event_enter_##sname; \ | ||
136 | static struct trace_event enter_syscall_print_##sname = { \ | 137 | static struct trace_event enter_syscall_print_##sname = { \ |
137 | .trace = print_syscall_enter, \ | 138 | .trace = print_syscall_enter, \ |
138 | }; \ | 139 | }; \ |
@@ -143,8 +144,7 @@ struct perf_event_attr; | |||
143 | .name = "sys_enter"#sname, \ | 144 | .name = "sys_enter"#sname, \ |
144 | .system = "syscalls", \ | 145 | .system = "syscalls", \ |
145 | .event = &enter_syscall_print_##sname, \ | 146 | .event = &enter_syscall_print_##sname, \ |
146 | .raw_init = trace_event_raw_init, \ | 147 | .raw_init = init_syscall_trace, \ |
147 | .show_format = syscall_enter_format, \ | ||
148 | .define_fields = syscall_enter_define_fields, \ | 148 | .define_fields = syscall_enter_define_fields, \ |
149 | .regfunc = reg_event_syscall_enter, \ | 149 | .regfunc = reg_event_syscall_enter, \ |
150 | .unregfunc = unreg_event_syscall_enter, \ | 150 | .unregfunc = unreg_event_syscall_enter, \ |
@@ -154,7 +154,8 @@ struct perf_event_attr; | |||
154 | 154 | ||
155 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 155 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
156 | static const struct syscall_metadata __syscall_meta_##sname; \ | 156 | static const struct syscall_metadata __syscall_meta_##sname; \ |
157 | static struct ftrace_event_call event_exit_##sname; \ | 157 | static struct ftrace_event_call \ |
158 | __attribute__((__aligned__(4))) event_exit_##sname; \ | ||
158 | static struct trace_event exit_syscall_print_##sname = { \ | 159 | static struct trace_event exit_syscall_print_##sname = { \ |
159 | .trace = print_syscall_exit, \ | 160 | .trace = print_syscall_exit, \ |
160 | }; \ | 161 | }; \ |
@@ -165,8 +166,7 @@ struct perf_event_attr; | |||
165 | .name = "sys_exit"#sname, \ | 166 | .name = "sys_exit"#sname, \ |
166 | .system = "syscalls", \ | 167 | .system = "syscalls", \ |
167 | .event = &exit_syscall_print_##sname, \ | 168 | .event = &exit_syscall_print_##sname, \ |
168 | .raw_init = trace_event_raw_init, \ | 169 | .raw_init = init_syscall_trace, \ |
169 | .show_format = syscall_exit_format, \ | ||
170 | .define_fields = syscall_exit_define_fields, \ | 170 | .define_fields = syscall_exit_define_fields, \ |
171 | .regfunc = reg_event_syscall_exit, \ | 171 | .regfunc = reg_event_syscall_exit, \ |
172 | .unregfunc = unreg_event_syscall_exit, \ | 172 | .unregfunc = unreg_event_syscall_exit, \ |
@@ -195,7 +195,7 @@ struct perf_event_attr; | |||
195 | static const struct syscall_metadata __used \ | 195 | static const struct syscall_metadata __used \ |
196 | __attribute__((__aligned__(4))) \ | 196 | __attribute__((__aligned__(4))) \ |
197 | __attribute__((section("__syscalls_metadata"))) \ | 197 | __attribute__((section("__syscalls_metadata"))) \ |
198 | __syscall_meta_##sname = { \ | 198 | __syscall_meta__##sname = { \ |
199 | .name = "sys_"#sname, \ | 199 | .name = "sys_"#sname, \ |
200 | .nb_args = 0, \ | 200 | .nb_args = 0, \ |
201 | .enter_event = &event_enter__##sname, \ | 201 | .enter_event = &event_enter__##sname, \ |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 877ba039e6a4..bd27fbc9db62 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -482,6 +482,7 @@ enum | |||
482 | NET_IPV4_CONF_ARP_ACCEPT=21, | 482 | NET_IPV4_CONF_ARP_ACCEPT=21, |
483 | NET_IPV4_CONF_ARP_NOTIFY=22, | 483 | NET_IPV4_CONF_ARP_NOTIFY=22, |
484 | NET_IPV4_CONF_ACCEPT_LOCAL=23, | 484 | NET_IPV4_CONF_ACCEPT_LOCAL=23, |
485 | NET_IPV4_CONF_SRC_VMARK=24, | ||
485 | __NET_IPV4_CONF_MAX | 486 | __NET_IPV4_CONF_MAX |
486 | }; | 487 | }; |
487 | 488 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 9d68fed50f11..cfa83083a2d4 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -99,8 +99,9 @@ int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, | |||
99 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); | 99 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); |
100 | 100 | ||
101 | int __must_check sysfs_create_bin_file(struct kobject *kobj, | 101 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
102 | struct bin_attribute *attr); | 102 | const struct bin_attribute *attr); |
103 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | 103 | void sysfs_remove_bin_file(struct kobject *kobj, |
104 | const struct bin_attribute *attr); | ||
104 | 105 | ||
105 | int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target, | 106 | int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target, |
106 | const char *name); | 107 | const char *name); |
@@ -175,13 +176,13 @@ static inline void sysfs_remove_file(struct kobject *kobj, | |||
175 | } | 176 | } |
176 | 177 | ||
177 | static inline int sysfs_create_bin_file(struct kobject *kobj, | 178 | static inline int sysfs_create_bin_file(struct kobject *kobj, |
178 | struct bin_attribute *attr) | 179 | const struct bin_attribute *attr) |
179 | { | 180 | { |
180 | return 0; | 181 | return 0; |
181 | } | 182 | } |
182 | 183 | ||
183 | static inline void sysfs_remove_bin_file(struct kobject *kobj, | 184 | static inline void sysfs_remove_bin_file(struct kobject *kobj, |
184 | struct bin_attribute *attr) | 185 | const struct bin_attribute *attr) |
185 | { | 186 | { |
186 | } | 187 | } |
187 | 188 | ||
diff --git a/include/linux/topology.h b/include/linux/topology.h index 57e63579bfdd..5b81156780b1 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -99,7 +99,7 @@ int arch_update_cpu_topology(void); | |||
99 | | 1*SD_WAKE_AFFINE \ | 99 | | 1*SD_WAKE_AFFINE \ |
100 | | 1*SD_SHARE_CPUPOWER \ | 100 | | 1*SD_SHARE_CPUPOWER \ |
101 | | 0*SD_POWERSAVINGS_BALANCE \ | 101 | | 0*SD_POWERSAVINGS_BALANCE \ |
102 | | 0*SD_SHARE_PKG_RESOURCES \ | 102 | | 1*SD_SHARE_PKG_RESOURCES \ |
103 | | 0*SD_SERIALIZE \ | 103 | | 0*SD_SERIALIZE \ |
104 | | 0*SD_PREFER_SIBLING \ | 104 | | 0*SD_PREFER_SIBLING \ |
105 | , \ | 105 | , \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index ef3a2947b102..6abfcf5b5887 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -464,7 +464,7 @@ extern int tty_port_alloc_xmit_buf(struct tty_port *port); | |||
464 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 464 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
465 | extern void tty_port_put(struct tty_port *port); | 465 | extern void tty_port_put(struct tty_port *port); |
466 | 466 | ||
467 | extern inline struct tty_port *tty_port_get(struct tty_port *port) | 467 | static inline struct tty_port *tty_port_get(struct tty_port *port) |
468 | { | 468 | { |
469 | if (port) | 469 | if (port) |
470 | kref_get(&port->kref); | 470 | kref_get(&port->kref); |
@@ -486,7 +486,7 @@ extern void tty_port_close(struct tty_port *port, | |||
486 | struct tty_struct *tty, struct file *filp); | 486 | struct tty_struct *tty, struct file *filp); |
487 | extern int tty_port_open(struct tty_port *port, | 487 | extern int tty_port_open(struct tty_port *port, |
488 | struct tty_struct *tty, struct file *filp); | 488 | struct tty_struct *tty, struct file *filp); |
489 | extern inline int tty_port_users(struct tty_port *port) | 489 | static inline int tty_port_users(struct tty_port *port) |
490 | { | 490 | { |
491 | return port->count + port->blocked_open; | 491 | return port->count + port->blocked_open; |
492 | } | 492 | } |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 6b58367d145e..d512d98dfb7d 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
@@ -94,6 +94,7 @@ static inline unsigned long __copy_from_user_nocache(void *to, | |||
94 | * happens, handle that and return -EFAULT. | 94 | * happens, handle that and return -EFAULT. |
95 | */ | 95 | */ |
96 | extern long probe_kernel_read(void *dst, void *src, size_t size); | 96 | extern long probe_kernel_read(void *dst, void *src, size_t size); |
97 | extern long __probe_kernel_read(void *dst, void *src, size_t size); | ||
97 | 98 | ||
98 | /* | 99 | /* |
99 | * probe_kernel_write(): safely attempt to write to a location | 100 | * probe_kernel_write(): safely attempt to write to a location |
@@ -104,6 +105,7 @@ extern long probe_kernel_read(void *dst, void *src, size_t size); | |||
104 | * Safely write to address @dst from the buffer at @src. If a kernel fault | 105 | * Safely write to address @dst from the buffer at @src. If a kernel fault |
105 | * happens, handle that and return -EFAULT. | 106 | * happens, handle that and return -EFAULT. |
106 | */ | 107 | */ |
107 | extern long probe_kernel_write(void *dst, void *src, size_t size); | 108 | extern long notrace probe_kernel_write(void *dst, void *src, size_t size); |
109 | extern long notrace __probe_kernel_write(void *dst, void *src, size_t size); | ||
108 | 110 | ||
109 | #endif /* __LINUX_UACCESS_H__ */ | 111 | #endif /* __LINUX_UACCESS_H__ */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index e101a2d04d75..332eaea61021 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -192,6 +192,7 @@ struct usb_interface { | |||
192 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ | 192 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ |
193 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ | 193 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ |
194 | unsigned reset_running:1; | 194 | unsigned reset_running:1; |
195 | unsigned resetting_device:1; /* true: bandwidth alloc after reset */ | ||
195 | 196 | ||
196 | struct device dev; /* interface specific device info */ | 197 | struct device dev; /* interface specific device info */ |
197 | struct device *usb_dev; | 198 | struct device *usb_dev; |
@@ -338,6 +339,7 @@ struct usb_bus { | |||
338 | 339 | ||
339 | struct usb_devmap devmap; /* device address allocation map */ | 340 | struct usb_devmap devmap; /* device address allocation map */ |
340 | struct usb_device *root_hub; /* Root hub */ | 341 | struct usb_device *root_hub; /* Root hub */ |
342 | struct usb_bus *hs_companion; /* Companion EHCI bus, if any */ | ||
341 | struct list_head bus_list; /* list of busses */ | 343 | struct list_head bus_list; /* list of busses */ |
342 | 344 | ||
343 | int bandwidth_allocated; /* on this bus: how much of the time | 345 | int bandwidth_allocated; /* on this bus: how much of the time |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index acf6e457c04b..1819396ed501 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | #include <linux/sysrq.h> | 18 | #include <linux/sysrq.h> |
19 | #include <linux/kfifo.h> | ||
19 | 20 | ||
20 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | 21 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ |
21 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ | 22 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ |
@@ -94,7 +95,7 @@ struct usb_serial_port { | |||
94 | unsigned char *bulk_out_buffer; | 95 | unsigned char *bulk_out_buffer; |
95 | int bulk_out_size; | 96 | int bulk_out_size; |
96 | struct urb *write_urb; | 97 | struct urb *write_urb; |
97 | struct kfifo *write_fifo; | 98 | struct kfifo write_fifo; |
98 | int write_urb_busy; | 99 | int write_urb_busy; |
99 | __u8 bulk_out_endpointAddress; | 100 | __u8 bulk_out_endpointAddress; |
100 | 101 | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d4962a782b8a..3793d168b44d 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -350,6 +350,7 @@ struct v4l2_pix_format { | |||
350 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ | 350 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ |
351 | 351 | ||
352 | /* Vendor-specific formats */ | 352 | /* Vendor-specific formats */ |
353 | #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ | ||
353 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ | 354 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ |
354 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ | 355 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ |
355 | #define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ | 356 | #define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ |
@@ -362,6 +363,7 @@ struct v4l2_pix_format { | |||
362 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ | 363 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ |
363 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ | 364 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ |
364 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ | 365 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ |
366 | #define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */ | ||
365 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ | 367 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ |
366 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | 368 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ |
367 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ | 369 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 057a2e010758..f508c651e53d 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -51,6 +51,9 @@ struct virtqueue { | |||
51 | * This re-enables callbacks; it returns "false" if there are pending | 51 | * This re-enables callbacks; it returns "false" if there are pending |
52 | * buffers in the queue, to detect a possible race between the driver | 52 | * buffers in the queue, to detect a possible race between the driver |
53 | * checking for more work, and enabling callbacks. | 53 | * checking for more work, and enabling callbacks. |
54 | * @detach_unused_buf: detach first unused buffer | ||
55 | * vq: the struct virtqueue we're talking about. | ||
56 | * Returns NULL or the "data" token handed to add_buf | ||
54 | * | 57 | * |
55 | * Locking rules are straightforward: the driver is responsible for | 58 | * Locking rules are straightforward: the driver is responsible for |
56 | * locking. No two operations may be invoked simultaneously, with the exception | 59 | * locking. No two operations may be invoked simultaneously, with the exception |
@@ -71,6 +74,7 @@ struct virtqueue_ops { | |||
71 | 74 | ||
72 | void (*disable_cb)(struct virtqueue *vq); | 75 | void (*disable_cb)(struct virtqueue *vq); |
73 | bool (*enable_cb)(struct virtqueue *vq); | 76 | bool (*enable_cb)(struct virtqueue *vq); |
77 | void *(*detach_unused_buf)(struct virtqueue *vq); | ||
74 | }; | 78 | }; |
75 | 79 | ||
76 | /** | 80 | /** |
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h index 1418f048cb34..a50ecd1b81a2 100644 --- a/include/linux/virtio_balloon.h +++ b/include/linux/virtio_balloon.h | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | /* The feature bitmap for virtio balloon */ | 8 | /* The feature bitmap for virtio balloon */ |
9 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ | 9 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ |
10 | #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ | ||
10 | 11 | ||
11 | /* Size of a PFN in the balloon interface. */ | 12 | /* Size of a PFN in the balloon interface. */ |
12 | #define VIRTIO_BALLOON_PFN_SHIFT 12 | 13 | #define VIRTIO_BALLOON_PFN_SHIFT 12 |
@@ -18,4 +19,18 @@ struct virtio_balloon_config | |||
18 | /* Number of pages we've actually got in balloon. */ | 19 | /* Number of pages we've actually got in balloon. */ |
19 | __le32 actual; | 20 | __le32 actual; |
20 | }; | 21 | }; |
22 | |||
23 | #define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */ | ||
24 | #define VIRTIO_BALLOON_S_SWAP_OUT 1 /* Amount of memory swapped out */ | ||
25 | #define VIRTIO_BALLOON_S_MAJFLT 2 /* Number of major faults */ | ||
26 | #define VIRTIO_BALLOON_S_MINFLT 3 /* Number of minor faults */ | ||
27 | #define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */ | ||
28 | #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ | ||
29 | #define VIRTIO_BALLOON_S_NR 6 | ||
30 | |||
31 | struct virtio_balloon_stat { | ||
32 | u16 tag; | ||
33 | u64 val; | ||
34 | } __attribute__((packed)); | ||
35 | |||
21 | #endif /* _LINUX_VIRTIO_BALLOON_H */ | 36 | #endif /* _LINUX_VIRTIO_BALLOON_H */ |
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index fd294c56d571..e52029e98919 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | 15 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ |
16 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | 16 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ |
17 | #define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ | 17 | #define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ |
18 | #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ | ||
18 | 19 | ||
19 | struct virtio_blk_config { | 20 | struct virtio_blk_config { |
20 | /* The capacity (in 512-byte sectors). */ | 21 | /* The capacity (in 512-byte sectors). */ |
@@ -29,8 +30,20 @@ struct virtio_blk_config { | |||
29 | __u8 heads; | 30 | __u8 heads; |
30 | __u8 sectors; | 31 | __u8 sectors; |
31 | } geometry; | 32 | } geometry; |
33 | |||
32 | /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ | 34 | /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ |
33 | __u32 blk_size; | 35 | __u32 blk_size; |
36 | |||
37 | /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */ | ||
38 | /* exponent for physical block per logical block. */ | ||
39 | __u8 physical_block_exp; | ||
40 | /* alignment offset in logical blocks. */ | ||
41 | __u8 alignment_offset; | ||
42 | /* minimum I/O size without performance penalty in logical blocks. */ | ||
43 | __u16 min_io_size; | ||
44 | /* optimal sustained I/O size in logical blocks. */ | ||
45 | __u32 opt_io_size; | ||
46 | |||
34 | } __attribute__((packed)); | 47 | } __attribute__((packed)); |
35 | 48 | ||
36 | /* | 49 | /* |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index fe885174cc1f..ae4f039515b4 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
@@ -3,19 +3,45 @@ | |||
3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
4 | #include <linux/virtio_ids.h> | 4 | #include <linux/virtio_ids.h> |
5 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
6 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | 6 | /* |
7 | * anyone can use the definitions to implement compatible drivers/servers. */ | 7 | * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so |
8 | * anyone can use the definitions to implement compatible drivers/servers. | ||
9 | * | ||
10 | * Copyright (C) Red Hat, Inc., 2009, 2010 | ||
11 | */ | ||
8 | 12 | ||
9 | /* Feature bits */ | 13 | /* Feature bits */ |
10 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ | 14 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ |
15 | #define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ | ||
11 | 16 | ||
12 | struct virtio_console_config { | 17 | struct virtio_console_config { |
13 | /* colums of the screens */ | 18 | /* colums of the screens */ |
14 | __u16 cols; | 19 | __u16 cols; |
15 | /* rows of the screens */ | 20 | /* rows of the screens */ |
16 | __u16 rows; | 21 | __u16 rows; |
22 | /* max. number of ports this device can hold */ | ||
23 | __u32 max_nr_ports; | ||
24 | /* number of ports added so far */ | ||
25 | __u32 nr_ports; | ||
17 | } __attribute__((packed)); | 26 | } __attribute__((packed)); |
18 | 27 | ||
28 | /* | ||
29 | * A message that's passed between the Host and the Guest for a | ||
30 | * particular port. | ||
31 | */ | ||
32 | struct virtio_console_control { | ||
33 | __u32 id; /* Port number */ | ||
34 | __u16 event; /* The kind of control event (see below) */ | ||
35 | __u16 value; /* Extra information for the key */ | ||
36 | }; | ||
37 | |||
38 | /* Some events for control messages */ | ||
39 | #define VIRTIO_CONSOLE_PORT_READY 0 | ||
40 | #define VIRTIO_CONSOLE_CONSOLE_PORT 1 | ||
41 | #define VIRTIO_CONSOLE_RESIZE 2 | ||
42 | #define VIRTIO_CONSOLE_PORT_OPEN 3 | ||
43 | #define VIRTIO_CONSOLE_PORT_NAME 4 | ||
44 | #define VIRTIO_CONSOLE_PORT_REMOVE 5 | ||
19 | 45 | ||
20 | #ifdef __KERNEL__ | 46 | #ifdef __KERNEL__ |
21 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); | 47 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); |
diff --git a/include/linux/vt.h b/include/linux/vt.h index 3fb9944e50a6..d5dd0bc408fd 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h | |||
@@ -84,6 +84,8 @@ struct vt_setactivate { | |||
84 | 84 | ||
85 | #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ | 85 | #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ |
86 | 86 | ||
87 | #ifdef __KERNEL__ | ||
88 | |||
87 | #ifdef CONFIG_VT_CONSOLE | 89 | #ifdef CONFIG_VT_CONSOLE |
88 | 90 | ||
89 | extern int vt_kmsg_redirect(int new); | 91 | extern int vt_kmsg_redirect(int new); |
@@ -97,6 +99,8 @@ static inline int vt_kmsg_redirect(int new) | |||
97 | 99 | ||
98 | #endif | 100 | #endif |
99 | 101 | ||
102 | #endif /* __KERNEL__ */ | ||
103 | |||
100 | #define vt_get_kmsg_redirect() vt_kmsg_redirect(-1) | 104 | #define vt_get_kmsg_redirect() vt_kmsg_redirect(-1) |
101 | 105 | ||
102 | #endif /* _LINUX_VT_H */ | 106 | #endif /* _LINUX_VT_H */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index c18c008f4bbf..76e8903cd204 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -70,6 +70,7 @@ struct writeback_control { | |||
70 | struct bdi_writeback; | 70 | struct bdi_writeback; |
71 | int inode_wait(void *); | 71 | int inode_wait(void *); |
72 | void writeback_inodes_sb(struct super_block *); | 72 | void writeback_inodes_sb(struct super_block *); |
73 | int writeback_inodes_sb_if_idle(struct super_block *); | ||
73 | void sync_inodes_sb(struct super_block *); | 74 | void sync_inodes_sb(struct super_block *); |
74 | void writeback_inodes_wbc(struct writeback_control *wbc); | 75 | void writeback_inodes_wbc(struct writeback_control *wbc); |
75 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | 76 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); |
diff --git a/include/media/davinci/isif.h b/include/media/davinci/isif.h new file mode 100644 index 000000000000..b0b74ad618cc --- /dev/null +++ b/include/media/davinci/isif.h | |||
@@ -0,0 +1,531 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008-2009 Texas Instruments Inc | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | * | ||
18 | * isif header file | ||
19 | */ | ||
20 | #ifndef _ISIF_H | ||
21 | #define _ISIF_H | ||
22 | |||
23 | #include <media/davinci/ccdc_types.h> | ||
24 | #include <media/davinci/vpfe_types.h> | ||
25 | |||
26 | /* isif float type S8Q8/U8Q8 */ | ||
27 | struct isif_float_8 { | ||
28 | /* 8 bit integer part */ | ||
29 | __u8 integer; | ||
30 | /* 8 bit decimal part */ | ||
31 | __u8 decimal; | ||
32 | }; | ||
33 | |||
34 | /* isif float type U16Q16/S16Q16 */ | ||
35 | struct isif_float_16 { | ||
36 | /* 16 bit integer part */ | ||
37 | __u16 integer; | ||
38 | /* 16 bit decimal part */ | ||
39 | __u16 decimal; | ||
40 | }; | ||
41 | |||
42 | /************************************************************************ | ||
43 | * Vertical Defect Correction parameters | ||
44 | ***********************************************************************/ | ||
45 | /* Defect Correction (DFC) table entry */ | ||
46 | struct isif_vdfc_entry { | ||
47 | /* vertical position of defect */ | ||
48 | __u16 pos_vert; | ||
49 | /* horizontal position of defect */ | ||
50 | __u16 pos_horz; | ||
51 | /* | ||
52 | * Defect level of Vertical line defect position. This is subtracted | ||
53 | * from the data at the defect position | ||
54 | */ | ||
55 | __u8 level_at_pos; | ||
56 | /* | ||
57 | * Defect level of the pixels upper than the vertical line defect. | ||
58 | * This is subtracted from the data | ||
59 | */ | ||
60 | __u8 level_up_pixels; | ||
61 | /* | ||
62 | * Defect level of the pixels lower than the vertical line defect. | ||
63 | * This is subtracted from the data | ||
64 | */ | ||
65 | __u8 level_low_pixels; | ||
66 | }; | ||
67 | |||
68 | #define ISIF_VDFC_TABLE_SIZE 8 | ||
69 | struct isif_dfc { | ||
70 | /* enable vertical defect correction */ | ||
71 | __u8 en; | ||
72 | /* Defect level subtraction. Just fed through if saturating */ | ||
73 | #define ISIF_VDFC_NORMAL 0 | ||
74 | /* | ||
75 | * Defect level subtraction. Horizontal interpolation ((i-2)+(i+2))/2 | ||
76 | * if data saturating | ||
77 | */ | ||
78 | #define ISIF_VDFC_HORZ_INTERPOL_IF_SAT 1 | ||
79 | /* Horizontal interpolation (((i-2)+(i+2))/2) */ | ||
80 | #define ISIF_VDFC_HORZ_INTERPOL 2 | ||
81 | /* one of the vertical defect correction modes above */ | ||
82 | __u8 corr_mode; | ||
83 | /* 0 - whole line corrected, 1 - not pixels upper than the defect */ | ||
84 | __u8 corr_whole_line; | ||
85 | #define ISIF_VDFC_NO_SHIFT 0 | ||
86 | #define ISIF_VDFC_SHIFT_1 1 | ||
87 | #define ISIF_VDFC_SHIFT_2 2 | ||
88 | #define ISIF_VDFC_SHIFT_3 3 | ||
89 | #define ISIF_VDFC_SHIFT_4 4 | ||
90 | /* | ||
91 | * defect level shift value. level_at_pos, level_upper_pos, | ||
92 | * and level_lower_pos can be shifted up by this value. Choose | ||
93 | * one of the values above | ||
94 | */ | ||
95 | __u8 def_level_shift; | ||
96 | /* defect saturation level */ | ||
97 | __u16 def_sat_level; | ||
98 | /* number of vertical defects. Max is ISIF_VDFC_TABLE_SIZE */ | ||
99 | __u16 num_vdefects; | ||
100 | /* VDFC table ptr */ | ||
101 | struct isif_vdfc_entry table[ISIF_VDFC_TABLE_SIZE]; | ||
102 | }; | ||
103 | |||
104 | struct isif_horz_bclamp { | ||
105 | |||
106 | /* Horizontal clamp disabled. Only vertical clamp value is subtracted */ | ||
107 | #define ISIF_HORZ_BC_DISABLE 0 | ||
108 | /* | ||
109 | * Horizontal clamp value is calculated and subtracted from image data | ||
110 | * along with vertical clamp value | ||
111 | */ | ||
112 | #define ISIF_HORZ_BC_CLAMP_CALC_ENABLED 1 | ||
113 | /* | ||
114 | * Horizontal clamp value calculated from previous image is subtracted | ||
115 | * from image data along with vertical clamp value. | ||
116 | */ | ||
117 | #define ISIF_HORZ_BC_CLAMP_NOT_UPDATED 2 | ||
118 | /* horizontal clamp mode. One of the values above */ | ||
119 | __u8 mode; | ||
120 | /* | ||
121 | * pixel value limit enable. | ||
122 | * 0 - limit disabled | ||
123 | * 1 - pixel value limited to 1023 | ||
124 | */ | ||
125 | __u8 clamp_pix_limit; | ||
126 | /* Select Most left window for bc calculation */ | ||
127 | #define ISIF_SEL_MOST_LEFT_WIN 0 | ||
128 | /* Select Most right window for bc calculation */ | ||
129 | #define ISIF_SEL_MOST_RIGHT_WIN 1 | ||
130 | /* Select most left or right window for clamp val calculation */ | ||
131 | __u8 base_win_sel_calc; | ||
132 | /* Window count per color for calculation. range 1-32 */ | ||
133 | __u8 win_count_calc; | ||
134 | /* Window start position - horizontal for calculation. 0 - 8191 */ | ||
135 | __u16 win_start_h_calc; | ||
136 | /* Window start position - vertical for calculation 0 - 8191 */ | ||
137 | __u16 win_start_v_calc; | ||
138 | #define ISIF_HORZ_BC_SZ_H_2PIXELS 0 | ||
139 | #define ISIF_HORZ_BC_SZ_H_4PIXELS 1 | ||
140 | #define ISIF_HORZ_BC_SZ_H_8PIXELS 2 | ||
141 | #define ISIF_HORZ_BC_SZ_H_16PIXELS 3 | ||
142 | /* Width of the sample window in pixels for calculation */ | ||
143 | __u8 win_h_sz_calc; | ||
144 | #define ISIF_HORZ_BC_SZ_V_32PIXELS 0 | ||
145 | #define ISIF_HORZ_BC_SZ_V_64PIXELS 1 | ||
146 | #define ISIF_HORZ_BC_SZ_V_128PIXELS 2 | ||
147 | #define ISIF_HORZ_BC_SZ_V_256PIXELS 3 | ||
148 | /* Height of the sample window in pixels for calculation */ | ||
149 | __u8 win_v_sz_calc; | ||
150 | }; | ||
151 | |||
152 | /************************************************************************ | ||
153 | * Black Clamp parameters | ||
154 | ***********************************************************************/ | ||
155 | struct isif_vert_bclamp { | ||
156 | /* Reset value used is the clamp value calculated */ | ||
157 | #define ISIF_VERT_BC_USE_HORZ_CLAMP_VAL 0 | ||
158 | /* Reset value used is reset_clamp_val configured */ | ||
159 | #define ISIF_VERT_BC_USE_CONFIG_CLAMP_VAL 1 | ||
160 | /* No update, previous image value is used */ | ||
161 | #define ISIF_VERT_BC_NO_UPDATE 2 | ||
162 | /* | ||
163 | * Reset value selector for vertical clamp calculation. Use one of | ||
164 | * the above values | ||
165 | */ | ||
166 | __u8 reset_val_sel; | ||
167 | /* U8Q8. Line average coefficient used in vertical clamp calculation */ | ||
168 | __u8 line_ave_coef; | ||
169 | /* Height of the optical black region for calculation */ | ||
170 | __u16 ob_v_sz_calc; | ||
171 | /* Optical black region start position - horizontal. 0 - 8191 */ | ||
172 | __u16 ob_start_h; | ||
173 | /* Optical black region start position - vertical 0 - 8191 */ | ||
174 | __u16 ob_start_v; | ||
175 | }; | ||
176 | |||
177 | struct isif_black_clamp { | ||
178 | /* | ||
179 | * This offset value is added irrespective of the clamp enable status. | ||
180 | * S13 | ||
181 | */ | ||
182 | __u16 dc_offset; | ||
183 | /* | ||
184 | * Enable black/digital clamp value to be subtracted from the image data | ||
185 | */ | ||
186 | __u8 en; | ||
187 | /* | ||
188 | * black clamp mode. same/separate clamp for 4 colors | ||
189 | * 0 - disable - same clamp value for all colors | ||
190 | * 1 - clamp value calculated separately for all colors | ||
191 | */ | ||
192 | __u8 bc_mode_color; | ||
193 | /* Vrtical start position for bc subtraction */ | ||
194 | __u16 vert_start_sub; | ||
195 | /* Black clamp for horizontal direction */ | ||
196 | struct isif_horz_bclamp horz; | ||
197 | /* Black clamp for vertical direction */ | ||
198 | struct isif_vert_bclamp vert; | ||
199 | }; | ||
200 | |||
201 | /************************************************************************* | ||
202 | ** Color Space Convertion (CSC) | ||
203 | *************************************************************************/ | ||
204 | #define ISIF_CSC_NUM_COEFF 16 | ||
205 | struct isif_color_space_conv { | ||
206 | /* Enable color space conversion */ | ||
207 | __u8 en; | ||
208 | /* | ||
209 | * csc coeffient table. S8Q5, M00 at index 0, M01 at index 1, and | ||
210 | * so forth | ||
211 | */ | ||
212 | struct isif_float_8 coeff[ISIF_CSC_NUM_COEFF]; | ||
213 | }; | ||
214 | |||
215 | |||
216 | /************************************************************************* | ||
217 | ** Black Compensation parameters | ||
218 | *************************************************************************/ | ||
219 | struct isif_black_comp { | ||
220 | /* Comp for Red */ | ||
221 | __s8 r_comp; | ||
222 | /* Comp for Gr */ | ||
223 | __s8 gr_comp; | ||
224 | /* Comp for Blue */ | ||
225 | __s8 b_comp; | ||
226 | /* Comp for Gb */ | ||
227 | __s8 gb_comp; | ||
228 | }; | ||
229 | |||
230 | /************************************************************************* | ||
231 | ** Gain parameters | ||
232 | *************************************************************************/ | ||
233 | struct isif_gain { | ||
234 | /* Gain for Red or ye */ | ||
235 | struct isif_float_16 r_ye; | ||
236 | /* Gain for Gr or cy */ | ||
237 | struct isif_float_16 gr_cy; | ||
238 | /* Gain for Gb or g */ | ||
239 | struct isif_float_16 gb_g; | ||
240 | /* Gain for Blue or mg */ | ||
241 | struct isif_float_16 b_mg; | ||
242 | }; | ||
243 | |||
244 | #define ISIF_LINEAR_TAB_SIZE 192 | ||
245 | /************************************************************************* | ||
246 | ** Linearization parameters | ||
247 | *************************************************************************/ | ||
248 | struct isif_linearize { | ||
249 | /* Enable or Disable linearization of data */ | ||
250 | __u8 en; | ||
251 | /* Shift value applied */ | ||
252 | __u8 corr_shft; | ||
253 | /* scale factor applied U11Q10 */ | ||
254 | struct isif_float_16 scale_fact; | ||
255 | /* Size of the linear table */ | ||
256 | __u16 table[ISIF_LINEAR_TAB_SIZE]; | ||
257 | }; | ||
258 | |||
259 | /* Color patterns */ | ||
260 | #define ISIF_RED 0 | ||
261 | #define ISIF_GREEN_RED 1 | ||
262 | #define ISIF_GREEN_BLUE 2 | ||
263 | #define ISIF_BLUE 3 | ||
264 | struct isif_col_pat { | ||
265 | __u8 olop; | ||
266 | __u8 olep; | ||
267 | __u8 elop; | ||
268 | __u8 elep; | ||
269 | }; | ||
270 | |||
271 | /************************************************************************* | ||
272 | ** Data formatter parameters | ||
273 | *************************************************************************/ | ||
274 | struct isif_fmtplen { | ||
275 | /* | ||
276 | * number of program entries for SET0, range 1 - 16 | ||
277 | * when fmtmode is ISIF_SPLIT, 1 - 8 when fmtmode is | ||
278 | * ISIF_COMBINE | ||
279 | */ | ||
280 | __u16 plen0; | ||
281 | /* | ||
282 | * number of program entries for SET1, range 1 - 16 | ||
283 | * when fmtmode is ISIF_SPLIT, 1 - 8 when fmtmode is | ||
284 | * ISIF_COMBINE | ||
285 | */ | ||
286 | __u16 plen1; | ||
287 | /** | ||
288 | * number of program entries for SET2, range 1 - 16 | ||
289 | * when fmtmode is ISIF_SPLIT, 1 - 8 when fmtmode is | ||
290 | * ISIF_COMBINE | ||
291 | */ | ||
292 | __u16 plen2; | ||
293 | /** | ||
294 | * number of program entries for SET3, range 1 - 16 | ||
295 | * when fmtmode is ISIF_SPLIT, 1 - 8 when fmtmode is | ||
296 | * ISIF_COMBINE | ||
297 | */ | ||
298 | __u16 plen3; | ||
299 | }; | ||
300 | |||
301 | struct isif_fmt_cfg { | ||
302 | #define ISIF_SPLIT 0 | ||
303 | #define ISIF_COMBINE 1 | ||
304 | /* Split or combine or line alternate */ | ||
305 | __u8 fmtmode; | ||
306 | /* enable or disable line alternating mode */ | ||
307 | __u8 ln_alter_en; | ||
308 | #define ISIF_1LINE 0 | ||
309 | #define ISIF_2LINES 1 | ||
310 | #define ISIF_3LINES 2 | ||
311 | #define ISIF_4LINES 3 | ||
312 | /* Split/combine line number */ | ||
313 | __u8 lnum; | ||
314 | /* Address increment Range 1 - 16 */ | ||
315 | __u8 addrinc; | ||
316 | }; | ||
317 | |||
318 | struct isif_fmt_addr_ptr { | ||
319 | /* Initial address */ | ||
320 | __u32 init_addr; | ||
321 | /* output line number */ | ||
322 | #define ISIF_1STLINE 0 | ||
323 | #define ISIF_2NDLINE 1 | ||
324 | #define ISIF_3RDLINE 2 | ||
325 | #define ISIF_4THLINE 3 | ||
326 | __u8 out_line; | ||
327 | }; | ||
328 | |||
329 | struct isif_fmtpgm_ap { | ||
330 | /* program address pointer */ | ||
331 | __u8 pgm_aptr; | ||
332 | /* program address increment or decrement */ | ||
333 | __u8 pgmupdt; | ||
334 | }; | ||
335 | |||
336 | struct isif_data_formatter { | ||
337 | /* Enable/Disable data formatter */ | ||
338 | __u8 en; | ||
339 | /* data formatter configuration */ | ||
340 | struct isif_fmt_cfg cfg; | ||
341 | /* Formatter program entries length */ | ||
342 | struct isif_fmtplen plen; | ||
343 | /* first pixel in a line fed to formatter */ | ||
344 | __u16 fmtrlen; | ||
345 | /* HD interval for output line. Only valid when split line */ | ||
346 | __u16 fmthcnt; | ||
347 | /* formatter address pointers */ | ||
348 | struct isif_fmt_addr_ptr fmtaddr_ptr[16]; | ||
349 | /* program enable/disable */ | ||
350 | __u8 pgm_en[32]; | ||
351 | /* program address pointers */ | ||
352 | struct isif_fmtpgm_ap fmtpgm_ap[32]; | ||
353 | }; | ||
354 | |||
355 | struct isif_df_csc { | ||
356 | /* Color Space Conversion confguration, 0 - csc, 1 - df */ | ||
357 | __u8 df_or_csc; | ||
358 | /* csc configuration valid if df_or_csc is 0 */ | ||
359 | struct isif_color_space_conv csc; | ||
360 | /* data formatter configuration valid if df_or_csc is 1 */ | ||
361 | struct isif_data_formatter df; | ||
362 | /* start pixel in a line at the input */ | ||
363 | __u32 start_pix; | ||
364 | /* number of pixels in input line */ | ||
365 | __u32 num_pixels; | ||
366 | /* start line at the input */ | ||
367 | __u32 start_line; | ||
368 | /* number of lines at the input */ | ||
369 | __u32 num_lines; | ||
370 | }; | ||
371 | |||
372 | struct isif_gain_offsets_adj { | ||
373 | /* Gain adjustment per color */ | ||
374 | struct isif_gain gain; | ||
375 | /* Offset adjustment */ | ||
376 | __u16 offset; | ||
377 | /* Enable or Disable Gain adjustment for SDRAM data */ | ||
378 | __u8 gain_sdram_en; | ||
379 | /* Enable or Disable Gain adjustment for IPIPE data */ | ||
380 | __u8 gain_ipipe_en; | ||
381 | /* Enable or Disable Gain adjustment for H3A data */ | ||
382 | __u8 gain_h3a_en; | ||
383 | /* Enable or Disable Gain adjustment for SDRAM data */ | ||
384 | __u8 offset_sdram_en; | ||
385 | /* Enable or Disable Gain adjustment for IPIPE data */ | ||
386 | __u8 offset_ipipe_en; | ||
387 | /* Enable or Disable Gain adjustment for H3A data */ | ||
388 | __u8 offset_h3a_en; | ||
389 | }; | ||
390 | |||
391 | struct isif_cul { | ||
392 | /* Horizontal Cull pattern for odd lines */ | ||
393 | __u8 hcpat_odd; | ||
394 | /* Horizontal Cull pattern for even lines */ | ||
395 | __u8 hcpat_even; | ||
396 | /* Vertical Cull pattern */ | ||
397 | __u8 vcpat; | ||
398 | /* Enable or disable lpf. Apply when cull is enabled */ | ||
399 | __u8 en_lpf; | ||
400 | }; | ||
401 | |||
402 | struct isif_compress { | ||
403 | #define ISIF_ALAW 0 | ||
404 | #define ISIF_DPCM 1 | ||
405 | #define ISIF_NO_COMPRESSION 2 | ||
406 | /* Compression Algorithm used */ | ||
407 | __u8 alg; | ||
408 | /* Choose Predictor1 for DPCM compression */ | ||
409 | #define ISIF_DPCM_PRED1 0 | ||
410 | /* Choose Predictor2 for DPCM compression */ | ||
411 | #define ISIF_DPCM_PRED2 1 | ||
412 | /* Predictor for DPCM compression */ | ||
413 | __u8 pred; | ||
414 | }; | ||
415 | |||
416 | /* all the stuff in this struct will be provided by userland */ | ||
417 | struct isif_config_params_raw { | ||
418 | /* Linearization parameters for image sensor data input */ | ||
419 | struct isif_linearize linearize; | ||
420 | /* Data formatter or CSC */ | ||
421 | struct isif_df_csc df_csc; | ||
422 | /* Defect Pixel Correction (DFC) confguration */ | ||
423 | struct isif_dfc dfc; | ||
424 | /* Black/Digital Clamp configuration */ | ||
425 | struct isif_black_clamp bclamp; | ||
426 | /* Gain, offset adjustments */ | ||
427 | struct isif_gain_offsets_adj gain_offset; | ||
428 | /* Culling */ | ||
429 | struct isif_cul culling; | ||
430 | /* A-Law and DPCM compression options */ | ||
431 | struct isif_compress compress; | ||
432 | /* horizontal offset for Gain/LSC/DFC */ | ||
433 | __u16 horz_offset; | ||
434 | /* vertical offset for Gain/LSC/DFC */ | ||
435 | __u16 vert_offset; | ||
436 | /* color pattern for field 0 */ | ||
437 | struct isif_col_pat col_pat_field0; | ||
438 | /* color pattern for field 1 */ | ||
439 | struct isif_col_pat col_pat_field1; | ||
440 | #define ISIF_NO_SHIFT 0 | ||
441 | #define ISIF_1BIT_SHIFT 1 | ||
442 | #define ISIF_2BIT_SHIFT 2 | ||
443 | #define ISIF_3BIT_SHIFT 3 | ||
444 | #define ISIF_4BIT_SHIFT 4 | ||
445 | #define ISIF_5BIT_SHIFT 5 | ||
446 | #define ISIF_6BIT_SHIFT 6 | ||
447 | /* Data shift applied before storing to SDRAM */ | ||
448 | __u8 data_shift; | ||
449 | /* enable input test pattern generation */ | ||
450 | __u8 test_pat_gen; | ||
451 | }; | ||
452 | |||
453 | #ifdef __KERNEL__ | ||
454 | struct isif_ycbcr_config { | ||
455 | /* isif pixel format */ | ||
456 | enum ccdc_pixfmt pix_fmt; | ||
457 | /* isif frame format */ | ||
458 | enum ccdc_frmfmt frm_fmt; | ||
459 | /* ISIF crop window */ | ||
460 | struct v4l2_rect win; | ||
461 | /* field polarity */ | ||
462 | enum vpfe_pin_pol fid_pol; | ||
463 | /* interface VD polarity */ | ||
464 | enum vpfe_pin_pol vd_pol; | ||
465 | /* interface HD polarity */ | ||
466 | enum vpfe_pin_pol hd_pol; | ||
467 | /* isif pix order. Only used for ycbcr capture */ | ||
468 | enum ccdc_pixorder pix_order; | ||
469 | /* isif buffer type. Only used for ycbcr capture */ | ||
470 | enum ccdc_buftype buf_type; | ||
471 | }; | ||
472 | |||
473 | /* MSB of image data connected to sensor port */ | ||
474 | enum isif_data_msb { | ||
475 | ISIF_BIT_MSB_15, | ||
476 | ISIF_BIT_MSB_14, | ||
477 | ISIF_BIT_MSB_13, | ||
478 | ISIF_BIT_MSB_12, | ||
479 | ISIF_BIT_MSB_11, | ||
480 | ISIF_BIT_MSB_10, | ||
481 | ISIF_BIT_MSB_9, | ||
482 | ISIF_BIT_MSB_8, | ||
483 | ISIF_BIT_MSB_7 | ||
484 | }; | ||
485 | |||
486 | enum isif_cfa_pattern { | ||
487 | ISIF_CFA_PAT_MOSAIC, | ||
488 | ISIF_CFA_PAT_STRIPE | ||
489 | }; | ||
490 | |||
491 | struct isif_params_raw { | ||
492 | /* isif pixel format */ | ||
493 | enum ccdc_pixfmt pix_fmt; | ||
494 | /* isif frame format */ | ||
495 | enum ccdc_frmfmt frm_fmt; | ||
496 | /* video window */ | ||
497 | struct v4l2_rect win; | ||
498 | /* field polarity */ | ||
499 | enum vpfe_pin_pol fid_pol; | ||
500 | /* interface VD polarity */ | ||
501 | enum vpfe_pin_pol vd_pol; | ||
502 | /* interface HD polarity */ | ||
503 | enum vpfe_pin_pol hd_pol; | ||
504 | /* buffer type. Applicable for interlaced mode */ | ||
505 | enum ccdc_buftype buf_type; | ||
506 | /* Gain values */ | ||
507 | struct isif_gain gain; | ||
508 | /* cfa pattern */ | ||
509 | enum isif_cfa_pattern cfa_pat; | ||
510 | /* Data MSB position */ | ||
511 | enum isif_data_msb data_msb; | ||
512 | /* Enable horizontal flip */ | ||
513 | unsigned char horz_flip_en; | ||
514 | /* Enable image invert vertically */ | ||
515 | unsigned char image_invert_en; | ||
516 | |||
517 | /* all the userland defined stuff*/ | ||
518 | struct isif_config_params_raw config_params; | ||
519 | }; | ||
520 | |||
521 | enum isif_data_pack { | ||
522 | ISIF_PACK_16BIT, | ||
523 | ISIF_PACK_12BIT, | ||
524 | ISIF_PACK_8BIT | ||
525 | }; | ||
526 | |||
527 | #define ISIF_WIN_NTSC {0, 0, 720, 480} | ||
528 | #define ISIF_WIN_VGA {0, 0, 640, 480} | ||
529 | |||
530 | #endif | ||
531 | #endif | ||
diff --git a/include/media/davinci/vpss.h b/include/media/davinci/vpss.h index fcdff745fae2..c59cc029c74a 100644 --- a/include/media/davinci/vpss.h +++ b/include/media/davinci/vpss.h | |||
@@ -29,7 +29,19 @@ | |||
29 | /* selector for ccdc input selection on DM355 */ | 29 | /* selector for ccdc input selection on DM355 */ |
30 | enum vpss_ccdc_source_sel { | 30 | enum vpss_ccdc_source_sel { |
31 | VPSS_CCDCIN, | 31 | VPSS_CCDCIN, |
32 | VPSS_HSSIIN | 32 | VPSS_HSSIIN, |
33 | VPSS_PGLPBK, /* for DM365 only */ | ||
34 | VPSS_CCDCPG /* for DM365 only */ | ||
35 | }; | ||
36 | |||
37 | struct vpss_sync_pol { | ||
38 | unsigned int ccdpg_hdpol:1; | ||
39 | unsigned int ccdpg_vdpol:1; | ||
40 | }; | ||
41 | |||
42 | struct vpss_pg_frame_size { | ||
43 | short hlpfr; | ||
44 | short pplen; | ||
33 | }; | 45 | }; |
34 | 46 | ||
35 | /* Used for enable/diable VPSS Clock */ | 47 | /* Used for enable/diable VPSS Clock */ |
@@ -47,12 +59,38 @@ enum vpss_clock_sel { | |||
47 | */ | 59 | */ |
48 | VPSS_VENC_CLOCK_SEL, | 60 | VPSS_VENC_CLOCK_SEL, |
49 | VPSS_VPBE_CLOCK, | 61 | VPSS_VPBE_CLOCK, |
62 | /* DM365 only clocks */ | ||
63 | VPSS_IPIPEIF_CLOCK, | ||
64 | VPSS_RSZ_CLOCK, | ||
65 | VPSS_BL_CLOCK, | ||
66 | /* | ||
67 | * When using VPSS_PCLK_INTERNAL in vpss_enable_clock() api | ||
68 | * following applies:- | ||
69 | * en = 0 disable internal PCLK | ||
70 | * en = 1 enables internal PCLK | ||
71 | */ | ||
72 | VPSS_PCLK_INTERNAL, | ||
73 | /* | ||
74 | * When using VPSS_PSYNC_CLOCK_SEL in vpss_enable_clock() api | ||
75 | * following applies:- | ||
76 | * en = 0 enables MMR clock | ||
77 | * en = 1 enables VPSS clock | ||
78 | */ | ||
79 | VPSS_PSYNC_CLOCK_SEL, | ||
80 | VPSS_LDC_CLOCK_SEL, | ||
81 | VPSS_OSD_CLOCK_SEL, | ||
82 | VPSS_FDIF_CLOCK, | ||
83 | VPSS_LDC_CLOCK | ||
50 | }; | 84 | }; |
51 | 85 | ||
52 | /* select input to ccdc on dm355 */ | 86 | /* select input to ccdc on dm355 */ |
53 | int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel); | 87 | int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel); |
54 | /* enable/disable a vpss clock, 0 - success, -1 - failure */ | 88 | /* enable/disable a vpss clock, 0 - success, -1 - failure */ |
55 | int vpss_enable_clock(enum vpss_clock_sel clock_sel, int en); | 89 | int vpss_enable_clock(enum vpss_clock_sel clock_sel, int en); |
90 | /* set sync polarity, only for DM365*/ | ||
91 | void dm365_vpss_set_sync_pol(struct vpss_sync_pol); | ||
92 | /* set the PG_FRAME_SIZE register, only for DM365 */ | ||
93 | void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size); | ||
56 | 94 | ||
57 | /* wbl reset for dm644x */ | 95 | /* wbl reset for dm644x */ |
58 | enum vpss_wbl_sel { | 96 | enum vpss_wbl_sel { |
@@ -65,5 +103,6 @@ enum vpss_wbl_sel { | |||
65 | VPSS_PCR_PREV_WBL_0, | 103 | VPSS_PCR_PREV_WBL_0, |
66 | VPSS_PCR_CCDC_WBL_O, | 104 | VPSS_PCR_CCDC_WBL_O, |
67 | }; | 105 | }; |
106 | /* clear wbl overflow flag for DM6446 */ | ||
68 | int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); | 107 | int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); |
69 | #endif | 108 | #endif |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 2c6af24b905e..c66298062d39 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | struct ir_input_state { | 36 | struct ir_input_state { |
37 | /* configuration */ | 37 | /* configuration */ |
38 | int ir_type; | 38 | u64 ir_type; |
39 | 39 | ||
40 | /* key info */ | 40 | /* key info */ |
41 | u32 ir_key; /* ir scancode */ | 41 | u32 ir_key; /* ir scancode */ |
@@ -84,7 +84,7 @@ struct card_ir { | |||
84 | /* Routines from ir-functions.c */ | 84 | /* Routines from ir-functions.c */ |
85 | 85 | ||
86 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 86 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, |
87 | int ir_type); | 87 | const u64 ir_type); |
88 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | 88 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); |
89 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | 89 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, |
90 | u32 ir_key); | 90 | u32 ir_key); |
@@ -162,4 +162,6 @@ extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; | |||
162 | extern struct ir_scancode_table ir_codes_videomate_s350_table; | 162 | extern struct ir_scancode_table ir_codes_videomate_s350_table; |
163 | extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; | 163 | extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; |
164 | extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table; | 164 | extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table; |
165 | extern struct ir_scancode_table ir_codes_winfast_usbii_deluxe_table; | ||
166 | extern struct ir_scancode_table ir_codes_kworld_315u_table; | ||
165 | #endif | 167 | #endif |
diff --git a/include/media/ir-core.h b/include/media/ir-core.h index 299d201e1339..61c223bc3953 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h | |||
@@ -21,13 +21,11 @@ extern int ir_core_debug; | |||
21 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | 21 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ |
22 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | 22 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) |
23 | 23 | ||
24 | enum ir_type { | 24 | #define IR_TYPE_UNKNOWN 0 |
25 | IR_TYPE_UNKNOWN = 0, | 25 | #define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ |
26 | IR_TYPE_RC5 = 1, | 26 | #define IR_TYPE_PD (1 << 1) /* Pulse distance encoded IR */ |
27 | IR_TYPE_PD = 2, /* Pulse distance encoded IR */ | 27 | #define IR_TYPE_NEC (1 << 2) |
28 | IR_TYPE_NEC = 3, | 28 | #define IR_TYPE_OTHER (((u64)1) << 63l) |
29 | IR_TYPE_OTHER = 99, | ||
30 | }; | ||
31 | 29 | ||
32 | struct ir_scancode { | 30 | struct ir_scancode { |
33 | u16 scancode; | 31 | u16 scancode; |
@@ -37,26 +35,40 @@ struct ir_scancode { | |||
37 | struct ir_scancode_table { | 35 | struct ir_scancode_table { |
38 | struct ir_scancode *scan; | 36 | struct ir_scancode *scan; |
39 | int size; | 37 | int size; |
40 | enum ir_type ir_type; | 38 | u64 ir_type; |
41 | spinlock_t lock; | 39 | spinlock_t lock; |
42 | }; | 40 | }; |
43 | 41 | ||
42 | struct ir_dev_props { | ||
43 | unsigned long allowed_protos; | ||
44 | void *priv; | ||
45 | int (*change_protocol)(void *priv, u64 ir_type); | ||
46 | }; | ||
47 | |||
48 | |||
44 | struct ir_input_dev { | 49 | struct ir_input_dev { |
45 | struct input_dev *dev; | 50 | struct input_dev *dev; /* Input device*/ |
46 | struct ir_scancode_table rc_tab; | 51 | struct ir_scancode_table rc_tab; /* scan/key table */ |
52 | unsigned long devno; /* device number */ | ||
53 | struct attribute_group attr; /* IR attributes */ | ||
54 | struct device *class_dev; /* virtual class dev */ | ||
55 | const struct ir_dev_props *props; /* Device properties */ | ||
47 | }; | 56 | }; |
57 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) | ||
48 | 58 | ||
49 | /* Routines from ir-keytable.c */ | 59 | /* Routines from ir-keytable.c */ |
50 | 60 | ||
51 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, | 61 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, |
52 | u32 scancode); | 62 | u32 scancode); |
53 | 63 | ||
54 | int ir_set_keycode_table(struct input_dev *input_dev, | ||
55 | struct ir_scancode_table *rc_tab); | ||
56 | |||
57 | int ir_roundup_tablesize(int n_elems); | ||
58 | int ir_input_register(struct input_dev *dev, | 64 | int ir_input_register(struct input_dev *dev, |
59 | struct ir_scancode_table *ir_codes); | 65 | const struct ir_scancode_table *ir_codes, |
66 | const struct ir_dev_props *props); | ||
60 | void ir_input_unregister(struct input_dev *input_dev); | 67 | void ir_input_unregister(struct input_dev *input_dev); |
61 | 68 | ||
69 | /* Routines from ir-sysfs.c */ | ||
70 | |||
71 | int ir_register_class(struct input_dev *input_dev); | ||
72 | void ir_unregister_class(struct input_dev *input_dev); | ||
73 | |||
62 | #endif | 74 | #endif |
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index aaf65e8b1a40..9142936603cc 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
@@ -36,7 +36,7 @@ enum ir_kbd_get_key_fn { | |||
36 | struct IR_i2c_init_data { | 36 | struct IR_i2c_init_data { |
37 | struct ir_scancode_table *ir_codes; | 37 | struct ir_scancode_table *ir_codes; |
38 | const char *name; | 38 | const char *name; |
39 | int type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */ | 39 | u64 type; /* IR_TYPE_RC5, IR_TYPE_PD, etc */ |
40 | /* | 40 | /* |
41 | * Specify either a function pointer or a value indicating one of | 41 | * Specify either a function pointer or a value indicating one of |
42 | * ir_kbd_i2c's internal get_key functions | 42 | * ir_kbd_i2c's internal get_key functions |
diff --git a/include/media/ov772x.h b/include/media/ov772x.h index 14c77efd6a85..548bf1155c83 100644 --- a/include/media/ov772x.h +++ b/include/media/ov772x.h | |||
@@ -15,8 +15,9 @@ | |||
15 | #include <media/soc_camera.h> | 15 | #include <media/soc_camera.h> |
16 | 16 | ||
17 | /* for flags */ | 17 | /* for flags */ |
18 | #define OV772X_FLAG_VFLIP 0x00000001 /* Vertical flip image */ | 18 | #define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */ |
19 | #define OV772X_FLAG_HFLIP 0x00000002 /* Horizontal flip image */ | 19 | #define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */ |
20 | #define OV772X_FLAG_8BIT (1 << 2) /* default 10 bit */ | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * for Edge ctrl | 23 | * for Edge ctrl |
@@ -53,9 +54,8 @@ struct ov772x_edge_ctrl { | |||
53 | * ov772x camera info | 54 | * ov772x camera info |
54 | */ | 55 | */ |
55 | struct ov772x_camera_info { | 56 | struct ov772x_camera_info { |
56 | unsigned long buswidth; | 57 | unsigned long flags; |
57 | unsigned long flags; | 58 | struct ov772x_edge_ctrl edgectrl; |
58 | struct ov772x_edge_ctrl edgectrl; | ||
59 | }; | 59 | }; |
60 | 60 | ||
61 | #endif /* __OV772X_H__ */ | 61 | #endif /* __OV772X_H__ */ |
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index 4aeff96ff7d8..b9da1f5591e7 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
@@ -188,6 +188,7 @@ void saa7146_buffer_timeout(unsigned long data); | |||
188 | void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q, | 188 | void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q, |
189 | struct saa7146_buf *buf); | 189 | struct saa7146_buf *buf); |
190 | 190 | ||
191 | int saa7146_vv_devinit(struct saa7146_dev *dev); | ||
191 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv); | 192 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv); |
192 | int saa7146_vv_release(struct saa7146_dev* dev); | 193 | int saa7146_vv_release(struct saa7146_dev* dev); |
193 | 194 | ||
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index dcc5b86bcb6c..9d69f01b6fa2 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -81,6 +81,8 @@ struct soc_camera_host_ops { | |||
81 | int (*set_bus_param)(struct soc_camera_device *, __u32); | 81 | int (*set_bus_param)(struct soc_camera_device *, __u32); |
82 | int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); | 82 | int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *); |
83 | int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *); | 83 | int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *); |
84 | int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); | ||
85 | int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); | ||
84 | unsigned int (*poll)(struct file *, poll_table *); | 86 | unsigned int (*poll)(struct file *, poll_table *); |
85 | const struct v4l2_queryctrl *controls; | 87 | const struct v4l2_queryctrl *controls; |
86 | int num_controls; | 88 | int num_controls; |
diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h new file mode 100644 index 000000000000..fcd32a3696ba --- /dev/null +++ b/include/media/timb_radio.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * timb_radio.h Platform struct for the Timberdale radio driver | ||
3 | * Copyright (c) 2009 Intel Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef _TIMB_RADIO_ | ||
20 | #define _TIMB_RADIO_ 1 | ||
21 | |||
22 | #include <linux/i2c.h> | ||
23 | |||
24 | struct timb_radio_platform_data { | ||
25 | int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ | ||
26 | struct { | ||
27 | const char *module_name; | ||
28 | struct i2c_board_info *info; | ||
29 | } tuner; | ||
30 | struct { | ||
31 | const char *module_name; | ||
32 | struct i2c_board_info *info; | ||
33 | } dsp; | ||
34 | }; | ||
35 | |||
36 | #endif | ||
diff --git a/include/media/tuner.h b/include/media/tuner.h index 4d5b53ff17db..5505c5360ca3 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h | |||
@@ -129,6 +129,7 @@ | |||
129 | #define TUNER_PARTSNIC_PTI_5NF05 81 | 129 | #define TUNER_PARTSNIC_PTI_5NF05 81 |
130 | #define TUNER_PHILIPS_CU1216L 82 | 130 | #define TUNER_PHILIPS_CU1216L 82 |
131 | #define TUNER_NXP_TDA18271 83 | 131 | #define TUNER_NXP_TDA18271 83 |
132 | #define TUNER_SONY_BTF_PXN01Z 84 | ||
132 | 133 | ||
133 | /* tv card specific */ | 134 | /* tv card specific */ |
134 | #define TDA9887_PRESENT (1<<0) | 135 | #define TDA9887_PRESENT (1<<0) |
diff --git a/include/media/tvp7002.h b/include/media/tvp7002.h new file mode 100644 index 000000000000..ee4353459ef5 --- /dev/null +++ b/include/media/tvp7002.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* Texas Instruments Triple 8-/10-BIT 165-/110-MSPS Video and Graphics | ||
2 | * Digitizer with Horizontal PLL registers | ||
3 | * | ||
4 | * Copyright (C) 2009 Texas Instruments Inc | ||
5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> | ||
6 | * | ||
7 | * This code is partially based upon the TVP5150 driver | ||
8 | * written by Mauro Carvalho Chehab (mchehab@infradead.org), | ||
9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> | ||
10 | * and the TVP7002 driver in the TI LSP 2.10.00.14 | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License as published by | ||
14 | * the Free Software Foundation; either version 2 of the License, or | ||
15 | * (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
25 | */ | ||
26 | #ifndef _TVP7002_H_ | ||
27 | #define _TVP7002_H_ | ||
28 | |||
29 | /* Platform-dependent data | ||
30 | * | ||
31 | * clk_polarity: | ||
32 | * 0 -> data clocked out on rising edge of DATACLK signal | ||
33 | * 1 -> data clocked out on falling edge of DATACLK signal | ||
34 | * hs_polarity: | ||
35 | * 0 -> active low HSYNC output | ||
36 | * 1 -> active high HSYNC output | ||
37 | * sog_polarity: | ||
38 | * 0 -> normal operation | ||
39 | * 1 -> operation with polarity inverted | ||
40 | * vs_polarity: | ||
41 | * 0 -> active low VSYNC output | ||
42 | * 1 -> active high VSYNC output | ||
43 | * fid_polarity: | ||
44 | * 0 -> the field ID output is set to logic 1 for an odd | ||
45 | * field (field 1) and set to logic 0 for an even | ||
46 | * field (field 0). | ||
47 | * 1 -> operation with polarity inverted. | ||
48 | */ | ||
49 | struct tvp7002_config { | ||
50 | u8 clk_polarity; | ||
51 | u8 hs_polarity; | ||
52 | u8 vs_polarity; | ||
53 | u8 fid_polarity; | ||
54 | u8 sog_polarity; | ||
55 | }; | ||
56 | #endif | ||
diff --git a/include/media/tw9910.h b/include/media/tw9910.h index 5e2895a05e6b..90bcf1fa5421 100644 --- a/include/media/tw9910.h +++ b/include/media/tw9910.h | |||
@@ -30,8 +30,8 @@ enum tw9910_mpout_pin { | |||
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct tw9910_video_info { | 32 | struct tw9910_video_info { |
33 | unsigned long buswidth; | 33 | unsigned long buswidth; |
34 | enum tw9910_mpout_pin mpout; | 34 | enum tw9910_mpout_pin mpout; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | 37 | ||
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 6cc107d198a0..56abf21dd786 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -39,6 +39,7 @@ enum { | |||
39 | 39 | ||
40 | /* module saa7115: reserved range 101-149 */ | 40 | /* module saa7115: reserved range 101-149 */ |
41 | V4L2_IDENT_SAA7111 = 101, | 41 | V4L2_IDENT_SAA7111 = 101, |
42 | V4L2_IDENT_SAA7111A = 102, | ||
42 | V4L2_IDENT_SAA7113 = 103, | 43 | V4L2_IDENT_SAA7113 = 103, |
43 | V4L2_IDENT_SAA7114 = 104, | 44 | V4L2_IDENT_SAA7114 = 104, |
44 | V4L2_IDENT_SAA7115 = 105, | 45 | V4L2_IDENT_SAA7115 = 105, |
@@ -134,6 +135,9 @@ enum { | |||
134 | /* modules tef6862: just ident 6862 */ | 135 | /* modules tef6862: just ident 6862 */ |
135 | V4L2_IDENT_TEF6862 = 6862, | 136 | V4L2_IDENT_TEF6862 = 6862, |
136 | 137 | ||
138 | /* module tvp7002: just ident 7002 */ | ||
139 | V4L2_IDENT_TVP7002 = 7002, | ||
140 | |||
137 | /* module adv7170: just ident 7170 */ | 141 | /* module adv7170: just ident 7170 */ |
138 | V4L2_IDENT_ADV7170 = 7170, | 142 | V4L2_IDENT_ADV7170 = 7170, |
139 | 143 | ||
@@ -155,6 +159,9 @@ enum { | |||
155 | /* module adv7343: just ident 7343 */ | 159 | /* module adv7343: just ident 7343 */ |
156 | V4L2_IDENT_ADV7343 = 7343, | 160 | V4L2_IDENT_ADV7343 = 7343, |
157 | 161 | ||
162 | /* module saa7706h: just ident 7706 */ | ||
163 | V4L2_IDENT_SAA7706H = 7706, | ||
164 | |||
158 | /* module wm8739: just ident 8739 */ | 165 | /* module wm8739: just ident 8739 */ |
159 | V4L2_IDENT_WM8739 = 8739, | 166 | V4L2_IDENT_WM8739 = 8739, |
160 | 167 | ||
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 9ba99cd39ee7..2bcdca0a57fc 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -180,6 +180,7 @@ struct v4l2_subdev_audio_ops { | |||
180 | int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq); | 180 | int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq); |
181 | int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq); | 181 | int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq); |
182 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); | 182 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); |
183 | int (*s_stream)(struct v4l2_subdev *sd, int enable); | ||
183 | }; | 184 | }; |
184 | 185 | ||
185 | /* | 186 | /* |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 0f7c37825fc1..45375b41a2a0 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -177,7 +177,9 @@ extern int unregister_inet6addr_notifier(struct notifier_block *nb); | |||
177 | static inline struct inet6_dev * | 177 | static inline struct inet6_dev * |
178 | __in6_dev_get(struct net_device *dev) | 178 | __in6_dev_get(struct net_device *dev) |
179 | { | 179 | { |
180 | return rcu_dereference(dev->ip6_ptr); | 180 | return rcu_dereference_check(dev->ip6_ptr, |
181 | rcu_read_lock_held() || | ||
182 | lockdep_rtnl_is_held()); | ||
181 | } | 183 | } |
182 | 184 | ||
183 | static inline struct inet6_dev * | 185 | static inline struct inet6_dev * |
diff --git a/include/net/ip.h b/include/net/ip.h index 85108cfbb1ae..fb63371c07a8 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -326,6 +326,22 @@ static __inline__ void inet_reset_saddr(struct sock *sk) | |||
326 | 326 | ||
327 | #endif | 327 | #endif |
328 | 328 | ||
329 | static inline int sk_mc_loop(struct sock *sk) | ||
330 | { | ||
331 | if (!sk) | ||
332 | return 1; | ||
333 | switch (sk->sk_family) { | ||
334 | case AF_INET: | ||
335 | return inet_sk(sk)->mc_loop; | ||
336 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
337 | case AF_INET6: | ||
338 | return inet6_sk(sk)->mc_loop; | ||
339 | #endif | ||
340 | } | ||
341 | WARN_ON(1); | ||
342 | return 1; | ||
343 | } | ||
344 | |||
329 | extern int ip_call_ra_chain(struct sk_buff *skb); | 345 | extern int ip_call_ra_chain(struct sk_buff *skb); |
330 | 346 | ||
331 | /* | 347 | /* |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 2aff4906b2ae..0bf369752274 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -547,7 +547,6 @@ enum mac80211_rx_flags { | |||
547 | * unspecified depending on the hardware capabilities flags | 547 | * unspecified depending on the hardware capabilities flags |
548 | * @IEEE80211_HW_SIGNAL_* | 548 | * @IEEE80211_HW_SIGNAL_* |
549 | * @noise: noise when receiving this frame, in dBm. | 549 | * @noise: noise when receiving this frame, in dBm. |
550 | * @qual: overall signal quality indication, in percent (0-100). | ||
551 | * @antenna: antenna used | 550 | * @antenna: antenna used |
552 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 551 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
553 | * HT rates are use (RX_FLAG_HT) | 552 | * HT rates are use (RX_FLAG_HT) |
@@ -559,7 +558,6 @@ struct ieee80211_rx_status { | |||
559 | int freq; | 558 | int freq; |
560 | int signal; | 559 | int signal; |
561 | int noise; | 560 | int noise; |
562 | int __deprecated qual; | ||
563 | int antenna; | 561 | int antenna; |
564 | int rate_idx; | 562 | int rate_idx; |
565 | int flag; | 563 | int flag; |
@@ -1737,6 +1735,12 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | |||
1737 | local_bh_enable(); | 1735 | local_bh_enable(); |
1738 | } | 1736 | } |
1739 | 1737 | ||
1738 | /* | ||
1739 | * The TX headroom reserved by mac80211 for its own tx_status functions. | ||
1740 | * This is enough for the radiotap header. | ||
1741 | */ | ||
1742 | #define IEEE80211_TX_STATUS_HEADROOM 13 | ||
1743 | |||
1740 | /** | 1744 | /** |
1741 | * ieee80211_tx_status - transmit status callback | 1745 | * ieee80211_tx_status - transmit status callback |
1742 | * | 1746 | * |
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index ba1ba0c5efd1..63d449807d9b 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
@@ -11,6 +11,8 @@ struct nf_conntrack_ecache; | |||
11 | struct netns_ct { | 11 | struct netns_ct { |
12 | atomic_t count; | 12 | atomic_t count; |
13 | unsigned int expect_count; | 13 | unsigned int expect_count; |
14 | unsigned int htable_size; | ||
15 | struct kmem_cache *nf_conntrack_cachep; | ||
14 | struct hlist_nulls_head *hash; | 16 | struct hlist_nulls_head *hash; |
15 | struct hlist_head *expect_hash; | 17 | struct hlist_head *expect_hash; |
16 | struct hlist_nulls_head unconfirmed; | 18 | struct hlist_nulls_head unconfirmed; |
@@ -28,5 +30,6 @@ struct netns_ct { | |||
28 | #endif | 30 | #endif |
29 | int hash_vmalloc; | 31 | int hash_vmalloc; |
30 | int expect_vmalloc; | 32 | int expect_vmalloc; |
33 | char *slabname; | ||
31 | }; | 34 | }; |
32 | #endif | 35 | #endif |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 2eb3814d6258..9a4b8b714079 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -40,6 +40,7 @@ struct netns_ipv4 { | |||
40 | struct xt_table *iptable_security; | 40 | struct xt_table *iptable_security; |
41 | struct xt_table *nat_table; | 41 | struct xt_table *nat_table; |
42 | struct hlist_head *nat_bysource; | 42 | struct hlist_head *nat_bysource; |
43 | unsigned int nat_htable_size; | ||
43 | int nat_vmalloced; | 44 | int nat_vmalloced; |
44 | #endif | 45 | #endif |
45 | 46 | ||
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 56f8e5585df7..74f119a2829a 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/wait.h> | 5 | #include <linux/wait.h> |
6 | #include <linux/workqueue.h> | 6 | #include <linux/workqueue.h> |
7 | #include <linux/xfrm.h> | 7 | #include <linux/xfrm.h> |
8 | #include <net/dst_ops.h> | ||
8 | 9 | ||
9 | struct ctl_table_header; | 10 | struct ctl_table_header; |
10 | 11 | ||
@@ -42,6 +43,11 @@ struct netns_xfrm { | |||
42 | unsigned int policy_count[XFRM_POLICY_MAX * 2]; | 43 | unsigned int policy_count[XFRM_POLICY_MAX * 2]; |
43 | struct work_struct policy_hash_work; | 44 | struct work_struct policy_hash_work; |
44 | 45 | ||
46 | struct dst_ops xfrm4_dst_ops; | ||
47 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
48 | struct dst_ops xfrm6_dst_ops; | ||
49 | #endif | ||
50 | |||
45 | struct sock *nlsk; | 51 | struct sock *nlsk; |
46 | struct sock *nlsk_stash; | 52 | struct sock *nlsk_stash; |
47 | 53 | ||
diff --git a/include/net/netrom.h b/include/net/netrom.h index 15696b1fd30f..ab170a60e7d3 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h | |||
@@ -132,6 +132,8 @@ static __inline__ void nr_node_put(struct nr_node *nr_node) | |||
132 | static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) | 132 | static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) |
133 | { | 133 | { |
134 | if (atomic_dec_and_test(&nr_neigh->refcount)) { | 134 | if (atomic_dec_and_test(&nr_neigh->refcount)) { |
135 | if (nr_neigh->ax25) | ||
136 | ax25_cb_put(nr_neigh->ax25); | ||
135 | kfree(nr_neigh->digipeat); | 137 | kfree(nr_neigh->digipeat); |
136 | kfree(nr_neigh); | 138 | kfree(nr_neigh); |
137 | } | 139 | } |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 6d85861ab990..60c27706e7b9 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1367,8 +1367,8 @@ struct xfrmk_spdinfo { | |||
1367 | extern struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 seq); | 1367 | extern struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 seq); |
1368 | extern int xfrm_state_delete(struct xfrm_state *x); | 1368 | extern int xfrm_state_delete(struct xfrm_state *x); |
1369 | extern int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); | 1369 | extern int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); |
1370 | extern void xfrm_sad_getinfo(struct xfrmk_sadinfo *si); | 1370 | extern void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si); |
1371 | extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si); | 1371 | extern void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si); |
1372 | extern int xfrm_replay_check(struct xfrm_state *x, | 1372 | extern int xfrm_replay_check(struct xfrm_state *x, |
1373 | struct sk_buff *skb, __be32 seq); | 1373 | struct sk_buff *skb, __be32 seq); |
1374 | extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); | 1374 | extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); |
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index ee148573c114..d57847f2f6c1 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -40,7 +40,7 @@ struct net_device; | |||
40 | * Documentation/pcmcia/driver.txt for details. | 40 | * Documentation/pcmcia/driver.txt for details. |
41 | */ | 41 | */ |
42 | struct pcmcia_dynids { | 42 | struct pcmcia_dynids { |
43 | spinlock_t lock; | 43 | struct mutex lock; |
44 | struct list_head list; | 44 | struct list_head list; |
45 | }; | 45 | }; |
46 | 46 | ||
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index cbfba885eb85..32896a773910 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
@@ -134,9 +134,9 @@ struct pccard_operations { | |||
134 | 134 | ||
135 | struct pcmcia_socket { | 135 | struct pcmcia_socket { |
136 | struct module *owner; | 136 | struct module *owner; |
137 | spinlock_t lock; | ||
138 | socket_state_t socket; | 137 | socket_state_t socket; |
139 | u_int state; | 138 | u_int state; |
139 | u_int suspended_state; /* state before suspend */ | ||
140 | u_short functions; | 140 | u_short functions; |
141 | u_short lock_count; | 141 | u_short lock_count; |
142 | pccard_mem_map cis_mem; | 142 | pccard_mem_map cis_mem; |
@@ -200,9 +200,14 @@ struct pcmcia_socket { | |||
200 | struct task_struct *thread; | 200 | struct task_struct *thread; |
201 | struct completion thread_done; | 201 | struct completion thread_done; |
202 | unsigned int thread_events; | 202 | unsigned int thread_events; |
203 | /* protects socket h/w state */ | 203 | unsigned int sysfs_events; |
204 | |||
205 | /* For the non-trivial interaction between these locks, | ||
206 | * see Documentation/pcmcia/locking.txt */ | ||
204 | struct mutex skt_mutex; | 207 | struct mutex skt_mutex; |
205 | /* protects thread_events */ | 208 | struct mutex ops_mutex; |
209 | |||
210 | /* protects thread_events and sysfs_events */ | ||
206 | spinlock_t thread_lock; | 211 | spinlock_t thread_lock; |
207 | 212 | ||
208 | /* pcmcia (16-bit) */ | 213 | /* pcmcia (16-bit) */ |
@@ -225,30 +230,19 @@ struct pcmcia_socket { | |||
225 | u8 busy:1; | 230 | u8 busy:1; |
226 | /* pcmcia module is being unloaded */ | 231 | /* pcmcia module is being unloaded */ |
227 | u8 dead:1; | 232 | u8 dead:1; |
228 | /* a multifunction-device add event is pending */ | 233 | /* the PCMCIA card consists of two pseudo devices */ |
229 | u8 device_add_pending:1; | 234 | u8 has_pfc:1; |
230 | /* the pending event adds a mfc (1) or pfc (0) */ | ||
231 | u8 mfc_pfc:1; | ||
232 | 235 | ||
233 | u8 reserved:3; | 236 | u8 reserved:4; |
234 | } pcmcia_state; | 237 | } pcmcia_state; |
235 | 238 | ||
236 | 239 | ||
237 | /* for adding further pseudo-multifunction devices */ | ||
238 | struct work_struct device_add; | ||
239 | |||
240 | #ifdef CONFIG_PCMCIA_IOCTL | 240 | #ifdef CONFIG_PCMCIA_IOCTL |
241 | struct user_info_t *user; | 241 | struct user_info_t *user; |
242 | wait_queue_head_t queue; | 242 | wait_queue_head_t queue; |
243 | #endif /* CONFIG_PCMCIA_IOCTL */ | 243 | #endif /* CONFIG_PCMCIA_IOCTL */ |
244 | #endif /* CONFIG_PCMCIA */ | 244 | #endif /* CONFIG_PCMCIA */ |
245 | 245 | ||
246 | /* cardbus (32-bit) */ | ||
247 | #ifdef CONFIG_CARDBUS | ||
248 | struct resource *cb_cis_res; | ||
249 | void __iomem *cb_cis_virt; | ||
250 | #endif /* CONFIG_CARDBUS */ | ||
251 | |||
252 | /* socket device */ | 246 | /* socket device */ |
253 | struct device dev; | 247 | struct device dev; |
254 | /* data internal to the socket driver */ | 248 | /* data internal to the socket driver */ |
@@ -263,13 +257,25 @@ struct pcmcia_socket { | |||
263 | * - pccard_static_ops iomem and ioport areas are assigned statically | 257 | * - pccard_static_ops iomem and ioport areas are assigned statically |
264 | * - pccard_iodyn_ops iomem areas is assigned statically, ioport | 258 | * - pccard_iodyn_ops iomem areas is assigned statically, ioport |
265 | * areas dynamically | 259 | * areas dynamically |
260 | * If this option is selected, use | ||
261 | * "select PCCARD_IODYN" in Kconfig. | ||
266 | * - pccard_nonstatic_ops iomem and ioport areas are assigned dynamically. | 262 | * - pccard_nonstatic_ops iomem and ioport areas are assigned dynamically. |
267 | * If this option is selected, use | 263 | * If this option is selected, use |
268 | * "select PCCARD_NONSTATIC" in Kconfig. | 264 | * "select PCCARD_NONSTATIC" in Kconfig. |
265 | * | ||
269 | */ | 266 | */ |
270 | extern struct pccard_resource_ops pccard_static_ops; | 267 | extern struct pccard_resource_ops pccard_static_ops; |
268 | #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE) | ||
271 | extern struct pccard_resource_ops pccard_iodyn_ops; | 269 | extern struct pccard_resource_ops pccard_iodyn_ops; |
272 | extern struct pccard_resource_ops pccard_nonstatic_ops; | 270 | extern struct pccard_resource_ops pccard_nonstatic_ops; |
271 | #else | ||
272 | /* If PCMCIA is not used, but only CARDBUS, these functions are not used | ||
273 | * at all. Therefore, do not use the large (240K!) rsrc_nonstatic module | ||
274 | */ | ||
275 | #define pccard_iodyn_ops pccard_static_ops | ||
276 | #define pccard_nonstatic_ops pccard_static_ops | ||
277 | #endif | ||
278 | |||
273 | 279 | ||
274 | /* socket drivers are expected to use these callbacks in their .drv struct */ | 280 | /* socket drivers are expected to use these callbacks in their .drv struct */ |
275 | extern int pcmcia_socket_dev_suspend(struct device *dev); | 281 | extern int pcmcia_socket_dev_suspend(struct device *dev); |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 7394e3bc8f4b..ff92b46f5153 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mutex.h> | 28 | #include <linux/mutex.h> |
29 | #include <linux/timer.h> | 29 | #include <linux/timer.h> |
30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
31 | #include <linux/kfifo.h> | ||
31 | #include <scsi/iscsi_proto.h> | 32 | #include <scsi/iscsi_proto.h> |
32 | #include <scsi/iscsi_if.h> | 33 | #include <scsi/iscsi_if.h> |
33 | #include <scsi/scsi_transport_iscsi.h> | 34 | #include <scsi/scsi_transport_iscsi.h> |
@@ -231,7 +232,7 @@ struct iscsi_conn { | |||
231 | }; | 232 | }; |
232 | 233 | ||
233 | struct iscsi_pool { | 234 | struct iscsi_pool { |
234 | struct kfifo *queue; /* FIFO Queue */ | 235 | struct kfifo queue; /* FIFO Queue */ |
235 | void **pool; /* Pool of elements */ | 236 | void **pool; /* Pool of elements */ |
236 | int max; /* Max number of elements */ | 237 | int max; /* Max number of elements */ |
237 | }; | 238 | }; |
diff --git a/include/scsi/libiscsi_tcp.h b/include/scsi/libiscsi_tcp.h index 9e3182e659db..741ae7ed4394 100644 --- a/include/scsi/libiscsi_tcp.h +++ b/include/scsi/libiscsi_tcp.h | |||
@@ -80,7 +80,7 @@ struct iscsi_tcp_task { | |||
80 | int data_offset; | 80 | int data_offset; |
81 | struct iscsi_r2t_info *r2t; /* in progress solict R2T */ | 81 | struct iscsi_r2t_info *r2t; /* in progress solict R2T */ |
82 | struct iscsi_pool r2tpool; | 82 | struct iscsi_pool r2tpool; |
83 | struct kfifo *r2tqueue; | 83 | struct kfifo r2tqueue; |
84 | void *dd_data; | 84 | void *dd_data; |
85 | }; | 85 | }; |
86 | 86 | ||
diff --git a/include/scsi/libsrp.h b/include/scsi/libsrp.h index ba615e4c1d7c..f4105c91af53 100644 --- a/include/scsi/libsrp.h +++ b/include/scsi/libsrp.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __LIBSRP_H__ | 2 | #define __LIBSRP_H__ |
3 | 3 | ||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/kfifo.h> | ||
5 | #include <scsi/scsi_cmnd.h> | 6 | #include <scsi/scsi_cmnd.h> |
6 | #include <scsi/scsi_host.h> | 7 | #include <scsi/scsi_host.h> |
7 | #include <scsi/srp.h> | 8 | #include <scsi/srp.h> |
@@ -21,7 +22,7 @@ struct srp_buf { | |||
21 | struct srp_queue { | 22 | struct srp_queue { |
22 | void *pool; | 23 | void *pool; |
23 | void *items; | 24 | void *items; |
24 | struct kfifo *queue; | 25 | struct kfifo queue; |
25 | spinlock_t lock; | 26 | spinlock_t lock; |
26 | }; | 27 | }; |
27 | 28 | ||
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h index 39d6d1097153..a8f370126632 100644 --- a/include/scsi/osd_initiator.h +++ b/include/scsi/osd_initiator.h | |||
@@ -142,6 +142,7 @@ struct osd_request { | |||
142 | struct _osd_io_info { | 142 | struct _osd_io_info { |
143 | struct bio *bio; | 143 | struct bio *bio; |
144 | u64 total_bytes; | 144 | u64 total_bytes; |
145 | u64 residual; | ||
145 | struct request *req; | 146 | struct request *req; |
146 | struct _osd_req_data_segment *last_seg; | 147 | struct _osd_req_data_segment *last_seg; |
147 | u8 *pad_buff; | 148 | u8 *pad_buff; |
@@ -150,12 +151,14 @@ struct osd_request { | |||
150 | gfp_t alloc_flags; | 151 | gfp_t alloc_flags; |
151 | unsigned timeout; | 152 | unsigned timeout; |
152 | unsigned retries; | 153 | unsigned retries; |
154 | unsigned sense_len; | ||
153 | u8 sense[OSD_MAX_SENSE_LEN]; | 155 | u8 sense[OSD_MAX_SENSE_LEN]; |
154 | enum osd_attributes_mode attributes_mode; | 156 | enum osd_attributes_mode attributes_mode; |
155 | 157 | ||
156 | osd_req_done_fn *async_done; | 158 | osd_req_done_fn *async_done; |
157 | void *async_private; | 159 | void *async_private; |
158 | int async_error; | 160 | int async_error; |
161 | int req_errors; | ||
159 | }; | 162 | }; |
160 | 163 | ||
161 | static inline bool osd_req_is_ver1(struct osd_request *or) | 164 | static inline bool osd_req_is_ver1(struct osd_request *or) |
@@ -297,8 +300,6 @@ enum osd_err_priority { | |||
297 | }; | 300 | }; |
298 | 301 | ||
299 | struct osd_sense_info { | 302 | struct osd_sense_info { |
300 | u64 out_resid; /* Zero on success otherwise out residual */ | ||
301 | u64 in_resid; /* Zero on success otherwise in residual */ | ||
302 | enum osd_err_priority osd_err_pri; | 303 | enum osd_err_priority osd_err_pri; |
303 | 304 | ||
304 | int key; /* one of enum scsi_sense_keys */ | 305 | int key; /* one of enum scsi_sense_keys */ |
diff --git a/include/scsi/scsi_bsg_fc.h b/include/scsi/scsi_bsg_fc.h index a4b233318179..91a4e4ff9a9b 100644 --- a/include/scsi/scsi_bsg_fc.h +++ b/include/scsi/scsi_bsg_fc.h | |||
@@ -292,7 +292,7 @@ struct fc_bsg_request { | |||
292 | struct fc_bsg_rport_els r_els; | 292 | struct fc_bsg_rport_els r_els; |
293 | struct fc_bsg_rport_ct r_ct; | 293 | struct fc_bsg_rport_ct r_ct; |
294 | } rqst_data; | 294 | } rqst_data; |
295 | }; | 295 | } __attribute__((packed)); |
296 | 296 | ||
297 | 297 | ||
298 | /* response (request sense data) structure of the sg_io_v4 */ | 298 | /* response (request sense data) structure of the sg_io_v4 */ |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 7c4449900c24..d80b6dbed1ca 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -348,7 +348,8 @@ extern int scsi_mode_select(struct scsi_device *sdev, int pf, int sp, | |||
348 | struct scsi_sense_hdr *); | 348 | struct scsi_sense_hdr *); |
349 | extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, | 349 | extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, |
350 | int retries, struct scsi_sense_hdr *sshdr); | 350 | int retries, struct scsi_sense_hdr *sshdr); |
351 | extern unsigned char *scsi_get_vpd_page(struct scsi_device *, u8 page); | 351 | extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf, |
352 | int buf_len); | ||
352 | extern int scsi_device_set_state(struct scsi_device *sdev, | 353 | extern int scsi_device_set_state(struct scsi_device *sdev, |
353 | enum scsi_device_state state); | 354 | enum scsi_device_state state); |
354 | extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, | 355 | extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, |
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index 61ad3594aad6..ffeebc34a4f7 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h | |||
@@ -107,6 +107,8 @@ struct sas_end_device { | |||
107 | struct sas_rphy rphy; | 107 | struct sas_rphy rphy; |
108 | /* flags */ | 108 | /* flags */ |
109 | unsigned ready_led_meaning:1; | 109 | unsigned ready_led_meaning:1; |
110 | unsigned tlr_supported:1; | ||
111 | unsigned tlr_enabled:1; | ||
110 | /* parameters */ | 112 | /* parameters */ |
111 | u16 I_T_nexus_loss_timeout; | 113 | u16 I_T_nexus_loss_timeout; |
112 | u16 initiator_response_timeout; | 114 | u16 initiator_response_timeout; |
@@ -181,6 +183,11 @@ extern int sas_phy_add(struct sas_phy *); | |||
181 | extern void sas_phy_delete(struct sas_phy *); | 183 | extern void sas_phy_delete(struct sas_phy *); |
182 | extern int scsi_is_sas_phy(const struct device *); | 184 | extern int scsi_is_sas_phy(const struct device *); |
183 | 185 | ||
186 | unsigned int sas_tlr_supported(struct scsi_device *); | ||
187 | unsigned int sas_is_tlr_enabled(struct scsi_device *); | ||
188 | void sas_disable_tlr(struct scsi_device *); | ||
189 | void sas_enable_tlr(struct scsi_device *); | ||
190 | |||
184 | extern struct sas_rphy *sas_end_device_alloc(struct sas_port *); | 191 | extern struct sas_rphy *sas_end_device_alloc(struct sas_port *); |
185 | extern struct sas_rphy *sas_expander_alloc(struct sas_port *, enum sas_device_type); | 192 | extern struct sas_rphy *sas_expander_alloc(struct sas_port *, enum sas_device_type); |
186 | void sas_rphy_free(struct sas_rphy *); | 193 | void sas_rphy_free(struct sas_rphy *); |
diff --git a/include/trace/events/lock.h b/include/trace/events/lock.h index a870ba125aa8..5c1dcfc16c60 100644 --- a/include/trace/events/lock.h +++ b/include/trace/events/lock.h | |||
@@ -20,14 +20,17 @@ TRACE_EVENT(lock_acquire, | |||
20 | TP_STRUCT__entry( | 20 | TP_STRUCT__entry( |
21 | __field(unsigned int, flags) | 21 | __field(unsigned int, flags) |
22 | __string(name, lock->name) | 22 | __string(name, lock->name) |
23 | __field(void *, lockdep_addr) | ||
23 | ), | 24 | ), |
24 | 25 | ||
25 | TP_fast_assign( | 26 | TP_fast_assign( |
26 | __entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0); | 27 | __entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0); |
27 | __assign_str(name, lock->name); | 28 | __assign_str(name, lock->name); |
29 | __entry->lockdep_addr = lock; | ||
28 | ), | 30 | ), |
29 | 31 | ||
30 | TP_printk("%s%s%s", (__entry->flags & 1) ? "try " : "", | 32 | TP_printk("%p %s%s%s", __entry->lockdep_addr, |
33 | (__entry->flags & 1) ? "try " : "", | ||
31 | (__entry->flags & 2) ? "read " : "", | 34 | (__entry->flags & 2) ? "read " : "", |
32 | __get_str(name)) | 35 | __get_str(name)) |
33 | ); | 36 | ); |
@@ -40,13 +43,16 @@ TRACE_EVENT(lock_release, | |||
40 | 43 | ||
41 | TP_STRUCT__entry( | 44 | TP_STRUCT__entry( |
42 | __string(name, lock->name) | 45 | __string(name, lock->name) |
46 | __field(void *, lockdep_addr) | ||
43 | ), | 47 | ), |
44 | 48 | ||
45 | TP_fast_assign( | 49 | TP_fast_assign( |
46 | __assign_str(name, lock->name); | 50 | __assign_str(name, lock->name); |
51 | __entry->lockdep_addr = lock; | ||
47 | ), | 52 | ), |
48 | 53 | ||
49 | TP_printk("%s", __get_str(name)) | 54 | TP_printk("%p %s", |
55 | __entry->lockdep_addr, __get_str(name)) | ||
50 | ); | 56 | ); |
51 | 57 | ||
52 | #ifdef CONFIG_LOCK_STAT | 58 | #ifdef CONFIG_LOCK_STAT |
@@ -59,13 +65,16 @@ TRACE_EVENT(lock_contended, | |||
59 | 65 | ||
60 | TP_STRUCT__entry( | 66 | TP_STRUCT__entry( |
61 | __string(name, lock->name) | 67 | __string(name, lock->name) |
68 | __field(void *, lockdep_addr) | ||
62 | ), | 69 | ), |
63 | 70 | ||
64 | TP_fast_assign( | 71 | TP_fast_assign( |
65 | __assign_str(name, lock->name); | 72 | __assign_str(name, lock->name); |
73 | __entry->lockdep_addr = lock; | ||
66 | ), | 74 | ), |
67 | 75 | ||
68 | TP_printk("%s", __get_str(name)) | 76 | TP_printk("%p %s", |
77 | __entry->lockdep_addr, __get_str(name)) | ||
69 | ); | 78 | ); |
70 | 79 | ||
71 | TRACE_EVENT(lock_acquired, | 80 | TRACE_EVENT(lock_acquired, |
@@ -75,16 +84,18 @@ TRACE_EVENT(lock_acquired, | |||
75 | 84 | ||
76 | TP_STRUCT__entry( | 85 | TP_STRUCT__entry( |
77 | __string(name, lock->name) | 86 | __string(name, lock->name) |
78 | __field(unsigned long, wait_usec) | 87 | __field(s64, wait_nsec) |
79 | __field(unsigned long, wait_nsec_rem) | 88 | __field(void *, lockdep_addr) |
80 | ), | 89 | ), |
90 | |||
81 | TP_fast_assign( | 91 | TP_fast_assign( |
82 | __assign_str(name, lock->name); | 92 | __assign_str(name, lock->name); |
83 | __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC); | 93 | __entry->wait_nsec = waittime; |
84 | __entry->wait_usec = (unsigned long) waittime; | 94 | __entry->lockdep_addr = lock; |
85 | ), | 95 | ), |
86 | TP_printk("%s (%lu.%03lu us)", __get_str(name), __entry->wait_usec, | 96 | TP_printk("%p %s (%llu ns)", __entry->lockdep_addr, |
87 | __entry->wait_nsec_rem) | 97 | __get_str(name), |
98 | __entry->wait_nsec) | ||
88 | ); | 99 | ); |
89 | 100 | ||
90 | #endif | 101 | #endif |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 73523151a731..0804cd594803 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -65,7 +65,8 @@ | |||
65 | }; | 65 | }; |
66 | #undef DEFINE_EVENT | 66 | #undef DEFINE_EVENT |
67 | #define DEFINE_EVENT(template, name, proto, args) \ | 67 | #define DEFINE_EVENT(template, name, proto, args) \ |
68 | static struct ftrace_event_call event_##name | 68 | static struct ftrace_event_call \ |
69 | __attribute__((__aligned__(4))) event_##name | ||
69 | 70 | ||
70 | #undef DEFINE_EVENT_PRINT | 71 | #undef DEFINE_EVENT_PRINT |
71 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 72 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
@@ -131,130 +132,6 @@ | |||
131 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 132 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
132 | 133 | ||
133 | /* | 134 | /* |
134 | * Setup the showing format of trace point. | ||
135 | * | ||
136 | * int | ||
137 | * ftrace_format_##call(struct trace_seq *s) | ||
138 | * { | ||
139 | * struct ftrace_raw_##call field; | ||
140 | * int ret; | ||
141 | * | ||
142 | * ret = trace_seq_printf(s, #type " " #item ";" | ||
143 | * " offset:%u; size:%u;\n", | ||
144 | * offsetof(struct ftrace_raw_##call, item), | ||
145 | * sizeof(field.type)); | ||
146 | * | ||
147 | * } | ||
148 | */ | ||
149 | |||
150 | #undef TP_STRUCT__entry | ||
151 | #define TP_STRUCT__entry(args...) args | ||
152 | |||
153 | #undef __field | ||
154 | #define __field(type, item) \ | ||
155 | ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ | ||
156 | "offset:%u;\tsize:%u;\tsigned:%u;\n", \ | ||
157 | (unsigned int)offsetof(typeof(field), item), \ | ||
158 | (unsigned int)sizeof(field.item), \ | ||
159 | (unsigned int)is_signed_type(type)); \ | ||
160 | if (!ret) \ | ||
161 | return 0; | ||
162 | |||
163 | #undef __field_ext | ||
164 | #define __field_ext(type, item, filter_type) __field(type, item) | ||
165 | |||
166 | #undef __array | ||
167 | #define __array(type, item, len) \ | ||
168 | ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ | ||
169 | "offset:%u;\tsize:%u;\tsigned:%u;\n", \ | ||
170 | (unsigned int)offsetof(typeof(field), item), \ | ||
171 | (unsigned int)sizeof(field.item), \ | ||
172 | (unsigned int)is_signed_type(type)); \ | ||
173 | if (!ret) \ | ||
174 | return 0; | ||
175 | |||
176 | #undef __dynamic_array | ||
177 | #define __dynamic_array(type, item, len) \ | ||
178 | ret = trace_seq_printf(s, "\tfield:__data_loc " #type "[] " #item ";\t"\ | ||
179 | "offset:%u;\tsize:%u;\tsigned:%u;\n", \ | ||
180 | (unsigned int)offsetof(typeof(field), \ | ||
181 | __data_loc_##item), \ | ||
182 | (unsigned int)sizeof(field.__data_loc_##item), \ | ||
183 | (unsigned int)is_signed_type(type)); \ | ||
184 | if (!ret) \ | ||
185 | return 0; | ||
186 | |||
187 | #undef __string | ||
188 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
189 | |||
190 | #undef __entry | ||
191 | #define __entry REC | ||
192 | |||
193 | #undef __print_symbolic | ||
194 | #undef __get_dynamic_array | ||
195 | #undef __get_str | ||
196 | |||
197 | #undef TP_printk | ||
198 | #define TP_printk(fmt, args...) "\"%s\", %s\n", fmt, __stringify(args) | ||
199 | |||
200 | #undef TP_fast_assign | ||
201 | #define TP_fast_assign(args...) args | ||
202 | |||
203 | #undef TP_perf_assign | ||
204 | #define TP_perf_assign(args...) | ||
205 | |||
206 | #undef DECLARE_EVENT_CLASS | ||
207 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ | ||
208 | static int \ | ||
209 | ftrace_format_setup_##call(struct ftrace_event_call *unused, \ | ||
210 | struct trace_seq *s) \ | ||
211 | { \ | ||
212 | struct ftrace_raw_##call field __attribute__((unused)); \ | ||
213 | int ret = 0; \ | ||
214 | \ | ||
215 | tstruct; \ | ||
216 | \ | ||
217 | return ret; \ | ||
218 | } \ | ||
219 | \ | ||
220 | static int \ | ||
221 | ftrace_format_##call(struct ftrace_event_call *unused, \ | ||
222 | struct trace_seq *s) \ | ||
223 | { \ | ||
224 | int ret = 0; \ | ||
225 | \ | ||
226 | ret = ftrace_format_setup_##call(unused, s); \ | ||
227 | if (!ret) \ | ||
228 | return ret; \ | ||
229 | \ | ||
230 | ret = trace_seq_printf(s, "\nprint fmt: " print); \ | ||
231 | \ | ||
232 | return ret; \ | ||
233 | } | ||
234 | |||
235 | #undef DEFINE_EVENT | ||
236 | #define DEFINE_EVENT(template, name, proto, args) | ||
237 | |||
238 | #undef DEFINE_EVENT_PRINT | ||
239 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
240 | static int \ | ||
241 | ftrace_format_##name(struct ftrace_event_call *unused, \ | ||
242 | struct trace_seq *s) \ | ||
243 | { \ | ||
244 | int ret = 0; \ | ||
245 | \ | ||
246 | ret = ftrace_format_setup_##template(unused, s); \ | ||
247 | if (!ret) \ | ||
248 | return ret; \ | ||
249 | \ | ||
250 | trace_seq_printf(s, "\nprint fmt: " print); \ | ||
251 | \ | ||
252 | return ret; \ | ||
253 | } | ||
254 | |||
255 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
256 | |||
257 | /* | ||
258 | * Stage 3 of the trace events. | 135 | * Stage 3 of the trace events. |
259 | * | 136 | * |
260 | * Override the macros in <trace/trace_events.h> to include the following: | 137 | * Override the macros in <trace/trace_events.h> to include the following: |
@@ -323,7 +200,7 @@ ftrace_format_##name(struct ftrace_event_call *unused, \ | |||
323 | 200 | ||
324 | #undef DECLARE_EVENT_CLASS | 201 | #undef DECLARE_EVENT_CLASS |
325 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 202 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
326 | static enum print_line_t \ | 203 | static notrace enum print_line_t \ |
327 | ftrace_raw_output_id_##call(int event_id, const char *name, \ | 204 | ftrace_raw_output_id_##call(int event_id, const char *name, \ |
328 | struct trace_iterator *iter, int flags) \ | 205 | struct trace_iterator *iter, int flags) \ |
329 | { \ | 206 | { \ |
@@ -356,7 +233,7 @@ ftrace_raw_output_id_##call(int event_id, const char *name, \ | |||
356 | 233 | ||
357 | #undef DEFINE_EVENT | 234 | #undef DEFINE_EVENT |
358 | #define DEFINE_EVENT(template, name, proto, args) \ | 235 | #define DEFINE_EVENT(template, name, proto, args) \ |
359 | static enum print_line_t \ | 236 | static notrace enum print_line_t \ |
360 | ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \ | 237 | ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \ |
361 | { \ | 238 | { \ |
362 | return ftrace_raw_output_id_##template(event_##name.id, \ | 239 | return ftrace_raw_output_id_##template(event_##name.id, \ |
@@ -365,7 +242,7 @@ ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \ | |||
365 | 242 | ||
366 | #undef DEFINE_EVENT_PRINT | 243 | #undef DEFINE_EVENT_PRINT |
367 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | 244 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ |
368 | static enum print_line_t \ | 245 | static notrace enum print_line_t \ |
369 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | 246 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ |
370 | { \ | 247 | { \ |
371 | struct trace_seq *s = &iter->seq; \ | 248 | struct trace_seq *s = &iter->seq; \ |
@@ -414,7 +291,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
414 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | 291 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
415 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | 292 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ |
416 | offsetof(typeof(field), item), \ | 293 | offsetof(typeof(field), item), \ |
417 | sizeof(field.item), 0, FILTER_OTHER); \ | 294 | sizeof(field.item), \ |
295 | is_signed_type(type), FILTER_OTHER); \ | ||
418 | if (ret) \ | 296 | if (ret) \ |
419 | return ret; | 297 | return ret; |
420 | 298 | ||
@@ -422,15 +300,15 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
422 | #define __dynamic_array(type, item, len) \ | 300 | #define __dynamic_array(type, item, len) \ |
423 | ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ | 301 | ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ |
424 | offsetof(typeof(field), __data_loc_##item), \ | 302 | offsetof(typeof(field), __data_loc_##item), \ |
425 | sizeof(field.__data_loc_##item), 0, \ | 303 | sizeof(field.__data_loc_##item), \ |
426 | FILTER_OTHER); | 304 | is_signed_type(type), FILTER_OTHER); |
427 | 305 | ||
428 | #undef __string | 306 | #undef __string |
429 | #define __string(item, src) __dynamic_array(char, item, -1) | 307 | #define __string(item, src) __dynamic_array(char, item, -1) |
430 | 308 | ||
431 | #undef DECLARE_EVENT_CLASS | 309 | #undef DECLARE_EVENT_CLASS |
432 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ | 310 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ |
433 | static int \ | 311 | static int notrace \ |
434 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | 312 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ |
435 | { \ | 313 | { \ |
436 | struct ftrace_raw_##call field; \ | 314 | struct ftrace_raw_##call field; \ |
@@ -478,7 +356,7 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
478 | 356 | ||
479 | #undef DECLARE_EVENT_CLASS | 357 | #undef DECLARE_EVENT_CLASS |
480 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 358 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
481 | static inline int ftrace_get_offsets_##call( \ | 359 | static inline notrace int ftrace_get_offsets_##call( \ |
482 | struct ftrace_data_offsets_##call *__data_offsets, proto) \ | 360 | struct ftrace_data_offsets_##call *__data_offsets, proto) \ |
483 | { \ | 361 | { \ |
484 | int __data_size = 0; \ | 362 | int __data_size = 0; \ |
@@ -498,7 +376,7 @@ static inline int ftrace_get_offsets_##call( \ | |||
498 | 376 | ||
499 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 377 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
500 | 378 | ||
501 | #ifdef CONFIG_EVENT_PROFILE | 379 | #ifdef CONFIG_PERF_EVENTS |
502 | 380 | ||
503 | /* | 381 | /* |
504 | * Generate the functions needed for tracepoint perf_event support. | 382 | * Generate the functions needed for tracepoint perf_event support. |
@@ -525,12 +403,14 @@ static inline int ftrace_get_offsets_##call( \ | |||
525 | \ | 403 | \ |
526 | static void ftrace_profile_##name(proto); \ | 404 | static void ftrace_profile_##name(proto); \ |
527 | \ | 405 | \ |
528 | static int ftrace_profile_enable_##name(struct ftrace_event_call *unused)\ | 406 | static notrace int \ |
407 | ftrace_profile_enable_##name(struct ftrace_event_call *unused) \ | ||
529 | { \ | 408 | { \ |
530 | return register_trace_##name(ftrace_profile_##name); \ | 409 | return register_trace_##name(ftrace_profile_##name); \ |
531 | } \ | 410 | } \ |
532 | \ | 411 | \ |
533 | static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | 412 | static notrace void \ |
413 | ftrace_profile_disable_##name(struct ftrace_event_call *unused) \ | ||
534 | { \ | 414 | { \ |
535 | unregister_trace_##name(ftrace_profile_##name); \ | 415 | unregister_trace_##name(ftrace_profile_##name); \ |
536 | } | 416 | } |
@@ -541,7 +421,7 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
541 | 421 | ||
542 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 422 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
543 | 423 | ||
544 | #endif | 424 | #endif /* CONFIG_PERF_EVENTS */ |
545 | 425 | ||
546 | /* | 426 | /* |
547 | * Stage 4 of the trace events. | 427 | * Stage 4 of the trace events. |
@@ -621,12 +501,11 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
621 | * .raw_init = trace_event_raw_init, | 501 | * .raw_init = trace_event_raw_init, |
622 | * .regfunc = ftrace_reg_event_<call>, | 502 | * .regfunc = ftrace_reg_event_<call>, |
623 | * .unregfunc = ftrace_unreg_event_<call>, | 503 | * .unregfunc = ftrace_unreg_event_<call>, |
624 | * .show_format = ftrace_format_<call>, | ||
625 | * } | 504 | * } |
626 | * | 505 | * |
627 | */ | 506 | */ |
628 | 507 | ||
629 | #ifdef CONFIG_EVENT_PROFILE | 508 | #ifdef CONFIG_PERF_EVENTS |
630 | 509 | ||
631 | #define _TRACE_PROFILE_INIT(call) \ | 510 | #define _TRACE_PROFILE_INIT(call) \ |
632 | .profile_enable = ftrace_profile_enable_##call, \ | 511 | .profile_enable = ftrace_profile_enable_##call, \ |
@@ -634,7 +513,7 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
634 | 513 | ||
635 | #else | 514 | #else |
636 | #define _TRACE_PROFILE_INIT(call) | 515 | #define _TRACE_PROFILE_INIT(call) |
637 | #endif | 516 | #endif /* CONFIG_PERF_EVENTS */ |
638 | 517 | ||
639 | #undef __entry | 518 | #undef __entry |
640 | #define __entry entry | 519 | #define __entry entry |
@@ -656,10 +535,17 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
656 | #define __assign_str(dst, src) \ | 535 | #define __assign_str(dst, src) \ |
657 | strcpy(__get_str(dst), src); | 536 | strcpy(__get_str(dst), src); |
658 | 537 | ||
538 | #undef TP_fast_assign | ||
539 | #define TP_fast_assign(args...) args | ||
540 | |||
541 | #undef TP_perf_assign | ||
542 | #define TP_perf_assign(args...) | ||
543 | |||
659 | #undef DECLARE_EVENT_CLASS | 544 | #undef DECLARE_EVENT_CLASS |
660 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 545 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
661 | \ | 546 | \ |
662 | static void ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | 547 | static notrace void \ |
548 | ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | ||
663 | proto) \ | 549 | proto) \ |
664 | { \ | 550 | { \ |
665 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 551 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
@@ -696,17 +582,19 @@ static void ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | |||
696 | #undef DEFINE_EVENT | 582 | #undef DEFINE_EVENT |
697 | #define DEFINE_EVENT(template, call, proto, args) \ | 583 | #define DEFINE_EVENT(template, call, proto, args) \ |
698 | \ | 584 | \ |
699 | static void ftrace_raw_event_##call(proto) \ | 585 | static notrace void ftrace_raw_event_##call(proto) \ |
700 | { \ | 586 | { \ |
701 | ftrace_raw_event_id_##template(&event_##call, args); \ | 587 | ftrace_raw_event_id_##template(&event_##call, args); \ |
702 | } \ | 588 | } \ |
703 | \ | 589 | \ |
704 | static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ | 590 | static notrace int \ |
591 | ftrace_raw_reg_event_##call(struct ftrace_event_call *unused) \ | ||
705 | { \ | 592 | { \ |
706 | return register_trace_##call(ftrace_raw_event_##call); \ | 593 | return register_trace_##call(ftrace_raw_event_##call); \ |
707 | } \ | 594 | } \ |
708 | \ | 595 | \ |
709 | static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ | 596 | static notrace void \ |
597 | ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused) \ | ||
710 | { \ | 598 | { \ |
711 | unregister_trace_##call(ftrace_raw_event_##call); \ | 599 | unregister_trace_##call(ftrace_raw_event_##call); \ |
712 | } \ | 600 | } \ |
@@ -721,8 +609,20 @@ static struct trace_event ftrace_event_type_##call = { \ | |||
721 | 609 | ||
722 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 610 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
723 | 611 | ||
612 | #undef __entry | ||
613 | #define __entry REC | ||
614 | |||
615 | #undef __print_flags | ||
616 | #undef __print_symbolic | ||
617 | #undef __get_dynamic_array | ||
618 | #undef __get_str | ||
619 | |||
620 | #undef TP_printk | ||
621 | #define TP_printk(fmt, args...) "\"" fmt "\", " __stringify(args) | ||
622 | |||
724 | #undef DECLARE_EVENT_CLASS | 623 | #undef DECLARE_EVENT_CLASS |
725 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) | 624 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
625 | static const char print_fmt_##call[] = print; | ||
726 | 626 | ||
727 | #undef DEFINE_EVENT | 627 | #undef DEFINE_EVENT |
728 | #define DEFINE_EVENT(template, call, proto, args) \ | 628 | #define DEFINE_EVENT(template, call, proto, args) \ |
@@ -736,7 +636,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
736 | .raw_init = trace_event_raw_init, \ | 636 | .raw_init = trace_event_raw_init, \ |
737 | .regfunc = ftrace_raw_reg_event_##call, \ | 637 | .regfunc = ftrace_raw_reg_event_##call, \ |
738 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 638 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
739 | .show_format = ftrace_format_##template, \ | 639 | .print_fmt = print_fmt_##template, \ |
740 | .define_fields = ftrace_define_fields_##template, \ | 640 | .define_fields = ftrace_define_fields_##template, \ |
741 | _TRACE_PROFILE_INIT(call) \ | 641 | _TRACE_PROFILE_INIT(call) \ |
742 | } | 642 | } |
@@ -744,6 +644,8 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
744 | #undef DEFINE_EVENT_PRINT | 644 | #undef DEFINE_EVENT_PRINT |
745 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | 645 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ |
746 | \ | 646 | \ |
647 | static const char print_fmt_##call[] = print; \ | ||
648 | \ | ||
747 | static struct ftrace_event_call __used \ | 649 | static struct ftrace_event_call __used \ |
748 | __attribute__((__aligned__(4))) \ | 650 | __attribute__((__aligned__(4))) \ |
749 | __attribute__((section("_ftrace_events"))) event_##call = { \ | 651 | __attribute__((section("_ftrace_events"))) event_##call = { \ |
@@ -753,7 +655,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
753 | .raw_init = trace_event_raw_init, \ | 655 | .raw_init = trace_event_raw_init, \ |
754 | .regfunc = ftrace_raw_reg_event_##call, \ | 656 | .regfunc = ftrace_raw_reg_event_##call, \ |
755 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 657 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
756 | .show_format = ftrace_format_##call, \ | 658 | .print_fmt = print_fmt_##call, \ |
757 | .define_fields = ftrace_define_fields_##template, \ | 659 | .define_fields = ftrace_define_fields_##template, \ |
758 | _TRACE_PROFILE_INIT(call) \ | 660 | _TRACE_PROFILE_INIT(call) \ |
759 | } | 661 | } |
@@ -834,7 +736,17 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
834 | * } | 736 | * } |
835 | */ | 737 | */ |
836 | 738 | ||
837 | #ifdef CONFIG_EVENT_PROFILE | 739 | #ifdef CONFIG_PERF_EVENTS |
740 | |||
741 | #undef __entry | ||
742 | #define __entry entry | ||
743 | |||
744 | #undef __get_dynamic_array | ||
745 | #define __get_dynamic_array(field) \ | ||
746 | ((void *)__entry + (__entry->__data_loc_##field & 0xffff)) | ||
747 | |||
748 | #undef __get_str | ||
749 | #define __get_str(field) (char *)__get_dynamic_array(field) | ||
838 | 750 | ||
839 | #undef __perf_addr | 751 | #undef __perf_addr |
840 | #define __perf_addr(a) __addr = (a) | 752 | #define __perf_addr(a) __addr = (a) |
@@ -844,27 +756,17 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
844 | 756 | ||
845 | #undef DECLARE_EVENT_CLASS | 757 | #undef DECLARE_EVENT_CLASS |
846 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 758 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
847 | static void \ | 759 | static notrace void \ |
848 | ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ | 760 | ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ |
849 | proto) \ | 761 | proto) \ |
850 | { \ | 762 | { \ |
851 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 763 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
852 | extern int perf_swevent_get_recursion_context(void); \ | ||
853 | extern void perf_swevent_put_recursion_context(int rctx); \ | ||
854 | extern void perf_tp_event(int, u64, u64, void *, int); \ | ||
855 | struct ftrace_raw_##call *entry; \ | 764 | struct ftrace_raw_##call *entry; \ |
856 | u64 __addr = 0, __count = 1; \ | 765 | u64 __addr = 0, __count = 1; \ |
857 | unsigned long irq_flags; \ | 766 | unsigned long irq_flags; \ |
858 | struct trace_entry *ent; \ | ||
859 | int __entry_size; \ | 767 | int __entry_size; \ |
860 | int __data_size; \ | 768 | int __data_size; \ |
861 | char *trace_buf; \ | ||
862 | char *raw_data; \ | ||
863 | int __cpu; \ | ||
864 | int rctx; \ | 769 | int rctx; \ |
865 | int pc; \ | ||
866 | \ | ||
867 | pc = preempt_count(); \ | ||
868 | \ | 770 | \ |
869 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | 771 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
870 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ | 772 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ |
@@ -874,47 +776,21 @@ ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ | |||
874 | if (WARN_ONCE(__entry_size > FTRACE_MAX_PROFILE_SIZE, \ | 776 | if (WARN_ONCE(__entry_size > FTRACE_MAX_PROFILE_SIZE, \ |
875 | "profile buffer not large enough")) \ | 777 | "profile buffer not large enough")) \ |
876 | return; \ | 778 | return; \ |
877 | \ | 779 | entry = (struct ftrace_raw_##call *)ftrace_perf_buf_prepare( \ |
878 | local_irq_save(irq_flags); \ | 780 | __entry_size, event_call->id, &rctx, &irq_flags); \ |
879 | \ | 781 | if (!entry) \ |
880 | rctx = perf_swevent_get_recursion_context(); \ | 782 | return; \ |
881 | if (rctx < 0) \ | ||
882 | goto end_recursion; \ | ||
883 | \ | ||
884 | __cpu = smp_processor_id(); \ | ||
885 | \ | ||
886 | if (in_nmi()) \ | ||
887 | trace_buf = rcu_dereference(perf_trace_buf_nmi); \ | ||
888 | else \ | ||
889 | trace_buf = rcu_dereference(perf_trace_buf); \ | ||
890 | \ | ||
891 | if (!trace_buf) \ | ||
892 | goto end; \ | ||
893 | \ | ||
894 | raw_data = per_cpu_ptr(trace_buf, __cpu); \ | ||
895 | \ | ||
896 | *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \ | ||
897 | entry = (struct ftrace_raw_##call *)raw_data; \ | ||
898 | ent = &entry->ent; \ | ||
899 | tracing_generic_entry_update(ent, irq_flags, pc); \ | ||
900 | ent->type = event_call->id; \ | ||
901 | \ | ||
902 | tstruct \ | 783 | tstruct \ |
903 | \ | 784 | \ |
904 | { assign; } \ | 785 | { assign; } \ |
905 | \ | 786 | \ |
906 | perf_tp_event(event_call->id, __addr, __count, entry, \ | 787 | ftrace_perf_buf_submit(entry, __entry_size, rctx, __addr, \ |
907 | __entry_size); \ | 788 | __count, irq_flags); \ |
908 | \ | ||
909 | end: \ | ||
910 | perf_swevent_put_recursion_context(rctx); \ | ||
911 | end_recursion: \ | ||
912 | local_irq_restore(irq_flags); \ | ||
913 | } | 789 | } |
914 | 790 | ||
915 | #undef DEFINE_EVENT | 791 | #undef DEFINE_EVENT |
916 | #define DEFINE_EVENT(template, call, proto, args) \ | 792 | #define DEFINE_EVENT(template, call, proto, args) \ |
917 | static void ftrace_profile_##call(proto) \ | 793 | static notrace void ftrace_profile_##call(proto) \ |
918 | { \ | 794 | { \ |
919 | struct ftrace_event_call *event_call = &event_##call; \ | 795 | struct ftrace_event_call *event_call = &event_##call; \ |
920 | \ | 796 | \ |
@@ -926,7 +802,7 @@ static void ftrace_profile_##call(proto) \ | |||
926 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | 802 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) |
927 | 803 | ||
928 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 804 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
929 | #endif /* CONFIG_EVENT_PROFILE */ | 805 | #endif /* CONFIG_PERF_EVENTS */ |
930 | 806 | ||
931 | #undef _TRACE_PROFILE_INIT | 807 | #undef _TRACE_PROFILE_INIT |
932 | 808 | ||
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index 961fda3556bb..0387100752f0 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
@@ -34,10 +34,6 @@ struct syscall_metadata { | |||
34 | extern unsigned long arch_syscall_addr(int nr); | 34 | extern unsigned long arch_syscall_addr(int nr); |
35 | extern int init_syscall_trace(struct ftrace_event_call *call); | 35 | extern int init_syscall_trace(struct ftrace_event_call *call); |
36 | 36 | ||
37 | extern int syscall_enter_format(struct ftrace_event_call *call, | ||
38 | struct trace_seq *s); | ||
39 | extern int syscall_exit_format(struct ftrace_event_call *call, | ||
40 | struct trace_seq *s); | ||
41 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); | 37 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); |
42 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); | 38 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); |
43 | extern int reg_event_syscall_enter(struct ftrace_event_call *call); | 39 | extern int reg_event_syscall_enter(struct ftrace_event_call *call); |
@@ -49,12 +45,12 @@ ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s); | |||
49 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); | 45 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); |
50 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); | 46 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); |
51 | #endif | 47 | #endif |
52 | #ifdef CONFIG_EVENT_PROFILE | 48 | |
49 | #ifdef CONFIG_PERF_EVENTS | ||
53 | int prof_sysenter_enable(struct ftrace_event_call *call); | 50 | int prof_sysenter_enable(struct ftrace_event_call *call); |
54 | void prof_sysenter_disable(struct ftrace_event_call *call); | 51 | void prof_sysenter_disable(struct ftrace_event_call *call); |
55 | int prof_sysexit_enable(struct ftrace_event_call *call); | 52 | int prof_sysexit_enable(struct ftrace_event_call *call); |
56 | void prof_sysexit_disable(struct ftrace_event_call *call); | 53 | void prof_sysexit_disable(struct ftrace_event_call *call); |
57 | |||
58 | #endif | 54 | #endif |
59 | 55 | ||
60 | #endif /* _TRACE_SYSCALL_H */ | 56 | #endif /* _TRACE_SYSCALL_H */ |
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 288205457713..2cc893fc1f85 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
@@ -34,6 +34,8 @@ enum { LCDC_CLK_BUS, LCDC_CLK_PERIPHERAL, LCDC_CLK_EXTERNAL }; | |||
34 | #define LCDC_FLAGS_HSCNT (1 << 3) /* Disable HSYNC during VBLANK */ | 34 | #define LCDC_FLAGS_HSCNT (1 << 3) /* Disable HSYNC during VBLANK */ |
35 | #define LCDC_FLAGS_DWCNT (1 << 4) /* Disable dotclock during blanking */ | 35 | #define LCDC_FLAGS_DWCNT (1 << 4) /* Disable dotclock during blanking */ |
36 | 36 | ||
37 | #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) | ||
38 | |||
37 | struct sh_mobile_lcdc_sys_bus_cfg { | 39 | struct sh_mobile_lcdc_sys_bus_cfg { |
38 | unsigned long ldmt2r; | 40 | unsigned long ldmt2r; |
39 | unsigned long ldmt3r; | 41 | unsigned long ldmt3r; |