diff options
Diffstat (limited to 'include')
50 files changed, 999 insertions, 290 deletions
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index c637b75b9f3f..cd77aa75c962 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
@@ -119,7 +119,7 @@ struct acpi_whea_header { | |||
119 | struct acpi_table_bert { | 119 | struct acpi_table_bert { |
120 | struct acpi_table_header header; /* Common ACPI table header */ | 120 | struct acpi_table_header header; /* Common ACPI table header */ |
121 | u32 region_length; /* Length of the boot error region */ | 121 | u32 region_length; /* Length of the boot error region */ |
122 | u64 address; /* Physical addresss of the error region */ | 122 | u64 address; /* Physical address of the error region */ |
123 | }; | 123 | }; |
124 | 124 | ||
125 | /* Boot Error Region (not a subtable, pointed to by Address field above) */ | 125 | /* Boot Error Region (not a subtable, pointed to by Address field above) */ |
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index ff5c66080c8c..6098cae2af8e 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -147,11 +147,11 @@ extern struct gpio_chip *gpiochip_find(void *data, | |||
147 | /* Always use the library code for GPIO management calls, | 147 | /* Always use the library code for GPIO management calls, |
148 | * or when sleeping may be involved. | 148 | * or when sleeping may be involved. |
149 | */ | 149 | */ |
150 | extern int gpio_request(unsigned gpio, const char *label); | 150 | extern int __must_check gpio_request(unsigned gpio, const char *label); |
151 | extern void gpio_free(unsigned gpio); | 151 | extern void gpio_free(unsigned gpio); |
152 | 152 | ||
153 | extern int gpio_direction_input(unsigned gpio); | 153 | extern int __must_check gpio_direction_input(unsigned gpio); |
154 | extern int gpio_direction_output(unsigned gpio, int value); | 154 | extern int __must_check gpio_direction_output(unsigned gpio, int value); |
155 | 155 | ||
156 | extern int gpio_set_debounce(unsigned gpio, unsigned debounce); | 156 | extern int gpio_set_debounce(unsigned gpio, unsigned debounce); |
157 | 157 | ||
@@ -192,8 +192,8 @@ struct gpio { | |||
192 | const char *label; | 192 | const char *label; |
193 | }; | 193 | }; |
194 | 194 | ||
195 | extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); | 195 | extern int __must_check gpio_request_one(unsigned gpio, unsigned long flags, const char *label); |
196 | extern int gpio_request_array(struct gpio *array, size_t num); | 196 | extern int __must_check gpio_request_array(struct gpio *array, size_t num); |
197 | extern void gpio_free_array(struct gpio *array, size_t num); | 197 | extern void gpio_free_array(struct gpio *array, size_t num); |
198 | 198 | ||
199 | #ifdef CONFIG_GPIO_SYSFS | 199 | #ifdef CONFIG_GPIO_SYSFS |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 05cbad03c5ab..68649336c4ad 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -200,7 +200,8 @@ | |||
200 | 200 | ||
201 | #define READ_MOSTLY_DATA(align) \ | 201 | #define READ_MOSTLY_DATA(align) \ |
202 | . = ALIGN(align); \ | 202 | . = ALIGN(align); \ |
203 | *(.data..read_mostly) | 203 | *(.data..read_mostly) \ |
204 | . = ALIGN(align); | ||
204 | 205 | ||
205 | #define CACHELINE_ALIGNED_DATA(align) \ | 206 | #define CACHELINE_ALIGNED_DATA(align) \ |
206 | . = ALIGN(align); \ | 207 | . = ALIGN(align); \ |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 64a7114a9394..c3d6512eded1 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -25,7 +25,7 @@ struct pt_regs; | |||
25 | /* | 25 | /* |
26 | * This structure is used to hold the arguments that are used when loading binaries. | 26 | * This structure is used to hold the arguments that are used when loading binaries. |
27 | */ | 27 | */ |
28 | struct linux_binprm{ | 28 | struct linux_binprm { |
29 | char buf[BINPRM_BUF_SIZE]; | 29 | char buf[BINPRM_BUF_SIZE]; |
30 | #ifdef CONFIG_MMU | 30 | #ifdef CONFIG_MMU |
31 | struct vm_area_struct *vma; | 31 | struct vm_area_struct *vma; |
@@ -93,7 +93,6 @@ struct linux_binfmt { | |||
93 | int (*load_shlib)(struct file *); | 93 | int (*load_shlib)(struct file *); |
94 | int (*core_dump)(struct coredump_params *cprm); | 94 | int (*core_dump)(struct coredump_params *cprm); |
95 | unsigned long min_coredump; /* minimal dump size */ | 95 | unsigned long min_coredump; /* minimal dump size */ |
96 | int hasvdso; | ||
97 | }; | 96 | }; |
98 | 97 | ||
99 | extern int __register_binfmt(struct linux_binfmt *fmt, int insert); | 98 | extern int __register_binfmt(struct linux_binfmt *fmt, int insert); |
@@ -113,7 +112,7 @@ extern void unregister_binfmt(struct linux_binfmt *); | |||
113 | 112 | ||
114 | extern int prepare_binprm(struct linux_binprm *); | 113 | extern int prepare_binprm(struct linux_binprm *); |
115 | extern int __must_check remove_arg_zero(struct linux_binprm *); | 114 | extern int __must_check remove_arg_zero(struct linux_binprm *); |
116 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); | 115 | extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); |
117 | extern int flush_old_exec(struct linux_binprm * bprm); | 116 | extern int flush_old_exec(struct linux_binprm * bprm); |
118 | extern void setup_new_exec(struct linux_binprm * bprm); | 117 | extern void setup_new_exec(struct linux_binprm * bprm); |
119 | 118 | ||
diff --git a/include/linux/cdev.h b/include/linux/cdev.h index f389e319a454..fb4591977b03 100644 --- a/include/linux/cdev.h +++ b/include/linux/cdev.h | |||
@@ -28,8 +28,6 @@ int cdev_add(struct cdev *, dev_t, unsigned); | |||
28 | 28 | ||
29 | void cdev_del(struct cdev *); | 29 | void cdev_del(struct cdev *); |
30 | 30 | ||
31 | int cdev_index(struct inode *inode); | ||
32 | |||
33 | void cd_forget(struct inode *); | 31 | void cd_forget(struct inode *); |
34 | 32 | ||
35 | extern struct backing_dev_info directly_mappable_cdev_bdi; | 33 | extern struct backing_dev_info directly_mappable_cdev_bdi; |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ed4ba111bc8d..ce104e33cd22 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -564,7 +564,7 @@ struct cgroup_iter { | |||
564 | /* | 564 | /* |
565 | * To iterate across the tasks in a cgroup: | 565 | * To iterate across the tasks in a cgroup: |
566 | * | 566 | * |
567 | * 1) call cgroup_iter_start to intialize an iterator | 567 | * 1) call cgroup_iter_start to initialize an iterator |
568 | * | 568 | * |
569 | * 2) call cgroup_iter_next() to retrieve member tasks until it | 569 | * 2) call cgroup_iter_next() to retrieve member tasks until it |
570 | * returns NULL or until you want to end the iteration | 570 | * returns NULL or until you want to end the iteration |
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h index 6fc2bed368b8..0e7bf272ec2f 100644 --- a/include/linux/cramfs_fs.h +++ b/include/linux/cramfs_fs.h | |||
@@ -84,9 +84,11 @@ struct cramfs_super { | |||
84 | | CRAMFS_FLAG_WRONG_SIGNATURE \ | 84 | | CRAMFS_FLAG_WRONG_SIGNATURE \ |
85 | | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET ) | 85 | | CRAMFS_FLAG_SHIFTED_ROOT_OFFSET ) |
86 | 86 | ||
87 | #ifdef __KERNEL__ | ||
87 | /* Uncompression interfaces to the underlying zlib */ | 88 | /* Uncompression interfaces to the underlying zlib */ |
88 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); | 89 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); |
89 | int cramfs_uncompress_init(void); | 90 | int cramfs_uncompress_init(void); |
90 | void cramfs_uncompress_exit(void); | 91 | void cramfs_uncompress_exit(void); |
92 | #endif /* __KERNEL__ */ | ||
91 | 93 | ||
92 | #endif | 94 | #endif |
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h index d5a1d4810b80..6fe2114f8ad2 100644 --- a/include/linux/cs5535.h +++ b/include/linux/cs5535.h | |||
@@ -103,14 +103,20 @@ static inline int cs5535_has_vsa2(void) | |||
103 | #define GPIO_POSITIVE_EDGE_STS 0x48 | 103 | #define GPIO_POSITIVE_EDGE_STS 0x48 |
104 | #define GPIO_NEGATIVE_EDGE_STS 0x4C | 104 | #define GPIO_NEGATIVE_EDGE_STS 0x4C |
105 | 105 | ||
106 | #define GPIO_FLTR7_AMOUNT 0xD8 | ||
107 | |||
106 | #define GPIO_MAP_X 0xE0 | 108 | #define GPIO_MAP_X 0xE0 |
107 | #define GPIO_MAP_Y 0xE4 | 109 | #define GPIO_MAP_Y 0xE4 |
108 | #define GPIO_MAP_Z 0xE8 | 110 | #define GPIO_MAP_Z 0xE8 |
109 | #define GPIO_MAP_W 0xEC | 111 | #define GPIO_MAP_W 0xEC |
110 | 112 | ||
113 | #define GPIO_FE7_SEL 0xF7 | ||
114 | |||
111 | void cs5535_gpio_set(unsigned offset, unsigned int reg); | 115 | void cs5535_gpio_set(unsigned offset, unsigned int reg); |
112 | void cs5535_gpio_clear(unsigned offset, unsigned int reg); | 116 | void cs5535_gpio_clear(unsigned offset, unsigned int reg); |
113 | int cs5535_gpio_isset(unsigned offset, unsigned int reg); | 117 | int cs5535_gpio_isset(unsigned offset, unsigned int reg); |
118 | int cs5535_gpio_set_irq(unsigned group, unsigned irq); | ||
119 | void cs5535_gpio_setup_event(unsigned offset, int pair, int pme); | ||
114 | 120 | ||
115 | /* MFGPTs */ | 121 | /* MFGPTs */ |
116 | 122 | ||
diff --git a/include/linux/decompress/inflate.h b/include/linux/decompress/inflate.h index f9b06ccc3e5c..8c0aef1ba5f5 100644 --- a/include/linux/decompress/inflate.h +++ b/include/linux/decompress/inflate.h | |||
@@ -1,9 +1,6 @@ | |||
1 | #ifndef INFLATE_H | 1 | #ifndef INFLATE_H |
2 | #define INFLATE_H | 2 | #define INFLATE_H |
3 | 3 | ||
4 | /* Other housekeeping constants */ | ||
5 | #define INBUFSIZ 4096 | ||
6 | |||
7 | int gunzip(unsigned char *inbuf, int len, | 4 | int gunzip(unsigned char *inbuf, int len, |
8 | int(*fill)(void*, unsigned int), | 5 | int(*fill)(void*, unsigned int), |
9 | int(*flush)(void*, unsigned int), | 6 | int(*flush)(void*, unsigned int), |
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index ad5ec1d0475e..4cb72b920c74 100644 --- a/include/linux/decompress/mm.h +++ b/include/linux/decompress/mm.h | |||
@@ -61,8 +61,6 @@ static void free(void *where) | |||
61 | #define large_malloc(a) malloc(a) | 61 | #define large_malloc(a) malloc(a) |
62 | #define large_free(a) free(a) | 62 | #define large_free(a) free(a) |
63 | 63 | ||
64 | #define set_error_fn(x) | ||
65 | |||
66 | #define INIT | 64 | #define INIT |
67 | 65 | ||
68 | #else /* STATIC */ | 66 | #else /* STATIC */ |
@@ -72,6 +70,7 @@ static void free(void *where) | |||
72 | #include <linux/kernel.h> | 70 | #include <linux/kernel.h> |
73 | #include <linux/fs.h> | 71 | #include <linux/fs.h> |
74 | #include <linux/string.h> | 72 | #include <linux/string.h> |
73 | #include <linux/slab.h> | ||
75 | #include <linux/vmalloc.h> | 74 | #include <linux/vmalloc.h> |
76 | 75 | ||
77 | /* Use defines rather than static inline in order to avoid spurious | 76 | /* Use defines rather than static inline in order to avoid spurious |
@@ -84,9 +83,6 @@ static void free(void *where) | |||
84 | #define large_malloc(a) vmalloc(a) | 83 | #define large_malloc(a) vmalloc(a) |
85 | #define large_free(a) vfree(a) | 84 | #define large_free(a) vfree(a) |
86 | 85 | ||
87 | static void(*error)(char *m); | ||
88 | #define set_error_fn(x) error = x; | ||
89 | |||
90 | #define INIT __init | 86 | #define INIT __init |
91 | #define STATIC | 87 | #define STATIC |
92 | 88 | ||
diff --git a/include/linux/decompress/unxz.h b/include/linux/decompress/unxz.h new file mode 100644 index 000000000000..41728fc6c8a1 --- /dev/null +++ b/include/linux/decompress/unxz.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd | ||
3 | * | ||
4 | * Author: Lasse Collin <lasse.collin@tukaani.org> | ||
5 | * | ||
6 | * This file has been put into the public domain. | ||
7 | * You can do whatever you want with this file. | ||
8 | */ | ||
9 | |||
10 | #ifndef DECOMPRESS_UNXZ_H | ||
11 | #define DECOMPRESS_UNXZ_H | ||
12 | |||
13 | int unxz(unsigned char *in, int in_size, | ||
14 | int (*fill)(void *dest, unsigned int size), | ||
15 | int (*flush)(void *src, unsigned int size), | ||
16 | unsigned char *out, int *in_used, | ||
17 | void (*error)(char *x)); | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index 68c642d8843d..59ea406be7f6 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -273,7 +273,7 @@ struct fw_cdev_event_iso_interrupt { | |||
273 | * @closure: See &fw_cdev_event_common; | 273 | * @closure: See &fw_cdev_event_common; |
274 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl | 274 | * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl |
275 | * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL | 275 | * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL |
276 | * @completed: Offset into the receive buffer; data before this offest is valid | 276 | * @completed: Offset into the receive buffer; data before this offset is valid |
277 | * | 277 | * |
278 | * This event is sent in multichannel contexts (context type | 278 | * This event is sent in multichannel contexts (context type |
279 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer | 279 | * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL) for &fw_cdev_iso_packet buffer |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index e41f7dd1ae67..f79d67f413e4 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | 14 | ||
15 | struct device; | 15 | struct device; |
16 | struct gpio; | ||
16 | struct gpio_chip; | 17 | struct gpio_chip; |
17 | 18 | ||
18 | /* | 19 | /* |
@@ -29,7 +30,18 @@ static inline int gpio_is_valid(int number) | |||
29 | return 0; | 30 | return 0; |
30 | } | 31 | } |
31 | 32 | ||
32 | static inline int gpio_request(unsigned gpio, const char *label) | 33 | static inline int __must_check gpio_request(unsigned gpio, const char *label) |
34 | { | ||
35 | return -ENOSYS; | ||
36 | } | ||
37 | |||
38 | static inline int __must_check gpio_request_one(unsigned gpio, | ||
39 | unsigned long flags, const char *label) | ||
40 | { | ||
41 | return -ENOSYS; | ||
42 | } | ||
43 | |||
44 | static inline int __must_check gpio_request_array(struct gpio *array, size_t num) | ||
33 | { | 45 | { |
34 | return -ENOSYS; | 46 | return -ENOSYS; |
35 | } | 47 | } |
@@ -42,12 +54,20 @@ static inline void gpio_free(unsigned gpio) | |||
42 | WARN_ON(1); | 54 | WARN_ON(1); |
43 | } | 55 | } |
44 | 56 | ||
45 | static inline int gpio_direction_input(unsigned gpio) | 57 | static inline void gpio_free_array(struct gpio *array, size_t num) |
58 | { | ||
59 | might_sleep(); | ||
60 | |||
61 | /* GPIO can never have been requested */ | ||
62 | WARN_ON(1); | ||
63 | } | ||
64 | |||
65 | static inline int __must_check gpio_direction_input(unsigned gpio) | ||
46 | { | 66 | { |
47 | return -ENOSYS; | 67 | return -ENOSYS; |
48 | } | 68 | } |
49 | 69 | ||
50 | static inline int gpio_direction_output(unsigned gpio, int value) | 70 | static inline int __must_check gpio_direction_output(unsigned gpio, int value) |
51 | { | 71 | { |
52 | return -ENOSYS; | 72 | return -ENOSYS; |
53 | } | 73 | } |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 20b9801f669b..d91c25e253c8 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -402,7 +402,7 @@ struct hid_field { | |||
402 | __u16 dpad; /* dpad input code */ | 402 | __u16 dpad; /* dpad input code */ |
403 | }; | 403 | }; |
404 | 404 | ||
405 | #define HID_MAX_FIELDS 64 | 405 | #define HID_MAX_FIELDS 128 |
406 | 406 | ||
407 | struct hid_report { | 407 | struct hid_report { |
408 | struct list_head list; | 408 | struct list_head list; |
@@ -593,6 +593,7 @@ struct hid_usage_id { | |||
593 | * @report_fixup: called before report descriptor parsing (NULL means nop) | 593 | * @report_fixup: called before report descriptor parsing (NULL means nop) |
594 | * @input_mapping: invoked on input registering before mapping an usage | 594 | * @input_mapping: invoked on input registering before mapping an usage |
595 | * @input_mapped: invoked on input registering after mapping an usage | 595 | * @input_mapped: invoked on input registering after mapping an usage |
596 | * @feature_mapping: invoked on feature registering | ||
596 | * @suspend: invoked on suspend (NULL means nop) | 597 | * @suspend: invoked on suspend (NULL means nop) |
597 | * @resume: invoked on resume if device was not reset (NULL means nop) | 598 | * @resume: invoked on resume if device was not reset (NULL means nop) |
598 | * @reset_resume: invoked on resume if device was reset (NULL means nop) | 599 | * @reset_resume: invoked on resume if device was reset (NULL means nop) |
@@ -636,6 +637,9 @@ struct hid_driver { | |||
636 | int (*input_mapped)(struct hid_device *hdev, | 637 | int (*input_mapped)(struct hid_device *hdev, |
637 | struct hid_input *hidinput, struct hid_field *field, | 638 | struct hid_input *hidinput, struct hid_field *field, |
638 | struct hid_usage *usage, unsigned long **bit, int *max); | 639 | struct hid_usage *usage, unsigned long **bit, int *max); |
640 | void (*feature_mapping)(struct hid_device *hdev, | ||
641 | struct hid_input *hidinput, struct hid_field *field, | ||
642 | struct hid_usage *usage); | ||
639 | #ifdef CONFIG_PM | 643 | #ifdef CONFIG_PM |
640 | int (*suspend)(struct hid_device *hdev, pm_message_t message); | 644 | int (*suspend)(struct hid_device *hdev, pm_message_t message); |
641 | int (*resume)(struct hid_device *hdev); | 645 | int (*resume)(struct hid_device *hdev); |
diff --git a/include/linux/input.h b/include/linux/input.h index c4e9d91ec979..e428382ca28a 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -802,6 +802,7 @@ struct input_keymap_entry { | |||
802 | #define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ | 802 | #define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ |
803 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ | 803 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ |
804 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ | 804 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ |
805 | #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ | ||
805 | #define SW_MAX 0x0f | 806 | #define SW_MAX 0x0f |
806 | #define SW_CNT (SW_MAX+1) | 807 | #define SW_CNT (SW_MAX+1) |
807 | 808 | ||
diff --git a/include/linux/input/as5011.h b/include/linux/input/as5011.h new file mode 100644 index 000000000000..1affd0ddfa9d --- /dev/null +++ b/include/linux/input/as5011.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _AS5011_H | ||
2 | #define _AS5011_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (c) 2010, 2011 Fabien Marteau <fabien.marteau@armadeus.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | struct as5011_platform_data { | ||
13 | unsigned int button_gpio; | ||
14 | unsigned int axis_irq; /* irq number */ | ||
15 | unsigned long axis_irqflags; | ||
16 | char xp, xn; /* threshold for x axis */ | ||
17 | char yp, yn; /* threshold for y axis */ | ||
18 | }; | ||
19 | |||
20 | #endif /* _AS5011_H */ | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d0fbc043de60..57dac7022b63 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -143,9 +143,22 @@ extern int _cond_resched(void); | |||
143 | 143 | ||
144 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) | 144 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) |
145 | 145 | ||
146 | #define abs(x) ({ \ | 146 | /* |
147 | long __x = (x); \ | 147 | * abs() handles unsigned and signed longs, ints, shorts and chars. For all |
148 | (__x < 0) ? -__x : __x; \ | 148 | * input types abs() returns a signed long. |
149 | * abs() should not be used for 64-bit types (s64, u64, long long) - use abs64() | ||
150 | * for those. | ||
151 | */ | ||
152 | #define abs(x) ({ \ | ||
153 | long ret; \ | ||
154 | if (sizeof(x) == sizeof(long)) { \ | ||
155 | long __x = (x); \ | ||
156 | ret = (__x < 0) ? -__x : __x; \ | ||
157 | } else { \ | ||
158 | int __x = (x); \ | ||
159 | ret = (__x < 0) ? -__x : __x; \ | ||
160 | } \ | ||
161 | ret; \ | ||
149 | }) | 162 | }) |
150 | 163 | ||
151 | #define abs64(x) ({ \ | 164 | #define abs64(x) ({ \ |
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h index 24b44145a886..2a0d7d651dc3 100644 --- a/include/linux/kmsg_dump.h +++ b/include/linux/kmsg_dump.h | |||
@@ -18,6 +18,10 @@ 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 | KMSG_DUMP_KEXEC, |
21 | KMSG_DUMP_RESTART, | ||
22 | KMSG_DUMP_HALT, | ||
23 | KMSG_DUMP_POWEROFF, | ||
24 | KMSG_DUMP_EMERG, | ||
21 | }; | 25 | }; |
22 | 26 | ||
23 | /** | 27 | /** |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 919ae53adc5c..ea2dc1a2e13d 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -540,6 +540,7 @@ struct kvm_ppc_pvinfo { | |||
540 | #endif | 540 | #endif |
541 | #define KVM_CAP_PPC_GET_PVINFO 57 | 541 | #define KVM_CAP_PPC_GET_PVINFO 57 |
542 | #define KVM_CAP_PPC_IRQ_LEVEL 58 | 542 | #define KVM_CAP_PPC_IRQ_LEVEL 58 |
543 | #define KVM_CAP_ASYNC_PF 59 | ||
543 | 544 | ||
544 | #ifdef KVM_CAP_IRQ_ROUTING | 545 | #ifdef KVM_CAP_IRQ_ROUTING |
545 | 546 | ||
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a0557422715e..b5021db21858 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | #include <linux/preempt.h> | 17 | #include <linux/preempt.h> |
18 | #include <linux/msi.h> | 18 | #include <linux/msi.h> |
19 | #include <linux/slab.h> | ||
20 | #include <linux/rcupdate.h> | ||
19 | #include <asm/signal.h> | 21 | #include <asm/signal.h> |
20 | 22 | ||
21 | #include <linux/kvm.h> | 23 | #include <linux/kvm.h> |
@@ -40,6 +42,7 @@ | |||
40 | #define KVM_REQ_KICK 9 | 42 | #define KVM_REQ_KICK 9 |
41 | #define KVM_REQ_DEACTIVATE_FPU 10 | 43 | #define KVM_REQ_DEACTIVATE_FPU 10 |
42 | #define KVM_REQ_EVENT 11 | 44 | #define KVM_REQ_EVENT 11 |
45 | #define KVM_REQ_APF_HALT 12 | ||
43 | 46 | ||
44 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 47 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
45 | 48 | ||
@@ -74,6 +77,27 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, | |||
74 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, | 77 | int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, |
75 | struct kvm_io_device *dev); | 78 | struct kvm_io_device *dev); |
76 | 79 | ||
80 | #ifdef CONFIG_KVM_ASYNC_PF | ||
81 | struct kvm_async_pf { | ||
82 | struct work_struct work; | ||
83 | struct list_head link; | ||
84 | struct list_head queue; | ||
85 | struct kvm_vcpu *vcpu; | ||
86 | struct mm_struct *mm; | ||
87 | gva_t gva; | ||
88 | unsigned long addr; | ||
89 | struct kvm_arch_async_pf arch; | ||
90 | struct page *page; | ||
91 | bool done; | ||
92 | }; | ||
93 | |||
94 | void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu); | ||
95 | void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu); | ||
96 | int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn, | ||
97 | struct kvm_arch_async_pf *arch); | ||
98 | int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); | ||
99 | #endif | ||
100 | |||
77 | struct kvm_vcpu { | 101 | struct kvm_vcpu { |
78 | struct kvm *kvm; | 102 | struct kvm *kvm; |
79 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 103 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
@@ -104,6 +128,15 @@ struct kvm_vcpu { | |||
104 | gpa_t mmio_phys_addr; | 128 | gpa_t mmio_phys_addr; |
105 | #endif | 129 | #endif |
106 | 130 | ||
131 | #ifdef CONFIG_KVM_ASYNC_PF | ||
132 | struct { | ||
133 | u32 queued; | ||
134 | struct list_head queue; | ||
135 | struct list_head done; | ||
136 | spinlock_t lock; | ||
137 | } async_pf; | ||
138 | #endif | ||
139 | |||
107 | struct kvm_vcpu_arch arch; | 140 | struct kvm_vcpu_arch arch; |
108 | }; | 141 | }; |
109 | 142 | ||
@@ -113,16 +146,19 @@ struct kvm_vcpu { | |||
113 | */ | 146 | */ |
114 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) | 147 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) |
115 | 148 | ||
149 | struct kvm_lpage_info { | ||
150 | unsigned long rmap_pde; | ||
151 | int write_count; | ||
152 | }; | ||
153 | |||
116 | struct kvm_memory_slot { | 154 | struct kvm_memory_slot { |
117 | gfn_t base_gfn; | 155 | gfn_t base_gfn; |
118 | unsigned long npages; | 156 | unsigned long npages; |
119 | unsigned long flags; | 157 | unsigned long flags; |
120 | unsigned long *rmap; | 158 | unsigned long *rmap; |
121 | unsigned long *dirty_bitmap; | 159 | unsigned long *dirty_bitmap; |
122 | struct { | 160 | unsigned long *dirty_bitmap_head; |
123 | unsigned long rmap_pde; | 161 | struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1]; |
124 | int write_count; | ||
125 | } *lpage_info[KVM_NR_PAGE_SIZES - 1]; | ||
126 | unsigned long userspace_addr; | 162 | unsigned long userspace_addr; |
127 | int user_alloc; | 163 | int user_alloc; |
128 | int id; | 164 | int id; |
@@ -169,6 +205,7 @@ struct kvm_irq_routing_table {}; | |||
169 | 205 | ||
170 | struct kvm_memslots { | 206 | struct kvm_memslots { |
171 | int nmemslots; | 207 | int nmemslots; |
208 | u64 generation; | ||
172 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + | 209 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + |
173 | KVM_PRIVATE_MEM_SLOTS]; | 210 | KVM_PRIVATE_MEM_SLOTS]; |
174 | }; | 211 | }; |
@@ -206,6 +243,10 @@ struct kvm { | |||
206 | 243 | ||
207 | struct mutex irq_lock; | 244 | struct mutex irq_lock; |
208 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 245 | #ifdef CONFIG_HAVE_KVM_IRQCHIP |
246 | /* | ||
247 | * Update side is protected by irq_lock and, | ||
248 | * if configured, irqfds.lock. | ||
249 | */ | ||
209 | struct kvm_irq_routing_table __rcu *irq_routing; | 250 | struct kvm_irq_routing_table __rcu *irq_routing; |
210 | struct hlist_head mask_notifier_list; | 251 | struct hlist_head mask_notifier_list; |
211 | struct hlist_head irq_ack_notifier_list; | 252 | struct hlist_head irq_ack_notifier_list; |
@@ -216,6 +257,7 @@ struct kvm { | |||
216 | unsigned long mmu_notifier_seq; | 257 | unsigned long mmu_notifier_seq; |
217 | long mmu_notifier_count; | 258 | long mmu_notifier_count; |
218 | #endif | 259 | #endif |
260 | long tlbs_dirty; | ||
219 | }; | 261 | }; |
220 | 262 | ||
221 | /* The guest did something we don't support. */ | 263 | /* The guest did something we don't support. */ |
@@ -302,7 +344,11 @@ void kvm_set_page_accessed(struct page *page); | |||
302 | 344 | ||
303 | pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr); | 345 | pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr); |
304 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); | 346 | pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); |
347 | pfn_t gfn_to_pfn_async(struct kvm *kvm, gfn_t gfn, bool *async, | ||
348 | bool write_fault, bool *writable); | ||
305 | pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); | 349 | pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); |
350 | pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault, | ||
351 | bool *writable); | ||
306 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, | 352 | pfn_t gfn_to_pfn_memslot(struct kvm *kvm, |
307 | struct kvm_memory_slot *slot, gfn_t gfn); | 353 | struct kvm_memory_slot *slot, gfn_t gfn); |
308 | int memslot_id(struct kvm *kvm, gfn_t gfn); | 354 | int memslot_id(struct kvm *kvm, gfn_t gfn); |
@@ -321,18 +367,25 @@ int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data, | |||
321 | int offset, int len); | 367 | int offset, int len); |
322 | int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, | 368 | int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, |
323 | unsigned long len); | 369 | unsigned long len); |
370 | int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, | ||
371 | void *data, unsigned long len); | ||
372 | int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc, | ||
373 | gpa_t gpa); | ||
324 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); | 374 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); |
325 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); | 375 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); |
326 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); | 376 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); |
327 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); | 377 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); |
328 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); | 378 | unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); |
329 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); | 379 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); |
380 | void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot, | ||
381 | gfn_t gfn); | ||
330 | 382 | ||
331 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); | 383 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); |
332 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); | 384 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); |
333 | void kvm_resched(struct kvm_vcpu *vcpu); | 385 | void kvm_resched(struct kvm_vcpu *vcpu); |
334 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); | 386 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); |
335 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | 387 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); |
388 | |||
336 | void kvm_flush_remote_tlbs(struct kvm *kvm); | 389 | void kvm_flush_remote_tlbs(struct kvm *kvm); |
337 | void kvm_reload_remote_mmus(struct kvm *kvm); | 390 | void kvm_reload_remote_mmus(struct kvm *kvm); |
338 | 391 | ||
@@ -398,7 +451,19 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); | |||
398 | 451 | ||
399 | void kvm_free_physmem(struct kvm *kvm); | 452 | void kvm_free_physmem(struct kvm *kvm); |
400 | 453 | ||
401 | struct kvm *kvm_arch_create_vm(void); | 454 | #ifndef __KVM_HAVE_ARCH_VM_ALLOC |
455 | static inline struct kvm *kvm_arch_alloc_vm(void) | ||
456 | { | ||
457 | return kzalloc(sizeof(struct kvm), GFP_KERNEL); | ||
458 | } | ||
459 | |||
460 | static inline void kvm_arch_free_vm(struct kvm *kvm) | ||
461 | { | ||
462 | kfree(kvm); | ||
463 | } | ||
464 | #endif | ||
465 | |||
466 | int kvm_arch_init_vm(struct kvm *kvm); | ||
402 | void kvm_arch_destroy_vm(struct kvm *kvm); | 467 | void kvm_arch_destroy_vm(struct kvm *kvm); |
403 | void kvm_free_all_assigned_devices(struct kvm *kvm); | 468 | void kvm_free_all_assigned_devices(struct kvm *kvm); |
404 | void kvm_arch_sync_events(struct kvm *kvm); | 469 | void kvm_arch_sync_events(struct kvm *kvm); |
@@ -414,16 +479,8 @@ struct kvm_irq_ack_notifier { | |||
414 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); | 479 | void (*irq_acked)(struct kvm_irq_ack_notifier *kian); |
415 | }; | 480 | }; |
416 | 481 | ||
417 | #define KVM_ASSIGNED_MSIX_PENDING 0x1 | ||
418 | struct kvm_guest_msix_entry { | ||
419 | u32 vector; | ||
420 | u16 entry; | ||
421 | u16 flags; | ||
422 | }; | ||
423 | |||
424 | struct kvm_assigned_dev_kernel { | 482 | struct kvm_assigned_dev_kernel { |
425 | struct kvm_irq_ack_notifier ack_notifier; | 483 | struct kvm_irq_ack_notifier ack_notifier; |
426 | struct work_struct interrupt_work; | ||
427 | struct list_head list; | 484 | struct list_head list; |
428 | int assigned_dev_id; | 485 | int assigned_dev_id; |
429 | int host_segnr; | 486 | int host_segnr; |
@@ -434,13 +491,14 @@ struct kvm_assigned_dev_kernel { | |||
434 | bool host_irq_disabled; | 491 | bool host_irq_disabled; |
435 | struct msix_entry *host_msix_entries; | 492 | struct msix_entry *host_msix_entries; |
436 | int guest_irq; | 493 | int guest_irq; |
437 | struct kvm_guest_msix_entry *guest_msix_entries; | 494 | struct msix_entry *guest_msix_entries; |
438 | unsigned long irq_requested_type; | 495 | unsigned long irq_requested_type; |
439 | int irq_source_id; | 496 | int irq_source_id; |
440 | int flags; | 497 | int flags; |
441 | struct pci_dev *dev; | 498 | struct pci_dev *dev; |
442 | struct kvm *kvm; | 499 | struct kvm *kvm; |
443 | spinlock_t assigned_dev_lock; | 500 | spinlock_t intx_lock; |
501 | char irq_name[32]; | ||
444 | }; | 502 | }; |
445 | 503 | ||
446 | struct kvm_irq_mask_notifier { | 504 | struct kvm_irq_mask_notifier { |
@@ -462,6 +520,8 @@ void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic, | |||
462 | unsigned long *deliver_bitmask); | 520 | unsigned long *deliver_bitmask); |
463 | #endif | 521 | #endif |
464 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); | 522 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); |
523 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, | ||
524 | int irq_source_id, int level); | ||
465 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 525 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
466 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 526 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
467 | struct kvm_irq_ack_notifier *kian); | 527 | struct kvm_irq_ack_notifier *kian); |
@@ -603,17 +663,28 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {} | |||
603 | void kvm_eventfd_init(struct kvm *kvm); | 663 | void kvm_eventfd_init(struct kvm *kvm); |
604 | int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags); | 664 | int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags); |
605 | void kvm_irqfd_release(struct kvm *kvm); | 665 | void kvm_irqfd_release(struct kvm *kvm); |
666 | void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *); | ||
606 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); | 667 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); |
607 | 668 | ||
608 | #else | 669 | #else |
609 | 670 | ||
610 | static inline void kvm_eventfd_init(struct kvm *kvm) {} | 671 | static inline void kvm_eventfd_init(struct kvm *kvm) {} |
672 | |||
611 | static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags) | 673 | static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags) |
612 | { | 674 | { |
613 | return -EINVAL; | 675 | return -EINVAL; |
614 | } | 676 | } |
615 | 677 | ||
616 | static inline void kvm_irqfd_release(struct kvm *kvm) {} | 678 | static inline void kvm_irqfd_release(struct kvm *kvm) {} |
679 | |||
680 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | ||
681 | static inline void kvm_irq_routing_update(struct kvm *kvm, | ||
682 | struct kvm_irq_routing_table *irq_rt) | ||
683 | { | ||
684 | rcu_assign_pointer(kvm->irq_routing, irq_rt); | ||
685 | } | ||
686 | #endif | ||
687 | |||
617 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | 688 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) |
618 | { | 689 | { |
619 | return -ENOSYS; | 690 | return -ENOSYS; |
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index 7ac0d4eee430..fa7cc7244cbd 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h | |||
@@ -67,4 +67,11 @@ struct kvm_lapic_irq { | |||
67 | u32 dest_id; | 67 | u32 dest_id; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct gfn_to_hva_cache { | ||
71 | u64 generation; | ||
72 | gpa_t gpa; | ||
73 | unsigned long hva; | ||
74 | struct kvm_memory_slot *memslot; | ||
75 | }; | ||
76 | |||
70 | #endif /* __KVM_TYPES_H__ */ | 77 | #endif /* __KVM_TYPES_H__ */ |
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h index 38368d785f08..fd548d2a8775 100644 --- a/include/linux/leds-lp5521.h +++ b/include/linux/leds-lp5521.h | |||
@@ -42,6 +42,7 @@ struct lp5521_platform_data { | |||
42 | int (*setup_resources)(void); | 42 | int (*setup_resources)(void); |
43 | void (*release_resources)(void); | 43 | void (*release_resources)(void); |
44 | void (*enable)(bool state); | 44 | void (*enable)(bool state); |
45 | const char *label; | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | #endif /* __LINUX_LP5521_H */ | 48 | #endif /* __LINUX_LP5521_H */ |
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h index 796747637b80..2694289babd0 100644 --- a/include/linux/leds-lp5523.h +++ b/include/linux/leds-lp5523.h | |||
@@ -42,6 +42,7 @@ struct lp5523_platform_data { | |||
42 | int (*setup_resources)(void); | 42 | int (*setup_resources)(void); |
43 | void (*release_resources)(void); | 43 | void (*release_resources)(void); |
44 | void (*enable)(bool state); | 44 | void (*enable)(bool state); |
45 | const char *label; | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | #endif /* __LINUX_LP5523_H */ | 48 | #endif /* __LINUX_LP5523_H */ |
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index cb93d80aa642..5582ab3d3e48 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h | |||
@@ -39,7 +39,7 @@ struct mfd_cell { | |||
39 | size_t data_size; | 39 | size_t data_size; |
40 | 40 | ||
41 | /* | 41 | /* |
42 | * This resources can be specified relatievly to the parent device. | 42 | * This resources can be specified relatively to the parent device. |
43 | * For accessing device you should use resources from device | 43 | * For accessing device you should use resources from device |
44 | */ | 44 | */ |
45 | int num_resources; | 45 | int num_resources; |
diff --git a/include/linux/nfc/pn544.h b/include/linux/nfc/pn544.h new file mode 100644 index 000000000000..7ab8521f2347 --- /dev/null +++ b/include/linux/nfc/pn544.h | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | * Driver include for the PN544 NFC chip. | ||
3 | * | ||
4 | * Copyright (C) Nokia Corporation | ||
5 | * | ||
6 | * Author: Jari Vanhala <ext-jari.vanhala@nokia.com> | ||
7 | * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _PN544_H_ | ||
24 | #define _PN544_H_ | ||
25 | |||
26 | #include <linux/i2c.h> | ||
27 | |||
28 | #define PN544_DRIVER_NAME "pn544" | ||
29 | #define PN544_MAXWINDOW_SIZE 7 | ||
30 | #define PN544_WINDOW_SIZE 4 | ||
31 | #define PN544_RETRIES 10 | ||
32 | #define PN544_MAX_I2C_TRANSFER 0x0400 | ||
33 | #define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */ | ||
34 | |||
35 | /* ioctl */ | ||
36 | #define PN544_CHAR_BASE 'P' | ||
37 | #define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype) | ||
38 | #define PN544_IOW(num, dtype) _IOW(PN544_CHAR_BASE, num, dtype) | ||
39 | #define PN544_GET_FW_MODE PN544_IOW(1, unsigned int) | ||
40 | #define PN544_SET_FW_MODE PN544_IOW(2, unsigned int) | ||
41 | #define PN544_GET_DEBUG PN544_IOW(3, unsigned int) | ||
42 | #define PN544_SET_DEBUG PN544_IOW(4, unsigned int) | ||
43 | |||
44 | /* Timing restrictions (ms) */ | ||
45 | #define PN544_RESETVEN_TIME 30 /* 7 */ | ||
46 | #define PN544_PVDDVEN_TIME 0 | ||
47 | #define PN544_VBATVEN_TIME 0 | ||
48 | #define PN544_GPIO4VEN_TIME 0 | ||
49 | #define PN544_WAKEUP_ACK 5 | ||
50 | #define PN544_WAKEUP_GUARD (PN544_WAKEUP_ACK + 1) | ||
51 | #define PN544_INACTIVITY_TIME 1000 | ||
52 | #define PN544_INTERFRAME_DELAY 200 /* us */ | ||
53 | #define PN544_BAUDRATE_CHANGE 150 /* us */ | ||
54 | |||
55 | /* Debug bits */ | ||
56 | #define PN544_DEBUG_BUF 0x01 | ||
57 | #define PN544_DEBUG_READ 0x02 | ||
58 | #define PN544_DEBUG_WRITE 0x04 | ||
59 | #define PN544_DEBUG_IRQ 0x08 | ||
60 | #define PN544_DEBUG_CALLS 0x10 | ||
61 | #define PN544_DEBUG_MODE 0x20 | ||
62 | |||
63 | /* Normal (HCI) mode */ | ||
64 | #define PN544_LLC_HCI_OVERHEAD 3 /* header + crc (to length) */ | ||
65 | #define PN544_LLC_MIN_SIZE (1 + PN544_LLC_HCI_OVERHEAD) /* length + */ | ||
66 | #define PN544_LLC_MAX_DATA (PN544_MSG_MAX_SIZE - 2) | ||
67 | #define PN544_LLC_MAX_HCI_SIZE (PN544_LLC_MAX_DATA - 2) | ||
68 | |||
69 | struct pn544_llc_packet { | ||
70 | unsigned char length; /* of rest of packet */ | ||
71 | unsigned char header; | ||
72 | unsigned char data[PN544_LLC_MAX_DATA]; /* includes crc-ccitt */ | ||
73 | }; | ||
74 | |||
75 | /* Firmware upgrade mode */ | ||
76 | #define PN544_FW_HEADER_SIZE 3 | ||
77 | /* max fw transfer is 1024bytes, but I2C limits it to 0xC0 */ | ||
78 | #define PN544_MAX_FW_DATA (PN544_MAX_I2C_TRANSFER - PN544_FW_HEADER_SIZE) | ||
79 | |||
80 | struct pn544_fw_packet { | ||
81 | unsigned char command; /* status in answer */ | ||
82 | unsigned char length[2]; /* big-endian order (msf) */ | ||
83 | unsigned char data[PN544_MAX_FW_DATA]; | ||
84 | }; | ||
85 | |||
86 | #ifdef __KERNEL__ | ||
87 | /* board config */ | ||
88 | struct pn544_nfc_platform_data { | ||
89 | int (*request_resources) (struct i2c_client *client); | ||
90 | void (*free_resources) (void); | ||
91 | void (*enable) (int fw); | ||
92 | int (*test) (void); | ||
93 | void (*disable) (void); | ||
94 | }; | ||
95 | #endif /* __KERNEL__ */ | ||
96 | |||
97 | #endif /* _PN544_H_ */ | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ab47732d81e0..ae0dc453e3e2 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2369,8 +2369,10 @@ | |||
2369 | #define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 | 2369 | #define PCI_DEVICE_ID_JMICRON_JMB38X_SD 0x2381 |
2370 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382 | 2370 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MMC 0x2382 |
2371 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383 | 2371 | #define PCI_DEVICE_ID_JMICRON_JMB38X_MS 0x2383 |
2372 | #define PCI_DEVICE_ID_JMICRON_JMB385_MS 0x2388 | ||
2372 | #define PCI_DEVICE_ID_JMICRON_JMB388_SD 0x2391 | 2373 | #define PCI_DEVICE_ID_JMICRON_JMB388_SD 0x2391 |
2373 | #define PCI_DEVICE_ID_JMICRON_JMB388_ESD 0x2392 | 2374 | #define PCI_DEVICE_ID_JMICRON_JMB388_ESD 0x2392 |
2375 | #define PCI_DEVICE_ID_JMICRON_JMB390_MS 0x2393 | ||
2374 | 2376 | ||
2375 | #define PCI_VENDOR_ID_KORENIX 0x1982 | 2377 | #define PCI_VENDOR_ID_KORENIX 0x1982 |
2376 | #define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600 | 2378 | #define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600 |
diff --git a/include/linux/poll.h b/include/linux/poll.h index 56e76af78102..1a2ccd6f3823 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
@@ -57,7 +57,7 @@ struct poll_table_entry { | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * Structures and helpers for sys_poll/sys_poll | 60 | * Structures and helpers for select/poll syscall |
61 | */ | 61 | */ |
62 | struct poll_wqueues { | 62 | struct poll_wqueues { |
63 | poll_table pt; | 63 | poll_table pt; |
diff --git a/include/linux/pps.h b/include/linux/pps.h index 0194ab06177b..a9bb1d93451a 100644 --- a/include/linux/pps.h +++ b/include/linux/pps.h | |||
@@ -114,11 +114,18 @@ struct pps_fdata { | |||
114 | struct pps_ktime timeout; | 114 | struct pps_ktime timeout; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | struct pps_bind_args { | ||
118 | int tsformat; /* format of time stamps */ | ||
119 | int edge; /* selected event type */ | ||
120 | int consumer; /* selected kernel consumer */ | ||
121 | }; | ||
122 | |||
117 | #include <linux/ioctl.h> | 123 | #include <linux/ioctl.h> |
118 | 124 | ||
119 | #define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) | 125 | #define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) |
120 | #define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) | 126 | #define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) |
121 | #define PPS_GETCAP _IOR('p', 0xa3, int *) | 127 | #define PPS_GETCAP _IOR('p', 0xa3, int *) |
122 | #define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) | 128 | #define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) |
129 | #define PPS_KC_BIND _IOW('p', 0xa5, struct pps_bind_args *) | ||
123 | 130 | ||
124 | #endif /* _PPS_H_ */ | 131 | #endif /* _PPS_H_ */ |
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h index e0a193f830ef..94048547f29a 100644 --- a/include/linux/pps_kernel.h +++ b/include/linux/pps_kernel.h | |||
@@ -18,6 +18,9 @@ | |||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef LINUX_PPS_KERNEL_H | ||
22 | #define LINUX_PPS_KERNEL_H | ||
23 | |||
21 | #include <linux/pps.h> | 24 | #include <linux/pps.h> |
22 | 25 | ||
23 | #include <linux/cdev.h> | 26 | #include <linux/cdev.h> |
@@ -28,18 +31,28 @@ | |||
28 | * Global defines | 31 | * Global defines |
29 | */ | 32 | */ |
30 | 33 | ||
34 | struct pps_device; | ||
35 | |||
31 | /* The specific PPS source info */ | 36 | /* The specific PPS source info */ |
32 | struct pps_source_info { | 37 | struct pps_source_info { |
33 | char name[PPS_MAX_NAME_LEN]; /* simbolic name */ | 38 | char name[PPS_MAX_NAME_LEN]; /* simbolic name */ |
34 | char path[PPS_MAX_NAME_LEN]; /* path of connected device */ | 39 | char path[PPS_MAX_NAME_LEN]; /* path of connected device */ |
35 | int mode; /* PPS's allowed mode */ | 40 | int mode; /* PPS's allowed mode */ |
36 | 41 | ||
37 | void (*echo)(int source, int event, void *data); /* PPS echo function */ | 42 | void (*echo)(struct pps_device *pps, |
43 | int event, void *data); /* PPS echo function */ | ||
38 | 44 | ||
39 | struct module *owner; | 45 | struct module *owner; |
40 | struct device *dev; | 46 | struct device *dev; |
41 | }; | 47 | }; |
42 | 48 | ||
49 | struct pps_event_time { | ||
50 | #ifdef CONFIG_NTP_PPS | ||
51 | struct timespec ts_raw; | ||
52 | #endif /* CONFIG_NTP_PPS */ | ||
53 | struct timespec ts_real; | ||
54 | }; | ||
55 | |||
43 | /* The main struct */ | 56 | /* The main struct */ |
44 | struct pps_device { | 57 | struct pps_device { |
45 | struct pps_source_info info; /* PSS source info */ | 58 | struct pps_source_info info; /* PSS source info */ |
@@ -52,38 +65,56 @@ struct pps_device { | |||
52 | struct pps_ktime clear_tu; | 65 | struct pps_ktime clear_tu; |
53 | int current_mode; /* PPS mode at event time */ | 66 | int current_mode; /* PPS mode at event time */ |
54 | 67 | ||
55 | int go; /* PPS event is arrived? */ | 68 | unsigned int last_ev; /* last PPS event id */ |
56 | wait_queue_head_t queue; /* PPS event queue */ | 69 | wait_queue_head_t queue; /* PPS event queue */ |
57 | 70 | ||
58 | unsigned int id; /* PPS source unique ID */ | 71 | unsigned int id; /* PPS source unique ID */ |
59 | struct cdev cdev; | 72 | struct cdev cdev; |
60 | struct device *dev; | 73 | struct device *dev; |
61 | int devno; | ||
62 | struct fasync_struct *async_queue; /* fasync method */ | 74 | struct fasync_struct *async_queue; /* fasync method */ |
63 | spinlock_t lock; | 75 | spinlock_t lock; |
64 | |||
65 | atomic_t usage; /* usage count */ | ||
66 | }; | 76 | }; |
67 | 77 | ||
68 | /* | 78 | /* |
69 | * Global variables | 79 | * Global variables |
70 | */ | 80 | */ |
71 | 81 | ||
72 | extern spinlock_t pps_idr_lock; | ||
73 | extern struct idr pps_idr; | ||
74 | extern struct timespec pps_irq_ts[]; | ||
75 | |||
76 | extern struct device_attribute pps_attrs[]; | 82 | extern struct device_attribute pps_attrs[]; |
77 | 83 | ||
78 | /* | 84 | /* |
79 | * Exported functions | 85 | * Exported functions |
80 | */ | 86 | */ |
81 | 87 | ||
82 | struct pps_device *pps_get_source(int source); | 88 | extern struct pps_device *pps_register_source( |
83 | extern void pps_put_source(struct pps_device *pps); | 89 | struct pps_source_info *info, int default_params); |
84 | extern int pps_register_source(struct pps_source_info *info, | 90 | extern void pps_unregister_source(struct pps_device *pps); |
85 | int default_params); | ||
86 | extern void pps_unregister_source(int source); | ||
87 | extern int pps_register_cdev(struct pps_device *pps); | 91 | extern int pps_register_cdev(struct pps_device *pps); |
88 | extern void pps_unregister_cdev(struct pps_device *pps); | 92 | extern void pps_unregister_cdev(struct pps_device *pps); |
89 | extern void pps_event(int source, struct pps_ktime *ts, int event, void *data); | 93 | extern void pps_event(struct pps_device *pps, |
94 | struct pps_event_time *ts, int event, void *data); | ||
95 | |||
96 | static inline void timespec_to_pps_ktime(struct pps_ktime *kt, | ||
97 | struct timespec ts) | ||
98 | { | ||
99 | kt->sec = ts.tv_sec; | ||
100 | kt->nsec = ts.tv_nsec; | ||
101 | } | ||
102 | |||
103 | #ifdef CONFIG_NTP_PPS | ||
104 | |||
105 | static inline void pps_get_ts(struct pps_event_time *ts) | ||
106 | { | ||
107 | getnstime_raw_and_real(&ts->ts_raw, &ts->ts_real); | ||
108 | } | ||
109 | |||
110 | #else /* CONFIG_NTP_PPS */ | ||
111 | |||
112 | static inline void pps_get_ts(struct pps_event_time *ts) | ||
113 | { | ||
114 | getnstimeofday(&ts->ts_real); | ||
115 | } | ||
116 | |||
117 | #endif /* CONFIG_NTP_PPS */ | ||
118 | |||
119 | #endif /* LINUX_PPS_KERNEL_H */ | ||
120 | |||
diff --git a/include/linux/printk.h b/include/linux/printk.h index b772ca5fbdf0..ee048e77e1ae 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -4,14 +4,14 @@ | |||
4 | extern const char linux_banner[]; | 4 | extern const char linux_banner[]; |
5 | extern const char linux_proc_banner[]; | 5 | extern const char linux_proc_banner[]; |
6 | 6 | ||
7 | #define KERN_EMERG "<0>" /* system is unusable */ | 7 | #define KERN_EMERG "<0>" /* system is unusable */ |
8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | 8 | #define KERN_ALERT "<1>" /* action must be taken immediately */ |
9 | #define KERN_CRIT "<2>" /* critical conditions */ | 9 | #define KERN_CRIT "<2>" /* critical conditions */ |
10 | #define KERN_ERR "<3>" /* error conditions */ | 10 | #define KERN_ERR "<3>" /* error conditions */ |
11 | #define KERN_WARNING "<4>" /* warning conditions */ | 11 | #define KERN_WARNING "<4>" /* warning conditions */ |
12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ | 12 | #define KERN_NOTICE "<5>" /* normal but significant condition */ |
13 | #define KERN_INFO "<6>" /* informational */ | 13 | #define KERN_INFO "<6>" /* informational */ |
14 | #define KERN_DEBUG "<7>" /* debug-level messages */ | 14 | #define KERN_DEBUG "<7>" /* debug-level messages */ |
15 | 15 | ||
16 | /* Use the default kernel loglevel */ | 16 | /* Use the default kernel loglevel */ |
17 | #define KERN_DEFAULT "<d>" | 17 | #define KERN_DEFAULT "<d>" |
@@ -20,7 +20,7 @@ extern const char linux_proc_banner[]; | |||
20 | * line that had no enclosing \n). Only to be used by core/arch code | 20 | * line that had no enclosing \n). Only to be used by core/arch code |
21 | * during early bootup (a continued line is not SMP-safe otherwise). | 21 | * during early bootup (a continued line is not SMP-safe otherwise). |
22 | */ | 22 | */ |
23 | #define KERN_CONT "<c>" | 23 | #define KERN_CONT "<c>" |
24 | 24 | ||
25 | extern int console_printk[]; | 25 | extern int console_printk[]; |
26 | 26 | ||
@@ -29,6 +29,17 @@ extern int console_printk[]; | |||
29 | #define minimum_console_loglevel (console_printk[2]) | 29 | #define minimum_console_loglevel (console_printk[2]) |
30 | #define default_console_loglevel (console_printk[3]) | 30 | #define default_console_loglevel (console_printk[3]) |
31 | 31 | ||
32 | static inline void console_silent(void) | ||
33 | { | ||
34 | console_loglevel = 0; | ||
35 | } | ||
36 | |||
37 | static inline void console_verbose(void) | ||
38 | { | ||
39 | if (console_loglevel) | ||
40 | console_loglevel = 15; | ||
41 | } | ||
42 | |||
32 | struct va_format { | 43 | struct va_format { |
33 | const char *fmt; | 44 | const char *fmt; |
34 | va_list *va; | 45 | va_list *va; |
@@ -65,11 +76,27 @@ struct va_format { | |||
65 | */ | 76 | */ |
66 | #define HW_ERR "[Hardware Error]: " | 77 | #define HW_ERR "[Hardware Error]: " |
67 | 78 | ||
79 | /* | ||
80 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
81 | * gcc's format and side-effect checking. | ||
82 | */ | ||
83 | static inline __attribute__ ((format (printf, 1, 2))) | ||
84 | int no_printk(const char *fmt, ...) | ||
85 | { | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | extern asmlinkage __attribute__ ((format (printf, 1, 2))) | ||
90 | void early_printk(const char *fmt, ...); | ||
91 | |||
92 | extern int printk_needs_cpu(int cpu); | ||
93 | extern void printk_tick(void); | ||
94 | |||
68 | #ifdef CONFIG_PRINTK | 95 | #ifdef CONFIG_PRINTK |
69 | asmlinkage int vprintk(const char *fmt, va_list args) | 96 | asmlinkage __attribute__ ((format (printf, 1, 0))) |
70 | __attribute__ ((format (printf, 1, 0))); | 97 | int vprintk(const char *fmt, va_list args); |
71 | asmlinkage int printk(const char * fmt, ...) | 98 | asmlinkage __attribute__ ((format (printf, 1, 2))) __cold |
72 | __attribute__ ((format (printf, 1, 2))) __cold; | 99 | int printk(const char *fmt, ...); |
73 | 100 | ||
74 | /* | 101 | /* |
75 | * Please don't use printk_ratelimit(), because it shares ratelimiting state | 102 | * Please don't use printk_ratelimit(), because it shares ratelimiting state |
@@ -83,99 +110,56 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | |||
83 | 110 | ||
84 | extern int printk_delay_msec; | 111 | extern int printk_delay_msec; |
85 | extern int dmesg_restrict; | 112 | extern int dmesg_restrict; |
86 | 113 | extern int kptr_restrict; | |
87 | /* | ||
88 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
89 | */ | ||
90 | #define printk_once(x...) ({ \ | ||
91 | static bool __print_once; \ | ||
92 | \ | ||
93 | if (!__print_once) { \ | ||
94 | __print_once = true; \ | ||
95 | printk(x); \ | ||
96 | } \ | ||
97 | }) | ||
98 | 114 | ||
99 | void log_buf_kexec_setup(void); | 115 | void log_buf_kexec_setup(void); |
100 | #else | 116 | #else |
101 | static inline int vprintk(const char *s, va_list args) | 117 | static inline __attribute__ ((format (printf, 1, 0))) |
102 | __attribute__ ((format (printf, 1, 0))); | 118 | int vprintk(const char *s, va_list args) |
103 | static inline int vprintk(const char *s, va_list args) { return 0; } | ||
104 | static inline int printk(const char *s, ...) | ||
105 | __attribute__ ((format (printf, 1, 2))); | ||
106 | static inline int __cold printk(const char *s, ...) { return 0; } | ||
107 | static inline int printk_ratelimit(void) { return 0; } | ||
108 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
109 | unsigned int interval_msec) \ | ||
110 | { return false; } | ||
111 | |||
112 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
113 | #define printk_once(x...) printk(x) | ||
114 | |||
115 | static inline void log_buf_kexec_setup(void) | ||
116 | { | 119 | { |
120 | return 0; | ||
117 | } | 121 | } |
118 | #endif | 122 | static inline __attribute__ ((format (printf, 1, 2))) __cold |
119 | 123 | int printk(const char *s, ...) | |
120 | /* | ||
121 | * Dummy printk for disabled debugging statements to use whilst maintaining | ||
122 | * gcc's format and side-effect checking. | ||
123 | */ | ||
124 | static inline __attribute__ ((format (printf, 1, 2))) | ||
125 | int no_printk(const char *s, ...) { return 0; } | ||
126 | |||
127 | extern int printk_needs_cpu(int cpu); | ||
128 | extern void printk_tick(void); | ||
129 | |||
130 | extern void asmlinkage __attribute__((format(printf, 1, 2))) | ||
131 | early_printk(const char *fmt, ...); | ||
132 | |||
133 | static inline void console_silent(void) | ||
134 | { | 124 | { |
135 | console_loglevel = 0; | 125 | return 0; |
126 | } | ||
127 | static inline int printk_ratelimit(void) | ||
128 | { | ||
129 | return 0; | ||
130 | } | ||
131 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
132 | unsigned int interval_msec) | ||
133 | { | ||
134 | return false; | ||
136 | } | 135 | } |
137 | 136 | ||
138 | static inline void console_verbose(void) | 137 | static inline void log_buf_kexec_setup(void) |
139 | { | 138 | { |
140 | if (console_loglevel) | ||
141 | console_loglevel = 15; | ||
142 | } | 139 | } |
140 | #endif | ||
143 | 141 | ||
144 | extern void dump_stack(void) __cold; | 142 | extern void dump_stack(void) __cold; |
145 | 143 | ||
146 | enum { | ||
147 | DUMP_PREFIX_NONE, | ||
148 | DUMP_PREFIX_ADDRESS, | ||
149 | DUMP_PREFIX_OFFSET | ||
150 | }; | ||
151 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
152 | int rowsize, int groupsize, | ||
153 | char *linebuf, size_t linebuflen, bool ascii); | ||
154 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
155 | int prefix_type, int rowsize, int groupsize, | ||
156 | const void *buf, size_t len, bool ascii); | ||
157 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
158 | const void *buf, size_t len); | ||
159 | |||
160 | #ifndef pr_fmt | 144 | #ifndef pr_fmt |
161 | #define pr_fmt(fmt) fmt | 145 | #define pr_fmt(fmt) fmt |
162 | #endif | 146 | #endif |
163 | 147 | ||
164 | #define pr_emerg(fmt, ...) \ | 148 | #define pr_emerg(fmt, ...) \ |
165 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | 149 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
166 | #define pr_alert(fmt, ...) \ | 150 | #define pr_alert(fmt, ...) \ |
167 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | 151 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
168 | #define pr_crit(fmt, ...) \ | 152 | #define pr_crit(fmt, ...) \ |
169 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | 153 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
170 | #define pr_err(fmt, ...) \ | 154 | #define pr_err(fmt, ...) \ |
171 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 155 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
172 | #define pr_warning(fmt, ...) \ | 156 | #define pr_warning(fmt, ...) \ |
173 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 157 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
174 | #define pr_warn pr_warning | 158 | #define pr_warn pr_warning |
175 | #define pr_notice(fmt, ...) \ | 159 | #define pr_notice(fmt, ...) \ |
176 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 160 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
177 | #define pr_info(fmt, ...) \ | 161 | #define pr_info(fmt, ...) \ |
178 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 162 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
179 | #define pr_cont(fmt, ...) \ | 163 | #define pr_cont(fmt, ...) \ |
180 | printk(KERN_CONT fmt, ##__VA_ARGS__) | 164 | printk(KERN_CONT fmt, ##__VA_ARGS__) |
181 | 165 | ||
@@ -185,7 +169,7 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
185 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 169 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
186 | #else | 170 | #else |
187 | #define pr_devel(fmt, ...) \ | 171 | #define pr_devel(fmt, ...) \ |
188 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | 172 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
189 | #endif | 173 | #endif |
190 | 174 | ||
191 | /* If you are writing a driver, please use dev_dbg instead */ | 175 | /* If you are writing a driver, please use dev_dbg instead */ |
@@ -198,7 +182,51 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
198 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | 182 | dynamic_pr_debug(fmt, ##__VA_ARGS__) |
199 | #else | 183 | #else |
200 | #define pr_debug(fmt, ...) \ | 184 | #define pr_debug(fmt, ...) \ |
201 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | 185 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
186 | #endif | ||
187 | |||
188 | /* | ||
189 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
190 | */ | ||
191 | |||
192 | #ifdef CONFIG_PRINTK | ||
193 | #define printk_once(fmt, ...) \ | ||
194 | ({ \ | ||
195 | static bool __print_once; \ | ||
196 | \ | ||
197 | if (!__print_once) { \ | ||
198 | __print_once = true; \ | ||
199 | printk(fmt, ##__VA_ARGS__); \ | ||
200 | } \ | ||
201 | }) | ||
202 | #else | ||
203 | #define printk_once(fmt, ...) \ | ||
204 | no_printk(fmt, ##__VA_ARGS__) | ||
205 | #endif | ||
206 | |||
207 | #define pr_emerg_once(fmt, ...) \ | ||
208 | printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | ||
209 | #define pr_alert_once(fmt, ...) \ | ||
210 | printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | ||
211 | #define pr_crit_once(fmt, ...) \ | ||
212 | printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | ||
213 | #define pr_err_once(fmt, ...) \ | ||
214 | printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | ||
215 | #define pr_warn_once(fmt, ...) \ | ||
216 | printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | ||
217 | #define pr_notice_once(fmt, ...) \ | ||
218 | printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
219 | #define pr_info_once(fmt, ...) \ | ||
220 | printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
221 | #define pr_cont_once(fmt, ...) \ | ||
222 | printk_once(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__) | ||
223 | /* If you are writing a driver, please use dev_dbg instead */ | ||
224 | #if defined(DEBUG) | ||
225 | #define pr_debug_once(fmt, ...) \ | ||
226 | printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
227 | #else | ||
228 | #define pr_debug_once(fmt, ...) \ | ||
229 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
202 | #endif | 230 | #endif |
203 | 231 | ||
204 | /* | 232 | /* |
@@ -206,7 +234,8 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
206 | * no local ratelimit_state used in the !PRINTK case | 234 | * no local ratelimit_state used in the !PRINTK case |
207 | */ | 235 | */ |
208 | #ifdef CONFIG_PRINTK | 236 | #ifdef CONFIG_PRINTK |
209 | #define printk_ratelimited(fmt, ...) ({ \ | 237 | #define printk_ratelimited(fmt, ...) \ |
238 | ({ \ | ||
210 | static DEFINE_RATELIMIT_STATE(_rs, \ | 239 | static DEFINE_RATELIMIT_STATE(_rs, \ |
211 | DEFAULT_RATELIMIT_INTERVAL, \ | 240 | DEFAULT_RATELIMIT_INTERVAL, \ |
212 | DEFAULT_RATELIMIT_BURST); \ | 241 | DEFAULT_RATELIMIT_BURST); \ |
@@ -215,34 +244,59 @@ extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | |||
215 | printk(fmt, ##__VA_ARGS__); \ | 244 | printk(fmt, ##__VA_ARGS__); \ |
216 | }) | 245 | }) |
217 | #else | 246 | #else |
218 | /* No effect, but we still get type checking even in the !PRINTK case: */ | 247 | #define printk_ratelimited(fmt, ...) \ |
219 | #define printk_ratelimited printk | 248 | no_printk(fmt, ##__VA_ARGS__) |
220 | #endif | 249 | #endif |
221 | 250 | ||
222 | #define pr_emerg_ratelimited(fmt, ...) \ | 251 | #define pr_emerg_ratelimited(fmt, ...) \ |
223 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) | 252 | printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
224 | #define pr_alert_ratelimited(fmt, ...) \ | 253 | #define pr_alert_ratelimited(fmt, ...) \ |
225 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) | 254 | printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
226 | #define pr_crit_ratelimited(fmt, ...) \ | 255 | #define pr_crit_ratelimited(fmt, ...) \ |
227 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) | 256 | printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
228 | #define pr_err_ratelimited(fmt, ...) \ | 257 | #define pr_err_ratelimited(fmt, ...) \ |
229 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) | 258 | printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
230 | #define pr_warning_ratelimited(fmt, ...) \ | 259 | #define pr_warn_ratelimited(fmt, ...) \ |
231 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) | 260 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
232 | #define pr_warn_ratelimited pr_warning_ratelimited | 261 | #define pr_notice_ratelimited(fmt, ...) \ |
233 | #define pr_notice_ratelimited(fmt, ...) \ | ||
234 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | 262 | printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) |
235 | #define pr_info_ratelimited(fmt, ...) \ | 263 | #define pr_info_ratelimited(fmt, ...) \ |
236 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 264 | printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
237 | /* no pr_cont_ratelimited, don't do that... */ | 265 | /* no pr_cont_ratelimited, don't do that... */ |
238 | /* If you are writing a driver, please use dev_dbg instead */ | 266 | /* If you are writing a driver, please use dev_dbg instead */ |
239 | #if defined(DEBUG) | 267 | #if defined(DEBUG) |
240 | #define pr_debug_ratelimited(fmt, ...) \ | 268 | #define pr_debug_ratelimited(fmt, ...) \ |
241 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | 269 | printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
242 | #else | 270 | #else |
243 | #define pr_debug_ratelimited(fmt, ...) \ | 271 | #define pr_debug_ratelimited(fmt, ...) \ |
244 | ({ if (0) printk_ratelimited(KERN_DEBUG pr_fmt(fmt), \ | 272 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
245 | ##__VA_ARGS__); 0; }) | 273 | #endif |
274 | |||
275 | enum { | ||
276 | DUMP_PREFIX_NONE, | ||
277 | DUMP_PREFIX_ADDRESS, | ||
278 | DUMP_PREFIX_OFFSET | ||
279 | }; | ||
280 | extern void hex_dump_to_buffer(const void *buf, size_t len, | ||
281 | int rowsize, int groupsize, | ||
282 | char *linebuf, size_t linebuflen, bool ascii); | ||
283 | #ifdef CONFIG_PRINTK | ||
284 | extern void print_hex_dump(const char *level, const char *prefix_str, | ||
285 | int prefix_type, int rowsize, int groupsize, | ||
286 | const void *buf, size_t len, bool ascii); | ||
287 | extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
288 | const void *buf, size_t len); | ||
289 | #else | ||
290 | static inline void print_hex_dump(const char *level, const char *prefix_str, | ||
291 | int prefix_type, int rowsize, int groupsize, | ||
292 | const void *buf, size_t len, bool ascii) | ||
293 | { | ||
294 | } | ||
295 | static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type, | ||
296 | const void *buf, size_t len) | ||
297 | { | ||
298 | } | ||
299 | |||
246 | #endif | 300 | #endif |
247 | 301 | ||
248 | #endif | 302 | #endif |
diff --git a/include/linux/rio.h b/include/linux/rio.h index 0bed941f9b13..ff681ebba585 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -66,14 +66,62 @@ | |||
66 | 66 | ||
67 | #define RIO_PW_MSG_SIZE 64 | 67 | #define RIO_PW_MSG_SIZE 64 |
68 | 68 | ||
69 | /* | ||
70 | * A component tag value (stored in the component tag CSR) is used as device's | ||
71 | * unique identifier assigned during enumeration. Besides being used for | ||
72 | * identifying switches (which do not have device ID register), it also is used | ||
73 | * by error management notification and therefore has to be assigned | ||
74 | * to endpoints as well. | ||
75 | */ | ||
76 | #define RIO_CTAG_RESRVD 0xfffe0000 /* Reserved */ | ||
77 | #define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */ | ||
78 | |||
69 | extern struct bus_type rio_bus_type; | 79 | extern struct bus_type rio_bus_type; |
70 | extern struct device rio_bus; | 80 | extern struct device rio_bus; |
71 | extern struct list_head rio_devices; /* list of all devices */ | 81 | extern struct list_head rio_devices; /* list of all devices */ |
72 | 82 | ||
73 | struct rio_mport; | 83 | struct rio_mport; |
84 | struct rio_dev; | ||
74 | union rio_pw_msg; | 85 | union rio_pw_msg; |
75 | 86 | ||
76 | /** | 87 | /** |
88 | * struct rio_switch - RIO switch info | ||
89 | * @node: Node in global list of switches | ||
90 | * @switchid: Switch ID that is unique across a network | ||
91 | * @route_table: Copy of switch routing table | ||
92 | * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0 | ||
93 | * @add_entry: Callback for switch-specific route add function | ||
94 | * @get_entry: Callback for switch-specific route get function | ||
95 | * @clr_table: Callback for switch-specific clear route table function | ||
96 | * @set_domain: Callback for switch-specific domain setting function | ||
97 | * @get_domain: Callback for switch-specific domain get function | ||
98 | * @em_init: Callback for switch-specific error management init function | ||
99 | * @em_handle: Callback for switch-specific error management handler function | ||
100 | * @sw_sysfs: Callback that initializes switch-specific sysfs attributes | ||
101 | * @nextdev: Array of per-port pointers to the next attached device | ||
102 | */ | ||
103 | struct rio_switch { | ||
104 | struct list_head node; | ||
105 | u16 switchid; | ||
106 | u8 *route_table; | ||
107 | u32 port_ok; | ||
108 | int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
109 | u16 table, u16 route_destid, u8 route_port); | ||
110 | int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
111 | u16 table, u16 route_destid, u8 *route_port); | ||
112 | int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
113 | u16 table); | ||
114 | int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
115 | u8 sw_domain); | ||
116 | int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
117 | u8 *sw_domain); | ||
118 | int (*em_init) (struct rio_dev *dev); | ||
119 | int (*em_handle) (struct rio_dev *dev, u8 swport); | ||
120 | int (*sw_sysfs) (struct rio_dev *dev, int create); | ||
121 | struct rio_dev *nextdev[0]; | ||
122 | }; | ||
123 | |||
124 | /** | ||
77 | * struct rio_dev - RIO device info | 125 | * struct rio_dev - RIO device info |
78 | * @global_list: Node in list of all RIO devices | 126 | * @global_list: Node in list of all RIO devices |
79 | * @net_list: Node in list of RIO devices in a network | 127 | * @net_list: Node in list of RIO devices in a network |
@@ -93,13 +141,14 @@ union rio_pw_msg; | |||
93 | * @phys_efptr: RIO device extended features pointer | 141 | * @phys_efptr: RIO device extended features pointer |
94 | * @em_efptr: RIO Error Management features pointer | 142 | * @em_efptr: RIO Error Management features pointer |
95 | * @dma_mask: Mask of bits of RIO address this device implements | 143 | * @dma_mask: Mask of bits of RIO address this device implements |
96 | * @rswitch: Pointer to &struct rio_switch if valid for this device | ||
97 | * @driver: Driver claiming this device | 144 | * @driver: Driver claiming this device |
98 | * @dev: Device model device | 145 | * @dev: Device model device |
99 | * @riores: RIO resources this device owns | 146 | * @riores: RIO resources this device owns |
100 | * @pwcback: port-write callback function for this device | 147 | * @pwcback: port-write callback function for this device |
101 | * @destid: Network destination ID | 148 | * @destid: Network destination ID (or associated destid for switch) |
149 | * @hopcount: Hopcount to this device | ||
102 | * @prev: Previous RIO device connected to the current one | 150 | * @prev: Previous RIO device connected to the current one |
151 | * @rswitch: struct rio_switch (if valid for this device) | ||
103 | */ | 152 | */ |
104 | struct rio_dev { | 153 | struct rio_dev { |
105 | struct list_head global_list; /* node in list of all RIO devices */ | 154 | struct list_head global_list; /* node in list of all RIO devices */ |
@@ -120,18 +169,20 @@ struct rio_dev { | |||
120 | u32 phys_efptr; | 169 | u32 phys_efptr; |
121 | u32 em_efptr; | 170 | u32 em_efptr; |
122 | u64 dma_mask; | 171 | u64 dma_mask; |
123 | struct rio_switch *rswitch; /* RIO switch info */ | ||
124 | struct rio_driver *driver; /* RIO driver claiming this device */ | 172 | struct rio_driver *driver; /* RIO driver claiming this device */ |
125 | struct device dev; /* LDM device structure */ | 173 | struct device dev; /* LDM device structure */ |
126 | struct resource riores[RIO_MAX_DEV_RESOURCES]; | 174 | struct resource riores[RIO_MAX_DEV_RESOURCES]; |
127 | int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); | 175 | int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step); |
128 | u16 destid; | 176 | u16 destid; |
177 | u8 hopcount; | ||
129 | struct rio_dev *prev; | 178 | struct rio_dev *prev; |
179 | struct rio_switch rswitch[0]; /* RIO switch info */ | ||
130 | }; | 180 | }; |
131 | 181 | ||
132 | #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) | 182 | #define rio_dev_g(n) list_entry(n, struct rio_dev, global_list) |
133 | #define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) | 183 | #define rio_dev_f(n) list_entry(n, struct rio_dev, net_list) |
134 | #define to_rio_dev(n) container_of(n, struct rio_dev, dev) | 184 | #define to_rio_dev(n) container_of(n, struct rio_dev, dev) |
185 | #define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0]) | ||
135 | 186 | ||
136 | /** | 187 | /** |
137 | * struct rio_msg - RIO message event | 188 | * struct rio_msg - RIO message event |
@@ -224,49 +275,6 @@ struct rio_net { | |||
224 | #define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */ | 275 | #define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */ |
225 | #define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */ | 276 | #define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */ |
226 | 277 | ||
227 | /** | ||
228 | * struct rio_switch - RIO switch info | ||
229 | * @node: Node in global list of switches | ||
230 | * @rdev: Associated RIO device structure | ||
231 | * @switchid: Switch ID that is unique across a network | ||
232 | * @hopcount: Hopcount to this switch | ||
233 | * @destid: Associated destid in the path | ||
234 | * @route_table: Copy of switch routing table | ||
235 | * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0 | ||
236 | * @add_entry: Callback for switch-specific route add function | ||
237 | * @get_entry: Callback for switch-specific route get function | ||
238 | * @clr_table: Callback for switch-specific clear route table function | ||
239 | * @set_domain: Callback for switch-specific domain setting function | ||
240 | * @get_domain: Callback for switch-specific domain get function | ||
241 | * @em_init: Callback for switch-specific error management initialization function | ||
242 | * @em_handle: Callback for switch-specific error management handler function | ||
243 | * @sw_sysfs: Callback that initializes switch-specific sysfs attributes | ||
244 | * @nextdev: Array of per-port pointers to the next attached device | ||
245 | */ | ||
246 | struct rio_switch { | ||
247 | struct list_head node; | ||
248 | struct rio_dev *rdev; | ||
249 | u16 switchid; | ||
250 | u16 hopcount; | ||
251 | u16 destid; | ||
252 | u8 *route_table; | ||
253 | u32 port_ok; | ||
254 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
255 | u16 table, u16 route_destid, u8 route_port); | ||
256 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | ||
257 | u16 table, u16 route_destid, u8 * route_port); | ||
258 | int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
259 | u16 table); | ||
260 | int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
261 | u8 sw_domain); | ||
262 | int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount, | ||
263 | u8 *sw_domain); | ||
264 | int (*em_init) (struct rio_dev *dev); | ||
265 | int (*em_handle) (struct rio_dev *dev, u8 swport); | ||
266 | int (*sw_sysfs) (struct rio_dev *dev, int create); | ||
267 | struct rio_dev *nextdev[0]; | ||
268 | }; | ||
269 | |||
270 | /* Low-level architecture-dependent routines */ | 278 | /* Low-level architecture-dependent routines */ |
271 | 279 | ||
272 | /** | 280 | /** |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index edc55da717b3..e09e565c4bce 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
@@ -150,16 +150,8 @@ static inline int rio_local_write_config_8(struct rio_mport *port, u32 offset, | |||
150 | static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, | 150 | static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, |
151 | u32 * data) | 151 | u32 * data) |
152 | { | 152 | { |
153 | u8 hopcount = 0xff; | 153 | return rio_mport_read_config_32(rdev->net->hport, rdev->destid, |
154 | u16 destid = rdev->destid; | 154 | rdev->hopcount, offset, data); |
155 | |||
156 | if (rdev->rswitch) { | ||
157 | destid = rdev->rswitch->destid; | ||
158 | hopcount = rdev->rswitch->hopcount; | ||
159 | } | ||
160 | |||
161 | return rio_mport_read_config_32(rdev->net->hport, destid, hopcount, | ||
162 | offset, data); | ||
163 | }; | 155 | }; |
164 | 156 | ||
165 | /** | 157 | /** |
@@ -174,16 +166,8 @@ static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset, | |||
174 | static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, | 166 | static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, |
175 | u32 data) | 167 | u32 data) |
176 | { | 168 | { |
177 | u8 hopcount = 0xff; | 169 | return rio_mport_write_config_32(rdev->net->hport, rdev->destid, |
178 | u16 destid = rdev->destid; | 170 | rdev->hopcount, offset, data); |
179 | |||
180 | if (rdev->rswitch) { | ||
181 | destid = rdev->rswitch->destid; | ||
182 | hopcount = rdev->rswitch->hopcount; | ||
183 | } | ||
184 | |||
185 | return rio_mport_write_config_32(rdev->net->hport, destid, hopcount, | ||
186 | offset, data); | ||
187 | }; | 171 | }; |
188 | 172 | ||
189 | /** | 173 | /** |
@@ -198,16 +182,8 @@ static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset, | |||
198 | static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, | 182 | static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, |
199 | u16 * data) | 183 | u16 * data) |
200 | { | 184 | { |
201 | u8 hopcount = 0xff; | 185 | return rio_mport_read_config_16(rdev->net->hport, rdev->destid, |
202 | u16 destid = rdev->destid; | 186 | rdev->hopcount, offset, data); |
203 | |||
204 | if (rdev->rswitch) { | ||
205 | destid = rdev->rswitch->destid; | ||
206 | hopcount = rdev->rswitch->hopcount; | ||
207 | } | ||
208 | |||
209 | return rio_mport_read_config_16(rdev->net->hport, destid, hopcount, | ||
210 | offset, data); | ||
211 | }; | 187 | }; |
212 | 188 | ||
213 | /** | 189 | /** |
@@ -222,16 +198,8 @@ static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset, | |||
222 | static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, | 198 | static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, |
223 | u16 data) | 199 | u16 data) |
224 | { | 200 | { |
225 | u8 hopcount = 0xff; | 201 | return rio_mport_write_config_16(rdev->net->hport, rdev->destid, |
226 | u16 destid = rdev->destid; | 202 | rdev->hopcount, offset, data); |
227 | |||
228 | if (rdev->rswitch) { | ||
229 | destid = rdev->rswitch->destid; | ||
230 | hopcount = rdev->rswitch->hopcount; | ||
231 | } | ||
232 | |||
233 | return rio_mport_write_config_16(rdev->net->hport, destid, hopcount, | ||
234 | offset, data); | ||
235 | }; | 203 | }; |
236 | 204 | ||
237 | /** | 205 | /** |
@@ -245,16 +213,8 @@ static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset, | |||
245 | */ | 213 | */ |
246 | static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) | 214 | static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) |
247 | { | 215 | { |
248 | u8 hopcount = 0xff; | 216 | return rio_mport_read_config_8(rdev->net->hport, rdev->destid, |
249 | u16 destid = rdev->destid; | 217 | rdev->hopcount, offset, data); |
250 | |||
251 | if (rdev->rswitch) { | ||
252 | destid = rdev->rswitch->destid; | ||
253 | hopcount = rdev->rswitch->hopcount; | ||
254 | } | ||
255 | |||
256 | return rio_mport_read_config_8(rdev->net->hport, destid, hopcount, | ||
257 | offset, data); | ||
258 | }; | 218 | }; |
259 | 219 | ||
260 | /** | 220 | /** |
@@ -268,16 +228,8 @@ static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data) | |||
268 | */ | 228 | */ |
269 | static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data) | 229 | static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data) |
270 | { | 230 | { |
271 | u8 hopcount = 0xff; | 231 | return rio_mport_write_config_8(rdev->net->hport, rdev->destid, |
272 | u16 destid = rdev->destid; | 232 | rdev->hopcount, offset, data); |
273 | |||
274 | if (rdev->rswitch) { | ||
275 | destid = rdev->rswitch->destid; | ||
276 | hopcount = rdev->rswitch->hopcount; | ||
277 | } | ||
278 | |||
279 | return rio_mport_write_config_8(rdev->net->hport, destid, hopcount, | ||
280 | offset, data); | ||
281 | }; | 233 | }; |
282 | 234 | ||
283 | extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, | 235 | extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, |
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h index ee7b6ada188f..7410d3365e2a 100644 --- a/include/linux/rio_ids.h +++ b/include/linux/rio_ids.h | |||
@@ -36,5 +36,7 @@ | |||
36 | #define RIO_DID_IDTCPS10Q 0x035e | 36 | #define RIO_DID_IDTCPS10Q 0x035e |
37 | #define RIO_DID_IDTCPS1848 0x0374 | 37 | #define RIO_DID_IDTCPS1848 0x0374 |
38 | #define RIO_DID_IDTCPS1616 0x0379 | 38 | #define RIO_DID_IDTCPS1616 0x0379 |
39 | #define RIO_DID_IDTVPS1616 0x0377 | ||
40 | #define RIO_DID_IDTSPS1616 0x0378 | ||
39 | 41 | ||
40 | #endif /* LINUX_RIO_IDS_H */ | 42 | #endif /* LINUX_RIO_IDS_H */ |
diff --git a/include/linux/romfs_fs.h b/include/linux/romfs_fs.h index c490fbc43fe2..5f57f93b284f 100644 --- a/include/linux/romfs_fs.h +++ b/include/linux/romfs_fs.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef __LINUX_ROMFS_FS_H | 1 | #ifndef __LINUX_ROMFS_FS_H |
2 | #define __LINUX_ROMFS_FS_H | 2 | #define __LINUX_ROMFS_FS_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | #include <linux/fs.h> | ||
6 | |||
4 | /* The basic structures of the romfs filesystem */ | 7 | /* The basic structures of the romfs filesystem */ |
5 | 8 | ||
6 | #define ROMBSIZE BLOCK_SIZE | 9 | #define ROMBSIZE BLOCK_SIZE |
diff --git a/include/linux/sched.h b/include/linux/sched.h index abc527aa8550..96e23215e276 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -683,7 +683,7 @@ struct user_struct { | |||
683 | atomic_t fanotify_listeners; | 683 | atomic_t fanotify_listeners; |
684 | #endif | 684 | #endif |
685 | #ifdef CONFIG_EPOLL | 685 | #ifdef CONFIG_EPOLL |
686 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ | 686 | atomic_long_t epoll_watches; /* The number of file descriptors currently watched */ |
687 | #endif | 687 | #endif |
688 | #ifdef CONFIG_POSIX_MQUEUE | 688 | #ifdef CONFIG_POSIX_MQUEUE |
689 | /* protected by mq_lock */ | 689 | /* protected by mq_lock */ |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index a23fa29d4eb0..758c5b0c6fd3 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -212,6 +212,7 @@ | |||
212 | #include <linux/tty.h> | 212 | #include <linux/tty.h> |
213 | #include <linux/mutex.h> | 213 | #include <linux/mutex.h> |
214 | #include <linux/sysrq.h> | 214 | #include <linux/sysrq.h> |
215 | #include <linux/pps_kernel.h> | ||
215 | 216 | ||
216 | struct uart_port; | 217 | struct uart_port; |
217 | struct serial_struct; | 218 | struct serial_struct; |
@@ -528,10 +529,10 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
528 | struct uart_state *state = uport->state; | 529 | struct uart_state *state = uport->state; |
529 | struct tty_port *port = &state->port; | 530 | struct tty_port *port = &state->port; |
530 | struct tty_ldisc *ld = tty_ldisc_ref(port->tty); | 531 | struct tty_ldisc *ld = tty_ldisc_ref(port->tty); |
531 | struct timespec ts; | 532 | struct pps_event_time ts; |
532 | 533 | ||
533 | if (ld && ld->ops->dcd_change) | 534 | if (ld && ld->ops->dcd_change) |
534 | getnstimeofday(&ts); | 535 | pps_get_ts(&ts); |
535 | 536 | ||
536 | uport->icount.dcd++; | 537 | uport->icount.dcd++; |
537 | #ifdef CONFIG_HARD_PPS | 538 | #ifdef CONFIG_HARD_PPS |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 144b34be5c32..c1f499835b2a 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -122,7 +122,7 @@ struct platform_suspend_ops { | |||
122 | * suspend_set_ops - set platform dependent suspend operations | 122 | * suspend_set_ops - set platform dependent suspend operations |
123 | * @ops: The new suspend operations to set. | 123 | * @ops: The new suspend operations to set. |
124 | */ | 124 | */ |
125 | extern void suspend_set_ops(struct platform_suspend_ops *ops); | 125 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); |
126 | extern int suspend_valid_only_mem(suspend_state_t state); | 126 | extern int suspend_valid_only_mem(suspend_state_t state); |
127 | 127 | ||
128 | /** | 128 | /** |
@@ -147,7 +147,7 @@ extern int pm_suspend(suspend_state_t state); | |||
147 | #else /* !CONFIG_SUSPEND */ | 147 | #else /* !CONFIG_SUSPEND */ |
148 | #define suspend_valid_only_mem NULL | 148 | #define suspend_valid_only_mem NULL |
149 | 149 | ||
150 | static inline void suspend_set_ops(struct platform_suspend_ops *ops) {} | 150 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} |
151 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 151 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
152 | #endif /* !CONFIG_SUSPEND */ | 152 | #endif /* !CONFIG_SUSPEND */ |
153 | 153 | ||
@@ -245,7 +245,7 @@ extern void swsusp_set_page_free(struct page *); | |||
245 | extern void swsusp_unset_page_free(struct page *); | 245 | extern void swsusp_unset_page_free(struct page *); |
246 | extern unsigned long get_safe_page(gfp_t gfp_mask); | 246 | extern unsigned long get_safe_page(gfp_t gfp_mask); |
247 | 247 | ||
248 | extern void hibernation_set_ops(struct platform_hibernation_ops *ops); | 248 | extern void hibernation_set_ops(const struct platform_hibernation_ops *ops); |
249 | extern int hibernate(void); | 249 | extern int hibernate(void); |
250 | extern bool system_entering_hibernation(void); | 250 | extern bool system_entering_hibernation(void); |
251 | #else /* CONFIG_HIBERNATION */ | 251 | #else /* CONFIG_HIBERNATION */ |
@@ -253,7 +253,7 @@ static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | |||
253 | static inline void swsusp_set_page_free(struct page *p) {} | 253 | static inline void swsusp_set_page_free(struct page *p) {} |
254 | static inline void swsusp_unset_page_free(struct page *p) {} | 254 | static inline void swsusp_unset_page_free(struct page *p) {} |
255 | 255 | ||
256 | static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} | 256 | static inline void hibernation_set_ops(const struct platform_hibernation_ops *ops) {} |
257 | static inline int hibernate(void) { return -ENOSYS; } | 257 | static inline int hibernate(void) { return -ENOSYS; } |
258 | static inline bool system_entering_hibernation(void) { return false; } | 258 | static inline bool system_entering_hibernation(void) { return false; } |
259 | #endif /* CONFIG_HIBERNATION */ | 259 | #endif /* CONFIG_HIBERNATION */ |
diff --git a/include/linux/time.h b/include/linux/time.h index 9f15ac7ab92a..1e6d3b59238d 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -158,6 +158,8 @@ extern unsigned int alarm_setitimer(unsigned int seconds); | |||
158 | extern int do_getitimer(int which, struct itimerval *value); | 158 | extern int do_getitimer(int which, struct itimerval *value); |
159 | extern void getnstimeofday(struct timespec *tv); | 159 | extern void getnstimeofday(struct timespec *tv); |
160 | extern void getrawmonotonic(struct timespec *ts); | 160 | extern void getrawmonotonic(struct timespec *ts); |
161 | extern void getnstime_raw_and_real(struct timespec *ts_raw, | ||
162 | struct timespec *ts_real); | ||
161 | extern void getboottime(struct timespec *ts); | 163 | extern void getboottime(struct timespec *ts); |
162 | extern void monotonic_to_bootbased(struct timespec *ts); | 164 | extern void monotonic_to_bootbased(struct timespec *ts); |
163 | 165 | ||
diff --git a/include/linux/timex.h b/include/linux/timex.h index 32d852f8cbe4..d23999f9499d 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -268,6 +268,7 @@ extern u64 tick_length; | |||
268 | extern void second_overflow(void); | 268 | extern void second_overflow(void); |
269 | extern void update_ntp_one_tick(void); | 269 | extern void update_ntp_one_tick(void); |
270 | extern int do_adjtimex(struct timex *); | 270 | extern int do_adjtimex(struct timex *); |
271 | extern void hardpps(const struct timespec *, const struct timespec *); | ||
271 | 272 | ||
272 | int read_current_timer(unsigned long *timer_val); | 273 | int read_current_timer(unsigned long *timer_val); |
273 | 274 | ||
diff --git a/include/linux/toshiba.h b/include/linux/toshiba.h index 6a7c4edf0e13..772dedbc3a22 100644 --- a/include/linux/toshiba.h +++ b/include/linux/toshiba.h | |||
@@ -33,6 +33,8 @@ typedef struct { | |||
33 | unsigned int edi __attribute__ ((packed)); | 33 | unsigned int edi __attribute__ ((packed)); |
34 | } SMMRegisters; | 34 | } SMMRegisters; |
35 | 35 | ||
36 | #ifdef __KERNEL__ | ||
36 | int tosh_smm(SMMRegisters *regs); | 37 | int tosh_smm(SMMRegisters *regs); |
38 | #endif /* __KERNEL__ */ | ||
37 | 39 | ||
38 | #endif | 40 | #endif |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 526d66f066a3..ff7dc08696a8 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -101,14 +101,15 @@ | |||
101 | * any pending driver I/O is completed. | 101 | * any pending driver I/O is completed. |
102 | * | 102 | * |
103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status, | 103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status, |
104 | * struct timespec *ts) | 104 | * struct pps_event_time *ts) |
105 | * | 105 | * |
106 | * Tells the discipline that the DCD pin has changed its status and | 106 | * Tells the discipline that the DCD pin has changed its status and |
107 | * the relative timestamp. Pointer ts can be NULL. | 107 | * the relative timestamp. Pointer ts cannot be NULL. |
108 | */ | 108 | */ |
109 | 109 | ||
110 | #include <linux/fs.h> | 110 | #include <linux/fs.h> |
111 | #include <linux/wait.h> | 111 | #include <linux/wait.h> |
112 | #include <linux/pps_kernel.h> | ||
112 | 113 | ||
113 | struct tty_ldisc_ops { | 114 | struct tty_ldisc_ops { |
114 | int magic; | 115 | int magic; |
@@ -143,7 +144,7 @@ struct tty_ldisc_ops { | |||
143 | char *fp, int count); | 144 | char *fp, int count); |
144 | void (*write_wakeup)(struct tty_struct *); | 145 | void (*write_wakeup)(struct tty_struct *); |
145 | void (*dcd_change)(struct tty_struct *, unsigned int, | 146 | void (*dcd_change)(struct tty_struct *, unsigned int, |
146 | struct timespec *); | 147 | struct pps_event_time *); |
147 | 148 | ||
148 | struct module *owner; | 149 | struct module *owner; |
149 | 150 | ||
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h index fa261a0da280..8da8c4e87da3 100644 --- a/include/linux/u64_stats_sync.h +++ b/include/linux/u64_stats_sync.h | |||
@@ -67,21 +67,21 @@ struct u64_stats_sync { | |||
67 | #endif | 67 | #endif |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static void inline u64_stats_update_begin(struct u64_stats_sync *syncp) | 70 | static inline void u64_stats_update_begin(struct u64_stats_sync *syncp) |
71 | { | 71 | { |
72 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 72 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
73 | write_seqcount_begin(&syncp->seq); | 73 | write_seqcount_begin(&syncp->seq); |
74 | #endif | 74 | #endif |
75 | } | 75 | } |
76 | 76 | ||
77 | static void inline u64_stats_update_end(struct u64_stats_sync *syncp) | 77 | static inline void u64_stats_update_end(struct u64_stats_sync *syncp) |
78 | { | 78 | { |
79 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 79 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
80 | write_seqcount_end(&syncp->seq); | 80 | write_seqcount_end(&syncp->seq); |
81 | #endif | 81 | #endif |
82 | } | 82 | } |
83 | 83 | ||
84 | static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *syncp) | 84 | static inline unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *syncp) |
85 | { | 85 | { |
86 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 86 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
87 | return read_seqcount_begin(&syncp->seq); | 87 | return read_seqcount_begin(&syncp->seq); |
@@ -93,7 +93,7 @@ static unsigned int inline u64_stats_fetch_begin(const struct u64_stats_sync *sy | |||
93 | #endif | 93 | #endif |
94 | } | 94 | } |
95 | 95 | ||
96 | static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp, | 96 | static inline bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp, |
97 | unsigned int start) | 97 | unsigned int start) |
98 | { | 98 | { |
99 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 99 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
@@ -112,7 +112,7 @@ static bool inline u64_stats_fetch_retry(const struct u64_stats_sync *syncp, | |||
112 | * - UP 32bit must disable BH. | 112 | * - UP 32bit must disable BH. |
113 | * - 64bit have no problem atomically reading u64 values, irq safe. | 113 | * - 64bit have no problem atomically reading u64 values, irq safe. |
114 | */ | 114 | */ |
115 | static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp) | 115 | static inline unsigned int u64_stats_fetch_begin_bh(const struct u64_stats_sync *syncp) |
116 | { | 116 | { |
117 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 117 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
118 | return read_seqcount_begin(&syncp->seq); | 118 | return read_seqcount_begin(&syncp->seq); |
@@ -124,7 +124,7 @@ static unsigned int inline u64_stats_fetch_begin_bh(const struct u64_stats_sync | |||
124 | #endif | 124 | #endif |
125 | } | 125 | } |
126 | 126 | ||
127 | static bool inline u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, | 127 | static inline bool u64_stats_fetch_retry_bh(const struct u64_stats_sync *syncp, |
128 | unsigned int start) | 128 | unsigned int start) |
129 | { | 129 | { |
130 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) | 130 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
diff --git a/include/linux/unaligned/packed_struct.h b/include/linux/unaligned/packed_struct.h index c9a6abd972a1..c0d817de4df2 100644 --- a/include/linux/unaligned/packed_struct.h +++ b/include/linux/unaligned/packed_struct.h | |||
@@ -3,9 +3,9 @@ | |||
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | 5 | ||
6 | struct __una_u16 { u16 x; } __attribute__((packed)); | 6 | struct __una_u16 { u16 x; } __packed; |
7 | struct __una_u32 { u32 x; } __attribute__((packed)); | 7 | struct __una_u32 { u32 x; } __packed; |
8 | struct __una_u64 { u64 x; } __attribute__((packed)); | 8 | struct __una_u64 { u64 x; } __packed; |
9 | 9 | ||
10 | static inline u16 __get_unaligned_cpu16(const void *p) | 10 | static inline u16 __get_unaligned_cpu16(const void *p) |
11 | { | 11 | { |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 8178156711f9..faf467944baf 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/err.h> | 7 | #include <linux/err.h> |
8 | 8 | ||
9 | #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8) | 9 | #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7) |
10 | #define UIDHASH_SZ (1 << UIDHASH_BITS) | 10 | #define UIDHASH_SZ (1 << UIDHASH_BITS) |
11 | 11 | ||
12 | struct user_namespace { | 12 | struct user_namespace { |
diff --git a/include/linux/xz.h b/include/linux/xz.h new file mode 100644 index 000000000000..64cffa6ddfce --- /dev/null +++ b/include/linux/xz.h | |||
@@ -0,0 +1,264 @@ | |||
1 | /* | ||
2 | * XZ decompressor | ||
3 | * | ||
4 | * Authors: Lasse Collin <lasse.collin@tukaani.org> | ||
5 | * Igor Pavlov <http://7-zip.org/> | ||
6 | * | ||
7 | * This file has been put into the public domain. | ||
8 | * You can do whatever you want with this file. | ||
9 | */ | ||
10 | |||
11 | #ifndef XZ_H | ||
12 | #define XZ_H | ||
13 | |||
14 | #ifdef __KERNEL__ | ||
15 | # include <linux/stddef.h> | ||
16 | # include <linux/types.h> | ||
17 | #else | ||
18 | # include <stddef.h> | ||
19 | # include <stdint.h> | ||
20 | #endif | ||
21 | |||
22 | /* In Linux, this is used to make extern functions static when needed. */ | ||
23 | #ifndef XZ_EXTERN | ||
24 | # define XZ_EXTERN extern | ||
25 | #endif | ||
26 | |||
27 | /** | ||
28 | * enum xz_mode - Operation mode | ||
29 | * | ||
30 | * @XZ_SINGLE: Single-call mode. This uses less RAM than | ||
31 | * than multi-call modes, because the LZMA2 | ||
32 | * dictionary doesn't need to be allocated as | ||
33 | * part of the decoder state. All required data | ||
34 | * structures are allocated at initialization, | ||
35 | * so xz_dec_run() cannot return XZ_MEM_ERROR. | ||
36 | * @XZ_PREALLOC: Multi-call mode with preallocated LZMA2 | ||
37 | * dictionary buffer. All data structures are | ||
38 | * allocated at initialization, so xz_dec_run() | ||
39 | * cannot return XZ_MEM_ERROR. | ||
40 | * @XZ_DYNALLOC: Multi-call mode. The LZMA2 dictionary is | ||
41 | * allocated once the required size has been | ||
42 | * parsed from the stream headers. If the | ||
43 | * allocation fails, xz_dec_run() will return | ||
44 | * XZ_MEM_ERROR. | ||
45 | * | ||
46 | * It is possible to enable support only for a subset of the above | ||
47 | * modes at compile time by defining XZ_DEC_SINGLE, XZ_DEC_PREALLOC, | ||
48 | * or XZ_DEC_DYNALLOC. The xz_dec kernel module is always compiled | ||
49 | * with support for all operation modes, but the preboot code may | ||
50 | * be built with fewer features to minimize code size. | ||
51 | */ | ||
52 | enum xz_mode { | ||
53 | XZ_SINGLE, | ||
54 | XZ_PREALLOC, | ||
55 | XZ_DYNALLOC | ||
56 | }; | ||
57 | |||
58 | /** | ||
59 | * enum xz_ret - Return codes | ||
60 | * @XZ_OK: Everything is OK so far. More input or more | ||
61 | * output space is required to continue. This | ||
62 | * return code is possible only in multi-call mode | ||
63 | * (XZ_PREALLOC or XZ_DYNALLOC). | ||
64 | * @XZ_STREAM_END: Operation finished successfully. | ||
65 | * @XZ_UNSUPPORTED_CHECK: Integrity check type is not supported. Decoding | ||
66 | * is still possible in multi-call mode by simply | ||
67 | * calling xz_dec_run() again. | ||
68 | * Note that this return value is used only if | ||
69 | * XZ_DEC_ANY_CHECK was defined at build time, | ||
70 | * which is not used in the kernel. Unsupported | ||
71 | * check types return XZ_OPTIONS_ERROR if | ||
72 | * XZ_DEC_ANY_CHECK was not defined at build time. | ||
73 | * @XZ_MEM_ERROR: Allocating memory failed. This return code is | ||
74 | * possible only if the decoder was initialized | ||
75 | * with XZ_DYNALLOC. The amount of memory that was | ||
76 | * tried to be allocated was no more than the | ||
77 | * dict_max argument given to xz_dec_init(). | ||
78 | * @XZ_MEMLIMIT_ERROR: A bigger LZMA2 dictionary would be needed than | ||
79 | * allowed by the dict_max argument given to | ||
80 | * xz_dec_init(). This return value is possible | ||
81 | * only in multi-call mode (XZ_PREALLOC or | ||
82 | * XZ_DYNALLOC); the single-call mode (XZ_SINGLE) | ||
83 | * ignores the dict_max argument. | ||
84 | * @XZ_FORMAT_ERROR: File format was not recognized (wrong magic | ||
85 | * bytes). | ||
86 | * @XZ_OPTIONS_ERROR: This implementation doesn't support the requested | ||
87 | * compression options. In the decoder this means | ||
88 | * that the header CRC32 matches, but the header | ||
89 | * itself specifies something that we don't support. | ||
90 | * @XZ_DATA_ERROR: Compressed data is corrupt. | ||
91 | * @XZ_BUF_ERROR: Cannot make any progress. Details are slightly | ||
92 | * different between multi-call and single-call | ||
93 | * mode; more information below. | ||
94 | * | ||
95 | * In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls | ||
96 | * to XZ code cannot consume any input and cannot produce any new output. | ||
97 | * This happens when there is no new input available, or the output buffer | ||
98 | * is full while at least one output byte is still pending. Assuming your | ||
99 | * code is not buggy, you can get this error only when decoding a compressed | ||
100 | * stream that is truncated or otherwise corrupt. | ||
101 | * | ||
102 | * In single-call mode, XZ_BUF_ERROR is returned only when the output buffer | ||
103 | * is too small or the compressed input is corrupt in a way that makes the | ||
104 | * decoder produce more output than the caller expected. When it is | ||
105 | * (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR | ||
106 | * is used instead of XZ_BUF_ERROR. | ||
107 | */ | ||
108 | enum xz_ret { | ||
109 | XZ_OK, | ||
110 | XZ_STREAM_END, | ||
111 | XZ_UNSUPPORTED_CHECK, | ||
112 | XZ_MEM_ERROR, | ||
113 | XZ_MEMLIMIT_ERROR, | ||
114 | XZ_FORMAT_ERROR, | ||
115 | XZ_OPTIONS_ERROR, | ||
116 | XZ_DATA_ERROR, | ||
117 | XZ_BUF_ERROR | ||
118 | }; | ||
119 | |||
120 | /** | ||
121 | * struct xz_buf - Passing input and output buffers to XZ code | ||
122 | * @in: Beginning of the input buffer. This may be NULL if and only | ||
123 | * if in_pos is equal to in_size. | ||
124 | * @in_pos: Current position in the input buffer. This must not exceed | ||
125 | * in_size. | ||
126 | * @in_size: Size of the input buffer | ||
127 | * @out: Beginning of the output buffer. This may be NULL if and only | ||
128 | * if out_pos is equal to out_size. | ||
129 | * @out_pos: Current position in the output buffer. This must not exceed | ||
130 | * out_size. | ||
131 | * @out_size: Size of the output buffer | ||
132 | * | ||
133 | * Only the contents of the output buffer from out[out_pos] onward, and | ||
134 | * the variables in_pos and out_pos are modified by the XZ code. | ||
135 | */ | ||
136 | struct xz_buf { | ||
137 | const uint8_t *in; | ||
138 | size_t in_pos; | ||
139 | size_t in_size; | ||
140 | |||
141 | uint8_t *out; | ||
142 | size_t out_pos; | ||
143 | size_t out_size; | ||
144 | }; | ||
145 | |||
146 | /** | ||
147 | * struct xz_dec - Opaque type to hold the XZ decoder state | ||
148 | */ | ||
149 | struct xz_dec; | ||
150 | |||
151 | /** | ||
152 | * xz_dec_init() - Allocate and initialize a XZ decoder state | ||
153 | * @mode: Operation mode | ||
154 | * @dict_max: Maximum size of the LZMA2 dictionary (history buffer) for | ||
155 | * multi-call decoding. This is ignored in single-call mode | ||
156 | * (mode == XZ_SINGLE). LZMA2 dictionary is always 2^n bytes | ||
157 | * or 2^n + 2^(n-1) bytes (the latter sizes are less common | ||
158 | * in practice), so other values for dict_max don't make sense. | ||
159 | * In the kernel, dictionary sizes of 64 KiB, 128 KiB, 256 KiB, | ||
160 | * 512 KiB, and 1 MiB are probably the only reasonable values, | ||
161 | * except for kernel and initramfs images where a bigger | ||
162 | * dictionary can be fine and useful. | ||
163 | * | ||
164 | * Single-call mode (XZ_SINGLE): xz_dec_run() decodes the whole stream at | ||
165 | * once. The caller must provide enough output space or the decoding will | ||
166 | * fail. The output space is used as the dictionary buffer, which is why | ||
167 | * there is no need to allocate the dictionary as part of the decoder's | ||
168 | * internal state. | ||
169 | * | ||
170 | * Because the output buffer is used as the workspace, streams encoded using | ||
171 | * a big dictionary are not a problem in single-call mode. It is enough that | ||
172 | * the output buffer is big enough to hold the actual uncompressed data; it | ||
173 | * can be smaller than the dictionary size stored in the stream headers. | ||
174 | * | ||
175 | * Multi-call mode with preallocated dictionary (XZ_PREALLOC): dict_max bytes | ||
176 | * of memory is preallocated for the LZMA2 dictionary. This way there is no | ||
177 | * risk that xz_dec_run() could run out of memory, since xz_dec_run() will | ||
178 | * never allocate any memory. Instead, if the preallocated dictionary is too | ||
179 | * small for decoding the given input stream, xz_dec_run() will return | ||
180 | * XZ_MEMLIMIT_ERROR. Thus, it is important to know what kind of data will be | ||
181 | * decoded to avoid allocating excessive amount of memory for the dictionary. | ||
182 | * | ||
183 | * Multi-call mode with dynamically allocated dictionary (XZ_DYNALLOC): | ||
184 | * dict_max specifies the maximum allowed dictionary size that xz_dec_run() | ||
185 | * may allocate once it has parsed the dictionary size from the stream | ||
186 | * headers. This way excessive allocations can be avoided while still | ||
187 | * limiting the maximum memory usage to a sane value to prevent running the | ||
188 | * system out of memory when decompressing streams from untrusted sources. | ||
189 | * | ||
190 | * On success, xz_dec_init() returns a pointer to struct xz_dec, which is | ||
191 | * ready to be used with xz_dec_run(). If memory allocation fails, | ||
192 | * xz_dec_init() returns NULL. | ||
193 | */ | ||
194 | XZ_EXTERN struct xz_dec *xz_dec_init(enum xz_mode mode, uint32_t dict_max); | ||
195 | |||
196 | /** | ||
197 | * xz_dec_run() - Run the XZ decoder | ||
198 | * @s: Decoder state allocated using xz_dec_init() | ||
199 | * @b: Input and output buffers | ||
200 | * | ||
201 | * The possible return values depend on build options and operation mode. | ||
202 | * See enum xz_ret for details. | ||
203 | * | ||
204 | * Note that if an error occurs in single-call mode (return value is not | ||
205 | * XZ_STREAM_END), b->in_pos and b->out_pos are not modified and the | ||
206 | * contents of the output buffer from b->out[b->out_pos] onward are | ||
207 | * undefined. This is true even after XZ_BUF_ERROR, because with some filter | ||
208 | * chains, there may be a second pass over the output buffer, and this pass | ||
209 | * cannot be properly done if the output buffer is truncated. Thus, you | ||
210 | * cannot give the single-call decoder a too small buffer and then expect to | ||
211 | * get that amount valid data from the beginning of the stream. You must use | ||
212 | * the multi-call decoder if you don't want to uncompress the whole stream. | ||
213 | */ | ||
214 | XZ_EXTERN enum xz_ret xz_dec_run(struct xz_dec *s, struct xz_buf *b); | ||
215 | |||
216 | /** | ||
217 | * xz_dec_reset() - Reset an already allocated decoder state | ||
218 | * @s: Decoder state allocated using xz_dec_init() | ||
219 | * | ||
220 | * This function can be used to reset the multi-call decoder state without | ||
221 | * freeing and reallocating memory with xz_dec_end() and xz_dec_init(). | ||
222 | * | ||
223 | * In single-call mode, xz_dec_reset() is always called in the beginning of | ||
224 | * xz_dec_run(). Thus, explicit call to xz_dec_reset() is useful only in | ||
225 | * multi-call mode. | ||
226 | */ | ||
227 | XZ_EXTERN void xz_dec_reset(struct xz_dec *s); | ||
228 | |||
229 | /** | ||
230 | * xz_dec_end() - Free the memory allocated for the decoder state | ||
231 | * @s: Decoder state allocated using xz_dec_init(). If s is NULL, | ||
232 | * this function does nothing. | ||
233 | */ | ||
234 | XZ_EXTERN void xz_dec_end(struct xz_dec *s); | ||
235 | |||
236 | /* | ||
237 | * Standalone build (userspace build or in-kernel build for boot time use) | ||
238 | * needs a CRC32 implementation. For normal in-kernel use, kernel's own | ||
239 | * CRC32 module is used instead, and users of this module don't need to | ||
240 | * care about the functions below. | ||
241 | */ | ||
242 | #ifndef XZ_INTERNAL_CRC32 | ||
243 | # ifdef __KERNEL__ | ||
244 | # define XZ_INTERNAL_CRC32 0 | ||
245 | # else | ||
246 | # define XZ_INTERNAL_CRC32 1 | ||
247 | # endif | ||
248 | #endif | ||
249 | |||
250 | #if XZ_INTERNAL_CRC32 | ||
251 | /* | ||
252 | * This must be called before any other xz_* function to initialize | ||
253 | * the CRC32 lookup table. | ||
254 | */ | ||
255 | XZ_EXTERN void xz_crc32_init(void); | ||
256 | |||
257 | /* | ||
258 | * Update CRC32 value using the polynomial from IEEE-802.3. To start a new | ||
259 | * calculation, the third argument must be zero. To continue the calculation, | ||
260 | * the previously returned value is passed as the third argument. | ||
261 | */ | ||
262 | XZ_EXTERN uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc); | ||
263 | #endif | ||
264 | #endif | ||
diff --git a/include/media/davinci/vpss.h b/include/media/davinci/vpss.h index c59cc029c74a..b586495bcd53 100644 --- a/include/media/davinci/vpss.h +++ b/include/media/davinci/vpss.h | |||
@@ -44,7 +44,7 @@ struct vpss_pg_frame_size { | |||
44 | short pplen; | 44 | short pplen; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | /* Used for enable/diable VPSS Clock */ | 47 | /* Used for enable/disable VPSS Clock */ |
48 | enum vpss_clock_sel { | 48 | enum vpss_clock_sel { |
49 | /* DM355/DM365 */ | 49 | /* DM355/DM365 */ |
50 | VPSS_CCDC_CLOCK, | 50 | VPSS_CCDC_CLOCK, |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 2b2769c5ca9f..2a128c8c2718 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -99,8 +99,8 @@ typedef __s32 sctp_assoc_t; | |||
99 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ | 99 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ |
100 | /* Options 104-106 are deprecated and removed. Do not use this space */ | 100 | /* Options 104-106 are deprecated and removed. Do not use this space */ |
101 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ | 101 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ |
102 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */ | 102 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */ |
103 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */ | 103 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */ |
104 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ | 104 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ |
105 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ | 105 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ |
106 | 106 | ||
diff --git a/include/scsi/fc/fc_fcp.h b/include/scsi/fc/fc_fcp.h index 8e9b222251c2..8a143ca79878 100644 --- a/include/scsi/fc/fc_fcp.h +++ b/include/scsi/fc/fc_fcp.h | |||
@@ -46,7 +46,7 @@ | |||
46 | */ | 46 | */ |
47 | struct fcp_cmnd { | 47 | struct fcp_cmnd { |
48 | __u8 fc_lun[8]; /* logical unit number */ | 48 | __u8 fc_lun[8]; /* logical unit number */ |
49 | __u8 fc_cmdref; /* commmand reference number */ | 49 | __u8 fc_cmdref; /* command reference number */ |
50 | __u8 fc_pri_ta; /* priority and task attribute */ | 50 | __u8 fc_pri_ta; /* priority and task attribute */ |
51 | __u8 fc_tm_flags; /* task management flags */ | 51 | __u8 fc_tm_flags; /* task management flags */ |
52 | __u8 fc_flags; /* additional len & flags */ | 52 | __u8 fc_flags; /* additional len & flags */ |
@@ -58,7 +58,7 @@ struct fcp_cmnd { | |||
58 | 58 | ||
59 | struct fcp_cmnd32 { | 59 | struct fcp_cmnd32 { |
60 | __u8 fc_lun[8]; /* logical unit number */ | 60 | __u8 fc_lun[8]; /* logical unit number */ |
61 | __u8 fc_cmdref; /* commmand reference number */ | 61 | __u8 fc_cmdref; /* command reference number */ |
62 | __u8 fc_pri_ta; /* priority and task attribute */ | 62 | __u8 fc_pri_ta; /* priority and task attribute */ |
63 | __u8 fc_tm_flags; /* task management flags */ | 63 | __u8 fc_tm_flags; /* task management flags */ |
64 | __u8 fc_flags; /* additional len & flags */ | 64 | __u8 fc_flags; /* additional len & flags */ |
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 6dd3a51ab1cb..46e3cd8e197a 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h | |||
@@ -6,6 +6,36 @@ | |||
6 | #undef TRACE_SYSTEM | 6 | #undef TRACE_SYSTEM |
7 | #define TRACE_SYSTEM kvm | 7 | #define TRACE_SYSTEM kvm |
8 | 8 | ||
9 | #define ERSN(x) { KVM_EXIT_##x, "KVM_EXIT_" #x } | ||
10 | |||
11 | #define kvm_trace_exit_reason \ | ||
12 | ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \ | ||
13 | ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ | ||
14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ | ||
15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ | ||
16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI) | ||
17 | |||
18 | TRACE_EVENT(kvm_userspace_exit, | ||
19 | TP_PROTO(__u32 reason, int errno), | ||
20 | TP_ARGS(reason, errno), | ||
21 | |||
22 | TP_STRUCT__entry( | ||
23 | __field( __u32, reason ) | ||
24 | __field( int, errno ) | ||
25 | ), | ||
26 | |||
27 | TP_fast_assign( | ||
28 | __entry->reason = reason; | ||
29 | __entry->errno = errno; | ||
30 | ), | ||
31 | |||
32 | TP_printk("reason %s (%d)", | ||
33 | __entry->errno < 0 ? | ||
34 | (__entry->errno == -EINTR ? "restart" : "error") : | ||
35 | __print_symbolic(__entry->reason, kvm_trace_exit_reason), | ||
36 | __entry->errno < 0 ? -__entry->errno : __entry->reason) | ||
37 | ); | ||
38 | |||
9 | #if defined(__KVM_HAVE_IOAPIC) | 39 | #if defined(__KVM_HAVE_IOAPIC) |
10 | TRACE_EVENT(kvm_set_irq, | 40 | TRACE_EVENT(kvm_set_irq, |
11 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), | 41 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), |
@@ -185,6 +215,97 @@ TRACE_EVENT(kvm_age_page, | |||
185 | __entry->referenced ? "YOUNG" : "OLD") | 215 | __entry->referenced ? "YOUNG" : "OLD") |
186 | ); | 216 | ); |
187 | 217 | ||
218 | #ifdef CONFIG_KVM_ASYNC_PF | ||
219 | DECLARE_EVENT_CLASS(kvm_async_get_page_class, | ||
220 | |||
221 | TP_PROTO(u64 gva, u64 gfn), | ||
222 | |||
223 | TP_ARGS(gva, gfn), | ||
224 | |||
225 | TP_STRUCT__entry( | ||
226 | __field(__u64, gva) | ||
227 | __field(u64, gfn) | ||
228 | ), | ||
229 | |||
230 | TP_fast_assign( | ||
231 | __entry->gva = gva; | ||
232 | __entry->gfn = gfn; | ||
233 | ), | ||
234 | |||
235 | TP_printk("gva = %#llx, gfn = %#llx", __entry->gva, __entry->gfn) | ||
236 | ); | ||
237 | |||
238 | DEFINE_EVENT(kvm_async_get_page_class, kvm_try_async_get_page, | ||
239 | |||
240 | TP_PROTO(u64 gva, u64 gfn), | ||
241 | |||
242 | TP_ARGS(gva, gfn) | ||
243 | ); | ||
244 | |||
245 | DEFINE_EVENT(kvm_async_get_page_class, kvm_async_pf_doublefault, | ||
246 | |||
247 | TP_PROTO(u64 gva, u64 gfn), | ||
248 | |||
249 | TP_ARGS(gva, gfn) | ||
250 | ); | ||
251 | |||
252 | DECLARE_EVENT_CLASS(kvm_async_pf_nopresent_ready, | ||
253 | |||
254 | TP_PROTO(u64 token, u64 gva), | ||
255 | |||
256 | TP_ARGS(token, gva), | ||
257 | |||
258 | TP_STRUCT__entry( | ||
259 | __field(__u64, token) | ||
260 | __field(__u64, gva) | ||
261 | ), | ||
262 | |||
263 | TP_fast_assign( | ||
264 | __entry->token = token; | ||
265 | __entry->gva = gva; | ||
266 | ), | ||
267 | |||
268 | TP_printk("token %#llx gva %#llx", __entry->token, __entry->gva) | ||
269 | |||
270 | ); | ||
271 | |||
272 | DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_not_present, | ||
273 | |||
274 | TP_PROTO(u64 token, u64 gva), | ||
275 | |||
276 | TP_ARGS(token, gva) | ||
277 | ); | ||
278 | |||
279 | DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_ready, | ||
280 | |||
281 | TP_PROTO(u64 token, u64 gva), | ||
282 | |||
283 | TP_ARGS(token, gva) | ||
284 | ); | ||
285 | |||
286 | TRACE_EVENT( | ||
287 | kvm_async_pf_completed, | ||
288 | TP_PROTO(unsigned long address, struct page *page, u64 gva), | ||
289 | TP_ARGS(address, page, gva), | ||
290 | |||
291 | TP_STRUCT__entry( | ||
292 | __field(unsigned long, address) | ||
293 | __field(pfn_t, pfn) | ||
294 | __field(u64, gva) | ||
295 | ), | ||
296 | |||
297 | TP_fast_assign( | ||
298 | __entry->address = address; | ||
299 | __entry->pfn = page ? page_to_pfn(page) : 0; | ||
300 | __entry->gva = gva; | ||
301 | ), | ||
302 | |||
303 | TP_printk("gva %#llx address %#lx pfn %#llx", __entry->gva, | ||
304 | __entry->address, __entry->pfn) | ||
305 | ); | ||
306 | |||
307 | #endif | ||
308 | |||
188 | #endif /* _TRACE_KVM_MAIN_H */ | 309 | #endif /* _TRACE_KVM_MAIN_H */ |
189 | 310 | ||
190 | /* This part must be outside protection */ | 311 | /* This part must be outside protection */ |
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index 43e2d7d33976..7a1d15ff19b7 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h | |||
@@ -94,7 +94,7 @@ struct xenbus_driver { | |||
94 | int (*remove)(struct xenbus_device *dev); | 94 | int (*remove)(struct xenbus_device *dev); |
95 | int (*suspend)(struct xenbus_device *dev, pm_message_t state); | 95 | int (*suspend)(struct xenbus_device *dev, pm_message_t state); |
96 | int (*resume)(struct xenbus_device *dev); | 96 | int (*resume)(struct xenbus_device *dev); |
97 | int (*uevent)(struct xenbus_device *, char **, int, char *, int); | 97 | int (*uevent)(struct xenbus_device *, struct kobj_uevent_env *); |
98 | struct device_driver driver; | 98 | struct device_driver driver; |
99 | int (*read_otherend_details)(struct xenbus_device *dev); | 99 | int (*read_otherend_details)(struct xenbus_device *dev); |
100 | int (*is_ready)(struct xenbus_device *dev); | 100 | int (*is_ready)(struct xenbus_device *dev); |