diff options
Diffstat (limited to 'include')
184 files changed, 4801 insertions, 1967 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 1b3b36068ca5..3cd9ccdcbd8f 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -30,8 +30,6 @@ | |||
30 | 30 | ||
31 | #include <acpi/acpi.h> | 31 | #include <acpi/acpi.h> |
32 | 32 | ||
33 | #define PREFIX "ACPI: " | ||
34 | |||
35 | /* TBD: Make dynamic */ | 33 | /* TBD: Make dynamic */ |
36 | #define ACPI_MAX_HANDLES 10 | 34 | #define ACPI_MAX_HANDLES 10 |
37 | struct acpi_handle_list { | 35 | struct acpi_handle_list { |
@@ -72,7 +70,6 @@ enum acpi_bus_device_type { | |||
72 | ACPI_BUS_TYPE_POWER, | 70 | ACPI_BUS_TYPE_POWER, |
73 | ACPI_BUS_TYPE_PROCESSOR, | 71 | ACPI_BUS_TYPE_PROCESSOR, |
74 | ACPI_BUS_TYPE_THERMAL, | 72 | ACPI_BUS_TYPE_THERMAL, |
75 | ACPI_BUS_TYPE_SYSTEM, | ||
76 | ACPI_BUS_TYPE_POWER_BUTTON, | 73 | ACPI_BUS_TYPE_POWER_BUTTON, |
77 | ACPI_BUS_TYPE_SLEEP_BUTTON, | 74 | ACPI_BUS_TYPE_SLEEP_BUTTON, |
78 | ACPI_BUS_DEVICE_TYPE_COUNT | 75 | ACPI_BUS_DEVICE_TYPE_COUNT |
@@ -89,7 +86,6 @@ struct acpi_device; | |||
89 | typedef int (*acpi_op_add) (struct acpi_device * device); | 86 | typedef int (*acpi_op_add) (struct acpi_device * device); |
90 | typedef int (*acpi_op_remove) (struct acpi_device * device, int type); | 87 | typedef int (*acpi_op_remove) (struct acpi_device * device, int type); |
91 | typedef int (*acpi_op_start) (struct acpi_device * device); | 88 | typedef int (*acpi_op_start) (struct acpi_device * device); |
92 | typedef int (*acpi_op_stop) (struct acpi_device * device, int type); | ||
93 | typedef int (*acpi_op_suspend) (struct acpi_device * device, | 89 | typedef int (*acpi_op_suspend) (struct acpi_device * device, |
94 | pm_message_t state); | 90 | pm_message_t state); |
95 | typedef int (*acpi_op_resume) (struct acpi_device * device); | 91 | typedef int (*acpi_op_resume) (struct acpi_device * device); |
@@ -106,7 +102,6 @@ struct acpi_device_ops { | |||
106 | acpi_op_add add; | 102 | acpi_op_add add; |
107 | acpi_op_remove remove; | 103 | acpi_op_remove remove; |
108 | acpi_op_start start; | 104 | acpi_op_start start; |
109 | acpi_op_stop stop; | ||
110 | acpi_op_suspend suspend; | 105 | acpi_op_suspend suspend; |
111 | acpi_op_resume resume; | 106 | acpi_op_resume resume; |
112 | acpi_op_bind bind; | 107 | acpi_op_bind bind; |
@@ -146,10 +141,7 @@ struct acpi_device_status { | |||
146 | 141 | ||
147 | struct acpi_device_flags { | 142 | struct acpi_device_flags { |
148 | u32 dynamic_status:1; | 143 | u32 dynamic_status:1; |
149 | u32 hardware_id:1; | ||
150 | u32 compatible_ids:1; | ||
151 | u32 bus_address:1; | 144 | u32 bus_address:1; |
152 | u32 unique_id:1; | ||
153 | u32 removable:1; | 145 | u32 removable:1; |
154 | u32 ejectable:1; | 146 | u32 ejectable:1; |
155 | u32 lockable:1; | 147 | u32 lockable:1; |
@@ -158,7 +150,7 @@ struct acpi_device_flags { | |||
158 | u32 performance_manageable:1; | 150 | u32 performance_manageable:1; |
159 | u32 wake_capable:1; /* Wakeup(_PRW) supported? */ | 151 | u32 wake_capable:1; /* Wakeup(_PRW) supported? */ |
160 | u32 force_power_state:1; | 152 | u32 force_power_state:1; |
161 | u32 reserved:19; | 153 | u32 reserved:22; |
162 | }; | 154 | }; |
163 | 155 | ||
164 | /* File System */ | 156 | /* File System */ |
@@ -173,25 +165,26 @@ struct acpi_device_dir { | |||
173 | 165 | ||
174 | typedef char acpi_bus_id[8]; | 166 | typedef char acpi_bus_id[8]; |
175 | typedef unsigned long acpi_bus_address; | 167 | typedef unsigned long acpi_bus_address; |
176 | typedef char acpi_hardware_id[15]; | ||
177 | typedef char acpi_unique_id[9]; | ||
178 | typedef char acpi_device_name[40]; | 168 | typedef char acpi_device_name[40]; |
179 | typedef char acpi_device_class[20]; | 169 | typedef char acpi_device_class[20]; |
180 | 170 | ||
171 | struct acpi_hardware_id { | ||
172 | struct list_head list; | ||
173 | char *id; | ||
174 | }; | ||
175 | |||
181 | struct acpi_device_pnp { | 176 | struct acpi_device_pnp { |
182 | acpi_bus_id bus_id; /* Object name */ | 177 | acpi_bus_id bus_id; /* Object name */ |
183 | acpi_bus_address bus_address; /* _ADR */ | 178 | acpi_bus_address bus_address; /* _ADR */ |
184 | acpi_hardware_id hardware_id; /* _HID */ | 179 | char *unique_id; /* _UID */ |
185 | struct acpi_compatible_id_list *cid_list; /* _CIDs */ | 180 | struct list_head ids; /* _HID and _CIDs */ |
186 | acpi_unique_id unique_id; /* _UID */ | ||
187 | acpi_device_name device_name; /* Driver-determined */ | 181 | acpi_device_name device_name; /* Driver-determined */ |
188 | acpi_device_class device_class; /* " */ | 182 | acpi_device_class device_class; /* " */ |
189 | }; | 183 | }; |
190 | 184 | ||
191 | #define acpi_device_bid(d) ((d)->pnp.bus_id) | 185 | #define acpi_device_bid(d) ((d)->pnp.bus_id) |
192 | #define acpi_device_adr(d) ((d)->pnp.bus_address) | 186 | #define acpi_device_adr(d) ((d)->pnp.bus_address) |
193 | #define acpi_device_hid(d) ((d)->pnp.hardware_id) | 187 | char *acpi_device_hid(struct acpi_device *device); |
194 | #define acpi_device_uid(d) ((d)->pnp.unique_id) | ||
195 | #define acpi_device_name(d) ((d)->pnp.device_name) | 188 | #define acpi_device_name(d) ((d)->pnp.device_name) |
196 | #define acpi_device_class(d) ((d)->pnp.device_class) | 189 | #define acpi_device_class(d) ((d)->pnp.device_class) |
197 | 190 | ||
@@ -268,7 +261,8 @@ struct acpi_device_wakeup { | |||
268 | /* Device */ | 261 | /* Device */ |
269 | 262 | ||
270 | struct acpi_device { | 263 | struct acpi_device { |
271 | acpi_handle handle; | 264 | int device_type; |
265 | acpi_handle handle; /* no handle for fixed hardware */ | ||
272 | struct acpi_device *parent; | 266 | struct acpi_device *parent; |
273 | struct list_head children; | 267 | struct list_head children; |
274 | struct list_head node; | 268 | struct list_head node; |
@@ -314,7 +308,7 @@ struct acpi_bus_event { | |||
314 | 308 | ||
315 | extern struct kobject *acpi_kobj; | 309 | extern struct kobject *acpi_kobj; |
316 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); | 310 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); |
317 | void acpi_bus_private_data_handler(acpi_handle, u32, void *); | 311 | void acpi_bus_private_data_handler(acpi_handle, void *); |
318 | int acpi_bus_get_private_data(acpi_handle, void **); | 312 | int acpi_bus_get_private_data(acpi_handle, void **); |
319 | extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); | 313 | extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32); |
320 | extern int register_acpi_notifier(struct notifier_block *); | 314 | extern int register_acpi_notifier(struct notifier_block *); |
@@ -327,7 +321,9 @@ extern void unregister_acpi_bus_notifier(struct notifier_block *nb); | |||
327 | */ | 321 | */ |
328 | 322 | ||
329 | int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); | 323 | int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); |
330 | void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context); | 324 | void acpi_bus_data_handler(acpi_handle handle, void *context); |
325 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, | ||
326 | unsigned long long *sta); | ||
331 | int acpi_bus_get_status(struct acpi_device *device); | 327 | int acpi_bus_get_status(struct acpi_device *device); |
332 | int acpi_bus_get_power(acpi_handle handle, int *state); | 328 | int acpi_bus_get_power(acpi_handle handle, int *state); |
333 | int acpi_bus_set_power(acpi_handle handle, int state); | 329 | int acpi_bus_set_power(acpi_handle handle, int state); |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index ab0b85cf21f3..eb0e7189075f 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -245,6 +245,9 @@ acpi_status acpi_osi_invalidate(char* interface); | |||
245 | acpi_status | 245 | acpi_status |
246 | acpi_os_validate_address(u8 space_id, acpi_physical_address address, | 246 | acpi_os_validate_address(u8 space_id, acpi_physical_address address, |
247 | acpi_size length, char *name); | 247 | acpi_size length, char *name); |
248 | acpi_status | ||
249 | acpi_os_invalidate_address(u8 space_id, acpi_physical_address address, | ||
250 | acpi_size length); | ||
248 | 251 | ||
249 | u64 acpi_os_get_timer(void); | 252 | u64 acpi_os_get_timer(void); |
250 | 253 | ||
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 82ec6a3c0500..e723b0fd8e41 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 48 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
49 | 49 | ||
50 | #define ACPI_CA_VERSION 0x20090521 | 50 | #define ACPI_CA_VERSION 0x20090903 |
51 | 51 | ||
52 | #include "actypes.h" | 52 | #include "actypes.h" |
53 | #include "actbl.h" | 53 | #include "actbl.h" |
@@ -64,6 +64,7 @@ extern u8 acpi_gbl_enable_interpreter_slack; | |||
64 | extern u8 acpi_gbl_all_methods_serialized; | 64 | extern u8 acpi_gbl_all_methods_serialized; |
65 | extern u8 acpi_gbl_create_osi_method; | 65 | extern u8 acpi_gbl_create_osi_method; |
66 | extern u8 acpi_gbl_leave_wake_gpes_disabled; | 66 | extern u8 acpi_gbl_leave_wake_gpes_disabled; |
67 | extern u8 acpi_gbl_use_default_register_widths; | ||
67 | extern acpi_name acpi_gbl_trace_method_name; | 68 | extern acpi_name acpi_gbl_trace_method_name; |
68 | extern u32 acpi_gbl_trace_flags; | 69 | extern u32 acpi_gbl_trace_flags; |
69 | 70 | ||
@@ -199,7 +200,8 @@ acpi_evaluate_object_typed(acpi_handle object, | |||
199 | acpi_object_type return_type); | 200 | acpi_object_type return_type); |
200 | 201 | ||
201 | acpi_status | 202 | acpi_status |
202 | acpi_get_object_info(acpi_handle handle, struct acpi_buffer *return_buffer); | 203 | acpi_get_object_info(acpi_handle handle, |
204 | struct acpi_device_info **return_buffer); | ||
203 | 205 | ||
204 | acpi_status acpi_install_method(u8 *buffer); | 206 | acpi_status acpi_install_method(u8 *buffer); |
205 | 207 | ||
@@ -359,9 +361,9 @@ acpi_status acpi_set_firmware_waking_vector(u32 physical_address); | |||
359 | acpi_status acpi_set_firmware_waking_vector64(u64 physical_address); | 361 | acpi_status acpi_set_firmware_waking_vector64(u64 physical_address); |
360 | #endif | 362 | #endif |
361 | 363 | ||
362 | acpi_status acpi_read(u32 *value, struct acpi_generic_address *reg); | 364 | acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); |
363 | 365 | ||
364 | acpi_status acpi_write(u32 value, struct acpi_generic_address *reg); | 366 | acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); |
365 | 367 | ||
366 | acpi_status | 368 | acpi_status |
367 | acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); | 369 | acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 222733d01f36..1b6587952604 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -44,9 +44,23 @@ | |||
44 | #ifndef __ACTBL_H__ | 44 | #ifndef __ACTBL_H__ |
45 | #define __ACTBL_H__ | 45 | #define __ACTBL_H__ |
46 | 46 | ||
47 | /******************************************************************************* | ||
48 | * | ||
49 | * Fundamental ACPI tables | ||
50 | * | ||
51 | * This file contains definitions for the ACPI tables that are directly consumed | ||
52 | * by ACPICA. All other tables are consumed by the OS-dependent ACPI-related | ||
53 | * device drivers and other OS support code. | ||
54 | * | ||
55 | * The RSDP and FACS do not use the common ACPI table header. All other ACPI | ||
56 | * tables use the header. | ||
57 | * | ||
58 | ******************************************************************************/ | ||
59 | |||
47 | /* | 60 | /* |
48 | * Values for description table header signatures. Useful because they make | 61 | * Values for description table header signatures for tables defined in this |
49 | * it more difficult to inadvertently type in the wrong signature. | 62 | * file. Useful because they make it more difficult to inadvertently type in |
63 | * the wrong signature. | ||
50 | */ | 64 | */ |
51 | #define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */ | 65 | #define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */ |
52 | #define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */ | 66 | #define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */ |
@@ -65,11 +79,6 @@ | |||
65 | #pragma pack(1) | 79 | #pragma pack(1) |
66 | 80 | ||
67 | /* | 81 | /* |
68 | * These are the ACPI tables that are directly consumed by the subsystem. | ||
69 | * | ||
70 | * The RSDP and FACS do not use the common ACPI table header. All other ACPI | ||
71 | * tables use the header. | ||
72 | * | ||
73 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. | 82 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. |
74 | * This is the only type that is even remotely portable. Anything else is not | 83 | * This is the only type that is even remotely portable. Anything else is not |
75 | * portable, so do not use any other bitfield types. | 84 | * portable, so do not use any other bitfield types. |
@@ -77,9 +86,8 @@ | |||
77 | 86 | ||
78 | /******************************************************************************* | 87 | /******************************************************************************* |
79 | * | 88 | * |
80 | * ACPI Table Header. This common header is used by all tables except the | 89 | * Master ACPI Table Header. This common header is used by all ACPI tables |
81 | * RSDP and FACS. The define is used for direct inclusion of header into | 90 | * except the RSDP and FACS. |
82 | * other ACPI tables | ||
83 | * | 91 | * |
84 | ******************************************************************************/ | 92 | ******************************************************************************/ |
85 | 93 | ||
@@ -95,13 +103,16 @@ struct acpi_table_header { | |||
95 | u32 asl_compiler_revision; /* ASL compiler version */ | 103 | u32 asl_compiler_revision; /* ASL compiler version */ |
96 | }; | 104 | }; |
97 | 105 | ||
98 | /* | 106 | /******************************************************************************* |
107 | * | ||
99 | * GAS - Generic Address Structure (ACPI 2.0+) | 108 | * GAS - Generic Address Structure (ACPI 2.0+) |
100 | * | 109 | * |
101 | * Note: Since this structure is used in the ACPI tables, it is byte aligned. | 110 | * Note: Since this structure is used in the ACPI tables, it is byte aligned. |
102 | * If misalignment is not supported, access to the Address field must be | 111 | * If misaliged access is not supported by the hardware, accesses to the |
103 | * performed with care. | 112 | * 64-bit Address field must be performed with care. |
104 | */ | 113 | * |
114 | ******************************************************************************/ | ||
115 | |||
105 | struct acpi_generic_address { | 116 | struct acpi_generic_address { |
106 | u8 space_id; /* Address space where struct or register exists */ | 117 | u8 space_id; /* Address space where struct or register exists */ |
107 | u8 bit_width; /* Size in bits of given register */ | 118 | u8 bit_width; /* Size in bits of given register */ |
@@ -113,6 +124,7 @@ struct acpi_generic_address { | |||
113 | /******************************************************************************* | 124 | /******************************************************************************* |
114 | * | 125 | * |
115 | * RSDP - Root System Description Pointer (Signature is "RSD PTR ") | 126 | * RSDP - Root System Description Pointer (Signature is "RSD PTR ") |
127 | * Version 2 | ||
116 | * | 128 | * |
117 | ******************************************************************************/ | 129 | ******************************************************************************/ |
118 | 130 | ||
@@ -133,6 +145,7 @@ struct acpi_table_rsdp { | |||
133 | /******************************************************************************* | 145 | /******************************************************************************* |
134 | * | 146 | * |
135 | * RSDT/XSDT - Root System Description Tables | 147 | * RSDT/XSDT - Root System Description Tables |
148 | * Version 1 (both) | ||
136 | * | 149 | * |
137 | ******************************************************************************/ | 150 | ******************************************************************************/ |
138 | 151 | ||
@@ -161,21 +174,29 @@ struct acpi_table_facs { | |||
161 | u32 flags; | 174 | u32 flags; |
162 | u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ | 175 | u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ |
163 | u8 version; /* Version of this table (ACPI 2.0+) */ | 176 | u8 version; /* Version of this table (ACPI 2.0+) */ |
164 | u8 reserved[31]; /* Reserved, must be zero */ | 177 | u8 reserved[3]; /* Reserved, must be zero */ |
178 | u32 ospm_flags; /* Flags to be set by OSPM (ACPI 4.0) */ | ||
179 | u8 reserved1[24]; /* Reserved, must be zero */ | ||
165 | }; | 180 | }; |
166 | 181 | ||
167 | /* Flag macros */ | 182 | /* Masks for global_lock flag field above */ |
168 | 183 | ||
169 | #define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */ | 184 | #define ACPI_GLOCK_PENDING (1) /* 00: Pending global lock ownership */ |
185 | #define ACPI_GLOCK_OWNED (1<<1) /* 01: Global lock is owned */ | ||
170 | 186 | ||
171 | /* Global lock flags */ | 187 | /* Masks for Flags field above */ |
172 | 188 | ||
173 | #define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */ | 189 | #define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */ |
174 | #define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */ | 190 | #define ACPI_FACS_64BIT_WAKE (1<<1) /* 01: 64-bit wake vector supported (ACPI 4.0) */ |
191 | |||
192 | /* Masks for ospm_flags field above */ | ||
193 | |||
194 | #define ACPI_FACS_64BIT_ENVIRONMENT (1) /* 00: 64-bit wake environment is required (ACPI 4.0) */ | ||
175 | 195 | ||
176 | /******************************************************************************* | 196 | /******************************************************************************* |
177 | * | 197 | * |
178 | * FADT - Fixed ACPI Description Table (Signature "FACP") | 198 | * FADT - Fixed ACPI Description Table (Signature "FACP") |
199 | * Version 4 | ||
179 | * | 200 | * |
180 | ******************************************************************************/ | 201 | ******************************************************************************/ |
181 | 202 | ||
@@ -236,7 +257,7 @@ struct acpi_table_fadt { | |||
236 | struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ | 257 | struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ |
237 | }; | 258 | }; |
238 | 259 | ||
239 | /* FADT Boot Architecture Flags (boot_flags) */ | 260 | /* Masks for FADT Boot Architecture Flags (boot_flags) */ |
240 | 261 | ||
241 | #define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ | 262 | #define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ |
242 | #define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ | 263 | #define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ |
@@ -246,7 +267,7 @@ struct acpi_table_fadt { | |||
246 | 267 | ||
247 | #define FADT2_REVISION_ID 3 | 268 | #define FADT2_REVISION_ID 3 |
248 | 269 | ||
249 | /* FADT flags */ | 270 | /* Masks for FADT flags */ |
250 | 271 | ||
251 | #define ACPI_FADT_WBINVD (1) /* 00: [V1] The wbinvd instruction works properly */ | 272 | #define ACPI_FADT_WBINVD (1) /* 00: [V1] The wbinvd instruction works properly */ |
252 | #define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] wbinvd flushes but does not invalidate caches */ | 273 | #define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] wbinvd flushes but does not invalidate caches */ |
@@ -269,7 +290,7 @@ struct acpi_table_fadt { | |||
269 | #define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ | 290 | #define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ |
270 | #define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local x_aPICs must use physical dest mode (ACPI 3.0) */ | 291 | #define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local x_aPICs must use physical dest mode (ACPI 3.0) */ |
271 | 292 | ||
272 | /* FADT Prefered Power Management Profiles */ | 293 | /* Values for preferred_profile (Prefered Power Management Profiles) */ |
273 | 294 | ||
274 | enum acpi_prefered_pm_profiles { | 295 | enum acpi_prefered_pm_profiles { |
275 | PM_UNSPECIFIED = 0, | 296 | PM_UNSPECIFIED = 0, |
@@ -287,14 +308,16 @@ enum acpi_prefered_pm_profiles { | |||
287 | 308 | ||
288 | #define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f) | 309 | #define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f) |
289 | 310 | ||
311 | /* | ||
312 | * Internal table-related structures | ||
313 | */ | ||
290 | union acpi_name_union { | 314 | union acpi_name_union { |
291 | u32 integer; | 315 | u32 integer; |
292 | char ascii[4]; | 316 | char ascii[4]; |
293 | }; | 317 | }; |
294 | 318 | ||
295 | /* | 319 | /* Internal ACPI Table Descriptor. One per ACPI table. */ |
296 | * Internal ACPI Table Descriptor. One per ACPI table | 320 | |
297 | */ | ||
298 | struct acpi_table_desc { | 321 | struct acpi_table_desc { |
299 | acpi_physical_address address; | 322 | acpi_physical_address address; |
300 | struct acpi_table_header *pointer; | 323 | struct acpi_table_header *pointer; |
@@ -304,7 +327,7 @@ struct acpi_table_desc { | |||
304 | u8 flags; | 327 | u8 flags; |
305 | }; | 328 | }; |
306 | 329 | ||
307 | /* Flags for above */ | 330 | /* Masks for Flags field above */ |
308 | 331 | ||
309 | #define ACPI_TABLE_ORIGIN_UNKNOWN (0) | 332 | #define ACPI_TABLE_ORIGIN_UNKNOWN (0) |
310 | #define ACPI_TABLE_ORIGIN_MAPPED (1) | 333 | #define ACPI_TABLE_ORIGIN_MAPPED (1) |
@@ -318,5 +341,6 @@ struct acpi_table_desc { | |||
318 | */ | 341 | */ |
319 | 342 | ||
320 | #include <acpi/actbl1.h> | 343 | #include <acpi/actbl1.h> |
344 | #include <acpi/actbl2.h> | ||
321 | 345 | ||
322 | #endif /* __ACTBL_H__ */ | 346 | #endif /* __ACTBL_H__ */ |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 59ade0752473..0b9b430b092b 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
@@ -46,41 +46,31 @@ | |||
46 | 46 | ||
47 | /******************************************************************************* | 47 | /******************************************************************************* |
48 | * | 48 | * |
49 | * Additional ACPI Tables | 49 | * Additional ACPI Tables (1) |
50 | * | 50 | * |
51 | * These tables are not consumed directly by the ACPICA subsystem, but are | 51 | * These tables are not consumed directly by the ACPICA subsystem, but are |
52 | * included here to support device drivers and the AML disassembler. | 52 | * included here to support device drivers and the AML disassembler. |
53 | * | 53 | * |
54 | * The tables in this file are fully defined within the ACPI specification. | ||
55 | * | ||
54 | ******************************************************************************/ | 56 | ******************************************************************************/ |
55 | 57 | ||
56 | /* | 58 | /* |
57 | * Values for description table header signatures. Useful because they make | 59 | * Values for description table header signatures for tables defined in this |
58 | * it more difficult to inadvertently type in the wrong signature. | 60 | * file. Useful because they make it more difficult to inadvertently type in |
61 | * the wrong signature. | ||
59 | */ | 62 | */ |
60 | #define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */ | ||
61 | #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */ | 63 | #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */ |
62 | #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ | ||
63 | #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ | 64 | #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ |
64 | #define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ | ||
65 | #define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */ | ||
66 | #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ | 65 | #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ |
67 | #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */ | 66 | #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */ |
68 | #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */ | 67 | #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */ |
69 | #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */ | 68 | #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */ |
70 | #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ | ||
71 | #define ACPI_SIG_IBFT "IBFT" /* i_sCSI Boot Firmware Table */ | ||
72 | #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ | 69 | #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ |
73 | #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ | 70 | #define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */ |
74 | #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ | 71 | #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ |
75 | #define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */ | ||
76 | #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ | 72 | #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ |
77 | #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ | ||
78 | #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ | ||
79 | #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ | 73 | #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ |
80 | #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ | ||
81 | #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */ | ||
82 | #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ | ||
83 | #define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ | ||
84 | 74 | ||
85 | /* | 75 | /* |
86 | * All tables must be byte-packed to match the ACPI specification, since | 76 | * All tables must be byte-packed to match the ACPI specification, since |
@@ -94,14 +84,20 @@ | |||
94 | * portable, so do not use any other bitfield types. | 84 | * portable, so do not use any other bitfield types. |
95 | */ | 85 | */ |
96 | 86 | ||
97 | /* Common Subtable header (used in MADT, SRAT, etc.) */ | 87 | /******************************************************************************* |
88 | * | ||
89 | * Common subtable headers | ||
90 | * | ||
91 | ******************************************************************************/ | ||
92 | |||
93 | /* Generic subtable header (used in MADT, SRAT, etc.) */ | ||
98 | 94 | ||
99 | struct acpi_subtable_header { | 95 | struct acpi_subtable_header { |
100 | u8 type; | 96 | u8 type; |
101 | u8 length; | 97 | u8 length; |
102 | }; | 98 | }; |
103 | 99 | ||
104 | /* Common Subtable header for WHEA tables (EINJ, ERST, WDAT) */ | 100 | /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */ |
105 | 101 | ||
106 | struct acpi_whea_header { | 102 | struct acpi_whea_header { |
107 | u8 action; | 103 | u8 action; |
@@ -115,116 +111,8 @@ struct acpi_whea_header { | |||
115 | 111 | ||
116 | /******************************************************************************* | 112 | /******************************************************************************* |
117 | * | 113 | * |
118 | * ASF - Alert Standard Format table (Signature "ASF!") | 114 | * BERT - Boot Error Record Table (ACPI 4.0) |
119 | * | 115 | * Version 1 |
120 | * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003 | ||
121 | * | ||
122 | ******************************************************************************/ | ||
123 | |||
124 | struct acpi_table_asf { | ||
125 | struct acpi_table_header header; /* Common ACPI table header */ | ||
126 | }; | ||
127 | |||
128 | /* ASF subtable header */ | ||
129 | |||
130 | struct acpi_asf_header { | ||
131 | u8 type; | ||
132 | u8 reserved; | ||
133 | u16 length; | ||
134 | }; | ||
135 | |||
136 | /* Values for Type field above */ | ||
137 | |||
138 | enum acpi_asf_type { | ||
139 | ACPI_ASF_TYPE_INFO = 0, | ||
140 | ACPI_ASF_TYPE_ALERT = 1, | ||
141 | ACPI_ASF_TYPE_CONTROL = 2, | ||
142 | ACPI_ASF_TYPE_BOOT = 3, | ||
143 | ACPI_ASF_TYPE_ADDRESS = 4, | ||
144 | ACPI_ASF_TYPE_RESERVED = 5 | ||
145 | }; | ||
146 | |||
147 | /* | ||
148 | * ASF subtables | ||
149 | */ | ||
150 | |||
151 | /* 0: ASF Information */ | ||
152 | |||
153 | struct acpi_asf_info { | ||
154 | struct acpi_asf_header header; | ||
155 | u8 min_reset_value; | ||
156 | u8 min_poll_interval; | ||
157 | u16 system_id; | ||
158 | u32 mfg_id; | ||
159 | u8 flags; | ||
160 | u8 reserved2[3]; | ||
161 | }; | ||
162 | |||
163 | /* 1: ASF Alerts */ | ||
164 | |||
165 | struct acpi_asf_alert { | ||
166 | struct acpi_asf_header header; | ||
167 | u8 assert_mask; | ||
168 | u8 deassert_mask; | ||
169 | u8 alerts; | ||
170 | u8 data_length; | ||
171 | }; | ||
172 | |||
173 | struct acpi_asf_alert_data { | ||
174 | u8 address; | ||
175 | u8 command; | ||
176 | u8 mask; | ||
177 | u8 value; | ||
178 | u8 sensor_type; | ||
179 | u8 type; | ||
180 | u8 offset; | ||
181 | u8 source_type; | ||
182 | u8 severity; | ||
183 | u8 sensor_number; | ||
184 | u8 entity; | ||
185 | u8 instance; | ||
186 | }; | ||
187 | |||
188 | /* 2: ASF Remote Control */ | ||
189 | |||
190 | struct acpi_asf_remote { | ||
191 | struct acpi_asf_header header; | ||
192 | u8 controls; | ||
193 | u8 data_length; | ||
194 | u16 reserved2; | ||
195 | }; | ||
196 | |||
197 | struct acpi_asf_control_data { | ||
198 | u8 function; | ||
199 | u8 address; | ||
200 | u8 command; | ||
201 | u8 value; | ||
202 | }; | ||
203 | |||
204 | /* 3: ASF RMCP Boot Options */ | ||
205 | |||
206 | struct acpi_asf_rmcp { | ||
207 | struct acpi_asf_header header; | ||
208 | u8 capabilities[7]; | ||
209 | u8 completion_code; | ||
210 | u32 enterprise_id; | ||
211 | u8 command; | ||
212 | u16 parameter; | ||
213 | u16 boot_options; | ||
214 | u16 oem_parameters; | ||
215 | }; | ||
216 | |||
217 | /* 4: ASF Address */ | ||
218 | |||
219 | struct acpi_asf_address { | ||
220 | struct acpi_asf_header header; | ||
221 | u8 eprom_address; | ||
222 | u8 devices; | ||
223 | }; | ||
224 | |||
225 | /******************************************************************************* | ||
226 | * | ||
227 | * BERT - Boot Error Record Table | ||
228 | * | 116 | * |
229 | ******************************************************************************/ | 117 | ******************************************************************************/ |
230 | 118 | ||
@@ -234,38 +122,43 @@ struct acpi_table_bert { | |||
234 | u64 address; /* Physical addresss of the error region */ | 122 | u64 address; /* Physical addresss of the error region */ |
235 | }; | 123 | }; |
236 | 124 | ||
237 | /* Boot Error Region */ | 125 | /* Boot Error Region (not a subtable, pointed to by Address field above) */ |
238 | 126 | ||
239 | struct acpi_bert_region { | 127 | struct acpi_bert_region { |
240 | u32 block_status; | 128 | u32 block_status; /* Type of error information */ |
241 | u32 raw_data_offset; | 129 | u32 raw_data_offset; /* Offset to raw error data */ |
242 | u32 raw_data_length; | 130 | u32 raw_data_length; /* Length of raw error data */ |
243 | u32 data_length; | 131 | u32 data_length; /* Length of generic error data */ |
244 | u32 error_severity; | 132 | u32 error_severity; /* Severity code */ |
245 | }; | 133 | }; |
246 | 134 | ||
247 | /* block_status Flags */ | 135 | /* Values for block_status flags above */ |
248 | 136 | ||
249 | #define ACPI_BERT_UNCORRECTABLE (1) | 137 | #define ACPI_BERT_UNCORRECTABLE (1) |
250 | #define ACPI_BERT_CORRECTABLE (2) | 138 | #define ACPI_BERT_CORRECTABLE (1<<1) |
251 | #define ACPI_BERT_MULTIPLE_UNCORRECTABLE (4) | 139 | #define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2) |
252 | #define ACPI_BERT_MULTIPLE_CORRECTABLE (8) | 140 | #define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3) |
141 | #define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ | ||
253 | 142 | ||
254 | /******************************************************************************* | 143 | /* Values for error_severity above */ |
255 | * | ||
256 | * BOOT - Simple Boot Flag Table | ||
257 | * | ||
258 | ******************************************************************************/ | ||
259 | 144 | ||
260 | struct acpi_table_boot { | 145 | enum acpi_bert_error_severity { |
261 | struct acpi_table_header header; /* Common ACPI table header */ | 146 | ACPI_BERT_ERROR_CORRECTABLE = 0, |
262 | u8 cmos_index; /* Index in CMOS RAM for the boot register */ | 147 | ACPI_BERT_ERROR_FATAL = 1, |
263 | u8 reserved[3]; | 148 | ACPI_BERT_ERROR_CORRECTED = 2, |
149 | ACPI_BERT_ERROR_NONE = 3, | ||
150 | ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */ | ||
264 | }; | 151 | }; |
265 | 152 | ||
153 | /* | ||
154 | * Note: The generic error data that follows the error_severity field above | ||
155 | * uses the struct acpi_hest_generic_data defined under the HEST table below | ||
156 | */ | ||
157 | |||
266 | /******************************************************************************* | 158 | /******************************************************************************* |
267 | * | 159 | * |
268 | * CPEP - Corrected Platform Error Polling table | 160 | * CPEP - Corrected Platform Error Polling table (ACPI 4.0) |
161 | * Version 1 | ||
269 | * | 162 | * |
270 | ******************************************************************************/ | 163 | ******************************************************************************/ |
271 | 164 | ||
@@ -277,8 +170,7 @@ struct acpi_table_cpep { | |||
277 | /* Subtable */ | 170 | /* Subtable */ |
278 | 171 | ||
279 | struct acpi_cpep_polling { | 172 | struct acpi_cpep_polling { |
280 | u8 type; | 173 | struct acpi_subtable_header header; |
281 | u8 length; | ||
282 | u8 id; /* Processor ID */ | 174 | u8 id; /* Processor ID */ |
283 | u8 eid; /* Processor EID */ | 175 | u8 eid; /* Processor EID */ |
284 | u32 interval; /* Polling interval (msec) */ | 176 | u32 interval; /* Polling interval (msec) */ |
@@ -286,124 +178,8 @@ struct acpi_cpep_polling { | |||
286 | 178 | ||
287 | /******************************************************************************* | 179 | /******************************************************************************* |
288 | * | 180 | * |
289 | * DBGP - Debug Port table | ||
290 | * | ||
291 | ******************************************************************************/ | ||
292 | |||
293 | struct acpi_table_dbgp { | ||
294 | struct acpi_table_header header; /* Common ACPI table header */ | ||
295 | u8 type; /* 0=full 16550, 1=subset of 16550 */ | ||
296 | u8 reserved[3]; | ||
297 | struct acpi_generic_address debug_port; | ||
298 | }; | ||
299 | |||
300 | /******************************************************************************* | ||
301 | * | ||
302 | * DMAR - DMA Remapping table | ||
303 | * From "Intel Virtualization Technology for Directed I/O", Sept. 2007 | ||
304 | * | ||
305 | ******************************************************************************/ | ||
306 | |||
307 | struct acpi_table_dmar { | ||
308 | struct acpi_table_header header; /* Common ACPI table header */ | ||
309 | u8 width; /* Host Address Width */ | ||
310 | u8 flags; | ||
311 | u8 reserved[10]; | ||
312 | }; | ||
313 | |||
314 | /* Flags */ | ||
315 | |||
316 | #define ACPI_DMAR_INTR_REMAP (1) | ||
317 | |||
318 | /* DMAR subtable header */ | ||
319 | |||
320 | struct acpi_dmar_header { | ||
321 | u16 type; | ||
322 | u16 length; | ||
323 | }; | ||
324 | |||
325 | /* Values for subtable type in struct acpi_dmar_header */ | ||
326 | |||
327 | enum acpi_dmar_type { | ||
328 | ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, | ||
329 | ACPI_DMAR_TYPE_RESERVED_MEMORY = 1, | ||
330 | ACPI_DMAR_TYPE_ATSR = 2, | ||
331 | ACPI_DMAR_TYPE_RESERVED = 3 /* 3 and greater are reserved */ | ||
332 | }; | ||
333 | |||
334 | struct acpi_dmar_device_scope { | ||
335 | u8 entry_type; | ||
336 | u8 length; | ||
337 | u16 reserved; | ||
338 | u8 enumeration_id; | ||
339 | u8 bus; | ||
340 | }; | ||
341 | |||
342 | /* Values for entry_type in struct acpi_dmar_device_scope */ | ||
343 | |||
344 | enum acpi_dmar_scope_type { | ||
345 | ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0, | ||
346 | ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1, | ||
347 | ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, | ||
348 | ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, | ||
349 | ACPI_DMAR_SCOPE_TYPE_HPET = 4, | ||
350 | ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */ | ||
351 | }; | ||
352 | |||
353 | struct acpi_dmar_pci_path { | ||
354 | u8 dev; | ||
355 | u8 fn; | ||
356 | }; | ||
357 | |||
358 | /* | ||
359 | * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header | ||
360 | */ | ||
361 | |||
362 | /* 0: Hardware Unit Definition */ | ||
363 | |||
364 | struct acpi_dmar_hardware_unit { | ||
365 | struct acpi_dmar_header header; | ||
366 | u8 flags; | ||
367 | u8 reserved; | ||
368 | u16 segment; | ||
369 | u64 address; /* Register Base Address */ | ||
370 | }; | ||
371 | |||
372 | /* Flags */ | ||
373 | |||
374 | #define ACPI_DMAR_INCLUDE_ALL (1) | ||
375 | |||
376 | /* 1: Reserved Memory Defininition */ | ||
377 | |||
378 | struct acpi_dmar_reserved_memory { | ||
379 | struct acpi_dmar_header header; | ||
380 | u16 reserved; | ||
381 | u16 segment; | ||
382 | u64 base_address; /* 4_k aligned base address */ | ||
383 | u64 end_address; /* 4_k aligned limit address */ | ||
384 | }; | ||
385 | |||
386 | /* Flags */ | ||
387 | |||
388 | #define ACPI_DMAR_ALLOW_ALL (1) | ||
389 | |||
390 | |||
391 | /* 2: Root Port ATS Capability Reporting Structure */ | ||
392 | |||
393 | struct acpi_dmar_atsr { | ||
394 | struct acpi_dmar_header header; | ||
395 | u8 flags; | ||
396 | u8 reserved; | ||
397 | u16 segment; | ||
398 | }; | ||
399 | |||
400 | /* Flags */ | ||
401 | |||
402 | #define ACPI_DMAR_ALL_PORTS (1) | ||
403 | |||
404 | /******************************************************************************* | ||
405 | * | ||
406 | * ECDT - Embedded Controller Boot Resources Table | 181 | * ECDT - Embedded Controller Boot Resources Table |
182 | * Version 1 | ||
407 | * | 183 | * |
408 | ******************************************************************************/ | 184 | ******************************************************************************/ |
409 | 185 | ||
@@ -418,14 +194,16 @@ struct acpi_table_ecdt { | |||
418 | 194 | ||
419 | /******************************************************************************* | 195 | /******************************************************************************* |
420 | * | 196 | * |
421 | * EINJ - Error Injection Table | 197 | * EINJ - Error Injection Table (ACPI 4.0) |
198 | * Version 1 | ||
422 | * | 199 | * |
423 | ******************************************************************************/ | 200 | ******************************************************************************/ |
424 | 201 | ||
425 | struct acpi_table_einj { | 202 | struct acpi_table_einj { |
426 | struct acpi_table_header header; /* Common ACPI table header */ | 203 | struct acpi_table_header header; /* Common ACPI table header */ |
427 | u32 header_length; | 204 | u32 header_length; |
428 | u32 reserved; | 205 | u8 flags; |
206 | u8 reserved[3]; | ||
429 | u32 entries; | 207 | u32 entries; |
430 | }; | 208 | }; |
431 | 209 | ||
@@ -435,6 +213,10 @@ struct acpi_einj_entry { | |||
435 | struct acpi_whea_header whea_header; /* Common header for WHEA tables */ | 213 | struct acpi_whea_header whea_header; /* Common header for WHEA tables */ |
436 | }; | 214 | }; |
437 | 215 | ||
216 | /* Masks for Flags field above */ | ||
217 | |||
218 | #define ACPI_EINJ_PRESERVE (1) | ||
219 | |||
438 | /* Values for Action field above */ | 220 | /* Values for Action field above */ |
439 | 221 | ||
440 | enum acpi_einj_actions { | 222 | enum acpi_einj_actions { |
@@ -470,9 +252,34 @@ struct acpi_einj_trigger { | |||
470 | u32 entry_count; | 252 | u32 entry_count; |
471 | }; | 253 | }; |
472 | 254 | ||
255 | /* Command status return values */ | ||
256 | |||
257 | enum acpi_einj_command_status { | ||
258 | ACPI_EINJ_SUCCESS = 0, | ||
259 | ACPI_EINJ_FAILURE = 1, | ||
260 | ACPI_EINJ_INVALID_ACCESS = 2, | ||
261 | ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */ | ||
262 | }; | ||
263 | |||
264 | /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */ | ||
265 | |||
266 | #define ACPI_EINJ_PROCESSOR_CORRECTABLE (1) | ||
267 | #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1) | ||
268 | #define ACPI_EINJ_PROCESSOR_FATAL (1<<2) | ||
269 | #define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3) | ||
270 | #define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4) | ||
271 | #define ACPI_EINJ_MEMORY_FATAL (1<<5) | ||
272 | #define ACPI_EINJ_PCIX_CORRECTABLE (1<<6) | ||
273 | #define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7) | ||
274 | #define ACPI_EINJ_PCIX_FATAL (1<<8) | ||
275 | #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) | ||
276 | #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) | ||
277 | #define ACPI_EINJ_PLATFORM_FATAL (1<<11) | ||
278 | |||
473 | /******************************************************************************* | 279 | /******************************************************************************* |
474 | * | 280 | * |
475 | * ERST - Error Record Serialization Table | 281 | * ERST - Error Record Serialization Table (ACPI 4.0) |
282 | * Version 1 | ||
476 | * | 283 | * |
477 | ******************************************************************************/ | 284 | ******************************************************************************/ |
478 | 285 | ||
@@ -489,19 +296,23 @@ struct acpi_erst_entry { | |||
489 | struct acpi_whea_header whea_header; /* Common header for WHEA tables */ | 296 | struct acpi_whea_header whea_header; /* Common header for WHEA tables */ |
490 | }; | 297 | }; |
491 | 298 | ||
299 | /* Masks for Flags field above */ | ||
300 | |||
301 | #define ACPI_ERST_PRESERVE (1) | ||
302 | |||
492 | /* Values for Action field above */ | 303 | /* Values for Action field above */ |
493 | 304 | ||
494 | enum acpi_erst_actions { | 305 | enum acpi_erst_actions { |
495 | ACPI_ERST_BEGIN_WRITE_OPERATION = 0, | 306 | ACPI_ERST_BEGIN_WRITE = 0, |
496 | ACPI_ERST_BEGIN_READ_OPERATION = 1, | 307 | ACPI_ERST_BEGIN_READ = 1, |
497 | ACPI_ERST_BETGIN_CLEAR_OPERATION = 2, | 308 | ACPI_ERST_BEGIN_CLEAR = 2, |
498 | ACPI_ERST_END_OPERATION = 3, | 309 | ACPI_ERST_END = 3, |
499 | ACPI_ERST_SET_RECORD_OFFSET = 4, | 310 | ACPI_ERST_SET_RECORD_OFFSET = 4, |
500 | ACPI_ERST_EXECUTE_OPERATION = 5, | 311 | ACPI_ERST_EXECUTE_OPERATION = 5, |
501 | ACPI_ERST_CHECK_BUSY_STATUS = 6, | 312 | ACPI_ERST_CHECK_BUSY_STATUS = 6, |
502 | ACPI_ERST_GET_COMMAND_STATUS = 7, | 313 | ACPI_ERST_GET_COMMAND_STATUS = 7, |
503 | ACPI_ERST_GET_RECORD_IDENTIFIER = 8, | 314 | ACPI_ERST_GET_RECORD_ID = 8, |
504 | ACPI_ERST_SET_RECORD_IDENTIFIER = 9, | 315 | ACPI_ERST_SET_RECORD_ID = 9, |
505 | ACPI_ERST_GET_RECORD_COUNT = 10, | 316 | ACPI_ERST_GET_RECORD_COUNT = 10, |
506 | ACPI_ERST_BEGIN_DUMMY_WRIITE = 11, | 317 | ACPI_ERST_BEGIN_DUMMY_WRIITE = 11, |
507 | ACPI_ERST_NOT_USED = 12, | 318 | ACPI_ERST_NOT_USED = 12, |
@@ -536,9 +347,29 @@ enum acpi_erst_instructions { | |||
536 | ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */ | 347 | ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */ |
537 | }; | 348 | }; |
538 | 349 | ||
350 | /* Command status return values */ | ||
351 | |||
352 | enum acpi_erst_command_status { | ||
353 | ACPI_ERST_SUCESS = 0, | ||
354 | ACPI_ERST_NO_SPACE = 1, | ||
355 | ACPI_ERST_NOT_AVAILABLE = 2, | ||
356 | ACPI_ERST_FAILURE = 3, | ||
357 | ACPI_ERST_RECORD_EMPTY = 4, | ||
358 | ACPI_ERST_NOT_FOUND = 5, | ||
359 | ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */ | ||
360 | }; | ||
361 | |||
362 | /* Error Record Serialization Information */ | ||
363 | |||
364 | struct acpi_erst_info { | ||
365 | u16 signature; /* Should be "ER" */ | ||
366 | u8 data[48]; | ||
367 | }; | ||
368 | |||
539 | /******************************************************************************* | 369 | /******************************************************************************* |
540 | * | 370 | * |
541 | * HEST - Hardware Error Source Table | 371 | * HEST - Hardware Error Source Table (ACPI 4.0) |
372 | * Version 1 | ||
542 | * | 373 | * |
543 | ******************************************************************************/ | 374 | ******************************************************************************/ |
544 | 375 | ||
@@ -551,85 +382,69 @@ struct acpi_table_hest { | |||
551 | 382 | ||
552 | struct acpi_hest_header { | 383 | struct acpi_hest_header { |
553 | u16 type; | 384 | u16 type; |
385 | u16 source_id; | ||
554 | }; | 386 | }; |
555 | 387 | ||
556 | /* Values for Type field above for subtables */ | 388 | /* Values for Type field above for subtables */ |
557 | 389 | ||
558 | enum acpi_hest_types { | 390 | enum acpi_hest_types { |
559 | ACPI_HEST_TYPE_XPF_MACHINE_CHECK = 0, | 391 | ACPI_HEST_TYPE_IA32_CHECK = 0, |
560 | ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK = 1, | 392 | ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1, |
561 | ACPI_HEST_TYPE_XPF_UNUSED = 2, | 393 | ACPI_HEST_TYPE_IA32_NMI = 2, |
562 | ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT = 3, | 394 | ACPI_HEST_TYPE_NOT_USED3 = 3, |
563 | ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK = 4, | 395 | ACPI_HEST_TYPE_NOT_USED4 = 4, |
564 | ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR = 5, | 396 | ACPI_HEST_TYPE_NOT_USED5 = 5, |
565 | ACPI_HEST_TYPE_AER_ROOT_PORT = 6, | 397 | ACPI_HEST_TYPE_AER_ROOT_PORT = 6, |
566 | ACPI_HEST_TYPE_AER_ENDPOINT = 7, | 398 | ACPI_HEST_TYPE_AER_ENDPOINT = 7, |
567 | ACPI_HEST_TYPE_AER_BRIDGE = 8, | 399 | ACPI_HEST_TYPE_AER_BRIDGE = 8, |
568 | ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE = 9, | 400 | ACPI_HEST_TYPE_GENERIC_ERROR = 9, |
569 | ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */ | 401 | ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */ |
570 | }; | 402 | }; |
571 | 403 | ||
572 | /* | 404 | /* |
573 | * HEST Sub-subtables | 405 | * HEST substructures contained in subtables |
574 | */ | 406 | */ |
575 | 407 | ||
576 | /* XPF Machine Check Error Bank */ | 408 | /* |
577 | 409 | * IA32 Error Bank(s) - Follows the struct acpi_hest_ia_machine_check and | |
578 | struct acpi_hest_xpf_error_bank { | 410 | * struct acpi_hest_ia_corrected structures. |
411 | */ | ||
412 | struct acpi_hest_ia_error_bank { | ||
579 | u8 bank_number; | 413 | u8 bank_number; |
580 | u8 clear_status_on_init; | 414 | u8 clear_status_on_init; |
581 | u8 status_format; | 415 | u8 status_format; |
582 | u8 config_write_enable; | 416 | u8 reserved; |
583 | u32 control_register; | 417 | u32 control_register; |
584 | u64 control_init_data; | 418 | u64 control_data; |
585 | u32 status_register; | 419 | u32 status_register; |
586 | u32 address_register; | 420 | u32 address_register; |
587 | u32 misc_register; | 421 | u32 misc_register; |
588 | }; | 422 | }; |
589 | 423 | ||
590 | /* Generic Error Status */ | 424 | /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */ |
591 | |||
592 | struct acpi_hest_generic_status { | ||
593 | u32 block_status; | ||
594 | u32 raw_data_offset; | ||
595 | u32 raw_data_length; | ||
596 | u32 data_length; | ||
597 | u32 error_severity; | ||
598 | }; | ||
599 | |||
600 | /* Generic Error Data */ | ||
601 | |||
602 | struct acpi_hest_generic_data { | ||
603 | u8 section_type[16]; | ||
604 | u32 error_severity; | ||
605 | u16 revision; | ||
606 | u8 validation_bits; | ||
607 | u8 flags; | ||
608 | u32 error_data_length; | ||
609 | u8 fru_id[16]; | ||
610 | u8 fru_text[20]; | ||
611 | }; | ||
612 | |||
613 | /* Common HEST structure for PCI/AER types below (6,7,8) */ | ||
614 | 425 | ||
615 | struct acpi_hest_aer_common { | 426 | struct acpi_hest_aer_common { |
616 | u16 source_id; | 427 | u16 reserved1; |
617 | u16 config_write_enable; | ||
618 | u8 flags; | 428 | u8 flags; |
619 | u8 enabled; | 429 | u8 enabled; |
620 | u32 records_to_pre_allocate; | 430 | u32 records_to_preallocate; |
621 | u32 max_sections_per_record; | 431 | u32 max_sections_per_record; |
622 | u32 bus; | 432 | u32 bus; |
623 | u16 device; | 433 | u16 device; |
624 | u16 function; | 434 | u16 function; |
625 | u16 device_control; | 435 | u16 device_control; |
626 | u16 reserved; | 436 | u16 reserved2; |
627 | u32 uncorrectable_error_mask; | 437 | u32 uncorrectable_mask; |
628 | u32 uncorrectable_error_severity; | 438 | u32 uncorrectable_severity; |
629 | u32 correctable_error_mask; | 439 | u32 correctable_mask; |
630 | u32 advanced_error_capabilities; | 440 | u32 advanced_capabilities; |
631 | }; | 441 | }; |
632 | 442 | ||
443 | /* Masks for HEST Flags fields */ | ||
444 | |||
445 | #define ACPI_HEST_FIRMWARE_FIRST (1) | ||
446 | #define ACPI_HEST_GLOBAL (1<<1) | ||
447 | |||
633 | /* Hardware Error Notification */ | 448 | /* Hardware Error Notification */ |
634 | 449 | ||
635 | struct acpi_hest_notify { | 450 | struct acpi_hest_notify { |
@@ -655,71 +470,59 @@ enum acpi_hest_notify_types { | |||
655 | ACPI_HEST_NOTIFY_RESERVED = 5 /* 5 and greater are reserved */ | 470 | ACPI_HEST_NOTIFY_RESERVED = 5 /* 5 and greater are reserved */ |
656 | }; | 471 | }; |
657 | 472 | ||
473 | /* Values for config_write_enable bitfield above */ | ||
474 | |||
475 | #define ACPI_HEST_TYPE (1) | ||
476 | #define ACPI_HEST_POLL_INTERVAL (1<<1) | ||
477 | #define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2) | ||
478 | #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3) | ||
479 | #define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4) | ||
480 | #define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5) | ||
481 | |||
658 | /* | 482 | /* |
659 | * HEST subtables | 483 | * HEST subtables |
660 | * | ||
661 | * From WHEA Design Document, 16 May 2007. | ||
662 | * Note: There is no subtable type 2 in this version of the document, | ||
663 | * and there are two different subtable type 3s. | ||
664 | */ | 484 | */ |
665 | 485 | ||
666 | /* 0: XPF Machine Check Exception */ | 486 | /* 0: IA32 Machine Check Exception */ |
667 | 487 | ||
668 | struct acpi_hest_xpf_machine_check { | 488 | struct acpi_hest_ia_machine_check { |
669 | struct acpi_hest_header header; | 489 | struct acpi_hest_header header; |
670 | u16 source_id; | 490 | u16 reserved1; |
671 | u16 config_write_enable; | ||
672 | u8 flags; | 491 | u8 flags; |
673 | u8 reserved1; | 492 | u8 enabled; |
674 | u32 records_to_pre_allocate; | 493 | u32 records_to_preallocate; |
675 | u32 max_sections_per_record; | 494 | u32 max_sections_per_record; |
676 | u64 global_capability_data; | 495 | u64 global_capability_data; |
677 | u64 global_control_data; | 496 | u64 global_control_data; |
678 | u8 num_hardware_banks; | 497 | u8 num_hardware_banks; |
679 | u8 reserved2[7]; | 498 | u8 reserved3[7]; |
680 | }; | 499 | }; |
681 | 500 | ||
682 | /* 1: XPF Corrected Machine Check */ | 501 | /* 1: IA32 Corrected Machine Check */ |
683 | 502 | ||
684 | struct acpi_table_hest_xpf_corrected { | 503 | struct acpi_hest_ia_corrected { |
685 | struct acpi_hest_header header; | 504 | struct acpi_hest_header header; |
686 | u16 source_id; | 505 | u16 reserved1; |
687 | u16 config_write_enable; | ||
688 | u8 flags; | 506 | u8 flags; |
689 | u8 enabled; | 507 | u8 enabled; |
690 | u32 records_to_pre_allocate; | 508 | u32 records_to_preallocate; |
691 | u32 max_sections_per_record; | 509 | u32 max_sections_per_record; |
692 | struct acpi_hest_notify notify; | 510 | struct acpi_hest_notify notify; |
693 | u8 num_hardware_banks; | 511 | u8 num_hardware_banks; |
694 | u8 reserved[3]; | 512 | u8 reserved2[3]; |
695 | }; | 513 | }; |
696 | 514 | ||
697 | /* 3: XPF Non-Maskable Interrupt */ | 515 | /* 2: IA32 Non-Maskable Interrupt */ |
698 | 516 | ||
699 | struct acpi_hest_xpf_nmi { | 517 | struct acpi_hest_ia_nmi { |
700 | struct acpi_hest_header header; | 518 | struct acpi_hest_header header; |
701 | u16 source_id; | ||
702 | u32 reserved; | 519 | u32 reserved; |
703 | u32 records_to_pre_allocate; | 520 | u32 records_to_preallocate; |
704 | u32 max_sections_per_record; | 521 | u32 max_sections_per_record; |
705 | u32 max_raw_data_length; | 522 | u32 max_raw_data_length; |
706 | }; | 523 | }; |
707 | 524 | ||
708 | /* 4: IPF Corrected Machine Check */ | 525 | /* 3,4,5: Not used */ |
709 | |||
710 | struct acpi_hest_ipf_corrected { | ||
711 | struct acpi_hest_header header; | ||
712 | u8 enabled; | ||
713 | u8 reserved; | ||
714 | }; | ||
715 | |||
716 | /* 5: IPF Corrected Platform Error */ | ||
717 | |||
718 | struct acpi_hest_ipf_corrected_platform { | ||
719 | struct acpi_hest_header header; | ||
720 | u8 enabled; | ||
721 | u8 reserved; | ||
722 | }; | ||
723 | 526 | ||
724 | /* 6: PCI Express Root Port AER */ | 527 | /* 6: PCI Express Root Port AER */ |
725 | 528 | ||
@@ -741,143 +544,61 @@ struct acpi_hest_aer { | |||
741 | struct acpi_hest_aer_bridge { | 544 | struct acpi_hest_aer_bridge { |
742 | struct acpi_hest_header header; | 545 | struct acpi_hest_header header; |
743 | struct acpi_hest_aer_common aer; | 546 | struct acpi_hest_aer_common aer; |
744 | u32 secondary_uncorrectable_error_mask; | 547 | u32 uncorrectable_mask2; |
745 | u32 secondary_uncorrectable_error_severity; | 548 | u32 uncorrectable_severity2; |
746 | u32 secondary_advanced_capabilities; | 549 | u32 advanced_capabilities2; |
747 | }; | 550 | }; |
748 | 551 | ||
749 | /* 9: Generic Hardware Error Source */ | 552 | /* 9: Generic Hardware Error Source */ |
750 | 553 | ||
751 | struct acpi_hest_generic { | 554 | struct acpi_hest_generic { |
752 | struct acpi_hest_header header; | 555 | struct acpi_hest_header header; |
753 | u16 source_id; | ||
754 | u16 related_source_id; | 556 | u16 related_source_id; |
755 | u8 config_write_enable; | 557 | u8 reserved; |
756 | u8 enabled; | 558 | u8 enabled; |
757 | u32 records_to_pre_allocate; | 559 | u32 records_to_preallocate; |
758 | u32 max_sections_per_record; | 560 | u32 max_sections_per_record; |
759 | u32 max_raw_data_length; | 561 | u32 max_raw_data_length; |
760 | struct acpi_generic_address error_status_address; | 562 | struct acpi_generic_address error_status_address; |
761 | struct acpi_hest_notify notify; | 563 | struct acpi_hest_notify notify; |
762 | u32 error_status_block_length; | 564 | u32 error_block_length; |
763 | }; | 565 | }; |
764 | 566 | ||
765 | /******************************************************************************* | 567 | /* Generic Error Status block */ |
766 | * | ||
767 | * HPET - High Precision Event Timer table | ||
768 | * | ||
769 | ******************************************************************************/ | ||
770 | 568 | ||
771 | struct acpi_table_hpet { | 569 | struct acpi_hest_generic_status { |
772 | struct acpi_table_header header; /* Common ACPI table header */ | 570 | u32 block_status; |
773 | u32 id; /* Hardware ID of event timer block */ | 571 | u32 raw_data_offset; |
774 | struct acpi_generic_address address; /* Address of event timer block */ | 572 | u32 raw_data_length; |
775 | u8 sequence; /* HPET sequence number */ | 573 | u32 data_length; |
776 | u16 minimum_tick; /* Main counter min tick, periodic mode */ | 574 | u32 error_severity; |
777 | u8 flags; | ||
778 | }; | 575 | }; |
779 | 576 | ||
780 | /*! Flags */ | 577 | /* Values for block_status flags above */ |
781 | 578 | ||
782 | #define ACPI_HPET_PAGE_PROTECT (1) /* 00: No page protection */ | 579 | #define ACPI_HEST_UNCORRECTABLE (1) |
783 | #define ACPI_HPET_PAGE_PROTECT_4 (1<<1) /* 01: 4KB page protected */ | 580 | #define ACPI_HEST_CORRECTABLE (1<<1) |
784 | #define ACPI_HPET_PAGE_PROTECT_64 (1<<2) /* 02: 64KB page protected */ | 581 | #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2) |
582 | #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3) | ||
583 | #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ | ||
785 | 584 | ||
786 | /*! [End] no source code translation !*/ | 585 | /* Generic Error Data entry */ |
787 | 586 | ||
788 | /******************************************************************************* | 587 | struct acpi_hest_generic_data { |
789 | * | 588 | u8 section_type[16]; |
790 | * IBFT - Boot Firmware Table | 589 | u32 error_severity; |
791 | * | 590 | u16 revision; |
792 | ******************************************************************************/ | 591 | u8 validation_bits; |
793 | |||
794 | struct acpi_table_ibft { | ||
795 | struct acpi_table_header header; /* Common ACPI table header */ | ||
796 | u8 reserved[12]; | ||
797 | }; | ||
798 | |||
799 | /* IBFT common subtable header */ | ||
800 | |||
801 | struct acpi_ibft_header { | ||
802 | u8 type; | ||
803 | u8 version; | ||
804 | u16 length; | ||
805 | u8 index; | ||
806 | u8 flags; | 592 | u8 flags; |
807 | }; | 593 | u32 error_data_length; |
808 | 594 | u8 fru_id[16]; | |
809 | /* Values for Type field above */ | 595 | u8 fru_text[20]; |
810 | |||
811 | enum acpi_ibft_type { | ||
812 | ACPI_IBFT_TYPE_NOT_USED = 0, | ||
813 | ACPI_IBFT_TYPE_CONTROL = 1, | ||
814 | ACPI_IBFT_TYPE_INITIATOR = 2, | ||
815 | ACPI_IBFT_TYPE_NIC = 3, | ||
816 | ACPI_IBFT_TYPE_TARGET = 4, | ||
817 | ACPI_IBFT_TYPE_EXTENSIONS = 5, | ||
818 | ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */ | ||
819 | }; | ||
820 | |||
821 | /* IBFT subtables */ | ||
822 | |||
823 | struct acpi_ibft_control { | ||
824 | struct acpi_ibft_header header; | ||
825 | u16 extensions; | ||
826 | u16 initiator_offset; | ||
827 | u16 nic0_offset; | ||
828 | u16 target0_offset; | ||
829 | u16 nic1_offset; | ||
830 | u16 target1_offset; | ||
831 | }; | ||
832 | |||
833 | struct acpi_ibft_initiator { | ||
834 | struct acpi_ibft_header header; | ||
835 | u8 sns_server[16]; | ||
836 | u8 slp_server[16]; | ||
837 | u8 primary_server[16]; | ||
838 | u8 secondary_server[16]; | ||
839 | u16 name_length; | ||
840 | u16 name_offset; | ||
841 | }; | ||
842 | |||
843 | struct acpi_ibft_nic { | ||
844 | struct acpi_ibft_header header; | ||
845 | u8 ip_address[16]; | ||
846 | u8 subnet_mask_prefix; | ||
847 | u8 origin; | ||
848 | u8 gateway[16]; | ||
849 | u8 primary_dns[16]; | ||
850 | u8 secondary_dns[16]; | ||
851 | u8 dhcp[16]; | ||
852 | u16 vlan; | ||
853 | u8 mac_address[6]; | ||
854 | u16 pci_address; | ||
855 | u16 name_length; | ||
856 | u16 name_offset; | ||
857 | }; | ||
858 | |||
859 | struct acpi_ibft_target { | ||
860 | struct acpi_ibft_header header; | ||
861 | u8 target_ip_address[16]; | ||
862 | u16 target_ip_socket; | ||
863 | u8 target_boot_lun[8]; | ||
864 | u8 chap_type; | ||
865 | u8 nic_association; | ||
866 | u16 target_name_length; | ||
867 | u16 target_name_offset; | ||
868 | u16 chap_name_length; | ||
869 | u16 chap_name_offset; | ||
870 | u16 chap_secret_length; | ||
871 | u16 chap_secret_offset; | ||
872 | u16 reverse_chap_name_length; | ||
873 | u16 reverse_chap_name_offset; | ||
874 | u16 reverse_chap_secret_length; | ||
875 | u16 reverse_chap_secret_offset; | ||
876 | }; | 596 | }; |
877 | 597 | ||
878 | /******************************************************************************* | 598 | /******************************************************************************* |
879 | * | 599 | * |
880 | * MADT - Multiple APIC Description Table | 600 | * MADT - Multiple APIC Description Table |
601 | * Version 3 | ||
881 | * | 602 | * |
882 | ******************************************************************************/ | 603 | ******************************************************************************/ |
883 | 604 | ||
@@ -887,16 +608,16 @@ struct acpi_table_madt { | |||
887 | u32 flags; | 608 | u32 flags; |
888 | }; | 609 | }; |
889 | 610 | ||
890 | /* Flags */ | 611 | /* Masks for Flags field above */ |
891 | 612 | ||
892 | #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */ | 613 | #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */ |
893 | 614 | ||
894 | /* Values for PCATCompat flag */ | 615 | /* Values for PCATCompat flag */ |
895 | 616 | ||
896 | #define ACPI_MADT_DUAL_PIC 0 | 617 | #define ACPI_MADT_DUAL_PIC 0 |
897 | #define ACPI_MADT_MULTIPLE_APIC 1 | 618 | #define ACPI_MADT_MULTIPLE_APIC 1 |
898 | 619 | ||
899 | /* Values for subtable type in struct acpi_subtable_header */ | 620 | /* Values for MADT subtable type in struct acpi_subtable_header */ |
900 | 621 | ||
901 | enum acpi_madt_type { | 622 | enum acpi_madt_type { |
902 | ACPI_MADT_TYPE_LOCAL_APIC = 0, | 623 | ACPI_MADT_TYPE_LOCAL_APIC = 0, |
@@ -1007,11 +728,11 @@ struct acpi_madt_interrupt_source { | |||
1007 | u32 flags; /* Interrupt Source Flags */ | 728 | u32 flags; /* Interrupt Source Flags */ |
1008 | }; | 729 | }; |
1009 | 730 | ||
1010 | /* Flags field above */ | 731 | /* Masks for Flags field above */ |
1011 | 732 | ||
1012 | #define ACPI_MADT_CPEI_OVERRIDE (1) | 733 | #define ACPI_MADT_CPEI_OVERRIDE (1) |
1013 | 734 | ||
1014 | /* 9: Processor Local X2_APIC (07/2008) */ | 735 | /* 9: Processor Local X2APIC (ACPI 4.0) */ |
1015 | 736 | ||
1016 | struct acpi_madt_local_x2apic { | 737 | struct acpi_madt_local_x2apic { |
1017 | struct acpi_subtable_header header; | 738 | struct acpi_subtable_header header; |
@@ -1021,7 +742,7 @@ struct acpi_madt_local_x2apic { | |||
1021 | u32 uid; /* ACPI processor UID */ | 742 | u32 uid; /* ACPI processor UID */ |
1022 | }; | 743 | }; |
1023 | 744 | ||
1024 | /* 10: Local X2APIC NMI (07/2008) */ | 745 | /* 10: Local X2APIC NMI (ACPI 4.0) */ |
1025 | 746 | ||
1026 | struct acpi_madt_local_x2apic_nmi { | 747 | struct acpi_madt_local_x2apic_nmi { |
1027 | struct acpi_subtable_header header; | 748 | struct acpi_subtable_header header; |
@@ -1058,28 +779,34 @@ struct acpi_madt_local_x2apic_nmi { | |||
1058 | 779 | ||
1059 | /******************************************************************************* | 780 | /******************************************************************************* |
1060 | * | 781 | * |
1061 | * MCFG - PCI Memory Mapped Configuration table and sub-table | 782 | * MSCT - Maximum System Characteristics Table (ACPI 4.0) |
783 | * Version 1 | ||
1062 | * | 784 | * |
1063 | ******************************************************************************/ | 785 | ******************************************************************************/ |
1064 | 786 | ||
1065 | struct acpi_table_mcfg { | 787 | struct acpi_table_msct { |
1066 | struct acpi_table_header header; /* Common ACPI table header */ | 788 | struct acpi_table_header header; /* Common ACPI table header */ |
1067 | u8 reserved[8]; | 789 | u32 proximity_offset; /* Location of proximity info struct(s) */ |
790 | u32 max_proximity_domains; /* Max number of proximity domains */ | ||
791 | u32 max_clock_domains; /* Max number of clock domains */ | ||
792 | u64 max_address; /* Max physical address in system */ | ||
1068 | }; | 793 | }; |
1069 | 794 | ||
1070 | /* Subtable */ | 795 | /* Subtable - Maximum Proximity Domain Information. Version 1 */ |
1071 | 796 | ||
1072 | struct acpi_mcfg_allocation { | 797 | struct acpi_msct_proximity { |
1073 | u64 address; /* Base address, processor-relative */ | 798 | u8 revision; |
1074 | u16 pci_segment; /* PCI segment group number */ | 799 | u8 length; |
1075 | u8 start_bus_number; /* Starting PCI Bus number */ | 800 | u32 range_start; /* Start of domain range */ |
1076 | u8 end_bus_number; /* Final PCI Bus number */ | 801 | u32 range_end; /* End of domain range */ |
1077 | u32 reserved; | 802 | u32 processor_capacity; |
803 | u64 memory_capacity; /* In bytes */ | ||
1078 | }; | 804 | }; |
1079 | 805 | ||
1080 | /******************************************************************************* | 806 | /******************************************************************************* |
1081 | * | 807 | * |
1082 | * SBST - Smart Battery Specification Table | 808 | * SBST - Smart Battery Specification Table |
809 | * Version 1 | ||
1083 | * | 810 | * |
1084 | ******************************************************************************/ | 811 | ******************************************************************************/ |
1085 | 812 | ||
@@ -1093,6 +820,7 @@ struct acpi_table_sbst { | |||
1093 | /******************************************************************************* | 820 | /******************************************************************************* |
1094 | * | 821 | * |
1095 | * SLIT - System Locality Distance Information Table | 822 | * SLIT - System Locality Distance Information Table |
823 | * Version 1 | ||
1096 | * | 824 | * |
1097 | ******************************************************************************/ | 825 | ******************************************************************************/ |
1098 | 826 | ||
@@ -1104,60 +832,8 @@ struct acpi_table_slit { | |||
1104 | 832 | ||
1105 | /******************************************************************************* | 833 | /******************************************************************************* |
1106 | * | 834 | * |
1107 | * SPCR - Serial Port Console Redirection table | ||
1108 | * | ||
1109 | ******************************************************************************/ | ||
1110 | |||
1111 | struct acpi_table_spcr { | ||
1112 | struct acpi_table_header header; /* Common ACPI table header */ | ||
1113 | u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ | ||
1114 | u8 reserved[3]; | ||
1115 | struct acpi_generic_address serial_port; | ||
1116 | u8 interrupt_type; | ||
1117 | u8 pc_interrupt; | ||
1118 | u32 interrupt; | ||
1119 | u8 baud_rate; | ||
1120 | u8 parity; | ||
1121 | u8 stop_bits; | ||
1122 | u8 flow_control; | ||
1123 | u8 terminal_type; | ||
1124 | u8 reserved1; | ||
1125 | u16 pci_device_id; | ||
1126 | u16 pci_vendor_id; | ||
1127 | u8 pci_bus; | ||
1128 | u8 pci_device; | ||
1129 | u8 pci_function; | ||
1130 | u32 pci_flags; | ||
1131 | u8 pci_segment; | ||
1132 | u32 reserved2; | ||
1133 | }; | ||
1134 | |||
1135 | /******************************************************************************* | ||
1136 | * | ||
1137 | * SPMI - Server Platform Management Interface table | ||
1138 | * | ||
1139 | ******************************************************************************/ | ||
1140 | |||
1141 | struct acpi_table_spmi { | ||
1142 | struct acpi_table_header header; /* Common ACPI table header */ | ||
1143 | u8 reserved; | ||
1144 | u8 interface_type; | ||
1145 | u16 spec_revision; /* Version of IPMI */ | ||
1146 | u8 interrupt_type; | ||
1147 | u8 gpe_number; /* GPE assigned */ | ||
1148 | u8 reserved1; | ||
1149 | u8 pci_device_flag; | ||
1150 | u32 interrupt; | ||
1151 | struct acpi_generic_address ipmi_register; | ||
1152 | u8 pci_segment; | ||
1153 | u8 pci_bus; | ||
1154 | u8 pci_device; | ||
1155 | u8 pci_function; | ||
1156 | }; | ||
1157 | |||
1158 | /******************************************************************************* | ||
1159 | * | ||
1160 | * SRAT - System Resource Affinity Table | 835 | * SRAT - System Resource Affinity Table |
836 | * Version 3 | ||
1161 | * | 837 | * |
1162 | ******************************************************************************/ | 838 | ******************************************************************************/ |
1163 | 839 | ||
@@ -1192,6 +868,10 @@ struct acpi_srat_cpu_affinity { | |||
1192 | u32 reserved; /* Reserved, must be zero */ | 868 | u32 reserved; /* Reserved, must be zero */ |
1193 | }; | 869 | }; |
1194 | 870 | ||
871 | /* Flags */ | ||
872 | |||
873 | #define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */ | ||
874 | |||
1195 | /* 1: Memory Affinity */ | 875 | /* 1: Memory Affinity */ |
1196 | 876 | ||
1197 | struct acpi_srat_mem_affinity { | 877 | struct acpi_srat_mem_affinity { |
@@ -1211,7 +891,7 @@ struct acpi_srat_mem_affinity { | |||
1211 | #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */ | 891 | #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */ |
1212 | #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */ | 892 | #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */ |
1213 | 893 | ||
1214 | /* 2: Processor Local X2_APIC Affinity (07/2008) */ | 894 | /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */ |
1215 | 895 | ||
1216 | struct acpi_srat_x2apic_cpu_affinity { | 896 | struct acpi_srat_x2apic_cpu_affinity { |
1217 | struct acpi_subtable_header header; | 897 | struct acpi_subtable_header header; |
@@ -1219,122 +899,14 @@ struct acpi_srat_x2apic_cpu_affinity { | |||
1219 | u32 proximity_domain; | 899 | u32 proximity_domain; |
1220 | u32 apic_id; | 900 | u32 apic_id; |
1221 | u32 flags; | 901 | u32 flags; |
902 | u32 clock_domain; | ||
903 | u32 reserved2; | ||
1222 | }; | 904 | }; |
1223 | 905 | ||
1224 | /* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */ | 906 | /* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */ |
1225 | 907 | ||
1226 | #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */ | 908 | #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */ |
1227 | 909 | ||
1228 | /******************************************************************************* | ||
1229 | * | ||
1230 | * TCPA - Trusted Computing Platform Alliance table | ||
1231 | * | ||
1232 | ******************************************************************************/ | ||
1233 | |||
1234 | struct acpi_table_tcpa { | ||
1235 | struct acpi_table_header header; /* Common ACPI table header */ | ||
1236 | u16 reserved; | ||
1237 | u32 max_log_length; /* Maximum length for the event log area */ | ||
1238 | u64 log_address; /* Address of the event log area */ | ||
1239 | }; | ||
1240 | |||
1241 | /******************************************************************************* | ||
1242 | * | ||
1243 | * UEFI - UEFI Boot optimization Table | ||
1244 | * | ||
1245 | ******************************************************************************/ | ||
1246 | |||
1247 | struct acpi_table_uefi { | ||
1248 | struct acpi_table_header header; /* Common ACPI table header */ | ||
1249 | u8 identifier[16]; /* UUID identifier */ | ||
1250 | u16 data_offset; /* Offset of remaining data in table */ | ||
1251 | u8 data; | ||
1252 | }; | ||
1253 | |||
1254 | /******************************************************************************* | ||
1255 | * | ||
1256 | * WDAT - Watchdog Action Table | ||
1257 | * | ||
1258 | ******************************************************************************/ | ||
1259 | |||
1260 | struct acpi_table_wdat { | ||
1261 | struct acpi_table_header header; /* Common ACPI table header */ | ||
1262 | u32 header_length; /* Watchdog Header Length */ | ||
1263 | u16 pci_segment; /* PCI Segment number */ | ||
1264 | u8 pci_bus; /* PCI Bus number */ | ||
1265 | u8 pci_device; /* PCI Device number */ | ||
1266 | u8 pci_function; /* PCI Function number */ | ||
1267 | u8 reserved[3]; | ||
1268 | u32 timer_period; /* Period of one timer count (msec) */ | ||
1269 | u32 max_count; /* Maximum counter value supported */ | ||
1270 | u32 min_count; /* Minimum counter value */ | ||
1271 | u8 flags; | ||
1272 | u8 reserved2[3]; | ||
1273 | u32 entries; /* Number of watchdog entries that follow */ | ||
1274 | }; | ||
1275 | |||
1276 | /* WDAT Instruction Entries (actions) */ | ||
1277 | |||
1278 | struct acpi_wdat_entry { | ||
1279 | struct acpi_whea_header whea_header; /* Common header for WHEA tables */ | ||
1280 | }; | ||
1281 | |||
1282 | /* Values for Action field above */ | ||
1283 | |||
1284 | enum acpi_wdat_actions { | ||
1285 | ACPI_WDAT_RESET = 1, | ||
1286 | ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4, | ||
1287 | ACPI_WDAT_GET_COUNTDOWN = 5, | ||
1288 | ACPI_WDAT_SET_COUNTDOWN = 6, | ||
1289 | ACPI_WDAT_GET_RUNNING_STATE = 8, | ||
1290 | ACPI_WDAT_SET_RUNNING_STATE = 9, | ||
1291 | ACPI_WDAT_GET_STOPPED_STATE = 10, | ||
1292 | ACPI_WDAT_SET_STOPPED_STATE = 11, | ||
1293 | ACPI_WDAT_GET_REBOOT = 16, | ||
1294 | ACPI_WDAT_SET_REBOOT = 17, | ||
1295 | ACPI_WDAT_GET_SHUTDOWN = 18, | ||
1296 | ACPI_WDAT_SET_SHUTDOWN = 19, | ||
1297 | ACPI_WDAT_GET_STATUS = 32, | ||
1298 | ACPI_WDAT_SET_STATUS = 33, | ||
1299 | ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */ | ||
1300 | }; | ||
1301 | |||
1302 | /* Values for Instruction field above */ | ||
1303 | |||
1304 | enum acpi_wdat_instructions { | ||
1305 | ACPI_WDAT_READ_VALUE = 0, | ||
1306 | ACPI_WDAT_READ_COUNTDOWN = 1, | ||
1307 | ACPI_WDAT_WRITE_VALUE = 2, | ||
1308 | ACPI_WDAT_WRITE_COUNTDOWN = 3, | ||
1309 | ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */ | ||
1310 | ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */ | ||
1311 | }; | ||
1312 | |||
1313 | /******************************************************************************* | ||
1314 | * | ||
1315 | * WDRT - Watchdog Resource Table | ||
1316 | * | ||
1317 | ******************************************************************************/ | ||
1318 | |||
1319 | struct acpi_table_wdrt { | ||
1320 | struct acpi_table_header header; /* Common ACPI table header */ | ||
1321 | u32 header_length; /* Watchdog Header Length */ | ||
1322 | u8 pci_segment; /* PCI Segment number */ | ||
1323 | u8 pci_bus; /* PCI Bus number */ | ||
1324 | u8 pci_device; /* PCI Device number */ | ||
1325 | u8 pci_function; /* PCI Function number */ | ||
1326 | u32 timer_period; /* Period of one timer count (msec) */ | ||
1327 | u32 max_count; /* Maximum counter value supported */ | ||
1328 | u32 min_count; /* Minimum counter value */ | ||
1329 | u8 flags; | ||
1330 | u8 reserved[3]; | ||
1331 | u32 entries; /* Number of watchdog entries that follow */ | ||
1332 | }; | ||
1333 | |||
1334 | /* Flags */ | ||
1335 | |||
1336 | #define ACPI_WDRT_TIMER_ENABLED (1) /* 00: Timer enabled */ | ||
1337 | |||
1338 | /* Reset to default packing */ | 910 | /* Reset to default packing */ |
1339 | 911 | ||
1340 | #pragma pack() | 912 | #pragma pack() |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h new file mode 100644 index 000000000000..6f3dce9991e1 --- /dev/null +++ b/include/acpi/actbl2.h | |||
@@ -0,0 +1,868 @@ | |||
1 | #ifndef __ACTBL2_H__ | ||
2 | #define __ACTBL2_H__ | ||
3 | |||
4 | /******************************************************************************* | ||
5 | * | ||
6 | * Additional ACPI Tables (2) | ||
7 | * | ||
8 | * These tables are not consumed directly by the ACPICA subsystem, but are | ||
9 | * included here to support device drivers and the AML disassembler. | ||
10 | * | ||
11 | * The tables in this file are defined by third-party specifications, and are | ||
12 | * not defined directly by the ACPI specification itself. | ||
13 | * | ||
14 | ******************************************************************************/ | ||
15 | |||
16 | /* | ||
17 | * Values for description table header signatures for tables defined in this | ||
18 | * file. Useful because they make it more difficult to inadvertently type in | ||
19 | * the wrong signature. | ||
20 | */ | ||
21 | #define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */ | ||
22 | #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ | ||
23 | #define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ | ||
24 | #define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */ | ||
25 | #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ | ||
26 | #define ACPI_SIG_IBFT "IBFT" /* i_sCSI Boot Firmware Table */ | ||
27 | #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ | ||
28 | #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ | ||
29 | #define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */ | ||
30 | #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ | ||
31 | #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ | ||
32 | #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ | ||
33 | #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */ | ||
34 | #define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */ | ||
35 | #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ | ||
36 | #define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ | ||
37 | |||
38 | /* | ||
39 | * All tables must be byte-packed to match the ACPI specification, since | ||
40 | * the tables are provided by the system BIOS. | ||
41 | */ | ||
42 | #pragma pack(1) | ||
43 | |||
44 | /* | ||
45 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. | ||
46 | * This is the only type that is even remotely portable. Anything else is not | ||
47 | * portable, so do not use any other bitfield types. | ||
48 | */ | ||
49 | |||
50 | /******************************************************************************* | ||
51 | * | ||
52 | * ASF - Alert Standard Format table (Signature "ASF!") | ||
53 | * Revision 0x10 | ||
54 | * | ||
55 | * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003 | ||
56 | * | ||
57 | ******************************************************************************/ | ||
58 | |||
59 | struct acpi_table_asf { | ||
60 | struct acpi_table_header header; /* Common ACPI table header */ | ||
61 | }; | ||
62 | |||
63 | /* ASF subtable header */ | ||
64 | |||
65 | struct acpi_asf_header { | ||
66 | u8 type; | ||
67 | u8 reserved; | ||
68 | u16 length; | ||
69 | }; | ||
70 | |||
71 | /* Values for Type field above */ | ||
72 | |||
73 | enum acpi_asf_type { | ||
74 | ACPI_ASF_TYPE_INFO = 0, | ||
75 | ACPI_ASF_TYPE_ALERT = 1, | ||
76 | ACPI_ASF_TYPE_CONTROL = 2, | ||
77 | ACPI_ASF_TYPE_BOOT = 3, | ||
78 | ACPI_ASF_TYPE_ADDRESS = 4, | ||
79 | ACPI_ASF_TYPE_RESERVED = 5 | ||
80 | }; | ||
81 | |||
82 | /* | ||
83 | * ASF subtables | ||
84 | */ | ||
85 | |||
86 | /* 0: ASF Information */ | ||
87 | |||
88 | struct acpi_asf_info { | ||
89 | struct acpi_asf_header header; | ||
90 | u8 min_reset_value; | ||
91 | u8 min_poll_interval; | ||
92 | u16 system_id; | ||
93 | u32 mfg_id; | ||
94 | u8 flags; | ||
95 | u8 reserved2[3]; | ||
96 | }; | ||
97 | |||
98 | /* Masks for Flags field above */ | ||
99 | |||
100 | #define ACPI_ASF_SMBUS_PROTOCOLS (1) | ||
101 | |||
102 | /* 1: ASF Alerts */ | ||
103 | |||
104 | struct acpi_asf_alert { | ||
105 | struct acpi_asf_header header; | ||
106 | u8 assert_mask; | ||
107 | u8 deassert_mask; | ||
108 | u8 alerts; | ||
109 | u8 data_length; | ||
110 | }; | ||
111 | |||
112 | struct acpi_asf_alert_data { | ||
113 | u8 address; | ||
114 | u8 command; | ||
115 | u8 mask; | ||
116 | u8 value; | ||
117 | u8 sensor_type; | ||
118 | u8 type; | ||
119 | u8 offset; | ||
120 | u8 source_type; | ||
121 | u8 severity; | ||
122 | u8 sensor_number; | ||
123 | u8 entity; | ||
124 | u8 instance; | ||
125 | }; | ||
126 | |||
127 | /* 2: ASF Remote Control */ | ||
128 | |||
129 | struct acpi_asf_remote { | ||
130 | struct acpi_asf_header header; | ||
131 | u8 controls; | ||
132 | u8 data_length; | ||
133 | u16 reserved2; | ||
134 | }; | ||
135 | |||
136 | struct acpi_asf_control_data { | ||
137 | u8 function; | ||
138 | u8 address; | ||
139 | u8 command; | ||
140 | u8 value; | ||
141 | }; | ||
142 | |||
143 | /* 3: ASF RMCP Boot Options */ | ||
144 | |||
145 | struct acpi_asf_rmcp { | ||
146 | struct acpi_asf_header header; | ||
147 | u8 capabilities[7]; | ||
148 | u8 completion_code; | ||
149 | u32 enterprise_id; | ||
150 | u8 command; | ||
151 | u16 parameter; | ||
152 | u16 boot_options; | ||
153 | u16 oem_parameters; | ||
154 | }; | ||
155 | |||
156 | /* 4: ASF Address */ | ||
157 | |||
158 | struct acpi_asf_address { | ||
159 | struct acpi_asf_header header; | ||
160 | u8 eprom_address; | ||
161 | u8 devices; | ||
162 | }; | ||
163 | |||
164 | /******************************************************************************* | ||
165 | * | ||
166 | * BOOT - Simple Boot Flag Table | ||
167 | * Version 1 | ||
168 | * | ||
169 | * Conforms to the "Simple Boot Flag Specification", Version 2.1 | ||
170 | * | ||
171 | ******************************************************************************/ | ||
172 | |||
173 | struct acpi_table_boot { | ||
174 | struct acpi_table_header header; /* Common ACPI table header */ | ||
175 | u8 cmos_index; /* Index in CMOS RAM for the boot register */ | ||
176 | u8 reserved[3]; | ||
177 | }; | ||
178 | |||
179 | /******************************************************************************* | ||
180 | * | ||
181 | * DBGP - Debug Port table | ||
182 | * Version 1 | ||
183 | * | ||
184 | * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000 | ||
185 | * | ||
186 | ******************************************************************************/ | ||
187 | |||
188 | struct acpi_table_dbgp { | ||
189 | struct acpi_table_header header; /* Common ACPI table header */ | ||
190 | u8 type; /* 0=full 16550, 1=subset of 16550 */ | ||
191 | u8 reserved[3]; | ||
192 | struct acpi_generic_address debug_port; | ||
193 | }; | ||
194 | |||
195 | /******************************************************************************* | ||
196 | * | ||
197 | * DMAR - DMA Remapping table | ||
198 | * Version 1 | ||
199 | * | ||
200 | * Conforms to "Intel Virtualization Technology for Directed I/O", | ||
201 | * Version 1.2, Sept. 2008 | ||
202 | * | ||
203 | ******************************************************************************/ | ||
204 | |||
205 | struct acpi_table_dmar { | ||
206 | struct acpi_table_header header; /* Common ACPI table header */ | ||
207 | u8 width; /* Host Address Width */ | ||
208 | u8 flags; | ||
209 | u8 reserved[10]; | ||
210 | }; | ||
211 | |||
212 | /* Masks for Flags field above */ | ||
213 | |||
214 | #define ACPI_DMAR_INTR_REMAP (1) | ||
215 | |||
216 | /* DMAR subtable header */ | ||
217 | |||
218 | struct acpi_dmar_header { | ||
219 | u16 type; | ||
220 | u16 length; | ||
221 | }; | ||
222 | |||
223 | /* Values for subtable type in struct acpi_dmar_header */ | ||
224 | |||
225 | enum acpi_dmar_type { | ||
226 | ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, | ||
227 | ACPI_DMAR_TYPE_RESERVED_MEMORY = 1, | ||
228 | ACPI_DMAR_TYPE_ATSR = 2, | ||
229 | ACPI_DMAR_HARDWARE_AFFINITY = 3, | ||
230 | ACPI_DMAR_TYPE_RESERVED = 4 /* 4 and greater are reserved */ | ||
231 | }; | ||
232 | |||
233 | /* DMAR Device Scope structure */ | ||
234 | |||
235 | struct acpi_dmar_device_scope { | ||
236 | u8 entry_type; | ||
237 | u8 length; | ||
238 | u16 reserved; | ||
239 | u8 enumeration_id; | ||
240 | u8 bus; | ||
241 | }; | ||
242 | |||
243 | /* Values for entry_type in struct acpi_dmar_device_scope */ | ||
244 | |||
245 | enum acpi_dmar_scope_type { | ||
246 | ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0, | ||
247 | ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1, | ||
248 | ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, | ||
249 | ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, | ||
250 | ACPI_DMAR_SCOPE_TYPE_HPET = 4, | ||
251 | ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */ | ||
252 | }; | ||
253 | |||
254 | struct acpi_dmar_pci_path { | ||
255 | u8 dev; | ||
256 | u8 fn; | ||
257 | }; | ||
258 | |||
259 | /* | ||
260 | * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header | ||
261 | */ | ||
262 | |||
263 | /* 0: Hardware Unit Definition */ | ||
264 | |||
265 | struct acpi_dmar_hardware_unit { | ||
266 | struct acpi_dmar_header header; | ||
267 | u8 flags; | ||
268 | u8 reserved; | ||
269 | u16 segment; | ||
270 | u64 address; /* Register Base Address */ | ||
271 | }; | ||
272 | |||
273 | /* Masks for Flags field above */ | ||
274 | |||
275 | #define ACPI_DMAR_INCLUDE_ALL (1) | ||
276 | |||
277 | /* 1: Reserved Memory Defininition */ | ||
278 | |||
279 | struct acpi_dmar_reserved_memory { | ||
280 | struct acpi_dmar_header header; | ||
281 | u16 reserved; | ||
282 | u16 segment; | ||
283 | u64 base_address; /* 4_k aligned base address */ | ||
284 | u64 end_address; /* 4_k aligned limit address */ | ||
285 | }; | ||
286 | |||
287 | /* Masks for Flags field above */ | ||
288 | |||
289 | #define ACPI_DMAR_ALLOW_ALL (1) | ||
290 | |||
291 | /* 2: Root Port ATS Capability Reporting Structure */ | ||
292 | |||
293 | struct acpi_dmar_atsr { | ||
294 | struct acpi_dmar_header header; | ||
295 | u8 flags; | ||
296 | u8 reserved; | ||
297 | u16 segment; | ||
298 | }; | ||
299 | |||
300 | /* Masks for Flags field above */ | ||
301 | |||
302 | #define ACPI_DMAR_ALL_PORTS (1) | ||
303 | |||
304 | /* 3: Remapping Hardware Static Affinity Structure */ | ||
305 | |||
306 | struct acpi_dmar_rhsa { | ||
307 | struct acpi_dmar_header header; | ||
308 | u32 reserved; | ||
309 | u64 base_address; | ||
310 | u32 proximity_domain; | ||
311 | }; | ||
312 | |||
313 | /******************************************************************************* | ||
314 | * | ||
315 | * HPET - High Precision Event Timer table | ||
316 | * Version 1 | ||
317 | * | ||
318 | * Conforms to "IA-PC HPET (High Precision Event Timers) Specification", | ||
319 | * Version 1.0a, October 2004 | ||
320 | * | ||
321 | ******************************************************************************/ | ||
322 | |||
323 | struct acpi_table_hpet { | ||
324 | struct acpi_table_header header; /* Common ACPI table header */ | ||
325 | u32 id; /* Hardware ID of event timer block */ | ||
326 | struct acpi_generic_address address; /* Address of event timer block */ | ||
327 | u8 sequence; /* HPET sequence number */ | ||
328 | u16 minimum_tick; /* Main counter min tick, periodic mode */ | ||
329 | u8 flags; | ||
330 | }; | ||
331 | |||
332 | /* Masks for Flags field above */ | ||
333 | |||
334 | #define ACPI_HPET_PAGE_PROTECT_MASK (3) | ||
335 | |||
336 | /* Values for Page Protect flags */ | ||
337 | |||
338 | enum acpi_hpet_page_protect { | ||
339 | ACPI_HPET_NO_PAGE_PROTECT = 0, | ||
340 | ACPI_HPET_PAGE_PROTECT4 = 1, | ||
341 | ACPI_HPET_PAGE_PROTECT64 = 2 | ||
342 | }; | ||
343 | |||
344 | /******************************************************************************* | ||
345 | * | ||
346 | * IBFT - Boot Firmware Table | ||
347 | * Version 1 | ||
348 | * | ||
349 | * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b | ||
350 | * Specification", Version 1.01, March 1, 2007 | ||
351 | * | ||
352 | * Note: It appears that this table is not intended to appear in the RSDT/XSDT. | ||
353 | * Therefore, it is not currently supported by the disassembler. | ||
354 | * | ||
355 | ******************************************************************************/ | ||
356 | |||
357 | struct acpi_table_ibft { | ||
358 | struct acpi_table_header header; /* Common ACPI table header */ | ||
359 | u8 reserved[12]; | ||
360 | }; | ||
361 | |||
362 | /* IBFT common subtable header */ | ||
363 | |||
364 | struct acpi_ibft_header { | ||
365 | u8 type; | ||
366 | u8 version; | ||
367 | u16 length; | ||
368 | u8 index; | ||
369 | u8 flags; | ||
370 | }; | ||
371 | |||
372 | /* Values for Type field above */ | ||
373 | |||
374 | enum acpi_ibft_type { | ||
375 | ACPI_IBFT_TYPE_NOT_USED = 0, | ||
376 | ACPI_IBFT_TYPE_CONTROL = 1, | ||
377 | ACPI_IBFT_TYPE_INITIATOR = 2, | ||
378 | ACPI_IBFT_TYPE_NIC = 3, | ||
379 | ACPI_IBFT_TYPE_TARGET = 4, | ||
380 | ACPI_IBFT_TYPE_EXTENSIONS = 5, | ||
381 | ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */ | ||
382 | }; | ||
383 | |||
384 | /* IBFT subtables */ | ||
385 | |||
386 | struct acpi_ibft_control { | ||
387 | struct acpi_ibft_header header; | ||
388 | u16 extensions; | ||
389 | u16 initiator_offset; | ||
390 | u16 nic0_offset; | ||
391 | u16 target0_offset; | ||
392 | u16 nic1_offset; | ||
393 | u16 target1_offset; | ||
394 | }; | ||
395 | |||
396 | struct acpi_ibft_initiator { | ||
397 | struct acpi_ibft_header header; | ||
398 | u8 sns_server[16]; | ||
399 | u8 slp_server[16]; | ||
400 | u8 primary_server[16]; | ||
401 | u8 secondary_server[16]; | ||
402 | u16 name_length; | ||
403 | u16 name_offset; | ||
404 | }; | ||
405 | |||
406 | struct acpi_ibft_nic { | ||
407 | struct acpi_ibft_header header; | ||
408 | u8 ip_address[16]; | ||
409 | u8 subnet_mask_prefix; | ||
410 | u8 origin; | ||
411 | u8 gateway[16]; | ||
412 | u8 primary_dns[16]; | ||
413 | u8 secondary_dns[16]; | ||
414 | u8 dhcp[16]; | ||
415 | u16 vlan; | ||
416 | u8 mac_address[6]; | ||
417 | u16 pci_address; | ||
418 | u16 name_length; | ||
419 | u16 name_offset; | ||
420 | }; | ||
421 | |||
422 | struct acpi_ibft_target { | ||
423 | struct acpi_ibft_header header; | ||
424 | u8 target_ip_address[16]; | ||
425 | u16 target_ip_socket; | ||
426 | u8 target_boot_lun[8]; | ||
427 | u8 chap_type; | ||
428 | u8 nic_association; | ||
429 | u16 target_name_length; | ||
430 | u16 target_name_offset; | ||
431 | u16 chap_name_length; | ||
432 | u16 chap_name_offset; | ||
433 | u16 chap_secret_length; | ||
434 | u16 chap_secret_offset; | ||
435 | u16 reverse_chap_name_length; | ||
436 | u16 reverse_chap_name_offset; | ||
437 | u16 reverse_chap_secret_length; | ||
438 | u16 reverse_chap_secret_offset; | ||
439 | }; | ||
440 | |||
441 | /******************************************************************************* | ||
442 | * | ||
443 | * IVRS - I/O Virtualization Reporting Structure | ||
444 | * Version 1 | ||
445 | * | ||
446 | * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification", | ||
447 | * Revision 1.26, February 2009. | ||
448 | * | ||
449 | ******************************************************************************/ | ||
450 | |||
451 | struct acpi_table_ivrs { | ||
452 | struct acpi_table_header header; /* Common ACPI table header */ | ||
453 | u32 info; /* Common virtualization info */ | ||
454 | u64 reserved; | ||
455 | }; | ||
456 | |||
457 | /* Values for Info field above */ | ||
458 | |||
459 | #define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */ | ||
460 | #define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */ | ||
461 | #define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved */ | ||
462 | |||
463 | /* IVRS subtable header */ | ||
464 | |||
465 | struct acpi_ivrs_header { | ||
466 | u8 type; /* Subtable type */ | ||
467 | u8 flags; | ||
468 | u16 length; /* Subtable length */ | ||
469 | u16 device_id; /* ID of IOMMU */ | ||
470 | }; | ||
471 | |||
472 | /* Values for subtable Type above */ | ||
473 | |||
474 | enum acpi_ivrs_type { | ||
475 | ACPI_IVRS_TYPE_HARDWARE = 0x10, | ||
476 | ACPI_IVRS_TYPE_MEMORY1 = 0x20, | ||
477 | ACPI_IVRS_TYPE_MEMORY2 = 0x21, | ||
478 | ACPI_IVRS_TYPE_MEMORY3 = 0x22 | ||
479 | }; | ||
480 | |||
481 | /* Masks for Flags field above for IVHD subtable */ | ||
482 | |||
483 | #define ACPI_IVHD_TT_ENABLE (1) | ||
484 | #define ACPI_IVHD_PASS_PW (1<<1) | ||
485 | #define ACPI_IVHD_RES_PASS_PW (1<<2) | ||
486 | #define ACPI_IVHD_ISOC (1<<3) | ||
487 | #define ACPI_IVHD_IOTLB (1<<4) | ||
488 | |||
489 | /* Masks for Flags field above for IVMD subtable */ | ||
490 | |||
491 | #define ACPI_IVMD_UNITY (1) | ||
492 | #define ACPI_IVMD_READ (1<<1) | ||
493 | #define ACPI_IVMD_WRITE (1<<2) | ||
494 | #define ACPI_IVMD_EXCLUSION_RANGE (1<<3) | ||
495 | |||
496 | /* | ||
497 | * IVRS subtables, correspond to Type in struct acpi_ivrs_header | ||
498 | */ | ||
499 | |||
500 | /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */ | ||
501 | |||
502 | struct acpi_ivrs_hardware { | ||
503 | struct acpi_ivrs_header header; | ||
504 | u16 capability_offset; /* Offset for IOMMU control fields */ | ||
505 | u64 base_address; /* IOMMU control registers */ | ||
506 | u16 pci_segment_group; | ||
507 | u16 info; /* MSI number and unit ID */ | ||
508 | u32 reserved; | ||
509 | }; | ||
510 | |||
511 | /* Masks for Info field above */ | ||
512 | |||
513 | #define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */ | ||
514 | #define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, unit_iD */ | ||
515 | |||
516 | /* | ||
517 | * Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure. | ||
518 | * Upper two bits of the Type field are the (encoded) length of the structure. | ||
519 | * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries | ||
520 | * are reserved for future use but not defined. | ||
521 | */ | ||
522 | struct acpi_ivrs_de_header { | ||
523 | u8 type; | ||
524 | u16 id; | ||
525 | u8 data_setting; | ||
526 | }; | ||
527 | |||
528 | /* Length of device entry is in the top two bits of Type field above */ | ||
529 | |||
530 | #define ACPI_IVHD_ENTRY_LENGTH 0xC0 | ||
531 | |||
532 | /* Values for device entry Type field above */ | ||
533 | |||
534 | enum acpi_ivrs_device_entry_type { | ||
535 | /* 4-byte device entries, all use struct acpi_ivrs_device4 */ | ||
536 | |||
537 | ACPI_IVRS_TYPE_PAD4 = 0, | ||
538 | ACPI_IVRS_TYPE_ALL = 1, | ||
539 | ACPI_IVRS_TYPE_SELECT = 2, | ||
540 | ACPI_IVRS_TYPE_START = 3, | ||
541 | ACPI_IVRS_TYPE_END = 4, | ||
542 | |||
543 | /* 8-byte device entries */ | ||
544 | |||
545 | ACPI_IVRS_TYPE_PAD8 = 64, | ||
546 | ACPI_IVRS_TYPE_NOT_USED = 65, | ||
547 | ACPI_IVRS_TYPE_ALIAS_SELECT = 66, /* Uses struct acpi_ivrs_device8a */ | ||
548 | ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses struct acpi_ivrs_device8a */ | ||
549 | ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses struct acpi_ivrs_device8b */ | ||
550 | ACPI_IVRS_TYPE_EXT_START = 71, /* Uses struct acpi_ivrs_device8b */ | ||
551 | ACPI_IVRS_TYPE_SPECIAL = 72 /* Uses struct acpi_ivrs_device8c */ | ||
552 | }; | ||
553 | |||
554 | /* Values for Data field above */ | ||
555 | |||
556 | #define ACPI_IVHD_INIT_PASS (1) | ||
557 | #define ACPI_IVHD_EINT_PASS (1<<1) | ||
558 | #define ACPI_IVHD_NMI_PASS (1<<2) | ||
559 | #define ACPI_IVHD_SYSTEM_MGMT (3<<4) | ||
560 | #define ACPI_IVHD_LINT0_PASS (1<<6) | ||
561 | #define ACPI_IVHD_LINT1_PASS (1<<7) | ||
562 | |||
563 | /* Types 0-4: 4-byte device entry */ | ||
564 | |||
565 | struct acpi_ivrs_device4 { | ||
566 | struct acpi_ivrs_de_header header; | ||
567 | }; | ||
568 | |||
569 | /* Types 66-67: 8-byte device entry */ | ||
570 | |||
571 | struct acpi_ivrs_device8a { | ||
572 | struct acpi_ivrs_de_header header; | ||
573 | u8 reserved1; | ||
574 | u16 used_id; | ||
575 | u8 reserved2; | ||
576 | }; | ||
577 | |||
578 | /* Types 70-71: 8-byte device entry */ | ||
579 | |||
580 | struct acpi_ivrs_device8b { | ||
581 | struct acpi_ivrs_de_header header; | ||
582 | u32 extended_data; | ||
583 | }; | ||
584 | |||
585 | /* Values for extended_data above */ | ||
586 | |||
587 | #define ACPI_IVHD_ATS_DISABLED (1<<31) | ||
588 | |||
589 | /* Type 72: 8-byte device entry */ | ||
590 | |||
591 | struct acpi_ivrs_device8c { | ||
592 | struct acpi_ivrs_de_header header; | ||
593 | u8 handle; | ||
594 | u16 used_id; | ||
595 | u8 variety; | ||
596 | }; | ||
597 | |||
598 | /* Values for Variety field above */ | ||
599 | |||
600 | #define ACPI_IVHD_IOAPIC 1 | ||
601 | #define ACPI_IVHD_HPET 2 | ||
602 | |||
603 | /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */ | ||
604 | |||
605 | struct acpi_ivrs_memory { | ||
606 | struct acpi_ivrs_header header; | ||
607 | u16 aux_data; | ||
608 | u64 reserved; | ||
609 | u64 start_address; | ||
610 | u64 memory_length; | ||
611 | }; | ||
612 | |||
613 | /******************************************************************************* | ||
614 | * | ||
615 | * MCFG - PCI Memory Mapped Configuration table and sub-table | ||
616 | * Version 1 | ||
617 | * | ||
618 | * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005 | ||
619 | * | ||
620 | ******************************************************************************/ | ||
621 | |||
622 | struct acpi_table_mcfg { | ||
623 | struct acpi_table_header header; /* Common ACPI table header */ | ||
624 | u8 reserved[8]; | ||
625 | }; | ||
626 | |||
627 | /* Subtable */ | ||
628 | |||
629 | struct acpi_mcfg_allocation { | ||
630 | u64 address; /* Base address, processor-relative */ | ||
631 | u16 pci_segment; /* PCI segment group number */ | ||
632 | u8 start_bus_number; /* Starting PCI Bus number */ | ||
633 | u8 end_bus_number; /* Final PCI Bus number */ | ||
634 | u32 reserved; | ||
635 | }; | ||
636 | |||
637 | /******************************************************************************* | ||
638 | * | ||
639 | * SPCR - Serial Port Console Redirection table | ||
640 | * Version 1 | ||
641 | * | ||
642 | * Conforms to "Serial Port Console Redirection Table", | ||
643 | * Version 1.00, January 11, 2002 | ||
644 | * | ||
645 | ******************************************************************************/ | ||
646 | |||
647 | struct acpi_table_spcr { | ||
648 | struct acpi_table_header header; /* Common ACPI table header */ | ||
649 | u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ | ||
650 | u8 reserved[3]; | ||
651 | struct acpi_generic_address serial_port; | ||
652 | u8 interrupt_type; | ||
653 | u8 pc_interrupt; | ||
654 | u32 interrupt; | ||
655 | u8 baud_rate; | ||
656 | u8 parity; | ||
657 | u8 stop_bits; | ||
658 | u8 flow_control; | ||
659 | u8 terminal_type; | ||
660 | u8 reserved1; | ||
661 | u16 pci_device_id; | ||
662 | u16 pci_vendor_id; | ||
663 | u8 pci_bus; | ||
664 | u8 pci_device; | ||
665 | u8 pci_function; | ||
666 | u32 pci_flags; | ||
667 | u8 pci_segment; | ||
668 | u32 reserved2; | ||
669 | }; | ||
670 | |||
671 | /* Masks for pci_flags field above */ | ||
672 | |||
673 | #define ACPI_SPCR_DO_NOT_DISABLE (1) | ||
674 | |||
675 | /******************************************************************************* | ||
676 | * | ||
677 | * SPMI - Server Platform Management Interface table | ||
678 | * Version 5 | ||
679 | * | ||
680 | * Conforms to "Intelligent Platform Management Interface Specification | ||
681 | * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with | ||
682 | * June 12, 2009 markup. | ||
683 | * | ||
684 | ******************************************************************************/ | ||
685 | |||
686 | struct acpi_table_spmi { | ||
687 | struct acpi_table_header header; /* Common ACPI table header */ | ||
688 | u8 interface_type; | ||
689 | u8 reserved; /* Must be 1 */ | ||
690 | u16 spec_revision; /* Version of IPMI */ | ||
691 | u8 interrupt_type; | ||
692 | u8 gpe_number; /* GPE assigned */ | ||
693 | u8 reserved1; | ||
694 | u8 pci_device_flag; | ||
695 | u32 interrupt; | ||
696 | struct acpi_generic_address ipmi_register; | ||
697 | u8 pci_segment; | ||
698 | u8 pci_bus; | ||
699 | u8 pci_device; | ||
700 | u8 pci_function; | ||
701 | u8 reserved2; | ||
702 | }; | ||
703 | |||
704 | /* Values for interface_type above */ | ||
705 | |||
706 | enum acpi_spmi_interface_types { | ||
707 | ACPI_SPMI_NOT_USED = 0, | ||
708 | ACPI_SPMI_KEYBOARD = 1, | ||
709 | ACPI_SPMI_SMI = 2, | ||
710 | ACPI_SPMI_BLOCK_TRANSFER = 3, | ||
711 | ACPI_SPMI_SMBUS = 4, | ||
712 | ACPI_SPMI_RESERVED = 5 /* 5 and above are reserved */ | ||
713 | }; | ||
714 | |||
715 | /******************************************************************************* | ||
716 | * | ||
717 | * TCPA - Trusted Computing Platform Alliance table | ||
718 | * Version 1 | ||
719 | * | ||
720 | * Conforms to "TCG PC Specific Implementation Specification", | ||
721 | * Version 1.1, August 18, 2003 | ||
722 | * | ||
723 | ******************************************************************************/ | ||
724 | |||
725 | struct acpi_table_tcpa { | ||
726 | struct acpi_table_header header; /* Common ACPI table header */ | ||
727 | u16 reserved; | ||
728 | u32 max_log_length; /* Maximum length for the event log area */ | ||
729 | u64 log_address; /* Address of the event log area */ | ||
730 | }; | ||
731 | |||
732 | /******************************************************************************* | ||
733 | * | ||
734 | * UEFI - UEFI Boot optimization Table | ||
735 | * Version 1 | ||
736 | * | ||
737 | * Conforms to "Unified Extensible Firmware Interface Specification", | ||
738 | * Version 2.3, May 8, 2009 | ||
739 | * | ||
740 | ******************************************************************************/ | ||
741 | |||
742 | struct acpi_table_uefi { | ||
743 | struct acpi_table_header header; /* Common ACPI table header */ | ||
744 | u8 identifier[16]; /* UUID identifier */ | ||
745 | u16 data_offset; /* Offset of remaining data in table */ | ||
746 | }; | ||
747 | |||
748 | /******************************************************************************* | ||
749 | * | ||
750 | * WAET - Windows ACPI Emulated devices Table | ||
751 | * Version 1 | ||
752 | * | ||
753 | * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009 | ||
754 | * | ||
755 | ******************************************************************************/ | ||
756 | |||
757 | struct acpi_table_waet { | ||
758 | struct acpi_table_header header; /* Common ACPI table header */ | ||
759 | u32 flags; | ||
760 | }; | ||
761 | |||
762 | /* Masks for Flags field above */ | ||
763 | |||
764 | #define ACPI_WAET_RTC_NO_ACK (1) /* RTC requires no int acknowledge */ | ||
765 | #define ACPI_WAET_TIMER_ONE_READ (1<<1) /* PM timer requires only one read */ | ||
766 | |||
767 | /******************************************************************************* | ||
768 | * | ||
769 | * WDAT - Watchdog Action Table | ||
770 | * Version 1 | ||
771 | * | ||
772 | * Conforms to "Hardware Watchdog Timers Design Specification", | ||
773 | * Copyright 2006 Microsoft Corporation. | ||
774 | * | ||
775 | ******************************************************************************/ | ||
776 | |||
777 | struct acpi_table_wdat { | ||
778 | struct acpi_table_header header; /* Common ACPI table header */ | ||
779 | u32 header_length; /* Watchdog Header Length */ | ||
780 | u16 pci_segment; /* PCI Segment number */ | ||
781 | u8 pci_bus; /* PCI Bus number */ | ||
782 | u8 pci_device; /* PCI Device number */ | ||
783 | u8 pci_function; /* PCI Function number */ | ||
784 | u8 reserved[3]; | ||
785 | u32 timer_period; /* Period of one timer count (msec) */ | ||
786 | u32 max_count; /* Maximum counter value supported */ | ||
787 | u32 min_count; /* Minimum counter value */ | ||
788 | u8 flags; | ||
789 | u8 reserved2[3]; | ||
790 | u32 entries; /* Number of watchdog entries that follow */ | ||
791 | }; | ||
792 | |||
793 | /* Masks for Flags field above */ | ||
794 | |||
795 | #define ACPI_WDAT_ENABLED (1) | ||
796 | #define ACPI_WDAT_STOPPED 0x80 | ||
797 | |||
798 | /* WDAT Instruction Entries (actions) */ | ||
799 | |||
800 | struct acpi_wdat_entry { | ||
801 | u8 action; | ||
802 | u8 instruction; | ||
803 | u16 reserved; | ||
804 | struct acpi_generic_address register_region; | ||
805 | u32 value; /* Value used with Read/Write register */ | ||
806 | u32 mask; /* Bitmask required for this register instruction */ | ||
807 | }; | ||
808 | |||
809 | /* Values for Action field above */ | ||
810 | |||
811 | enum acpi_wdat_actions { | ||
812 | ACPI_WDAT_RESET = 1, | ||
813 | ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4, | ||
814 | ACPI_WDAT_GET_COUNTDOWN = 5, | ||
815 | ACPI_WDAT_SET_COUNTDOWN = 6, | ||
816 | ACPI_WDAT_GET_RUNNING_STATE = 8, | ||
817 | ACPI_WDAT_SET_RUNNING_STATE = 9, | ||
818 | ACPI_WDAT_GET_STOPPED_STATE = 10, | ||
819 | ACPI_WDAT_SET_STOPPED_STATE = 11, | ||
820 | ACPI_WDAT_GET_REBOOT = 16, | ||
821 | ACPI_WDAT_SET_REBOOT = 17, | ||
822 | ACPI_WDAT_GET_SHUTDOWN = 18, | ||
823 | ACPI_WDAT_SET_SHUTDOWN = 19, | ||
824 | ACPI_WDAT_GET_STATUS = 32, | ||
825 | ACPI_WDAT_SET_STATUS = 33, | ||
826 | ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */ | ||
827 | }; | ||
828 | |||
829 | /* Values for Instruction field above */ | ||
830 | |||
831 | enum acpi_wdat_instructions { | ||
832 | ACPI_WDAT_READ_VALUE = 0, | ||
833 | ACPI_WDAT_READ_COUNTDOWN = 1, | ||
834 | ACPI_WDAT_WRITE_VALUE = 2, | ||
835 | ACPI_WDAT_WRITE_COUNTDOWN = 3, | ||
836 | ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */ | ||
837 | ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */ | ||
838 | }; | ||
839 | |||
840 | /******************************************************************************* | ||
841 | * | ||
842 | * WDRT - Watchdog Resource Table | ||
843 | * Version 1 | ||
844 | * | ||
845 | * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003", | ||
846 | * Version 1.01, August 28, 2006 | ||
847 | * | ||
848 | ******************************************************************************/ | ||
849 | |||
850 | struct acpi_table_wdrt { | ||
851 | struct acpi_table_header header; /* Common ACPI table header */ | ||
852 | struct acpi_generic_address control_register; | ||
853 | struct acpi_generic_address count_register; | ||
854 | u16 pci_device_id; | ||
855 | u16 pci_vendor_id; | ||
856 | u8 pci_bus; /* PCI Bus number */ | ||
857 | u8 pci_device; /* PCI Device number */ | ||
858 | u8 pci_function; /* PCI Function number */ | ||
859 | u8 pci_segment; /* PCI Segment number */ | ||
860 | u16 max_count; /* Maximum counter value supported */ | ||
861 | u8 units; | ||
862 | }; | ||
863 | |||
864 | /* Reset to default packing */ | ||
865 | |||
866 | #pragma pack() | ||
867 | |||
868 | #endif /* __ACTBL2_H__ */ | ||
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 37ba576d06e8..153f12dc3373 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -288,7 +288,7 @@ typedef u32 acpi_physical_address; | |||
288 | /* | 288 | /* |
289 | * Some compilers complain about unused variables. Sometimes we don't want to | 289 | * Some compilers complain about unused variables. Sometimes we don't want to |
290 | * use all the variables (for example, _acpi_module_name). This allows us | 290 | * use all the variables (for example, _acpi_module_name). This allows us |
291 | * to to tell the compiler in a per-variable manner that a variable | 291 | * to tell the compiler in a per-variable manner that a variable |
292 | * is unused | 292 | * is unused |
293 | */ | 293 | */ |
294 | #ifndef ACPI_UNUSED_VAR | 294 | #ifndef ACPI_UNUSED_VAR |
@@ -338,7 +338,7 @@ typedef u32 acpi_physical_address; | |||
338 | 338 | ||
339 | /* PM Timer ticks per second (HZ) */ | 339 | /* PM Timer ticks per second (HZ) */ |
340 | 340 | ||
341 | #define PM_TIMER_FREQUENCY 3579545 | 341 | #define PM_TIMER_FREQUENCY 3579545 |
342 | 342 | ||
343 | /******************************************************************************* | 343 | /******************************************************************************* |
344 | * | 344 | * |
@@ -732,7 +732,8 @@ typedef u8 acpi_adr_space_type; | |||
732 | #define ACPI_ADR_SPACE_SMBUS (acpi_adr_space_type) 4 | 732 | #define ACPI_ADR_SPACE_SMBUS (acpi_adr_space_type) 4 |
733 | #define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 | 733 | #define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 |
734 | #define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 | 734 | #define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 |
735 | #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7 | 735 | #define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7 |
736 | #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 8 | ||
736 | #define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127 | 737 | #define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127 |
737 | 738 | ||
738 | /* | 739 | /* |
@@ -921,7 +922,7 @@ typedef | |||
921 | void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context); | 922 | void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context); |
922 | 923 | ||
923 | typedef | 924 | typedef |
924 | void (*acpi_object_handler) (acpi_handle object, u32 function, void *data); | 925 | void (*acpi_object_handler) (acpi_handle object, void *data); |
925 | 926 | ||
926 | typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function); | 927 | typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function); |
927 | 928 | ||
@@ -969,38 +970,60 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle, | |||
969 | #define ACPI_INTERRUPT_NOT_HANDLED 0x00 | 970 | #define ACPI_INTERRUPT_NOT_HANDLED 0x00 |
970 | #define ACPI_INTERRUPT_HANDLED 0x01 | 971 | #define ACPI_INTERRUPT_HANDLED 0x01 |
971 | 972 | ||
972 | /* Length of _HID, _UID, _CID, and UUID values */ | 973 | /* Length of 32-bit EISAID values when converted back to a string */ |
974 | |||
975 | #define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */ | ||
976 | |||
977 | /* Length of UUID (string) values */ | ||
973 | 978 | ||
974 | #define ACPI_DEVICE_ID_LENGTH 0x09 | ||
975 | #define ACPI_MAX_CID_LENGTH 48 | ||
976 | #define ACPI_UUID_LENGTH 16 | 979 | #define ACPI_UUID_LENGTH 16 |
977 | 980 | ||
978 | /* Common string version of device HIDs and UIDs */ | 981 | /* Structures used for device/processor HID, UID, CID */ |
979 | 982 | ||
980 | struct acpica_device_id { | 983 | struct acpica_device_id { |
981 | char value[ACPI_DEVICE_ID_LENGTH]; | 984 | u32 length; /* Length of string + null */ |
985 | char *string; | ||
982 | }; | 986 | }; |
983 | 987 | ||
984 | /* Common string version of device CIDs */ | 988 | struct acpica_device_id_list { |
985 | 989 | u32 count; /* Number of IDs in Ids array */ | |
986 | struct acpi_compatible_id { | 990 | u32 list_size; /* Size of list, including ID strings */ |
987 | char value[ACPI_MAX_CID_LENGTH]; | 991 | struct acpica_device_id ids[1]; /* ID array */ |
988 | }; | 992 | }; |
989 | 993 | ||
990 | struct acpi_compatible_id_list { | 994 | /* |
991 | u32 count; | 995 | * Structure returned from acpi_get_object_info. |
992 | u32 size; | 996 | * Optimized for both 32- and 64-bit builds |
993 | struct acpi_compatible_id id[1]; | 997 | */ |
998 | struct acpi_device_info { | ||
999 | u32 info_size; /* Size of info, including ID strings */ | ||
1000 | u32 name; /* ACPI object Name */ | ||
1001 | acpi_object_type type; /* ACPI object Type */ | ||
1002 | u8 param_count; /* If a method, required parameter count */ | ||
1003 | u8 valid; /* Indicates which optional fields are valid */ | ||
1004 | u8 flags; /* Miscellaneous info */ | ||
1005 | u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ | ||
1006 | u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */ | ||
1007 | u32 current_status; /* _STA value */ | ||
1008 | acpi_integer address; /* _ADR value */ | ||
1009 | struct acpica_device_id hardware_id; /* _HID value */ | ||
1010 | struct acpica_device_id unique_id; /* _UID value */ | ||
1011 | struct acpica_device_id_list compatible_id_list; /* _CID list <must be last> */ | ||
994 | }; | 1012 | }; |
995 | 1013 | ||
996 | /* Structure and flags for acpi_get_object_info */ | 1014 | /* Values for Flags field above (acpi_get_object_info) */ |
1015 | |||
1016 | #define ACPI_PCI_ROOT_BRIDGE 0x01 | ||
997 | 1017 | ||
998 | #define ACPI_VALID_STA 0x0001 | 1018 | /* Flags for Valid field above (acpi_get_object_info) */ |
999 | #define ACPI_VALID_ADR 0x0002 | 1019 | |
1000 | #define ACPI_VALID_HID 0x0004 | 1020 | #define ACPI_VALID_STA 0x01 |
1001 | #define ACPI_VALID_UID 0x0008 | 1021 | #define ACPI_VALID_ADR 0x02 |
1002 | #define ACPI_VALID_CID 0x0010 | 1022 | #define ACPI_VALID_HID 0x04 |
1003 | #define ACPI_VALID_SXDS 0x0020 | 1023 | #define ACPI_VALID_UID 0x08 |
1024 | #define ACPI_VALID_CID 0x10 | ||
1025 | #define ACPI_VALID_SXDS 0x20 | ||
1026 | #define ACPI_VALID_SXWS 0x40 | ||
1004 | 1027 | ||
1005 | /* Flags for _STA method */ | 1028 | /* Flags for _STA method */ |
1006 | 1029 | ||
@@ -1011,29 +1034,6 @@ struct acpi_compatible_id_list { | |||
1011 | #define ACPI_STA_DEVICE_OK 0x08 /* Synonym */ | 1034 | #define ACPI_STA_DEVICE_OK 0x08 /* Synonym */ |
1012 | #define ACPI_STA_BATTERY_PRESENT 0x10 | 1035 | #define ACPI_STA_BATTERY_PRESENT 0x10 |
1013 | 1036 | ||
1014 | #define ACPI_COMMON_OBJ_INFO \ | ||
1015 | acpi_object_type type; /* ACPI object type */ \ | ||
1016 | acpi_name name /* ACPI object Name */ | ||
1017 | |||
1018 | struct acpi_obj_info_header { | ||
1019 | ACPI_COMMON_OBJ_INFO; | ||
1020 | }; | ||
1021 | |||
1022 | /* Structure returned from Get Object Info */ | ||
1023 | |||
1024 | struct acpi_device_info { | ||
1025 | ACPI_COMMON_OBJ_INFO; | ||
1026 | |||
1027 | u32 param_count; /* If a method, required parameter count */ | ||
1028 | u32 valid; /* Indicates which fields below are valid */ | ||
1029 | u32 current_status; /* _STA value */ | ||
1030 | acpi_integer address; /* _ADR value if any */ | ||
1031 | struct acpica_device_id hardware_id; /* _HID value if any */ | ||
1032 | struct acpica_device_id unique_id; /* _UID value if any */ | ||
1033 | u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ | ||
1034 | struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ | ||
1035 | }; | ||
1036 | |||
1037 | /* Context structs for address space handlers */ | 1037 | /* Context structs for address space handlers */ |
1038 | 1038 | ||
1039 | struct acpi_pci_id { | 1039 | struct acpi_pci_id { |
diff --git a/include/acpi/button.h b/include/acpi/button.h new file mode 100644 index 000000000000..97eea0e4c016 --- /dev/null +++ b/include/acpi/button.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef ACPI_BUTTON_H | ||
2 | #define ACPI_BUTTON_H | ||
3 | |||
4 | #include <linux/notifier.h> | ||
5 | |||
6 | #if defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE) | ||
7 | extern int acpi_lid_notifier_register(struct notifier_block *nb); | ||
8 | extern int acpi_lid_notifier_unregister(struct notifier_block *nb); | ||
9 | extern int acpi_lid_open(void); | ||
10 | #else | ||
11 | static inline int acpi_lid_notifier_register(struct notifier_block *nb) | ||
12 | { | ||
13 | return 0; | ||
14 | } | ||
15 | static inline int acpi_lid_notifier_unregister(struct notifier_block *nb) | ||
16 | { | ||
17 | return 0; | ||
18 | } | ||
19 | static inline int acpi_lid_open(void) | ||
20 | { | ||
21 | return 1; | ||
22 | } | ||
23 | #endif /* defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE) */ | ||
24 | |||
25 | #endif /* ACPI_BUTTON_H */ | ||
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 935c5d7fc86e..6aadbf84ae71 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h | |||
@@ -57,7 +57,7 @@ | |||
57 | /* | 57 | /* |
58 | * Some compilers complain about unused variables. Sometimes we don't want to | 58 | * Some compilers complain about unused variables. Sometimes we don't want to |
59 | * use all the variables (for example, _acpi_module_name). This allows us | 59 | * use all the variables (for example, _acpi_module_name). This allows us |
60 | * to to tell the compiler warning in a per-variable manner that a variable | 60 | * to tell the compiler warning in a per-variable manner that a variable |
61 | * is unused. | 61 | * is unused. |
62 | */ | 62 | */ |
63 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) | 63 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index fcb8e4b159b1..9d7febde10a1 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -149,10 +149,10 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) | |||
149 | #define ACPI_FREE(a) kfree(a) | 149 | #define ACPI_FREE(a) kfree(a) |
150 | 150 | ||
151 | /* Used within ACPICA to show where it is safe to preempt execution */ | 151 | /* Used within ACPICA to show where it is safe to preempt execution */ |
152 | 152 | #include <linux/hardirq.h> | |
153 | #define ACPI_PREEMPTION_POINT() \ | 153 | #define ACPI_PREEMPTION_POINT() \ |
154 | do { \ | 154 | do { \ |
155 | if (!irqs_disabled()) \ | 155 | if (!in_atomic_preempt_off()) \ |
156 | cond_resched(); \ | 156 | cond_resched(); \ |
157 | } while (0) | 157 | } while (0) |
158 | 158 | ||
diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h index 1c1fa422d18a..ca0f239f0e13 100644 --- a/include/asm-generic/cputime.h +++ b/include/asm-generic/cputime.h | |||
@@ -7,6 +7,7 @@ | |||
7 | typedef unsigned long cputime_t; | 7 | typedef unsigned long cputime_t; |
8 | 8 | ||
9 | #define cputime_zero (0UL) | 9 | #define cputime_zero (0UL) |
10 | #define cputime_one_jiffy jiffies_to_cputime(1) | ||
10 | #define cputime_max ((~0UL >> 1) - 1) | 11 | #define cputime_max ((~0UL >> 1) - 1) |
11 | #define cputime_add(__a, __b) ((__a) + (__b)) | 12 | #define cputime_add(__a, __b) ((__a) + (__b)) |
12 | #define cputime_sub(__a, __b) ((__a) - (__b)) | 13 | #define cputime_sub(__a, __b) ((__a) - (__b)) |
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index 4d3e48373e74..0c3dd8603927 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h | |||
@@ -73,6 +73,19 @@ | |||
73 | #define F_SETSIG 10 /* for sockets. */ | 73 | #define F_SETSIG 10 /* for sockets. */ |
74 | #define F_GETSIG 11 /* for sockets. */ | 74 | #define F_GETSIG 11 /* for sockets. */ |
75 | #endif | 75 | #endif |
76 | #ifndef F_SETOWN_EX | ||
77 | #define F_SETOWN_EX 12 | ||
78 | #define F_GETOWN_EX 13 | ||
79 | #endif | ||
80 | |||
81 | #define F_OWNER_TID 0 | ||
82 | #define F_OWNER_PID 1 | ||
83 | #define F_OWNER_GID 2 | ||
84 | |||
85 | struct f_owner_ex { | ||
86 | int type; | ||
87 | pid_t pid; | ||
88 | }; | ||
76 | 89 | ||
77 | /* for F_[GET|SET]FL */ | 90 | /* for F_[GET|SET]FL */ |
78 | #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ | 91 | #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ |
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index d6c379dc64fa..9cca3785cab8 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -141,6 +141,8 @@ extern int __gpio_to_irq(unsigned gpio); | |||
141 | * but more typically is configured entirely from userspace. | 141 | * but more typically is configured entirely from userspace. |
142 | */ | 142 | */ |
143 | extern int gpio_export(unsigned gpio, bool direction_may_change); | 143 | extern int gpio_export(unsigned gpio, bool direction_may_change); |
144 | extern int gpio_export_link(struct device *dev, const char *name, | ||
145 | unsigned gpio); | ||
144 | extern void gpio_unexport(unsigned gpio); | 146 | extern void gpio_unexport(unsigned gpio); |
145 | 147 | ||
146 | #endif /* CONFIG_GPIO_SYSFS */ | 148 | #endif /* CONFIG_GPIO_SYSFS */ |
@@ -185,6 +187,12 @@ static inline int gpio_export(unsigned gpio, bool direction_may_change) | |||
185 | return -ENOSYS; | 187 | return -ENOSYS; |
186 | } | 188 | } |
187 | 189 | ||
190 | static inline int gpio_export_link(struct device *dev, const char *name, | ||
191 | unsigned gpio) | ||
192 | { | ||
193 | return -ENOSYS; | ||
194 | } | ||
195 | |||
188 | static inline void gpio_unexport(unsigned gpio) | 196 | static inline void gpio_unexport(unsigned gpio) |
189 | { | 197 | { |
190 | } | 198 | } |
diff --git a/include/asm-generic/kmap_types.h b/include/asm-generic/kmap_types.h index eddbce0f9fb9..e5f234a08540 100644 --- a/include/asm-generic/kmap_types.h +++ b/include/asm-generic/kmap_types.h | |||
@@ -2,34 +2,35 @@ | |||
2 | #define _ASM_GENERIC_KMAP_TYPES_H | 2 | #define _ASM_GENERIC_KMAP_TYPES_H |
3 | 3 | ||
4 | #ifdef __WITH_KM_FENCE | 4 | #ifdef __WITH_KM_FENCE |
5 | # define D(n) __KM_FENCE_##n , | 5 | # define KMAP_D(n) __KM_FENCE_##n , |
6 | #else | 6 | #else |
7 | # define D(n) | 7 | # define KMAP_D(n) |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | enum km_type { | 10 | enum km_type { |
11 | D(0) KM_BOUNCE_READ, | 11 | KMAP_D(0) KM_BOUNCE_READ, |
12 | D(1) KM_SKB_SUNRPC_DATA, | 12 | KMAP_D(1) KM_SKB_SUNRPC_DATA, |
13 | D(2) KM_SKB_DATA_SOFTIRQ, | 13 | KMAP_D(2) KM_SKB_DATA_SOFTIRQ, |
14 | D(3) KM_USER0, | 14 | KMAP_D(3) KM_USER0, |
15 | D(4) KM_USER1, | 15 | KMAP_D(4) KM_USER1, |
16 | D(5) KM_BIO_SRC_IRQ, | 16 | KMAP_D(5) KM_BIO_SRC_IRQ, |
17 | D(6) KM_BIO_DST_IRQ, | 17 | KMAP_D(6) KM_BIO_DST_IRQ, |
18 | D(7) KM_PTE0, | 18 | KMAP_D(7) KM_PTE0, |
19 | D(8) KM_PTE1, | 19 | KMAP_D(8) KM_PTE1, |
20 | D(9) KM_IRQ0, | 20 | KMAP_D(9) KM_IRQ0, |
21 | D(10) KM_IRQ1, | 21 | KMAP_D(10) KM_IRQ1, |
22 | D(11) KM_SOFTIRQ0, | 22 | KMAP_D(11) KM_SOFTIRQ0, |
23 | D(12) KM_SOFTIRQ1, | 23 | KMAP_D(12) KM_SOFTIRQ1, |
24 | D(13) KM_SYNC_ICACHE, | 24 | KMAP_D(13) KM_SYNC_ICACHE, |
25 | D(14) KM_SYNC_DCACHE, | 25 | KMAP_D(14) KM_SYNC_DCACHE, |
26 | D(15) KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */ | 26 | /* UML specific, for copy_*_user - used in do_op_one_page */ |
27 | D(16) KM_IRQ_PTE, | 27 | KMAP_D(15) KM_UML_USERCOPY, |
28 | D(17) KM_NMI, | 28 | KMAP_D(16) KM_IRQ_PTE, |
29 | D(18) KM_NMI_PTE, | 29 | KMAP_D(17) KM_NMI, |
30 | D(19) KM_TYPE_NR | 30 | KMAP_D(18) KM_NMI_PTE, |
31 | KMAP_D(19) KM_TYPE_NR | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | #undef D | 34 | #undef KMAP_D |
34 | 35 | ||
35 | #endif | 36 | #endif |
diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h index 3b69ad34189a..5ee13b2fd223 100644 --- a/include/asm-generic/mman-common.h +++ b/include/asm-generic/mman-common.h | |||
@@ -34,6 +34,10 @@ | |||
34 | #define MADV_REMOVE 9 /* remove these pages & resources */ | 34 | #define MADV_REMOVE 9 /* remove these pages & resources */ |
35 | #define MADV_DONTFORK 10 /* don't inherit across fork */ | 35 | #define MADV_DONTFORK 10 /* don't inherit across fork */ |
36 | #define MADV_DOFORK 11 /* do inherit across fork */ | 36 | #define MADV_DOFORK 11 /* do inherit across fork */ |
37 | #define MADV_HWPOISON 100 /* poison a page for testing */ | ||
38 | |||
39 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ | ||
40 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ | ||
37 | 41 | ||
38 | /* compatibility flags */ | 42 | /* compatibility flags */ |
39 | #define MAP_FILE 0 | 43 | #define MAP_FILE 0 |
diff --git a/include/asm-generic/mman.h b/include/asm-generic/mman.h index 7cab4de2bca6..32c8bd6a196d 100644 --- a/include/asm-generic/mman.h +++ b/include/asm-generic/mman.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | 11 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ |
12 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ | 12 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ |
13 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ | 13 | #define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ |
14 | #define MAP_HUGETLB 0x40000 /* create a huge page mapping */ | ||
14 | 15 | ||
15 | #define MCL_CURRENT 1 /* lock all current mappings */ | 16 | #define MCL_CURRENT 1 /* lock all current mappings */ |
16 | #define MCL_FUTURE 2 /* lock all future mappings */ | 17 | #define MCL_FUTURE 2 /* lock all future mappings */ |
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index d083561337f2..b3bfabc258f3 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h | |||
@@ -23,4 +23,20 @@ extern char __ctors_start[], __ctors_end[]; | |||
23 | #define dereference_function_descriptor(p) (p) | 23 | #define dereference_function_descriptor(p) (p) |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | /* random extra sections (if any). Override | ||
27 | * in asm/sections.h */ | ||
28 | #ifndef arch_is_kernel_text | ||
29 | static inline int arch_is_kernel_text(unsigned long addr) | ||
30 | { | ||
31 | return 0; | ||
32 | } | ||
33 | #endif | ||
34 | |||
35 | #ifndef arch_is_kernel_data | ||
36 | static inline int arch_is_kernel_data(unsigned long addr) | ||
37 | { | ||
38 | return 0; | ||
39 | } | ||
40 | #endif | ||
41 | |||
26 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ | 42 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ |
diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h index c840719a8c59..942d30b5aab1 100644 --- a/include/asm-generic/siginfo.h +++ b/include/asm-generic/siginfo.h | |||
@@ -82,6 +82,7 @@ typedef struct siginfo { | |||
82 | #ifdef __ARCH_SI_TRAPNO | 82 | #ifdef __ARCH_SI_TRAPNO |
83 | int _trapno; /* TRAP # which caused the signal */ | 83 | int _trapno; /* TRAP # which caused the signal */ |
84 | #endif | 84 | #endif |
85 | short _addr_lsb; /* LSB of the reported address */ | ||
85 | } _sigfault; | 86 | } _sigfault; |
86 | 87 | ||
87 | /* SIGPOLL */ | 88 | /* SIGPOLL */ |
@@ -112,6 +113,7 @@ typedef struct siginfo { | |||
112 | #ifdef __ARCH_SI_TRAPNO | 113 | #ifdef __ARCH_SI_TRAPNO |
113 | #define si_trapno _sifields._sigfault._trapno | 114 | #define si_trapno _sifields._sigfault._trapno |
114 | #endif | 115 | #endif |
116 | #define si_addr_lsb _sifields._sigfault._addr_lsb | ||
115 | #define si_band _sifields._sigpoll._band | 117 | #define si_band _sifields._sigpoll._band |
116 | #define si_fd _sifields._sigpoll._fd | 118 | #define si_fd _sifields._sigpoll._fd |
117 | 119 | ||
@@ -192,7 +194,11 @@ typedef struct siginfo { | |||
192 | #define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */ | 194 | #define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */ |
193 | #define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */ | 195 | #define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */ |
194 | #define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */ | 196 | #define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */ |
195 | #define NSIGBUS 3 | 197 | /* hardware memory error consumed on a machine check: action required */ |
198 | #define BUS_MCEERR_AR (__SI_FAULT|4) | ||
199 | /* hardware memory error detected in process but not consumed: action optional*/ | ||
200 | #define BUS_MCEERR_AO (__SI_FAULT|5) | ||
201 | #define NSIGBUS 5 | ||
196 | 202 | ||
197 | /* | 203 | /* |
198 | * SIGTRAP si_codes | 204 | * SIGTRAP si_codes |
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h index ea8087b55ffc..5c122ae6bfa6 100644 --- a/include/asm-generic/syscall.h +++ b/include/asm-generic/syscall.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Access to user system call parameters and results | 2 | * Access to user system call parameters and results |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | 4 | * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. |
5 | * | 5 | * |
6 | * This copyrighted material is made available to anyone wishing to use, | 6 | * This copyrighted material is made available to anyone wishing to use, |
7 | * modify, copy, or redistribute it subject to the terms and conditions | 7 | * modify, copy, or redistribute it subject to the terms and conditions |
@@ -32,9 +32,13 @@ struct pt_regs; | |||
32 | * If @task is not executing a system call, i.e. it's blocked | 32 | * If @task is not executing a system call, i.e. it's blocked |
33 | * inside the kernel for a fault or signal, returns -1. | 33 | * inside the kernel for a fault or signal, returns -1. |
34 | * | 34 | * |
35 | * Note this returns int even on 64-bit machines. Only 32 bits of | ||
36 | * system call number can be meaningful. If the actual arch value | ||
37 | * is 64 bits, this truncates to 32 bits so 0xffffffff means -1. | ||
38 | * | ||
35 | * It's only valid to call this when @task is known to be blocked. | 39 | * It's only valid to call this when @task is known to be blocked. |
36 | */ | 40 | */ |
37 | long syscall_get_nr(struct task_struct *task, struct pt_regs *regs); | 41 | int syscall_get_nr(struct task_struct *task, struct pt_regs *regs); |
38 | 42 | ||
39 | /** | 43 | /** |
40 | * syscall_rollback - roll back registers after an aborted system call | 44 | * syscall_rollback - roll back registers after an aborted system call |
diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index 88bada2ebc4b..510df36dd5d4 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h | |||
@@ -37,9 +37,6 @@ | |||
37 | #ifndef parent_node | 37 | #ifndef parent_node |
38 | #define parent_node(node) ((void)(node),0) | 38 | #define parent_node(node) ((void)(node),0) |
39 | #endif | 39 | #endif |
40 | #ifndef node_to_cpumask | ||
41 | #define node_to_cpumask(node) ((void)node, cpu_online_map) | ||
42 | #endif | ||
43 | #ifndef cpumask_of_node | 40 | #ifndef cpumask_of_node |
44 | #define cpumask_of_node(node) ((void)node, cpu_online_mask) | 41 | #define cpumask_of_node(node) ((void)node, cpu_online_mask) |
45 | #endif | 42 | #endif |
@@ -55,18 +52,4 @@ | |||
55 | 52 | ||
56 | #endif /* CONFIG_NUMA */ | 53 | #endif /* CONFIG_NUMA */ |
57 | 54 | ||
58 | /* | ||
59 | * returns pointer to cpumask for specified node | ||
60 | * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)" | ||
61 | */ | ||
62 | #ifndef node_to_cpumask_ptr | ||
63 | |||
64 | #define node_to_cpumask_ptr(v, node) \ | ||
65 | cpumask_t _##v = node_to_cpumask(node); \ | ||
66 | const cpumask_t *v = &_##v | ||
67 | |||
68 | #define node_to_cpumask_ptr_next(v, node) \ | ||
69 | _##v = node_to_cpumask(node) | ||
70 | #endif | ||
71 | |||
72 | #endif /* _ASM_GENERIC_TOPOLOGY_H */ | 55 | #endif /* _ASM_GENERIC_TOPOLOGY_H */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 29ca8f53ffbe..b6e818f4b247 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -721,12 +721,12 @@ | |||
721 | . = ALIGN(PAGE_SIZE); \ | 721 | . = ALIGN(PAGE_SIZE); \ |
722 | .data : AT(ADDR(.data) - LOAD_OFFSET) { \ | 722 | .data : AT(ADDR(.data) - LOAD_OFFSET) { \ |
723 | INIT_TASK_DATA(inittask) \ | 723 | INIT_TASK_DATA(inittask) \ |
724 | NOSAVE_DATA \ | ||
725 | PAGE_ALIGNED_DATA(pagealigned) \ | ||
724 | CACHELINE_ALIGNED_DATA(cacheline) \ | 726 | CACHELINE_ALIGNED_DATA(cacheline) \ |
725 | READ_MOSTLY_DATA(cacheline) \ | 727 | READ_MOSTLY_DATA(cacheline) \ |
726 | DATA_DATA \ | 728 | DATA_DATA \ |
727 | CONSTRUCTORS \ | 729 | CONSTRUCTORS \ |
728 | NOSAVE_DATA \ | ||
729 | PAGE_ALIGNED_DATA(pagealigned) \ | ||
730 | } | 730 | } |
731 | 731 | ||
732 | #define INIT_TEXT_SECTION(inittext_align) \ | 732 | #define INIT_TEXT_SECTION(inittext_align) \ |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 853508499d20..3f6e545609be 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -552,6 +552,7 @@ | |||
552 | {0x8086, 0x2e12, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 552 | {0x8086, 0x2e12, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
553 | {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 553 | {0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
554 | {0x8086, 0x2e32, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 554 | {0x8086, 0x2e32, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
555 | {0x8086, 0x2e42, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | ||
555 | {0x8086, 0xa001, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 556 | {0x8086, 0xa001, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
556 | {0x8086, 0xa011, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 557 | {0x8086, 0xa011, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
557 | {0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ | 558 | {0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \ |
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 8e1e92583fbc..7e0cb1da92e6 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -185,6 +185,7 @@ typedef struct _drm_i915_sarea { | |||
185 | #define DRM_I915_GEM_GET_APERTURE 0x23 | 185 | #define DRM_I915_GEM_GET_APERTURE 0x23 |
186 | #define DRM_I915_GEM_MMAP_GTT 0x24 | 186 | #define DRM_I915_GEM_MMAP_GTT 0x24 |
187 | #define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 | 187 | #define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 |
188 | #define DRM_I915_GEM_MADVISE 0x26 | ||
188 | 189 | ||
189 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | 190 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
190 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | 191 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
@@ -221,6 +222,7 @@ typedef struct _drm_i915_sarea { | |||
221 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) | 222 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) |
222 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) | 223 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) |
223 | #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_intel_get_pipe_from_crtc_id) | 224 | #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_intel_get_pipe_from_crtc_id) |
225 | #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) | ||
224 | 226 | ||
225 | /* Allow drivers to submit batchbuffers directly to hardware, relying | 227 | /* Allow drivers to submit batchbuffers directly to hardware, relying |
226 | * on the security mechanisms provided by hardware. | 228 | * on the security mechanisms provided by hardware. |
@@ -667,4 +669,21 @@ struct drm_i915_get_pipe_from_crtc_id { | |||
667 | __u32 pipe; | 669 | __u32 pipe; |
668 | }; | 670 | }; |
669 | 671 | ||
672 | #define I915_MADV_WILLNEED 0 | ||
673 | #define I915_MADV_DONTNEED 1 | ||
674 | #define __I915_MADV_PURGED 2 /* internal state */ | ||
675 | |||
676 | struct drm_i915_gem_madvise { | ||
677 | /** Handle of the buffer to change the backing store advice */ | ||
678 | __u32 handle; | ||
679 | |||
680 | /* Advice: either the buffer will be needed again in the near future, | ||
681 | * or wont be and could be discarded under memory pressure. | ||
682 | */ | ||
683 | __u32 madv; | ||
684 | |||
685 | /** Whether the backing store still exists. */ | ||
686 | __u32 retained; | ||
687 | }; | ||
688 | |||
670 | #endif /* _I915_DRM_H_ */ | 689 | #endif /* _I915_DRM_H_ */ |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 34321cfffeab..dfcd920c3e54 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -41,8 +41,6 @@ | |||
41 | #include <acpi/acpi_drivers.h> | 41 | #include <acpi/acpi_drivers.h> |
42 | #include <acpi/acpi_numa.h> | 42 | #include <acpi/acpi_numa.h> |
43 | #include <asm/acpi.h> | 43 | #include <asm/acpi.h> |
44 | #include <linux/dmi.h> | ||
45 | |||
46 | 44 | ||
47 | enum acpi_irq_model_id { | 45 | enum acpi_irq_model_id { |
48 | ACPI_IRQ_MODEL_PIC = 0, | 46 | ACPI_IRQ_MODEL_PIC = 0, |
@@ -219,10 +217,8 @@ static inline int acpi_video_display_switch_support(void) | |||
219 | #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */ | 217 | #endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */ |
220 | 218 | ||
221 | extern int acpi_blacklisted(void); | 219 | extern int acpi_blacklisted(void); |
222 | #ifdef CONFIG_DMI | ||
223 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); | 220 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); |
224 | extern int acpi_osi_setup(char *str); | 221 | extern int acpi_osi_setup(char *str); |
225 | #endif | ||
226 | 222 | ||
227 | #ifdef CONFIG_ACPI_NUMA | 223 | #ifdef CONFIG_ACPI_NUMA |
228 | int acpi_get_pxm(acpi_handle handle); | 224 | int acpi_get_pxm(acpi_handle handle); |
@@ -292,7 +288,10 @@ void __init acpi_s4_no_nvs(void); | |||
292 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); | 288 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); |
293 | extern void acpi_early_init(void); | 289 | extern void acpi_early_init(void); |
294 | 290 | ||
295 | #else /* CONFIG_ACPI */ | 291 | #else /* !CONFIG_ACPI */ |
292 | |||
293 | #define acpi_disabled 1 | ||
294 | |||
296 | static inline void acpi_early_init(void) { } | 295 | static inline void acpi_early_init(void) { } |
297 | 296 | ||
298 | static inline int early_acpi_boot_init(void) | 297 | static inline int early_acpi_boot_init(void) |
@@ -331,5 +330,11 @@ static inline int acpi_check_mem_region(resource_size_t start, | |||
331 | return 0; | 330 | return 0; |
332 | } | 331 | } |
333 | 332 | ||
333 | struct acpi_table_header; | ||
334 | static inline int acpi_table_parse(char *id, | ||
335 | int (*handler)(struct acpi_table_header *)) | ||
336 | { | ||
337 | return -1; | ||
338 | } | ||
334 | #endif /* !CONFIG_ACPI */ | 339 | #endif /* !CONFIG_ACPI */ |
335 | #endif /*_LINUX_ACPI_H*/ | 340 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h new file mode 100644 index 000000000000..6b4241748dda --- /dev/null +++ b/include/linux/amba/mmci.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * include/linux/amba/mmci.h | ||
3 | */ | ||
4 | #ifndef AMBA_MMCI_H | ||
5 | #define AMBA_MMCI_H | ||
6 | |||
7 | #include <linux/mmc/host.h> | ||
8 | |||
9 | struct mmci_platform_data { | ||
10 | unsigned int ocr_mask; /* available voltages */ | ||
11 | u32 (*translate_vdd)(struct device *, unsigned int); | ||
12 | unsigned int (*status)(struct device *); | ||
13 | int gpio_wp; | ||
14 | int gpio_cd; | ||
15 | unsigned long capabilities; | ||
16 | }; | ||
17 | |||
18 | #endif | ||
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h index dcad0ffd1755..e4836c6b3dd7 100644 --- a/include/linux/amba/pl022.h +++ b/include/linux/amba/pl022.h | |||
@@ -136,12 +136,12 @@ enum ssp_tx_level_trig { | |||
136 | 136 | ||
137 | /** | 137 | /** |
138 | * enum SPI Clock Phase - clock phase (Motorola SPI interface only) | 138 | * enum SPI Clock Phase - clock phase (Motorola SPI interface only) |
139 | * @SSP_CLK_RISING_EDGE: Receive data on rising edge | 139 | * @SSP_CLK_FIRST_EDGE: Receive data on first edge transition (actual direction depends on polarity) |
140 | * @SSP_CLK_FALLING_EDGE: Receive data on falling edge | 140 | * @SSP_CLK_SECOND_EDGE: Receive data on second edge transition (actual direction depends on polarity) |
141 | */ | 141 | */ |
142 | enum ssp_spi_clk_phase { | 142 | enum ssp_spi_clk_phase { |
143 | SSP_CLK_RISING_EDGE, | 143 | SSP_CLK_FIRST_EDGE, |
144 | SSP_CLK_FALLING_EDGE | 144 | SSP_CLK_SECOND_EDGE |
145 | }; | 145 | }; |
146 | 146 | ||
147 | /** | 147 | /** |
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index e0a0cdc2da43..69a21e0ebd33 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h | |||
@@ -8,6 +8,9 @@ | |||
8 | #ifndef _LINUX_ANON_INODES_H | 8 | #ifndef _LINUX_ANON_INODES_H |
9 | #define _LINUX_ANON_INODES_H | 9 | #define _LINUX_ANON_INODES_H |
10 | 10 | ||
11 | struct file *anon_inode_getfile(const char *name, | ||
12 | const struct file_operations *fops, | ||
13 | void *priv, int flags); | ||
11 | int anon_inode_getfd(const char *name, const struct file_operations *fops, | 14 | int anon_inode_getfd(const char *name, const struct file_operations *fops, |
12 | void *priv, int flags); | 15 | void *priv, int flags); |
13 | 16 | ||
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h index 5fc2ef8d97fa..a1c486a88e88 100644 --- a/include/linux/async_tx.h +++ b/include/linux/async_tx.h | |||
@@ -58,25 +58,60 @@ struct dma_chan_ref { | |||
58 | * array. | 58 | * array. |
59 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a | 59 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a |
60 | * dependency chain | 60 | * dependency chain |
61 | * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. | 61 | * @ASYNC_TX_FENCE: specify that the next operation in the dependency |
62 | * chain uses this operation's result as an input | ||
62 | */ | 63 | */ |
63 | enum async_tx_flags { | 64 | enum async_tx_flags { |
64 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), | 65 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), |
65 | ASYNC_TX_XOR_DROP_DST = (1 << 1), | 66 | ASYNC_TX_XOR_DROP_DST = (1 << 1), |
66 | ASYNC_TX_ACK = (1 << 3), | 67 | ASYNC_TX_ACK = (1 << 2), |
67 | ASYNC_TX_DEP_ACK = (1 << 4), | 68 | ASYNC_TX_FENCE = (1 << 3), |
69 | }; | ||
70 | |||
71 | /** | ||
72 | * struct async_submit_ctl - async_tx submission/completion modifiers | ||
73 | * @flags: submission modifiers | ||
74 | * @depend_tx: parent dependency of the current operation being submitted | ||
75 | * @cb_fn: callback routine to run at operation completion | ||
76 | * @cb_param: parameter for the callback routine | ||
77 | * @scribble: caller provided space for dma/page address conversions | ||
78 | */ | ||
79 | struct async_submit_ctl { | ||
80 | enum async_tx_flags flags; | ||
81 | struct dma_async_tx_descriptor *depend_tx; | ||
82 | dma_async_tx_callback cb_fn; | ||
83 | void *cb_param; | ||
84 | void *scribble; | ||
68 | }; | 85 | }; |
69 | 86 | ||
70 | #ifdef CONFIG_DMA_ENGINE | 87 | #ifdef CONFIG_DMA_ENGINE |
71 | #define async_tx_issue_pending_all dma_issue_pending_all | 88 | #define async_tx_issue_pending_all dma_issue_pending_all |
89 | |||
90 | /** | ||
91 | * async_tx_issue_pending - send pending descriptor to the hardware channel | ||
92 | * @tx: descriptor handle to retrieve hardware context | ||
93 | * | ||
94 | * Note: any dependent operations will have already been issued by | ||
95 | * async_tx_channel_switch, or (in the case of no channel switch) will | ||
96 | * be already pending on this channel. | ||
97 | */ | ||
98 | static inline void async_tx_issue_pending(struct dma_async_tx_descriptor *tx) | ||
99 | { | ||
100 | if (likely(tx)) { | ||
101 | struct dma_chan *chan = tx->chan; | ||
102 | struct dma_device *dma = chan->device; | ||
103 | |||
104 | dma->device_issue_pending(chan); | ||
105 | } | ||
106 | } | ||
72 | #ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL | 107 | #ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL |
73 | #include <asm/async_tx.h> | 108 | #include <asm/async_tx.h> |
74 | #else | 109 | #else |
75 | #define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \ | 110 | #define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \ |
76 | __async_tx_find_channel(dep, type) | 111 | __async_tx_find_channel(dep, type) |
77 | struct dma_chan * | 112 | struct dma_chan * |
78 | __async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | 113 | __async_tx_find_channel(struct async_submit_ctl *submit, |
79 | enum dma_transaction_type tx_type); | 114 | enum dma_transaction_type tx_type); |
80 | #endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */ | 115 | #endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */ |
81 | #else | 116 | #else |
82 | static inline void async_tx_issue_pending_all(void) | 117 | static inline void async_tx_issue_pending_all(void) |
@@ -84,10 +119,16 @@ static inline void async_tx_issue_pending_all(void) | |||
84 | do { } while (0); | 119 | do { } while (0); |
85 | } | 120 | } |
86 | 121 | ||
122 | static inline void async_tx_issue_pending(struct dma_async_tx_descriptor *tx) | ||
123 | { | ||
124 | do { } while (0); | ||
125 | } | ||
126 | |||
87 | static inline struct dma_chan * | 127 | static inline struct dma_chan * |
88 | async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | 128 | async_tx_find_channel(struct async_submit_ctl *submit, |
89 | enum dma_transaction_type tx_type, struct page **dst, int dst_count, | 129 | enum dma_transaction_type tx_type, struct page **dst, |
90 | struct page **src, int src_count, size_t len) | 130 | int dst_count, struct page **src, int src_count, |
131 | size_t len) | ||
91 | { | 132 | { |
92 | return NULL; | 133 | return NULL; |
93 | } | 134 | } |
@@ -99,46 +140,70 @@ async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, | |||
99 | * @cb_fn_param: parameter to pass to the callback routine | 140 | * @cb_fn_param: parameter to pass to the callback routine |
100 | */ | 141 | */ |
101 | static inline void | 142 | static inline void |
102 | async_tx_sync_epilog(dma_async_tx_callback cb_fn, void *cb_fn_param) | 143 | async_tx_sync_epilog(struct async_submit_ctl *submit) |
103 | { | 144 | { |
104 | if (cb_fn) | 145 | if (submit->cb_fn) |
105 | cb_fn(cb_fn_param); | 146 | submit->cb_fn(submit->cb_param); |
106 | } | 147 | } |
107 | 148 | ||
108 | void | 149 | typedef union { |
109 | async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx, | 150 | unsigned long addr; |
110 | enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx, | 151 | struct page *page; |
111 | dma_async_tx_callback cb_fn, void *cb_fn_param); | 152 | dma_addr_t dma; |
153 | } addr_conv_t; | ||
154 | |||
155 | static inline void | ||
156 | init_async_submit(struct async_submit_ctl *args, enum async_tx_flags flags, | ||
157 | struct dma_async_tx_descriptor *tx, | ||
158 | dma_async_tx_callback cb_fn, void *cb_param, | ||
159 | addr_conv_t *scribble) | ||
160 | { | ||
161 | args->flags = flags; | ||
162 | args->depend_tx = tx; | ||
163 | args->cb_fn = cb_fn; | ||
164 | args->cb_param = cb_param; | ||
165 | args->scribble = scribble; | ||
166 | } | ||
167 | |||
168 | void async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx, | ||
169 | struct async_submit_ctl *submit); | ||
112 | 170 | ||
113 | struct dma_async_tx_descriptor * | 171 | struct dma_async_tx_descriptor * |
114 | async_xor(struct page *dest, struct page **src_list, unsigned int offset, | 172 | async_xor(struct page *dest, struct page **src_list, unsigned int offset, |
115 | int src_cnt, size_t len, enum async_tx_flags flags, | 173 | int src_cnt, size_t len, struct async_submit_ctl *submit); |
116 | struct dma_async_tx_descriptor *depend_tx, | ||
117 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
118 | 174 | ||
119 | struct dma_async_tx_descriptor * | 175 | struct dma_async_tx_descriptor * |
120 | async_xor_zero_sum(struct page *dest, struct page **src_list, | 176 | async_xor_val(struct page *dest, struct page **src_list, unsigned int offset, |
121 | unsigned int offset, int src_cnt, size_t len, | 177 | int src_cnt, size_t len, enum sum_check_flags *result, |
122 | u32 *result, enum async_tx_flags flags, | 178 | struct async_submit_ctl *submit); |
123 | struct dma_async_tx_descriptor *depend_tx, | ||
124 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
125 | 179 | ||
126 | struct dma_async_tx_descriptor * | 180 | struct dma_async_tx_descriptor * |
127 | async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset, | 181 | async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset, |
128 | unsigned int src_offset, size_t len, enum async_tx_flags flags, | 182 | unsigned int src_offset, size_t len, |
129 | struct dma_async_tx_descriptor *depend_tx, | 183 | struct async_submit_ctl *submit); |
130 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
131 | 184 | ||
132 | struct dma_async_tx_descriptor * | 185 | struct dma_async_tx_descriptor * |
133 | async_memset(struct page *dest, int val, unsigned int offset, | 186 | async_memset(struct page *dest, int val, unsigned int offset, |
134 | size_t len, enum async_tx_flags flags, | 187 | size_t len, struct async_submit_ctl *submit); |
135 | struct dma_async_tx_descriptor *depend_tx, | 188 | |
136 | dma_async_tx_callback cb_fn, void *cb_fn_param); | 189 | struct dma_async_tx_descriptor *async_trigger_callback(struct async_submit_ctl *submit); |
190 | |||
191 | struct dma_async_tx_descriptor * | ||
192 | async_gen_syndrome(struct page **blocks, unsigned int offset, int src_cnt, | ||
193 | size_t len, struct async_submit_ctl *submit); | ||
194 | |||
195 | struct dma_async_tx_descriptor * | ||
196 | async_syndrome_val(struct page **blocks, unsigned int offset, int src_cnt, | ||
197 | size_t len, enum sum_check_flags *pqres, struct page *spare, | ||
198 | struct async_submit_ctl *submit); | ||
199 | |||
200 | struct dma_async_tx_descriptor * | ||
201 | async_raid6_2data_recov(int src_num, size_t bytes, int faila, int failb, | ||
202 | struct page **ptrs, struct async_submit_ctl *submit); | ||
137 | 203 | ||
138 | struct dma_async_tx_descriptor * | 204 | struct dma_async_tx_descriptor * |
139 | async_trigger_callback(enum async_tx_flags flags, | 205 | async_raid6_datap_recov(int src_num, size_t bytes, int faila, |
140 | struct dma_async_tx_descriptor *depend_tx, | 206 | struct page **ptrs, struct async_submit_ctl *submit); |
141 | dma_async_tx_callback cb_fn, void *cb_fn_param); | ||
142 | 207 | ||
143 | void async_tx_quiesce(struct dma_async_tx_descriptor **tx); | 208 | void async_tx_quiesce(struct dma_async_tx_descriptor **tx); |
144 | #endif /* _ASYNC_TX_H_ */ | 209 | #endif /* _ASYNC_TX_H_ */ |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 0ee33c2e6129..b449e738533a 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -101,7 +101,8 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, | |||
101 | const char *fmt, ...); | 101 | const char *fmt, ...); |
102 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); | 102 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); |
103 | void bdi_unregister(struct backing_dev_info *bdi); | 103 | void bdi_unregister(struct backing_dev_info *bdi); |
104 | void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages); | 104 | void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb, |
105 | long nr_pages); | ||
105 | int bdi_writeback_task(struct bdi_writeback *wb); | 106 | int bdi_writeback_task(struct bdi_writeback *wb); |
106 | int bdi_has_dirty_io(struct backing_dev_info *bdi); | 107 | int bdi_has_dirty_io(struct backing_dev_info *bdi); |
107 | 108 | ||
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 2046b5b8af48..aece486ac734 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -120,7 +120,7 @@ extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | |||
120 | extern int prepare_bprm_creds(struct linux_binprm *bprm); | 120 | extern int prepare_bprm_creds(struct linux_binprm *bprm); |
121 | extern void install_exec_creds(struct linux_binprm *bprm); | 121 | extern void install_exec_creds(struct linux_binprm *bprm); |
122 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); | 122 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); |
123 | extern int set_binfmt(struct linux_binfmt *new); | 123 | extern void set_binfmt(struct linux_binfmt *new); |
124 | extern void free_bprm(struct linux_binprm *); | 124 | extern void free_bprm(struct linux_binprm *); |
125 | 125 | ||
126 | #endif /* __KERNEL__ */ | 126 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index bc3ab7073695..dd97fb8408a8 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -132,9 +132,6 @@ static inline void *alloc_remap(int nid, unsigned long size) | |||
132 | } | 132 | } |
133 | #endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */ | 133 | #endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */ |
134 | 134 | ||
135 | extern unsigned long __meminitdata nr_kernel_pages; | ||
136 | extern unsigned long __meminitdata nr_all_pages; | ||
137 | |||
138 | extern void *alloc_large_system_hash(const char *tablename, | 135 | extern void *alloc_large_system_hash(const char *tablename, |
139 | unsigned long bucketsize, | 136 | unsigned long bucketsize, |
140 | unsigned long numentries, | 137 | unsigned long numentries, |
@@ -145,6 +142,8 @@ extern void *alloc_large_system_hash(const char *tablename, | |||
145 | unsigned long limit); | 142 | unsigned long limit); |
146 | 143 | ||
147 | #define HASH_EARLY 0x00000001 /* Allocating during early boot? */ | 144 | #define HASH_EARLY 0x00000001 /* Allocating during early boot? */ |
145 | #define HASH_SMALL 0x00000002 /* sub-page allocation allowed, min | ||
146 | * shift passed via *_hash_shift */ | ||
148 | 147 | ||
149 | /* Only NUMA needs hash distribution. 64bit NUMA architectures have | 148 | /* Only NUMA needs hash distribution. 64bit NUMA architectures have |
150 | * sufficient vmalloc space. | 149 | * sufficient vmalloc space. |
diff --git a/include/linux/capability.h b/include/linux/capability.h index c3021105edc0..c8f2a5f70ed5 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * | 7 | * |
8 | * See here for the libcap library ("POSIX draft" compliance): | 8 | * See here for the libcap library ("POSIX draft" compliance): |
9 | * | 9 | * |
10 | * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/ | 10 | * ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/ |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef _LINUX_CAPABILITY_H | 13 | #ifndef _LINUX_CAPABILITY_H |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 90bba9e62286..b62bb9294d0c 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -141,6 +141,38 @@ enum { | |||
141 | CGRP_WAIT_ON_RMDIR, | 141 | CGRP_WAIT_ON_RMDIR, |
142 | }; | 142 | }; |
143 | 143 | ||
144 | /* which pidlist file are we talking about? */ | ||
145 | enum cgroup_filetype { | ||
146 | CGROUP_FILE_PROCS, | ||
147 | CGROUP_FILE_TASKS, | ||
148 | }; | ||
149 | |||
150 | /* | ||
151 | * A pidlist is a list of pids that virtually represents the contents of one | ||
152 | * of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists, | ||
153 | * a pair (one each for procs, tasks) for each pid namespace that's relevant | ||
154 | * to the cgroup. | ||
155 | */ | ||
156 | struct cgroup_pidlist { | ||
157 | /* | ||
158 | * used to find which pidlist is wanted. doesn't change as long as | ||
159 | * this particular list stays in the list. | ||
160 | */ | ||
161 | struct { enum cgroup_filetype type; struct pid_namespace *ns; } key; | ||
162 | /* array of xids */ | ||
163 | pid_t *list; | ||
164 | /* how many elements the above list has */ | ||
165 | int length; | ||
166 | /* how many files are using the current array */ | ||
167 | int use_count; | ||
168 | /* each of these stored in a list by its cgroup */ | ||
169 | struct list_head links; | ||
170 | /* pointer to the cgroup we belong to, for list removal purposes */ | ||
171 | struct cgroup *owner; | ||
172 | /* protects the other fields */ | ||
173 | struct rw_semaphore mutex; | ||
174 | }; | ||
175 | |||
144 | struct cgroup { | 176 | struct cgroup { |
145 | unsigned long flags; /* "unsigned long" so bitops work */ | 177 | unsigned long flags; /* "unsigned long" so bitops work */ |
146 | 178 | ||
@@ -179,11 +211,12 @@ struct cgroup { | |||
179 | */ | 211 | */ |
180 | struct list_head release_list; | 212 | struct list_head release_list; |
181 | 213 | ||
182 | /* pids_mutex protects pids_list and cached pid arrays. */ | 214 | /* |
183 | struct rw_semaphore pids_mutex; | 215 | * list of pidlists, up to two for each namespace (one for procs, one |
184 | 216 | * for tasks); created on demand. | |
185 | /* Linked list of struct cgroup_pids */ | 217 | */ |
186 | struct list_head pids_list; | 218 | struct list_head pidlists; |
219 | struct mutex pidlist_mutex; | ||
187 | 220 | ||
188 | /* For RCU-protected deletion */ | 221 | /* For RCU-protected deletion */ |
189 | struct rcu_head rcu_head; | 222 | struct rcu_head rcu_head; |
@@ -227,6 +260,9 @@ struct css_set { | |||
227 | * during subsystem registration (at boot time). | 260 | * during subsystem registration (at boot time). |
228 | */ | 261 | */ |
229 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | 262 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; |
263 | |||
264 | /* For RCU-protected deletion */ | ||
265 | struct rcu_head rcu_head; | ||
230 | }; | 266 | }; |
231 | 267 | ||
232 | /* | 268 | /* |
@@ -389,10 +425,11 @@ struct cgroup_subsys { | |||
389 | struct cgroup *cgrp); | 425 | struct cgroup *cgrp); |
390 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 426 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
391 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 427 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
392 | int (*can_attach)(struct cgroup_subsys *ss, | 428 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
393 | struct cgroup *cgrp, struct task_struct *tsk); | 429 | struct task_struct *tsk, bool threadgroup); |
394 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 430 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
395 | struct cgroup *old_cgrp, struct task_struct *tsk); | 431 | struct cgroup *old_cgrp, struct task_struct *tsk, |
432 | bool threadgroup); | ||
396 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); | 433 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); |
397 | void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); | 434 | void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); |
398 | int (*populate)(struct cgroup_subsys *ss, | 435 | int (*populate)(struct cgroup_subsys *ss, |
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h index b8125b2eb665..47dac5ea8d3a 100644 --- a/include/linux/cn_proc.h +++ b/include/linux/cn_proc.h | |||
@@ -52,6 +52,7 @@ struct proc_event { | |||
52 | PROC_EVENT_EXEC = 0x00000002, | 52 | PROC_EVENT_EXEC = 0x00000002, |
53 | PROC_EVENT_UID = 0x00000004, | 53 | PROC_EVENT_UID = 0x00000004, |
54 | PROC_EVENT_GID = 0x00000040, | 54 | PROC_EVENT_GID = 0x00000040, |
55 | PROC_EVENT_SID = 0x00000080, | ||
55 | /* "next" should be 0x00000400 */ | 56 | /* "next" should be 0x00000400 */ |
56 | /* "last" is the last process event: exit */ | 57 | /* "last" is the last process event: exit */ |
57 | PROC_EVENT_EXIT = 0x80000000 | 58 | PROC_EVENT_EXIT = 0x80000000 |
@@ -89,6 +90,11 @@ struct proc_event { | |||
89 | } e; | 90 | } e; |
90 | } id; | 91 | } id; |
91 | 92 | ||
93 | struct sid_proc_event { | ||
94 | __kernel_pid_t process_pid; | ||
95 | __kernel_pid_t process_tgid; | ||
96 | } sid; | ||
97 | |||
92 | struct exit_proc_event { | 98 | struct exit_proc_event { |
93 | __kernel_pid_t process_pid; | 99 | __kernel_pid_t process_pid; |
94 | __kernel_pid_t process_tgid; | 100 | __kernel_pid_t process_tgid; |
@@ -102,6 +108,7 @@ struct proc_event { | |||
102 | void proc_fork_connector(struct task_struct *task); | 108 | void proc_fork_connector(struct task_struct *task); |
103 | void proc_exec_connector(struct task_struct *task); | 109 | void proc_exec_connector(struct task_struct *task); |
104 | void proc_id_connector(struct task_struct *task, int which_id); | 110 | void proc_id_connector(struct task_struct *task, int which_id); |
111 | void proc_sid_connector(struct task_struct *task); | ||
105 | void proc_exit_connector(struct task_struct *task); | 112 | void proc_exit_connector(struct task_struct *task); |
106 | #else | 113 | #else |
107 | static inline void proc_fork_connector(struct task_struct *task) | 114 | static inline void proc_fork_connector(struct task_struct *task) |
@@ -114,6 +121,9 @@ static inline void proc_id_connector(struct task_struct *task, | |||
114 | int which_id) | 121 | int which_id) |
115 | {} | 122 | {} |
116 | 123 | ||
124 | static inline void proc_sid_connector(struct task_struct *task) | ||
125 | {} | ||
126 | |||
117 | static inline void proc_exit_connector(struct task_struct *task) | 127 | static inline void proc_exit_connector(struct task_struct *task) |
118 | {} | 128 | {} |
119 | #endif /* CONFIG_PROC_EVENTS */ | 129 | #endif /* CONFIG_PROC_EVENTS */ |
diff --git a/include/linux/configfs.h b/include/linux/configfs.h index 7f627775c947..ddb7a97c78c2 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h | |||
@@ -27,8 +27,8 @@ | |||
27 | * | 27 | * |
28 | * configfs Copyright (C) 2005 Oracle. All rights reserved. | 28 | * configfs Copyright (C) 2005 Oracle. All rights reserved. |
29 | * | 29 | * |
30 | * Please read Documentation/filesystems/configfs.txt before using the | 30 | * Please read Documentation/filesystems/configfs/configfs.txt before using |
31 | * configfs interface, ESPECIALLY the parts about reference counts and | 31 | * the configfs interface, ESPECIALLY the parts about reference counts and |
32 | * item destructors. | 32 | * item destructors. |
33 | */ | 33 | */ |
34 | 34 | ||
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 796df12091b7..789cf5f920ce 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -3,444 +3,37 @@ | |||
3 | 3 | ||
4 | /* | 4 | /* |
5 | * Cpumasks provide a bitmap suitable for representing the | 5 | * Cpumasks provide a bitmap suitable for representing the |
6 | * set of CPU's in a system, one bit position per CPU number. | 6 | * set of CPU's in a system, one bit position per CPU number. In general, |
7 | * | 7 | * only nr_cpu_ids (<= NR_CPUS) bits are valid. |
8 | * The new cpumask_ ops take a "struct cpumask *"; the old ones | ||
9 | * use cpumask_t. | ||
10 | * | ||
11 | * See detailed comments in the file linux/bitmap.h describing the | ||
12 | * data type on which these cpumasks are based. | ||
13 | * | ||
14 | * For details of cpumask_scnprintf() and cpumask_parse_user(), | ||
15 | * see bitmap_scnprintf() and bitmap_parse_user() in lib/bitmap.c. | ||
16 | * For details of cpulist_scnprintf() and cpulist_parse(), see | ||
17 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. | ||
18 | * For details of cpu_remap(), see bitmap_bitremap in lib/bitmap.c | ||
19 | * For details of cpus_remap(), see bitmap_remap in lib/bitmap.c. | ||
20 | * For details of cpus_onto(), see bitmap_onto in lib/bitmap.c. | ||
21 | * For details of cpus_fold(), see bitmap_fold in lib/bitmap.c. | ||
22 | * | ||
23 | * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | ||
24 | * Note: The alternate operations with the suffix "_nr" are used | ||
25 | * to limit the range of the loop to nr_cpu_ids instead of | ||
26 | * NR_CPUS when NR_CPUS > 64 for performance reasons. | ||
27 | * If NR_CPUS is <= 64 then most assembler bitmask | ||
28 | * operators execute faster with a constant range, so | ||
29 | * the operator will continue to use NR_CPUS. | ||
30 | * | ||
31 | * Another consideration is that nr_cpu_ids is initialized | ||
32 | * to NR_CPUS and isn't lowered until the possible cpus are | ||
33 | * discovered (including any disabled cpus). So early uses | ||
34 | * will span the entire range of NR_CPUS. | ||
35 | * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . | ||
36 | * | ||
37 | * The obsolescent cpumask operations are: | ||
38 | * | ||
39 | * void cpu_set(cpu, mask) turn on bit 'cpu' in mask | ||
40 | * void cpu_clear(cpu, mask) turn off bit 'cpu' in mask | ||
41 | * void cpus_setall(mask) set all bits | ||
42 | * void cpus_clear(mask) clear all bits | ||
43 | * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask | ||
44 | * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask | ||
45 | * | ||
46 | * int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] | ||
47 | * void cpus_or(dst, src1, src2) dst = src1 | src2 [union] | ||
48 | * void cpus_xor(dst, src1, src2) dst = src1 ^ src2 | ||
49 | * int cpus_andnot(dst, src1, src2) dst = src1 & ~src2 | ||
50 | * void cpus_complement(dst, src) dst = ~src | ||
51 | * | ||
52 | * int cpus_equal(mask1, mask2) Does mask1 == mask2? | ||
53 | * int cpus_intersects(mask1, mask2) Do mask1 and mask2 intersect? | ||
54 | * int cpus_subset(mask1, mask2) Is mask1 a subset of mask2? | ||
55 | * int cpus_empty(mask) Is mask empty (no bits sets)? | ||
56 | * int cpus_full(mask) Is mask full (all bits sets)? | ||
57 | * int cpus_weight(mask) Hamming weigh - number of set bits | ||
58 | * int cpus_weight_nr(mask) Same using nr_cpu_ids instead of NR_CPUS | ||
59 | * | ||
60 | * void cpus_shift_right(dst, src, n) Shift right | ||
61 | * void cpus_shift_left(dst, src, n) Shift left | ||
62 | * | ||
63 | * int first_cpu(mask) Number lowest set bit, or NR_CPUS | ||
64 | * int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS | ||
65 | * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids | ||
66 | * | ||
67 | * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set | ||
68 | * (can be used as an lvalue) | ||
69 | * CPU_MASK_ALL Initializer - all bits set | ||
70 | * CPU_MASK_NONE Initializer - no bits set | ||
71 | * unsigned long *cpus_addr(mask) Array of unsigned long's in mask | ||
72 | * | ||
73 | * CPUMASK_ALLOC kmalloc's a structure that is a composite of many cpumask_t | ||
74 | * variables, and CPUMASK_PTR provides pointers to each field. | ||
75 | * | ||
76 | * The structure should be defined something like this: | ||
77 | * struct my_cpumasks { | ||
78 | * cpumask_t mask1; | ||
79 | * cpumask_t mask2; | ||
80 | * }; | ||
81 | * | ||
82 | * Usage is then: | ||
83 | * CPUMASK_ALLOC(my_cpumasks); | ||
84 | * CPUMASK_PTR(mask1, my_cpumasks); | ||
85 | * CPUMASK_PTR(mask2, my_cpumasks); | ||
86 | * | ||
87 | * --- DO NOT reference cpumask_t pointers until this check --- | ||
88 | * if (my_cpumasks == NULL) | ||
89 | * "kmalloc failed"... | ||
90 | * | ||
91 | * References are now pointers to the cpumask_t variables (*mask1, ...) | ||
92 | * | ||
93 | *if NR_CPUS > BITS_PER_LONG | ||
94 | * CPUMASK_ALLOC(m) Declares and allocates struct m *m = | ||
95 | * kmalloc(sizeof(*m), GFP_KERNEL) | ||
96 | * CPUMASK_FREE(m) Macro for kfree(m) | ||
97 | *else | ||
98 | * CPUMASK_ALLOC(m) Declares struct m _m, *m = &_m | ||
99 | * CPUMASK_FREE(m) Nop | ||
100 | *endif | ||
101 | * CPUMASK_PTR(v, m) Declares cpumask_t *v = &(m->v) | ||
102 | * ------------------------------------------------------------------------ | ||
103 | * | ||
104 | * int cpumask_scnprintf(buf, len, mask) Format cpumask for printing | ||
105 | * int cpumask_parse_user(ubuf, ulen, mask) Parse ascii string as cpumask | ||
106 | * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing | ||
107 | * int cpulist_parse(buf, map) Parse ascii string as cpulist | ||
108 | * int cpu_remap(oldbit, old, new) newbit = map(old, new)(oldbit) | ||
109 | * void cpus_remap(dst, src, old, new) *dst = map(old, new)(src) | ||
110 | * void cpus_onto(dst, orig, relmap) *dst = orig relative to relmap | ||
111 | * void cpus_fold(dst, orig, sz) dst bits = orig bits mod sz | ||
112 | * | ||
113 | * for_each_cpu_mask(cpu, mask) for-loop cpu over mask using NR_CPUS | ||
114 | * for_each_cpu_mask_nr(cpu, mask) for-loop cpu over mask using nr_cpu_ids | ||
115 | * | ||
116 | * int num_online_cpus() Number of online CPUs | ||
117 | * int num_possible_cpus() Number of all possible CPUs | ||
118 | * int num_present_cpus() Number of present CPUs | ||
119 | * | ||
120 | * int cpu_online(cpu) Is some cpu online? | ||
121 | * int cpu_possible(cpu) Is some cpu possible? | ||
122 | * int cpu_present(cpu) Is some cpu present (can schedule)? | ||
123 | * | ||
124 | * int any_online_cpu(mask) First online cpu in mask | ||
125 | * | ||
126 | * for_each_possible_cpu(cpu) for-loop cpu over cpu_possible_map | ||
127 | * for_each_online_cpu(cpu) for-loop cpu over cpu_online_map | ||
128 | * for_each_present_cpu(cpu) for-loop cpu over cpu_present_map | ||
129 | * | ||
130 | * Subtlety: | ||
131 | * 1) The 'type-checked' form of cpu_isset() causes gcc (3.3.2, anyway) | ||
132 | * to generate slightly worse code. Note for example the additional | ||
133 | * 40 lines of assembly code compiling the "for each possible cpu" | ||
134 | * loops buried in the disk_stat_read() macros calls when compiling | ||
135 | * drivers/block/genhd.c (arch i386, CONFIG_SMP=y). So use a simple | ||
136 | * one-line #define for cpu_isset(), instead of wrapping an inline | ||
137 | * inside a macro, the way we do the other calls. | ||
138 | */ | 8 | */ |
139 | |||
140 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
141 | #include <linux/threads.h> | 10 | #include <linux/threads.h> |
142 | #include <linux/bitmap.h> | 11 | #include <linux/bitmap.h> |
143 | 12 | ||
144 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; | 13 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; |
145 | extern cpumask_t _unused_cpumask_arg_; | ||
146 | |||
147 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
148 | #define cpu_set(cpu, dst) __cpu_set((cpu), &(dst)) | ||
149 | static inline void __cpu_set(int cpu, volatile cpumask_t *dstp) | ||
150 | { | ||
151 | set_bit(cpu, dstp->bits); | ||
152 | } | ||
153 | |||
154 | #define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst)) | ||
155 | static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp) | ||
156 | { | ||
157 | clear_bit(cpu, dstp->bits); | ||
158 | } | ||
159 | |||
160 | #define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS) | ||
161 | static inline void __cpus_setall(cpumask_t *dstp, int nbits) | ||
162 | { | ||
163 | bitmap_fill(dstp->bits, nbits); | ||
164 | } | ||
165 | |||
166 | #define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS) | ||
167 | static inline void __cpus_clear(cpumask_t *dstp, int nbits) | ||
168 | { | ||
169 | bitmap_zero(dstp->bits, nbits); | ||
170 | } | ||
171 | |||
172 | /* No static inline type checking - see Subtlety (1) above. */ | ||
173 | #define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits) | ||
174 | |||
175 | #define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask)) | ||
176 | static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) | ||
177 | { | ||
178 | return test_and_set_bit(cpu, addr->bits); | ||
179 | } | ||
180 | |||
181 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) | ||
182 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | ||
183 | const cpumask_t *src2p, int nbits) | ||
184 | { | ||
185 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
186 | } | ||
187 | |||
188 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) | ||
189 | static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p, | ||
190 | const cpumask_t *src2p, int nbits) | ||
191 | { | ||
192 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
193 | } | ||
194 | |||
195 | #define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS) | ||
196 | static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | ||
197 | const cpumask_t *src2p, int nbits) | ||
198 | { | ||
199 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
200 | } | ||
201 | |||
202 | #define cpus_andnot(dst, src1, src2) \ | ||
203 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) | ||
204 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | ||
205 | const cpumask_t *src2p, int nbits) | ||
206 | { | ||
207 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
208 | } | ||
209 | |||
210 | #define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS) | ||
211 | static inline void __cpus_complement(cpumask_t *dstp, | ||
212 | const cpumask_t *srcp, int nbits) | ||
213 | { | ||
214 | bitmap_complement(dstp->bits, srcp->bits, nbits); | ||
215 | } | ||
216 | |||
217 | #define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS) | ||
218 | static inline int __cpus_equal(const cpumask_t *src1p, | ||
219 | const cpumask_t *src2p, int nbits) | ||
220 | { | ||
221 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | ||
222 | } | ||
223 | |||
224 | #define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS) | ||
225 | static inline int __cpus_intersects(const cpumask_t *src1p, | ||
226 | const cpumask_t *src2p, int nbits) | ||
227 | { | ||
228 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | ||
229 | } | ||
230 | |||
231 | #define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS) | ||
232 | static inline int __cpus_subset(const cpumask_t *src1p, | ||
233 | const cpumask_t *src2p, int nbits) | ||
234 | { | ||
235 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | ||
236 | } | ||
237 | |||
238 | #define cpus_empty(src) __cpus_empty(&(src), NR_CPUS) | ||
239 | static inline int __cpus_empty(const cpumask_t *srcp, int nbits) | ||
240 | { | ||
241 | return bitmap_empty(srcp->bits, nbits); | ||
242 | } | ||
243 | |||
244 | #define cpus_full(cpumask) __cpus_full(&(cpumask), NR_CPUS) | ||
245 | static inline int __cpus_full(const cpumask_t *srcp, int nbits) | ||
246 | { | ||
247 | return bitmap_full(srcp->bits, nbits); | ||
248 | } | ||
249 | |||
250 | #define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS) | ||
251 | static inline int __cpus_weight(const cpumask_t *srcp, int nbits) | ||
252 | { | ||
253 | return bitmap_weight(srcp->bits, nbits); | ||
254 | } | ||
255 | |||
256 | #define cpus_shift_right(dst, src, n) \ | ||
257 | __cpus_shift_right(&(dst), &(src), (n), NR_CPUS) | ||
258 | static inline void __cpus_shift_right(cpumask_t *dstp, | ||
259 | const cpumask_t *srcp, int n, int nbits) | ||
260 | { | ||
261 | bitmap_shift_right(dstp->bits, srcp->bits, n, nbits); | ||
262 | } | ||
263 | |||
264 | #define cpus_shift_left(dst, src, n) \ | ||
265 | __cpus_shift_left(&(dst), &(src), (n), NR_CPUS) | ||
266 | static inline void __cpus_shift_left(cpumask_t *dstp, | ||
267 | const cpumask_t *srcp, int n, int nbits) | ||
268 | { | ||
269 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | ||
270 | } | ||
271 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
272 | 14 | ||
273 | /** | 15 | /** |
274 | * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * | 16 | * cpumask_bits - get the bits in a cpumask |
275 | * @bitmap: the bitmap | 17 | * @maskp: the struct cpumask * |
276 | * | ||
277 | * There are a few places where cpumask_var_t isn't appropriate and | ||
278 | * static cpumasks must be used (eg. very early boot), yet we don't | ||
279 | * expose the definition of 'struct cpumask'. | ||
280 | * | 18 | * |
281 | * This does the conversion, and can be used as a constant initializer. | 19 | * You should only assume nr_cpu_ids bits of this mask are valid. This is |
20 | * a macro so it's const-correct. | ||
282 | */ | 21 | */ |
283 | #define to_cpumask(bitmap) \ | 22 | #define cpumask_bits(maskp) ((maskp)->bits) |
284 | ((struct cpumask *)(1 ? (bitmap) \ | ||
285 | : (void *)sizeof(__check_is_bitmap(bitmap)))) | ||
286 | |||
287 | static inline int __check_is_bitmap(const unsigned long *bitmap) | ||
288 | { | ||
289 | return 1; | ||
290 | } | ||
291 | |||
292 | /* | ||
293 | * Special-case data structure for "single bit set only" constant CPU masks. | ||
294 | * | ||
295 | * We pre-generate all the 64 (or 32) possible bit positions, with enough | ||
296 | * padding to the left and the right, and return the constant pointer | ||
297 | * appropriately offset. | ||
298 | */ | ||
299 | extern const unsigned long | ||
300 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; | ||
301 | |||
302 | static inline const struct cpumask *get_cpu_mask(unsigned int cpu) | ||
303 | { | ||
304 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; | ||
305 | p -= cpu / BITS_PER_LONG; | ||
306 | return to_cpumask(p); | ||
307 | } | ||
308 | |||
309 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
310 | /* | ||
311 | * In cases where we take the address of the cpumask immediately, | ||
312 | * gcc optimizes it out (it's a constant) and there's no huge stack | ||
313 | * variable created: | ||
314 | */ | ||
315 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) | ||
316 | |||
317 | |||
318 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | ||
319 | |||
320 | #if NR_CPUS <= BITS_PER_LONG | ||
321 | |||
322 | #define CPU_MASK_ALL \ | ||
323 | (cpumask_t) { { \ | ||
324 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
325 | } } | ||
326 | |||
327 | #define CPU_MASK_ALL_PTR (&CPU_MASK_ALL) | ||
328 | |||
329 | #else | ||
330 | |||
331 | #define CPU_MASK_ALL \ | ||
332 | (cpumask_t) { { \ | ||
333 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
334 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
335 | } } | ||
336 | |||
337 | /* cpu_mask_all is in init/main.c */ | ||
338 | extern cpumask_t cpu_mask_all; | ||
339 | #define CPU_MASK_ALL_PTR (&cpu_mask_all) | ||
340 | |||
341 | #endif | ||
342 | |||
343 | #define CPU_MASK_NONE \ | ||
344 | (cpumask_t) { { \ | ||
345 | [0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \ | ||
346 | } } | ||
347 | |||
348 | #define CPU_MASK_CPU0 \ | ||
349 | (cpumask_t) { { \ | ||
350 | [0] = 1UL \ | ||
351 | } } | ||
352 | |||
353 | #define cpus_addr(src) ((src).bits) | ||
354 | |||
355 | #if NR_CPUS > BITS_PER_LONG | ||
356 | #define CPUMASK_ALLOC(m) struct m *m = kmalloc(sizeof(*m), GFP_KERNEL) | ||
357 | #define CPUMASK_FREE(m) kfree(m) | ||
358 | #else | ||
359 | #define CPUMASK_ALLOC(m) struct m _m, *m = &_m | ||
360 | #define CPUMASK_FREE(m) | ||
361 | #endif | ||
362 | #define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v) | ||
363 | |||
364 | #define cpu_remap(oldbit, old, new) \ | ||
365 | __cpu_remap((oldbit), &(old), &(new), NR_CPUS) | ||
366 | static inline int __cpu_remap(int oldbit, | ||
367 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | ||
368 | { | ||
369 | return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits); | ||
370 | } | ||
371 | |||
372 | #define cpus_remap(dst, src, old, new) \ | ||
373 | __cpus_remap(&(dst), &(src), &(old), &(new), NR_CPUS) | ||
374 | static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, | ||
375 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | ||
376 | { | ||
377 | bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits); | ||
378 | } | ||
379 | |||
380 | #define cpus_onto(dst, orig, relmap) \ | ||
381 | __cpus_onto(&(dst), &(orig), &(relmap), NR_CPUS) | ||
382 | static inline void __cpus_onto(cpumask_t *dstp, const cpumask_t *origp, | ||
383 | const cpumask_t *relmapp, int nbits) | ||
384 | { | ||
385 | bitmap_onto(dstp->bits, origp->bits, relmapp->bits, nbits); | ||
386 | } | ||
387 | |||
388 | #define cpus_fold(dst, orig, sz) \ | ||
389 | __cpus_fold(&(dst), &(orig), sz, NR_CPUS) | ||
390 | static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp, | ||
391 | int sz, int nbits) | ||
392 | { | ||
393 | bitmap_fold(dstp->bits, origp->bits, sz, nbits); | ||
394 | } | ||
395 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
396 | 23 | ||
397 | #if NR_CPUS == 1 | 24 | #if NR_CPUS == 1 |
398 | |||
399 | #define nr_cpu_ids 1 | 25 | #define nr_cpu_ids 1 |
400 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | 26 | #else |
401 | #define first_cpu(src) ({ (void)(src); 0; }) | ||
402 | #define next_cpu(n, src) ({ (void)(src); 1; }) | ||
403 | #define any_online_cpu(mask) 0 | ||
404 | #define for_each_cpu_mask(cpu, mask) \ | ||
405 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
406 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
407 | #else /* NR_CPUS > 1 */ | ||
408 | |||
409 | extern int nr_cpu_ids; | 27 | extern int nr_cpu_ids; |
410 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
411 | int __first_cpu(const cpumask_t *srcp); | ||
412 | int __next_cpu(int n, const cpumask_t *srcp); | ||
413 | int __any_online_cpu(const cpumask_t *mask); | ||
414 | |||
415 | #define first_cpu(src) __first_cpu(&(src)) | ||
416 | #define next_cpu(n, src) __next_cpu((n), &(src)) | ||
417 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | ||
418 | #define for_each_cpu_mask(cpu, mask) \ | ||
419 | for ((cpu) = -1; \ | ||
420 | (cpu) = next_cpu((cpu), (mask)), \ | ||
421 | (cpu) < NR_CPUS; ) | ||
422 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
423 | #endif | 28 | #endif |
424 | 29 | ||
425 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | 30 | #ifdef CONFIG_CPUMASK_OFFSTACK |
426 | #if NR_CPUS <= 64 | 31 | /* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, |
427 | 32 | * not all bits may be allocated. */ | |
428 | #define next_cpu_nr(n, src) next_cpu(n, src) | 33 | #define nr_cpumask_bits nr_cpu_ids |
429 | #define cpus_weight_nr(cpumask) cpus_weight(cpumask) | 34 | #else |
430 | #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) | 35 | #define nr_cpumask_bits NR_CPUS |
431 | 36 | #endif | |
432 | #else /* NR_CPUS > 64 */ | ||
433 | |||
434 | int __next_cpu_nr(int n, const cpumask_t *srcp); | ||
435 | #define next_cpu_nr(n, src) __next_cpu_nr((n), &(src)) | ||
436 | #define cpus_weight_nr(cpumask) __cpus_weight(&(cpumask), nr_cpu_ids) | ||
437 | #define for_each_cpu_mask_nr(cpu, mask) \ | ||
438 | for ((cpu) = -1; \ | ||
439 | (cpu) = next_cpu_nr((cpu), (mask)), \ | ||
440 | (cpu) < nr_cpu_ids; ) | ||
441 | |||
442 | #endif /* NR_CPUS > 64 */ | ||
443 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
444 | 37 | ||
445 | /* | 38 | /* |
446 | * The following particular system cpumasks and operations manage | 39 | * The following particular system cpumasks and operations manage |
@@ -487,12 +80,6 @@ extern const struct cpumask *const cpu_online_mask; | |||
487 | extern const struct cpumask *const cpu_present_mask; | 80 | extern const struct cpumask *const cpu_present_mask; |
488 | extern const struct cpumask *const cpu_active_mask; | 81 | extern const struct cpumask *const cpu_active_mask; |
489 | 82 | ||
490 | /* These strip const, as traditionally they weren't const. */ | ||
491 | #define cpu_possible_map (*(cpumask_t *)cpu_possible_mask) | ||
492 | #define cpu_online_map (*(cpumask_t *)cpu_online_mask) | ||
493 | #define cpu_present_map (*(cpumask_t *)cpu_present_mask) | ||
494 | #define cpu_active_map (*(cpumask_t *)cpu_active_mask) | ||
495 | |||
496 | #if NR_CPUS > 1 | 83 | #if NR_CPUS > 1 |
497 | #define num_online_cpus() cpumask_weight(cpu_online_mask) | 84 | #define num_online_cpus() cpumask_weight(cpu_online_mask) |
498 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) | 85 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) |
@@ -511,35 +98,6 @@ extern const struct cpumask *const cpu_active_mask; | |||
511 | #define cpu_active(cpu) ((cpu) == 0) | 98 | #define cpu_active(cpu) ((cpu) == 0) |
512 | #endif | 99 | #endif |
513 | 100 | ||
514 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | ||
515 | |||
516 | /* These are the new versions of the cpumask operators: passed by pointer. | ||
517 | * The older versions will be implemented in terms of these, then deleted. */ | ||
518 | #define cpumask_bits(maskp) ((maskp)->bits) | ||
519 | |||
520 | #if NR_CPUS <= BITS_PER_LONG | ||
521 | #define CPU_BITS_ALL \ | ||
522 | { \ | ||
523 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
524 | } | ||
525 | |||
526 | #else /* NR_CPUS > BITS_PER_LONG */ | ||
527 | |||
528 | #define CPU_BITS_ALL \ | ||
529 | { \ | ||
530 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
531 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
532 | } | ||
533 | #endif /* NR_CPUS > BITS_PER_LONG */ | ||
534 | |||
535 | #ifdef CONFIG_CPUMASK_OFFSTACK | ||
536 | /* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, | ||
537 | * not all bits may be allocated. */ | ||
538 | #define nr_cpumask_bits nr_cpu_ids | ||
539 | #else | ||
540 | #define nr_cpumask_bits NR_CPUS | ||
541 | #endif | ||
542 | |||
543 | /* verify cpu argument to cpumask_* operators */ | 101 | /* verify cpu argument to cpumask_* operators */ |
544 | static inline unsigned int cpumask_check(unsigned int cpu) | 102 | static inline unsigned int cpumask_check(unsigned int cpu) |
545 | { | 103 | { |
@@ -715,6 +273,18 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) | |||
715 | } | 273 | } |
716 | 274 | ||
717 | /** | 275 | /** |
276 | * cpumask_test_and_clear_cpu - atomically test and clear a cpu in a cpumask | ||
277 | * @cpu: cpu number (< nr_cpu_ids) | ||
278 | * @cpumask: the cpumask pointer | ||
279 | * | ||
280 | * test_and_clear_bit wrapper for cpumasks. | ||
281 | */ | ||
282 | static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask) | ||
283 | { | ||
284 | return test_and_clear_bit(cpumask_check(cpu), cpumask_bits(cpumask)); | ||
285 | } | ||
286 | |||
287 | /** | ||
718 | * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask | 288 | * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask |
719 | * @dstp: the cpumask pointer | 289 | * @dstp: the cpumask pointer |
720 | */ | 290 | */ |
@@ -1088,4 +658,241 @@ void set_cpu_active(unsigned int cpu, bool active); | |||
1088 | void init_cpu_present(const struct cpumask *src); | 658 | void init_cpu_present(const struct cpumask *src); |
1089 | void init_cpu_possible(const struct cpumask *src); | 659 | void init_cpu_possible(const struct cpumask *src); |
1090 | void init_cpu_online(const struct cpumask *src); | 660 | void init_cpu_online(const struct cpumask *src); |
661 | |||
662 | /** | ||
663 | * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * | ||
664 | * @bitmap: the bitmap | ||
665 | * | ||
666 | * There are a few places where cpumask_var_t isn't appropriate and | ||
667 | * static cpumasks must be used (eg. very early boot), yet we don't | ||
668 | * expose the definition of 'struct cpumask'. | ||
669 | * | ||
670 | * This does the conversion, and can be used as a constant initializer. | ||
671 | */ | ||
672 | #define to_cpumask(bitmap) \ | ||
673 | ((struct cpumask *)(1 ? (bitmap) \ | ||
674 | : (void *)sizeof(__check_is_bitmap(bitmap)))) | ||
675 | |||
676 | static inline int __check_is_bitmap(const unsigned long *bitmap) | ||
677 | { | ||
678 | return 1; | ||
679 | } | ||
680 | |||
681 | /* | ||
682 | * Special-case data structure for "single bit set only" constant CPU masks. | ||
683 | * | ||
684 | * We pre-generate all the 64 (or 32) possible bit positions, with enough | ||
685 | * padding to the left and the right, and return the constant pointer | ||
686 | * appropriately offset. | ||
687 | */ | ||
688 | extern const unsigned long | ||
689 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; | ||
690 | |||
691 | static inline const struct cpumask *get_cpu_mask(unsigned int cpu) | ||
692 | { | ||
693 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; | ||
694 | p -= cpu / BITS_PER_LONG; | ||
695 | return to_cpumask(p); | ||
696 | } | ||
697 | |||
698 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | ||
699 | |||
700 | #if NR_CPUS <= BITS_PER_LONG | ||
701 | #define CPU_BITS_ALL \ | ||
702 | { \ | ||
703 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
704 | } | ||
705 | |||
706 | #else /* NR_CPUS > BITS_PER_LONG */ | ||
707 | |||
708 | #define CPU_BITS_ALL \ | ||
709 | { \ | ||
710 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
711 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
712 | } | ||
713 | #endif /* NR_CPUS > BITS_PER_LONG */ | ||
714 | |||
715 | /* | ||
716 | * | ||
717 | * From here down, all obsolete. Use cpumask_ variants! | ||
718 | * | ||
719 | */ | ||
720 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
721 | /* These strip const, as traditionally they weren't const. */ | ||
722 | #define cpu_possible_map (*(cpumask_t *)cpu_possible_mask) | ||
723 | #define cpu_online_map (*(cpumask_t *)cpu_online_mask) | ||
724 | #define cpu_present_map (*(cpumask_t *)cpu_present_mask) | ||
725 | #define cpu_active_map (*(cpumask_t *)cpu_active_mask) | ||
726 | |||
727 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) | ||
728 | |||
729 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | ||
730 | |||
731 | #if NR_CPUS <= BITS_PER_LONG | ||
732 | |||
733 | #define CPU_MASK_ALL \ | ||
734 | (cpumask_t) { { \ | ||
735 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
736 | } } | ||
737 | |||
738 | #else | ||
739 | |||
740 | #define CPU_MASK_ALL \ | ||
741 | (cpumask_t) { { \ | ||
742 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | ||
743 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | ||
744 | } } | ||
745 | |||
746 | #endif | ||
747 | |||
748 | #define CPU_MASK_NONE \ | ||
749 | (cpumask_t) { { \ | ||
750 | [0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \ | ||
751 | } } | ||
752 | |||
753 | #define CPU_MASK_CPU0 \ | ||
754 | (cpumask_t) { { \ | ||
755 | [0] = 1UL \ | ||
756 | } } | ||
757 | |||
758 | #if NR_CPUS == 1 | ||
759 | #define first_cpu(src) ({ (void)(src); 0; }) | ||
760 | #define next_cpu(n, src) ({ (void)(src); 1; }) | ||
761 | #define any_online_cpu(mask) 0 | ||
762 | #define for_each_cpu_mask(cpu, mask) \ | ||
763 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
764 | #else /* NR_CPUS > 1 */ | ||
765 | int __first_cpu(const cpumask_t *srcp); | ||
766 | int __next_cpu(int n, const cpumask_t *srcp); | ||
767 | int __any_online_cpu(const cpumask_t *mask); | ||
768 | |||
769 | #define first_cpu(src) __first_cpu(&(src)) | ||
770 | #define next_cpu(n, src) __next_cpu((n), &(src)) | ||
771 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | ||
772 | #define for_each_cpu_mask(cpu, mask) \ | ||
773 | for ((cpu) = -1; \ | ||
774 | (cpu) = next_cpu((cpu), (mask)), \ | ||
775 | (cpu) < NR_CPUS; ) | ||
776 | #endif /* SMP */ | ||
777 | |||
778 | #if NR_CPUS <= 64 | ||
779 | |||
780 | #define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask) | ||
781 | |||
782 | #else /* NR_CPUS > 64 */ | ||
783 | |||
784 | int __next_cpu_nr(int n, const cpumask_t *srcp); | ||
785 | #define for_each_cpu_mask_nr(cpu, mask) \ | ||
786 | for ((cpu) = -1; \ | ||
787 | (cpu) = __next_cpu_nr((cpu), &(mask)), \ | ||
788 | (cpu) < nr_cpu_ids; ) | ||
789 | |||
790 | #endif /* NR_CPUS > 64 */ | ||
791 | |||
792 | #define cpus_addr(src) ((src).bits) | ||
793 | |||
794 | #define cpu_set(cpu, dst) __cpu_set((cpu), &(dst)) | ||
795 | static inline void __cpu_set(int cpu, volatile cpumask_t *dstp) | ||
796 | { | ||
797 | set_bit(cpu, dstp->bits); | ||
798 | } | ||
799 | |||
800 | #define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst)) | ||
801 | static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp) | ||
802 | { | ||
803 | clear_bit(cpu, dstp->bits); | ||
804 | } | ||
805 | |||
806 | #define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS) | ||
807 | static inline void __cpus_setall(cpumask_t *dstp, int nbits) | ||
808 | { | ||
809 | bitmap_fill(dstp->bits, nbits); | ||
810 | } | ||
811 | |||
812 | #define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS) | ||
813 | static inline void __cpus_clear(cpumask_t *dstp, int nbits) | ||
814 | { | ||
815 | bitmap_zero(dstp->bits, nbits); | ||
816 | } | ||
817 | |||
818 | /* No static inline type checking - see Subtlety (1) above. */ | ||
819 | #define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits) | ||
820 | |||
821 | #define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask)) | ||
822 | static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) | ||
823 | { | ||
824 | return test_and_set_bit(cpu, addr->bits); | ||
825 | } | ||
826 | |||
827 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) | ||
828 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | ||
829 | const cpumask_t *src2p, int nbits) | ||
830 | { | ||
831 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
832 | } | ||
833 | |||
834 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) | ||
835 | static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p, | ||
836 | const cpumask_t *src2p, int nbits) | ||
837 | { | ||
838 | bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
839 | } | ||
840 | |||
841 | #define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS) | ||
842 | static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | ||
843 | const cpumask_t *src2p, int nbits) | ||
844 | { | ||
845 | bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
846 | } | ||
847 | |||
848 | #define cpus_andnot(dst, src1, src2) \ | ||
849 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) | ||
850 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | ||
851 | const cpumask_t *src2p, int nbits) | ||
852 | { | ||
853 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | ||
854 | } | ||
855 | |||
856 | #define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS) | ||
857 | static inline int __cpus_equal(const cpumask_t *src1p, | ||
858 | const cpumask_t *src2p, int nbits) | ||
859 | { | ||
860 | return bitmap_equal(src1p->bits, src2p->bits, nbits); | ||
861 | } | ||
862 | |||
863 | #define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS) | ||
864 | static inline int __cpus_intersects(const cpumask_t *src1p, | ||
865 | const cpumask_t *src2p, int nbits) | ||
866 | { | ||
867 | return bitmap_intersects(src1p->bits, src2p->bits, nbits); | ||
868 | } | ||
869 | |||
870 | #define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS) | ||
871 | static inline int __cpus_subset(const cpumask_t *src1p, | ||
872 | const cpumask_t *src2p, int nbits) | ||
873 | { | ||
874 | return bitmap_subset(src1p->bits, src2p->bits, nbits); | ||
875 | } | ||
876 | |||
877 | #define cpus_empty(src) __cpus_empty(&(src), NR_CPUS) | ||
878 | static inline int __cpus_empty(const cpumask_t *srcp, int nbits) | ||
879 | { | ||
880 | return bitmap_empty(srcp->bits, nbits); | ||
881 | } | ||
882 | |||
883 | #define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS) | ||
884 | static inline int __cpus_weight(const cpumask_t *srcp, int nbits) | ||
885 | { | ||
886 | return bitmap_weight(srcp->bits, nbits); | ||
887 | } | ||
888 | |||
889 | #define cpus_shift_left(dst, src, n) \ | ||
890 | __cpus_shift_left(&(dst), &(src), (n), NR_CPUS) | ||
891 | static inline void __cpus_shift_left(cpumask_t *dstp, | ||
892 | const cpumask_t *srcp, int n, int nbits) | ||
893 | { | ||
894 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | ||
895 | } | ||
896 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
897 | |||
1091 | #endif /* __LINUX_CPUMASK_H */ | 898 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/cred.h b/include/linux/cred.h index fb371601a3b4..4e3387a89cb9 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -176,23 +176,7 @@ extern void __invalid_creds(const struct cred *, const char *, unsigned); | |||
176 | extern void __validate_process_creds(struct task_struct *, | 176 | extern void __validate_process_creds(struct task_struct *, |
177 | const char *, unsigned); | 177 | const char *, unsigned); |
178 | 178 | ||
179 | static inline bool creds_are_invalid(const struct cred *cred) | 179 | extern bool creds_are_invalid(const struct cred *cred); |
180 | { | ||
181 | if (cred->magic != CRED_MAGIC) | ||
182 | return true; | ||
183 | if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers)) | ||
184 | return true; | ||
185 | #ifdef CONFIG_SECURITY_SELINUX | ||
186 | if (selinux_is_enabled()) { | ||
187 | if ((unsigned long) cred->security < PAGE_SIZE) | ||
188 | return true; | ||
189 | if ((*(u32 *)cred->security & 0xffffff00) == | ||
190 | (POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8)) | ||
191 | return true; | ||
192 | } | ||
193 | #endif | ||
194 | return false; | ||
195 | } | ||
196 | 180 | ||
197 | static inline void __validate_creds(const struct cred *cred, | 181 | static inline void __validate_creds(const struct cred *cred, |
198 | const char *file, unsigned line) | 182 | const char *file, unsigned line) |
diff --git a/include/linux/dca.h b/include/linux/dca.h index 9c20c7e87d0a..d27a7a05718d 100644 --- a/include/linux/dca.h +++ b/include/linux/dca.h | |||
@@ -20,6 +20,9 @@ | |||
20 | */ | 20 | */ |
21 | #ifndef DCA_H | 21 | #ifndef DCA_H |
22 | #define DCA_H | 22 | #define DCA_H |
23 | |||
24 | #include <linux/pci.h> | ||
25 | |||
23 | /* DCA Provider API */ | 26 | /* DCA Provider API */ |
24 | 27 | ||
25 | /* DCA Notifier Interface */ | 28 | /* DCA Notifier Interface */ |
@@ -36,6 +39,12 @@ struct dca_provider { | |||
36 | int id; | 39 | int id; |
37 | }; | 40 | }; |
38 | 41 | ||
42 | struct dca_domain { | ||
43 | struct list_head node; | ||
44 | struct list_head dca_providers; | ||
45 | struct pci_bus *pci_rc; | ||
46 | }; | ||
47 | |||
39 | struct dca_ops { | 48 | struct dca_ops { |
40 | int (*add_requester) (struct dca_provider *, struct device *); | 49 | int (*add_requester) (struct dca_provider *, struct device *); |
41 | int (*remove_requester) (struct dca_provider *, struct device *); | 50 | int (*remove_requester) (struct dca_provider *, struct device *); |
@@ -47,7 +56,7 @@ struct dca_ops { | |||
47 | struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size); | 56 | struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size); |
48 | void free_dca_provider(struct dca_provider *dca); | 57 | void free_dca_provider(struct dca_provider *dca); |
49 | int register_dca_provider(struct dca_provider *dca, struct device *dev); | 58 | int register_dca_provider(struct dca_provider *dca, struct device *dev); |
50 | void unregister_dca_provider(struct dca_provider *dca); | 59 | void unregister_dca_provider(struct dca_provider *dca, struct device *dev); |
51 | 60 | ||
52 | static inline void *dca_priv(struct dca_provider *dca) | 61 | static inline void *dca_priv(struct dca_provider *dca) |
53 | { | 62 | { |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index eb5c2ba2f81a..fc1b930f246c 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * 2 as published by the Free Software Foundation. | 9 | * 2 as published by the Free Software Foundation. |
10 | * | 10 | * |
11 | * debugfs is for people to use instead of /proc or /sys. | 11 | * debugfs is for people to use instead of /proc or /sys. |
12 | * See Documentation/DocBook/kernel-api for more details. | 12 | * See Documentation/DocBook/filesystems for more details. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifndef _DEBUGFS_H_ | 15 | #ifndef _DEBUGFS_H_ |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index ffefba81c818..2b9f2ac7ed60 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -48,19 +48,20 @@ enum dma_status { | |||
48 | 48 | ||
49 | /** | 49 | /** |
50 | * enum dma_transaction_type - DMA transaction types/indexes | 50 | * enum dma_transaction_type - DMA transaction types/indexes |
51 | * | ||
52 | * Note: The DMA_ASYNC_TX capability is not to be set by drivers. It is | ||
53 | * automatically set as dma devices are registered. | ||
51 | */ | 54 | */ |
52 | enum dma_transaction_type { | 55 | enum dma_transaction_type { |
53 | DMA_MEMCPY, | 56 | DMA_MEMCPY, |
54 | DMA_XOR, | 57 | DMA_XOR, |
55 | DMA_PQ_XOR, | 58 | DMA_PQ, |
56 | DMA_DUAL_XOR, | 59 | DMA_XOR_VAL, |
57 | DMA_PQ_UPDATE, | 60 | DMA_PQ_VAL, |
58 | DMA_ZERO_SUM, | ||
59 | DMA_PQ_ZERO_SUM, | ||
60 | DMA_MEMSET, | 61 | DMA_MEMSET, |
61 | DMA_MEMCPY_CRC32C, | ||
62 | DMA_INTERRUPT, | 62 | DMA_INTERRUPT, |
63 | DMA_PRIVATE, | 63 | DMA_PRIVATE, |
64 | DMA_ASYNC_TX, | ||
64 | DMA_SLAVE, | 65 | DMA_SLAVE, |
65 | }; | 66 | }; |
66 | 67 | ||
@@ -70,18 +71,25 @@ enum dma_transaction_type { | |||
70 | 71 | ||
71 | /** | 72 | /** |
72 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, | 73 | * enum dma_ctrl_flags - DMA flags to augment operation preparation, |
73 | * control completion, and communicate status. | 74 | * control completion, and communicate status. |
74 | * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of | 75 | * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of |
75 | * this transaction | 76 | * this transaction |
76 | * @DMA_CTRL_ACK - the descriptor cannot be reused until the client | 77 | * @DMA_CTRL_ACK - the descriptor cannot be reused until the client |
77 | * acknowledges receipt, i.e. has has a chance to establish any | 78 | * acknowledges receipt, i.e. has has a chance to establish any dependency |
78 | * dependency chains | 79 | * chains |
79 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | 80 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) |
80 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) | 81 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) |
81 | * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single | 82 | * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single |
82 | * (if not set, do the source dma-unmapping as page) | 83 | * (if not set, do the source dma-unmapping as page) |
83 | * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single | 84 | * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single |
84 | * (if not set, do the destination dma-unmapping as page) | 85 | * (if not set, do the destination dma-unmapping as page) |
86 | * @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q | ||
87 | * @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P | ||
88 | * @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as | ||
89 | * sources that were the result of a previous operation, in the case of a PQ | ||
90 | * operation it continues the calculation with new sources | ||
91 | * @DMA_PREP_FENCE - tell the driver that subsequent operations depend | ||
92 | * on the result of this operation | ||
85 | */ | 93 | */ |
86 | enum dma_ctrl_flags { | 94 | enum dma_ctrl_flags { |
87 | DMA_PREP_INTERRUPT = (1 << 0), | 95 | DMA_PREP_INTERRUPT = (1 << 0), |
@@ -90,9 +98,32 @@ enum dma_ctrl_flags { | |||
90 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), | 98 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), |
91 | DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), | 99 | DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), |
92 | DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), | 100 | DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), |
101 | DMA_PREP_PQ_DISABLE_P = (1 << 6), | ||
102 | DMA_PREP_PQ_DISABLE_Q = (1 << 7), | ||
103 | DMA_PREP_CONTINUE = (1 << 8), | ||
104 | DMA_PREP_FENCE = (1 << 9), | ||
93 | }; | 105 | }; |
94 | 106 | ||
95 | /** | 107 | /** |
108 | * enum sum_check_bits - bit position of pq_check_flags | ||
109 | */ | ||
110 | enum sum_check_bits { | ||
111 | SUM_CHECK_P = 0, | ||
112 | SUM_CHECK_Q = 1, | ||
113 | }; | ||
114 | |||
115 | /** | ||
116 | * enum pq_check_flags - result of async_{xor,pq}_zero_sum operations | ||
117 | * @SUM_CHECK_P_RESULT - 1 if xor zero sum error, 0 otherwise | ||
118 | * @SUM_CHECK_Q_RESULT - 1 if reed-solomon zero sum error, 0 otherwise | ||
119 | */ | ||
120 | enum sum_check_flags { | ||
121 | SUM_CHECK_P_RESULT = (1 << SUM_CHECK_P), | ||
122 | SUM_CHECK_Q_RESULT = (1 << SUM_CHECK_Q), | ||
123 | }; | ||
124 | |||
125 | |||
126 | /** | ||
96 | * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. | 127 | * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. |
97 | * See linux/cpumask.h | 128 | * See linux/cpumask.h |
98 | */ | 129 | */ |
@@ -180,8 +211,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param); | |||
180 | * @flags: flags to augment operation preparation, control completion, and | 211 | * @flags: flags to augment operation preparation, control completion, and |
181 | * communicate status | 212 | * communicate status |
182 | * @phys: physical address of the descriptor | 213 | * @phys: physical address of the descriptor |
183 | * @tx_list: driver common field for operations that require multiple | ||
184 | * descriptors | ||
185 | * @chan: target channel for this operation | 214 | * @chan: target channel for this operation |
186 | * @tx_submit: set the prepared descriptor(s) to be executed by the engine | 215 | * @tx_submit: set the prepared descriptor(s) to be executed by the engine |
187 | * @callback: routine to call after this operation is complete | 216 | * @callback: routine to call after this operation is complete |
@@ -195,7 +224,6 @@ struct dma_async_tx_descriptor { | |||
195 | dma_cookie_t cookie; | 224 | dma_cookie_t cookie; |
196 | enum dma_ctrl_flags flags; /* not a 'long' to pack with cookie */ | 225 | enum dma_ctrl_flags flags; /* not a 'long' to pack with cookie */ |
197 | dma_addr_t phys; | 226 | dma_addr_t phys; |
198 | struct list_head tx_list; | ||
199 | struct dma_chan *chan; | 227 | struct dma_chan *chan; |
200 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); | 228 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); |
201 | dma_async_tx_callback callback; | 229 | dma_async_tx_callback callback; |
@@ -213,6 +241,11 @@ struct dma_async_tx_descriptor { | |||
213 | * @global_node: list_head for global dma_device_list | 241 | * @global_node: list_head for global dma_device_list |
214 | * @cap_mask: one or more dma_capability flags | 242 | * @cap_mask: one or more dma_capability flags |
215 | * @max_xor: maximum number of xor sources, 0 if no capability | 243 | * @max_xor: maximum number of xor sources, 0 if no capability |
244 | * @max_pq: maximum number of PQ sources and PQ-continue capability | ||
245 | * @copy_align: alignment shift for memcpy operations | ||
246 | * @xor_align: alignment shift for xor operations | ||
247 | * @pq_align: alignment shift for pq operations | ||
248 | * @fill_align: alignment shift for memset operations | ||
216 | * @dev_id: unique device ID | 249 | * @dev_id: unique device ID |
217 | * @dev: struct device reference for dma mapping api | 250 | * @dev: struct device reference for dma mapping api |
218 | * @device_alloc_chan_resources: allocate resources and return the | 251 | * @device_alloc_chan_resources: allocate resources and return the |
@@ -220,7 +253,9 @@ struct dma_async_tx_descriptor { | |||
220 | * @device_free_chan_resources: release DMA channel's resources | 253 | * @device_free_chan_resources: release DMA channel's resources |
221 | * @device_prep_dma_memcpy: prepares a memcpy operation | 254 | * @device_prep_dma_memcpy: prepares a memcpy operation |
222 | * @device_prep_dma_xor: prepares a xor operation | 255 | * @device_prep_dma_xor: prepares a xor operation |
223 | * @device_prep_dma_zero_sum: prepares a zero_sum operation | 256 | * @device_prep_dma_xor_val: prepares a xor validation operation |
257 | * @device_prep_dma_pq: prepares a pq operation | ||
258 | * @device_prep_dma_pq_val: prepares a pqzero_sum operation | ||
224 | * @device_prep_dma_memset: prepares a memset operation | 259 | * @device_prep_dma_memset: prepares a memset operation |
225 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation | 260 | * @device_prep_dma_interrupt: prepares an end of chain interrupt operation |
226 | * @device_prep_slave_sg: prepares a slave dma operation | 261 | * @device_prep_slave_sg: prepares a slave dma operation |
@@ -235,7 +270,13 @@ struct dma_device { | |||
235 | struct list_head channels; | 270 | struct list_head channels; |
236 | struct list_head global_node; | 271 | struct list_head global_node; |
237 | dma_cap_mask_t cap_mask; | 272 | dma_cap_mask_t cap_mask; |
238 | int max_xor; | 273 | unsigned short max_xor; |
274 | unsigned short max_pq; | ||
275 | u8 copy_align; | ||
276 | u8 xor_align; | ||
277 | u8 pq_align; | ||
278 | u8 fill_align; | ||
279 | #define DMA_HAS_PQ_CONTINUE (1 << 15) | ||
239 | 280 | ||
240 | int dev_id; | 281 | int dev_id; |
241 | struct device *dev; | 282 | struct device *dev; |
@@ -249,9 +290,17 @@ struct dma_device { | |||
249 | struct dma_async_tx_descriptor *(*device_prep_dma_xor)( | 290 | struct dma_async_tx_descriptor *(*device_prep_dma_xor)( |
250 | struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src, | 291 | struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src, |
251 | unsigned int src_cnt, size_t len, unsigned long flags); | 292 | unsigned int src_cnt, size_t len, unsigned long flags); |
252 | struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( | 293 | struct dma_async_tx_descriptor *(*device_prep_dma_xor_val)( |
253 | struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt, | 294 | struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt, |
254 | size_t len, u32 *result, unsigned long flags); | 295 | size_t len, enum sum_check_flags *result, unsigned long flags); |
296 | struct dma_async_tx_descriptor *(*device_prep_dma_pq)( | ||
297 | struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src, | ||
298 | unsigned int src_cnt, const unsigned char *scf, | ||
299 | size_t len, unsigned long flags); | ||
300 | struct dma_async_tx_descriptor *(*device_prep_dma_pq_val)( | ||
301 | struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src, | ||
302 | unsigned int src_cnt, const unsigned char *scf, size_t len, | ||
303 | enum sum_check_flags *pqres, unsigned long flags); | ||
255 | struct dma_async_tx_descriptor *(*device_prep_dma_memset)( | 304 | struct dma_async_tx_descriptor *(*device_prep_dma_memset)( |
256 | struct dma_chan *chan, dma_addr_t dest, int value, size_t len, | 305 | struct dma_chan *chan, dma_addr_t dest, int value, size_t len, |
257 | unsigned long flags); | 306 | unsigned long flags); |
@@ -270,6 +319,96 @@ struct dma_device { | |||
270 | void (*device_issue_pending)(struct dma_chan *chan); | 319 | void (*device_issue_pending)(struct dma_chan *chan); |
271 | }; | 320 | }; |
272 | 321 | ||
322 | static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len) | ||
323 | { | ||
324 | size_t mask; | ||
325 | |||
326 | if (!align) | ||
327 | return true; | ||
328 | mask = (1 << align) - 1; | ||
329 | if (mask & (off1 | off2 | len)) | ||
330 | return false; | ||
331 | return true; | ||
332 | } | ||
333 | |||
334 | static inline bool is_dma_copy_aligned(struct dma_device *dev, size_t off1, | ||
335 | size_t off2, size_t len) | ||
336 | { | ||
337 | return dmaengine_check_align(dev->copy_align, off1, off2, len); | ||
338 | } | ||
339 | |||
340 | static inline bool is_dma_xor_aligned(struct dma_device *dev, size_t off1, | ||
341 | size_t off2, size_t len) | ||
342 | { | ||
343 | return dmaengine_check_align(dev->xor_align, off1, off2, len); | ||
344 | } | ||
345 | |||
346 | static inline bool is_dma_pq_aligned(struct dma_device *dev, size_t off1, | ||
347 | size_t off2, size_t len) | ||
348 | { | ||
349 | return dmaengine_check_align(dev->pq_align, off1, off2, len); | ||
350 | } | ||
351 | |||
352 | static inline bool is_dma_fill_aligned(struct dma_device *dev, size_t off1, | ||
353 | size_t off2, size_t len) | ||
354 | { | ||
355 | return dmaengine_check_align(dev->fill_align, off1, off2, len); | ||
356 | } | ||
357 | |||
358 | static inline void | ||
359 | dma_set_maxpq(struct dma_device *dma, int maxpq, int has_pq_continue) | ||
360 | { | ||
361 | dma->max_pq = maxpq; | ||
362 | if (has_pq_continue) | ||
363 | dma->max_pq |= DMA_HAS_PQ_CONTINUE; | ||
364 | } | ||
365 | |||
366 | static inline bool dmaf_continue(enum dma_ctrl_flags flags) | ||
367 | { | ||
368 | return (flags & DMA_PREP_CONTINUE) == DMA_PREP_CONTINUE; | ||
369 | } | ||
370 | |||
371 | static inline bool dmaf_p_disabled_continue(enum dma_ctrl_flags flags) | ||
372 | { | ||
373 | enum dma_ctrl_flags mask = DMA_PREP_CONTINUE | DMA_PREP_PQ_DISABLE_P; | ||
374 | |||
375 | return (flags & mask) == mask; | ||
376 | } | ||
377 | |||
378 | static inline bool dma_dev_has_pq_continue(struct dma_device *dma) | ||
379 | { | ||
380 | return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE; | ||
381 | } | ||
382 | |||
383 | static unsigned short dma_dev_to_maxpq(struct dma_device *dma) | ||
384 | { | ||
385 | return dma->max_pq & ~DMA_HAS_PQ_CONTINUE; | ||
386 | } | ||
387 | |||
388 | /* dma_maxpq - reduce maxpq in the face of continued operations | ||
389 | * @dma - dma device with PQ capability | ||
390 | * @flags - to check if DMA_PREP_CONTINUE and DMA_PREP_PQ_DISABLE_P are set | ||
391 | * | ||
392 | * When an engine does not support native continuation we need 3 extra | ||
393 | * source slots to reuse P and Q with the following coefficients: | ||
394 | * 1/ {00} * P : remove P from Q', but use it as a source for P' | ||
395 | * 2/ {01} * Q : use Q to continue Q' calculation | ||
396 | * 3/ {00} * Q : subtract Q from P' to cancel (2) | ||
397 | * | ||
398 | * In the case where P is disabled we only need 1 extra source: | ||
399 | * 1/ {01} * Q : use Q to continue Q' calculation | ||
400 | */ | ||
401 | static inline int dma_maxpq(struct dma_device *dma, enum dma_ctrl_flags flags) | ||
402 | { | ||
403 | if (dma_dev_has_pq_continue(dma) || !dmaf_continue(flags)) | ||
404 | return dma_dev_to_maxpq(dma); | ||
405 | else if (dmaf_p_disabled_continue(flags)) | ||
406 | return dma_dev_to_maxpq(dma) - 1; | ||
407 | else if (dmaf_continue(flags)) | ||
408 | return dma_dev_to_maxpq(dma) - 3; | ||
409 | BUG(); | ||
410 | } | ||
411 | |||
273 | /* --- public DMA engine API --- */ | 412 | /* --- public DMA engine API --- */ |
274 | 413 | ||
275 | #ifdef CONFIG_DMA_ENGINE | 414 | #ifdef CONFIG_DMA_ENGINE |
@@ -299,7 +438,11 @@ static inline void net_dmaengine_put(void) | |||
299 | #ifdef CONFIG_ASYNC_TX_DMA | 438 | #ifdef CONFIG_ASYNC_TX_DMA |
300 | #define async_dmaengine_get() dmaengine_get() | 439 | #define async_dmaengine_get() dmaengine_get() |
301 | #define async_dmaengine_put() dmaengine_put() | 440 | #define async_dmaengine_put() dmaengine_put() |
441 | #ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH | ||
442 | #define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX) | ||
443 | #else | ||
302 | #define async_dma_find_channel(type) dma_find_channel(type) | 444 | #define async_dma_find_channel(type) dma_find_channel(type) |
445 | #endif /* CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH */ | ||
303 | #else | 446 | #else |
304 | static inline void async_dmaengine_get(void) | 447 | static inline void async_dmaengine_get(void) |
305 | { | 448 | { |
@@ -312,7 +455,7 @@ async_dma_find_channel(enum dma_transaction_type type) | |||
312 | { | 455 | { |
313 | return NULL; | 456 | return NULL; |
314 | } | 457 | } |
315 | #endif | 458 | #endif /* CONFIG_ASYNC_TX_DMA */ |
316 | 459 | ||
317 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, | 460 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, |
318 | void *dest, void *src, size_t len); | 461 | void *dest, void *src, size_t len); |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 3b85ba6479f4..94dd10366a78 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #ifdef CONFIG_EVENTFD | 28 | #ifdef CONFIG_EVENTFD |
29 | 29 | ||
30 | struct file *eventfd_file_create(unsigned int count, int flags); | ||
30 | struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx); | 31 | struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx); |
31 | void eventfd_ctx_put(struct eventfd_ctx *ctx); | 32 | void eventfd_ctx_put(struct eventfd_ctx *ctx); |
32 | struct file *eventfd_fget(int fd); | 33 | struct file *eventfd_fget(int fd); |
@@ -40,6 +41,11 @@ int eventfd_signal(struct eventfd_ctx *ctx, int n); | |||
40 | * Ugly ugly ugly error layer to support modules that uses eventfd but | 41 | * Ugly ugly ugly error layer to support modules that uses eventfd but |
41 | * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO. | 42 | * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO. |
42 | */ | 43 | */ |
44 | static inline struct file *eventfd_file_create(unsigned int count, int flags) | ||
45 | { | ||
46 | return ERR_PTR(-ENOSYS); | ||
47 | } | ||
48 | |||
43 | static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) | 49 | static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) |
44 | { | 50 | { |
45 | return ERR_PTR(-ENOSYS); | 51 | return ERR_PTR(-ENOSYS); |
diff --git a/include/linux/fb.h b/include/linux/fb.h index f847df9e99b6..a34bdf5a9d23 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -133,6 +133,7 @@ struct dentry; | |||
133 | #define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */ | 133 | #define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */ |
134 | #define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */ | 134 | #define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */ |
135 | #define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */ | 135 | #define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */ |
136 | #define FB_ACCEL_PXA3XX 99 /* PXA3xx */ | ||
136 | 137 | ||
137 | #define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */ | 138 | #define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */ |
138 | #define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */ | 139 | #define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */ |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 192d1e43c43c..7e1d4dec83e7 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -134,20 +134,6 @@ struct fw_card { | |||
134 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; | 134 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; |
135 | }; | 135 | }; |
136 | 136 | ||
137 | static inline struct fw_card *fw_card_get(struct fw_card *card) | ||
138 | { | ||
139 | kref_get(&card->kref); | ||
140 | |||
141 | return card; | ||
142 | } | ||
143 | |||
144 | void fw_card_release(struct kref *kref); | ||
145 | |||
146 | static inline void fw_card_put(struct fw_card *card) | ||
147 | { | ||
148 | kref_put(&card->kref, fw_card_release); | ||
149 | } | ||
150 | |||
151 | struct fw_attribute_group { | 137 | struct fw_attribute_group { |
152 | struct attribute_group *groups[2]; | 138 | struct attribute_group *groups[2]; |
153 | struct attribute_group group; | 139 | struct attribute_group group; |
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h index 45ff18491514..1d747f72298b 100644 --- a/include/linux/flex_array.h +++ b/include/linux/flex_array.h | |||
@@ -31,10 +31,32 @@ struct flex_array { | |||
31 | }; | 31 | }; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | #define FLEX_ARRAY_INIT(size, total) { { {\ | 34 | /* Number of bytes left in base struct flex_array, excluding metadata */ |
35 | .element_size = (size), \ | 35 | #define FLEX_ARRAY_BASE_BYTES_LEFT \ |
36 | .total_nr_elements = (total), \ | 36 | (FLEX_ARRAY_BASE_SIZE - offsetof(struct flex_array, parts)) |
37 | } } } | 37 | |
38 | /* Number of pointers in base to struct flex_array_part pages */ | ||
39 | #define FLEX_ARRAY_NR_BASE_PTRS \ | ||
40 | (FLEX_ARRAY_BASE_BYTES_LEFT / sizeof(struct flex_array_part *)) | ||
41 | |||
42 | /* Number of elements of size that fit in struct flex_array_part */ | ||
43 | #define FLEX_ARRAY_ELEMENTS_PER_PART(size) \ | ||
44 | (FLEX_ARRAY_PART_SIZE / size) | ||
45 | |||
46 | /* | ||
47 | * Defines a statically allocated flex array and ensures its parameters are | ||
48 | * valid. | ||
49 | */ | ||
50 | #define DEFINE_FLEX_ARRAY(__arrayname, __element_size, __total) \ | ||
51 | struct flex_array __arrayname = { { { \ | ||
52 | .element_size = (__element_size), \ | ||
53 | .total_nr_elements = (__total), \ | ||
54 | } } }; \ | ||
55 | static inline void __arrayname##_invalid_parameter(void) \ | ||
56 | { \ | ||
57 | BUILD_BUG_ON((__total) > FLEX_ARRAY_NR_BASE_PTRS * \ | ||
58 | FLEX_ARRAY_ELEMENTS_PER_PART(__element_size)); \ | ||
59 | } | ||
38 | 60 | ||
39 | struct flex_array *flex_array_alloc(int element_size, unsigned int total, | 61 | struct flex_array *flex_array_alloc(int element_size, unsigned int total, |
40 | gfp_t flags); | 62 | gfp_t flags); |
@@ -44,6 +66,8 @@ void flex_array_free(struct flex_array *fa); | |||
44 | void flex_array_free_parts(struct flex_array *fa); | 66 | void flex_array_free_parts(struct flex_array *fa); |
45 | int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, | 67 | int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, |
46 | gfp_t flags); | 68 | gfp_t flags); |
69 | int flex_array_clear(struct flex_array *fa, unsigned int element_nr); | ||
47 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); | 70 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); |
71 | int flex_array_shrink(struct flex_array *fa); | ||
48 | 72 | ||
49 | #endif /* _FLEX_ARRAY_H */ | 73 | #endif /* _FLEX_ARRAY_H */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 90162fb3bf04..2adaa2529f18 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -595,6 +595,7 @@ struct address_space_operations { | |||
595 | int (*launder_page) (struct page *); | 595 | int (*launder_page) (struct page *); |
596 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, | 596 | int (*is_partially_uptodate) (struct page *, read_descriptor_t *, |
597 | unsigned long); | 597 | unsigned long); |
598 | int (*error_remove_page)(struct address_space *, struct page *); | ||
598 | }; | 599 | }; |
599 | 600 | ||
600 | /* | 601 | /* |
@@ -640,7 +641,6 @@ struct block_device { | |||
640 | struct super_block * bd_super; | 641 | struct super_block * bd_super; |
641 | int bd_openers; | 642 | int bd_openers; |
642 | struct mutex bd_mutex; /* open/close mutex */ | 643 | struct mutex bd_mutex; /* open/close mutex */ |
643 | struct semaphore bd_mount_sem; | ||
644 | struct list_head bd_inodes; | 644 | struct list_head bd_inodes; |
645 | void * bd_holder; | 645 | void * bd_holder; |
646 | int bd_holders; | 646 | int bd_holders; |
@@ -1066,8 +1066,8 @@ struct file_lock { | |||
1066 | struct fasync_struct * fl_fasync; /* for lease break notifications */ | 1066 | struct fasync_struct * fl_fasync; /* for lease break notifications */ |
1067 | unsigned long fl_break_time; /* for nonblocking lease breaks */ | 1067 | unsigned long fl_break_time; /* for nonblocking lease breaks */ |
1068 | 1068 | ||
1069 | struct file_lock_operations *fl_ops; /* Callbacks for filesystems */ | 1069 | const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */ |
1070 | struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ | 1070 | const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ |
1071 | union { | 1071 | union { |
1072 | struct nfs_lock_info nfs_fl; | 1072 | struct nfs_lock_info nfs_fl; |
1073 | struct nfs4_lock_info nfs4_fl; | 1073 | struct nfs4_lock_info nfs4_fl; |
@@ -1315,11 +1315,11 @@ struct super_block { | |||
1315 | unsigned long s_blocksize; | 1315 | unsigned long s_blocksize; |
1316 | unsigned char s_blocksize_bits; | 1316 | unsigned char s_blocksize_bits; |
1317 | unsigned char s_dirt; | 1317 | unsigned char s_dirt; |
1318 | unsigned long long s_maxbytes; /* Max file size */ | 1318 | loff_t s_maxbytes; /* Max file size */ |
1319 | struct file_system_type *s_type; | 1319 | struct file_system_type *s_type; |
1320 | const struct super_operations *s_op; | 1320 | const struct super_operations *s_op; |
1321 | struct dquot_operations *dq_op; | 1321 | const struct dquot_operations *dq_op; |
1322 | struct quotactl_ops *s_qcop; | 1322 | const struct quotactl_ops *s_qcop; |
1323 | const struct export_operations *s_export_op; | 1323 | const struct export_operations *s_export_op; |
1324 | unsigned long s_flags; | 1324 | unsigned long s_flags; |
1325 | unsigned long s_magic; | 1325 | unsigned long s_magic; |
@@ -2156,6 +2156,7 @@ extern ino_t iunique(struct super_block *, ino_t); | |||
2156 | extern int inode_needs_sync(struct inode *inode); | 2156 | extern int inode_needs_sync(struct inode *inode); |
2157 | extern void generic_delete_inode(struct inode *inode); | 2157 | extern void generic_delete_inode(struct inode *inode); |
2158 | extern void generic_drop_inode(struct inode *inode); | 2158 | extern void generic_drop_inode(struct inode *inode); |
2159 | extern int generic_detach_inode(struct inode *inode); | ||
2159 | 2160 | ||
2160 | extern struct inode *ilookup5_nowait(struct super_block *sb, | 2161 | extern struct inode *ilookup5_nowait(struct super_block *sb, |
2161 | unsigned long hashval, int (*test)(struct inode *, void *), | 2162 | unsigned long hashval, int (*test)(struct inode *, void *), |
@@ -2334,6 +2335,7 @@ extern void get_filesystem(struct file_system_type *fs); | |||
2334 | extern void put_filesystem(struct file_system_type *fs); | 2335 | extern void put_filesystem(struct file_system_type *fs); |
2335 | extern struct file_system_type *get_fs_type(const char *name); | 2336 | extern struct file_system_type *get_fs_type(const char *name); |
2336 | extern struct super_block *get_super(struct block_device *); | 2337 | extern struct super_block *get_super(struct block_device *); |
2338 | extern struct super_block *get_active_super(struct block_device *bdev); | ||
2337 | extern struct super_block *user_get_super(dev_t); | 2339 | extern struct super_block *user_get_super(dev_t); |
2338 | extern void drop_super(struct super_block *sb); | 2340 | extern void drop_super(struct super_block *sb); |
2339 | 2341 | ||
@@ -2381,7 +2383,8 @@ extern int buffer_migrate_page(struct address_space *, | |||
2381 | #define buffer_migrate_page NULL | 2383 | #define buffer_migrate_page NULL |
2382 | #endif | 2384 | #endif |
2383 | 2385 | ||
2384 | extern int inode_change_ok(struct inode *, struct iattr *); | 2386 | extern int inode_change_ok(const struct inode *, struct iattr *); |
2387 | extern int inode_newsize_ok(const struct inode *, loff_t offset); | ||
2385 | extern int __must_check inode_setattr(struct inode *, struct iattr *); | 2388 | extern int __must_check inode_setattr(struct inode *, struct iattr *); |
2386 | 2389 | ||
2387 | extern void file_update_time(struct file *file); | 2390 | extern void file_update_time(struct file *file); |
@@ -2467,7 +2470,7 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf, | |||
2467 | size_t len, loff_t *ppos); | 2470 | size_t len, loff_t *ppos); |
2468 | 2471 | ||
2469 | struct ctl_table; | 2472 | struct ctl_table; |
2470 | int proc_nr_files(struct ctl_table *table, int write, struct file *filp, | 2473 | int proc_nr_files(struct ctl_table *table, int write, |
2471 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2474 | void __user *buffer, size_t *lenp, loff_t *ppos); |
2472 | 2475 | ||
2473 | int __init get_filesystem_list(char *buf); | 2476 | int __init get_filesystem_list(char *buf); |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 3c0924a18daf..cd3d2abaf30a 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -19,7 +19,7 @@ | |||
19 | extern int ftrace_enabled; | 19 | extern int ftrace_enabled; |
20 | extern int | 20 | extern int |
21 | ftrace_enable_sysctl(struct ctl_table *table, int write, | 21 | ftrace_enable_sysctl(struct ctl_table *table, int write, |
22 | struct file *filp, void __user *buffer, size_t *lenp, | 22 | void __user *buffer, size_t *lenp, |
23 | loff_t *ppos); | 23 | loff_t *ppos); |
24 | 24 | ||
25 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); | 25 | typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); |
@@ -94,7 +94,7 @@ static inline void ftrace_start(void) { } | |||
94 | extern int stack_tracer_enabled; | 94 | extern int stack_tracer_enabled; |
95 | int | 95 | int |
96 | stack_trace_sysctl(struct ctl_table *table, int write, | 96 | stack_trace_sysctl(struct ctl_table *table, int write, |
97 | struct file *file, void __user *buffer, size_t *lenp, | 97 | void __user *buffer, size_t *lenp, |
98 | loff_t *ppos); | 98 | loff_t *ppos); |
99 | #endif | 99 | #endif |
100 | 100 | ||
diff --git a/include/linux/futex.h b/include/linux/futex.h index 34956c8fdebf..8ec17997d94f 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -4,11 +4,6 @@ | |||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | 6 | ||
7 | struct inode; | ||
8 | struct mm_struct; | ||
9 | struct task_struct; | ||
10 | union ktime; | ||
11 | |||
12 | /* Second argument to futex syscall */ | 7 | /* Second argument to futex syscall */ |
13 | 8 | ||
14 | 9 | ||
@@ -129,6 +124,11 @@ struct robust_list_head { | |||
129 | #define FUTEX_BITSET_MATCH_ANY 0xffffffff | 124 | #define FUTEX_BITSET_MATCH_ANY 0xffffffff |
130 | 125 | ||
131 | #ifdef __KERNEL__ | 126 | #ifdef __KERNEL__ |
127 | struct inode; | ||
128 | struct mm_struct; | ||
129 | struct task_struct; | ||
130 | union ktime; | ||
131 | |||
132 | long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout, | 132 | long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout, |
133 | u32 __user *uaddr2, u32 val2, u32 val3); | 133 | u32 __user *uaddr2, u32 val2, u32 val3); |
134 | 134 | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 109d179adb93..297df45ffd0a 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -151,7 +151,7 @@ struct gendisk { | |||
151 | struct disk_part_tbl *part_tbl; | 151 | struct disk_part_tbl *part_tbl; |
152 | struct hd_struct part0; | 152 | struct hd_struct part0; |
153 | 153 | ||
154 | struct block_device_operations *fops; | 154 | const struct block_device_operations *fops; |
155 | struct request_queue *queue; | 155 | struct request_queue *queue; |
156 | void *private_data; | 156 | void *private_data; |
157 | 157 | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 7c777a0da17a..557bdad320b6 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -220,7 +220,7 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
220 | ((1 << ZONES_SHIFT) - 1); | 220 | ((1 << ZONES_SHIFT) - 1); |
221 | 221 | ||
222 | if (__builtin_constant_p(bit)) | 222 | if (__builtin_constant_p(bit)) |
223 | BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | 223 | MAYBE_BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); |
224 | else { | 224 | else { |
225 | #ifdef CONFIG_DEBUG_VM | 225 | #ifdef CONFIG_DEBUG_VM |
226 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); | 226 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); |
@@ -326,7 +326,6 @@ void free_pages_exact(void *virt, size_t size); | |||
326 | extern void __free_pages(struct page *page, unsigned int order); | 326 | extern void __free_pages(struct page *page, unsigned int order); |
327 | extern void free_pages(unsigned long addr, unsigned int order); | 327 | extern void free_pages(unsigned long addr, unsigned int order); |
328 | extern void free_hot_page(struct page *page); | 328 | extern void free_hot_page(struct page *page); |
329 | extern void free_cold_page(struct page *page); | ||
330 | 329 | ||
331 | #define __free_page(page) __free_pages((page), 0) | 330 | #define __free_page(page) __free_pages((page), 0) |
332 | #define free_page(addr) free_pages((addr),0) | 331 | #define free_page(addr) free_pages((addr),0) |
@@ -336,18 +335,6 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); | |||
336 | void drain_all_pages(void); | 335 | void drain_all_pages(void); |
337 | void drain_local_pages(void *dummy); | 336 | void drain_local_pages(void *dummy); |
338 | 337 | ||
339 | extern bool oom_killer_disabled; | ||
340 | |||
341 | static inline void oom_killer_disable(void) | ||
342 | { | ||
343 | oom_killer_disabled = true; | ||
344 | } | ||
345 | |||
346 | static inline void oom_killer_enable(void) | ||
347 | { | ||
348 | oom_killer_disabled = false; | ||
349 | } | ||
350 | |||
351 | extern gfp_t gfp_allowed_mask; | 338 | extern gfp_t gfp_allowed_mask; |
352 | 339 | ||
353 | static inline void set_gfp_allowed_mask(gfp_t mask) | 340 | static inline void set_gfp_allowed_mask(gfp_t mask) |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index e10c49a5b96e..059bd189d35d 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | 14 | ||
15 | struct device; | ||
16 | |||
15 | /* | 17 | /* |
16 | * Some platforms don't support the GPIO programming interface. | 18 | * Some platforms don't support the GPIO programming interface. |
17 | * | 19 | * |
@@ -89,6 +91,15 @@ static inline int gpio_export(unsigned gpio, bool direction_may_change) | |||
89 | return -EINVAL; | 91 | return -EINVAL; |
90 | } | 92 | } |
91 | 93 | ||
94 | static inline int gpio_export_link(struct device *dev, const char *name, | ||
95 | unsigned gpio) | ||
96 | { | ||
97 | /* GPIO can never have been exported */ | ||
98 | WARN_ON(1); | ||
99 | return -EINVAL; | ||
100 | } | ||
101 | |||
102 | |||
92 | static inline void gpio_unexport(unsigned gpio) | 103 | static inline void gpio_unexport(unsigned gpio) |
93 | { | 104 | { |
94 | /* GPIO can never have been exported */ | 105 | /* GPIO can never have been exported */ |
diff --git a/include/linux/hid.h b/include/linux/hid.h index a0ebdace7baa..10f628416740 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -494,6 +494,7 @@ struct hid_device { /* device report descriptor */ | |||
494 | 494 | ||
495 | /* hiddev event handler */ | 495 | /* hiddev event handler */ |
496 | int (*hiddev_connect)(struct hid_device *, unsigned int); | 496 | int (*hiddev_connect)(struct hid_device *, unsigned int); |
497 | void (*hiddev_disconnect)(struct hid_device *); | ||
497 | void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, | 498 | void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, |
498 | struct hid_usage *, __s32); | 499 | struct hid_usage *, __s32); |
499 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); | 500 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); |
@@ -691,6 +692,7 @@ struct hid_device *hid_allocate_device(void); | |||
691 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); | 692 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); |
692 | int hid_check_keys_pressed(struct hid_device *hid); | 693 | int hid_check_keys_pressed(struct hid_device *hid); |
693 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); | 694 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); |
695 | void hid_disconnect(struct hid_device *hid); | ||
694 | 696 | ||
695 | /** | 697 | /** |
696 | * hid_map_usage - map usage input bits | 698 | * hid_map_usage - map usage input bits |
@@ -800,6 +802,7 @@ static inline int __must_check hid_hw_start(struct hid_device *hdev, | |||
800 | */ | 802 | */ |
801 | static inline void hid_hw_stop(struct hid_device *hdev) | 803 | static inline void hid_hw_stop(struct hid_device *hdev) |
802 | { | 804 | { |
805 | hid_disconnect(hdev); | ||
803 | hdev->ll_driver->stop(hdev); | 806 | hdev->ll_driver->stop(hdev); |
804 | } | 807 | } |
805 | 808 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 5cbc620bdfe0..16937995abd4 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -3,15 +3,15 @@ | |||
3 | 3 | ||
4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
5 | 5 | ||
6 | struct ctl_table; | ||
7 | struct user_struct; | ||
8 | |||
6 | #ifdef CONFIG_HUGETLB_PAGE | 9 | #ifdef CONFIG_HUGETLB_PAGE |
7 | 10 | ||
8 | #include <linux/mempolicy.h> | 11 | #include <linux/mempolicy.h> |
9 | #include <linux/shm.h> | 12 | #include <linux/shm.h> |
10 | #include <asm/tlbflush.h> | 13 | #include <asm/tlbflush.h> |
11 | 14 | ||
12 | struct ctl_table; | ||
13 | struct user_struct; | ||
14 | |||
15 | int PageHuge(struct page *page); | 15 | int PageHuge(struct page *page); |
16 | 16 | ||
17 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 17 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
@@ -20,11 +20,13 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
20 | } | 20 | } |
21 | 21 | ||
22 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 22 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); |
23 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 23 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
24 | int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 24 | int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
26 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 26 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
27 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); | 27 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, |
28 | struct page **, struct vm_area_struct **, | ||
29 | unsigned long *, int *, int, unsigned int flags); | ||
28 | void unmap_hugepage_range(struct vm_area_struct *, | 30 | void unmap_hugepage_range(struct vm_area_struct *, |
29 | unsigned long, unsigned long, struct page *); | 31 | unsigned long, unsigned long, struct page *); |
30 | void __unmap_hugepage_range(struct vm_area_struct *, | 32 | void __unmap_hugepage_range(struct vm_area_struct *, |
@@ -110,6 +112,21 @@ static inline void hugetlb_report_meminfo(struct seq_file *m) | |||
110 | 112 | ||
111 | #endif /* !CONFIG_HUGETLB_PAGE */ | 113 | #endif /* !CONFIG_HUGETLB_PAGE */ |
112 | 114 | ||
115 | #define HUGETLB_ANON_FILE "anon_hugepage" | ||
116 | |||
117 | enum { | ||
118 | /* | ||
119 | * The file will be used as an shm file so shmfs accounting rules | ||
120 | * apply | ||
121 | */ | ||
122 | HUGETLB_SHMFS_INODE = 1, | ||
123 | /* | ||
124 | * The file is being created on the internal vfs mount and shmfs | ||
125 | * accounting rules do not apply | ||
126 | */ | ||
127 | HUGETLB_ANONHUGE_INODE = 2, | ||
128 | }; | ||
129 | |||
113 | #ifdef CONFIG_HUGETLBFS | 130 | #ifdef CONFIG_HUGETLBFS |
114 | struct hugetlbfs_config { | 131 | struct hugetlbfs_config { |
115 | uid_t uid; | 132 | uid_t uid; |
@@ -148,7 +165,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
148 | extern const struct file_operations hugetlbfs_file_operations; | 165 | extern const struct file_operations hugetlbfs_file_operations; |
149 | extern struct vm_operations_struct hugetlb_vm_ops; | 166 | extern struct vm_operations_struct hugetlb_vm_ops; |
150 | struct file *hugetlb_file_setup(const char *name, size_t size, int acct, | 167 | struct file *hugetlb_file_setup(const char *name, size_t size, int acct, |
151 | struct user_struct **user); | 168 | struct user_struct **user, int creat_flags); |
152 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 169 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
153 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 170 | void hugetlb_put_quota(struct address_space *mapping, long delta); |
154 | 171 | ||
@@ -170,7 +187,11 @@ static inline void set_file_hugepages(struct file *file) | |||
170 | 187 | ||
171 | #define is_file_hugepages(file) 0 | 188 | #define is_file_hugepages(file) 0 |
172 | #define set_file_hugepages(file) BUG() | 189 | #define set_file_hugepages(file) BUG() |
173 | #define hugetlb_file_setup(name,size,acct,user) ERR_PTR(-ENOSYS) | 190 | static inline struct file *hugetlb_file_setup(const char *name, size_t size, |
191 | int acctflag, struct user_struct **user, int creat_flags) | ||
192 | { | ||
193 | return ERR_PTR(-ENOSYS); | ||
194 | } | ||
174 | 195 | ||
175 | #endif /* !CONFIG_HUGETLBFS */ | 196 | #endif /* !CONFIG_HUGETLBFS */ |
176 | 197 | ||
@@ -185,7 +206,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, | |||
185 | #define HSTATE_NAME_LEN 32 | 206 | #define HSTATE_NAME_LEN 32 |
186 | /* Defines one hugetlb page size */ | 207 | /* Defines one hugetlb page size */ |
187 | struct hstate { | 208 | struct hstate { |
188 | int hugetlb_next_nid; | 209 | int next_nid_to_alloc; |
210 | int next_nid_to_free; | ||
189 | unsigned int order; | 211 | unsigned int order; |
190 | unsigned long mask; | 212 | unsigned long mask; |
191 | unsigned long max_huge_pages; | 213 | unsigned long max_huge_pages; |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index c9087de5c6c6..e844a0b18695 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -28,17 +28,6 @@ | |||
28 | identify a legacy client. If you don't need them, just don't set them. */ | 28 | identify a legacy client. If you don't need them, just don't set them. */ |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * ---- Driver types ----------------------------------------------------- | ||
32 | */ | ||
33 | |||
34 | #define I2C_DRIVERID_MSP3400 1 | ||
35 | #define I2C_DRIVERID_TUNER 2 | ||
36 | #define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ | ||
37 | #define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ | ||
38 | #define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ | ||
39 | #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ | ||
40 | |||
41 | /* | ||
42 | * ---- Adapter types ---------------------------------------------------- | 31 | * ---- Adapter types ---------------------------------------------------- |
43 | */ | 32 | */ |
44 | 33 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index f4784c0fe975..57d41b0abce2 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -98,7 +98,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
98 | 98 | ||
99 | /** | 99 | /** |
100 | * struct i2c_driver - represent an I2C device driver | 100 | * struct i2c_driver - represent an I2C device driver |
101 | * @id: Unique driver ID (optional) | ||
102 | * @class: What kind of i2c device we instantiate (for detect) | 101 | * @class: What kind of i2c device we instantiate (for detect) |
103 | * @attach_adapter: Callback for bus addition (for legacy drivers) | 102 | * @attach_adapter: Callback for bus addition (for legacy drivers) |
104 | * @detach_adapter: Callback for bus removal (for legacy drivers) | 103 | * @detach_adapter: Callback for bus removal (for legacy drivers) |
@@ -135,7 +134,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
135 | * not allowed. | 134 | * not allowed. |
136 | */ | 135 | */ |
137 | struct i2c_driver { | 136 | struct i2c_driver { |
138 | int id; | ||
139 | unsigned int class; | 137 | unsigned int class; |
140 | 138 | ||
141 | /* Notifies the driver that a new bus has appeared or is about to be | 139 | /* Notifies the driver that a new bus has appeared or is about to be |
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h new file mode 100644 index 000000000000..fc5db826b48e --- /dev/null +++ b/include/linux/i2c/adp5588.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller | ||
3 | * | ||
4 | * Copyright 2009 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2 or later. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ADP5588_H | ||
10 | #define _ADP5588_H | ||
11 | |||
12 | #define DEV_ID 0x00 /* Device ID */ | ||
13 | #define CFG 0x01 /* Configuration Register1 */ | ||
14 | #define INT_STAT 0x02 /* Interrupt Status Register */ | ||
15 | #define KEY_LCK_EC_STAT 0x03 /* Key Lock and Event Counter Register */ | ||
16 | #define Key_EVENTA 0x04 /* Key Event Register A */ | ||
17 | #define Key_EVENTB 0x05 /* Key Event Register B */ | ||
18 | #define Key_EVENTC 0x06 /* Key Event Register C */ | ||
19 | #define Key_EVENTD 0x07 /* Key Event Register D */ | ||
20 | #define Key_EVENTE 0x08 /* Key Event Register E */ | ||
21 | #define Key_EVENTF 0x09 /* Key Event Register F */ | ||
22 | #define Key_EVENTG 0x0A /* Key Event Register G */ | ||
23 | #define Key_EVENTH 0x0B /* Key Event Register H */ | ||
24 | #define Key_EVENTI 0x0C /* Key Event Register I */ | ||
25 | #define Key_EVENTJ 0x0D /* Key Event Register J */ | ||
26 | #define KP_LCK_TMR 0x0E /* Keypad Lock1 to Lock2 Timer */ | ||
27 | #define UNLOCK1 0x0F /* Unlock Key1 */ | ||
28 | #define UNLOCK2 0x10 /* Unlock Key2 */ | ||
29 | #define GPIO_INT_STAT1 0x11 /* GPIO Interrupt Status */ | ||
30 | #define GPIO_INT_STAT2 0x12 /* GPIO Interrupt Status */ | ||
31 | #define GPIO_INT_STAT3 0x13 /* GPIO Interrupt Status */ | ||
32 | #define GPIO_DAT_STAT1 0x14 /* GPIO Data Status, Read twice to clear */ | ||
33 | #define GPIO_DAT_STAT2 0x15 /* GPIO Data Status, Read twice to clear */ | ||
34 | #define GPIO_DAT_STAT3 0x16 /* GPIO Data Status, Read twice to clear */ | ||
35 | #define GPIO_DAT_OUT1 0x17 /* GPIO DATA OUT */ | ||
36 | #define GPIO_DAT_OUT2 0x18 /* GPIO DATA OUT */ | ||
37 | #define GPIO_DAT_OUT3 0x19 /* GPIO DATA OUT */ | ||
38 | #define GPIO_INT_EN1 0x1A /* GPIO Interrupt Enable */ | ||
39 | #define GPIO_INT_EN2 0x1B /* GPIO Interrupt Enable */ | ||
40 | #define GPIO_INT_EN3 0x1C /* GPIO Interrupt Enable */ | ||
41 | #define KP_GPIO1 0x1D /* Keypad or GPIO Selection */ | ||
42 | #define KP_GPIO2 0x1E /* Keypad or GPIO Selection */ | ||
43 | #define KP_GPIO3 0x1F /* Keypad or GPIO Selection */ | ||
44 | #define GPI_EM1 0x20 /* GPI Event Mode 1 */ | ||
45 | #define GPI_EM2 0x21 /* GPI Event Mode 2 */ | ||
46 | #define GPI_EM3 0x22 /* GPI Event Mode 3 */ | ||
47 | #define GPIO_DIR1 0x23 /* GPIO Data Direction */ | ||
48 | #define GPIO_DIR2 0x24 /* GPIO Data Direction */ | ||
49 | #define GPIO_DIR3 0x25 /* GPIO Data Direction */ | ||
50 | #define GPIO_INT_LVL1 0x26 /* GPIO Edge/Level Detect */ | ||
51 | #define GPIO_INT_LVL2 0x27 /* GPIO Edge/Level Detect */ | ||
52 | #define GPIO_INT_LVL3 0x28 /* GPIO Edge/Level Detect */ | ||
53 | #define Debounce_DIS1 0x29 /* Debounce Disable */ | ||
54 | #define Debounce_DIS2 0x2A /* Debounce Disable */ | ||
55 | #define Debounce_DIS3 0x2B /* Debounce Disable */ | ||
56 | #define GPIO_PULL1 0x2C /* GPIO Pull Disable */ | ||
57 | #define GPIO_PULL2 0x2D /* GPIO Pull Disable */ | ||
58 | #define GPIO_PULL3 0x2E /* GPIO Pull Disable */ | ||
59 | #define CMP_CFG_STAT 0x30 /* Comparator Configuration and Status Register */ | ||
60 | #define CMP_CONFG_SENS1 0x31 /* Sensor1 Comparator Configuration Register */ | ||
61 | #define CMP_CONFG_SENS2 0x32 /* L2 Light Sensor Reference Level, Output Falling for Sensor 1 */ | ||
62 | #define CMP1_LVL2_TRIP 0x33 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 1 */ | ||
63 | #define CMP1_LVL2_HYS 0x34 /* L3 Light Sensor Reference Level, Output Falling For Sensor 1 */ | ||
64 | #define CMP1_LVL3_TRIP 0x35 /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 1 */ | ||
65 | #define CMP1_LVL3_HYS 0x36 /* Sensor 2 Comparator Configuration Register */ | ||
66 | #define CMP2_LVL2_TRIP 0x37 /* L2 Light Sensor Reference Level, Output Falling for Sensor 2 */ | ||
67 | #define CMP2_LVL2_HYS 0x38 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 2 */ | ||
68 | #define CMP2_LVL3_TRIP 0x39 /* L3 Light Sensor Reference Level, Output Falling For Sensor 2 */ | ||
69 | #define CMP2_LVL3_HYS 0x3A /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 2 */ | ||
70 | #define CMP1_ADC_DAT_R1 0x3B /* Comparator 1 ADC data Register1 */ | ||
71 | #define CMP1_ADC_DAT_R2 0x3C /* Comparator 1 ADC data Register2 */ | ||
72 | #define CMP2_ADC_DAT_R1 0x3D /* Comparator 2 ADC data Register1 */ | ||
73 | #define CMP2_ADC_DAT_R2 0x3E /* Comparator 2 ADC data Register2 */ | ||
74 | |||
75 | #define ADP5588_DEVICE_ID_MASK 0xF | ||
76 | |||
77 | /* Put one of these structures in i2c_board_info platform_data */ | ||
78 | |||
79 | #define ADP5588_KEYMAPSIZE 80 | ||
80 | |||
81 | struct adp5588_kpad_platform_data { | ||
82 | int rows; /* Number of rows */ | ||
83 | int cols; /* Number of columns */ | ||
84 | const unsigned short *keymap; /* Pointer to keymap */ | ||
85 | unsigned short keymapsize; /* Keymap size */ | ||
86 | unsigned repeat:1; /* Enable key repeat */ | ||
87 | unsigned en_keylock:1; /* Enable Key Lock feature */ | ||
88 | unsigned short unlock_key1; /* Unlock Key 1 */ | ||
89 | unsigned short unlock_key2; /* Unlock Key 2 */ | ||
90 | }; | ||
91 | |||
92 | #endif | ||
diff --git a/include/linux/i2c/mcs5000_ts.h b/include/linux/i2c/mcs5000_ts.h new file mode 100644 index 000000000000..5a117b5ca15e --- /dev/null +++ b/include/linux/i2c/mcs5000_ts.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * mcs5000_ts.h | ||
3 | * | ||
4 | * Copyright (C) 2009 Samsung Electronics Co.Ltd | ||
5 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __LINUX_MCS5000_TS_H | ||
15 | #define __LINUX_MCS5000_TS_H | ||
16 | |||
17 | /* platform data for the MELFAS MCS-5000 touchscreen driver */ | ||
18 | struct mcs5000_ts_platform_data { | ||
19 | void (*cfg_pin)(void); | ||
20 | int x_size; | ||
21 | int y_size; | ||
22 | }; | ||
23 | |||
24 | #endif /* __LINUX_MCS5000_TS_H */ | ||
diff --git a/include/linux/i8042.h b/include/linux/i8042.h index 7907a72403ee..60c3360ef6ad 100644 --- a/include/linux/i8042.h +++ b/include/linux/i8042.h | |||
@@ -7,6 +7,7 @@ | |||
7 | * the Free Software Foundation. | 7 | * the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/types.h> | ||
10 | 11 | ||
11 | /* | 12 | /* |
12 | * Standard commands. | 13 | * Standard commands. |
@@ -30,6 +31,35 @@ | |||
30 | #define I8042_CMD_MUX_PFX 0x0090 | 31 | #define I8042_CMD_MUX_PFX 0x0090 |
31 | #define I8042_CMD_MUX_SEND 0x1090 | 32 | #define I8042_CMD_MUX_SEND 0x1090 |
32 | 33 | ||
34 | struct serio; | ||
35 | |||
36 | #if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE) | ||
37 | |||
38 | void i8042_lock_chip(void); | ||
39 | void i8042_unlock_chip(void); | ||
33 | int i8042_command(unsigned char *param, int command); | 40 | int i8042_command(unsigned char *param, int command); |
41 | bool i8042_check_port_owner(const struct serio *); | ||
42 | |||
43 | #else | ||
44 | |||
45 | void i8042_lock_chip(void) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | void i8042_unlock_chip(void) | ||
50 | { | ||
51 | } | ||
52 | |||
53 | int i8042_command(unsigned char *param, int command) | ||
54 | { | ||
55 | return -ENOSYS; | ||
56 | } | ||
57 | |||
58 | bool i8042_check_port_owner(const struct serio *serio) | ||
59 | { | ||
60 | return false; | ||
61 | } | ||
62 | |||
63 | #endif | ||
34 | 64 | ||
35 | #endif | 65 | #endif |
diff --git a/include/linux/input.h b/include/linux/input.h index 8b3bc3e0d146..0ccfc30cd40f 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -1123,7 +1123,7 @@ struct input_dev { | |||
1123 | struct mutex mutex; | 1123 | struct mutex mutex; |
1124 | 1124 | ||
1125 | unsigned int users; | 1125 | unsigned int users; |
1126 | int going_away; | 1126 | bool going_away; |
1127 | 1127 | ||
1128 | struct device dev; | 1128 | struct device dev; |
1129 | 1129 | ||
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 482dc91fd53a..4f0a72a9740c 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
@@ -360,4 +360,6 @@ extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, | |||
360 | 360 | ||
361 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | 361 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); |
362 | 362 | ||
363 | extern int dmar_ir_support(void); | ||
364 | |||
363 | #endif | 365 | #endif |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 8e9e151f811e..b78cf8194957 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -84,7 +84,6 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
84 | * struct irqaction - per interrupt action descriptor | 84 | * struct irqaction - per interrupt action descriptor |
85 | * @handler: interrupt handler function | 85 | * @handler: interrupt handler function |
86 | * @flags: flags (see IRQF_* above) | 86 | * @flags: flags (see IRQF_* above) |
87 | * @mask: no comment as it is useless and about to be removed | ||
88 | * @name: name of the device | 87 | * @name: name of the device |
89 | * @dev_id: cookie to identify the device | 88 | * @dev_id: cookie to identify the device |
90 | * @next: pointer to the next irqaction for shared interrupts | 89 | * @next: pointer to the next irqaction for shared interrupts |
@@ -97,7 +96,6 @@ typedef irqreturn_t (*irq_handler_t)(int, void *); | |||
97 | struct irqaction { | 96 | struct irqaction { |
98 | irq_handler_t handler; | 97 | irq_handler_t handler; |
99 | unsigned long flags; | 98 | unsigned long flags; |
100 | cpumask_t mask; | ||
101 | const char *name; | 99 | const char *name; |
102 | void *dev_id; | 100 | void *dev_id; |
103 | struct irqaction *next; | 101 | struct irqaction *next; |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 786e7b8cece9..83aa81297ea3 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -184,5 +184,9 @@ extern void __devm_release_region(struct device *dev, struct resource *parent, | |||
184 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); | 184 | extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size); |
185 | extern int iomem_is_exclusive(u64 addr); | 185 | extern int iomem_is_exclusive(u64 addr); |
186 | 186 | ||
187 | extern int | ||
188 | walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, | ||
189 | void *arg, int (*func)(unsigned long, unsigned long, void *)); | ||
190 | |||
187 | #endif /* __ASSEMBLY__ */ | 191 | #endif /* __ASSEMBLY__ */ |
188 | #endif /* _LINUX_IOPORT_H */ | 192 | #endif /* _LINUX_IOPORT_H */ |
diff --git a/include/linux/iova.h b/include/linux/iova.h index 228f6c94b69c..76a0759e88ec 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h | |||
@@ -28,7 +28,6 @@ struct iova { | |||
28 | 28 | ||
29 | /* holds all the iova translations for a domain */ | 29 | /* holds all the iova translations for a domain */ |
30 | struct iova_domain { | 30 | struct iova_domain { |
31 | spinlock_t iova_alloc_lock;/* Lock to protect iova allocation */ | ||
32 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ | 31 | spinlock_t iova_rbtree_lock; /* Lock to protect update of rbtree */ |
33 | struct rb_root rbroot; /* iova domain rbtree root */ | 32 | struct rb_root rbroot; /* iova domain rbtree root */ |
34 | struct rb_node *cached32_node; /* Save last alloced node */ | 33 | struct rb_node *cached32_node; /* Save last alloced node */ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index a1187a0c99b4..331530cd3cc6 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -556,7 +556,7 @@ struct transaction_s | |||
556 | * This transaction is being forced and some process is | 556 | * This transaction is being forced and some process is |
557 | * waiting for it to finish. | 557 | * waiting for it to finish. |
558 | */ | 558 | */ |
559 | int t_synchronous_commit:1; | 559 | unsigned int t_synchronous_commit:1; |
560 | }; | 560 | }; |
561 | 561 | ||
562 | /** | 562 | /** |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 2b5b1e0899a8..d3cd23f30039 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -146,7 +146,7 @@ extern int _cond_resched(void); | |||
146 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) | 146 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) |
147 | 147 | ||
148 | #define abs(x) ({ \ | 148 | #define abs(x) ({ \ |
149 | int __x = (x); \ | 149 | long __x = (x); \ |
150 | (__x < 0) ? -__x : __x; \ | 150 | (__x < 0) ? -__x : __x; \ |
151 | }) | 151 | }) |
152 | 152 | ||
@@ -246,14 +246,16 @@ extern int printk_ratelimit(void); | |||
246 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 246 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
247 | unsigned int interval_msec); | 247 | unsigned int interval_msec); |
248 | 248 | ||
249 | extern int printk_delay_msec; | ||
250 | |||
249 | /* | 251 | /* |
250 | * Print a one-time message (analogous to WARN_ONCE() et al): | 252 | * Print a one-time message (analogous to WARN_ONCE() et al): |
251 | */ | 253 | */ |
252 | #define printk_once(x...) ({ \ | 254 | #define printk_once(x...) ({ \ |
253 | static int __print_once = 1; \ | 255 | static bool __print_once = true; \ |
254 | \ | 256 | \ |
255 | if (__print_once) { \ | 257 | if (__print_once) { \ |
256 | __print_once = 0; \ | 258 | __print_once = false; \ |
257 | printk(x); \ | 259 | printk(x); \ |
258 | } \ | 260 | } \ |
259 | }) | 261 | }) |
@@ -676,13 +678,17 @@ struct sysinfo { | |||
676 | }; | 678 | }; |
677 | 679 | ||
678 | /* Force a compilation error if condition is true */ | 680 | /* Force a compilation error if condition is true */ |
679 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 681 | #define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition)) |
682 | |||
683 | /* Force a compilation error if condition is constant and true */ | ||
684 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) | ||
680 | 685 | ||
681 | /* Force a compilation error if condition is true, but also produce a | 686 | /* Force a compilation error if condition is true, but also produce a |
682 | result (of value 0 and type size_t), so the expression can be used | 687 | result (of value 0 and type size_t), so the expression can be used |
683 | e.g. in a structure initializer (or where-ever else comma expressions | 688 | e.g. in a structure initializer (or where-ever else comma expressions |
684 | aren't permitted). */ | 689 | aren't permitted). */ |
685 | #define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) | 690 | #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) |
691 | #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) | ||
686 | 692 | ||
687 | /* Trap pasters of __FUNCTION__ at compile-time */ | 693 | /* Trap pasters of __FUNCTION__ at compile-time */ |
688 | #define __FUNCTION__ (__func__) | 694 | #define __FUNCTION__ (__func__) |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index dc2fd545db00..e880d4cf9e22 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
@@ -144,10 +144,15 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | |||
144 | int name##_end[0]; | 144 | int name##_end[0]; |
145 | 145 | ||
146 | #define kmemcheck_annotate_bitfield(ptr, name) \ | 146 | #define kmemcheck_annotate_bitfield(ptr, name) \ |
147 | do if (ptr) { \ | 147 | do { \ |
148 | int _n = (long) &((ptr)->name##_end) \ | 148 | int _n; \ |
149 | \ | ||
150 | if (!ptr) \ | ||
151 | break; \ | ||
152 | \ | ||
153 | _n = (long) &((ptr)->name##_end) \ | ||
149 | - (long) &((ptr)->name##_begin); \ | 154 | - (long) &((ptr)->name##_begin); \ |
150 | BUILD_BUG_ON(_n < 0); \ | 155 | MAYBE_BUILD_BUG_ON(_n < 0); \ |
151 | \ | 156 | \ |
152 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | 157 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ |
153 | } while (0) | 158 | } while (0) |
diff --git a/include/linux/ksm.h b/include/linux/ksm.h new file mode 100644 index 000000000000..a485c14ecd5d --- /dev/null +++ b/include/linux/ksm.h | |||
@@ -0,0 +1,79 @@ | |||
1 | #ifndef __LINUX_KSM_H | ||
2 | #define __LINUX_KSM_H | ||
3 | /* | ||
4 | * Memory merging support. | ||
5 | * | ||
6 | * This code enables dynamic sharing of identical pages found in different | ||
7 | * memory areas, even if they are not shared by fork(). | ||
8 | */ | ||
9 | |||
10 | #include <linux/bitops.h> | ||
11 | #include <linux/mm.h> | ||
12 | #include <linux/sched.h> | ||
13 | #include <linux/vmstat.h> | ||
14 | |||
15 | #ifdef CONFIG_KSM | ||
16 | int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | ||
17 | unsigned long end, int advice, unsigned long *vm_flags); | ||
18 | int __ksm_enter(struct mm_struct *mm); | ||
19 | void __ksm_exit(struct mm_struct *mm); | ||
20 | |||
21 | static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm) | ||
22 | { | ||
23 | if (test_bit(MMF_VM_MERGEABLE, &oldmm->flags)) | ||
24 | return __ksm_enter(mm); | ||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | static inline void ksm_exit(struct mm_struct *mm) | ||
29 | { | ||
30 | if (test_bit(MMF_VM_MERGEABLE, &mm->flags)) | ||
31 | __ksm_exit(mm); | ||
32 | } | ||
33 | |||
34 | /* | ||
35 | * A KSM page is one of those write-protected "shared pages" or "merged pages" | ||
36 | * which KSM maps into multiple mms, wherever identical anonymous page content | ||
37 | * is found in VM_MERGEABLE vmas. It's a PageAnon page, with NULL anon_vma. | ||
38 | */ | ||
39 | static inline int PageKsm(struct page *page) | ||
40 | { | ||
41 | return ((unsigned long)page->mapping == PAGE_MAPPING_ANON); | ||
42 | } | ||
43 | |||
44 | /* | ||
45 | * But we have to avoid the checking which page_add_anon_rmap() performs. | ||
46 | */ | ||
47 | static inline void page_add_ksm_rmap(struct page *page) | ||
48 | { | ||
49 | if (atomic_inc_and_test(&page->_mapcount)) { | ||
50 | page->mapping = (void *) PAGE_MAPPING_ANON; | ||
51 | __inc_zone_page_state(page, NR_ANON_PAGES); | ||
52 | } | ||
53 | } | ||
54 | #else /* !CONFIG_KSM */ | ||
55 | |||
56 | static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | ||
57 | unsigned long end, int advice, unsigned long *vm_flags) | ||
58 | { | ||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm) | ||
63 | { | ||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | static inline void ksm_exit(struct mm_struct *mm) | ||
68 | { | ||
69 | } | ||
70 | |||
71 | static inline int PageKsm(struct page *page) | ||
72 | { | ||
73 | return 0; | ||
74 | } | ||
75 | |||
76 | /* No stub required for page_add_ksm_rmap(page) */ | ||
77 | #endif /* !CONFIG_KSM */ | ||
78 | |||
79 | #endif | ||
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index fcf5fbe6a50c..79603a6c356f 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
@@ -44,6 +44,8 @@ struct ps2dev { | |||
44 | void ps2_init(struct ps2dev *ps2dev, struct serio *serio); | 44 | void ps2_init(struct ps2dev *ps2dev, struct serio *serio); |
45 | int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); | 45 | int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); |
46 | void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout); | 46 | void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout); |
47 | void ps2_begin_command(struct ps2dev *ps2dev); | ||
48 | void ps2_end_command(struct ps2dev *ps2dev); | ||
47 | int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); | 49 | int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); |
48 | int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); | 50 | int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); |
49 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); | 51 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 691f59171c6c..5126cceb6ae9 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -57,6 +57,7 @@ | |||
57 | 57 | ||
58 | #ifdef __ASSEMBLY__ | 58 | #ifdef __ASSEMBLY__ |
59 | 59 | ||
60 | #ifndef LINKER_SCRIPT | ||
60 | #define ALIGN __ALIGN | 61 | #define ALIGN __ALIGN |
61 | #define ALIGN_STR __ALIGN_STR | 62 | #define ALIGN_STR __ALIGN_STR |
62 | 63 | ||
@@ -66,6 +67,7 @@ | |||
66 | ALIGN; \ | 67 | ALIGN; \ |
67 | name: | 68 | name: |
68 | #endif | 69 | #endif |
70 | #endif /* LINKER_SCRIPT */ | ||
69 | 71 | ||
70 | #ifndef WEAK | 72 | #ifndef WEAK |
71 | #define WEAK(name) \ | 73 | #define WEAK(name) \ |
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h index ad651f4e45ac..3cc2f2c53e4c 100644 --- a/include/linux/lis3lv02d.h +++ b/include/linux/lis3lv02d.h | |||
@@ -32,8 +32,17 @@ struct lis3lv02d_platform_data { | |||
32 | #define LIS3_IRQ2_DATA_READY (4 << 3) | 32 | #define LIS3_IRQ2_DATA_READY (4 << 3) |
33 | #define LIS3_IRQ2_CLICK (7 << 3) | 33 | #define LIS3_IRQ2_CLICK (7 << 3) |
34 | #define LIS3_IRQ_OPEN_DRAIN (1 << 6) | 34 | #define LIS3_IRQ_OPEN_DRAIN (1 << 6) |
35 | #define LIS3_IRQ_ACTIVE_HIGH (1 << 7) | 35 | #define LIS3_IRQ_ACTIVE_LOW (1 << 7) |
36 | unsigned char irq_cfg; | 36 | unsigned char irq_cfg; |
37 | |||
38 | #define LIS3_WAKEUP_X_LO (1 << 0) | ||
39 | #define LIS3_WAKEUP_X_HI (1 << 1) | ||
40 | #define LIS3_WAKEUP_Y_LO (1 << 2) | ||
41 | #define LIS3_WAKEUP_Y_HI (1 << 3) | ||
42 | #define LIS3_WAKEUP_Z_LO (1 << 4) | ||
43 | #define LIS3_WAKEUP_Z_HI (1 << 5) | ||
44 | unsigned char wakeup_flags; | ||
45 | unsigned char wakeup_thresh; | ||
37 | }; | 46 | }; |
38 | 47 | ||
39 | #endif /* __LIS3LV02D_H_ */ | 48 | #endif /* __LIS3LV02D_H_ */ |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index c325b187966b..a34dea46b629 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -338,49 +338,6 @@ static inline int nlm_privileged_requester(const struct svc_rqst *rqstp) | |||
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
341 | static inline int __nlm_cmp_addr4(const struct sockaddr *sap1, | ||
342 | const struct sockaddr *sap2) | ||
343 | { | ||
344 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
345 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
346 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | ||
347 | } | ||
348 | |||
349 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
350 | static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, | ||
351 | const struct sockaddr *sap2) | ||
352 | { | ||
353 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
354 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
355 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); | ||
356 | } | ||
357 | #else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
358 | static inline int __nlm_cmp_addr6(const struct sockaddr *sap1, | ||
359 | const struct sockaddr *sap2) | ||
360 | { | ||
361 | return 0; | ||
362 | } | ||
363 | #endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
364 | |||
365 | /* | ||
366 | * Compare two host addresses | ||
367 | * | ||
368 | * Return TRUE if the addresses are the same; otherwise FALSE. | ||
369 | */ | ||
370 | static inline int nlm_cmp_addr(const struct sockaddr *sap1, | ||
371 | const struct sockaddr *sap2) | ||
372 | { | ||
373 | if (sap1->sa_family == sap2->sa_family) { | ||
374 | switch (sap1->sa_family) { | ||
375 | case AF_INET: | ||
376 | return __nlm_cmp_addr4(sap1, sap2); | ||
377 | case AF_INET6: | ||
378 | return __nlm_cmp_addr6(sap1, sap2); | ||
379 | } | ||
380 | } | ||
381 | return 0; | ||
382 | } | ||
383 | |||
384 | /* | 341 | /* |
385 | * Compare two NLM locks. | 342 | * Compare two NLM locks. |
386 | * When the second lock is of type F_UNLCK, this acts like a wildcard. | 343 | * When the second lock is of type F_UNLCK, this acts like a wildcard. |
@@ -395,7 +352,7 @@ static inline int nlm_compare_locks(const struct file_lock *fl1, | |||
395 | &&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK); | 352 | &&(fl1->fl_type == fl2->fl_type || fl2->fl_type == F_UNLCK); |
396 | } | 353 | } |
397 | 354 | ||
398 | extern struct lock_manager_operations nlmsvc_lock_operations; | 355 | extern const struct lock_manager_operations nlmsvc_lock_operations; |
399 | 356 | ||
400 | #endif /* __KERNEL__ */ | 357 | #endif /* __KERNEL__ */ |
401 | 358 | ||
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h index 536ca12442ca..78c3bed1c3f5 100644 --- a/include/linux/mISDNif.h +++ b/include/linux/mISDNif.h | |||
@@ -104,7 +104,7 @@ | |||
104 | #define DL_UNITDATA_IND 0x3108 | 104 | #define DL_UNITDATA_IND 0x3108 |
105 | #define DL_INFORMATION_IND 0x0008 | 105 | #define DL_INFORMATION_IND 0x0008 |
106 | 106 | ||
107 | /* intern layer 2 managment */ | 107 | /* intern layer 2 management */ |
108 | #define MDL_ASSIGN_REQ 0x1804 | 108 | #define MDL_ASSIGN_REQ 0x1804 |
109 | #define MDL_ASSIGN_IND 0x1904 | 109 | #define MDL_ASSIGN_IND 0x1904 |
110 | #define MDL_REMOVE_REQ 0x1A04 | 110 | #define MDL_REMOVE_REQ 0x1A04 |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 1923327b9869..76285e01b39e 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -12,7 +12,9 @@ | |||
12 | #define SYSFS_MAGIC 0x62656572 | 12 | #define SYSFS_MAGIC 0x62656572 |
13 | #define SECURITYFS_MAGIC 0x73636673 | 13 | #define SECURITYFS_MAGIC 0x73636673 |
14 | #define SELINUX_MAGIC 0xf97cff8c | 14 | #define SELINUX_MAGIC 0xf97cff8c |
15 | #define RAMFS_MAGIC 0x858458f6 /* some random number */ | ||
15 | #define TMPFS_MAGIC 0x01021994 | 16 | #define TMPFS_MAGIC 0x01021994 |
17 | #define HUGETLBFS_MAGIC 0x958458f6 /* some random number */ | ||
16 | #define SQUASHFS_MAGIC 0x73717368 | 18 | #define SQUASHFS_MAGIC 0x73717368 |
17 | #define EFS_SUPER_MAGIC 0x414A53 | 19 | #define EFS_SUPER_MAGIC 0x414A53 |
18 | #define EXT2_SUPER_MAGIC 0xEF53 | 20 | #define EXT2_SUPER_MAGIC 0xEF53 |
@@ -53,4 +55,8 @@ | |||
53 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA | 55 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA |
54 | 56 | ||
55 | #define STACK_END_MAGIC 0x57AC6E9D | 57 | #define STACK_END_MAGIC 0x57AC6E9D |
58 | |||
59 | #define DEVPTS_SUPER_MAGIC 0x1cd1 | ||
60 | #define SOCKFS_MAGIC 0x534F434B | ||
61 | |||
56 | #endif /* __LINUX_MAGIC_H__ */ | 62 | #endif /* __LINUX_MAGIC_H__ */ |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e46a0734ab6e..bf9213b2db8f 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -118,6 +118,9 @@ static inline bool mem_cgroup_disabled(void) | |||
118 | 118 | ||
119 | extern bool mem_cgroup_oom_called(struct task_struct *task); | 119 | extern bool mem_cgroup_oom_called(struct task_struct *task); |
120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); | 120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); |
121 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | ||
122 | gfp_t gfp_mask, int nid, | ||
123 | int zid); | ||
121 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 124 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
122 | struct mem_cgroup; | 125 | struct mem_cgroup; |
123 | 126 | ||
@@ -276,6 +279,13 @@ static inline void mem_cgroup_update_mapped_file_stat(struct page *page, | |||
276 | { | 279 | { |
277 | } | 280 | } |
278 | 281 | ||
282 | static inline | ||
283 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | ||
284 | gfp_t gfp_mask, int nid, int zid) | ||
285 | { | ||
286 | return 0; | ||
287 | } | ||
288 | |||
279 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 289 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
280 | 290 | ||
281 | #endif /* _LINUX_MEMCONTROL_H */ | 291 | #endif /* _LINUX_MEMCONTROL_H */ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index d95f72e79b82..fed969281a41 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -191,14 +191,6 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | |||
191 | 191 | ||
192 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ | 192 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ |
193 | 193 | ||
194 | /* | ||
195 | * Walk through all memory which is registered as resource. | ||
196 | * arg is (start_pfn, nr_pages, private_arg_pointer) | ||
197 | */ | ||
198 | extern int walk_memory_resource(unsigned long start_pfn, | ||
199 | unsigned long nr_pages, void *arg, | ||
200 | int (*func)(unsigned long, unsigned long, void *)); | ||
201 | |||
202 | #ifdef CONFIG_MEMORY_HOTREMOVE | 194 | #ifdef CONFIG_MEMORY_HOTREMOVE |
203 | 195 | ||
204 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); | 196 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); |
diff --git a/include/linux/mempool.h b/include/linux/mempool.h index 9be484d11283..7c08052e3321 100644 --- a/include/linux/mempool.h +++ b/include/linux/mempool.h | |||
@@ -47,22 +47,16 @@ mempool_create_slab_pool(int min_nr, struct kmem_cache *kc) | |||
47 | } | 47 | } |
48 | 48 | ||
49 | /* | 49 | /* |
50 | * 2 mempool_alloc_t's and a mempool_free_t to kmalloc/kzalloc and kfree | 50 | * a mempool_alloc_t and a mempool_free_t to kmalloc and kfree the |
51 | * the amount of memory specified by pool_data | 51 | * amount of memory specified by pool_data |
52 | */ | 52 | */ |
53 | void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data); | 53 | void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data); |
54 | void *mempool_kzalloc(gfp_t gfp_mask, void *pool_data); | ||
55 | void mempool_kfree(void *element, void *pool_data); | 54 | void mempool_kfree(void *element, void *pool_data); |
56 | static inline mempool_t *mempool_create_kmalloc_pool(int min_nr, size_t size) | 55 | static inline mempool_t *mempool_create_kmalloc_pool(int min_nr, size_t size) |
57 | { | 56 | { |
58 | return mempool_create(min_nr, mempool_kmalloc, mempool_kfree, | 57 | return mempool_create(min_nr, mempool_kmalloc, mempool_kfree, |
59 | (void *) size); | 58 | (void *) size); |
60 | } | 59 | } |
61 | static inline mempool_t *mempool_create_kzalloc_pool(int min_nr, size_t size) | ||
62 | { | ||
63 | return mempool_create(min_nr, mempool_kzalloc, mempool_kfree, | ||
64 | (void *) size); | ||
65 | } | ||
66 | 60 | ||
67 | /* | 61 | /* |
68 | * A mempool_alloc_t and mempool_free_t for a simple page allocator that | 62 | * A mempool_alloc_t and mempool_free_t for a simple page allocator that |
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h index 115dbe965082..c63b65c94429 100644 --- a/include/linux/mfd/da903x.h +++ b/include/linux/mfd/da903x.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __LINUX_PMIC_DA903X_H | 1 | #ifndef __LINUX_PMIC_DA903X_H |
2 | #define __LINUX_PMIC_DA903X_H | 2 | #define __LINUX_PMIC_DA903X_H |
3 | 3 | ||
4 | /* Unified sub device IDs for DA9030/DA9034 */ | 4 | /* Unified sub device IDs for DA9030/DA9034/DA9035 */ |
5 | enum { | 5 | enum { |
6 | DA9030_ID_LED_1, | 6 | DA9030_ID_LED_1, |
7 | DA9030_ID_LED_2, | 7 | DA9030_ID_LED_2, |
@@ -57,6 +57,8 @@ enum { | |||
57 | DA9034_ID_LDO13, | 57 | DA9034_ID_LDO13, |
58 | DA9034_ID_LDO14, | 58 | DA9034_ID_LDO14, |
59 | DA9034_ID_LDO15, | 59 | DA9034_ID_LDO15, |
60 | |||
61 | DA9035_ID_BUCK3, | ||
60 | }; | 62 | }; |
61 | 63 | ||
62 | /* | 64 | /* |
diff --git a/include/linux/mfd/wm831x/pmu.h b/include/linux/mfd/wm831x/pmu.h new file mode 100644 index 000000000000..b18cbb027bc3 --- /dev/null +++ b/include/linux/mfd/wm831x/pmu.h | |||
@@ -0,0 +1,189 @@ | |||
1 | /* | ||
2 | * include/linux/mfd/wm831x/pmu.h -- PMU for WM831x | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics PLC. | ||
5 | * | ||
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __MFD_WM831X_PMU_H__ | ||
16 | #define __MFD_WM831X_PMU_H__ | ||
17 | |||
18 | /* | ||
19 | * R16387 (0x4003) - Power State | ||
20 | */ | ||
21 | #define WM831X_CHIP_ON 0x8000 /* CHIP_ON */ | ||
22 | #define WM831X_CHIP_ON_MASK 0x8000 /* CHIP_ON */ | ||
23 | #define WM831X_CHIP_ON_SHIFT 15 /* CHIP_ON */ | ||
24 | #define WM831X_CHIP_ON_WIDTH 1 /* CHIP_ON */ | ||
25 | #define WM831X_CHIP_SLP 0x4000 /* CHIP_SLP */ | ||
26 | #define WM831X_CHIP_SLP_MASK 0x4000 /* CHIP_SLP */ | ||
27 | #define WM831X_CHIP_SLP_SHIFT 14 /* CHIP_SLP */ | ||
28 | #define WM831X_CHIP_SLP_WIDTH 1 /* CHIP_SLP */ | ||
29 | #define WM831X_REF_LP 0x1000 /* REF_LP */ | ||
30 | #define WM831X_REF_LP_MASK 0x1000 /* REF_LP */ | ||
31 | #define WM831X_REF_LP_SHIFT 12 /* REF_LP */ | ||
32 | #define WM831X_REF_LP_WIDTH 1 /* REF_LP */ | ||
33 | #define WM831X_PWRSTATE_DLY_MASK 0x0C00 /* PWRSTATE_DLY - [11:10] */ | ||
34 | #define WM831X_PWRSTATE_DLY_SHIFT 10 /* PWRSTATE_DLY - [11:10] */ | ||
35 | #define WM831X_PWRSTATE_DLY_WIDTH 2 /* PWRSTATE_DLY - [11:10] */ | ||
36 | #define WM831X_SWRST_DLY 0x0200 /* SWRST_DLY */ | ||
37 | #define WM831X_SWRST_DLY_MASK 0x0200 /* SWRST_DLY */ | ||
38 | #define WM831X_SWRST_DLY_SHIFT 9 /* SWRST_DLY */ | ||
39 | #define WM831X_SWRST_DLY_WIDTH 1 /* SWRST_DLY */ | ||
40 | #define WM831X_USB100MA_STARTUP_MASK 0x0030 /* USB100MA_STARTUP - [5:4] */ | ||
41 | #define WM831X_USB100MA_STARTUP_SHIFT 4 /* USB100MA_STARTUP - [5:4] */ | ||
42 | #define WM831X_USB100MA_STARTUP_WIDTH 2 /* USB100MA_STARTUP - [5:4] */ | ||
43 | #define WM831X_USB_CURR_STS 0x0008 /* USB_CURR_STS */ | ||
44 | #define WM831X_USB_CURR_STS_MASK 0x0008 /* USB_CURR_STS */ | ||
45 | #define WM831X_USB_CURR_STS_SHIFT 3 /* USB_CURR_STS */ | ||
46 | #define WM831X_USB_CURR_STS_WIDTH 1 /* USB_CURR_STS */ | ||
47 | #define WM831X_USB_ILIM_MASK 0x0007 /* USB_ILIM - [2:0] */ | ||
48 | #define WM831X_USB_ILIM_SHIFT 0 /* USB_ILIM - [2:0] */ | ||
49 | #define WM831X_USB_ILIM_WIDTH 3 /* USB_ILIM - [2:0] */ | ||
50 | |||
51 | /* | ||
52 | * R16397 (0x400D) - System Status | ||
53 | */ | ||
54 | #define WM831X_THW_STS 0x8000 /* THW_STS */ | ||
55 | #define WM831X_THW_STS_MASK 0x8000 /* THW_STS */ | ||
56 | #define WM831X_THW_STS_SHIFT 15 /* THW_STS */ | ||
57 | #define WM831X_THW_STS_WIDTH 1 /* THW_STS */ | ||
58 | #define WM831X_PWR_SRC_BATT 0x0400 /* PWR_SRC_BATT */ | ||
59 | #define WM831X_PWR_SRC_BATT_MASK 0x0400 /* PWR_SRC_BATT */ | ||
60 | #define WM831X_PWR_SRC_BATT_SHIFT 10 /* PWR_SRC_BATT */ | ||
61 | #define WM831X_PWR_SRC_BATT_WIDTH 1 /* PWR_SRC_BATT */ | ||
62 | #define WM831X_PWR_WALL 0x0200 /* PWR_WALL */ | ||
63 | #define WM831X_PWR_WALL_MASK 0x0200 /* PWR_WALL */ | ||
64 | #define WM831X_PWR_WALL_SHIFT 9 /* PWR_WALL */ | ||
65 | #define WM831X_PWR_WALL_WIDTH 1 /* PWR_WALL */ | ||
66 | #define WM831X_PWR_USB 0x0100 /* PWR_USB */ | ||
67 | #define WM831X_PWR_USB_MASK 0x0100 /* PWR_USB */ | ||
68 | #define WM831X_PWR_USB_SHIFT 8 /* PWR_USB */ | ||
69 | #define WM831X_PWR_USB_WIDTH 1 /* PWR_USB */ | ||
70 | #define WM831X_MAIN_STATE_MASK 0x001F /* MAIN_STATE - [4:0] */ | ||
71 | #define WM831X_MAIN_STATE_SHIFT 0 /* MAIN_STATE - [4:0] */ | ||
72 | #define WM831X_MAIN_STATE_WIDTH 5 /* MAIN_STATE - [4:0] */ | ||
73 | |||
74 | /* | ||
75 | * R16456 (0x4048) - Charger Control 1 | ||
76 | */ | ||
77 | #define WM831X_CHG_ENA 0x8000 /* CHG_ENA */ | ||
78 | #define WM831X_CHG_ENA_MASK 0x8000 /* CHG_ENA */ | ||
79 | #define WM831X_CHG_ENA_SHIFT 15 /* CHG_ENA */ | ||
80 | #define WM831X_CHG_ENA_WIDTH 1 /* CHG_ENA */ | ||
81 | #define WM831X_CHG_FRC 0x4000 /* CHG_FRC */ | ||
82 | #define WM831X_CHG_FRC_MASK 0x4000 /* CHG_FRC */ | ||
83 | #define WM831X_CHG_FRC_SHIFT 14 /* CHG_FRC */ | ||
84 | #define WM831X_CHG_FRC_WIDTH 1 /* CHG_FRC */ | ||
85 | #define WM831X_CHG_ITERM_MASK 0x1C00 /* CHG_ITERM - [12:10] */ | ||
86 | #define WM831X_CHG_ITERM_SHIFT 10 /* CHG_ITERM - [12:10] */ | ||
87 | #define WM831X_CHG_ITERM_WIDTH 3 /* CHG_ITERM - [12:10] */ | ||
88 | #define WM831X_CHG_FAST 0x0020 /* CHG_FAST */ | ||
89 | #define WM831X_CHG_FAST_MASK 0x0020 /* CHG_FAST */ | ||
90 | #define WM831X_CHG_FAST_SHIFT 5 /* CHG_FAST */ | ||
91 | #define WM831X_CHG_FAST_WIDTH 1 /* CHG_FAST */ | ||
92 | #define WM831X_CHG_IMON_ENA 0x0002 /* CHG_IMON_ENA */ | ||
93 | #define WM831X_CHG_IMON_ENA_MASK 0x0002 /* CHG_IMON_ENA */ | ||
94 | #define WM831X_CHG_IMON_ENA_SHIFT 1 /* CHG_IMON_ENA */ | ||
95 | #define WM831X_CHG_IMON_ENA_WIDTH 1 /* CHG_IMON_ENA */ | ||
96 | #define WM831X_CHG_CHIP_TEMP_MON 0x0001 /* CHG_CHIP_TEMP_MON */ | ||
97 | #define WM831X_CHG_CHIP_TEMP_MON_MASK 0x0001 /* CHG_CHIP_TEMP_MON */ | ||
98 | #define WM831X_CHG_CHIP_TEMP_MON_SHIFT 0 /* CHG_CHIP_TEMP_MON */ | ||
99 | #define WM831X_CHG_CHIP_TEMP_MON_WIDTH 1 /* CHG_CHIP_TEMP_MON */ | ||
100 | |||
101 | /* | ||
102 | * R16457 (0x4049) - Charger Control 2 | ||
103 | */ | ||
104 | #define WM831X_CHG_OFF_MSK 0x4000 /* CHG_OFF_MSK */ | ||
105 | #define WM831X_CHG_OFF_MSK_MASK 0x4000 /* CHG_OFF_MSK */ | ||
106 | #define WM831X_CHG_OFF_MSK_SHIFT 14 /* CHG_OFF_MSK */ | ||
107 | #define WM831X_CHG_OFF_MSK_WIDTH 1 /* CHG_OFF_MSK */ | ||
108 | #define WM831X_CHG_TIME_MASK 0x0F00 /* CHG_TIME - [11:8] */ | ||
109 | #define WM831X_CHG_TIME_SHIFT 8 /* CHG_TIME - [11:8] */ | ||
110 | #define WM831X_CHG_TIME_WIDTH 4 /* CHG_TIME - [11:8] */ | ||
111 | #define WM831X_CHG_TRKL_ILIM_MASK 0x00C0 /* CHG_TRKL_ILIM - [7:6] */ | ||
112 | #define WM831X_CHG_TRKL_ILIM_SHIFT 6 /* CHG_TRKL_ILIM - [7:6] */ | ||
113 | #define WM831X_CHG_TRKL_ILIM_WIDTH 2 /* CHG_TRKL_ILIM - [7:6] */ | ||
114 | #define WM831X_CHG_VSEL_MASK 0x0030 /* CHG_VSEL - [5:4] */ | ||
115 | #define WM831X_CHG_VSEL_SHIFT 4 /* CHG_VSEL - [5:4] */ | ||
116 | #define WM831X_CHG_VSEL_WIDTH 2 /* CHG_VSEL - [5:4] */ | ||
117 | #define WM831X_CHG_FAST_ILIM_MASK 0x000F /* CHG_FAST_ILIM - [3:0] */ | ||
118 | #define WM831X_CHG_FAST_ILIM_SHIFT 0 /* CHG_FAST_ILIM - [3:0] */ | ||
119 | #define WM831X_CHG_FAST_ILIM_WIDTH 4 /* CHG_FAST_ILIM - [3:0] */ | ||
120 | |||
121 | /* | ||
122 | * R16458 (0x404A) - Charger Status | ||
123 | */ | ||
124 | #define WM831X_BATT_OV_STS 0x8000 /* BATT_OV_STS */ | ||
125 | #define WM831X_BATT_OV_STS_MASK 0x8000 /* BATT_OV_STS */ | ||
126 | #define WM831X_BATT_OV_STS_SHIFT 15 /* BATT_OV_STS */ | ||
127 | #define WM831X_BATT_OV_STS_WIDTH 1 /* BATT_OV_STS */ | ||
128 | #define WM831X_CHG_STATE_MASK 0x7000 /* CHG_STATE - [14:12] */ | ||
129 | #define WM831X_CHG_STATE_SHIFT 12 /* CHG_STATE - [14:12] */ | ||
130 | #define WM831X_CHG_STATE_WIDTH 3 /* CHG_STATE - [14:12] */ | ||
131 | #define WM831X_BATT_HOT_STS 0x0800 /* BATT_HOT_STS */ | ||
132 | #define WM831X_BATT_HOT_STS_MASK 0x0800 /* BATT_HOT_STS */ | ||
133 | #define WM831X_BATT_HOT_STS_SHIFT 11 /* BATT_HOT_STS */ | ||
134 | #define WM831X_BATT_HOT_STS_WIDTH 1 /* BATT_HOT_STS */ | ||
135 | #define WM831X_BATT_COLD_STS 0x0400 /* BATT_COLD_STS */ | ||
136 | #define WM831X_BATT_COLD_STS_MASK 0x0400 /* BATT_COLD_STS */ | ||
137 | #define WM831X_BATT_COLD_STS_SHIFT 10 /* BATT_COLD_STS */ | ||
138 | #define WM831X_BATT_COLD_STS_WIDTH 1 /* BATT_COLD_STS */ | ||
139 | #define WM831X_CHG_TOPOFF 0x0200 /* CHG_TOPOFF */ | ||
140 | #define WM831X_CHG_TOPOFF_MASK 0x0200 /* CHG_TOPOFF */ | ||
141 | #define WM831X_CHG_TOPOFF_SHIFT 9 /* CHG_TOPOFF */ | ||
142 | #define WM831X_CHG_TOPOFF_WIDTH 1 /* CHG_TOPOFF */ | ||
143 | #define WM831X_CHG_ACTIVE 0x0100 /* CHG_ACTIVE */ | ||
144 | #define WM831X_CHG_ACTIVE_MASK 0x0100 /* CHG_ACTIVE */ | ||
145 | #define WM831X_CHG_ACTIVE_SHIFT 8 /* CHG_ACTIVE */ | ||
146 | #define WM831X_CHG_ACTIVE_WIDTH 1 /* CHG_ACTIVE */ | ||
147 | #define WM831X_CHG_TIME_ELAPSED_MASK 0x00FF /* CHG_TIME_ELAPSED - [7:0] */ | ||
148 | #define WM831X_CHG_TIME_ELAPSED_SHIFT 0 /* CHG_TIME_ELAPSED - [7:0] */ | ||
149 | #define WM831X_CHG_TIME_ELAPSED_WIDTH 8 /* CHG_TIME_ELAPSED - [7:0] */ | ||
150 | |||
151 | #define WM831X_CHG_STATE_OFF (0 << WM831X_CHG_STATE_SHIFT) | ||
152 | #define WM831X_CHG_STATE_TRICKLE (1 << WM831X_CHG_STATE_SHIFT) | ||
153 | #define WM831X_CHG_STATE_FAST (2 << WM831X_CHG_STATE_SHIFT) | ||
154 | #define WM831X_CHG_STATE_TRICKLE_OT (3 << WM831X_CHG_STATE_SHIFT) | ||
155 | #define WM831X_CHG_STATE_FAST_OT (4 << WM831X_CHG_STATE_SHIFT) | ||
156 | #define WM831X_CHG_STATE_DEFECTIVE (5 << WM831X_CHG_STATE_SHIFT) | ||
157 | |||
158 | /* | ||
159 | * R16459 (0x404B) - Backup Charger Control | ||
160 | */ | ||
161 | #define WM831X_BKUP_CHG_ENA 0x8000 /* BKUP_CHG_ENA */ | ||
162 | #define WM831X_BKUP_CHG_ENA_MASK 0x8000 /* BKUP_CHG_ENA */ | ||
163 | #define WM831X_BKUP_CHG_ENA_SHIFT 15 /* BKUP_CHG_ENA */ | ||
164 | #define WM831X_BKUP_CHG_ENA_WIDTH 1 /* BKUP_CHG_ENA */ | ||
165 | #define WM831X_BKUP_CHG_STS 0x4000 /* BKUP_CHG_STS */ | ||
166 | #define WM831X_BKUP_CHG_STS_MASK 0x4000 /* BKUP_CHG_STS */ | ||
167 | #define WM831X_BKUP_CHG_STS_SHIFT 14 /* BKUP_CHG_STS */ | ||
168 | #define WM831X_BKUP_CHG_STS_WIDTH 1 /* BKUP_CHG_STS */ | ||
169 | #define WM831X_BKUP_CHG_MODE 0x1000 /* BKUP_CHG_MODE */ | ||
170 | #define WM831X_BKUP_CHG_MODE_MASK 0x1000 /* BKUP_CHG_MODE */ | ||
171 | #define WM831X_BKUP_CHG_MODE_SHIFT 12 /* BKUP_CHG_MODE */ | ||
172 | #define WM831X_BKUP_CHG_MODE_WIDTH 1 /* BKUP_CHG_MODE */ | ||
173 | #define WM831X_BKUP_BATT_DET_ENA 0x0800 /* BKUP_BATT_DET_ENA */ | ||
174 | #define WM831X_BKUP_BATT_DET_ENA_MASK 0x0800 /* BKUP_BATT_DET_ENA */ | ||
175 | #define WM831X_BKUP_BATT_DET_ENA_SHIFT 11 /* BKUP_BATT_DET_ENA */ | ||
176 | #define WM831X_BKUP_BATT_DET_ENA_WIDTH 1 /* BKUP_BATT_DET_ENA */ | ||
177 | #define WM831X_BKUP_BATT_STS 0x0400 /* BKUP_BATT_STS */ | ||
178 | #define WM831X_BKUP_BATT_STS_MASK 0x0400 /* BKUP_BATT_STS */ | ||
179 | #define WM831X_BKUP_BATT_STS_SHIFT 10 /* BKUP_BATT_STS */ | ||
180 | #define WM831X_BKUP_BATT_STS_WIDTH 1 /* BKUP_BATT_STS */ | ||
181 | #define WM831X_BKUP_CHG_VLIM 0x0010 /* BKUP_CHG_VLIM */ | ||
182 | #define WM831X_BKUP_CHG_VLIM_MASK 0x0010 /* BKUP_CHG_VLIM */ | ||
183 | #define WM831X_BKUP_CHG_VLIM_SHIFT 4 /* BKUP_CHG_VLIM */ | ||
184 | #define WM831X_BKUP_CHG_VLIM_WIDTH 1 /* BKUP_CHG_VLIM */ | ||
185 | #define WM831X_BKUP_CHG_ILIM_MASK 0x0003 /* BKUP_CHG_ILIM - [1:0] */ | ||
186 | #define WM831X_BKUP_CHG_ILIM_SHIFT 0 /* BKUP_CHG_ILIM - [1:0] */ | ||
187 | #define WM831X_BKUP_CHG_ILIM_WIDTH 2 /* BKUP_CHG_ILIM - [1:0] */ | ||
188 | |||
189 | #endif | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 9a72cc78e6b8..24c395694f4d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -25,6 +25,7 @@ extern unsigned long max_mapnr; | |||
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | extern unsigned long num_physpages; | 27 | extern unsigned long num_physpages; |
28 | extern unsigned long totalram_pages; | ||
28 | extern void * high_memory; | 29 | extern void * high_memory; |
29 | extern int page_cluster; | 30 | extern int page_cluster; |
30 | 31 | ||
@@ -103,6 +104,7 @@ extern unsigned int kobjsize(const void *objp); | |||
103 | #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ | 104 | #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ |
104 | #define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ | 105 | #define VM_SAO 0x20000000 /* Strong Access Ordering (powerpc) */ |
105 | #define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ | 106 | #define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ |
107 | #define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ | ||
106 | 108 | ||
107 | #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ | 109 | #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ |
108 | #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS | 110 | #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS |
@@ -283,6 +285,14 @@ static inline int is_vmalloc_addr(const void *x) | |||
283 | return 0; | 285 | return 0; |
284 | #endif | 286 | #endif |
285 | } | 287 | } |
288 | #ifdef CONFIG_MMU | ||
289 | extern int is_vmalloc_or_module_addr(const void *x); | ||
290 | #else | ||
291 | static inline int is_vmalloc_or_module_addr(const void *x) | ||
292 | { | ||
293 | return 0; | ||
294 | } | ||
295 | #endif | ||
286 | 296 | ||
287 | static inline struct page *compound_head(struct page *page) | 297 | static inline struct page *compound_head(struct page *page) |
288 | { | 298 | { |
@@ -685,11 +695,12 @@ static inline int page_mapped(struct page *page) | |||
685 | #define VM_FAULT_SIGBUS 0x0002 | 695 | #define VM_FAULT_SIGBUS 0x0002 |
686 | #define VM_FAULT_MAJOR 0x0004 | 696 | #define VM_FAULT_MAJOR 0x0004 |
687 | #define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ | 697 | #define VM_FAULT_WRITE 0x0008 /* Special case for get_user_pages */ |
698 | #define VM_FAULT_HWPOISON 0x0010 /* Hit poisoned page */ | ||
688 | 699 | ||
689 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ | 700 | #define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ |
690 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ | 701 | #define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ |
691 | 702 | ||
692 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) | 703 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON) |
693 | 704 | ||
694 | /* | 705 | /* |
695 | * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. | 706 | * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. |
@@ -700,17 +711,8 @@ extern void pagefault_out_of_memory(void); | |||
700 | 711 | ||
701 | extern void show_free_areas(void); | 712 | extern void show_free_areas(void); |
702 | 713 | ||
703 | #ifdef CONFIG_SHMEM | 714 | int shmem_lock(struct file *file, int lock, struct user_struct *user); |
704 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | ||
705 | #else | ||
706 | static inline int shmem_lock(struct file *file, int lock, | ||
707 | struct user_struct *user) | ||
708 | { | ||
709 | return 0; | ||
710 | } | ||
711 | #endif | ||
712 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); | 715 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); |
713 | |||
714 | int shmem_zero_setup(struct vm_area_struct *); | 716 | int shmem_zero_setup(struct vm_area_struct *); |
715 | 717 | ||
716 | #ifndef CONFIG_MMU | 718 | #ifndef CONFIG_MMU |
@@ -790,8 +792,14 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, | |||
790 | unmap_mapping_range(mapping, holebegin, holelen, 0); | 792 | unmap_mapping_range(mapping, holebegin, holelen, 0); |
791 | } | 793 | } |
792 | 794 | ||
793 | extern int vmtruncate(struct inode * inode, loff_t offset); | 795 | extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new); |
794 | extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); | 796 | extern int vmtruncate(struct inode *inode, loff_t offset); |
797 | extern int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end); | ||
798 | |||
799 | int truncate_inode_page(struct address_space *mapping, struct page *page); | ||
800 | int generic_error_remove_page(struct address_space *mapping, struct page *page); | ||
801 | |||
802 | int invalidate_inode_page(struct page *page); | ||
795 | 803 | ||
796 | #ifdef CONFIG_MMU | 804 | #ifdef CONFIG_MMU |
797 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 805 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
@@ -815,6 +823,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
815 | struct page **pages, struct vm_area_struct **vmas); | 823 | struct page **pages, struct vm_area_struct **vmas); |
816 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 824 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
817 | struct page **pages); | 825 | struct page **pages); |
826 | struct page *get_dump_page(unsigned long addr); | ||
818 | 827 | ||
819 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); | 828 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
820 | extern void do_invalidatepage(struct page *page, unsigned long offset); | 829 | extern void do_invalidatepage(struct page *page, unsigned long offset); |
@@ -1058,6 +1067,8 @@ extern void setup_per_cpu_pageset(void); | |||
1058 | static inline void setup_per_cpu_pageset(void) {} | 1067 | static inline void setup_per_cpu_pageset(void) {} |
1059 | #endif | 1068 | #endif |
1060 | 1069 | ||
1070 | extern void zone_pcp_update(struct zone *zone); | ||
1071 | |||
1061 | /* nommu.c */ | 1072 | /* nommu.c */ |
1062 | extern atomic_long_t mmap_pages_allocated; | 1073 | extern atomic_long_t mmap_pages_allocated; |
1063 | 1074 | ||
@@ -1226,7 +1237,8 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address, | |||
1226 | #define FOLL_WRITE 0x01 /* check pte is writable */ | 1237 | #define FOLL_WRITE 0x01 /* check pte is writable */ |
1227 | #define FOLL_TOUCH 0x02 /* mark page accessed */ | 1238 | #define FOLL_TOUCH 0x02 /* mark page accessed */ |
1228 | #define FOLL_GET 0x04 /* do get_page on page */ | 1239 | #define FOLL_GET 0x04 /* do get_page on page */ |
1229 | #define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ | 1240 | #define FOLL_DUMP 0x08 /* give error on hole if it would be zero */ |
1241 | #define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */ | ||
1230 | 1242 | ||
1231 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, | 1243 | typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, |
1232 | void *data); | 1244 | void *data); |
@@ -1274,7 +1286,7 @@ int in_gate_area_no_task(unsigned long addr); | |||
1274 | #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) | 1286 | #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) |
1275 | #endif /* __HAVE_ARCH_GATE_AREA */ | 1287 | #endif /* __HAVE_ARCH_GATE_AREA */ |
1276 | 1288 | ||
1277 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, | 1289 | int drop_caches_sysctl_handler(struct ctl_table *, int, |
1278 | void __user *, size_t *, loff_t *); | 1290 | void __user *, size_t *, loff_t *); |
1279 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1291 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, |
1280 | unsigned long lru_pages); | 1292 | unsigned long lru_pages); |
@@ -1303,5 +1315,12 @@ void vmemmap_populate_print_last(void); | |||
1303 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, | 1315 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, |
1304 | size_t size); | 1316 | size_t size); |
1305 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); | 1317 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); |
1318 | |||
1319 | extern void memory_failure(unsigned long pfn, int trapno); | ||
1320 | extern int __memory_failure(unsigned long pfn, int trapno, int ref); | ||
1321 | extern int sysctl_memory_failure_early_kill; | ||
1322 | extern int sysctl_memory_failure_recovery; | ||
1323 | extern atomic_long_t mce_bad_pages; | ||
1324 | |||
1306 | #endif /* __KERNEL__ */ | 1325 | #endif /* __KERNEL__ */ |
1307 | #endif /* _LINUX_MM_H */ | 1326 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 7fbb97267556..8835b877b8db 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * page_is_file_cache - should the page be on a file LRU or anon LRU? | 5 | * page_is_file_cache - should the page be on a file LRU or anon LRU? |
6 | * @page: the page to test | 6 | * @page: the page to test |
7 | * | 7 | * |
8 | * Returns LRU_FILE if @page is page cache page backed by a regular filesystem, | 8 | * Returns 1 if @page is page cache page backed by a regular filesystem, |
9 | * or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed. | 9 | * or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed. |
10 | * Used by functions that manipulate the LRU lists, to sort a page | 10 | * Used by functions that manipulate the LRU lists, to sort a page |
11 | * onto the right LRU list. | 11 | * onto the right LRU list. |
@@ -16,11 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | static inline int page_is_file_cache(struct page *page) | 17 | static inline int page_is_file_cache(struct page *page) |
18 | { | 18 | { |
19 | if (PageSwapBacked(page)) | 19 | return !PageSwapBacked(page); |
20 | return 0; | ||
21 | |||
22 | /* The page is page cache backed by a normal filesystem. */ | ||
23 | return LRU_FILE; | ||
24 | } | 20 | } |
25 | 21 | ||
26 | static inline void | 22 | static inline void |
@@ -39,21 +35,36 @@ del_page_from_lru_list(struct zone *zone, struct page *page, enum lru_list l) | |||
39 | mem_cgroup_del_lru_list(page, l); | 35 | mem_cgroup_del_lru_list(page, l); |
40 | } | 36 | } |
41 | 37 | ||
38 | /** | ||
39 | * page_lru_base_type - which LRU list type should a page be on? | ||
40 | * @page: the page to test | ||
41 | * | ||
42 | * Used for LRU list index arithmetic. | ||
43 | * | ||
44 | * Returns the base LRU type - file or anon - @page should be on. | ||
45 | */ | ||
46 | static inline enum lru_list page_lru_base_type(struct page *page) | ||
47 | { | ||
48 | if (page_is_file_cache(page)) | ||
49 | return LRU_INACTIVE_FILE; | ||
50 | return LRU_INACTIVE_ANON; | ||
51 | } | ||
52 | |||
42 | static inline void | 53 | static inline void |
43 | del_page_from_lru(struct zone *zone, struct page *page) | 54 | del_page_from_lru(struct zone *zone, struct page *page) |
44 | { | 55 | { |
45 | enum lru_list l = LRU_BASE; | 56 | enum lru_list l; |
46 | 57 | ||
47 | list_del(&page->lru); | 58 | list_del(&page->lru); |
48 | if (PageUnevictable(page)) { | 59 | if (PageUnevictable(page)) { |
49 | __ClearPageUnevictable(page); | 60 | __ClearPageUnevictable(page); |
50 | l = LRU_UNEVICTABLE; | 61 | l = LRU_UNEVICTABLE; |
51 | } else { | 62 | } else { |
63 | l = page_lru_base_type(page); | ||
52 | if (PageActive(page)) { | 64 | if (PageActive(page)) { |
53 | __ClearPageActive(page); | 65 | __ClearPageActive(page); |
54 | l += LRU_ACTIVE; | 66 | l += LRU_ACTIVE; |
55 | } | 67 | } |
56 | l += page_is_file_cache(page); | ||
57 | } | 68 | } |
58 | __dec_zone_state(zone, NR_LRU_BASE + l); | 69 | __dec_zone_state(zone, NR_LRU_BASE + l); |
59 | mem_cgroup_del_lru_list(page, l); | 70 | mem_cgroup_del_lru_list(page, l); |
@@ -68,14 +79,14 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
68 | */ | 79 | */ |
69 | static inline enum lru_list page_lru(struct page *page) | 80 | static inline enum lru_list page_lru(struct page *page) |
70 | { | 81 | { |
71 | enum lru_list lru = LRU_BASE; | 82 | enum lru_list lru; |
72 | 83 | ||
73 | if (PageUnevictable(page)) | 84 | if (PageUnevictable(page)) |
74 | lru = LRU_UNEVICTABLE; | 85 | lru = LRU_UNEVICTABLE; |
75 | else { | 86 | else { |
87 | lru = page_lru_base_type(page); | ||
76 | if (PageActive(page)) | 88 | if (PageActive(page)) |
77 | lru += LRU_ACTIVE; | 89 | lru += LRU_ACTIVE; |
78 | lru += page_is_file_cache(page); | ||
79 | } | 90 | } |
80 | 91 | ||
81 | return lru; | 92 | return lru; |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0042090a4d70..21d6aa45206a 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -240,6 +240,8 @@ struct mm_struct { | |||
240 | 240 | ||
241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
242 | 242 | ||
243 | struct linux_binfmt *binfmt; | ||
244 | |||
243 | cpumask_t cpu_vm_mask; | 245 | cpumask_t cpu_vm_mask; |
244 | 246 | ||
245 | /* Architecture-specific MM context */ | 247 | /* Architecture-specific MM context */ |
@@ -259,11 +261,10 @@ struct mm_struct { | |||
259 | unsigned long flags; /* Must use atomic bitops to access the bits */ | 261 | unsigned long flags; /* Must use atomic bitops to access the bits */ |
260 | 262 | ||
261 | struct core_state *core_state; /* coredumping support */ | 263 | struct core_state *core_state; /* coredumping support */ |
262 | 264 | #ifdef CONFIG_AIO | |
263 | /* aio bits */ | ||
264 | spinlock_t ioctx_lock; | 265 | spinlock_t ioctx_lock; |
265 | struct hlist_head ioctx_list; | 266 | struct hlist_head ioctx_list; |
266 | 267 | #endif | |
267 | #ifdef CONFIG_MM_OWNER | 268 | #ifdef CONFIG_MM_OWNER |
268 | /* | 269 | /* |
269 | * "owner" points to a task that is regarded as the canonical | 270 | * "owner" points to a task that is regarded as the canonical |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 403aa505f27e..2ee22e8af110 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -40,6 +40,8 @@ struct mmc_csd { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | struct mmc_ext_csd { | 42 | struct mmc_ext_csd { |
43 | u8 rev; | ||
44 | unsigned int sa_timeout; /* Units: 100ns */ | ||
43 | unsigned int hs_max_dtr; | 45 | unsigned int hs_max_dtr; |
44 | unsigned int sectors; | 46 | unsigned int sectors; |
45 | }; | 47 | }; |
@@ -62,7 +64,8 @@ struct sdio_cccr { | |||
62 | low_speed:1, | 64 | low_speed:1, |
63 | wide_bus:1, | 65 | wide_bus:1, |
64 | high_power:1, | 66 | high_power:1, |
65 | high_speed:1; | 67 | high_speed:1, |
68 | disable_cd:1; | ||
66 | }; | 69 | }; |
67 | 70 | ||
68 | struct sdio_cis { | 71 | struct sdio_cis { |
@@ -94,6 +97,8 @@ struct mmc_card { | |||
94 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ | 97 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ |
95 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ | 98 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ |
96 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ | 99 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
100 | unsigned int quirks; /* card quirks */ | ||
101 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | ||
97 | 102 | ||
98 | u32 raw_cid[4]; /* raw card CID */ | 103 | u32 raw_cid[4]; /* raw card CID */ |
99 | u32 raw_csd[4]; /* raw card CSD */ | 104 | u32 raw_csd[4]; /* raw card CSD */ |
@@ -129,6 +134,11 @@ struct mmc_card { | |||
129 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 134 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
130 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 135 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
131 | 136 | ||
137 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) | ||
138 | { | ||
139 | return c->quirks & MMC_QUIRK_LENIENT_FN0; | ||
140 | } | ||
141 | |||
132 | #define mmc_card_name(c) ((c)->cid.prod_name) | 142 | #define mmc_card_name(c) ((c)->cid.prod_name) |
133 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 143 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
134 | 144 | ||
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 7ac8b500d55c..e4898e9eeb59 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -139,6 +139,7 @@ extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); | |||
139 | 139 | ||
140 | extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); | 140 | extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); |
141 | extern void mmc_release_host(struct mmc_host *host); | 141 | extern void mmc_release_host(struct mmc_host *host); |
142 | extern int mmc_try_claim_host(struct mmc_host *host); | ||
142 | 143 | ||
143 | /** | 144 | /** |
144 | * mmc_claim_host - exclusively claim a host | 145 | * mmc_claim_host - exclusively claim a host |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 3e7615e9087e..81bb42358595 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -51,6 +51,35 @@ struct mmc_ios { | |||
51 | }; | 51 | }; |
52 | 52 | ||
53 | struct mmc_host_ops { | 53 | struct mmc_host_ops { |
54 | /* | ||
55 | * Hosts that support power saving can use the 'enable' and 'disable' | ||
56 | * methods to exit and enter power saving states. 'enable' is called | ||
57 | * when the host is claimed and 'disable' is called (or scheduled with | ||
58 | * a delay) when the host is released. The 'disable' is scheduled if | ||
59 | * the disable delay set by 'mmc_set_disable_delay()' is non-zero, | ||
60 | * otherwise 'disable' is called immediately. 'disable' may be | ||
61 | * scheduled repeatedly, to permit ever greater power saving at the | ||
62 | * expense of ever greater latency to re-enable. Rescheduling is | ||
63 | * determined by the return value of the 'disable' method. A positive | ||
64 | * value gives the delay in milliseconds. | ||
65 | * | ||
66 | * In the case where a host function (like set_ios) may be called | ||
67 | * with or without the host claimed, enabling and disabling can be | ||
68 | * done directly and will nest correctly. Call 'mmc_host_enable()' and | ||
69 | * 'mmc_host_lazy_disable()' for this purpose, but note that these | ||
70 | * functions must be paired. | ||
71 | * | ||
72 | * Alternatively, 'mmc_host_enable()' may be paired with | ||
73 | * 'mmc_host_disable()' which calls 'disable' immediately. In this | ||
74 | * case the 'disable' method will be called with 'lazy' set to 0. | ||
75 | * This is mainly useful for error paths. | ||
76 | * | ||
77 | * Because lazy disable may be called from a work queue, the 'disable' | ||
78 | * method must claim the host when 'lazy' != 0, which will work | ||
79 | * correctly because recursion is detected and handled. | ||
80 | */ | ||
81 | int (*enable)(struct mmc_host *host); | ||
82 | int (*disable)(struct mmc_host *host, int lazy); | ||
54 | void (*request)(struct mmc_host *host, struct mmc_request *req); | 83 | void (*request)(struct mmc_host *host, struct mmc_request *req); |
55 | /* | 84 | /* |
56 | * Avoid calling these three functions too often or in a "fast path", | 85 | * Avoid calling these three functions too often or in a "fast path", |
@@ -118,6 +147,9 @@ struct mmc_host { | |||
118 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ | 147 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ |
119 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ | 148 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ |
120 | #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ | 149 | #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ |
150 | #define MMC_CAP_DISABLE (1 << 7) /* Can the host be disabled */ | ||
151 | #define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ | ||
152 | #define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ | ||
121 | 153 | ||
122 | /* host specific block data */ | 154 | /* host specific block data */ |
123 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 155 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
@@ -142,9 +174,18 @@ struct mmc_host { | |||
142 | unsigned int removed:1; /* host is being removed */ | 174 | unsigned int removed:1; /* host is being removed */ |
143 | #endif | 175 | #endif |
144 | 176 | ||
177 | /* Only used with MMC_CAP_DISABLE */ | ||
178 | int enabled; /* host is enabled */ | ||
179 | int nesting_cnt; /* "enable" nesting count */ | ||
180 | int en_dis_recurs; /* detect recursion */ | ||
181 | unsigned int disable_delay; /* disable delay in msecs */ | ||
182 | struct delayed_work disable; /* disabling work */ | ||
183 | |||
145 | struct mmc_card *card; /* device attached to this host */ | 184 | struct mmc_card *card; /* device attached to this host */ |
146 | 185 | ||
147 | wait_queue_head_t wq; | 186 | wait_queue_head_t wq; |
187 | struct task_struct *claimer; /* task that has host claimed */ | ||
188 | int claim_cnt; /* "claim" nesting count */ | ||
148 | 189 | ||
149 | struct delayed_work detect; | 190 | struct delayed_work detect; |
150 | 191 | ||
@@ -183,6 +224,9 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
183 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); | 224 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); |
184 | extern int mmc_resume_host(struct mmc_host *); | 225 | extern int mmc_resume_host(struct mmc_host *); |
185 | 226 | ||
227 | extern void mmc_power_save_host(struct mmc_host *host); | ||
228 | extern void mmc_power_restore_host(struct mmc_host *host); | ||
229 | |||
186 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 230 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
187 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 231 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
188 | 232 | ||
@@ -197,5 +241,19 @@ struct regulator; | |||
197 | int mmc_regulator_get_ocrmask(struct regulator *supply); | 241 | int mmc_regulator_get_ocrmask(struct regulator *supply); |
198 | int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); | 242 | int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit); |
199 | 243 | ||
244 | int mmc_card_awake(struct mmc_host *host); | ||
245 | int mmc_card_sleep(struct mmc_host *host); | ||
246 | int mmc_card_can_sleep(struct mmc_host *host); | ||
247 | |||
248 | int mmc_host_enable(struct mmc_host *host); | ||
249 | int mmc_host_disable(struct mmc_host *host); | ||
250 | int mmc_host_lazy_disable(struct mmc_host *host); | ||
251 | |||
252 | static inline void mmc_set_disable_delay(struct mmc_host *host, | ||
253 | unsigned int disable_delay) | ||
254 | { | ||
255 | host->disable_delay = disable_delay; | ||
256 | } | ||
257 | |||
200 | #endif | 258 | #endif |
201 | 259 | ||
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 14b81f3e5232..c02c8db73701 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ | 31 | #define MMC_ALL_SEND_CID 2 /* bcr R2 */ |
32 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ | 32 | #define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ |
33 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ | 33 | #define MMC_SET_DSR 4 /* bc [31:16] RCA */ |
34 | #define MMC_SLEEP_AWAKE 5 /* ac [31:16] RCA 15:flg R1b */ | ||
34 | #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ | 35 | #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ |
35 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ | 36 | #define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ |
36 | #define MMC_SEND_EXT_CSD 8 /* adtc R1 */ | 37 | #define MMC_SEND_EXT_CSD 8 /* adtc R1 */ |
@@ -127,6 +128,7 @@ | |||
127 | #define R1_STATUS(x) (x & 0xFFFFE000) | 128 | #define R1_STATUS(x) (x & 0xFFFFE000) |
128 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ | 129 | #define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ |
129 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ | 130 | #define R1_READY_FOR_DATA (1 << 8) /* sx, a */ |
131 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ | ||
130 | #define R1_APP_CMD (1 << 5) /* sr, c */ | 132 | #define R1_APP_CMD (1 << 5) /* sr, c */ |
131 | 133 | ||
132 | /* | 134 | /* |
@@ -254,6 +256,7 @@ struct _mmc_csd { | |||
254 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | 256 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
255 | #define EXT_CSD_REV 192 /* RO */ | 257 | #define EXT_CSD_REV 192 /* RO */ |
256 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | 258 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ |
259 | #define EXT_CSD_S_A_TIMEOUT 217 | ||
257 | 260 | ||
258 | /* | 261 | /* |
259 | * EXT_CSD field definitions | 262 | * EXT_CSD field definitions |
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index 451bdfc85830..ac3ab683fec6 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h | |||
@@ -67,6 +67,7 @@ struct sdio_func { | |||
67 | 67 | ||
68 | #define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev) | 68 | #define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev) |
69 | #define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d) | 69 | #define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d) |
70 | #define dev_to_sdio_func(d) container_of(d, struct sdio_func, dev) | ||
70 | 71 | ||
71 | /* | 72 | /* |
72 | * SDIO function device driver | 73 | * SDIO function device driver |
@@ -81,6 +82,8 @@ struct sdio_driver { | |||
81 | struct device_driver drv; | 82 | struct device_driver drv; |
82 | }; | 83 | }; |
83 | 84 | ||
85 | #define to_sdio_driver(d) container_of(d, struct sdio_driver, drv) | ||
86 | |||
84 | /** | 87 | /** |
85 | * SDIO_DEVICE - macro used to describe a specific SDIO device | 88 | * SDIO_DEVICE - macro used to describe a specific SDIO device |
86 | * @vend: the 16 bit manufacturer code | 89 | * @vend: the 16 bit manufacturer code |
diff --git a/include/linux/mmu_context.h b/include/linux/mmu_context.h new file mode 100644 index 000000000000..70fffeba7495 --- /dev/null +++ b/include/linux/mmu_context.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _LINUX_MMU_CONTEXT_H | ||
2 | #define _LINUX_MMU_CONTEXT_H | ||
3 | |||
4 | struct mm_struct; | ||
5 | |||
6 | void use_mm(struct mm_struct *mm); | ||
7 | void unuse_mm(struct mm_struct *mm); | ||
8 | |||
9 | #endif | ||
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index b77486d152cd..4e02ee2b071e 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
@@ -62,6 +62,15 @@ struct mmu_notifier_ops { | |||
62 | unsigned long address); | 62 | unsigned long address); |
63 | 63 | ||
64 | /* | 64 | /* |
65 | * change_pte is called in cases that pte mapping to page is changed: | ||
66 | * for example, when ksm remaps pte to point to a new shared page. | ||
67 | */ | ||
68 | void (*change_pte)(struct mmu_notifier *mn, | ||
69 | struct mm_struct *mm, | ||
70 | unsigned long address, | ||
71 | pte_t pte); | ||
72 | |||
73 | /* | ||
65 | * Before this is invoked any secondary MMU is still ok to | 74 | * Before this is invoked any secondary MMU is still ok to |
66 | * read/write to the page previously pointed to by the Linux | 75 | * read/write to the page previously pointed to by the Linux |
67 | * pte because the page hasn't been freed yet and it won't be | 76 | * pte because the page hasn't been freed yet and it won't be |
@@ -154,6 +163,8 @@ extern void __mmu_notifier_mm_destroy(struct mm_struct *mm); | |||
154 | extern void __mmu_notifier_release(struct mm_struct *mm); | 163 | extern void __mmu_notifier_release(struct mm_struct *mm); |
155 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, | 164 | extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm, |
156 | unsigned long address); | 165 | unsigned long address); |
166 | extern void __mmu_notifier_change_pte(struct mm_struct *mm, | ||
167 | unsigned long address, pte_t pte); | ||
157 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, | 168 | extern void __mmu_notifier_invalidate_page(struct mm_struct *mm, |
158 | unsigned long address); | 169 | unsigned long address); |
159 | extern void __mmu_notifier_invalidate_range_start(struct mm_struct *mm, | 170 | extern void __mmu_notifier_invalidate_range_start(struct mm_struct *mm, |
@@ -175,6 +186,13 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | |||
175 | return 0; | 186 | return 0; |
176 | } | 187 | } |
177 | 188 | ||
189 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, | ||
190 | unsigned long address, pte_t pte) | ||
191 | { | ||
192 | if (mm_has_notifiers(mm)) | ||
193 | __mmu_notifier_change_pte(mm, address, pte); | ||
194 | } | ||
195 | |||
178 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, | 196 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, |
179 | unsigned long address) | 197 | unsigned long address) |
180 | { | 198 | { |
@@ -236,6 +254,16 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
236 | __young; \ | 254 | __young; \ |
237 | }) | 255 | }) |
238 | 256 | ||
257 | #define set_pte_at_notify(__mm, __address, __ptep, __pte) \ | ||
258 | ({ \ | ||
259 | struct mm_struct *___mm = __mm; \ | ||
260 | unsigned long ___address = __address; \ | ||
261 | pte_t ___pte = __pte; \ | ||
262 | \ | ||
263 | set_pte_at(___mm, ___address, __ptep, ___pte); \ | ||
264 | mmu_notifier_change_pte(___mm, ___address, ___pte); \ | ||
265 | }) | ||
266 | |||
239 | #else /* CONFIG_MMU_NOTIFIER */ | 267 | #else /* CONFIG_MMU_NOTIFIER */ |
240 | 268 | ||
241 | static inline void mmu_notifier_release(struct mm_struct *mm) | 269 | static inline void mmu_notifier_release(struct mm_struct *mm) |
@@ -248,6 +276,11 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, | |||
248 | return 0; | 276 | return 0; |
249 | } | 277 | } |
250 | 278 | ||
279 | static inline void mmu_notifier_change_pte(struct mm_struct *mm, | ||
280 | unsigned long address, pte_t pte) | ||
281 | { | ||
282 | } | ||
283 | |||
251 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, | 284 | static inline void mmu_notifier_invalidate_page(struct mm_struct *mm, |
252 | unsigned long address) | 285 | unsigned long address) |
253 | { | 286 | { |
@@ -273,6 +306,7 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) | |||
273 | 306 | ||
274 | #define ptep_clear_flush_young_notify ptep_clear_flush_young | 307 | #define ptep_clear_flush_young_notify ptep_clear_flush_young |
275 | #define ptep_clear_flush_notify ptep_clear_flush | 308 | #define ptep_clear_flush_notify ptep_clear_flush |
309 | #define set_pte_at_notify set_pte_at | ||
276 | 310 | ||
277 | #endif /* CONFIG_MMU_NOTIFIER */ | 311 | #endif /* CONFIG_MMU_NOTIFIER */ |
278 | 312 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 889598537370..6f7561730d88 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define MIGRATE_UNMOVABLE 0 | 38 | #define MIGRATE_UNMOVABLE 0 |
39 | #define MIGRATE_RECLAIMABLE 1 | 39 | #define MIGRATE_RECLAIMABLE 1 |
40 | #define MIGRATE_MOVABLE 2 | 40 | #define MIGRATE_MOVABLE 2 |
41 | #define MIGRATE_PCPTYPES 3 /* the number of types on the pcp lists */ | ||
41 | #define MIGRATE_RESERVE 3 | 42 | #define MIGRATE_RESERVE 3 |
42 | #define MIGRATE_ISOLATE 4 /* can't allocate from here */ | 43 | #define MIGRATE_ISOLATE 4 /* can't allocate from here */ |
43 | #define MIGRATE_TYPES 5 | 44 | #define MIGRATE_TYPES 5 |
@@ -94,11 +95,15 @@ enum zone_stat_item { | |||
94 | NR_SLAB_RECLAIMABLE, | 95 | NR_SLAB_RECLAIMABLE, |
95 | NR_SLAB_UNRECLAIMABLE, | 96 | NR_SLAB_UNRECLAIMABLE, |
96 | NR_PAGETABLE, /* used for pagetables */ | 97 | NR_PAGETABLE, /* used for pagetables */ |
98 | NR_KERNEL_STACK, | ||
99 | /* Second 128 byte cacheline */ | ||
97 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | 100 | NR_UNSTABLE_NFS, /* NFS unstable pages */ |
98 | NR_BOUNCE, | 101 | NR_BOUNCE, |
99 | NR_VMSCAN_WRITE, | 102 | NR_VMSCAN_WRITE, |
100 | /* Second 128 byte cacheline */ | ||
101 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ | 103 | NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ |
104 | NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ | ||
105 | NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ | ||
106 | NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */ | ||
102 | #ifdef CONFIG_NUMA | 107 | #ifdef CONFIG_NUMA |
103 | NUMA_HIT, /* allocated in intended node */ | 108 | NUMA_HIT, /* allocated in intended node */ |
104 | NUMA_MISS, /* allocated in non intended node */ | 109 | NUMA_MISS, /* allocated in non intended node */ |
@@ -165,7 +170,9 @@ struct per_cpu_pages { | |||
165 | int count; /* number of pages in the list */ | 170 | int count; /* number of pages in the list */ |
166 | int high; /* high watermark, emptying needed */ | 171 | int high; /* high watermark, emptying needed */ |
167 | int batch; /* chunk size for buddy add/remove */ | 172 | int batch; /* chunk size for buddy add/remove */ |
168 | struct list_head list; /* the list of pages */ | 173 | |
174 | /* Lists of pages, one per migrate type stored on the pcp-lists */ | ||
175 | struct list_head lists[MIGRATE_PCPTYPES]; | ||
169 | }; | 176 | }; |
170 | 177 | ||
171 | struct per_cpu_pageset { | 178 | struct per_cpu_pageset { |
@@ -269,6 +276,11 @@ struct zone_reclaim_stat { | |||
269 | */ | 276 | */ |
270 | unsigned long recent_rotated[2]; | 277 | unsigned long recent_rotated[2]; |
271 | unsigned long recent_scanned[2]; | 278 | unsigned long recent_scanned[2]; |
279 | |||
280 | /* | ||
281 | * accumulated for batching | ||
282 | */ | ||
283 | unsigned long nr_saved_scan[NR_LRU_LISTS]; | ||
272 | }; | 284 | }; |
273 | 285 | ||
274 | struct zone { | 286 | struct zone { |
@@ -323,7 +335,6 @@ struct zone { | |||
323 | spinlock_t lru_lock; | 335 | spinlock_t lru_lock; |
324 | struct zone_lru { | 336 | struct zone_lru { |
325 | struct list_head list; | 337 | struct list_head list; |
326 | unsigned long nr_saved_scan; /* accumulated for batching */ | ||
327 | } lru[NR_LRU_LISTS]; | 338 | } lru[NR_LRU_LISTS]; |
328 | 339 | ||
329 | struct zone_reclaim_stat reclaim_stat; | 340 | struct zone_reclaim_stat reclaim_stat; |
@@ -744,21 +755,20 @@ static inline int is_dma(struct zone *zone) | |||
744 | 755 | ||
745 | /* These two functions are used to setup the per zone pages min values */ | 756 | /* These two functions are used to setup the per zone pages min values */ |
746 | struct ctl_table; | 757 | struct ctl_table; |
747 | struct file; | 758 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, |
748 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, | ||
749 | void __user *, size_t *, loff_t *); | 759 | void __user *, size_t *, loff_t *); |
750 | extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; | 760 | extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; |
751 | int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, | 761 | int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, |
752 | void __user *, size_t *, loff_t *); | 762 | void __user *, size_t *, loff_t *); |
753 | int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *, | 763 | int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, |
754 | void __user *, size_t *, loff_t *); | 764 | void __user *, size_t *, loff_t *); |
755 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, | 765 | int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int, |
756 | struct file *, void __user *, size_t *, loff_t *); | 766 | void __user *, size_t *, loff_t *); |
757 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, | 767 | int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, |
758 | struct file *, void __user *, size_t *, loff_t *); | 768 | void __user *, size_t *, loff_t *); |
759 | 769 | ||
760 | extern int numa_zonelist_order_handler(struct ctl_table *, int, | 770 | extern int numa_zonelist_order_handler(struct ctl_table *, int, |
761 | struct file *, void __user *, size_t *, loff_t *); | 771 | void __user *, size_t *, loff_t *); |
762 | extern char numa_zonelist_order[]; | 772 | extern char numa_zonelist_order[]; |
763 | #define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */ | 773 | #define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */ |
764 | 774 | ||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 1bf5900ffe43..f58e9d836f32 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -399,6 +399,17 @@ struct i2c_device_id { | |||
399 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | 399 | __attribute__((aligned(sizeof(kernel_ulong_t)))); |
400 | }; | 400 | }; |
401 | 401 | ||
402 | /* spi */ | ||
403 | |||
404 | #define SPI_NAME_SIZE 32 | ||
405 | #define SPI_MODULE_PREFIX "spi:" | ||
406 | |||
407 | struct spi_device_id { | ||
408 | char name[SPI_NAME_SIZE]; | ||
409 | kernel_ulong_t driver_data /* Data private to the driver */ | ||
410 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
411 | }; | ||
412 | |||
402 | /* dmi */ | 413 | /* dmi */ |
403 | enum dmi_field { | 414 | enum dmi_field { |
404 | DMI_NONE, | 415 | DMI_NONE, |
diff --git a/include/linux/module.h b/include/linux/module.h index 1c755b2f937d..482efc865acf 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -128,7 +128,10 @@ extern struct module __this_module; | |||
128 | */ | 128 | */ |
129 | #define MODULE_LICENSE(_license) MODULE_INFO(license, _license) | 129 | #define MODULE_LICENSE(_license) MODULE_INFO(license, _license) |
130 | 130 | ||
131 | /* Author, ideally of form NAME[, NAME]*[ and NAME] */ | 131 | /* |
132 | * Author(s), use "Name <email>" or just "Name", for multiple | ||
133 | * authors use multiple MODULE_AUTHOR() statements/lines. | ||
134 | */ | ||
132 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) | 135 | #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) |
133 | 136 | ||
134 | /* What your module does. */ | 137 | /* What your module does. */ |
@@ -308,10 +311,14 @@ struct module | |||
308 | #endif | 311 | #endif |
309 | 312 | ||
310 | #ifdef CONFIG_KALLSYMS | 313 | #ifdef CONFIG_KALLSYMS |
311 | /* We keep the symbol and string tables for kallsyms. */ | 314 | /* |
312 | Elf_Sym *symtab; | 315 | * We keep the symbol and string tables for kallsyms. |
313 | unsigned int num_symtab; | 316 | * The core_* fields below are temporary, loader-only (they |
314 | char *strtab; | 317 | * could really be discarded after module init). |
318 | */ | ||
319 | Elf_Sym *symtab, *core_symtab; | ||
320 | unsigned int num_symtab, core_num_syms; | ||
321 | char *strtab, *core_strtab; | ||
315 | 322 | ||
316 | /* Section attributes */ | 323 | /* Section attributes */ |
317 | struct module_sect_attrs *sect_attrs; | 324 | struct module_sect_attrs *sect_attrs; |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 4030ebada49e..7a232a9bdd62 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -121,6 +121,7 @@ typedef enum { | |||
121 | NAND_ECC_SOFT, | 121 | NAND_ECC_SOFT, |
122 | NAND_ECC_HW, | 122 | NAND_ECC_HW, |
123 | NAND_ECC_HW_SYNDROME, | 123 | NAND_ECC_HW_SYNDROME, |
124 | NAND_ECC_HW_OOB_FIRST, | ||
124 | } nand_ecc_modes_t; | 125 | } nand_ecc_modes_t; |
125 | 126 | ||
126 | /* | 127 | /* |
@@ -271,13 +272,13 @@ struct nand_ecc_ctrl { | |||
271 | uint8_t *calc_ecc); | 272 | uint8_t *calc_ecc); |
272 | int (*read_page_raw)(struct mtd_info *mtd, | 273 | int (*read_page_raw)(struct mtd_info *mtd, |
273 | struct nand_chip *chip, | 274 | struct nand_chip *chip, |
274 | uint8_t *buf); | 275 | uint8_t *buf, int page); |
275 | void (*write_page_raw)(struct mtd_info *mtd, | 276 | void (*write_page_raw)(struct mtd_info *mtd, |
276 | struct nand_chip *chip, | 277 | struct nand_chip *chip, |
277 | const uint8_t *buf); | 278 | const uint8_t *buf); |
278 | int (*read_page)(struct mtd_info *mtd, | 279 | int (*read_page)(struct mtd_info *mtd, |
279 | struct nand_chip *chip, | 280 | struct nand_chip *chip, |
280 | uint8_t *buf); | 281 | uint8_t *buf, int page); |
281 | int (*read_subpage)(struct mtd_info *mtd, | 282 | int (*read_subpage)(struct mtd_info *mtd, |
282 | struct nand_chip *chip, | 283 | struct nand_chip *chip, |
283 | uint32_t offs, uint32_t len, | 284 | uint32_t offs, uint32_t len, |
diff --git a/include/linux/mtd/nand_ecc.h b/include/linux/mtd/nand_ecc.h index 090da505425d..052ea8ca2434 100644 --- a/include/linux/mtd/nand_ecc.h +++ b/include/linux/mtd/nand_ecc.h | |||
@@ -21,6 +21,12 @@ struct mtd_info; | |||
21 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); | 21 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); |
22 | 22 | ||
23 | /* | 23 | /* |
24 | * Detect and correct a 1 bit error for eccsize byte block | ||
25 | */ | ||
26 | int __nand_correct_data(u_char *dat, u_char *read_ecc, u_char *calc_ecc, | ||
27 | unsigned int eccsize); | ||
28 | |||
29 | /* | ||
24 | * Detect and correct a 1 bit error for 256 byte block | 30 | * Detect and correct a 1 bit error for 256 byte block |
25 | */ | 31 | */ |
26 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); | 32 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 8ed873374381..4e49f3350678 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -214,4 +214,12 @@ unsigned onenand_block(struct onenand_chip *this, loff_t addr); | |||
214 | loff_t onenand_addr(struct onenand_chip *this, int block); | 214 | loff_t onenand_addr(struct onenand_chip *this, int block); |
215 | int flexonenand_region(struct mtd_info *mtd, loff_t addr); | 215 | int flexonenand_region(struct mtd_info *mtd, loff_t addr); |
216 | 216 | ||
217 | struct mtd_partition; | ||
218 | |||
219 | struct onenand_platform_data { | ||
220 | void (*mmcontrol)(struct mtd_info *mtd, int sync_read); | ||
221 | struct mtd_partition *parts; | ||
222 | unsigned int nr_parts; | ||
223 | }; | ||
224 | |||
217 | #endif /* __LINUX_MTD_ONENAND_H */ | 225 | #endif /* __LINUX_MTD_ONENAND_H */ |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index 86a6bbef6465..acadbf53a69f 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -207,6 +207,9 @@ | |||
207 | #define ONENAND_ECC_2BIT (1 << 1) | 207 | #define ONENAND_ECC_2BIT (1 << 1) |
208 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) | 208 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) |
209 | #define FLEXONENAND_UNCORRECTABLE_ERROR (0x1010) | 209 | #define FLEXONENAND_UNCORRECTABLE_ERROR (0x1010) |
210 | #define ONENAND_ECC_3BIT (1 << 2) | ||
211 | #define ONENAND_ECC_4BIT (1 << 3) | ||
212 | #define ONENAND_ECC_4BIT_UNCORRECTABLE (0x1010) | ||
210 | 213 | ||
211 | /* | 214 | /* |
212 | * One-Time Programmable (OTP) | 215 | * One-Time Programmable (OTP) |
diff --git a/include/linux/namei.h b/include/linux/namei.h index d870ae2faedc..ec0f607b364a 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -40,7 +40,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
40 | * - follow links at the end | 40 | * - follow links at the end |
41 | * - require a directory | 41 | * - require a directory |
42 | * - ending slashes ok even for nonexistent files | 42 | * - ending slashes ok even for nonexistent files |
43 | * - internal "there are more path compnents" flag | 43 | * - internal "there are more path components" flag |
44 | * - locked when lookup done with dcache_lock held | 44 | * - locked when lookup done with dcache_lock held |
45 | * - dentry cache is untrusted; force a real lookup | 45 | * - dentry cache is untrusted; force a real lookup |
46 | */ | 46 | */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 080f6ba9e73a..ab5d3126831f 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -187,6 +187,7 @@ extern struct sock *netlink_kernel_create(struct net *net, | |||
187 | extern void netlink_kernel_release(struct sock *sk); | 187 | extern void netlink_kernel_release(struct sock *sk); |
188 | extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); | 188 | extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); |
189 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); | 189 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); |
190 | extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group); | ||
190 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); | 191 | extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group); |
191 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 192 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
192 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | 193 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 33b283601f62..c4c060208109 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -234,7 +234,7 @@ enum nfs_opnum4 { | |||
234 | Needs to be updated if more operations are defined in future.*/ | 234 | Needs to be updated if more operations are defined in future.*/ |
235 | 235 | ||
236 | #define FIRST_NFS4_OP OP_ACCESS | 236 | #define FIRST_NFS4_OP OP_ACCESS |
237 | #define LAST_NFS4_OP OP_RELEASE_LOCKOWNER | 237 | #define LAST_NFS4_OP OP_RECLAIM_COMPLETE |
238 | 238 | ||
239 | enum nfsstat4 { | 239 | enum nfsstat4 { |
240 | NFS4_OK = 0, | 240 | NFS4_OK = 0, |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 2b49d676d0c9..510ffdd5020e 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -56,8 +56,11 @@ extern struct svc_version nfsd_version2, nfsd_version3, | |||
56 | extern u32 nfsd_supported_minorversion; | 56 | extern u32 nfsd_supported_minorversion; |
57 | extern struct mutex nfsd_mutex; | 57 | extern struct mutex nfsd_mutex; |
58 | extern struct svc_serv *nfsd_serv; | 58 | extern struct svc_serv *nfsd_serv; |
59 | extern spinlock_t nfsd_drc_lock; | ||
60 | extern unsigned int nfsd_drc_max_mem; | ||
61 | extern unsigned int nfsd_drc_mem_used; | ||
59 | 62 | ||
60 | extern struct seq_operations nfs_exports_op; | 63 | extern const struct seq_operations nfs_exports_op; |
61 | 64 | ||
62 | /* | 65 | /* |
63 | * Function prototypes. | 66 | * Function prototypes. |
@@ -163,7 +166,7 @@ extern int nfsd_max_blksize; | |||
163 | extern unsigned int max_delegations; | 166 | extern unsigned int max_delegations; |
164 | int nfs4_state_init(void); | 167 | int nfs4_state_init(void); |
165 | void nfsd4_free_slabs(void); | 168 | void nfsd4_free_slabs(void); |
166 | void nfs4_state_start(void); | 169 | int nfs4_state_start(void); |
167 | void nfs4_state_shutdown(void); | 170 | void nfs4_state_shutdown(void); |
168 | time_t nfs4_lease_time(void); | 171 | time_t nfs4_lease_time(void); |
169 | void nfs4_reset_lease(time_t leasetime); | 172 | void nfs4_reset_lease(time_t leasetime); |
@@ -171,7 +174,7 @@ int nfs4_reset_recoverydir(char *recdir); | |||
171 | #else | 174 | #else |
172 | static inline int nfs4_state_init(void) { return 0; } | 175 | static inline int nfs4_state_init(void) { return 0; } |
173 | static inline void nfsd4_free_slabs(void) { } | 176 | static inline void nfsd4_free_slabs(void) { } |
174 | static inline void nfs4_state_start(void) { } | 177 | static inline int nfs4_state_start(void) { return 0; } |
175 | static inline void nfs4_state_shutdown(void) { } | 178 | static inline void nfs4_state_shutdown(void) { } |
176 | static inline time_t nfs4_lease_time(void) { return 0; } | 179 | static inline time_t nfs4_lease_time(void) { return 0; } |
177 | static inline void nfs4_reset_lease(time_t leasetime) { } | 180 | static inline void nfs4_reset_lease(time_t leasetime) { } |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index 57ab2ed08459..b38d11324189 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -60,6 +60,12 @@ typedef struct { | |||
60 | #define si_stateownerid si_opaque.so_stateownerid | 60 | #define si_stateownerid si_opaque.so_stateownerid |
61 | #define si_fileid si_opaque.so_fileid | 61 | #define si_fileid si_opaque.so_fileid |
62 | 62 | ||
63 | struct nfsd4_cb_sequence { | ||
64 | /* args/res */ | ||
65 | u32 cbs_minorversion; | ||
66 | struct nfs4_client *cbs_clp; | ||
67 | }; | ||
68 | |||
63 | struct nfs4_delegation { | 69 | struct nfs4_delegation { |
64 | struct list_head dl_perfile; | 70 | struct list_head dl_perfile; |
65 | struct list_head dl_perclnt; | 71 | struct list_head dl_perclnt; |
@@ -81,38 +87,35 @@ struct nfs4_delegation { | |||
81 | /* client delegation callback info */ | 87 | /* client delegation callback info */ |
82 | struct nfs4_cb_conn { | 88 | struct nfs4_cb_conn { |
83 | /* SETCLIENTID info */ | 89 | /* SETCLIENTID info */ |
84 | u32 cb_addr; | 90 | struct sockaddr_storage cb_addr; |
85 | unsigned short cb_port; | 91 | size_t cb_addrlen; |
86 | u32 cb_prog; | 92 | u32 cb_prog; |
87 | u32 cb_minorversion; | 93 | u32 cb_minorversion; |
88 | u32 cb_ident; /* minorversion 0 only */ | 94 | u32 cb_ident; /* minorversion 0 only */ |
89 | /* RPC client info */ | 95 | /* RPC client info */ |
90 | atomic_t cb_set; /* successful CB_NULL call */ | 96 | atomic_t cb_set; /* successful CB_NULL call */ |
91 | struct rpc_clnt * cb_client; | 97 | struct rpc_clnt * cb_client; |
92 | struct rpc_cred * cb_cred; | ||
93 | }; | 98 | }; |
94 | 99 | ||
95 | /* Maximum number of slots per session. 128 is useful for long haul TCP */ | 100 | /* Maximum number of slots per session. 160 is useful for long haul TCP */ |
96 | #define NFSD_MAX_SLOTS_PER_SESSION 128 | 101 | #define NFSD_MAX_SLOTS_PER_SESSION 160 |
97 | /* Maximum number of pages per slot cache entry */ | ||
98 | #define NFSD_PAGES_PER_SLOT 1 | ||
99 | /* Maximum number of operations per session compound */ | 102 | /* Maximum number of operations per session compound */ |
100 | #define NFSD_MAX_OPS_PER_COMPOUND 16 | 103 | #define NFSD_MAX_OPS_PER_COMPOUND 16 |
101 | 104 | /* Maximum session per slot cache size */ | |
102 | struct nfsd4_cache_entry { | 105 | #define NFSD_SLOT_CACHE_SIZE 1024 |
103 | __be32 ce_status; | 106 | /* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */ |
104 | struct kvec ce_datav; /* encoded NFSv4.1 data in rq_res.head[0] */ | 107 | #define NFSD_CACHE_SIZE_SLOTS_PER_SESSION 32 |
105 | struct page *ce_respages[NFSD_PAGES_PER_SLOT + 1]; | 108 | #define NFSD_MAX_MEM_PER_SESSION \ |
106 | int ce_cachethis; | 109 | (NFSD_CACHE_SIZE_SLOTS_PER_SESSION * NFSD_SLOT_CACHE_SIZE) |
107 | short ce_resused; | ||
108 | int ce_opcnt; | ||
109 | int ce_rpchdrlen; | ||
110 | }; | ||
111 | 110 | ||
112 | struct nfsd4_slot { | 111 | struct nfsd4_slot { |
113 | bool sl_inuse; | 112 | bool sl_inuse; |
114 | u32 sl_seqid; | 113 | bool sl_cachethis; |
115 | struct nfsd4_cache_entry sl_cache_entry; | 114 | u16 sl_opcnt; |
115 | u32 sl_seqid; | ||
116 | __be32 sl_status; | ||
117 | u32 sl_datalen; | ||
118 | char sl_data[]; | ||
116 | }; | 119 | }; |
117 | 120 | ||
118 | struct nfsd4_channel_attrs { | 121 | struct nfsd4_channel_attrs { |
@@ -126,6 +129,25 @@ struct nfsd4_channel_attrs { | |||
126 | u32 rdma_attrs; | 129 | u32 rdma_attrs; |
127 | }; | 130 | }; |
128 | 131 | ||
132 | struct nfsd4_create_session { | ||
133 | clientid_t clientid; | ||
134 | struct nfs4_sessionid sessionid; | ||
135 | u32 seqid; | ||
136 | u32 flags; | ||
137 | struct nfsd4_channel_attrs fore_channel; | ||
138 | struct nfsd4_channel_attrs back_channel; | ||
139 | u32 callback_prog; | ||
140 | u32 uid; | ||
141 | u32 gid; | ||
142 | }; | ||
143 | |||
144 | /* The single slot clientid cache structure */ | ||
145 | struct nfsd4_clid_slot { | ||
146 | u32 sl_seqid; | ||
147 | __be32 sl_status; | ||
148 | struct nfsd4_create_session sl_cr_ses; | ||
149 | }; | ||
150 | |||
129 | struct nfsd4_session { | 151 | struct nfsd4_session { |
130 | struct kref se_ref; | 152 | struct kref se_ref; |
131 | struct list_head se_hash; /* hash by sessionid */ | 153 | struct list_head se_hash; /* hash by sessionid */ |
@@ -135,7 +157,7 @@ struct nfsd4_session { | |||
135 | struct nfs4_sessionid se_sessionid; | 157 | struct nfs4_sessionid se_sessionid; |
136 | struct nfsd4_channel_attrs se_fchannel; | 158 | struct nfsd4_channel_attrs se_fchannel; |
137 | struct nfsd4_channel_attrs se_bchannel; | 159 | struct nfsd4_channel_attrs se_bchannel; |
138 | struct nfsd4_slot se_slots[]; /* forward channel slots */ | 160 | struct nfsd4_slot *se_slots[]; /* forward channel slots */ |
139 | }; | 161 | }; |
140 | 162 | ||
141 | static inline void | 163 | static inline void |
@@ -180,7 +202,7 @@ struct nfs4_client { | |||
180 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ | 202 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ |
181 | nfs4_verifier cl_verifier; /* generated by client */ | 203 | nfs4_verifier cl_verifier; /* generated by client */ |
182 | time_t cl_time; /* time of last lease renewal */ | 204 | time_t cl_time; /* time of last lease renewal */ |
183 | __be32 cl_addr; /* client ipaddress */ | 205 | struct sockaddr_storage cl_addr; /* client ipaddress */ |
184 | u32 cl_flavor; /* setclientid pseudoflavor */ | 206 | u32 cl_flavor; /* setclientid pseudoflavor */ |
185 | char *cl_principal; /* setclientid principal name */ | 207 | char *cl_principal; /* setclientid principal name */ |
186 | struct svc_cred cl_cred; /* setclientid principal */ | 208 | struct svc_cred cl_cred; /* setclientid principal */ |
@@ -192,9 +214,17 @@ struct nfs4_client { | |||
192 | 214 | ||
193 | /* for nfs41 */ | 215 | /* for nfs41 */ |
194 | struct list_head cl_sessions; | 216 | struct list_head cl_sessions; |
195 | struct nfsd4_slot cl_slot; /* create_session slot */ | 217 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ |
196 | u32 cl_exchange_flags; | 218 | u32 cl_exchange_flags; |
197 | struct nfs4_sessionid cl_sessionid; | 219 | struct nfs4_sessionid cl_sessionid; |
220 | |||
221 | /* for nfs41 callbacks */ | ||
222 | /* We currently support a single back channel with a single slot */ | ||
223 | unsigned long cl_cb_slot_busy; | ||
224 | u32 cl_cb_seq_nr; | ||
225 | struct svc_xprt *cl_cb_xprt; /* 4.1 callback transport */ | ||
226 | struct rpc_wait_queue cl_cb_waitq; /* backchannel callers may */ | ||
227 | /* wait here for slots */ | ||
198 | }; | 228 | }; |
199 | 229 | ||
200 | /* struct nfs4_client_reset | 230 | /* struct nfs4_client_reset |
@@ -345,6 +375,7 @@ extern int nfs4_in_grace(void); | |||
345 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); | 375 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); |
346 | extern void put_nfs4_client(struct nfs4_client *clp); | 376 | extern void put_nfs4_client(struct nfs4_client *clp); |
347 | extern void nfs4_free_stateowner(struct kref *kref); | 377 | extern void nfs4_free_stateowner(struct kref *kref); |
378 | extern int set_callback_cred(void); | ||
348 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | 379 | extern void nfsd4_probe_callback(struct nfs4_client *clp); |
349 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); | 380 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); |
350 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); | 381 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); |
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index 2bacf7535069..73164c2b3d29 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
@@ -51,7 +51,7 @@ struct nfsd4_compound_state { | |||
51 | /* For sessions DRC */ | 51 | /* For sessions DRC */ |
52 | struct nfsd4_session *session; | 52 | struct nfsd4_session *session; |
53 | struct nfsd4_slot *slot; | 53 | struct nfsd4_slot *slot; |
54 | __be32 *statp; | 54 | __be32 *datap; |
55 | size_t iovlen; | 55 | size_t iovlen; |
56 | u32 minorversion; | 56 | u32 minorversion; |
57 | u32 status; | 57 | u32 status; |
@@ -366,18 +366,6 @@ struct nfsd4_exchange_id { | |||
366 | int spa_how; | 366 | int spa_how; |
367 | }; | 367 | }; |
368 | 368 | ||
369 | struct nfsd4_create_session { | ||
370 | clientid_t clientid; | ||
371 | struct nfs4_sessionid sessionid; | ||
372 | u32 seqid; | ||
373 | u32 flags; | ||
374 | struct nfsd4_channel_attrs fore_channel; | ||
375 | struct nfsd4_channel_attrs back_channel; | ||
376 | u32 callback_prog; | ||
377 | u32 uid; | ||
378 | u32 gid; | ||
379 | }; | ||
380 | |||
381 | struct nfsd4_sequence { | 369 | struct nfsd4_sequence { |
382 | struct nfs4_sessionid sessionid; /* request/response */ | 370 | struct nfs4_sessionid sessionid; /* request/response */ |
383 | u32 seqid; /* request/response */ | 371 | u32 seqid; /* request/response */ |
@@ -479,13 +467,12 @@ struct nfsd4_compoundres { | |||
479 | static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp) | 467 | static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp) |
480 | { | 468 | { |
481 | struct nfsd4_compoundargs *args = resp->rqstp->rq_argp; | 469 | struct nfsd4_compoundargs *args = resp->rqstp->rq_argp; |
482 | return args->opcnt == 1; | 470 | return resp->opcnt == 1 && args->ops[0].opnum == OP_SEQUENCE; |
483 | } | 471 | } |
484 | 472 | ||
485 | static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp) | 473 | static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp) |
486 | { | 474 | { |
487 | return !resp->cstate.slot->sl_cache_entry.ce_cachethis || | 475 | return !resp->cstate.slot->sl_cachethis || nfsd4_is_solo_sequence(resp); |
488 | nfsd4_is_solo_sequence(resp); | ||
489 | } | 476 | } |
490 | 477 | ||
491 | #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) | 478 | #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) |
diff --git a/include/linux/oom.h b/include/linux/oom.h index a7979baf1e39..6aac5fe4f6f1 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -30,5 +30,16 @@ extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); | |||
30 | extern int register_oom_notifier(struct notifier_block *nb); | 30 | extern int register_oom_notifier(struct notifier_block *nb); |
31 | extern int unregister_oom_notifier(struct notifier_block *nb); | 31 | extern int unregister_oom_notifier(struct notifier_block *nb); |
32 | 32 | ||
33 | extern bool oom_killer_disabled; | ||
34 | |||
35 | static inline void oom_killer_disable(void) | ||
36 | { | ||
37 | oom_killer_disabled = true; | ||
38 | } | ||
39 | |||
40 | static inline void oom_killer_enable(void) | ||
41 | { | ||
42 | oom_killer_disabled = false; | ||
43 | } | ||
33 | #endif /* __KERNEL__*/ | 44 | #endif /* __KERNEL__*/ |
34 | #endif /* _INCLUDE_LINUX_OOM_H */ | 45 | #endif /* _INCLUDE_LINUX_OOM_H */ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 2b87acfc5f87..6b202b173955 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -51,6 +51,9 @@ | |||
51 | * PG_buddy is set to indicate that the page is free and in the buddy system | 51 | * PG_buddy is set to indicate that the page is free and in the buddy system |
52 | * (see mm/page_alloc.c). | 52 | * (see mm/page_alloc.c). |
53 | * | 53 | * |
54 | * PG_hwpoison indicates that a page got corrupted in hardware and contains | ||
55 | * data with incorrect ECC bits that triggered a machine check. Accessing is | ||
56 | * not safe since it may cause another machine check. Don't touch! | ||
54 | */ | 57 | */ |
55 | 58 | ||
56 | /* | 59 | /* |
@@ -102,6 +105,9 @@ enum pageflags { | |||
102 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED | 105 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED |
103 | PG_uncached, /* Page has been mapped as uncached */ | 106 | PG_uncached, /* Page has been mapped as uncached */ |
104 | #endif | 107 | #endif |
108 | #ifdef CONFIG_MEMORY_FAILURE | ||
109 | PG_hwpoison, /* hardware poisoned page. Don't touch */ | ||
110 | #endif | ||
105 | __NR_PAGEFLAGS, | 111 | __NR_PAGEFLAGS, |
106 | 112 | ||
107 | /* Filesystems */ | 113 | /* Filesystems */ |
@@ -158,6 +164,9 @@ static inline int TestSetPage##uname(struct page *page) \ | |||
158 | static inline int TestClearPage##uname(struct page *page) \ | 164 | static inline int TestClearPage##uname(struct page *page) \ |
159 | { return test_and_clear_bit(PG_##lname, &page->flags); } | 165 | { return test_and_clear_bit(PG_##lname, &page->flags); } |
160 | 166 | ||
167 | #define __TESTCLEARFLAG(uname, lname) \ | ||
168 | static inline int __TestClearPage##uname(struct page *page) \ | ||
169 | { return __test_and_clear_bit(PG_##lname, &page->flags); } | ||
161 | 170 | ||
162 | #define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ | 171 | #define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ |
163 | SETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname) | 172 | SETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname) |
@@ -184,6 +193,9 @@ static inline void __ClearPage##uname(struct page *page) { } | |||
184 | #define TESTCLEARFLAG_FALSE(uname) \ | 193 | #define TESTCLEARFLAG_FALSE(uname) \ |
185 | static inline int TestClearPage##uname(struct page *page) { return 0; } | 194 | static inline int TestClearPage##uname(struct page *page) { return 0; } |
186 | 195 | ||
196 | #define __TESTCLEARFLAG_FALSE(uname) \ | ||
197 | static inline int __TestClearPage##uname(struct page *page) { return 0; } | ||
198 | |||
187 | struct page; /* forward declaration */ | 199 | struct page; /* forward declaration */ |
188 | 200 | ||
189 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) | 201 | TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) |
@@ -250,11 +262,11 @@ PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) | |||
250 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 262 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
251 | #define MLOCK_PAGES 1 | 263 | #define MLOCK_PAGES 1 |
252 | PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) | 264 | PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) |
253 | TESTSCFLAG(Mlocked, mlocked) | 265 | TESTSCFLAG(Mlocked, mlocked) __TESTCLEARFLAG(Mlocked, mlocked) |
254 | #else | 266 | #else |
255 | #define MLOCK_PAGES 0 | 267 | #define MLOCK_PAGES 0 |
256 | PAGEFLAG_FALSE(Mlocked) | 268 | PAGEFLAG_FALSE(Mlocked) SETPAGEFLAG_NOOP(Mlocked) |
257 | SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked) | 269 | TESTCLEARFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked) |
258 | #endif | 270 | #endif |
259 | 271 | ||
260 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED | 272 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED |
@@ -263,6 +275,15 @@ PAGEFLAG(Uncached, uncached) | |||
263 | PAGEFLAG_FALSE(Uncached) | 275 | PAGEFLAG_FALSE(Uncached) |
264 | #endif | 276 | #endif |
265 | 277 | ||
278 | #ifdef CONFIG_MEMORY_FAILURE | ||
279 | PAGEFLAG(HWPoison, hwpoison) | ||
280 | TESTSETFLAG(HWPoison, hwpoison) | ||
281 | #define __PG_HWPOISON (1UL << PG_hwpoison) | ||
282 | #else | ||
283 | PAGEFLAG_FALSE(HWPoison) | ||
284 | #define __PG_HWPOISON 0 | ||
285 | #endif | ||
286 | |||
266 | static inline int PageUptodate(struct page *page) | 287 | static inline int PageUptodate(struct page *page) |
267 | { | 288 | { |
268 | int ret = test_bit(PG_uptodate, &(page)->flags); | 289 | int ret = test_bit(PG_uptodate, &(page)->flags); |
@@ -387,7 +408,7 @@ static inline void __ClearPageTail(struct page *page) | |||
387 | 1 << PG_private | 1 << PG_private_2 | \ | 408 | 1 << PG_private | 1 << PG_private_2 | \ |
388 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ | 409 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ |
389 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | 410 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ |
390 | 1 << PG_unevictable | __PG_MLOCKED) | 411 | 1 << PG_unevictable | __PG_MLOCKED | __PG_HWPOISON) |
391 | 412 | ||
392 | /* | 413 | /* |
393 | * Flags checked when a page is prepped for return by the page allocator. | 414 | * Flags checked when a page is prepped for return by the page allocator. |
@@ -396,8 +417,8 @@ static inline void __ClearPageTail(struct page *page) | |||
396 | */ | 417 | */ |
397 | #define PAGE_FLAGS_CHECK_AT_PREP ((1 << NR_PAGEFLAGS) - 1) | 418 | #define PAGE_FLAGS_CHECK_AT_PREP ((1 << NR_PAGEFLAGS) - 1) |
398 | 419 | ||
399 | #endif /* !__GENERATING_BOUNDS_H */ | 420 | #define PAGE_FLAGS_PRIVATE \ |
400 | 421 | (1 << PG_private | 1 << PG_private_2) | |
401 | /** | 422 | /** |
402 | * page_has_private - Determine if page has private stuff | 423 | * page_has_private - Determine if page has private stuff |
403 | * @page: The page to be checked | 424 | * @page: The page to be checked |
@@ -405,8 +426,11 @@ static inline void __ClearPageTail(struct page *page) | |||
405 | * Determine if a page has private stuff, indicating that release routines | 426 | * Determine if a page has private stuff, indicating that release routines |
406 | * should be invoked upon it. | 427 | * should be invoked upon it. |
407 | */ | 428 | */ |
408 | #define page_has_private(page) \ | 429 | static inline int page_has_private(struct page *page) |
409 | ((page)->flags & ((1 << PG_private) | \ | 430 | { |
410 | (1 << PG_private_2))) | 431 | return !!(page->flags & PAGE_FLAGS_PRIVATE); |
432 | } | ||
433 | |||
434 | #endif /* !__GENERATING_BOUNDS_H */ | ||
411 | 435 | ||
412 | #endif /* PAGE_FLAGS_H */ | 436 | #endif /* PAGE_FLAGS_H */ |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index ada779f24178..4b938d4f3ac2 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -38,6 +38,7 @@ enum { | |||
38 | PCG_LOCK, /* page cgroup is locked */ | 38 | PCG_LOCK, /* page cgroup is locked */ |
39 | PCG_CACHE, /* charged as cache */ | 39 | PCG_CACHE, /* charged as cache */ |
40 | PCG_USED, /* this object is in use. */ | 40 | PCG_USED, /* this object is in use. */ |
41 | PCG_ACCT_LRU, /* page has been accounted for */ | ||
41 | }; | 42 | }; |
42 | 43 | ||
43 | #define TESTPCGFLAG(uname, lname) \ | 44 | #define TESTPCGFLAG(uname, lname) \ |
@@ -52,11 +53,23 @@ static inline void SetPageCgroup##uname(struct page_cgroup *pc)\ | |||
52 | static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ | 53 | static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ |
53 | { clear_bit(PCG_##lname, &pc->flags); } | 54 | { clear_bit(PCG_##lname, &pc->flags); } |
54 | 55 | ||
56 | #define TESTCLEARPCGFLAG(uname, lname) \ | ||
57 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ | ||
58 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } | ||
59 | |||
55 | /* Cache flag is set only once (at allocation) */ | 60 | /* Cache flag is set only once (at allocation) */ |
56 | TESTPCGFLAG(Cache, CACHE) | 61 | TESTPCGFLAG(Cache, CACHE) |
62 | CLEARPCGFLAG(Cache, CACHE) | ||
63 | SETPCGFLAG(Cache, CACHE) | ||
57 | 64 | ||
58 | TESTPCGFLAG(Used, USED) | 65 | TESTPCGFLAG(Used, USED) |
59 | CLEARPCGFLAG(Used, USED) | 66 | CLEARPCGFLAG(Used, USED) |
67 | SETPCGFLAG(Used, USED) | ||
68 | |||
69 | SETPCGFLAG(AcctLRU, ACCT_LRU) | ||
70 | CLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
71 | TESTPCGFLAG(AcctLRU, ACCT_LRU) | ||
72 | TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) | ||
60 | 73 | ||
61 | static inline int page_cgroup_nid(struct page_cgroup *pc) | 74 | static inline int page_cgroup_nid(struct page_cgroup *pc) |
62 | { | 75 | { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 3b6b788fe2b5..da1fda8623e0 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -543,6 +543,7 @@ | |||
543 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 | 543 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
544 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | 544 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 |
545 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 | 545 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 |
546 | #define PCI_DEVICE_ID_AMD_SB900_SMBUS 0x780b | ||
546 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F | 547 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F |
547 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 548 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
548 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 549 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
@@ -2526,6 +2527,16 @@ | |||
2526 | #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e | 2527 | #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e |
2527 | #define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b | 2528 | #define PCI_DEVICE_ID_INTEL_IOAT_CNB 0x360b |
2528 | #define PCI_DEVICE_ID_INTEL_FBD_CNB 0x360c | 2529 | #define PCI_DEVICE_ID_INTEL_FBD_CNB 0x360c |
2530 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF0 0x3710 | ||
2531 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF1 0x3711 | ||
2532 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF2 0x3712 | ||
2533 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF3 0x3713 | ||
2534 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF4 0x3714 | ||
2535 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF5 0x3715 | ||
2536 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF6 0x3716 | ||
2537 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF7 0x3717 | ||
2538 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF8 0x3718 | ||
2539 | #define PCI_DEVICE_ID_INTEL_IOAT_JSF9 0x3719 | ||
2529 | #define PCI_DEVICE_ID_INTEL_ICH10_0 0x3a14 | 2540 | #define PCI_DEVICE_ID_INTEL_ICH10_0 0x3a14 |
2530 | #define PCI_DEVICE_ID_INTEL_ICH10_1 0x3a16 | 2541 | #define PCI_DEVICE_ID_INTEL_ICH10_1 0x3a16 |
2531 | #define PCI_DEVICE_ID_INTEL_ICH10_2 0x3a18 | 2542 | #define PCI_DEVICE_ID_INTEL_ICH10_2 0x3a18 |
diff --git a/include/linux/phonet.h b/include/linux/phonet.h index 1ef5a0781831..e5126cff9b2a 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define PNPIPE_IFINDEX 2 | 38 | #define PNPIPE_IFINDEX 2 |
39 | 39 | ||
40 | #define PNADDR_ANY 0 | 40 | #define PNADDR_ANY 0 |
41 | #define PNADDR_BROADCAST 0xFC | ||
41 | #define PNPORT_RESOURCE_ROUTING 0 | 42 | #define PNPORT_RESOURCE_ROUTING 0 |
42 | 43 | ||
43 | /* Values for PNPIPE_ENCAP option */ | 44 | /* Values for PNPIPE_ENCAP option */ |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index b063c7328ba5..fddfafaed024 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -360,6 +360,7 @@ struct pnp_driver { | |||
360 | unsigned int flags; | 360 | unsigned int flags; |
361 | int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); | 361 | int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); |
362 | void (*remove) (struct pnp_dev *dev); | 362 | void (*remove) (struct pnp_dev *dev); |
363 | void (*shutdown) (struct pnp_dev *dev); | ||
363 | int (*suspend) (struct pnp_dev *dev, pm_message_t state); | 364 | int (*suspend) (struct pnp_dev *dev, pm_message_t state); |
364 | int (*resume) (struct pnp_dev *dev); | 365 | int (*resume) (struct pnp_dev *dev); |
365 | struct device_driver driver; | 366 | struct device_driver driver; |
diff --git a/include/linux/poison.h b/include/linux/poison.h index 6729f7dcd60e..7fc194aef8c2 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
@@ -65,6 +65,9 @@ | |||
65 | #define MUTEX_DEBUG_INIT 0x11 | 65 | #define MUTEX_DEBUG_INIT 0x11 |
66 | #define MUTEX_DEBUG_FREE 0x22 | 66 | #define MUTEX_DEBUG_FREE 0x22 |
67 | 67 | ||
68 | /********** lib/flex_array.c **********/ | ||
69 | #define FLEX_ARRAY_FREE 0x6c /* for use-after-free poisoning */ | ||
70 | |||
68 | /********** security/ **********/ | 71 | /********** security/ **********/ |
69 | #define KEY_DESTROY 0xbd | 72 | #define KEY_DESTROY 0xbd |
70 | 73 | ||
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 594c494ac3f0..b5d096d3a9be 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -39,6 +39,13 @@ enum { | |||
39 | }; | 39 | }; |
40 | 40 | ||
41 | enum { | 41 | enum { |
42 | POWER_SUPPLY_CHARGE_TYPE_UNKNOWN = 0, | ||
43 | POWER_SUPPLY_CHARGE_TYPE_NONE, | ||
44 | POWER_SUPPLY_CHARGE_TYPE_TRICKLE, | ||
45 | POWER_SUPPLY_CHARGE_TYPE_FAST, | ||
46 | }; | ||
47 | |||
48 | enum { | ||
42 | POWER_SUPPLY_HEALTH_UNKNOWN = 0, | 49 | POWER_SUPPLY_HEALTH_UNKNOWN = 0, |
43 | POWER_SUPPLY_HEALTH_GOOD, | 50 | POWER_SUPPLY_HEALTH_GOOD, |
44 | POWER_SUPPLY_HEALTH_OVERHEAT, | 51 | POWER_SUPPLY_HEALTH_OVERHEAT, |
@@ -58,9 +65,19 @@ enum { | |||
58 | POWER_SUPPLY_TECHNOLOGY_LiMn, | 65 | POWER_SUPPLY_TECHNOLOGY_LiMn, |
59 | }; | 66 | }; |
60 | 67 | ||
68 | enum { | ||
69 | POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN = 0, | ||
70 | POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL, | ||
71 | POWER_SUPPLY_CAPACITY_LEVEL_LOW, | ||
72 | POWER_SUPPLY_CAPACITY_LEVEL_NORMAL, | ||
73 | POWER_SUPPLY_CAPACITY_LEVEL_HIGH, | ||
74 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, | ||
75 | }; | ||
76 | |||
61 | enum power_supply_property { | 77 | enum power_supply_property { |
62 | /* Properties of type `int' */ | 78 | /* Properties of type `int' */ |
63 | POWER_SUPPLY_PROP_STATUS = 0, | 79 | POWER_SUPPLY_PROP_STATUS = 0, |
80 | POWER_SUPPLY_PROP_CHARGE_TYPE, | ||
64 | POWER_SUPPLY_PROP_HEALTH, | 81 | POWER_SUPPLY_PROP_HEALTH, |
65 | POWER_SUPPLY_PROP_PRESENT, | 82 | POWER_SUPPLY_PROP_PRESENT, |
66 | POWER_SUPPLY_PROP_ONLINE, | 83 | POWER_SUPPLY_PROP_ONLINE, |
@@ -89,6 +106,7 @@ enum power_supply_property { | |||
89 | POWER_SUPPLY_PROP_ENERGY_NOW, | 106 | POWER_SUPPLY_PROP_ENERGY_NOW, |
90 | POWER_SUPPLY_PROP_ENERGY_AVG, | 107 | POWER_SUPPLY_PROP_ENERGY_AVG, |
91 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ | 108 | POWER_SUPPLY_PROP_CAPACITY, /* in percents! */ |
109 | POWER_SUPPLY_PROP_CAPACITY_LEVEL, | ||
92 | POWER_SUPPLY_PROP_TEMP, | 110 | POWER_SUPPLY_PROP_TEMP, |
93 | POWER_SUPPLY_PROP_TEMP_AMBIENT, | 111 | POWER_SUPPLY_PROP_TEMP_AMBIENT, |
94 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, | 112 | POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, |
@@ -126,6 +144,7 @@ struct power_supply { | |||
126 | enum power_supply_property psp, | 144 | enum power_supply_property psp, |
127 | union power_supply_propval *val); | 145 | union power_supply_propval *val); |
128 | void (*external_power_changed)(struct power_supply *psy); | 146 | void (*external_power_changed)(struct power_supply *psy); |
147 | void (*set_charged)(struct power_supply *psy); | ||
129 | 148 | ||
130 | /* For APM emulation, think legacy userspace. */ | 149 | /* For APM emulation, think legacy userspace. */ |
131 | int use_for_apm; | 150 | int use_for_apm; |
@@ -165,8 +184,10 @@ struct power_supply_info { | |||
165 | int use_for_apm; | 184 | int use_for_apm; |
166 | }; | 185 | }; |
167 | 186 | ||
187 | extern struct power_supply *power_supply_get_by_name(char *name); | ||
168 | extern void power_supply_changed(struct power_supply *psy); | 188 | extern void power_supply_changed(struct power_supply *psy); |
169 | extern int power_supply_am_i_supplied(struct power_supply *psy); | 189 | extern int power_supply_am_i_supplied(struct power_supply *psy); |
190 | extern int power_supply_set_battery_charged(struct power_supply *psy); | ||
170 | 191 | ||
171 | #if defined(CONFIG_POWER_SUPPLY) || defined(CONFIG_POWER_SUPPLY_MODULE) | 192 | #if defined(CONFIG_POWER_SUPPLY) || defined(CONFIG_POWER_SUPPLY_MODULE) |
172 | extern int power_supply_is_system_supplied(void); | 193 | extern int power_supply_is_system_supplied(void); |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index 07bff666e65b..931150566ade 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
@@ -88,4 +88,6 @@ | |||
88 | #define PR_TASK_PERF_EVENTS_DISABLE 31 | 88 | #define PR_TASK_PERF_EVENTS_DISABLE 31 |
89 | #define PR_TASK_PERF_EVENTS_ENABLE 32 | 89 | #define PR_TASK_PERF_EVENTS_ENABLE 32 |
90 | 90 | ||
91 | #define PR_MCE_KILL 33 | ||
92 | |||
91 | #endif /* _LINUX_PRCTL_H */ | 93 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index e6e77d31c418..379eaed72d4b 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -78,10 +78,19 @@ struct proc_dir_entry { | |||
78 | struct list_head pde_openers; /* who did ->open, but not ->release */ | 78 | struct list_head pde_openers; /* who did ->open, but not ->release */ |
79 | }; | 79 | }; |
80 | 80 | ||
81 | enum kcore_type { | ||
82 | KCORE_TEXT, | ||
83 | KCORE_VMALLOC, | ||
84 | KCORE_RAM, | ||
85 | KCORE_VMEMMAP, | ||
86 | KCORE_OTHER, | ||
87 | }; | ||
88 | |||
81 | struct kcore_list { | 89 | struct kcore_list { |
82 | struct kcore_list *next; | 90 | struct list_head list; |
83 | unsigned long addr; | 91 | unsigned long addr; |
84 | size_t size; | 92 | size_t size; |
93 | int type; | ||
85 | }; | 94 | }; |
86 | 95 | ||
87 | struct vmcore { | 96 | struct vmcore { |
@@ -233,11 +242,12 @@ static inline void dup_mm_exe_file(struct mm_struct *oldmm, | |||
233 | #endif /* CONFIG_PROC_FS */ | 242 | #endif /* CONFIG_PROC_FS */ |
234 | 243 | ||
235 | #if !defined(CONFIG_PROC_KCORE) | 244 | #if !defined(CONFIG_PROC_KCORE) |
236 | static inline void kclist_add(struct kcore_list *new, void *addr, size_t size) | 245 | static inline void |
246 | kclist_add(struct kcore_list *new, void *addr, size_t size, int type) | ||
237 | { | 247 | { |
238 | } | 248 | } |
239 | #else | 249 | #else |
240 | extern void kclist_add(struct kcore_list *, void *, size_t); | 250 | extern void kclist_add(struct kcore_list *, void *, size_t, int type); |
241 | #endif | 251 | #endif |
242 | 252 | ||
243 | union proc_op { | 253 | union proc_op { |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 26361c4c037a..3ebb23153640 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -135,8 +135,8 @@ static inline int sb_any_quota_active(struct super_block *sb) | |||
135 | /* | 135 | /* |
136 | * Operations supported for diskquotas. | 136 | * Operations supported for diskquotas. |
137 | */ | 137 | */ |
138 | extern struct dquot_operations dquot_operations; | 138 | extern const struct dquot_operations dquot_operations; |
139 | extern struct quotactl_ops vfs_quotactl_ops; | 139 | extern const struct quotactl_ops vfs_quotactl_ops; |
140 | 140 | ||
141 | #define sb_dquot_ops (&dquot_operations) | 141 | #define sb_dquot_ops (&dquot_operations) |
142 | #define sb_quotactl_ops (&vfs_quotactl_ops) | 142 | #define sb_quotactl_ops (&vfs_quotactl_ops) |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 277f4b964df5..490c5b37b6d7 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -125,6 +125,8 @@ struct regulator_bulk_data { | |||
125 | /* regulator get and put */ | 125 | /* regulator get and put */ |
126 | struct regulator *__must_check regulator_get(struct device *dev, | 126 | struct regulator *__must_check regulator_get(struct device *dev, |
127 | const char *id); | 127 | const char *id); |
128 | struct regulator *__must_check regulator_get_exclusive(struct device *dev, | ||
129 | const char *id); | ||
128 | void regulator_put(struct regulator *regulator); | 130 | void regulator_put(struct regulator *regulator); |
129 | 131 | ||
130 | /* regulator output control and status */ | 132 | /* regulator output control and status */ |
@@ -144,6 +146,8 @@ void regulator_bulk_free(int num_consumers, | |||
144 | 146 | ||
145 | int regulator_count_voltages(struct regulator *regulator); | 147 | int regulator_count_voltages(struct regulator *regulator); |
146 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); | 148 | int regulator_list_voltage(struct regulator *regulator, unsigned selector); |
149 | int regulator_is_supported_voltage(struct regulator *regulator, | ||
150 | int min_uV, int max_uV); | ||
147 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); | 151 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); |
148 | int regulator_get_voltage(struct regulator *regulator); | 152 | int regulator_get_voltage(struct regulator *regulator); |
149 | int regulator_set_current_limit(struct regulator *regulator, | 153 | int regulator_set_current_limit(struct regulator *regulator, |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index ce1be708ca16..31f2055eae28 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
@@ -37,7 +37,8 @@ enum regulator_status { | |||
37 | * | 37 | * |
38 | * @enable: Configure the regulator as enabled. | 38 | * @enable: Configure the regulator as enabled. |
39 | * @disable: Configure the regulator as disabled. | 39 | * @disable: Configure the regulator as disabled. |
40 | * @is_enabled: Return 1 if the regulator is enabled, 0 otherwise. | 40 | * @is_enabled: Return 1 if the regulator is enabled, 0 if not. |
41 | * May also return negative errno. | ||
41 | * | 42 | * |
42 | * @set_voltage: Set the voltage for the regulator within the range specified. | 43 | * @set_voltage: Set the voltage for the regulator within the range specified. |
43 | * The driver should select the voltage closest to min_uV. | 44 | * The driver should select the voltage closest to min_uV. |
@@ -162,6 +163,8 @@ struct regulator_desc { | |||
162 | struct regulator_dev { | 163 | struct regulator_dev { |
163 | struct regulator_desc *desc; | 164 | struct regulator_desc *desc; |
164 | int use_count; | 165 | int use_count; |
166 | int open_count; | ||
167 | int exclusive; | ||
165 | 168 | ||
166 | /* lists we belong to */ | 169 | /* lists we belong to */ |
167 | struct list_head list; /* list of all regulators */ | 170 | struct list_head list; /* list of all regulators */ |
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h index 91b4da31f1b5..e94a4a1c7c8a 100644 --- a/include/linux/regulator/fixed.h +++ b/include/linux/regulator/fixed.h | |||
@@ -5,6 +5,9 @@ | |||
5 | * | 5 | * |
6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> | 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
7 | * | 7 | * |
8 | * Copyright (c) 2009 Nokia Corporation | ||
9 | * Roger Quadros <ext-roger.quadros@nokia.com> | ||
10 | * | ||
8 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU General Public License as | 12 | * modify it under the terms of the GNU General Public License as |
10 | * published by the Free Software Foundation; either version 2 of the | 13 | * published by the Free Software Foundation; either version 2 of the |
@@ -16,9 +19,30 @@ | |||
16 | 19 | ||
17 | struct regulator_init_data; | 20 | struct regulator_init_data; |
18 | 21 | ||
22 | /** | ||
23 | * struct fixed_voltage_config - fixed_voltage_config structure | ||
24 | * @supply_name: Name of the regulator supply | ||
25 | * @microvolts: Output voltage of regulator | ||
26 | * @gpio: GPIO to use for enable control | ||
27 | * set to -EINVAL if not used | ||
28 | * @enable_high: Polarity of enable GPIO | ||
29 | * 1 = Active high, 0 = Active low | ||
30 | * @enabled_at_boot: Whether regulator has been enabled at | ||
31 | * boot or not. 1 = Yes, 0 = No | ||
32 | * This is used to keep the regulator at | ||
33 | * the default state | ||
34 | * @init_data: regulator_init_data | ||
35 | * | ||
36 | * This structure contains fixed voltage regulator configuration | ||
37 | * information that must be passed by platform code to the fixed | ||
38 | * voltage regulator driver. | ||
39 | */ | ||
19 | struct fixed_voltage_config { | 40 | struct fixed_voltage_config { |
20 | const char *supply_name; | 41 | const char *supply_name; |
21 | int microvolts; | 42 | int microvolts; |
43 | int gpio; | ||
44 | unsigned enable_high:1; | ||
45 | unsigned enabled_at_boot:1; | ||
22 | struct regulator_init_data *init_data; | 46 | struct regulator_init_data *init_data; |
23 | }; | 47 | }; |
24 | 48 | ||
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index bac64fa390f2..87f5f176d4ef 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -41,7 +41,7 @@ struct regulator; | |||
41 | #define REGULATOR_CHANGE_DRMS 0x10 | 41 | #define REGULATOR_CHANGE_DRMS 0x10 |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct regulator_state - regulator state during low power syatem states | 44 | * struct regulator_state - regulator state during low power system states |
45 | * | 45 | * |
46 | * This describes a regulators state during a system wide low power state. | 46 | * This describes a regulators state during a system wide low power state. |
47 | * | 47 | * |
@@ -117,25 +117,37 @@ struct regulation_constraints { | |||
117 | /* mode to set on startup */ | 117 | /* mode to set on startup */ |
118 | unsigned int initial_mode; | 118 | unsigned int initial_mode; |
119 | 119 | ||
120 | /* constriant flags */ | 120 | /* constraint flags */ |
121 | unsigned always_on:1; /* regulator never off when system is on */ | 121 | unsigned always_on:1; /* regulator never off when system is on */ |
122 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ | 122 | unsigned boot_on:1; /* bootloader/firmware enabled regulator */ |
123 | unsigned apply_uV:1; /* apply uV constraint iff min == max */ | 123 | unsigned apply_uV:1; /* apply uV constraint if min == max */ |
124 | }; | 124 | }; |
125 | 125 | ||
126 | /** | 126 | /** |
127 | * struct regulator_consumer_supply - supply -> device mapping | 127 | * struct regulator_consumer_supply - supply -> device mapping |
128 | * | 128 | * |
129 | * This maps a supply name to a device. | 129 | * This maps a supply name to a device. Only one of dev or dev_name |
130 | * can be specified. Use of dev_name allows support for buses which | ||
131 | * make struct device available late such as I2C and is the preferred | ||
132 | * form. | ||
130 | * | 133 | * |
131 | * @dev: Device structure for the consumer. | 134 | * @dev: Device structure for the consumer. |
135 | * @dev_name: Result of dev_name() for the consumer. | ||
132 | * @supply: Name for the supply. | 136 | * @supply: Name for the supply. |
133 | */ | 137 | */ |
134 | struct regulator_consumer_supply { | 138 | struct regulator_consumer_supply { |
135 | struct device *dev; /* consumer */ | 139 | struct device *dev; /* consumer */ |
140 | const char *dev_name; /* dev_name() for consumer */ | ||
136 | const char *supply; /* consumer supply - e.g. "vcc" */ | 141 | const char *supply; /* consumer supply - e.g. "vcc" */ |
137 | }; | 142 | }; |
138 | 143 | ||
144 | /* Initialize struct regulator_consumer_supply */ | ||
145 | #define REGULATOR_SUPPLY(_name, _dev_name) \ | ||
146 | { \ | ||
147 | .supply = _name, \ | ||
148 | .dev_name = _dev_name, \ | ||
149 | } | ||
150 | |||
139 | /** | 151 | /** |
140 | * struct regulator_init_data - regulator platform initialisation data. | 152 | * struct regulator_init_data - regulator platform initialisation data. |
141 | * | 153 | * |
@@ -166,6 +178,12 @@ struct regulator_init_data { | |||
166 | 178 | ||
167 | int regulator_suspend_prepare(suspend_state_t state); | 179 | int regulator_suspend_prepare(suspend_state_t state); |
168 | 180 | ||
181 | #ifdef CONFIG_REGULATOR | ||
169 | void regulator_has_full_constraints(void); | 182 | void regulator_has_full_constraints(void); |
183 | #else | ||
184 | static inline void regulator_has_full_constraints(void) | ||
185 | { | ||
186 | } | ||
187 | #endif | ||
170 | 188 | ||
171 | #endif | 189 | #endif |
diff --git a/include/linux/regulator/max1586.h b/include/linux/regulator/max1586.h index 44563192bf16..de9a7fae20be 100644 --- a/include/linux/regulator/max1586.h +++ b/include/linux/regulator/max1586.h | |||
@@ -36,7 +36,7 @@ | |||
36 | * max1586_subdev_data - regulator data | 36 | * max1586_subdev_data - regulator data |
37 | * @id: regulator Id (either MAX1586_V3 or MAX1586_V6) | 37 | * @id: regulator Id (either MAX1586_V3 or MAX1586_V6) |
38 | * @name: regulator cute name (example for V3: "vcc_core") | 38 | * @name: regulator cute name (example for V3: "vcc_core") |
39 | * @platform_data: regulator init data (contraints, supplies, ...) | 39 | * @platform_data: regulator init data (constraints, supplies, ...) |
40 | */ | 40 | */ |
41 | struct max1586_subdev_data { | 41 | struct max1586_subdev_data { |
42 | int id; | 42 | int id; |
@@ -46,7 +46,7 @@ struct max1586_subdev_data { | |||
46 | 46 | ||
47 | /** | 47 | /** |
48 | * max1586_platform_data - platform data for max1586 | 48 | * max1586_platform_data - platform data for max1586 |
49 | * @num_subdevs: number of regultors used (may be 1 or 2) | 49 | * @num_subdevs: number of regulators used (may be 1 or 2) |
50 | * @subdevs: regulator used | 50 | * @subdevs: regulator used |
51 | * At most, there will be a regulator for V3 and one for V6 voltages. | 51 | * At most, there will be a regulator for V3 and one for V6 voltages. |
52 | * @v3_gain: gain on the V3 voltage output multiplied by 1e6. | 52 | * @v3_gain: gain on the V3 voltage output multiplied by 1e6. |
diff --git a/include/linux/relay.h b/include/linux/relay.h index 953fc055e875..14a86bc7102b 100644 --- a/include/linux/relay.h +++ b/include/linux/relay.h | |||
@@ -140,7 +140,7 @@ struct rchan_callbacks | |||
140 | * cause relay_open() to create a single global buffer rather | 140 | * cause relay_open() to create a single global buffer rather |
141 | * than the default set of per-cpu buffers. | 141 | * than the default set of per-cpu buffers. |
142 | * | 142 | * |
143 | * See Documentation/filesystems/relayfs.txt for more info. | 143 | * See Documentation/filesystems/relay.txt for more info. |
144 | */ | 144 | */ |
145 | struct dentry *(*create_buf_file)(const char *filename, | 145 | struct dentry *(*create_buf_file)(const char *filename, |
146 | struct dentry *parent, | 146 | struct dentry *parent, |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 511f42fc6816..731af71cddc9 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -35,6 +35,10 @@ struct res_counter { | |||
35 | */ | 35 | */ |
36 | unsigned long long limit; | 36 | unsigned long long limit; |
37 | /* | 37 | /* |
38 | * the limit that usage can be exceed | ||
39 | */ | ||
40 | unsigned long long soft_limit; | ||
41 | /* | ||
38 | * the number of unsuccessful attempts to consume the resource | 42 | * the number of unsuccessful attempts to consume the resource |
39 | */ | 43 | */ |
40 | unsigned long long failcnt; | 44 | unsigned long long failcnt; |
@@ -87,6 +91,7 @@ enum { | |||
87 | RES_MAX_USAGE, | 91 | RES_MAX_USAGE, |
88 | RES_LIMIT, | 92 | RES_LIMIT, |
89 | RES_FAILCNT, | 93 | RES_FAILCNT, |
94 | RES_SOFT_LIMIT, | ||
90 | }; | 95 | }; |
91 | 96 | ||
92 | /* | 97 | /* |
@@ -109,7 +114,8 @@ void res_counter_init(struct res_counter *counter, struct res_counter *parent); | |||
109 | int __must_check res_counter_charge_locked(struct res_counter *counter, | 114 | int __must_check res_counter_charge_locked(struct res_counter *counter, |
110 | unsigned long val); | 115 | unsigned long val); |
111 | int __must_check res_counter_charge(struct res_counter *counter, | 116 | int __must_check res_counter_charge(struct res_counter *counter, |
112 | unsigned long val, struct res_counter **limit_fail_at); | 117 | unsigned long val, struct res_counter **limit_fail_at, |
118 | struct res_counter **soft_limit_at); | ||
113 | 119 | ||
114 | /* | 120 | /* |
115 | * uncharge - tell that some portion of the resource is released | 121 | * uncharge - tell that some portion of the resource is released |
@@ -122,7 +128,8 @@ int __must_check res_counter_charge(struct res_counter *counter, | |||
122 | */ | 128 | */ |
123 | 129 | ||
124 | void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val); | 130 | void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val); |
125 | void res_counter_uncharge(struct res_counter *counter, unsigned long val); | 131 | void res_counter_uncharge(struct res_counter *counter, unsigned long val, |
132 | bool *was_soft_limit_excess); | ||
126 | 133 | ||
127 | static inline bool res_counter_limit_check_locked(struct res_counter *cnt) | 134 | static inline bool res_counter_limit_check_locked(struct res_counter *cnt) |
128 | { | 135 | { |
@@ -132,6 +139,36 @@ static inline bool res_counter_limit_check_locked(struct res_counter *cnt) | |||
132 | return false; | 139 | return false; |
133 | } | 140 | } |
134 | 141 | ||
142 | static inline bool res_counter_soft_limit_check_locked(struct res_counter *cnt) | ||
143 | { | ||
144 | if (cnt->usage < cnt->soft_limit) | ||
145 | return true; | ||
146 | |||
147 | return false; | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * Get the difference between the usage and the soft limit | ||
152 | * @cnt: The counter | ||
153 | * | ||
154 | * Returns 0 if usage is less than or equal to soft limit | ||
155 | * The difference between usage and soft limit, otherwise. | ||
156 | */ | ||
157 | static inline unsigned long long | ||
158 | res_counter_soft_limit_excess(struct res_counter *cnt) | ||
159 | { | ||
160 | unsigned long long excess; | ||
161 | unsigned long flags; | ||
162 | |||
163 | spin_lock_irqsave(&cnt->lock, flags); | ||
164 | if (cnt->usage <= cnt->soft_limit) | ||
165 | excess = 0; | ||
166 | else | ||
167 | excess = cnt->usage - cnt->soft_limit; | ||
168 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
169 | return excess; | ||
170 | } | ||
171 | |||
135 | /* | 172 | /* |
136 | * Helper function to detect if the cgroup is within it's limit or | 173 | * Helper function to detect if the cgroup is within it's limit or |
137 | * not. It's currently called from cgroup_rss_prepare() | 174 | * not. It's currently called from cgroup_rss_prepare() |
@@ -147,6 +184,17 @@ static inline bool res_counter_check_under_limit(struct res_counter *cnt) | |||
147 | return ret; | 184 | return ret; |
148 | } | 185 | } |
149 | 186 | ||
187 | static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt) | ||
188 | { | ||
189 | bool ret; | ||
190 | unsigned long flags; | ||
191 | |||
192 | spin_lock_irqsave(&cnt->lock, flags); | ||
193 | ret = res_counter_soft_limit_check_locked(cnt); | ||
194 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
195 | return ret; | ||
196 | } | ||
197 | |||
150 | static inline void res_counter_reset_max(struct res_counter *cnt) | 198 | static inline void res_counter_reset_max(struct res_counter *cnt) |
151 | { | 199 | { |
152 | unsigned long flags; | 200 | unsigned long flags; |
@@ -180,4 +228,16 @@ static inline int res_counter_set_limit(struct res_counter *cnt, | |||
180 | return ret; | 228 | return ret; |
181 | } | 229 | } |
182 | 230 | ||
231 | static inline int | ||
232 | res_counter_set_soft_limit(struct res_counter *cnt, | ||
233 | unsigned long long soft_limit) | ||
234 | { | ||
235 | unsigned long flags; | ||
236 | |||
237 | spin_lock_irqsave(&cnt->lock, flags); | ||
238 | cnt->soft_limit = soft_limit; | ||
239 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
240 | return 0; | ||
241 | } | ||
242 | |||
183 | #endif | 243 | #endif |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index bf116d0dbf23..cb0ba7032609 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -71,21 +71,29 @@ void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned lon | |||
71 | void page_add_file_rmap(struct page *); | 71 | void page_add_file_rmap(struct page *); |
72 | void page_remove_rmap(struct page *); | 72 | void page_remove_rmap(struct page *); |
73 | 73 | ||
74 | #ifdef CONFIG_DEBUG_VM | 74 | static inline void page_dup_rmap(struct page *page) |
75 | void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address); | ||
76 | #else | ||
77 | static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address) | ||
78 | { | 75 | { |
79 | atomic_inc(&page->_mapcount); | 76 | atomic_inc(&page->_mapcount); |
80 | } | 77 | } |
81 | #endif | ||
82 | 78 | ||
83 | /* | 79 | /* |
84 | * Called from mm/vmscan.c to handle paging out | 80 | * Called from mm/vmscan.c to handle paging out |
85 | */ | 81 | */ |
86 | int page_referenced(struct page *, int is_locked, | 82 | int page_referenced(struct page *, int is_locked, |
87 | struct mem_cgroup *cnt, unsigned long *vm_flags); | 83 | struct mem_cgroup *cnt, unsigned long *vm_flags); |
88 | int try_to_unmap(struct page *, int ignore_refs); | 84 | enum ttu_flags { |
85 | TTU_UNMAP = 0, /* unmap mode */ | ||
86 | TTU_MIGRATION = 1, /* migration mode */ | ||
87 | TTU_MUNLOCK = 2, /* munlock mode */ | ||
88 | TTU_ACTION_MASK = 0xff, | ||
89 | |||
90 | TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */ | ||
91 | TTU_IGNORE_ACCESS = (1 << 9), /* don't age */ | ||
92 | TTU_IGNORE_HWPOISON = (1 << 10),/* corrupted page is recoverable */ | ||
93 | }; | ||
94 | #define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) | ||
95 | |||
96 | int try_to_unmap(struct page *, enum ttu_flags flags); | ||
89 | 97 | ||
90 | /* | 98 | /* |
91 | * Called from mm/filemap_xip.c to unmap empty zero page | 99 | * Called from mm/filemap_xip.c to unmap empty zero page |
@@ -112,6 +120,13 @@ int page_mkclean(struct page *); | |||
112 | */ | 120 | */ |
113 | int try_to_munlock(struct page *); | 121 | int try_to_munlock(struct page *); |
114 | 122 | ||
123 | /* | ||
124 | * Called by memory-failure.c to kill processes. | ||
125 | */ | ||
126 | struct anon_vma *page_lock_anon_vma(struct page *page); | ||
127 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | ||
128 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | ||
129 | |||
115 | #else /* !CONFIG_MMU */ | 130 | #else /* !CONFIG_MMU */ |
116 | 131 | ||
117 | #define anon_vma_init() do {} while (0) | 132 | #define anon_vma_init() do {} while (0) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8fe351c3914a..75e6e60bf583 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -140,6 +140,10 @@ extern int nr_processes(void); | |||
140 | extern unsigned long nr_running(void); | 140 | extern unsigned long nr_running(void); |
141 | extern unsigned long nr_uninterruptible(void); | 141 | extern unsigned long nr_uninterruptible(void); |
142 | extern unsigned long nr_iowait(void); | 142 | extern unsigned long nr_iowait(void); |
143 | extern unsigned long nr_iowait_cpu(void); | ||
144 | extern unsigned long this_cpu_load(void); | ||
145 | |||
146 | |||
143 | extern void calc_global_load(void); | 147 | extern void calc_global_load(void); |
144 | extern u64 cpu_nr_migrations(int cpu); | 148 | extern u64 cpu_nr_migrations(int cpu); |
145 | 149 | ||
@@ -305,7 +309,7 @@ extern void softlockup_tick(void); | |||
305 | extern void touch_softlockup_watchdog(void); | 309 | extern void touch_softlockup_watchdog(void); |
306 | extern void touch_all_softlockup_watchdogs(void); | 310 | extern void touch_all_softlockup_watchdogs(void); |
307 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, | 311 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, |
308 | struct file *filp, void __user *buffer, | 312 | void __user *buffer, |
309 | size_t *lenp, loff_t *ppos); | 313 | size_t *lenp, loff_t *ppos); |
310 | extern unsigned int softlockup_panic; | 314 | extern unsigned int softlockup_panic; |
311 | extern int softlockup_thresh; | 315 | extern int softlockup_thresh; |
@@ -327,7 +331,7 @@ extern unsigned long sysctl_hung_task_check_count; | |||
327 | extern unsigned long sysctl_hung_task_timeout_secs; | 331 | extern unsigned long sysctl_hung_task_timeout_secs; |
328 | extern unsigned long sysctl_hung_task_warnings; | 332 | extern unsigned long sysctl_hung_task_warnings; |
329 | extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, | 333 | extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, |
330 | struct file *filp, void __user *buffer, | 334 | void __user *buffer, |
331 | size_t *lenp, loff_t *ppos); | 335 | size_t *lenp, loff_t *ppos); |
332 | #endif | 336 | #endif |
333 | 337 | ||
@@ -422,6 +426,15 @@ static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm) | |||
422 | return max(mm->hiwater_rss, get_mm_rss(mm)); | 426 | return max(mm->hiwater_rss, get_mm_rss(mm)); |
423 | } | 427 | } |
424 | 428 | ||
429 | static inline void setmax_mm_hiwater_rss(unsigned long *maxrss, | ||
430 | struct mm_struct *mm) | ||
431 | { | ||
432 | unsigned long hiwater_rss = get_mm_hiwater_rss(mm); | ||
433 | |||
434 | if (*maxrss < hiwater_rss) | ||
435 | *maxrss = hiwater_rss; | ||
436 | } | ||
437 | |||
425 | static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) | 438 | static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm) |
426 | { | 439 | { |
427 | return max(mm->hiwater_vm, mm->total_vm); | 440 | return max(mm->hiwater_vm, mm->total_vm); |
@@ -434,7 +447,9 @@ extern int get_dumpable(struct mm_struct *mm); | |||
434 | /* dumpable bits */ | 447 | /* dumpable bits */ |
435 | #define MMF_DUMPABLE 0 /* core dump is permitted */ | 448 | #define MMF_DUMPABLE 0 /* core dump is permitted */ |
436 | #define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ | 449 | #define MMF_DUMP_SECURELY 1 /* core file is readable only by root */ |
450 | |||
437 | #define MMF_DUMPABLE_BITS 2 | 451 | #define MMF_DUMPABLE_BITS 2 |
452 | #define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1) | ||
438 | 453 | ||
439 | /* coredump filter bits */ | 454 | /* coredump filter bits */ |
440 | #define MMF_DUMP_ANON_PRIVATE 2 | 455 | #define MMF_DUMP_ANON_PRIVATE 2 |
@@ -444,6 +459,7 @@ extern int get_dumpable(struct mm_struct *mm); | |||
444 | #define MMF_DUMP_ELF_HEADERS 6 | 459 | #define MMF_DUMP_ELF_HEADERS 6 |
445 | #define MMF_DUMP_HUGETLB_PRIVATE 7 | 460 | #define MMF_DUMP_HUGETLB_PRIVATE 7 |
446 | #define MMF_DUMP_HUGETLB_SHARED 8 | 461 | #define MMF_DUMP_HUGETLB_SHARED 8 |
462 | |||
447 | #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS | 463 | #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS |
448 | #define MMF_DUMP_FILTER_BITS 7 | 464 | #define MMF_DUMP_FILTER_BITS 7 |
449 | #define MMF_DUMP_FILTER_MASK \ | 465 | #define MMF_DUMP_FILTER_MASK \ |
@@ -457,6 +473,10 @@ extern int get_dumpable(struct mm_struct *mm); | |||
457 | #else | 473 | #else |
458 | # define MMF_DUMP_MASK_DEFAULT_ELF 0 | 474 | # define MMF_DUMP_MASK_DEFAULT_ELF 0 |
459 | #endif | 475 | #endif |
476 | /* leave room for more dump flags */ | ||
477 | #define MMF_VM_MERGEABLE 16 /* KSM may merge identical pages */ | ||
478 | |||
479 | #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK) | ||
460 | 480 | ||
461 | struct sighand_struct { | 481 | struct sighand_struct { |
462 | atomic_t count; | 482 | atomic_t count; |
@@ -473,6 +493,13 @@ struct pacct_struct { | |||
473 | unsigned long ac_minflt, ac_majflt; | 493 | unsigned long ac_minflt, ac_majflt; |
474 | }; | 494 | }; |
475 | 495 | ||
496 | struct cpu_itimer { | ||
497 | cputime_t expires; | ||
498 | cputime_t incr; | ||
499 | u32 error; | ||
500 | u32 incr_error; | ||
501 | }; | ||
502 | |||
476 | /** | 503 | /** |
477 | * struct task_cputime - collected CPU time counts | 504 | * struct task_cputime - collected CPU time counts |
478 | * @utime: time spent in user mode, in &cputime_t units | 505 | * @utime: time spent in user mode, in &cputime_t units |
@@ -567,9 +594,12 @@ struct signal_struct { | |||
567 | struct pid *leader_pid; | 594 | struct pid *leader_pid; |
568 | ktime_t it_real_incr; | 595 | ktime_t it_real_incr; |
569 | 596 | ||
570 | /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ | 597 | /* |
571 | cputime_t it_prof_expires, it_virt_expires; | 598 | * ITIMER_PROF and ITIMER_VIRTUAL timers for the process, we use |
572 | cputime_t it_prof_incr, it_virt_incr; | 599 | * CPUCLOCK_PROF and CPUCLOCK_VIRT for indexing array as these |
600 | * values are defined to 0 and 1 respectively | ||
601 | */ | ||
602 | struct cpu_itimer it[2]; | ||
573 | 603 | ||
574 | /* | 604 | /* |
575 | * Thread group totals for process CPU timers. | 605 | * Thread group totals for process CPU timers. |
@@ -601,6 +631,7 @@ struct signal_struct { | |||
601 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 631 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
602 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; | 632 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; |
603 | unsigned long inblock, oublock, cinblock, coublock; | 633 | unsigned long inblock, oublock, cinblock, coublock; |
634 | unsigned long maxrss, cmaxrss; | ||
604 | struct task_io_accounting ioac; | 635 | struct task_io_accounting ioac; |
605 | 636 | ||
606 | /* | 637 | /* |
@@ -632,6 +663,8 @@ struct signal_struct { | |||
632 | unsigned audit_tty; | 663 | unsigned audit_tty; |
633 | struct tty_audit_buf *tty_audit_buf; | 664 | struct tty_audit_buf *tty_audit_buf; |
634 | #endif | 665 | #endif |
666 | |||
667 | int oom_adj; /* OOM kill score adjustment (bit shift) */ | ||
635 | }; | 668 | }; |
636 | 669 | ||
637 | /* Context switch must be unlocked if interrupts are to be enabled */ | 670 | /* Context switch must be unlocked if interrupts are to be enabled */ |
@@ -1214,7 +1247,6 @@ struct task_struct { | |||
1214 | * a short time | 1247 | * a short time |
1215 | */ | 1248 | */ |
1216 | unsigned char fpu_counter; | 1249 | unsigned char fpu_counter; |
1217 | s8 oomkilladj; /* OOM kill score adjustment (bit shift). */ | ||
1218 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 1250 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
1219 | unsigned int btrace_seq; | 1251 | unsigned int btrace_seq; |
1220 | #endif | 1252 | #endif |
@@ -1239,7 +1271,6 @@ struct task_struct { | |||
1239 | struct mm_struct *mm, *active_mm; | 1271 | struct mm_struct *mm, *active_mm; |
1240 | 1272 | ||
1241 | /* task state */ | 1273 | /* task state */ |
1242 | struct linux_binfmt *binfmt; | ||
1243 | int exit_state; | 1274 | int exit_state; |
1244 | int exit_code, exit_signal; | 1275 | int exit_code, exit_signal; |
1245 | int pdeath_signal; /* The signal sent when the parent dies */ | 1276 | int pdeath_signal; /* The signal sent when the parent dies */ |
@@ -1507,6 +1538,7 @@ struct task_struct { | |||
1507 | /* bitmask of trace recursion */ | 1538 | /* bitmask of trace recursion */ |
1508 | unsigned long trace_recursion; | 1539 | unsigned long trace_recursion; |
1509 | #endif /* CONFIG_TRACING */ | 1540 | #endif /* CONFIG_TRACING */ |
1541 | unsigned long stack_start; | ||
1510 | }; | 1542 | }; |
1511 | 1543 | ||
1512 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1544 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
@@ -1702,6 +1734,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1702 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ | 1734 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ |
1703 | #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ | 1735 | #define PF_VCPU 0x00000010 /* I'm a virtual CPU */ |
1704 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ | 1736 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ |
1737 | #define PF_MCE_PROCESS 0x00000080 /* process policy on mce errors */ | ||
1705 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ | 1738 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ |
1706 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1739 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |
1707 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ | 1740 | #define PF_SIGNALED 0x00000400 /* killed by a signal */ |
@@ -1713,7 +1746,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1713 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1746 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
1714 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1747 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
1715 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 1748 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
1716 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ | 1749 | #define PF_OOM_ORIGIN 0x00080000 /* Allocating much memory to others */ |
1717 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 1750 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
1718 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ | 1751 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
1719 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1752 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
@@ -1721,6 +1754,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1721 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ | 1754 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ |
1722 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ | 1755 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ |
1723 | #define PF_THREAD_BOUND 0x04000000 /* Thread bound to specific cpu */ | 1756 | #define PF_THREAD_BOUND 0x04000000 /* Thread bound to specific cpu */ |
1757 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ | ||
1724 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 1758 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
1725 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | 1759 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ |
1726 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ | 1760 | #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezeable */ |
@@ -1784,10 +1818,13 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p, | |||
1784 | return 0; | 1818 | return 0; |
1785 | } | 1819 | } |
1786 | #endif | 1820 | #endif |
1821 | |||
1822 | #ifndef CONFIG_CPUMASK_OFFSTACK | ||
1787 | static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) | 1823 | static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask) |
1788 | { | 1824 | { |
1789 | return set_cpus_allowed_ptr(p, &new_mask); | 1825 | return set_cpus_allowed_ptr(p, &new_mask); |
1790 | } | 1826 | } |
1827 | #endif | ||
1791 | 1828 | ||
1792 | /* | 1829 | /* |
1793 | * Architectures can set this to 1 if they have specified | 1830 | * Architectures can set this to 1 if they have specified |
@@ -1870,7 +1907,7 @@ extern unsigned int sysctl_sched_time_avg; | |||
1870 | extern unsigned int sysctl_timer_migration; | 1907 | extern unsigned int sysctl_timer_migration; |
1871 | 1908 | ||
1872 | int sched_nr_latency_handler(struct ctl_table *table, int write, | 1909 | int sched_nr_latency_handler(struct ctl_table *table, int write, |
1873 | struct file *file, void __user *buffer, size_t *length, | 1910 | void __user *buffer, size_t *length, |
1874 | loff_t *ppos); | 1911 | loff_t *ppos); |
1875 | #endif | 1912 | #endif |
1876 | #ifdef CONFIG_SCHED_DEBUG | 1913 | #ifdef CONFIG_SCHED_DEBUG |
@@ -1888,7 +1925,7 @@ extern unsigned int sysctl_sched_rt_period; | |||
1888 | extern int sysctl_sched_rt_runtime; | 1925 | extern int sysctl_sched_rt_runtime; |
1889 | 1926 | ||
1890 | int sched_rt_handler(struct ctl_table *table, int write, | 1927 | int sched_rt_handler(struct ctl_table *table, int write, |
1891 | struct file *filp, void __user *buffer, size_t *lenp, | 1928 | void __user *buffer, size_t *lenp, |
1892 | loff_t *ppos); | 1929 | loff_t *ppos); |
1893 | 1930 | ||
1894 | extern unsigned int sysctl_sched_compat_yield; | 1931 | extern unsigned int sysctl_sched_compat_yield; |
@@ -2023,6 +2060,7 @@ extern int kill_pgrp(struct pid *pid, int sig, int priv); | |||
2023 | extern int kill_pid(struct pid *pid, int sig, int priv); | 2060 | extern int kill_pid(struct pid *pid, int sig, int priv); |
2024 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 2061 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
2025 | extern int do_notify_parent(struct task_struct *, int); | 2062 | extern int do_notify_parent(struct task_struct *, int); |
2063 | extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); | ||
2026 | extern void force_sig(int, struct task_struct *); | 2064 | extern void force_sig(int, struct task_struct *); |
2027 | extern void force_sig_specific(int, struct task_struct *); | 2065 | extern void force_sig_specific(int, struct task_struct *); |
2028 | extern int send_sig(int, struct task_struct *, int); | 2066 | extern int send_sig(int, struct task_struct *, int); |
@@ -2300,7 +2338,10 @@ static inline int signal_pending(struct task_struct *p) | |||
2300 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); | 2338 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); |
2301 | } | 2339 | } |
2302 | 2340 | ||
2303 | extern int __fatal_signal_pending(struct task_struct *p); | 2341 | static inline int __fatal_signal_pending(struct task_struct *p) |
2342 | { | ||
2343 | return unlikely(sigismember(&p->pending.signal, SIGKILL)); | ||
2344 | } | ||
2304 | 2345 | ||
2305 | static inline int fatal_signal_pending(struct task_struct *p) | 2346 | static inline int fatal_signal_pending(struct task_struct *p) |
2306 | { | 2347 | { |
diff --git a/include/linux/security.h b/include/linux/security.h index d050b66ab9ef..239e40d0450b 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -133,7 +133,7 @@ static inline unsigned long round_hint_to_min(unsigned long hint) | |||
133 | return PAGE_ALIGN(mmap_min_addr); | 133 | return PAGE_ALIGN(mmap_min_addr); |
134 | return hint; | 134 | return hint; |
135 | } | 135 | } |
136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp, | 136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, |
137 | void __user *buffer, size_t *lenp, loff_t *ppos); | 137 | void __user *buffer, size_t *lenp, loff_t *ppos); |
138 | 138 | ||
139 | #ifdef CONFIG_SECURITY | 139 | #ifdef CONFIG_SECURITY |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 0c6a86b79596..8366d8f12e53 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -35,6 +35,44 @@ struct seq_operations { | |||
35 | 35 | ||
36 | #define SEQ_SKIP 1 | 36 | #define SEQ_SKIP 1 |
37 | 37 | ||
38 | /** | ||
39 | * seq_get_buf - get buffer to write arbitrary data to | ||
40 | * @m: the seq_file handle | ||
41 | * @bufp: the beginning of the buffer is stored here | ||
42 | * | ||
43 | * Return the number of bytes available in the buffer, or zero if | ||
44 | * there's no space. | ||
45 | */ | ||
46 | static inline size_t seq_get_buf(struct seq_file *m, char **bufp) | ||
47 | { | ||
48 | BUG_ON(m->count > m->size); | ||
49 | if (m->count < m->size) | ||
50 | *bufp = m->buf + m->count; | ||
51 | else | ||
52 | *bufp = NULL; | ||
53 | |||
54 | return m->size - m->count; | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * seq_commit - commit data to the buffer | ||
59 | * @m: the seq_file handle | ||
60 | * @num: the number of bytes to commit | ||
61 | * | ||
62 | * Commit @num bytes of data written to a buffer previously acquired | ||
63 | * by seq_buf_get. To signal an error condition, or that the data | ||
64 | * didn't fit in the available space, pass a negative @num value. | ||
65 | */ | ||
66 | static inline void seq_commit(struct seq_file *m, int num) | ||
67 | { | ||
68 | if (num < 0) { | ||
69 | m->count = m->size; | ||
70 | } else { | ||
71 | BUG_ON(m->count + num > m->size); | ||
72 | m->count += num; | ||
73 | } | ||
74 | } | ||
75 | |||
38 | char *mangle_path(char *s, char *p, char *esc); | 76 | char *mangle_path(char *s, char *p, char *esc); |
39 | int seq_open(struct file *, const struct seq_operations *); | 77 | int seq_open(struct file *, const struct seq_operations *); |
40 | ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); | 78 | ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index d58e460844dd..fe661afe0713 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -477,7 +477,7 @@ static inline int uart_handle_break(struct uart_port *port) | |||
477 | 477 | ||
478 | /** | 478 | /** |
479 | * uart_handle_dcd_change - handle a change of carrier detect state | 479 | * uart_handle_dcd_change - handle a change of carrier detect state |
480 | * @port: uart_port structure for the open port | 480 | * @uport: uart_port structure for the open port |
481 | * @status: new carrier detect status, nonzero if active | 481 | * @status: new carrier detect status, nonzero if active |
482 | */ | 482 | */ |
483 | static inline void | 483 | static inline void |
@@ -503,7 +503,7 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status) | |||
503 | 503 | ||
504 | /** | 504 | /** |
505 | * uart_handle_cts_change - handle a change of clear-to-send state | 505 | * uart_handle_cts_change - handle a change of clear-to-send state |
506 | * @port: uart_port structure for the open port | 506 | * @uport: uart_port structure for the open port |
507 | * @status: new clear to send status, nonzero if active | 507 | * @status: new clear to send status, nonzero if active |
508 | */ | 508 | */ |
509 | static inline void | 509 | static inline void |
diff --git a/include/linux/sfi.h b/include/linux/sfi.h new file mode 100644 index 000000000000..9a6f7607174e --- /dev/null +++ b/include/linux/sfi.h | |||
@@ -0,0 +1,206 @@ | |||
1 | /* sfi.h Simple Firmware Interface */ | ||
2 | |||
3 | /* | ||
4 | |||
5 | This file is provided under a dual BSD/GPLv2 license. When using or | ||
6 | redistributing this file, you may do so under either license. | ||
7 | |||
8 | GPL LICENSE SUMMARY | ||
9 | |||
10 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify | ||
13 | it under the terms of version 2 of the GNU General Public License as | ||
14 | published by the Free Software Foundation. | ||
15 | |||
16 | This program is distributed in the hope that it will be useful, but | ||
17 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License | ||
22 | along with this program; if not, write to the Free Software | ||
23 | Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | The full GNU General Public License is included in this distribution | ||
25 | in the file called LICENSE.GPL. | ||
26 | |||
27 | BSD LICENSE | ||
28 | |||
29 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
30 | |||
31 | Redistribution and use in source and binary forms, with or without | ||
32 | modification, are permitted provided that the following conditions | ||
33 | are met: | ||
34 | |||
35 | * Redistributions of source code must retain the above copyright | ||
36 | notice, this list of conditions and the following disclaimer. | ||
37 | * Redistributions in binary form must reproduce the above copyright | ||
38 | notice, this list of conditions and the following disclaimer in | ||
39 | the documentation and/or other materials provided with the | ||
40 | distribution. | ||
41 | * Neither the name of Intel Corporation nor the names of its | ||
42 | contributors may be used to endorse or promote products derived | ||
43 | from this software without specific prior written permission. | ||
44 | |||
45 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
46 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
47 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
48 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
49 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
50 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
51 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
52 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
53 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
54 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
55 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
56 | |||
57 | */ | ||
58 | |||
59 | #ifndef _LINUX_SFI_H | ||
60 | #define _LINUX_SFI_H | ||
61 | |||
62 | /* Table signatures reserved by the SFI specification */ | ||
63 | #define SFI_SIG_SYST "SYST" | ||
64 | #define SFI_SIG_FREQ "FREQ" | ||
65 | #define SFI_SIG_IDLE "IDLE" | ||
66 | #define SFI_SIG_CPUS "CPUS" | ||
67 | #define SFI_SIG_MTMR "MTMR" | ||
68 | #define SFI_SIG_MRTC "MRTC" | ||
69 | #define SFI_SIG_MMAP "MMAP" | ||
70 | #define SFI_SIG_APIC "APIC" | ||
71 | #define SFI_SIG_XSDT "XSDT" | ||
72 | #define SFI_SIG_WAKE "WAKE" | ||
73 | #define SFI_SIG_SPIB "SPIB" | ||
74 | #define SFI_SIG_I2CB "I2CB" | ||
75 | #define SFI_SIG_GPEM "GPEM" | ||
76 | |||
77 | #define SFI_SIGNATURE_SIZE 4 | ||
78 | #define SFI_OEM_ID_SIZE 6 | ||
79 | #define SFI_OEM_TABLE_ID_SIZE 8 | ||
80 | |||
81 | #define SFI_SYST_SEARCH_BEGIN 0x000E0000 | ||
82 | #define SFI_SYST_SEARCH_END 0x000FFFFF | ||
83 | |||
84 | #define SFI_GET_NUM_ENTRIES(ptable, entry_type) \ | ||
85 | ((ptable->header.len - sizeof(struct sfi_table_header)) / \ | ||
86 | (sizeof(entry_type))) | ||
87 | /* | ||
88 | * Table structures must be byte-packed to match the SFI specification, | ||
89 | * as they are provided by the BIOS. | ||
90 | */ | ||
91 | struct sfi_table_header { | ||
92 | char sig[SFI_SIGNATURE_SIZE]; | ||
93 | u32 len; | ||
94 | u8 rev; | ||
95 | u8 csum; | ||
96 | char oem_id[SFI_OEM_ID_SIZE]; | ||
97 | char oem_table_id[SFI_OEM_TABLE_ID_SIZE]; | ||
98 | } __packed; | ||
99 | |||
100 | struct sfi_table_simple { | ||
101 | struct sfi_table_header header; | ||
102 | u64 pentry[1]; | ||
103 | } __packed; | ||
104 | |||
105 | /* Comply with UEFI spec 2.1 */ | ||
106 | struct sfi_mem_entry { | ||
107 | u32 type; | ||
108 | u64 phys_start; | ||
109 | u64 virt_start; | ||
110 | u64 pages; | ||
111 | u64 attrib; | ||
112 | } __packed; | ||
113 | |||
114 | struct sfi_cpu_table_entry { | ||
115 | u32 apic_id; | ||
116 | } __packed; | ||
117 | |||
118 | struct sfi_cstate_table_entry { | ||
119 | u32 hint; /* MWAIT hint */ | ||
120 | u32 latency; /* latency in ms */ | ||
121 | } __packed; | ||
122 | |||
123 | struct sfi_apic_table_entry { | ||
124 | u64 phys_addr; /* phy base addr for APIC reg */ | ||
125 | } __packed; | ||
126 | |||
127 | struct sfi_freq_table_entry { | ||
128 | u32 freq_mhz; /* in MHZ */ | ||
129 | u32 latency; /* transition latency in ms */ | ||
130 | u32 ctrl_val; /* value to write to PERF_CTL */ | ||
131 | } __packed; | ||
132 | |||
133 | struct sfi_wake_table_entry { | ||
134 | u64 phys_addr; /* pointer to where the wake vector locates */ | ||
135 | } __packed; | ||
136 | |||
137 | struct sfi_timer_table_entry { | ||
138 | u64 phys_addr; /* phy base addr for the timer */ | ||
139 | u32 freq_hz; /* in HZ */ | ||
140 | u32 irq; | ||
141 | } __packed; | ||
142 | |||
143 | struct sfi_rtc_table_entry { | ||
144 | u64 phys_addr; /* phy base addr for the RTC */ | ||
145 | u32 irq; | ||
146 | } __packed; | ||
147 | |||
148 | struct sfi_spi_table_entry { | ||
149 | u16 host_num; /* attached to host 0, 1...*/ | ||
150 | u16 cs; /* chip select */ | ||
151 | u16 irq_info; | ||
152 | char name[16]; | ||
153 | u8 dev_info[10]; | ||
154 | } __packed; | ||
155 | |||
156 | struct sfi_i2c_table_entry { | ||
157 | u16 host_num; | ||
158 | u16 addr; /* slave addr */ | ||
159 | u16 irq_info; | ||
160 | char name[16]; | ||
161 | u8 dev_info[10]; | ||
162 | } __packed; | ||
163 | |||
164 | struct sfi_gpe_table_entry { | ||
165 | u16 logical_id; /* logical id */ | ||
166 | u16 phys_id; /* physical GPE id */ | ||
167 | } __packed; | ||
168 | |||
169 | |||
170 | typedef int (*sfi_table_handler) (struct sfi_table_header *table); | ||
171 | |||
172 | #ifdef CONFIG_SFI | ||
173 | extern void __init sfi_init(void); | ||
174 | extern int __init sfi_platform_init(void); | ||
175 | extern void __init sfi_init_late(void); | ||
176 | extern int sfi_table_parse(char *signature, char *oem_id, char *oem_table_id, | ||
177 | sfi_table_handler handler); | ||
178 | |||
179 | extern int sfi_disabled; | ||
180 | static inline void disable_sfi(void) | ||
181 | { | ||
182 | sfi_disabled = 1; | ||
183 | } | ||
184 | |||
185 | #else /* !CONFIG_SFI */ | ||
186 | |||
187 | static inline void sfi_init(void) | ||
188 | { | ||
189 | } | ||
190 | |||
191 | static inline void sfi_init_late(void) | ||
192 | { | ||
193 | } | ||
194 | |||
195 | #define sfi_disabled 0 | ||
196 | |||
197 | static inline int sfi_table_parse(char *signature, char *oem_id, | ||
198 | char *oem_table_id, | ||
199 | sfi_table_handler handler) | ||
200 | { | ||
201 | return -1; | ||
202 | } | ||
203 | |||
204 | #endif /* !CONFIG_SFI */ | ||
205 | |||
206 | #endif /*_LINUX_SFI_H*/ | ||
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h new file mode 100644 index 000000000000..c4a5a8cd4469 --- /dev/null +++ b/include/linux/sfi_acpi.h | |||
@@ -0,0 +1,93 @@ | |||
1 | /* sfi.h Simple Firmware Interface */ | ||
2 | |||
3 | /* | ||
4 | |||
5 | This file is provided under a dual BSD/GPLv2 license. When using or | ||
6 | redistributing this file, you may do so under either license. | ||
7 | |||
8 | GPL LICENSE SUMMARY | ||
9 | |||
10 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
11 | |||
12 | This program is free software; you can redistribute it and/or modify | ||
13 | it under the terms of version 2 of the GNU General Public License as | ||
14 | published by the Free Software Foundation. | ||
15 | |||
16 | This program is distributed in the hope that it will be useful, but | ||
17 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License | ||
22 | along with this program; if not, write to the Free Software | ||
23 | Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
24 | The full GNU General Public License is included in this distribution | ||
25 | in the file called LICENSE.GPL. | ||
26 | |||
27 | BSD LICENSE | ||
28 | |||
29 | Copyright(c) 2009 Intel Corporation. All rights reserved. | ||
30 | |||
31 | Redistribution and use in source and binary forms, with or without | ||
32 | modification, are permitted provided that the following conditions | ||
33 | are met: | ||
34 | |||
35 | * Redistributions of source code must retain the above copyright | ||
36 | notice, this list of conditions and the following disclaimer. | ||
37 | * Redistributions in binary form must reproduce the above copyright | ||
38 | notice, this list of conditions and the following disclaimer in | ||
39 | the documentation and/or other materials provided with the | ||
40 | distribution. | ||
41 | * Neither the name of Intel Corporation nor the names of its | ||
42 | contributors may be used to endorse or promote products derived | ||
43 | from this software without specific prior written permission. | ||
44 | |||
45 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
46 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
47 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
48 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
49 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
50 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
51 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
52 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
53 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
54 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
55 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
56 | |||
57 | */ | ||
58 | |||
59 | #ifndef _LINUX_SFI_ACPI_H | ||
60 | #define _LINUX_SFI_ACPI_H | ||
61 | |||
62 | #ifdef CONFIG_SFI | ||
63 | #include <acpi/acpi.h> /* struct acpi_table_header */ | ||
64 | |||
65 | extern int sfi_acpi_table_parse(char *signature, char *oem_id, | ||
66 | char *oem_table_id, | ||
67 | int (*handler)(struct acpi_table_header *)); | ||
68 | |||
69 | static inline int acpi_sfi_table_parse(char *signature, | ||
70 | int (*handler)(struct acpi_table_header *)) | ||
71 | { | ||
72 | if (!acpi_table_parse(signature, handler)) | ||
73 | return 0; | ||
74 | |||
75 | return sfi_acpi_table_parse(signature, NULL, NULL, handler); | ||
76 | } | ||
77 | #else /* !CONFIG_SFI */ | ||
78 | |||
79 | static inline int sfi_acpi_table_parse(char *signature, char *oem_id, | ||
80 | char *oem_table_id, | ||
81 | int (*handler)(struct acpi_table_header *)) | ||
82 | { | ||
83 | return -1; | ||
84 | } | ||
85 | |||
86 | static inline int acpi_sfi_table_parse(char *signature, | ||
87 | int (*handler)(struct acpi_table_header *)) | ||
88 | { | ||
89 | return acpi_table_parse(signature, handler); | ||
90 | } | ||
91 | #endif /* !CONFIG_SFI */ | ||
92 | |||
93 | #endif /*_LINUX_SFI_ACPI_H*/ | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index c7552836bd95..ab9272cc270c 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -233,6 +233,8 @@ static inline int valid_signal(unsigned long sig) | |||
233 | } | 233 | } |
234 | 234 | ||
235 | extern int next_signal(struct sigpending *pending, sigset_t *mask); | 235 | extern int next_signal(struct sigpending *pending, sigset_t *mask); |
236 | extern int do_send_sig_info(int sig, struct siginfo *info, | ||
237 | struct task_struct *p, bool group); | ||
236 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); | 238 | extern int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p); |
237 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); | 239 | extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *); |
238 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, | 240 | extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 9e3d8af09207..39c64bae776d 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -73,15 +73,6 @@ int smp_call_function(void(*func)(void *info), void *info, int wait); | |||
73 | void smp_call_function_many(const struct cpumask *mask, | 73 | void smp_call_function_many(const struct cpumask *mask, |
74 | void (*func)(void *info), void *info, bool wait); | 74 | void (*func)(void *info), void *info, bool wait); |
75 | 75 | ||
76 | /* Deprecated: Use smp_call_function_many which takes a pointer to the mask. */ | ||
77 | static inline int | ||
78 | smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, | ||
79 | int wait) | ||
80 | { | ||
81 | smp_call_function_many(&mask, func, info, wait); | ||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | void __smp_call_function_single(int cpuid, struct call_single_data *data, | 76 | void __smp_call_function_single(int cpuid, struct call_single_data *data, |
86 | int wait); | 77 | int wait); |
87 | 78 | ||
@@ -144,8 +135,6 @@ static inline int up_smp_call_function(void (*func)(void *), void *info) | |||
144 | static inline void smp_send_reschedule(int cpu) { } | 135 | static inline void smp_send_reschedule(int cpu) { } |
145 | #define num_booting_cpus() 1 | 136 | #define num_booting_cpus() 1 |
146 | #define smp_prepare_boot_cpu() do {} while (0) | 137 | #define smp_prepare_boot_cpu() do {} while (0) |
147 | #define smp_call_function_mask(mask, func, info, wait) \ | ||
148 | (up_smp_call_function(func, info)) | ||
149 | #define smp_call_function_many(mask, func, info, wait) \ | 138 | #define smp_call_function_many(mask, func, info, wait) \ |
150 | (up_smp_call_function(func, info)) | 139 | (up_smp_call_function(func, info)) |
151 | static inline void init_call_single_data(void) | 140 | static inline void init_call_single_data(void) |
diff --git a/include/linux/spi/mc33880.h b/include/linux/spi/mc33880.h new file mode 100644 index 000000000000..82ffccd6fbe5 --- /dev/null +++ b/include/linux/spi/mc33880.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef LINUX_SPI_MC33880_H | ||
2 | #define LINUX_SPI_MC33880_H | ||
3 | |||
4 | struct mc33880_platform_data { | ||
5 | /* number assigned to the first GPIO */ | ||
6 | unsigned base; | ||
7 | }; | ||
8 | |||
9 | #endif | ||
10 | |||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index c47c4b4da97e..97b60b37f445 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #define __LINUX_SPI_H | 20 | #define __LINUX_SPI_H |
21 | 21 | ||
22 | #include <linux/device.h> | 22 | #include <linux/device.h> |
23 | #include <linux/mod_devicetable.h> | ||
23 | 24 | ||
24 | /* | 25 | /* |
25 | * INTERFACES between SPI master-side drivers and SPI infrastructure. | 26 | * INTERFACES between SPI master-side drivers and SPI infrastructure. |
@@ -86,7 +87,7 @@ struct spi_device { | |||
86 | int irq; | 87 | int irq; |
87 | void *controller_state; | 88 | void *controller_state; |
88 | void *controller_data; | 89 | void *controller_data; |
89 | char modalias[32]; | 90 | char modalias[SPI_NAME_SIZE]; |
90 | 91 | ||
91 | /* | 92 | /* |
92 | * likely need more hooks for more protocol options affecting how | 93 | * likely need more hooks for more protocol options affecting how |
@@ -145,6 +146,7 @@ struct spi_message; | |||
145 | 146 | ||
146 | /** | 147 | /** |
147 | * struct spi_driver - Host side "protocol" driver | 148 | * struct spi_driver - Host side "protocol" driver |
149 | * @id_table: List of SPI devices supported by this driver | ||
148 | * @probe: Binds this driver to the spi device. Drivers can verify | 150 | * @probe: Binds this driver to the spi device. Drivers can verify |
149 | * that the device is actually present, and may need to configure | 151 | * that the device is actually present, and may need to configure |
150 | * characteristics (such as bits_per_word) which weren't needed for | 152 | * characteristics (such as bits_per_word) which weren't needed for |
@@ -170,6 +172,7 @@ struct spi_message; | |||
170 | * MMC, RTC, filesystem character device nodes, and hardware monitoring. | 172 | * MMC, RTC, filesystem character device nodes, and hardware monitoring. |
171 | */ | 173 | */ |
172 | struct spi_driver { | 174 | struct spi_driver { |
175 | const struct spi_device_id *id_table; | ||
173 | int (*probe)(struct spi_device *spi); | 176 | int (*probe)(struct spi_device *spi); |
174 | int (*remove)(struct spi_device *spi); | 177 | int (*remove)(struct spi_device *spi); |
175 | void (*shutdown)(struct spi_device *spi); | 178 | void (*shutdown)(struct spi_device *spi); |
@@ -207,6 +210,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
207 | * each slave has a chipselect signal, but it's common that not | 210 | * each slave has a chipselect signal, but it's common that not |
208 | * every chipselect is connected to a slave. | 211 | * every chipselect is connected to a slave. |
209 | * @dma_alignment: SPI controller constraint on DMA buffers alignment. | 212 | * @dma_alignment: SPI controller constraint on DMA buffers alignment. |
213 | * @mode_bits: flags understood by this controller driver | ||
214 | * @flags: other constraints relevant to this driver | ||
210 | * @setup: updates the device mode and clocking records used by a | 215 | * @setup: updates the device mode and clocking records used by a |
211 | * device's SPI controller; protocol code may call this. This | 216 | * device's SPI controller; protocol code may call this. This |
212 | * must fail if an unrecognized or unsupported mode is requested. | 217 | * must fail if an unrecognized or unsupported mode is requested. |
@@ -253,6 +258,8 @@ struct spi_master { | |||
253 | /* other constraints relevant to this driver */ | 258 | /* other constraints relevant to this driver */ |
254 | u16 flags; | 259 | u16 flags; |
255 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ | 260 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ |
261 | #define SPI_MASTER_NO_RX BIT(1) /* can't do buffer read */ | ||
262 | #define SPI_MASTER_NO_TX BIT(2) /* can't do buffer write */ | ||
256 | 263 | ||
257 | /* Setup mode and clock, etc (spi driver may call many times). | 264 | /* Setup mode and clock, etc (spi driver may call many times). |
258 | * | 265 | * |
@@ -533,42 +540,7 @@ static inline void spi_message_free(struct spi_message *m) | |||
533 | } | 540 | } |
534 | 541 | ||
535 | extern int spi_setup(struct spi_device *spi); | 542 | extern int spi_setup(struct spi_device *spi); |
536 | 543 | extern int spi_async(struct spi_device *spi, struct spi_message *message); | |
537 | /** | ||
538 | * spi_async - asynchronous SPI transfer | ||
539 | * @spi: device with which data will be exchanged | ||
540 | * @message: describes the data transfers, including completion callback | ||
541 | * Context: any (irqs may be blocked, etc) | ||
542 | * | ||
543 | * This call may be used in_irq and other contexts which can't sleep, | ||
544 | * as well as from task contexts which can sleep. | ||
545 | * | ||
546 | * The completion callback is invoked in a context which can't sleep. | ||
547 | * Before that invocation, the value of message->status is undefined. | ||
548 | * When the callback is issued, message->status holds either zero (to | ||
549 | * indicate complete success) or a negative error code. After that | ||
550 | * callback returns, the driver which issued the transfer request may | ||
551 | * deallocate the associated memory; it's no longer in use by any SPI | ||
552 | * core or controller driver code. | ||
553 | * | ||
554 | * Note that although all messages to a spi_device are handled in | ||
555 | * FIFO order, messages may go to different devices in other orders. | ||
556 | * Some device might be higher priority, or have various "hard" access | ||
557 | * time requirements, for example. | ||
558 | * | ||
559 | * On detection of any fault during the transfer, processing of | ||
560 | * the entire message is aborted, and the device is deselected. | ||
561 | * Until returning from the associated message completion callback, | ||
562 | * no other spi_message queued to that device will be processed. | ||
563 | * (This rule applies equally to all the synchronous transfer calls, | ||
564 | * which are wrappers around this core asynchronous primitive.) | ||
565 | */ | ||
566 | static inline int | ||
567 | spi_async(struct spi_device *spi, struct spi_message *message) | ||
568 | { | ||
569 | message->spi = spi; | ||
570 | return spi->master->transfer(spi, message); | ||
571 | } | ||
572 | 544 | ||
573 | /*---------------------------------------------------------------------------*/ | 545 | /*---------------------------------------------------------------------------*/ |
574 | 546 | ||
@@ -732,7 +704,7 @@ struct spi_board_info { | |||
732 | * controller_data goes to spi_device.controller_data, | 704 | * controller_data goes to spi_device.controller_data, |
733 | * irq is copied too | 705 | * irq is copied too |
734 | */ | 706 | */ |
735 | char modalias[32]; | 707 | char modalias[SPI_NAME_SIZE]; |
736 | const void *platform_data; | 708 | const void *platform_data; |
737 | void *controller_data; | 709 | void *controller_data; |
738 | int irq; | 710 | int irq; |
@@ -800,4 +772,7 @@ spi_unregister_device(struct spi_device *spi) | |||
800 | device_unregister(&spi->dev); | 772 | device_unregister(&spi->dev); |
801 | } | 773 | } |
802 | 774 | ||
775 | extern const struct spi_device_id * | ||
776 | spi_get_device_id(const struct spi_device *sdev); | ||
777 | |||
803 | #endif /* __LINUX_SPI_H */ | 778 | #endif /* __LINUX_SPI_H */ |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 3f632182d8eb..996df4dac7d4 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -111,7 +111,7 @@ struct rpc_credops { | |||
111 | void (*crdestroy)(struct rpc_cred *); | 111 | void (*crdestroy)(struct rpc_cred *); |
112 | 112 | ||
113 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); | 113 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); |
114 | void (*crbind)(struct rpc_task *, struct rpc_cred *); | 114 | void (*crbind)(struct rpc_task *, struct rpc_cred *, int); |
115 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); | 115 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); |
116 | int (*crrefresh)(struct rpc_task *); | 116 | int (*crrefresh)(struct rpc_task *); |
117 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); | 117 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); |
@@ -140,7 +140,7 @@ struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred * | |||
140 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 140 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
141 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); | 141 | struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); |
142 | void rpcauth_bindcred(struct rpc_task *, struct rpc_cred *, int); | 142 | void rpcauth_bindcred(struct rpc_task *, struct rpc_cred *, int); |
143 | void rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *); | 143 | void rpcauth_generic_bind_cred(struct rpc_task *, struct rpc_cred *, int); |
144 | void put_rpccred(struct rpc_cred *); | 144 | void put_rpccred(struct rpc_cred *); |
145 | void rpcauth_unbindcred(struct rpc_task *); | 145 | void rpcauth_unbindcred(struct rpc_task *); |
146 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); | 146 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index ab3f6e90caa5..8ed9642a5a76 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/sunrpc/timer.h> | 22 | #include <linux/sunrpc/timer.h> |
23 | #include <asm/signal.h> | 23 | #include <asm/signal.h> |
24 | #include <linux/path.h> | 24 | #include <linux/path.h> |
25 | #include <net/ipv6.h> | ||
25 | 26 | ||
26 | struct rpc_inode; | 27 | struct rpc_inode; |
27 | 28 | ||
@@ -113,6 +114,7 @@ struct rpc_create_args { | |||
113 | rpc_authflavor_t authflavor; | 114 | rpc_authflavor_t authflavor; |
114 | unsigned long flags; | 115 | unsigned long flags; |
115 | char *client_name; | 116 | char *client_name; |
117 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | ||
116 | }; | 118 | }; |
117 | 119 | ||
118 | /* Values for "flags" field */ | 120 | /* Values for "flags" field */ |
@@ -188,5 +190,117 @@ static inline void rpc_set_port(struct sockaddr *sap, | |||
188 | #define IPV6_SCOPE_DELIMITER '%' | 190 | #define IPV6_SCOPE_DELIMITER '%' |
189 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") | 191 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") |
190 | 192 | ||
193 | static inline bool __rpc_cmp_addr4(const struct sockaddr *sap1, | ||
194 | const struct sockaddr *sap2) | ||
195 | { | ||
196 | const struct sockaddr_in *sin1 = (const struct sockaddr_in *)sap1; | ||
197 | const struct sockaddr_in *sin2 = (const struct sockaddr_in *)sap2; | ||
198 | |||
199 | return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr; | ||
200 | } | ||
201 | |||
202 | static inline bool __rpc_copy_addr4(struct sockaddr *dst, | ||
203 | const struct sockaddr *src) | ||
204 | { | ||
205 | const struct sockaddr_in *ssin = (struct sockaddr_in *) src; | ||
206 | struct sockaddr_in *dsin = (struct sockaddr_in *) dst; | ||
207 | |||
208 | dsin->sin_family = ssin->sin_family; | ||
209 | dsin->sin_addr.s_addr = ssin->sin_addr.s_addr; | ||
210 | return true; | ||
211 | } | ||
212 | |||
213 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
214 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
215 | const struct sockaddr *sap2) | ||
216 | { | ||
217 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | ||
218 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | ||
219 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); | ||
220 | } | ||
221 | |||
222 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
223 | const struct sockaddr *src) | ||
224 | { | ||
225 | const struct sockaddr_in6 *ssin6 = (const struct sockaddr_in6 *) src; | ||
226 | struct sockaddr_in6 *dsin6 = (struct sockaddr_in6 *) dst; | ||
227 | |||
228 | dsin6->sin6_family = ssin6->sin6_family; | ||
229 | ipv6_addr_copy(&dsin6->sin6_addr, &ssin6->sin6_addr); | ||
230 | return true; | ||
231 | } | ||
232 | #else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
233 | static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | ||
234 | const struct sockaddr *sap2) | ||
235 | { | ||
236 | return false; | ||
237 | } | ||
238 | |||
239 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | ||
240 | const struct sockaddr *src) | ||
241 | { | ||
242 | return false; | ||
243 | } | ||
244 | #endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */ | ||
245 | |||
246 | /** | ||
247 | * rpc_cmp_addr - compare the address portion of two sockaddrs. | ||
248 | * @sap1: first sockaddr | ||
249 | * @sap2: second sockaddr | ||
250 | * | ||
251 | * Just compares the family and address portion. Ignores port, scope, etc. | ||
252 | * Returns true if the addrs are equal, false if they aren't. | ||
253 | */ | ||
254 | static inline bool rpc_cmp_addr(const struct sockaddr *sap1, | ||
255 | const struct sockaddr *sap2) | ||
256 | { | ||
257 | if (sap1->sa_family == sap2->sa_family) { | ||
258 | switch (sap1->sa_family) { | ||
259 | case AF_INET: | ||
260 | return __rpc_cmp_addr4(sap1, sap2); | ||
261 | case AF_INET6: | ||
262 | return __rpc_cmp_addr6(sap1, sap2); | ||
263 | } | ||
264 | } | ||
265 | return false; | ||
266 | } | ||
267 | |||
268 | /** | ||
269 | * rpc_copy_addr - copy the address portion of one sockaddr to another | ||
270 | * @dst: destination sockaddr | ||
271 | * @src: source sockaddr | ||
272 | * | ||
273 | * Just copies the address portion and family. Ignores port, scope, etc. | ||
274 | * Caller is responsible for making certain that dst is large enough to hold | ||
275 | * the address in src. Returns true if address family is supported. Returns | ||
276 | * false otherwise. | ||
277 | */ | ||
278 | static inline bool rpc_copy_addr(struct sockaddr *dst, | ||
279 | const struct sockaddr *src) | ||
280 | { | ||
281 | switch (src->sa_family) { | ||
282 | case AF_INET: | ||
283 | return __rpc_copy_addr4(dst, src); | ||
284 | case AF_INET6: | ||
285 | return __rpc_copy_addr6(dst, src); | ||
286 | } | ||
287 | return false; | ||
288 | } | ||
289 | |||
290 | /** | ||
291 | * rpc_get_scope_id - return scopeid for a given sockaddr | ||
292 | * @sa: sockaddr to get scopeid from | ||
293 | * | ||
294 | * Returns the value of the sin6_scope_id for AF_INET6 addrs, or 0 if | ||
295 | * not an AF_INET6 address. | ||
296 | */ | ||
297 | static inline u32 rpc_get_scope_id(const struct sockaddr *sa) | ||
298 | { | ||
299 | if (sa->sa_family != AF_INET6) | ||
300 | return 0; | ||
301 | |||
302 | return ((struct sockaddr_in6 *) sa)->sin6_scope_id; | ||
303 | } | ||
304 | |||
191 | #endif /* __KERNEL__ */ | 305 | #endif /* __KERNEL__ */ |
192 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 306 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index ea8009695c69..52e8cb0a7569 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -94,8 +94,6 @@ struct svc_serv { | |||
94 | struct module * sv_module; /* optional module to count when | 94 | struct module * sv_module; /* optional module to count when |
95 | * adding threads */ | 95 | * adding threads */ |
96 | svc_thread_fn sv_function; /* main function for threads */ | 96 | svc_thread_fn sv_function; /* main function for threads */ |
97 | unsigned int sv_drc_max_pages; /* Total pages for DRC */ | ||
98 | unsigned int sv_drc_pages_used;/* DRC pages used */ | ||
99 | #if defined(CONFIG_NFS_V4_1) | 97 | #if defined(CONFIG_NFS_V4_1) |
100 | struct list_head sv_cb_list; /* queue for callback requests | 98 | struct list_head sv_cb_list; /* queue for callback requests |
101 | * that arrive over the same | 99 | * that arrive over the same |
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 2223ae0b5ed5..5f4e18b3ce73 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -65,6 +65,7 @@ struct svc_xprt { | |||
65 | size_t xpt_locallen; /* length of address */ | 65 | size_t xpt_locallen; /* length of address */ |
66 | struct sockaddr_storage xpt_remote; /* remote peer's address */ | 66 | struct sockaddr_storage xpt_remote; /* remote peer's address */ |
67 | size_t xpt_remotelen; /* length of address */ | 67 | size_t xpt_remotelen; /* length of address */ |
68 | struct rpc_wait_queue xpt_bc_pending; /* backchannel wait queue */ | ||
68 | }; | 69 | }; |
69 | 70 | ||
70 | int svc_reg_xprt_class(struct svc_xprt_class *); | 71 | int svc_reg_xprt_class(struct svc_xprt_class *); |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 04dba23c59f2..1b353a76c304 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -28,6 +28,7 @@ struct svc_sock { | |||
28 | /* private TCP part */ | 28 | /* private TCP part */ |
29 | u32 sk_reclen; /* length of record */ | 29 | u32 sk_reclen; /* length of record */ |
30 | u32 sk_tcplen; /* current read length */ | 30 | u32 sk_tcplen; /* current read length */ |
31 | struct rpc_xprt *sk_bc_xprt; /* NFSv4.1 backchannel xprt */ | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | /* | 34 | /* |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 7da466ba4b0d..f5cc0898bc53 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/uio.h> | 12 | #include <linux/uio.h> |
13 | #include <asm/byteorder.h> | 13 | #include <asm/byteorder.h> |
14 | #include <asm/unaligned.h> | ||
14 | #include <linux/scatterlist.h> | 15 | #include <linux/scatterlist.h> |
15 | 16 | ||
16 | /* | 17 | /* |
@@ -117,14 +118,14 @@ static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int le | |||
117 | static inline __be32 * | 118 | static inline __be32 * |
118 | xdr_encode_hyper(__be32 *p, __u64 val) | 119 | xdr_encode_hyper(__be32 *p, __u64 val) |
119 | { | 120 | { |
120 | *(__be64 *)p = cpu_to_be64(val); | 121 | put_unaligned_be64(val, p); |
121 | return p + 2; | 122 | return p + 2; |
122 | } | 123 | } |
123 | 124 | ||
124 | static inline __be32 * | 125 | static inline __be32 * |
125 | xdr_decode_hyper(__be32 *p, __u64 *valp) | 126 | xdr_decode_hyper(__be32 *p, __u64 *valp) |
126 | { | 127 | { |
127 | *valp = be64_to_cpup((__be64 *)p); | 128 | *valp = get_unaligned_be64(p); |
128 | return p + 2; | 129 | return p + 2; |
129 | } | 130 | } |
130 | 131 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index c090df442572..6f9457a75b8f 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -124,6 +124,23 @@ struct rpc_xprt_ops { | |||
124 | void (*print_stats)(struct rpc_xprt *xprt, struct seq_file *seq); | 124 | void (*print_stats)(struct rpc_xprt *xprt, struct seq_file *seq); |
125 | }; | 125 | }; |
126 | 126 | ||
127 | /* | ||
128 | * RPC transport identifiers | ||
129 | * | ||
130 | * To preserve compatibility with the historical use of raw IP protocol | ||
131 | * id's for transport selection, UDP and TCP identifiers are specified | ||
132 | * with the previous values. No such restriction exists for new transports, | ||
133 | * except that they may not collide with these values (17 and 6, | ||
134 | * respectively). | ||
135 | */ | ||
136 | #define XPRT_TRANSPORT_BC (1 << 31) | ||
137 | enum xprt_transports { | ||
138 | XPRT_TRANSPORT_UDP = IPPROTO_UDP, | ||
139 | XPRT_TRANSPORT_TCP = IPPROTO_TCP, | ||
140 | XPRT_TRANSPORT_BC_TCP = IPPROTO_TCP | XPRT_TRANSPORT_BC, | ||
141 | XPRT_TRANSPORT_RDMA = 256 | ||
142 | }; | ||
143 | |||
127 | struct rpc_xprt { | 144 | struct rpc_xprt { |
128 | struct kref kref; /* Reference count */ | 145 | struct kref kref; /* Reference count */ |
129 | struct rpc_xprt_ops * ops; /* transport methods */ | 146 | struct rpc_xprt_ops * ops; /* transport methods */ |
@@ -179,6 +196,7 @@ struct rpc_xprt { | |||
179 | spinlock_t reserve_lock; /* lock slot table */ | 196 | spinlock_t reserve_lock; /* lock slot table */ |
180 | u32 xid; /* Next XID value to use */ | 197 | u32 xid; /* Next XID value to use */ |
181 | struct rpc_task * snd_task; /* Task blocked in send */ | 198 | struct rpc_task * snd_task; /* Task blocked in send */ |
199 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | ||
182 | #if defined(CONFIG_NFS_V4_1) | 200 | #if defined(CONFIG_NFS_V4_1) |
183 | struct svc_serv *bc_serv; /* The RPC service which will */ | 201 | struct svc_serv *bc_serv; /* The RPC service which will */ |
184 | /* process the callback */ | 202 | /* process the callback */ |
@@ -231,6 +249,7 @@ struct xprt_create { | |||
231 | struct sockaddr * srcaddr; /* optional local address */ | 249 | struct sockaddr * srcaddr; /* optional local address */ |
232 | struct sockaddr * dstaddr; /* remote peer address */ | 250 | struct sockaddr * dstaddr; /* remote peer address */ |
233 | size_t addrlen; | 251 | size_t addrlen; |
252 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | ||
234 | }; | 253 | }; |
235 | 254 | ||
236 | struct xprt_class { | 255 | struct xprt_class { |
diff --git a/include/linux/sunrpc/xprtrdma.h b/include/linux/sunrpc/xprtrdma.h index 54a379c9e8eb..c2f04e1ae159 100644 --- a/include/linux/sunrpc/xprtrdma.h +++ b/include/linux/sunrpc/xprtrdma.h | |||
@@ -41,11 +41,6 @@ | |||
41 | #define _LINUX_SUNRPC_XPRTRDMA_H | 41 | #define _LINUX_SUNRPC_XPRTRDMA_H |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * RPC transport identifier for RDMA | ||
45 | */ | ||
46 | #define XPRT_TRANSPORT_RDMA 256 | ||
47 | |||
48 | /* | ||
49 | * rpcbind (v3+) RDMA netid. | 44 | * rpcbind (v3+) RDMA netid. |
50 | */ | 45 | */ |
51 | #define RPCBIND_NETID_RDMA "rdma" | 46 | #define RPCBIND_NETID_RDMA "rdma" |
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h index c2a46c45c8f7..3f14a02e9cc0 100644 --- a/include/linux/sunrpc/xprtsock.h +++ b/include/linux/sunrpc/xprtsock.h | |||
@@ -13,17 +13,6 @@ int init_socket_xprt(void); | |||
13 | void cleanup_socket_xprt(void); | 13 | void cleanup_socket_xprt(void); |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * RPC transport identifiers for UDP, TCP | ||
17 | * | ||
18 | * To preserve compatibility with the historical use of raw IP protocol | ||
19 | * id's for transport selection, these are specified with the previous | ||
20 | * values. No such restriction exists for new transports, except that | ||
21 | * they may not collide with these values (17 and 6, respectively). | ||
22 | */ | ||
23 | #define XPRT_TRANSPORT_UDP IPPROTO_UDP | ||
24 | #define XPRT_TRANSPORT_TCP IPPROTO_TCP | ||
25 | |||
26 | /* | ||
27 | * RPC slot table sizes for UDP, TCP transports | 16 | * RPC slot table sizes for UDP, TCP transports |
28 | */ | 17 | */ |
29 | extern unsigned int xprt_udp_slot_table_entries; | 18 | extern unsigned int xprt_udp_slot_table_entries; |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 7c15334f3ff2..4ec90019c1a4 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -34,15 +34,37 @@ static inline int current_is_kswapd(void) | |||
34 | * the type/offset into the pte as 5/27 as well. | 34 | * the type/offset into the pte as 5/27 as well. |
35 | */ | 35 | */ |
36 | #define MAX_SWAPFILES_SHIFT 5 | 36 | #define MAX_SWAPFILES_SHIFT 5 |
37 | #ifndef CONFIG_MIGRATION | 37 | |
38 | #define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) | 38 | /* |
39 | * Use some of the swap files numbers for other purposes. This | ||
40 | * is a convenient way to hook into the VM to trigger special | ||
41 | * actions on faults. | ||
42 | */ | ||
43 | |||
44 | /* | ||
45 | * NUMA node memory migration support | ||
46 | */ | ||
47 | #ifdef CONFIG_MIGRATION | ||
48 | #define SWP_MIGRATION_NUM 2 | ||
49 | #define SWP_MIGRATION_READ (MAX_SWAPFILES + SWP_HWPOISON_NUM) | ||
50 | #define SWP_MIGRATION_WRITE (MAX_SWAPFILES + SWP_HWPOISON_NUM + 1) | ||
51 | #else | ||
52 | #define SWP_MIGRATION_NUM 0 | ||
53 | #endif | ||
54 | |||
55 | /* | ||
56 | * Handling of hardware poisoned pages with memory corruption. | ||
57 | */ | ||
58 | #ifdef CONFIG_MEMORY_FAILURE | ||
59 | #define SWP_HWPOISON_NUM 1 | ||
60 | #define SWP_HWPOISON MAX_SWAPFILES | ||
39 | #else | 61 | #else |
40 | /* Use last two entries for page migration swap entries */ | 62 | #define SWP_HWPOISON_NUM 0 |
41 | #define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2) | ||
42 | #define SWP_MIGRATION_READ MAX_SWAPFILES | ||
43 | #define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1) | ||
44 | #endif | 63 | #endif |
45 | 64 | ||
65 | #define MAX_SWAPFILES \ | ||
66 | ((1 << MAX_SWAPFILES_SHIFT) - SWP_MIGRATION_NUM - SWP_HWPOISON_NUM) | ||
67 | |||
46 | /* | 68 | /* |
47 | * Magic header for a swap area. The first part of the union is | 69 | * Magic header for a swap area. The first part of the union is |
48 | * what the swap magic looks like for the old (limited to 128MB) | 70 | * what the swap magic looks like for the old (limited to 128MB) |
@@ -217,6 +239,11 @@ extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, | |||
217 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, | 239 | extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem, |
218 | gfp_t gfp_mask, bool noswap, | 240 | gfp_t gfp_mask, bool noswap, |
219 | unsigned int swappiness); | 241 | unsigned int swappiness); |
242 | extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem, | ||
243 | gfp_t gfp_mask, bool noswap, | ||
244 | unsigned int swappiness, | ||
245 | struct zone *zone, | ||
246 | int nid); | ||
220 | extern int __isolate_lru_page(struct page *page, int mode, int file); | 247 | extern int __isolate_lru_page(struct page *page, int mode, int file); |
221 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 248 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
222 | extern int vm_swappiness; | 249 | extern int vm_swappiness; |
@@ -240,7 +267,7 @@ extern int page_evictable(struct page *page, struct vm_area_struct *vma); | |||
240 | extern void scan_mapping_unevictable_pages(struct address_space *); | 267 | extern void scan_mapping_unevictable_pages(struct address_space *); |
241 | 268 | ||
242 | extern unsigned long scan_unevictable_pages; | 269 | extern unsigned long scan_unevictable_pages; |
243 | extern int scan_unevictable_handler(struct ctl_table *, int, struct file *, | 270 | extern int scan_unevictable_handler(struct ctl_table *, int, |
244 | void __user *, size_t *, loff_t *); | 271 | void __user *, size_t *, loff_t *); |
245 | extern int scan_unevictable_register_node(struct node *node); | 272 | extern int scan_unevictable_register_node(struct node *node); |
246 | extern void scan_unevictable_unregister_node(struct node *node); | 273 | extern void scan_unevictable_unregister_node(struct node *node); |
@@ -419,10 +446,22 @@ static inline swp_entry_t get_swap_page(void) | |||
419 | } | 446 | } |
420 | 447 | ||
421 | /* linux/mm/thrash.c */ | 448 | /* linux/mm/thrash.c */ |
422 | #define put_swap_token(mm) do { } while (0) | 449 | static inline void put_swap_token(struct mm_struct *mm) |
423 | #define grab_swap_token(mm) do { } while (0) | 450 | { |
424 | #define has_swap_token(mm) 0 | 451 | } |
425 | #define disable_swap_token() do { } while (0) | 452 | |
453 | static inline void grab_swap_token(struct mm_struct *mm) | ||
454 | { | ||
455 | } | ||
456 | |||
457 | static inline int has_swap_token(struct mm_struct *mm) | ||
458 | { | ||
459 | return 0; | ||
460 | } | ||
461 | |||
462 | static inline void disable_swap_token(void) | ||
463 | { | ||
464 | } | ||
426 | 465 | ||
427 | static inline void | 466 | static inline void |
428 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | 467 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 6ec39ab27b4b..cd42e30b7c6e 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -131,3 +131,41 @@ static inline int is_write_migration_entry(swp_entry_t entry) | |||
131 | 131 | ||
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | #ifdef CONFIG_MEMORY_FAILURE | ||
135 | /* | ||
136 | * Support for hardware poisoned pages | ||
137 | */ | ||
138 | static inline swp_entry_t make_hwpoison_entry(struct page *page) | ||
139 | { | ||
140 | BUG_ON(!PageLocked(page)); | ||
141 | return swp_entry(SWP_HWPOISON, page_to_pfn(page)); | ||
142 | } | ||
143 | |||
144 | static inline int is_hwpoison_entry(swp_entry_t entry) | ||
145 | { | ||
146 | return swp_type(entry) == SWP_HWPOISON; | ||
147 | } | ||
148 | #else | ||
149 | |||
150 | static inline swp_entry_t make_hwpoison_entry(struct page *page) | ||
151 | { | ||
152 | return swp_entry(0, 0); | ||
153 | } | ||
154 | |||
155 | static inline int is_hwpoison_entry(swp_entry_t swp) | ||
156 | { | ||
157 | return 0; | ||
158 | } | ||
159 | #endif | ||
160 | |||
161 | #if defined(CONFIG_MEMORY_FAILURE) || defined(CONFIG_MIGRATION) | ||
162 | static inline int non_swap_entry(swp_entry_t entry) | ||
163 | { | ||
164 | return swp_type(entry) >= MAX_SWAPFILES; | ||
165 | } | ||
166 | #else | ||
167 | static inline int non_swap_entry(swp_entry_t entry) | ||
168 | { | ||
169 | return 0; | ||
170 | } | ||
171 | #endif | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 8d8285a10db9..a990ace1a838 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -460,8 +460,7 @@ asmlinkage long sys_mount(char __user *dev_name, char __user *dir_name, | |||
460 | void __user *data); | 460 | void __user *data); |
461 | asmlinkage long sys_umount(char __user *name, int flags); | 461 | asmlinkage long sys_umount(char __user *name, int flags); |
462 | asmlinkage long sys_oldumount(char __user *name); | 462 | asmlinkage long sys_oldumount(char __user *name); |
463 | asmlinkage long sys_truncate(const char __user *path, | 463 | asmlinkage long sys_truncate(const char __user *path, long length); |
464 | unsigned long length); | ||
465 | asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); | 464 | asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); |
466 | asmlinkage long sys_stat(char __user *filename, | 465 | asmlinkage long sys_stat(char __user *filename, |
467 | struct __old_kernel_stat __user *statbuf); | 466 | struct __old_kernel_stat __user *statbuf); |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index e76d3b22a466..1e4743ee6831 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #include <linux/compiler.h> | 30 | #include <linux/compiler.h> |
31 | 31 | ||
32 | struct file; | ||
33 | struct completion; | 32 | struct completion; |
34 | 33 | ||
35 | #define CTL_MAXNAME 10 /* how many path components do we allow in a | 34 | #define CTL_MAXNAME 10 /* how many path components do we allow in a |
@@ -977,25 +976,25 @@ typedef int ctl_handler (struct ctl_table *table, | |||
977 | void __user *oldval, size_t __user *oldlenp, | 976 | void __user *oldval, size_t __user *oldlenp, |
978 | void __user *newval, size_t newlen); | 977 | void __user *newval, size_t newlen); |
979 | 978 | ||
980 | typedef int proc_handler (struct ctl_table *ctl, int write, struct file * filp, | 979 | typedef int proc_handler (struct ctl_table *ctl, int write, |
981 | void __user *buffer, size_t *lenp, loff_t *ppos); | 980 | void __user *buffer, size_t *lenp, loff_t *ppos); |
982 | 981 | ||
983 | extern int proc_dostring(struct ctl_table *, int, struct file *, | 982 | extern int proc_dostring(struct ctl_table *, int, |
984 | void __user *, size_t *, loff_t *); | 983 | void __user *, size_t *, loff_t *); |
985 | extern int proc_dointvec(struct ctl_table *, int, struct file *, | 984 | extern int proc_dointvec(struct ctl_table *, int, |
986 | void __user *, size_t *, loff_t *); | 985 | void __user *, size_t *, loff_t *); |
987 | extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *, | 986 | extern int proc_dointvec_minmax(struct ctl_table *, int, |
988 | void __user *, size_t *, loff_t *); | 987 | void __user *, size_t *, loff_t *); |
989 | extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *, | 988 | extern int proc_dointvec_jiffies(struct ctl_table *, int, |
990 | void __user *, size_t *, loff_t *); | 989 | void __user *, size_t *, loff_t *); |
991 | extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int, struct file *, | 990 | extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int, |
992 | void __user *, size_t *, loff_t *); | 991 | void __user *, size_t *, loff_t *); |
993 | extern int proc_dointvec_ms_jiffies(struct ctl_table *, int, struct file *, | 992 | extern int proc_dointvec_ms_jiffies(struct ctl_table *, int, |
994 | void __user *, size_t *, loff_t *); | 993 | void __user *, size_t *, loff_t *); |
995 | extern int proc_doulongvec_minmax(struct ctl_table *, int, struct file *, | 994 | extern int proc_doulongvec_minmax(struct ctl_table *, int, |
996 | void __user *, size_t *, loff_t *); | 995 | void __user *, size_t *, loff_t *); |
997 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, | 996 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, |
998 | struct file *, void __user *, size_t *, loff_t *); | 997 | void __user *, size_t *, loff_t *); |
999 | 998 | ||
1000 | extern int do_sysctl (int __user *name, int nlen, | 999 | extern int do_sysctl (int __user *name, int nlen, |
1001 | void __user *oldval, size_t __user *oldlenp, | 1000 | void __user *oldval, size_t __user *oldlenp, |
diff --git a/include/linux/time.h b/include/linux/time.h index 56787c093345..fe04e5ef6a59 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -155,6 +155,34 @@ extern void timekeeping_leap_insert(int leapsecond); | |||
155 | struct tms; | 155 | struct tms; |
156 | extern void do_sys_times(struct tms *); | 156 | extern void do_sys_times(struct tms *); |
157 | 157 | ||
158 | /* | ||
159 | * Similar to the struct tm in userspace <time.h>, but it needs to be here so | ||
160 | * that the kernel source is self contained. | ||
161 | */ | ||
162 | struct tm { | ||
163 | /* | ||
164 | * the number of seconds after the minute, normally in the range | ||
165 | * 0 to 59, but can be up to 60 to allow for leap seconds | ||
166 | */ | ||
167 | int tm_sec; | ||
168 | /* the number of minutes after the hour, in the range 0 to 59*/ | ||
169 | int tm_min; | ||
170 | /* the number of hours past midnight, in the range 0 to 23 */ | ||
171 | int tm_hour; | ||
172 | /* the day of the month, in the range 1 to 31 */ | ||
173 | int tm_mday; | ||
174 | /* the number of months since January, in the range 0 to 11 */ | ||
175 | int tm_mon; | ||
176 | /* the number of years since 1900 */ | ||
177 | long tm_year; | ||
178 | /* the number of days since Sunday, in the range 0 to 6 */ | ||
179 | int tm_wday; | ||
180 | /* the number of days since January 1, in the range 0 to 365 */ | ||
181 | int tm_yday; | ||
182 | }; | ||
183 | |||
184 | void time_to_tm(time_t totalsecs, int offset, struct tm *result); | ||
185 | |||
158 | /** | 186 | /** |
159 | * timespec_to_ns - Convert timespec to nanoseconds | 187 | * timespec_to_ns - Convert timespec to nanoseconds |
160 | * @ts: pointer to the timespec variable to be converted | 188 | * @ts: pointer to the timespec variable to be converted |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 809b26c07090..fc0bf3edeb67 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -211,12 +211,6 @@ int arch_update_cpu_topology(void); | |||
211 | #ifndef topology_core_id | 211 | #ifndef topology_core_id |
212 | #define topology_core_id(cpu) ((void)(cpu), 0) | 212 | #define topology_core_id(cpu) ((void)(cpu), 0) |
213 | #endif | 213 | #endif |
214 | #ifndef topology_thread_siblings | ||
215 | #define topology_thread_siblings(cpu) cpumask_of_cpu(cpu) | ||
216 | #endif | ||
217 | #ifndef topology_core_siblings | ||
218 | #define topology_core_siblings(cpu) cpumask_of_cpu(cpu) | ||
219 | #endif | ||
220 | #ifndef topology_thread_cpumask | 214 | #ifndef topology_thread_cpumask |
221 | #define topology_thread_cpumask(cpu) cpumask_of(cpu) | 215 | #define topology_thread_cpumask(cpu) cpumask_of(cpu) |
222 | #endif | 216 | #endif |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 17ba82efa483..1eb44a924e56 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Tracing hooks | 2 | * Tracing hooks |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | 4 | * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. |
5 | * | 5 | * |
6 | * This copyrighted material is made available to anyone wishing to use, | 6 | * This copyrighted material is made available to anyone wishing to use, |
7 | * modify, copy, or redistribute it subject to the terms and conditions | 7 | * modify, copy, or redistribute it subject to the terms and conditions |
@@ -463,22 +463,38 @@ static inline int tracehook_get_signal(struct task_struct *task, | |||
463 | 463 | ||
464 | /** | 464 | /** |
465 | * tracehook_notify_jctl - report about job control stop/continue | 465 | * tracehook_notify_jctl - report about job control stop/continue |
466 | * @notify: nonzero if this is the last thread in the group to stop | 466 | * @notify: zero, %CLD_STOPPED or %CLD_CONTINUED |
467 | * @why: %CLD_STOPPED or %CLD_CONTINUED | 467 | * @why: %CLD_STOPPED or %CLD_CONTINUED |
468 | * | 468 | * |
469 | * This is called when we might call do_notify_parent_cldstop(). | 469 | * This is called when we might call do_notify_parent_cldstop(). |
470 | * It's called when about to stop for job control; we are already in | ||
471 | * %TASK_STOPPED state, about to call schedule(). It's also called when | ||
472 | * a delayed %CLD_STOPPED or %CLD_CONTINUED report is ready to be made. | ||
473 | * | 470 | * |
474 | * Return nonzero to generate a %SIGCHLD with @why, which is | 471 | * @notify is zero if we would not ordinarily send a %SIGCHLD, |
475 | * normal if @notify is nonzero. | 472 | * or is the %CLD_STOPPED or %CLD_CONTINUED .si_code for %SIGCHLD. |
476 | * | 473 | * |
477 | * Called with no locks held. | 474 | * @why is %CLD_STOPPED when about to stop for job control; |
475 | * we are already in %TASK_STOPPED state, about to call schedule(). | ||
476 | * It might also be that we have just exited (check %PF_EXITING), | ||
477 | * but need to report that a group-wide stop is complete. | ||
478 | * | ||
479 | * @why is %CLD_CONTINUED when waking up after job control stop and | ||
480 | * ready to make a delayed @notify report. | ||
481 | * | ||
482 | * Return the %CLD_* value for %SIGCHLD, or zero to generate no signal. | ||
483 | * | ||
484 | * Called with the siglock held. | ||
478 | */ | 485 | */ |
479 | static inline int tracehook_notify_jctl(int notify, int why) | 486 | static inline int tracehook_notify_jctl(int notify, int why) |
480 | { | 487 | { |
481 | return notify || (current->ptrace & PT_PTRACED); | 488 | return notify ?: (current->ptrace & PT_PTRACED) ? why : 0; |
489 | } | ||
490 | |||
491 | /** | ||
492 | * tracehook_finish_jctl - report about return from job control stop | ||
493 | * | ||
494 | * This is called by do_signal_stop() after wakeup. | ||
495 | */ | ||
496 | static inline void tracehook_finish_jctl(void) | ||
497 | { | ||
482 | } | 498 | } |
483 | 499 | ||
484 | #define DEATH_REAP -1 | 500 | #define DEATH_REAP -1 |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 63a3f7a80580..2aac8a83e89b 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -4,7 +4,7 @@ | |||
4 | /* | 4 | /* |
5 | * Kernel Tracepoint API. | 5 | * Kernel Tracepoint API. |
6 | * | 6 | * |
7 | * See Documentation/tracepoint.txt. | 7 | * See Documentation/trace/tracepoints.txt. |
8 | * | 8 | * |
9 | * (C) Copyright 2008 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 9 | * (C) Copyright 2008 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
10 | * | 10 | * |
@@ -36,7 +36,7 @@ struct tracepoint { | |||
36 | #ifndef DECLARE_TRACE | 36 | #ifndef DECLARE_TRACE |
37 | 37 | ||
38 | #define TP_PROTO(args...) args | 38 | #define TP_PROTO(args...) args |
39 | #define TP_ARGS(args...) args | 39 | #define TP_ARGS(args...) args |
40 | 40 | ||
41 | #ifdef CONFIG_TRACEPOINTS | 41 | #ifdef CONFIG_TRACEPOINTS |
42 | 42 | ||
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index ae779bb8cc0f..adb44066680c 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <sound/ac97_codec.h> | 26 | #include <sound/ac97_codec.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/gpio.h> | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * UCB1400 AC-link registers | 32 | * UCB1400 AC-link registers |
@@ -82,6 +83,17 @@ | |||
82 | #define UCB_ID 0x7e | 83 | #define UCB_ID 0x7e |
83 | #define UCB_ID_1400 0x4304 | 84 | #define UCB_ID_1400 0x4304 |
84 | 85 | ||
86 | struct ucb1400_gpio_data { | ||
87 | int gpio_offset; | ||
88 | int (*gpio_setup)(struct device *dev, int ngpio); | ||
89 | int (*gpio_teardown)(struct device *dev, int ngpio); | ||
90 | }; | ||
91 | |||
92 | struct ucb1400_gpio { | ||
93 | struct gpio_chip gc; | ||
94 | struct snd_ac97 *ac97; | ||
95 | }; | ||
96 | |||
85 | struct ucb1400_ts { | 97 | struct ucb1400_ts { |
86 | struct input_dev *ts_idev; | 98 | struct input_dev *ts_idev; |
87 | struct task_struct *ts_task; | 99 | struct task_struct *ts_task; |
@@ -95,6 +107,7 @@ struct ucb1400_ts { | |||
95 | 107 | ||
96 | struct ucb1400 { | 108 | struct ucb1400 { |
97 | struct platform_device *ucb1400_ts; | 109 | struct platform_device *ucb1400_ts; |
110 | struct platform_device *ucb1400_gpio; | ||
98 | }; | 111 | }; |
99 | 112 | ||
100 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) | 113 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) |
@@ -147,4 +160,10 @@ static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) | |||
147 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, | 160 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, |
148 | int adcsync); | 161 | int adcsync); |
149 | 162 | ||
163 | #ifdef CONFIG_GPIO_UCB1400 | ||
164 | void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data); | ||
165 | #else | ||
166 | static inline void ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) {} | ||
167 | #endif | ||
168 | |||
150 | #endif | 169 | #endif |
diff --git a/include/linux/unaligned/be_byteshift.h b/include/linux/unaligned/be_byteshift.h index 46dd12c5709e..9356b24223ac 100644 --- a/include/linux/unaligned/be_byteshift.h +++ b/include/linux/unaligned/be_byteshift.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_UNALIGNED_BE_BYTESHIFT_H | 1 | #ifndef _LINUX_UNALIGNED_BE_BYTESHIFT_H |
2 | #define _LINUX_UNALIGNED_BE_BYTESHIFT_H | 2 | #define _LINUX_UNALIGNED_BE_BYTESHIFT_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | static inline u16 __get_unaligned_be16(const u8 *p) | 6 | static inline u16 __get_unaligned_be16(const u8 *p) |
7 | { | 7 | { |
diff --git a/include/linux/unaligned/le_byteshift.h b/include/linux/unaligned/le_byteshift.h index 59777e951baf..be376fb79b64 100644 --- a/include/linux/unaligned/le_byteshift.h +++ b/include/linux/unaligned/le_byteshift.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_UNALIGNED_LE_BYTESHIFT_H | 1 | #ifndef _LINUX_UNALIGNED_LE_BYTESHIFT_H |
2 | #define _LINUX_UNALIGNED_LE_BYTESHIFT_H | 2 | #define _LINUX_UNALIGNED_LE_BYTESHIFT_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | static inline u16 __get_unaligned_le16(const u8 *p) | 6 | static inline u16 __get_unaligned_le16(const u8 *p) |
7 | { | 7 | { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index a8fe05f224e5..a34fa89f1474 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -195,7 +195,7 @@ struct usb_interface { | |||
195 | 195 | ||
196 | struct device dev; /* interface specific device info */ | 196 | struct device dev; /* interface specific device info */ |
197 | struct device *usb_dev; | 197 | struct device *usb_dev; |
198 | int pm_usage_cnt; /* usage counter for autosuspend */ | 198 | atomic_t pm_usage_cnt; /* usage counter for autosuspend */ |
199 | struct work_struct reset_ws; /* for resets in atomic context */ | 199 | struct work_struct reset_ws; /* for resets in atomic context */ |
200 | }; | 200 | }; |
201 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 201 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
@@ -551,13 +551,13 @@ extern void usb_autopm_put_interface_async(struct usb_interface *intf); | |||
551 | 551 | ||
552 | static inline void usb_autopm_enable(struct usb_interface *intf) | 552 | static inline void usb_autopm_enable(struct usb_interface *intf) |
553 | { | 553 | { |
554 | intf->pm_usage_cnt = 0; | 554 | atomic_set(&intf->pm_usage_cnt, 0); |
555 | usb_autopm_set_interface(intf); | 555 | usb_autopm_set_interface(intf); |
556 | } | 556 | } |
557 | 557 | ||
558 | static inline void usb_autopm_disable(struct usb_interface *intf) | 558 | static inline void usb_autopm_disable(struct usb_interface *intf) |
559 | { | 559 | { |
560 | intf->pm_usage_cnt = 1; | 560 | atomic_set(&intf->pm_usage_cnt, 1); |
561 | usb_autopm_set_interface(intf); | 561 | usb_autopm_set_interface(intf); |
562 | } | 562 | } |
563 | 563 | ||
@@ -1036,9 +1036,10 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1036 | * @transfer_flags: A variety of flags may be used to affect how URB | 1036 | * @transfer_flags: A variety of flags may be used to affect how URB |
1037 | * submission, unlinking, or operation are handled. Different | 1037 | * submission, unlinking, or operation are handled. Different |
1038 | * kinds of URB can use different flags. | 1038 | * kinds of URB can use different flags. |
1039 | * @transfer_buffer: This identifies the buffer to (or from) which | 1039 | * @transfer_buffer: This identifies the buffer to (or from) which the I/O |
1040 | * the I/O request will be performed (unless URB_NO_TRANSFER_DMA_MAP | 1040 | * request will be performed unless URB_NO_TRANSFER_DMA_MAP is set |
1041 | * is set). This buffer must be suitable for DMA; allocate it with | 1041 | * (however, do not leave garbage in transfer_buffer even then). |
1042 | * This buffer must be suitable for DMA; allocate it with | ||
1042 | * kmalloc() or equivalent. For transfers to "in" endpoints, contents | 1043 | * kmalloc() or equivalent. For transfers to "in" endpoints, contents |
1043 | * of this buffer will be modified. This buffer is used for the data | 1044 | * of this buffer will be modified. This buffer is used for the data |
1044 | * stage of control transfers. | 1045 | * stage of control transfers. |
@@ -1071,7 +1072,7 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1071 | * @start_frame: Returns the initial frame for isochronous transfers. | 1072 | * @start_frame: Returns the initial frame for isochronous transfers. |
1072 | * @number_of_packets: Lists the number of ISO transfer buffers. | 1073 | * @number_of_packets: Lists the number of ISO transfer buffers. |
1073 | * @interval: Specifies the polling interval for interrupt or isochronous | 1074 | * @interval: Specifies the polling interval for interrupt or isochronous |
1074 | * transfers. The units are frames (milliseconds) for for full and low | 1075 | * transfers. The units are frames (milliseconds) for full and low |
1075 | * speed devices, and microframes (1/8 millisecond) for highspeed ones. | 1076 | * speed devices, and microframes (1/8 millisecond) for highspeed ones. |
1076 | * @error_count: Returns the number of ISO transfers that reported errors. | 1077 | * @error_count: Returns the number of ISO transfers that reported errors. |
1077 | * @context: For use in completion functions. This normally points to | 1078 | * @context: For use in completion functions. This normally points to |
@@ -1104,9 +1105,15 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1104 | * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). | 1105 | * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). |
1105 | * When these transfer flags are provided, host controller drivers will | 1106 | * When these transfer flags are provided, host controller drivers will |
1106 | * attempt to use the dma addresses found in the transfer_dma and/or | 1107 | * attempt to use the dma addresses found in the transfer_dma and/or |
1107 | * setup_dma fields rather than determining a dma address themselves. (Note | 1108 | * setup_dma fields rather than determining a dma address themselves. |
1108 | * that transfer_buffer and setup_packet must still be set because not all | 1109 | * |
1109 | * host controllers use DMA, nor do virtual root hubs). | 1110 | * Note that transfer_buffer must still be set if the controller |
1111 | * does not support DMA (as indicated by bus.uses_dma) and when talking | ||
1112 | * to root hub. If you have to trasfer between highmem zone and the device | ||
1113 | * on such controller, create a bounce buffer or bail out with an error. | ||
1114 | * If transfer_buffer cannot be set (is in highmem) and the controller is DMA | ||
1115 | * capable, assign NULL to it, so that usbmon knows not to use the value. | ||
1116 | * The setup_packet must always be set, so it cannot be located in highmem. | ||
1110 | * | 1117 | * |
1111 | * Initialization: | 1118 | * Initialization: |
1112 | * | 1119 | * |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index b5744bc218ab..eaf9dffe0a01 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
@@ -24,88 +24,78 @@ | |||
24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | 24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 |
25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
27 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | 27 | |
28 | 28 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ | |
29 | /* A.5 Audio Class-Specific AC interface Descriptor Subtypes*/ | 29 | #define UAC_HEADER 0x01 |
30 | #define HEADER 0x01 | 30 | #define UAC_INPUT_TERMINAL 0x02 |
31 | #define INPUT_TERMINAL 0x02 | 31 | #define UAC_OUTPUT_TERMINAL 0x03 |
32 | #define OUTPUT_TERMINAL 0x03 | 32 | #define UAC_MIXER_UNIT 0x04 |
33 | #define MIXER_UNIT 0x04 | 33 | #define UAC_SELECTOR_UNIT 0x05 |
34 | #define SELECTOR_UNIT 0x05 | 34 | #define UAC_FEATURE_UNIT 0x06 |
35 | #define FEATURE_UNIT 0x06 | 35 | #define UAC_PROCESSING_UNIT 0x07 |
36 | #define PROCESSING_UNIT 0x07 | 36 | #define UAC_EXTENSION_UNIT 0x08 |
37 | #define EXTENSION_UNIT 0x08 | 37 | |
38 | 38 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | |
39 | #define AS_GENERAL 0x01 | 39 | #define UAC_AS_GENERAL 0x01 |
40 | #define FORMAT_TYPE 0x02 | 40 | #define UAC_FORMAT_TYPE 0x02 |
41 | #define FORMAT_SPECIFIC 0x03 | 41 | #define UAC_FORMAT_SPECIFIC 0x03 |
42 | 42 | ||
43 | #define EP_GENERAL 0x01 | 43 | /* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */ |
44 | 44 | #define UAC_EP_GENERAL 0x01 | |
45 | #define MS_GENERAL 0x01 | 45 | |
46 | #define MIDI_IN_JACK 0x02 | 46 | /* A.9 Audio Class-Specific Request Codes */ |
47 | #define MIDI_OUT_JACK 0x03 | 47 | #define UAC_SET_ 0x00 |
48 | 48 | #define UAC_GET_ 0x80 | |
49 | /* endpoint attributes */ | 49 | |
50 | #define EP_ATTR_MASK 0x0c | 50 | #define UAC__CUR 0x1 |
51 | #define EP_ATTR_ASYNC 0x04 | 51 | #define UAC__MIN 0x2 |
52 | #define EP_ATTR_ADAPTIVE 0x08 | 52 | #define UAC__MAX 0x3 |
53 | #define EP_ATTR_SYNC 0x0c | 53 | #define UAC__RES 0x4 |
54 | 54 | #define UAC__MEM 0x5 | |
55 | /* cs endpoint attributes */ | 55 | |
56 | #define EP_CS_ATTR_SAMPLE_RATE 0x01 | 56 | #define UAC_SET_CUR (UAC_SET_ | UAC__CUR) |
57 | #define EP_CS_ATTR_PITCH_CONTROL 0x02 | 57 | #define UAC_GET_CUR (UAC_GET_ | UAC__CUR) |
58 | #define EP_CS_ATTR_FILL_MAX 0x80 | 58 | #define UAC_SET_MIN (UAC_SET_ | UAC__MIN) |
59 | 59 | #define UAC_GET_MIN (UAC_GET_ | UAC__MIN) | |
60 | /* Audio Class specific Request Codes */ | 60 | #define UAC_SET_MAX (UAC_SET_ | UAC__MAX) |
61 | #define USB_AUDIO_SET_INTF 0x21 | 61 | #define UAC_GET_MAX (UAC_GET_ | UAC__MAX) |
62 | #define USB_AUDIO_SET_ENDPOINT 0x22 | 62 | #define UAC_SET_RES (UAC_SET_ | UAC__RES) |
63 | #define USB_AUDIO_GET_INTF 0xa1 | 63 | #define UAC_GET_RES (UAC_GET_ | UAC__RES) |
64 | #define USB_AUDIO_GET_ENDPOINT 0xa2 | 64 | #define UAC_SET_MEM (UAC_SET_ | UAC__MEM) |
65 | 65 | #define UAC_GET_MEM (UAC_GET_ | UAC__MEM) | |
66 | #define SET_ 0x00 | 66 | |
67 | #define GET_ 0x80 | 67 | #define UAC_GET_STAT 0xff |
68 | 68 | ||
69 | #define _CUR 0x1 | 69 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ |
70 | #define _MIN 0x2 | 70 | #define UAC_MS_HEADER 0x01 |
71 | #define _MAX 0x3 | 71 | #define UAC_MIDI_IN_JACK 0x02 |
72 | #define _RES 0x4 | 72 | #define UAC_MIDI_OUT_JACK 0x03 |
73 | #define _MEM 0x5 | 73 | |
74 | 74 | /* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */ | |
75 | #define SET_CUR (SET_ | _CUR) | 75 | #define UAC_MS_GENERAL 0x01 |
76 | #define GET_CUR (GET_ | _CUR) | 76 | |
77 | #define SET_MIN (SET_ | _MIN) | 77 | /* Terminals - 2.1 USB Terminal Types */ |
78 | #define GET_MIN (GET_ | _MIN) | 78 | #define UAC_TERMINAL_UNDEFINED 0x100 |
79 | #define SET_MAX (SET_ | _MAX) | 79 | #define UAC_TERMINAL_STREAMING 0x101 |
80 | #define GET_MAX (GET_ | _MAX) | 80 | #define UAC_TERMINAL_VENDOR_SPEC 0x1FF |
81 | #define SET_RES (SET_ | _RES) | ||
82 | #define GET_RES (GET_ | _RES) | ||
83 | #define SET_MEM (SET_ | _MEM) | ||
84 | #define GET_MEM (GET_ | _MEM) | ||
85 | |||
86 | #define GET_STAT 0xff | ||
87 | |||
88 | #define USB_AC_TERMINAL_UNDEFINED 0x100 | ||
89 | #define USB_AC_TERMINAL_STREAMING 0x101 | ||
90 | #define USB_AC_TERMINAL_VENDOR_SPEC 0x1FF | ||
91 | 81 | ||
92 | /* Terminal Control Selectors */ | 82 | /* Terminal Control Selectors */ |
93 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 83 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
94 | struct usb_ac_header_descriptor { | 84 | struct uac_ac_header_descriptor { |
95 | __u8 bLength; /* 8 + n */ | 85 | __u8 bLength; /* 8 + n */ |
96 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 86 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
97 | __u8 bDescriptorSubtype; /* USB_MS_HEADER */ | 87 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ |
98 | __le16 bcdADC; /* 0x0100 */ | 88 | __le16 bcdADC; /* 0x0100 */ |
99 | __le16 wTotalLength; /* includes Unit and Terminal desc. */ | 89 | __le16 wTotalLength; /* includes Unit and Terminal desc. */ |
100 | __u8 bInCollection; /* n */ | 90 | __u8 bInCollection; /* n */ |
101 | __u8 baInterfaceNr[]; /* [n] */ | 91 | __u8 baInterfaceNr[]; /* [n] */ |
102 | } __attribute__ ((packed)); | 92 | } __attribute__ ((packed)); |
103 | 93 | ||
104 | #define USB_DT_AC_HEADER_SIZE(n) (8 + (n)) | 94 | #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) |
105 | 95 | ||
106 | /* As above, but more useful for defining your own descriptors: */ | 96 | /* As above, but more useful for defining your own descriptors: */ |
107 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ | 97 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ |
108 | struct usb_ac_header_descriptor_##n { \ | 98 | struct uac_ac_header_descriptor_##n { \ |
109 | __u8 bLength; \ | 99 | __u8 bLength; \ |
110 | __u8 bDescriptorType; \ | 100 | __u8 bDescriptorType; \ |
111 | __u8 bDescriptorSubtype; \ | 101 | __u8 bDescriptorSubtype; \ |
@@ -116,7 +106,7 @@ struct usb_ac_header_descriptor_##n { \ | |||
116 | } __attribute__ ((packed)) | 106 | } __attribute__ ((packed)) |
117 | 107 | ||
118 | /* 4.3.2.1 Input Terminal Descriptor */ | 108 | /* 4.3.2.1 Input Terminal Descriptor */ |
119 | struct usb_input_terminal_descriptor { | 109 | struct uac_input_terminal_descriptor { |
120 | __u8 bLength; /* in bytes: 12 */ | 110 | __u8 bLength; /* in bytes: 12 */ |
121 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 111 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
122 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ | 112 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ |
@@ -129,18 +119,19 @@ struct usb_input_terminal_descriptor { | |||
129 | __u8 iTerminal; | 119 | __u8 iTerminal; |
130 | } __attribute__ ((packed)); | 120 | } __attribute__ ((packed)); |
131 | 121 | ||
132 | #define USB_DT_AC_INPUT_TERMINAL_SIZE 12 | 122 | #define UAC_DT_INPUT_TERMINAL_SIZE 12 |
133 | 123 | ||
134 | #define USB_AC_INPUT_TERMINAL_UNDEFINED 0x200 | 124 | /* Terminals - 2.2 Input Terminal Types */ |
135 | #define USB_AC_INPUT_TERMINAL_MICROPHONE 0x201 | 125 | #define UAC_INPUT_TERMINAL_UNDEFINED 0x200 |
136 | #define USB_AC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 | 126 | #define UAC_INPUT_TERMINAL_MICROPHONE 0x201 |
137 | #define USB_AC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 | 127 | #define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 |
138 | #define USB_AC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 | 128 | #define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 |
139 | #define USB_AC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | 129 | #define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 |
140 | #define USB_AC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | 130 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 |
131 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | ||
141 | 132 | ||
142 | /* 4.3.2.2 Output Terminal Descriptor */ | 133 | /* 4.3.2.2 Output Terminal Descriptor */ |
143 | struct usb_output_terminal_descriptor { | 134 | struct uac_output_terminal_descriptor { |
144 | __u8 bLength; /* in bytes: 9 */ | 135 | __u8 bLength; /* in bytes: 9 */ |
145 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 136 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
146 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | 137 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ |
@@ -151,23 +142,24 @@ struct usb_output_terminal_descriptor { | |||
151 | __u8 iTerminal; | 142 | __u8 iTerminal; |
152 | } __attribute__ ((packed)); | 143 | } __attribute__ ((packed)); |
153 | 144 | ||
154 | #define USB_DT_AC_OUTPUT_TERMINAL_SIZE 9 | 145 | #define UAC_DT_OUTPUT_TERMINAL_SIZE 9 |
155 | 146 | ||
156 | #define USB_AC_OUTPUT_TERMINAL_UNDEFINED 0x300 | 147 | /* Terminals - 2.3 Output Terminal Types */ |
157 | #define USB_AC_OUTPUT_TERMINAL_SPEAKER 0x301 | 148 | #define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300 |
158 | #define USB_AC_OUTPUT_TERMINAL_HEADPHONES 0x302 | 149 | #define UAC_OUTPUT_TERMINAL_SPEAKER 0x301 |
159 | #define USB_AC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 | 150 | #define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302 |
160 | #define USB_AC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 | 151 | #define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 |
161 | #define USB_AC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 | 152 | #define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 |
162 | #define USB_AC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 | 153 | #define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 |
163 | #define USB_AC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | 154 | #define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 |
155 | #define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | ||
164 | 156 | ||
165 | /* Set bControlSize = 2 as default setting */ | 157 | /* Set bControlSize = 2 as default setting */ |
166 | #define USB_DT_AC_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) | 158 | #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) |
167 | 159 | ||
168 | /* As above, but more useful for defining your own descriptors: */ | 160 | /* As above, but more useful for defining your own descriptors: */ |
169 | #define DECLARE_USB_AC_FEATURE_UNIT_DESCRIPTOR(ch) \ | 161 | #define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \ |
170 | struct usb_ac_feature_unit_descriptor_##ch { \ | 162 | struct uac_feature_unit_descriptor_##ch { \ |
171 | __u8 bLength; \ | 163 | __u8 bLength; \ |
172 | __u8 bDescriptorType; \ | 164 | __u8 bDescriptorType; \ |
173 | __u8 bDescriptorSubtype; \ | 165 | __u8 bDescriptorSubtype; \ |
@@ -179,7 +171,7 @@ struct usb_ac_feature_unit_descriptor_##ch { \ | |||
179 | } __attribute__ ((packed)) | 171 | } __attribute__ ((packed)) |
180 | 172 | ||
181 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 173 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
182 | struct usb_as_header_descriptor { | 174 | struct uac_as_header_descriptor { |
183 | __u8 bLength; /* in bytes: 7 */ | 175 | __u8 bLength; /* in bytes: 7 */ |
184 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 176 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
185 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | 177 | __u8 bDescriptorSubtype; /* AS_GENERAL */ |
@@ -188,16 +180,17 @@ struct usb_as_header_descriptor { | |||
188 | __le16 wFormatTag; /* The Audio Data Format */ | 180 | __le16 wFormatTag; /* The Audio Data Format */ |
189 | } __attribute__ ((packed)); | 181 | } __attribute__ ((packed)); |
190 | 182 | ||
191 | #define USB_DT_AS_HEADER_SIZE 7 | 183 | #define UAC_DT_AS_HEADER_SIZE 7 |
192 | 184 | ||
193 | #define USB_AS_AUDIO_FORMAT_TYPE_I_UNDEFINED 0x0 | 185 | /* Formats - A.1.1 Audio Data Format Type I Codes */ |
194 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM 0x1 | 186 | #define UAC_FORMAT_TYPE_I_UNDEFINED 0x0 |
195 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM8 0x2 | 187 | #define UAC_FORMAT_TYPE_I_PCM 0x1 |
196 | #define USB_AS_AUDIO_FORMAT_TYPE_I_IEEE_FLOAT 0x3 | 188 | #define UAC_FORMAT_TYPE_I_PCM8 0x2 |
197 | #define USB_AS_AUDIO_FORMAT_TYPE_I_ALAW 0x4 | 189 | #define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3 |
198 | #define USB_AS_AUDIO_FORMAT_TYPE_I_MULAW 0x5 | 190 | #define UAC_FORMAT_TYPE_I_ALAW 0x4 |
191 | #define UAC_FORMAT_TYPE_I_MULAW 0x5 | ||
199 | 192 | ||
200 | struct usb_as_format_type_i_continuous_descriptor { | 193 | struct uac_format_type_i_continuous_descriptor { |
201 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | 194 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ |
202 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 195 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
203 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | 196 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ |
@@ -210,9 +203,9 @@ struct usb_as_format_type_i_continuous_descriptor { | |||
210 | __u8 tUpperSamFreq[3]; | 203 | __u8 tUpperSamFreq[3]; |
211 | } __attribute__ ((packed)); | 204 | } __attribute__ ((packed)); |
212 | 205 | ||
213 | #define USB_AS_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 | 206 | #define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 |
214 | 207 | ||
215 | struct usb_as_formate_type_i_discrete_descriptor { | 208 | struct uac_format_type_i_discrete_descriptor { |
216 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | 209 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ |
217 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 210 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
218 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | 211 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ |
@@ -224,8 +217,8 @@ struct usb_as_formate_type_i_discrete_descriptor { | |||
224 | __u8 tSamFreq[][3]; | 217 | __u8 tSamFreq[][3]; |
225 | } __attribute__ ((packed)); | 218 | } __attribute__ ((packed)); |
226 | 219 | ||
227 | #define DECLARE_USB_AS_FORMAT_TYPE_I_DISCRETE_DESC(n) \ | 220 | #define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \ |
228 | struct usb_as_formate_type_i_discrete_descriptor_##n { \ | 221 | struct uac_format_type_i_discrete_descriptor_##n { \ |
229 | __u8 bLength; \ | 222 | __u8 bLength; \ |
230 | __u8 bDescriptorType; \ | 223 | __u8 bDescriptorType; \ |
231 | __u8 bDescriptorSubtype; \ | 224 | __u8 bDescriptorSubtype; \ |
@@ -237,18 +230,15 @@ struct usb_as_formate_type_i_discrete_descriptor_##n { \ | |||
237 | __u8 tSamFreq[n][3]; \ | 230 | __u8 tSamFreq[n][3]; \ |
238 | } __attribute__ ((packed)) | 231 | } __attribute__ ((packed)) |
239 | 232 | ||
240 | #define USB_AS_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | 233 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) |
241 | |||
242 | #define USB_AS_FORMAT_TYPE_UNDEFINED 0x0 | ||
243 | #define USB_AS_FORMAT_TYPE_I 0x1 | ||
244 | #define USB_AS_FORMAT_TYPE_II 0x2 | ||
245 | #define USB_AS_FORMAT_TYPE_III 0x3 | ||
246 | 234 | ||
247 | #define USB_AS_ENDPOINT_ASYNC (1 << 2) | 235 | /* Formats - A.2 Format Type Codes */ |
248 | #define USB_AS_ENDPOINT_ADAPTIVE (2 << 2) | 236 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 |
249 | #define USB_AS_ENDPOINT_SYNC (3 << 2) | 237 | #define UAC_FORMAT_TYPE_I 0x1 |
238 | #define UAC_FORMAT_TYPE_II 0x2 | ||
239 | #define UAC_FORMAT_TYPE_III 0x3 | ||
250 | 240 | ||
251 | struct usb_as_iso_endpoint_descriptor { | 241 | struct uac_iso_endpoint_descriptor { |
252 | __u8 bLength; /* in bytes: 7 */ | 242 | __u8 bLength; /* in bytes: 7 */ |
253 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ | 243 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ |
254 | __u8 bDescriptorSubtype; /* EP_GENERAL */ | 244 | __u8 bDescriptorSubtype; /* EP_GENERAL */ |
@@ -256,30 +246,37 @@ struct usb_as_iso_endpoint_descriptor { | |||
256 | __u8 bLockDelayUnits; | 246 | __u8 bLockDelayUnits; |
257 | __le16 wLockDelay; | 247 | __le16 wLockDelay; |
258 | }; | 248 | }; |
259 | #define USB_AS_ISO_ENDPOINT_DESC_SIZE 7 | 249 | #define UAC_ISO_ENDPOINT_DESC_SIZE 7 |
260 | 250 | ||
261 | #define FU_CONTROL_UNDEFINED 0x00 | 251 | #define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 |
262 | #define MUTE_CONTROL 0x01 | 252 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 |
263 | #define VOLUME_CONTROL 0x02 | 253 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 |
264 | #define BASS_CONTROL 0x03 | 254 | |
265 | #define MID_CONTROL 0x04 | 255 | /* A.10.2 Feature Unit Control Selectors */ |
266 | #define TREBLE_CONTROL 0x05 | 256 | #define UAC_FU_CONTROL_UNDEFINED 0x00 |
267 | #define GRAPHIC_EQUALIZER_CONTROL 0x06 | 257 | #define UAC_MUTE_CONTROL 0x01 |
268 | #define AUTOMATIC_GAIN_CONTROL 0x07 | 258 | #define UAC_VOLUME_CONTROL 0x02 |
269 | #define DELAY_CONTROL 0x08 | 259 | #define UAC_BASS_CONTROL 0x03 |
270 | #define BASS_BOOST_CONTROL 0x09 | 260 | #define UAC_MID_CONTROL 0x04 |
271 | #define LOUDNESS_CONTROL 0x0a | 261 | #define UAC_TREBLE_CONTROL 0x05 |
272 | 262 | #define UAC_GRAPHIC_EQUALIZER_CONTROL 0x06 | |
273 | #define FU_MUTE (1 << (MUTE_CONTROL - 1)) | 263 | #define UAC_AUTOMATIC_GAIN_CONTROL 0x07 |
274 | #define FU_VOLUME (1 << (VOLUME_CONTROL - 1)) | 264 | #define UAC_DELAY_CONTROL 0x08 |
275 | #define FU_BASS (1 << (BASS_CONTROL - 1)) | 265 | #define UAC_BASS_BOOST_CONTROL 0x09 |
276 | #define FU_MID (1 << (MID_CONTROL - 1)) | 266 | #define UAC_LOUDNESS_CONTROL 0x0a |
277 | #define FU_TREBLE (1 << (TREBLE_CONTROL - 1)) | 267 | |
278 | #define FU_GRAPHIC_EQ (1 << (GRAPHIC_EQUALIZER_CONTROL - 1)) | 268 | #define UAC_FU_MUTE (1 << (UAC_MUTE_CONTROL - 1)) |
279 | #define FU_AUTO_GAIN (1 << (AUTOMATIC_GAIN_CONTROL - 1)) | 269 | #define UAC_FU_VOLUME (1 << (UAC_VOLUME_CONTROL - 1)) |
280 | #define FU_DELAY (1 << (DELAY_CONTROL - 1)) | 270 | #define UAC_FU_BASS (1 << (UAC_BASS_CONTROL - 1)) |
281 | #define FU_BASS_BOOST (1 << (BASS_BOOST_CONTROL - 1)) | 271 | #define UAC_FU_MID (1 << (UAC_MID_CONTROL - 1)) |
282 | #define FU_LOUDNESS (1 << (LOUDNESS_CONTROL - 1)) | 272 | #define UAC_FU_TREBLE (1 << (UAC_TREBLE_CONTROL - 1)) |
273 | #define UAC_FU_GRAPHIC_EQ (1 << (UAC_GRAPHIC_EQUALIZER_CONTROL - 1)) | ||
274 | #define UAC_FU_AUTO_GAIN (1 << (UAC_AUTOMATIC_GAIN_CONTROL - 1)) | ||
275 | #define UAC_FU_DELAY (1 << (UAC_DELAY_CONTROL - 1)) | ||
276 | #define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1)) | ||
277 | #define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1)) | ||
278 | |||
279 | #ifdef __KERNEL__ | ||
283 | 280 | ||
284 | struct usb_audio_control { | 281 | struct usb_audio_control { |
285 | struct list_head list; | 282 | struct list_head list; |
@@ -290,18 +287,6 @@ struct usb_audio_control { | |||
290 | int (*get)(struct usb_audio_control *con, u8 cmd); | 287 | int (*get)(struct usb_audio_control *con, u8 cmd); |
291 | }; | 288 | }; |
292 | 289 | ||
293 | static inline int generic_set_cmd(struct usb_audio_control *con, u8 cmd, int value) | ||
294 | { | ||
295 | con->data[cmd] = value; | ||
296 | |||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | static inline int generic_get_cmd(struct usb_audio_control *con, u8 cmd) | ||
301 | { | ||
302 | return con->data[cmd]; | ||
303 | } | ||
304 | |||
305 | struct usb_audio_control_selector { | 290 | struct usb_audio_control_selector { |
306 | struct list_head list; | 291 | struct list_head list; |
307 | struct list_head control; | 292 | struct list_head control; |
@@ -311,4 +296,6 @@ struct usb_audio_control_selector { | |||
311 | struct usb_descriptor_header *desc; | 296 | struct usb_descriptor_header *desc; |
312 | }; | 297 | }; |
313 | 298 | ||
299 | #endif /* __KERNEL__ */ | ||
300 | |||
314 | #endif /* __LINUX_USB_AUDIO_H */ | 301 | #endif /* __LINUX_USB_AUDIO_H */ |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 93223638f702..94012e649d86 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -258,6 +258,8 @@ struct usb_device_descriptor { | |||
258 | #define USB_CLASS_APP_SPEC 0xfe | 258 | #define USB_CLASS_APP_SPEC 0xfe |
259 | #define USB_CLASS_VENDOR_SPEC 0xff | 259 | #define USB_CLASS_VENDOR_SPEC 0xff |
260 | 260 | ||
261 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | ||
262 | |||
261 | /*-------------------------------------------------------------------------*/ | 263 | /*-------------------------------------------------------------------------*/ |
262 | 264 | ||
263 | /* USB_DT_CONFIG: Configuration descriptor information. | 265 | /* USB_DT_CONFIG: Configuration descriptor information. |
@@ -348,6 +350,12 @@ struct usb_endpoint_descriptor { | |||
348 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ | 350 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ |
349 | #define USB_ENDPOINT_DIR_MASK 0x80 | 351 | #define USB_ENDPOINT_DIR_MASK 0x80 |
350 | 352 | ||
353 | #define USB_ENDPOINT_SYNCTYPE 0x0c | ||
354 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | ||
355 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | ||
356 | #define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2) | ||
357 | #define USB_ENDPOINT_SYNC_SYNC (3 << 2) | ||
358 | |||
351 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ | 359 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ |
352 | #define USB_ENDPOINT_XFER_CONTROL 0 | 360 | #define USB_ENDPOINT_XFER_CONTROL 0 |
353 | #define USB_ENDPOINT_XFER_ISOC 1 | 361 | #define USB_ENDPOINT_XFER_ISOC 1 |
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index 5b88e36c9103..af4b86f3aca3 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
@@ -105,6 +105,7 @@ struct ehci_regs { | |||
105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ | 105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ |
106 | #define PORT_WKCONN_E (1<<20) /* wake on connect (enable) */ | 106 | #define PORT_WKCONN_E (1<<20) /* wake on connect (enable) */ |
107 | /* 19:16 for port testing */ | 107 | /* 19:16 for port testing */ |
108 | #define PORT_TEST_PKT (0x4<<16) /* Port Test Control - packet test */ | ||
108 | #define PORT_LED_OFF (0<<14) | 109 | #define PORT_LED_OFF (0<<14) |
109 | #define PORT_LED_AMBER (1<<14) | 110 | #define PORT_LED_AMBER (1<<14) |
110 | #define PORT_LED_GREEN (2<<14) | 111 | #define PORT_LED_GREEN (2<<14) |
@@ -132,6 +133,19 @@ struct ehci_regs { | |||
132 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ | 133 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ |
133 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ | 134 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ |
134 | 135 | ||
136 | /* Moorestown has some non-standard registers, partially due to the fact that | ||
137 | * its EHCI controller has both TT and LPM support. HOSTPCx are extentions to | ||
138 | * PORTSCx | ||
139 | */ | ||
140 | #define HOSTPC0 0x84 /* HOSTPC extension */ | ||
141 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ | ||
142 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ | ||
143 | #define USBMODE_EX 0xc8 /* USB Device mode extension */ | ||
144 | #define USBMODE_EX_VBPS (1<<5) /* VBus Power Select On */ | ||
145 | #define USBMODE_EX_HC (3<<0) /* host controller mode */ | ||
146 | #define TXFILLTUNING 0x24 /* TX FIFO Tuning register */ | ||
147 | #define TXFIFO_DEFAULT (8<<16) /* FIFO burst threshold 8 */ | ||
148 | |||
135 | /* Appendix C, Debug port ... intended for use with special "debug devices" | 149 | /* Appendix C, Debug port ... intended for use with special "debug devices" |
136 | * that can help if there's no serial console. (nonstandard enumeration.) | 150 | * that can help if there's no serial console. (nonstandard enumeration.) |
137 | */ | 151 | */ |
@@ -157,4 +171,25 @@ struct ehci_dbg_port { | |||
157 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) | 171 | #define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep)) |
158 | } __attribute__ ((packed)); | 172 | } __attribute__ ((packed)); |
159 | 173 | ||
174 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
175 | #include <linux/init.h> | ||
176 | extern int __init early_dbgp_init(char *s); | ||
177 | extern struct console early_dbgp_console; | ||
178 | #endif /* CONFIG_EARLY_PRINTK_DBGP */ | ||
179 | |||
180 | #ifdef CONFIG_EARLY_PRINTK_DBGP | ||
181 | /* Call backs from ehci host driver to ehci debug driver */ | ||
182 | extern int dbgp_external_startup(void); | ||
183 | extern int dbgp_reset_prep(void); | ||
184 | #else | ||
185 | static inline int dbgp_reset_prep(void) | ||
186 | { | ||
187 | return 1; | ||
188 | } | ||
189 | static inline int dbgp_external_startup(void) | ||
190 | { | ||
191 | return -1; | ||
192 | } | ||
193 | #endif | ||
194 | |||
160 | #endif /* __LINUX_USB_EHCI_DEF_H */ | 195 | #endif /* __LINUX_USB_EHCI_DEF_H */ |
diff --git a/include/linux/usb/isp1362.h b/include/linux/usb/isp1362.h new file mode 100644 index 000000000000..642684bb9292 --- /dev/null +++ b/include/linux/usb/isp1362.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * board initialization code should put one of these into dev->platform_data | ||
3 | * and place the isp1362 onto platform_bus. | ||
4 | */ | ||
5 | |||
6 | #ifndef __LINUX_USB_ISP1362_H__ | ||
7 | #define __LINUX_USB_ISP1362_H__ | ||
8 | |||
9 | struct isp1362_platform_data { | ||
10 | /* Enable internal pulldown resistors on downstream ports */ | ||
11 | unsigned sel15Kres:1; | ||
12 | /* Clock cannot be stopped */ | ||
13 | unsigned clknotstop:1; | ||
14 | /* On-chip overcurrent protection */ | ||
15 | unsigned oc_enable:1; | ||
16 | /* INT output polarity */ | ||
17 | unsigned int_act_high:1; | ||
18 | /* INT edge or level triggered */ | ||
19 | unsigned int_edge_triggered:1; | ||
20 | /* DREQ output polarity */ | ||
21 | unsigned dreq_act_high:1; | ||
22 | /* DACK input polarity */ | ||
23 | unsigned dack_act_high:1; | ||
24 | /* chip can be resumed via H_WAKEUP pin */ | ||
25 | unsigned remote_wakeup_connected:1; | ||
26 | /* Switch or not to switch (keep always powered) */ | ||
27 | unsigned no_power_switching:1; | ||
28 | /* Ganged port power switching (0) or individual port power switching (1) */ | ||
29 | unsigned power_switching_mode:1; | ||
30 | /* Given port_power, msec/2 after power on till power good */ | ||
31 | u8 potpg; | ||
32 | /* Hardware reset set/clear */ | ||
33 | void (*reset) (struct device *dev, int set); | ||
34 | /* Clock start/stop */ | ||
35 | void (*clock) (struct device *dev, int start); | ||
36 | /* Inter-io delay (ns). The chip is picky about access timings; it | ||
37 | * expects at least: | ||
38 | * 110ns delay between consecutive accesses to DATA_REG, | ||
39 | * 300ns delay between access to ADDR_REG and DATA_REG (registers) | ||
40 | * 462ns delay between access to ADDR_REG and DATA_REG (buffer memory) | ||
41 | * WE MUST NOT be activated during these intervals (even without CS!) | ||
42 | */ | ||
43 | void (*delay) (struct device *dev, unsigned int delay); | ||
44 | }; | ||
45 | |||
46 | #endif | ||
diff --git a/include/linux/usb/isp1760.h b/include/linux/usb/isp1760.h new file mode 100644 index 000000000000..de7de53c5531 --- /dev/null +++ b/include/linux/usb/isp1760.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * board initialization should put one of these into dev->platform_data | ||
3 | * and place the isp1760 onto platform_bus named "isp1760-hcd". | ||
4 | */ | ||
5 | |||
6 | #ifndef __LINUX_USB_ISP1760_H | ||
7 | #define __LINUX_USB_ISP1760_H | ||
8 | |||
9 | struct isp1760_platform_data { | ||
10 | unsigned is_isp1761:1; /* Chip is ISP1761 */ | ||
11 | unsigned bus_width_16:1; /* 16/32-bit data bus width */ | ||
12 | unsigned port1_otg:1; /* Port 1 supports OTG */ | ||
13 | unsigned analog_oc:1; /* Analog overcurrent */ | ||
14 | unsigned dack_polarity_high:1; /* DACK active high */ | ||
15 | unsigned dreq_polarity_high:1; /* DREQ active high */ | ||
16 | }; | ||
17 | |||
18 | #endif /* __LINUX_USB_ISP1760_H */ | ||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 7b85e327af91..c17eb64d7213 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -59,6 +59,7 @@ enum port_dev_state { | |||
59 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. | 59 | * @bulk_out_buffer: pointer to the bulk out buffer for this port. |
60 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. | 60 | * @bulk_out_size: the size of the bulk_out_buffer, in bytes. |
61 | * @write_urb: pointer to the bulk out struct urb for this port. | 61 | * @write_urb: pointer to the bulk out struct urb for this port. |
62 | * @write_fifo: kfifo used to buffer outgoing data | ||
62 | * @write_urb_busy: port`s writing status | 63 | * @write_urb_busy: port`s writing status |
63 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this | 64 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this |
64 | * port. | 65 | * port. |
@@ -96,6 +97,7 @@ struct usb_serial_port { | |||
96 | unsigned char *bulk_out_buffer; | 97 | unsigned char *bulk_out_buffer; |
97 | int bulk_out_size; | 98 | int bulk_out_size; |
98 | struct urb *write_urb; | 99 | struct urb *write_urb; |
100 | struct kfifo *write_fifo; | ||
99 | int write_urb_busy; | 101 | int write_urb_busy; |
100 | __u8 bulk_out_endpointAddress; | 102 | __u8 bulk_out_endpointAddress; |
101 | 103 | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index bb69e256cd16..f81473052059 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -89,6 +89,7 @@ struct driver_info { | |||
89 | #define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */ | 89 | #define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */ |
90 | #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ | 90 | #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ |
91 | #define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */ | 91 | #define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */ |
92 | #define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */ | ||
92 | 93 | ||
93 | 94 | ||
94 | /* init device ... can sleep, or cause probe() failure */ | 95 | /* init device ... can sleep, or cause probe() failure */ |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 0044d9b4cb85..b2a7d8ba6ee3 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
@@ -77,6 +77,7 @@ struct usbdevfs_connectinfo { | |||
77 | 77 | ||
78 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 | 78 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 |
79 | #define USBDEVFS_URB_ISO_ASAP 0x02 | 79 | #define USBDEVFS_URB_ISO_ASAP 0x02 |
80 | #define USBDEVFS_URB_BULK_CONTINUATION 0x04 | ||
80 | #define USBDEVFS_URB_NO_FSBR 0x20 | 81 | #define USBDEVFS_URB_NO_FSBR 0x20 |
81 | #define USBDEVFS_URB_ZERO_PACKET 0x40 | 82 | #define USBDEVFS_URB_ZERO_PACKET 0x40 |
82 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 | 83 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 |
@@ -175,4 +176,6 @@ struct usbdevfs_ioctl32 { | |||
175 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) | 176 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) |
176 | #define USBDEVFS_DISCONNECT _IO('U', 22) | 177 | #define USBDEVFS_DISCONNECT _IO('U', 22) |
177 | #define USBDEVFS_CONNECT _IO('U', 23) | 178 | #define USBDEVFS_CONNECT _IO('U', 23) |
179 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) | ||
180 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) | ||
178 | #endif /* _LINUX_USBDEVICE_FS_H */ | 181 | #endif /* _LINUX_USBDEVICE_FS_H */ |
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 3656b300de3a..69f39974c041 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -36,7 +36,6 @@ struct new_utsname { | |||
36 | #include <linux/kref.h> | 36 | #include <linux/kref.h> |
37 | #include <linux/nsproxy.h> | 37 | #include <linux/nsproxy.h> |
38 | #include <linux/err.h> | 38 | #include <linux/err.h> |
39 | #include <asm/atomic.h> | ||
40 | 39 | ||
41 | struct uts_namespace { | 40 | struct uts_namespace { |
42 | struct kref kref; | 41 | struct kref kref; |
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index e81c64af80c1..2dfaa293ae8c 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * vgaarb.c | 2 | * The VGA aribiter manages VGA space routing and VGA resource decode to |
3 | * allow multiple VGA devices to be used in a system in a safe way. | ||
3 | * | 4 | * |
4 | * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> | 5 | * (C) Copyright 2005 Benjamin Herrenschmidt <benh@kernel.crashing.org> |
5 | * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> | 6 | * (C) Copyright 2007 Paulo R. Zanoni <przanoni@gmail.com> |
@@ -41,7 +42,7 @@ | |||
41 | * interrupts at any time. | 42 | * interrupts at any time. |
42 | */ | 43 | */ |
43 | extern void vga_set_legacy_decoding(struct pci_dev *pdev, | 44 | extern void vga_set_legacy_decoding(struct pci_dev *pdev, |
44 | unsigned int decodes); | 45 | unsigned int decodes); |
45 | 46 | ||
46 | /** | 47 | /** |
47 | * vga_get - acquire & locks VGA resources | 48 | * vga_get - acquire & locks VGA resources |
@@ -193,8 +194,17 @@ static inline int vga_conflicts(struct pci_dev *p1, struct pci_dev *p2) | |||
193 | * They driver will get a callback when VGA arbitration is first used | 194 | * They driver will get a callback when VGA arbitration is first used |
194 | * by userspace since we some older X servers have issues. | 195 | * by userspace since we some older X servers have issues. |
195 | */ | 196 | */ |
197 | #if defined(CONFIG_VGA_ARB) | ||
196 | int vga_client_register(struct pci_dev *pdev, void *cookie, | 198 | int vga_client_register(struct pci_dev *pdev, void *cookie, |
197 | void (*irq_set_state)(void *cookie, bool state), | 199 | void (*irq_set_state)(void *cookie, bool state), |
198 | unsigned int (*set_vga_decode)(void *cookie, bool state)); | 200 | unsigned int (*set_vga_decode)(void *cookie, bool state)); |
201 | #else | ||
202 | static inline int vga_client_register(struct pci_dev *pdev, void *cookie, | ||
203 | void (*irq_set_state)(void *cookie, bool state), | ||
204 | unsigned int (*set_vga_decode)(void *cookie, bool state)) | ||
205 | { | ||
206 | return 0; | ||
207 | } | ||
208 | #endif | ||
199 | 209 | ||
200 | #endif /* LINUX_VGA_H */ | 210 | #endif /* LINUX_VGA_H */ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 4fca4f5440ba..057a2e010758 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -34,7 +34,7 @@ struct virtqueue { | |||
34 | * out_num: the number of sg readable by other side | 34 | * out_num: the number of sg readable by other side |
35 | * in_num: the number of sg which are writable (after readable ones) | 35 | * in_num: the number of sg which are writable (after readable ones) |
36 | * data: the token identifying the buffer. | 36 | * data: the token identifying the buffer. |
37 | * Returns 0 or an error. | 37 | * Returns remaining capacity of queue (sg segments) or a negative error. |
38 | * @kick: update after add_buf | 38 | * @kick: update after add_buf |
39 | * vq: the struct virtqueue | 39 | * vq: the struct virtqueue |
40 | * After one or more add_buf calls, invoke this to kick the other side. | 40 | * After one or more add_buf calls, invoke this to kick the other side. |
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h index b3c4a60ceeb3..ea7226a45acb 100644 --- a/include/linux/virtio_9p.h +++ b/include/linux/virtio_9p.h | |||
@@ -4,8 +4,6 @@ | |||
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
5 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
6 | 6 | ||
7 | /* The ID for virtio console */ | ||
8 | #define VIRTIO_ID_9P 9 | ||
9 | /* Maximum number of virtio channels per partition (1 for now) */ | 7 | /* Maximum number of virtio channels per partition (1 for now) */ |
10 | #define MAX_9P_CHAN 1 | 8 | #define MAX_9P_CHAN 1 |
11 | 9 | ||
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h index 8726ff77763e..09d730085060 100644 --- a/include/linux/virtio_balloon.h +++ b/include/linux/virtio_balloon.h | |||
@@ -4,9 +4,6 @@ | |||
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
5 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
6 | 6 | ||
7 | /* The ID for virtio_balloon */ | ||
8 | #define VIRTIO_ID_BALLOON 5 | ||
9 | |||
10 | /* The feature bitmap for virtio balloon */ | 7 | /* The feature bitmap for virtio balloon */ |
11 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ | 8 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ |
12 | 9 | ||
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index 8dab9f2b8832..15cb666581d7 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
@@ -5,9 +5,6 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
7 | 7 | ||
8 | /* The ID for virtio_block */ | ||
9 | #define VIRTIO_ID_BLOCK 2 | ||
10 | |||
11 | /* Feature bits */ | 8 | /* Feature bits */ |
12 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ | 9 | #define VIRTIO_BLK_F_BARRIER 0 /* Does host support barriers? */ |
13 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ | 10 | #define VIRTIO_BLK_F_SIZE_MAX 1 /* Indicates maximum segment size */ |
@@ -17,6 +14,7 @@ | |||
17 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | 14 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ |
18 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | 15 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ |
19 | #define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */ | 16 | #define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */ |
17 | #define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ | ||
20 | 18 | ||
21 | #define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ | 19 | #define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ |
22 | 20 | ||
@@ -38,6 +36,17 @@ struct virtio_blk_config { | |||
38 | __u8 identify[VIRTIO_BLK_ID_BYTES]; | 36 | __u8 identify[VIRTIO_BLK_ID_BYTES]; |
39 | } __attribute__((packed)); | 37 | } __attribute__((packed)); |
40 | 38 | ||
39 | /* | ||
40 | * Command types | ||
41 | * | ||
42 | * Usage is a bit tricky as some bits are used as flags and some are not. | ||
43 | * | ||
44 | * Rules: | ||
45 | * VIRTIO_BLK_T_OUT may be combined with VIRTIO_BLK_T_SCSI_CMD or | ||
46 | * VIRTIO_BLK_T_BARRIER. VIRTIO_BLK_T_FLUSH is a command of its own | ||
47 | * and may not be combined with any of the other flags. | ||
48 | */ | ||
49 | |||
41 | /* These two define direction. */ | 50 | /* These two define direction. */ |
42 | #define VIRTIO_BLK_T_IN 0 | 51 | #define VIRTIO_BLK_T_IN 0 |
43 | #define VIRTIO_BLK_T_OUT 1 | 52 | #define VIRTIO_BLK_T_OUT 1 |
@@ -45,6 +54,9 @@ struct virtio_blk_config { | |||
45 | /* This bit says it's a scsi command, not an actual read or write. */ | 54 | /* This bit says it's a scsi command, not an actual read or write. */ |
46 | #define VIRTIO_BLK_T_SCSI_CMD 2 | 55 | #define VIRTIO_BLK_T_SCSI_CMD 2 |
47 | 56 | ||
57 | /* Cache flush command */ | ||
58 | #define VIRTIO_BLK_T_FLUSH 4 | ||
59 | |||
48 | /* Barrier before this op. */ | 60 | /* Barrier before this op. */ |
49 | #define VIRTIO_BLK_T_BARRIER 0x80000000 | 61 | #define VIRTIO_BLK_T_BARRIER 0x80000000 |
50 | 62 | ||
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index e547e3c8ee9a..0093dd7c1d6f 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -109,8 +109,7 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, | |||
109 | unsigned int fbit) | 109 | unsigned int fbit) |
110 | { | 110 | { |
111 | /* Did you forget to fix assumptions on max features? */ | 111 | /* Did you forget to fix assumptions on max features? */ |
112 | if (__builtin_constant_p(fbit)) | 112 | MAYBE_BUILD_BUG_ON(fbit >= 32); |
113 | BUILD_BUG_ON(fbit >= 32); | ||
114 | 113 | ||
115 | if (fbit < VIRTIO_TRANSPORT_F_START) | 114 | if (fbit < VIRTIO_TRANSPORT_F_START) |
116 | virtio_check_driver_offered_feature(vdev, fbit); | 115 | virtio_check_driver_offered_feature(vdev, fbit); |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index dc161115ae35..b5f519806014 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
@@ -5,9 +5,6 @@ | |||
5 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | 5 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so |
6 | * anyone can use the definitions to implement compatible drivers/servers. */ | 6 | * anyone can use the definitions to implement compatible drivers/servers. */ |
7 | 7 | ||
8 | /* The ID for virtio console */ | ||
9 | #define VIRTIO_ID_CONSOLE 3 | ||
10 | |||
11 | /* Feature bits */ | 8 | /* Feature bits */ |
12 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ | 9 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ |
13 | 10 | ||
diff --git a/include/linux/virtio_ids.h b/include/linux/virtio_ids.h new file mode 100644 index 000000000000..06660c0a78d7 --- /dev/null +++ b/include/linux/virtio_ids.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _LINUX_VIRTIO_IDS_H | ||
2 | #define _LINUX_VIRTIO_IDS_H | ||
3 | /* | ||
4 | * Virtio IDs | ||
5 | * | ||
6 | * This header is BSD licensed so anyone can use the definitions to implement | ||
7 | * compatible drivers/servers. | ||
8 | */ | ||
9 | |||
10 | #define VIRTIO_ID_NET 1 /* virtio net */ | ||
11 | #define VIRTIO_ID_BLOCK 2 /* virtio block */ | ||
12 | #define VIRTIO_ID_CONSOLE 3 /* virtio console */ | ||
13 | #define VIRTIO_ID_RNG 4 /* virtio ring */ | ||
14 | #define VIRTIO_ID_BALLOON 5 /* virtio balloon */ | ||
15 | #define VIRTIO_ID_9P 9 /* 9p virtio console */ | ||
16 | |||
17 | #endif /* _LINUX_VIRTIO_IDS_H */ | ||
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index d8dd539c9f48..1f41734bbb77 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
@@ -6,9 +6,6 @@ | |||
6 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
7 | #include <linux/if_ether.h> | 7 | #include <linux/if_ether.h> |
8 | 8 | ||
9 | /* The ID for virtio_net */ | ||
10 | #define VIRTIO_ID_NET 1 | ||
11 | |||
12 | /* The feature bitmap for virtio net */ | 9 | /* The feature bitmap for virtio net */ |
13 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ | 10 | #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ |
14 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ | 11 | #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ |
diff --git a/include/linux/virtio_rng.h b/include/linux/virtio_rng.h index 1a85dab8a940..48121c3c434b 100644 --- a/include/linux/virtio_rng.h +++ b/include/linux/virtio_rng.h | |||
@@ -4,7 +4,4 @@ | |||
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
5 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
6 | 6 | ||
7 | /* The ID for virtio_rng */ | ||
8 | #define VIRTIO_ID_RNG 4 | ||
9 | |||
10 | #endif /* _LINUX_VIRTIO_RNG_H */ | 7 | #endif /* _LINUX_VIRTIO_RNG_H */ |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 81a97cf8f0a0..2d0f222388a8 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -166,15 +166,8 @@ static inline unsigned long zone_page_state(struct zone *zone, | |||
166 | return x; | 166 | return x; |
167 | } | 167 | } |
168 | 168 | ||
169 | extern unsigned long global_lru_pages(void); | 169 | extern unsigned long global_reclaimable_pages(void); |
170 | 170 | extern unsigned long zone_reclaimable_pages(struct zone *zone); | |
171 | static inline unsigned long zone_lru_pages(struct zone *zone) | ||
172 | { | ||
173 | return (zone_page_state(zone, NR_ACTIVE_ANON) | ||
174 | + zone_page_state(zone, NR_ACTIVE_FILE) | ||
175 | + zone_page_state(zone, NR_INACTIVE_ANON) | ||
176 | + zone_page_state(zone, NR_INACTIVE_FILE)); | ||
177 | } | ||
178 | 171 | ||
179 | #ifdef CONFIG_NUMA | 172 | #ifdef CONFIG_NUMA |
180 | /* | 173 | /* |
@@ -210,11 +203,6 @@ extern void zone_statistics(struct zone *, struct zone *); | |||
210 | 203 | ||
211 | #endif /* CONFIG_NUMA */ | 204 | #endif /* CONFIG_NUMA */ |
212 | 205 | ||
213 | #define __add_zone_page_state(__z, __i, __d) \ | ||
214 | __mod_zone_page_state(__z, __i, __d) | ||
215 | #define __sub_zone_page_state(__z, __i, __d) \ | ||
216 | __mod_zone_page_state(__z, __i,-(__d)) | ||
217 | |||
218 | #define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d) | 206 | #define add_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, __d) |
219 | #define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d)) | 207 | #define sub_zone_page_state(__z, __i, __d) mod_zone_page_state(__z, __i, -(__d)) |
220 | 208 | ||
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h index 0c9878123d5f..38e8c4d9289e 100644 --- a/include/linux/wm97xx.h +++ b/include/linux/wm97xx.h | |||
@@ -293,6 +293,24 @@ struct wm97xx { | |||
293 | u16 suspend_mode; /* PRP in suspend mode */ | 293 | u16 suspend_mode; /* PRP in suspend mode */ |
294 | }; | 294 | }; |
295 | 295 | ||
296 | struct wm97xx_batt_pdata { | ||
297 | int batt_aux; | ||
298 | int temp_aux; | ||
299 | int charge_gpio; | ||
300 | int min_voltage; | ||
301 | int max_voltage; | ||
302 | int batt_div; | ||
303 | int batt_mult; | ||
304 | int temp_div; | ||
305 | int temp_mult; | ||
306 | int batt_tech; | ||
307 | char *batt_name; | ||
308 | }; | ||
309 | |||
310 | struct wm97xx_pdata { | ||
311 | struct wm97xx_batt_pdata *batt_pdata; /* battery data */ | ||
312 | }; | ||
313 | |||
296 | /* | 314 | /* |
297 | * Codec GPIO access (not supported on WM9705) | 315 | * Codec GPIO access (not supported on WM9705) |
298 | * This can be used to set/get codec GPIO and Virtual GPIO status. | 316 | * This can be used to set/get codec GPIO and Virtual GPIO status. |
diff --git a/include/linux/wm97xx_batt.h b/include/linux/wm97xx_batt.h index 9681d1ab0e4f..a1d6419c2ff8 100644 --- a/include/linux/wm97xx_batt.h +++ b/include/linux/wm97xx_batt.h | |||
@@ -3,22 +3,12 @@ | |||
3 | 3 | ||
4 | #include <linux/wm97xx.h> | 4 | #include <linux/wm97xx.h> |
5 | 5 | ||
6 | struct wm97xx_batt_info { | 6 | #warning This file will be removed soon, use wm97xx.h instead! |
7 | int batt_aux; | 7 | |
8 | int temp_aux; | 8 | #define wm97xx_batt_info wm97xx_batt_pdata |
9 | int charge_gpio; | ||
10 | int min_voltage; | ||
11 | int max_voltage; | ||
12 | int batt_div; | ||
13 | int batt_mult; | ||
14 | int temp_div; | ||
15 | int temp_mult; | ||
16 | int batt_tech; | ||
17 | char *batt_name; | ||
18 | }; | ||
19 | 9 | ||
20 | #ifdef CONFIG_BATTERY_WM97XX | 10 | #ifdef CONFIG_BATTERY_WM97XX |
21 | void __init wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); | 11 | void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); |
22 | #else | 12 | #else |
23 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} | 13 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} |
24 | #endif | 14 | #endif |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 6273fa97b527..7ef0c7b94f31 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -94,7 +94,7 @@ struct execute_work { | |||
94 | /* | 94 | /* |
95 | * initialize all of a work item in one go | 95 | * initialize all of a work item in one go |
96 | * | 96 | * |
97 | * NOTE! No point in using "atomic_long_set()": useing a direct | 97 | * NOTE! No point in using "atomic_long_set()": using a direct |
98 | * assignment of the work data initializer allows the compiler | 98 | * assignment of the work data initializer allows the compiler |
99 | * to generate better code. | 99 | * to generate better code. |
100 | */ | 100 | */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 75cf58666ff9..66ebddcff664 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -110,21 +110,20 @@ extern int laptop_mode; | |||
110 | extern unsigned long determine_dirtyable_memory(void); | 110 | extern unsigned long determine_dirtyable_memory(void); |
111 | 111 | ||
112 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, | 112 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, |
113 | struct file *filp, void __user *buffer, size_t *lenp, | 113 | void __user *buffer, size_t *lenp, |
114 | loff_t *ppos); | 114 | loff_t *ppos); |
115 | extern int dirty_background_bytes_handler(struct ctl_table *table, int write, | 115 | extern int dirty_background_bytes_handler(struct ctl_table *table, int write, |
116 | struct file *filp, void __user *buffer, size_t *lenp, | 116 | void __user *buffer, size_t *lenp, |
117 | loff_t *ppos); | 117 | loff_t *ppos); |
118 | extern int dirty_ratio_handler(struct ctl_table *table, int write, | 118 | extern int dirty_ratio_handler(struct ctl_table *table, int write, |
119 | struct file *filp, void __user *buffer, size_t *lenp, | 119 | void __user *buffer, size_t *lenp, |
120 | loff_t *ppos); | 120 | loff_t *ppos); |
121 | extern int dirty_bytes_handler(struct ctl_table *table, int write, | 121 | extern int dirty_bytes_handler(struct ctl_table *table, int write, |
122 | struct file *filp, void __user *buffer, size_t *lenp, | 122 | void __user *buffer, size_t *lenp, |
123 | loff_t *ppos); | 123 | loff_t *ppos); |
124 | 124 | ||
125 | struct ctl_table; | 125 | struct ctl_table; |
126 | struct file; | 126 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, |
127 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, | ||
128 | void __user *, size_t *, loff_t *); | 127 | void __user *, size_t *, loff_t *); |
129 | 128 | ||
130 | void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty, | 129 | void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty, |
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index b77c1478c99f..a7fb54808a23 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
@@ -38,6 +38,8 @@ | |||
38 | * @P9_DEBUG_SLABS: memory management tracing | 38 | * @P9_DEBUG_SLABS: memory management tracing |
39 | * @P9_DEBUG_FCALL: verbose dump of protocol messages | 39 | * @P9_DEBUG_FCALL: verbose dump of protocol messages |
40 | * @P9_DEBUG_FID: fid allocation/deallocation tracking | 40 | * @P9_DEBUG_FID: fid allocation/deallocation tracking |
41 | * @P9_DEBUG_PKT: packet marshalling/unmarshalling | ||
42 | * @P9_DEBUG_FSC: FS-cache tracing | ||
41 | * | 43 | * |
42 | * These flags are passed at mount time to turn on various levels of | 44 | * These flags are passed at mount time to turn on various levels of |
43 | * verbosity and tracing which will be output to the system logs. | 45 | * verbosity and tracing which will be output to the system logs. |
@@ -54,6 +56,7 @@ enum p9_debug_flags { | |||
54 | P9_DEBUG_FCALL = (1<<8), | 56 | P9_DEBUG_FCALL = (1<<8), |
55 | P9_DEBUG_FID = (1<<9), | 57 | P9_DEBUG_FID = (1<<9), |
56 | P9_DEBUG_PKT = (1<<10), | 58 | P9_DEBUG_PKT = (1<<10), |
59 | P9_DEBUG_FSC = (1<<11), | ||
57 | }; | 60 | }; |
58 | 61 | ||
59 | #ifdef CONFIG_NET_9P_DEBUG | 62 | #ifdef CONFIG_NET_9P_DEBUG |
diff --git a/include/net/ip.h b/include/net/ip.h index 72c36926c26d..5b26a0bd178e 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -399,7 +399,7 @@ extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, | |||
399 | * fed into the routing cache should use these handlers. | 399 | * fed into the routing cache should use these handlers. |
400 | */ | 400 | */ |
401 | int ipv4_doint_and_flush(ctl_table *ctl, int write, | 401 | int ipv4_doint_and_flush(ctl_table *ctl, int write, |
402 | struct file* filp, void __user *buffer, | 402 | void __user *buffer, |
403 | size_t *lenp, loff_t *ppos); | 403 | size_t *lenp, loff_t *ppos); |
404 | int ipv4_doint_and_flush_strategy(ctl_table *table, | 404 | int ipv4_doint_and_flush_strategy(ctl_table *table, |
405 | void __user *oldval, size_t __user *oldlenp, | 405 | void __user *oldval, size_t __user *oldlenp, |
diff --git a/include/net/ipip.h b/include/net/ipip.h index 5d3036fa1511..76e3ea6e2fe5 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -12,7 +12,6 @@ struct ip_tunnel | |||
12 | struct ip_tunnel *next; | 12 | struct ip_tunnel *next; |
13 | struct net_device *dev; | 13 | struct net_device *dev; |
14 | 14 | ||
15 | int recursion; /* Depth of hard_start_xmit recursion */ | ||
16 | int err_count; /* Number of arrived ICMP errors */ | 15 | int err_count; /* Number of arrived ICMP errors */ |
17 | unsigned long err_time; /* Time when the last ICMP error arrived */ | 16 | unsigned long err_time; /* Time when the last ICMP error arrived */ |
18 | 17 | ||
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index 1459ed3e2697..f76f22d05721 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -55,7 +55,6 @@ enum { | |||
55 | #include <net/neighbour.h> | 55 | #include <net/neighbour.h> |
56 | 56 | ||
57 | struct ctl_table; | 57 | struct ctl_table; |
58 | struct file; | ||
59 | struct inet6_dev; | 58 | struct inet6_dev; |
60 | struct net_device; | 59 | struct net_device; |
61 | struct net_proto_family; | 60 | struct net_proto_family; |
@@ -139,7 +138,6 @@ extern int igmp6_event_report(struct sk_buff *skb); | |||
139 | #ifdef CONFIG_SYSCTL | 138 | #ifdef CONFIG_SYSCTL |
140 | extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, | 139 | extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, |
141 | int write, | 140 | int write, |
142 | struct file * filp, | ||
143 | void __user *buffer, | 141 | void __user *buffer, |
144 | size_t *lenp, | 142 | size_t *lenp, |
145 | loff_t *ppos); | 143 | loff_t *ppos); |
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index 938858304300..c8f94e8db69c 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h | |||
@@ -482,7 +482,7 @@ int ib_send_cm_rej(struct ib_cm_id *cm_id, | |||
482 | * message. | 482 | * message. |
483 | * @cm_id: Connection identifier associated with the connection message. | 483 | * @cm_id: Connection identifier associated with the connection message. |
484 | * @service_timeout: The lower 5-bits specify the maximum time required for | 484 | * @service_timeout: The lower 5-bits specify the maximum time required for |
485 | * the sender to reply to to the connection message. The upper 3-bits | 485 | * the sender to reply to the connection message. The upper 3-bits |
486 | * specify additional control flags. | 486 | * specify additional control flags. |
487 | * @private_data: Optional user-defined private data sent with the | 487 | * @private_data: Optional user-defined private data sent with the |
488 | * message receipt acknowledgement. | 488 | * message receipt acknowledgement. |
diff --git a/include/scsi/fc/fc_fc2.h b/include/scsi/fc/fc_fc2.h index cff8a8c22f50..f87777d0d5bd 100644 --- a/include/scsi/fc/fc_fc2.h +++ b/include/scsi/fc/fc_fc2.h | |||
@@ -92,8 +92,7 @@ struct fc_esb { | |||
92 | __u8 _esb_resvd[4]; | 92 | __u8 _esb_resvd[4]; |
93 | __u8 esb_service_params[112]; /* TBD */ | 93 | __u8 esb_service_params[112]; /* TBD */ |
94 | __u8 esb_seq_status[8]; /* sequence statuses, 8 bytes each */ | 94 | __u8 esb_seq_status[8]; /* sequence statuses, 8 bytes each */ |
95 | } __attribute__((packed));; | 95 | } __attribute__((packed)); |
96 | |||
97 | 96 | ||
98 | /* | 97 | /* |
99 | * Define expected size for ASSERTs. | 98 | * Define expected size for ASSERTs. |
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 1493c541f9c4..eaf46bdd18a5 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
@@ -225,6 +225,169 @@ TRACE_EVENT(kmem_cache_free, | |||
225 | 225 | ||
226 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) | 226 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) |
227 | ); | 227 | ); |
228 | |||
229 | TRACE_EVENT(mm_page_free_direct, | ||
230 | |||
231 | TP_PROTO(struct page *page, unsigned int order), | ||
232 | |||
233 | TP_ARGS(page, order), | ||
234 | |||
235 | TP_STRUCT__entry( | ||
236 | __field( struct page *, page ) | ||
237 | __field( unsigned int, order ) | ||
238 | ), | ||
239 | |||
240 | TP_fast_assign( | ||
241 | __entry->page = page; | ||
242 | __entry->order = order; | ||
243 | ), | ||
244 | |||
245 | TP_printk("page=%p pfn=%lu order=%d", | ||
246 | __entry->page, | ||
247 | page_to_pfn(__entry->page), | ||
248 | __entry->order) | ||
249 | ); | ||
250 | |||
251 | TRACE_EVENT(mm_pagevec_free, | ||
252 | |||
253 | TP_PROTO(struct page *page, int cold), | ||
254 | |||
255 | TP_ARGS(page, cold), | ||
256 | |||
257 | TP_STRUCT__entry( | ||
258 | __field( struct page *, page ) | ||
259 | __field( int, cold ) | ||
260 | ), | ||
261 | |||
262 | TP_fast_assign( | ||
263 | __entry->page = page; | ||
264 | __entry->cold = cold; | ||
265 | ), | ||
266 | |||
267 | TP_printk("page=%p pfn=%lu order=0 cold=%d", | ||
268 | __entry->page, | ||
269 | page_to_pfn(__entry->page), | ||
270 | __entry->cold) | ||
271 | ); | ||
272 | |||
273 | TRACE_EVENT(mm_page_alloc, | ||
274 | |||
275 | TP_PROTO(struct page *page, unsigned int order, | ||
276 | gfp_t gfp_flags, int migratetype), | ||
277 | |||
278 | TP_ARGS(page, order, gfp_flags, migratetype), | ||
279 | |||
280 | TP_STRUCT__entry( | ||
281 | __field( struct page *, page ) | ||
282 | __field( unsigned int, order ) | ||
283 | __field( gfp_t, gfp_flags ) | ||
284 | __field( int, migratetype ) | ||
285 | ), | ||
286 | |||
287 | TP_fast_assign( | ||
288 | __entry->page = page; | ||
289 | __entry->order = order; | ||
290 | __entry->gfp_flags = gfp_flags; | ||
291 | __entry->migratetype = migratetype; | ||
292 | ), | ||
293 | |||
294 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s", | ||
295 | __entry->page, | ||
296 | page_to_pfn(__entry->page), | ||
297 | __entry->order, | ||
298 | __entry->migratetype, | ||
299 | show_gfp_flags(__entry->gfp_flags)) | ||
300 | ); | ||
301 | |||
302 | TRACE_EVENT(mm_page_alloc_zone_locked, | ||
303 | |||
304 | TP_PROTO(struct page *page, unsigned int order, int migratetype), | ||
305 | |||
306 | TP_ARGS(page, order, migratetype), | ||
307 | |||
308 | TP_STRUCT__entry( | ||
309 | __field( struct page *, page ) | ||
310 | __field( unsigned int, order ) | ||
311 | __field( int, migratetype ) | ||
312 | ), | ||
313 | |||
314 | TP_fast_assign( | ||
315 | __entry->page = page; | ||
316 | __entry->order = order; | ||
317 | __entry->migratetype = migratetype; | ||
318 | ), | ||
319 | |||
320 | TP_printk("page=%p pfn=%lu order=%u migratetype=%d percpu_refill=%d", | ||
321 | __entry->page, | ||
322 | page_to_pfn(__entry->page), | ||
323 | __entry->order, | ||
324 | __entry->migratetype, | ||
325 | __entry->order == 0) | ||
326 | ); | ||
327 | |||
328 | TRACE_EVENT(mm_page_pcpu_drain, | ||
329 | |||
330 | TP_PROTO(struct page *page, int order, int migratetype), | ||
331 | |||
332 | TP_ARGS(page, order, migratetype), | ||
333 | |||
334 | TP_STRUCT__entry( | ||
335 | __field( struct page *, page ) | ||
336 | __field( int, order ) | ||
337 | __field( int, migratetype ) | ||
338 | ), | ||
339 | |||
340 | TP_fast_assign( | ||
341 | __entry->page = page; | ||
342 | __entry->order = order; | ||
343 | __entry->migratetype = migratetype; | ||
344 | ), | ||
345 | |||
346 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d", | ||
347 | __entry->page, | ||
348 | page_to_pfn(__entry->page), | ||
349 | __entry->order, | ||
350 | __entry->migratetype) | ||
351 | ); | ||
352 | |||
353 | TRACE_EVENT(mm_page_alloc_extfrag, | ||
354 | |||
355 | TP_PROTO(struct page *page, | ||
356 | int alloc_order, int fallback_order, | ||
357 | int alloc_migratetype, int fallback_migratetype), | ||
358 | |||
359 | TP_ARGS(page, | ||
360 | alloc_order, fallback_order, | ||
361 | alloc_migratetype, fallback_migratetype), | ||
362 | |||
363 | TP_STRUCT__entry( | ||
364 | __field( struct page *, page ) | ||
365 | __field( int, alloc_order ) | ||
366 | __field( int, fallback_order ) | ||
367 | __field( int, alloc_migratetype ) | ||
368 | __field( int, fallback_migratetype ) | ||
369 | ), | ||
370 | |||
371 | TP_fast_assign( | ||
372 | __entry->page = page; | ||
373 | __entry->alloc_order = alloc_order; | ||
374 | __entry->fallback_order = fallback_order; | ||
375 | __entry->alloc_migratetype = alloc_migratetype; | ||
376 | __entry->fallback_migratetype = fallback_migratetype; | ||
377 | ), | ||
378 | |||
379 | TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d", | ||
380 | __entry->page, | ||
381 | page_to_pfn(__entry->page), | ||
382 | __entry->alloc_order, | ||
383 | __entry->fallback_order, | ||
384 | pageblock_order, | ||
385 | __entry->alloc_migratetype, | ||
386 | __entry->fallback_migratetype, | ||
387 | __entry->fallback_order < pageblock_order, | ||
388 | __entry->alloc_migratetype == __entry->fallback_migratetype) | ||
389 | ); | ||
390 | |||
228 | #endif /* _TRACE_KMEM_H */ | 391 | #endif /* _TRACE_KMEM_H */ |
229 | 392 | ||
230 | /* This part must be outside protection */ | 393 | /* This part must be outside protection */ |
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h new file mode 100644 index 000000000000..1844c48d640e --- /dev/null +++ b/include/trace/events/timer.h | |||
@@ -0,0 +1,342 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM timer | ||
3 | |||
4 | #if !defined(_TRACE_TIMER_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_TIMER_H | ||
6 | |||
7 | #include <linux/tracepoint.h> | ||
8 | #include <linux/hrtimer.h> | ||
9 | #include <linux/timer.h> | ||
10 | |||
11 | /** | ||
12 | * timer_init - called when the timer is initialized | ||
13 | * @timer: pointer to struct timer_list | ||
14 | */ | ||
15 | TRACE_EVENT(timer_init, | ||
16 | |||
17 | TP_PROTO(struct timer_list *timer), | ||
18 | |||
19 | TP_ARGS(timer), | ||
20 | |||
21 | TP_STRUCT__entry( | ||
22 | __field( void *, timer ) | ||
23 | ), | ||
24 | |||
25 | TP_fast_assign( | ||
26 | __entry->timer = timer; | ||
27 | ), | ||
28 | |||
29 | TP_printk("timer %p", __entry->timer) | ||
30 | ); | ||
31 | |||
32 | /** | ||
33 | * timer_start - called when the timer is started | ||
34 | * @timer: pointer to struct timer_list | ||
35 | * @expires: the timers expiry time | ||
36 | */ | ||
37 | TRACE_EVENT(timer_start, | ||
38 | |||
39 | TP_PROTO(struct timer_list *timer, unsigned long expires), | ||
40 | |||
41 | TP_ARGS(timer, expires), | ||
42 | |||
43 | TP_STRUCT__entry( | ||
44 | __field( void *, timer ) | ||
45 | __field( void *, function ) | ||
46 | __field( unsigned long, expires ) | ||
47 | __field( unsigned long, now ) | ||
48 | ), | ||
49 | |||
50 | TP_fast_assign( | ||
51 | __entry->timer = timer; | ||
52 | __entry->function = timer->function; | ||
53 | __entry->expires = expires; | ||
54 | __entry->now = jiffies; | ||
55 | ), | ||
56 | |||
57 | TP_printk("timer %p: func %pf, expires %lu, timeout %ld", | ||
58 | __entry->timer, __entry->function, __entry->expires, | ||
59 | (long)__entry->expires - __entry->now) | ||
60 | ); | ||
61 | |||
62 | /** | ||
63 | * timer_expire_entry - called immediately before the timer callback | ||
64 | * @timer: pointer to struct timer_list | ||
65 | * | ||
66 | * Allows to determine the timer latency. | ||
67 | */ | ||
68 | TRACE_EVENT(timer_expire_entry, | ||
69 | |||
70 | TP_PROTO(struct timer_list *timer), | ||
71 | |||
72 | TP_ARGS(timer), | ||
73 | |||
74 | TP_STRUCT__entry( | ||
75 | __field( void *, timer ) | ||
76 | __field( unsigned long, now ) | ||
77 | ), | ||
78 | |||
79 | TP_fast_assign( | ||
80 | __entry->timer = timer; | ||
81 | __entry->now = jiffies; | ||
82 | ), | ||
83 | |||
84 | TP_printk("timer %p: now %lu", __entry->timer, __entry->now) | ||
85 | ); | ||
86 | |||
87 | /** | ||
88 | * timer_expire_exit - called immediately after the timer callback returns | ||
89 | * @timer: pointer to struct timer_list | ||
90 | * | ||
91 | * When used in combination with the timer_expire_entry tracepoint we can | ||
92 | * determine the runtime of the timer callback function. | ||
93 | * | ||
94 | * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might | ||
95 | * be invalid. We solely track the pointer. | ||
96 | */ | ||
97 | TRACE_EVENT(timer_expire_exit, | ||
98 | |||
99 | TP_PROTO(struct timer_list *timer), | ||
100 | |||
101 | TP_ARGS(timer), | ||
102 | |||
103 | TP_STRUCT__entry( | ||
104 | __field(void *, timer ) | ||
105 | ), | ||
106 | |||
107 | TP_fast_assign( | ||
108 | __entry->timer = timer; | ||
109 | ), | ||
110 | |||
111 | TP_printk("timer %p", __entry->timer) | ||
112 | ); | ||
113 | |||
114 | /** | ||
115 | * timer_cancel - called when the timer is canceled | ||
116 | * @timer: pointer to struct timer_list | ||
117 | */ | ||
118 | TRACE_EVENT(timer_cancel, | ||
119 | |||
120 | TP_PROTO(struct timer_list *timer), | ||
121 | |||
122 | TP_ARGS(timer), | ||
123 | |||
124 | TP_STRUCT__entry( | ||
125 | __field( void *, timer ) | ||
126 | ), | ||
127 | |||
128 | TP_fast_assign( | ||
129 | __entry->timer = timer; | ||
130 | ), | ||
131 | |||
132 | TP_printk("timer %p", __entry->timer) | ||
133 | ); | ||
134 | |||
135 | /** | ||
136 | * hrtimer_init - called when the hrtimer is initialized | ||
137 | * @timer: pointer to struct hrtimer | ||
138 | * @clockid: the hrtimers clock | ||
139 | * @mode: the hrtimers mode | ||
140 | */ | ||
141 | TRACE_EVENT(hrtimer_init, | ||
142 | |||
143 | TP_PROTO(struct hrtimer *timer, clockid_t clockid, | ||
144 | enum hrtimer_mode mode), | ||
145 | |||
146 | TP_ARGS(timer, clockid, mode), | ||
147 | |||
148 | TP_STRUCT__entry( | ||
149 | __field( void *, timer ) | ||
150 | __field( clockid_t, clockid ) | ||
151 | __field( enum hrtimer_mode, mode ) | ||
152 | ), | ||
153 | |||
154 | TP_fast_assign( | ||
155 | __entry->timer = timer; | ||
156 | __entry->clockid = clockid; | ||
157 | __entry->mode = mode; | ||
158 | ), | ||
159 | |||
160 | TP_printk("hrtimer %p, clockid %s, mode %s", __entry->timer, | ||
161 | __entry->clockid == CLOCK_REALTIME ? | ||
162 | "CLOCK_REALTIME" : "CLOCK_MONOTONIC", | ||
163 | __entry->mode == HRTIMER_MODE_ABS ? | ||
164 | "HRTIMER_MODE_ABS" : "HRTIMER_MODE_REL") | ||
165 | ); | ||
166 | |||
167 | /** | ||
168 | * hrtimer_start - called when the hrtimer is started | ||
169 | * @timer: pointer to struct hrtimer | ||
170 | */ | ||
171 | TRACE_EVENT(hrtimer_start, | ||
172 | |||
173 | TP_PROTO(struct hrtimer *timer), | ||
174 | |||
175 | TP_ARGS(timer), | ||
176 | |||
177 | TP_STRUCT__entry( | ||
178 | __field( void *, timer ) | ||
179 | __field( void *, function ) | ||
180 | __field( s64, expires ) | ||
181 | __field( s64, softexpires ) | ||
182 | ), | ||
183 | |||
184 | TP_fast_assign( | ||
185 | __entry->timer = timer; | ||
186 | __entry->function = timer->function; | ||
187 | __entry->expires = hrtimer_get_expires(timer).tv64; | ||
188 | __entry->softexpires = hrtimer_get_softexpires(timer).tv64; | ||
189 | ), | ||
190 | |||
191 | TP_printk("hrtimer %p, func %pf, expires %llu, softexpires %llu", | ||
192 | __entry->timer, __entry->function, | ||
193 | (unsigned long long)ktime_to_ns((ktime_t) { | ||
194 | .tv64 = __entry->expires }), | ||
195 | (unsigned long long)ktime_to_ns((ktime_t) { | ||
196 | .tv64 = __entry->softexpires })) | ||
197 | ); | ||
198 | |||
199 | /** | ||
200 | * htimmer_expire_entry - called immediately before the hrtimer callback | ||
201 | * @timer: pointer to struct hrtimer | ||
202 | * @now: pointer to variable which contains current time of the | ||
203 | * timers base. | ||
204 | * | ||
205 | * Allows to determine the timer latency. | ||
206 | */ | ||
207 | TRACE_EVENT(hrtimer_expire_entry, | ||
208 | |||
209 | TP_PROTO(struct hrtimer *timer, ktime_t *now), | ||
210 | |||
211 | TP_ARGS(timer, now), | ||
212 | |||
213 | TP_STRUCT__entry( | ||
214 | __field( void *, timer ) | ||
215 | __field( s64, now ) | ||
216 | ), | ||
217 | |||
218 | TP_fast_assign( | ||
219 | __entry->timer = timer; | ||
220 | __entry->now = now->tv64; | ||
221 | ), | ||
222 | |||
223 | TP_printk("hrtimer %p, now %llu", __entry->timer, | ||
224 | (unsigned long long)ktime_to_ns((ktime_t) { | ||
225 | .tv64 = __entry->now })) | ||
226 | ); | ||
227 | |||
228 | /** | ||
229 | * hrtimer_expire_exit - called immediately after the hrtimer callback returns | ||
230 | * @timer: pointer to struct hrtimer | ||
231 | * | ||
232 | * When used in combination with the hrtimer_expire_entry tracepoint we can | ||
233 | * determine the runtime of the callback function. | ||
234 | */ | ||
235 | TRACE_EVENT(hrtimer_expire_exit, | ||
236 | |||
237 | TP_PROTO(struct hrtimer *timer), | ||
238 | |||
239 | TP_ARGS(timer), | ||
240 | |||
241 | TP_STRUCT__entry( | ||
242 | __field( void *, timer ) | ||
243 | ), | ||
244 | |||
245 | TP_fast_assign( | ||
246 | __entry->timer = timer; | ||
247 | ), | ||
248 | |||
249 | TP_printk("hrtimer %p", __entry->timer) | ||
250 | ); | ||
251 | |||
252 | /** | ||
253 | * hrtimer_cancel - called when the hrtimer is canceled | ||
254 | * @timer: pointer to struct hrtimer | ||
255 | */ | ||
256 | TRACE_EVENT(hrtimer_cancel, | ||
257 | |||
258 | TP_PROTO(struct hrtimer *timer), | ||
259 | |||
260 | TP_ARGS(timer), | ||
261 | |||
262 | TP_STRUCT__entry( | ||
263 | __field( void *, timer ) | ||
264 | ), | ||
265 | |||
266 | TP_fast_assign( | ||
267 | __entry->timer = timer; | ||
268 | ), | ||
269 | |||
270 | TP_printk("hrtimer %p", __entry->timer) | ||
271 | ); | ||
272 | |||
273 | /** | ||
274 | * itimer_state - called when itimer is started or canceled | ||
275 | * @which: name of the interval timer | ||
276 | * @value: the itimers value, itimer is canceled if value->it_value is | ||
277 | * zero, otherwise it is started | ||
278 | * @expires: the itimers expiry time | ||
279 | */ | ||
280 | TRACE_EVENT(itimer_state, | ||
281 | |||
282 | TP_PROTO(int which, const struct itimerval *const value, | ||
283 | cputime_t expires), | ||
284 | |||
285 | TP_ARGS(which, value, expires), | ||
286 | |||
287 | TP_STRUCT__entry( | ||
288 | __field( int, which ) | ||
289 | __field( cputime_t, expires ) | ||
290 | __field( long, value_sec ) | ||
291 | __field( long, value_usec ) | ||
292 | __field( long, interval_sec ) | ||
293 | __field( long, interval_usec ) | ||
294 | ), | ||
295 | |||
296 | TP_fast_assign( | ||
297 | __entry->which = which; | ||
298 | __entry->expires = expires; | ||
299 | __entry->value_sec = value->it_value.tv_sec; | ||
300 | __entry->value_usec = value->it_value.tv_usec; | ||
301 | __entry->interval_sec = value->it_interval.tv_sec; | ||
302 | __entry->interval_usec = value->it_interval.tv_usec; | ||
303 | ), | ||
304 | |||
305 | TP_printk("which %d, expires %lu, it_value %lu.%lu, it_interval %lu.%lu", | ||
306 | __entry->which, __entry->expires, | ||
307 | __entry->value_sec, __entry->value_usec, | ||
308 | __entry->interval_sec, __entry->interval_usec) | ||
309 | ); | ||
310 | |||
311 | /** | ||
312 | * itimer_expire - called when itimer expires | ||
313 | * @which: type of the interval timer | ||
314 | * @pid: pid of the process which owns the timer | ||
315 | * @now: current time, used to calculate the latency of itimer | ||
316 | */ | ||
317 | TRACE_EVENT(itimer_expire, | ||
318 | |||
319 | TP_PROTO(int which, struct pid *pid, cputime_t now), | ||
320 | |||
321 | TP_ARGS(which, pid, now), | ||
322 | |||
323 | TP_STRUCT__entry( | ||
324 | __field( int , which ) | ||
325 | __field( pid_t, pid ) | ||
326 | __field( cputime_t, now ) | ||
327 | ), | ||
328 | |||
329 | TP_fast_assign( | ||
330 | __entry->which = which; | ||
331 | __entry->now = now; | ||
332 | __entry->pid = pid_nr(pid); | ||
333 | ), | ||
334 | |||
335 | TP_printk("which %d, pid %d, now %lu", __entry->which, | ||
336 | (int) __entry->pid, __entry->now) | ||
337 | ); | ||
338 | |||
339 | #endif /* _TRACE_TIMER_H */ | ||
340 | |||
341 | /* This part must be outside protection */ | ||
342 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h index fcfd9a1e4b96..e4612dbd7ba6 100644 --- a/include/trace/events/workqueue.h +++ b/include/trace/events/workqueue.h | |||
@@ -26,7 +26,7 @@ TRACE_EVENT(workqueue_insertion, | |||
26 | __entry->func = work->func; | 26 | __entry->func = work->func; |
27 | ), | 27 | ), |
28 | 28 | ||
29 | TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, | 29 | TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, |
30 | __entry->thread_pid, __entry->func) | 30 | __entry->thread_pid, __entry->func) |
31 | ); | 31 | ); |
32 | 32 | ||
@@ -48,7 +48,7 @@ TRACE_EVENT(workqueue_execution, | |||
48 | __entry->func = work->func; | 48 | __entry->func = work->func; |
49 | ), | 49 | ), |
50 | 50 | ||
51 | TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, | 51 | TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, |
52 | __entry->thread_pid, __entry->func) | 52 | __entry->thread_pid, __entry->func) |
53 | ); | 53 | ); |
54 | 54 | ||
diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h new file mode 100644 index 000000000000..c051a50ed528 --- /dev/null +++ b/include/video/da8xx-fb.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | * Header file for TI DA8XX LCD controller platform data. | ||
3 | * | ||
4 | * Copyright (C) 2008-2009 MontaVista Software Inc. | ||
5 | * Copyright (C) 2008-2009 Texas Instruments Inc | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public License | ||
8 | * version 2. This program is licensed "as is" without any warranty of any | ||
9 | * kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef DA8XX_FB_H | ||
13 | #define DA8XX_FB_H | ||
14 | |||
15 | enum panel_type { | ||
16 | QVGA = 0 | ||
17 | }; | ||
18 | |||
19 | enum panel_shade { | ||
20 | MONOCHROME = 0, | ||
21 | COLOR_ACTIVE, | ||
22 | COLOR_PASSIVE, | ||
23 | }; | ||
24 | |||
25 | enum raster_load_mode { | ||
26 | LOAD_DATA = 1, | ||
27 | LOAD_PALETTE, | ||
28 | }; | ||
29 | |||
30 | struct display_panel { | ||
31 | enum panel_type panel_type; /* QVGA */ | ||
32 | int max_bpp; | ||
33 | int min_bpp; | ||
34 | enum panel_shade panel_shade; | ||
35 | }; | ||
36 | |||
37 | struct da8xx_lcdc_platform_data { | ||
38 | const char manu_name[10]; | ||
39 | void *controller_data; | ||
40 | const char type[25]; | ||
41 | }; | ||
42 | |||
43 | struct lcd_ctrl_config { | ||
44 | const struct display_panel *p_disp_panel; | ||
45 | |||
46 | /* AC Bias Pin Frequency */ | ||
47 | int ac_bias; | ||
48 | |||
49 | /* AC Bias Pin Transitions per Interrupt */ | ||
50 | int ac_bias_intrpt; | ||
51 | |||
52 | /* DMA burst size */ | ||
53 | int dma_burst_sz; | ||
54 | |||
55 | /* Bits per pixel */ | ||
56 | int bpp; | ||
57 | |||
58 | /* FIFO DMA Request Delay */ | ||
59 | int fdd; | ||
60 | |||
61 | /* TFT Alternative Signal Mapping (Only for active) */ | ||
62 | unsigned char tft_alt_mode; | ||
63 | |||
64 | /* 12 Bit Per Pixel (5-6-5) Mode (Only for passive) */ | ||
65 | unsigned char stn_565_mode; | ||
66 | |||
67 | /* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */ | ||
68 | unsigned char mono_8bit_mode; | ||
69 | |||
70 | /* Invert line clock */ | ||
71 | unsigned char invert_line_clock; | ||
72 | |||
73 | /* Invert frame clock */ | ||
74 | unsigned char invert_frm_clock; | ||
75 | |||
76 | /* Horizontal and Vertical Sync Edge: 0=rising 1=falling */ | ||
77 | unsigned char sync_edge; | ||
78 | |||
79 | /* Horizontal and Vertical Sync: Control: 0=ignore */ | ||
80 | unsigned char sync_ctrl; | ||
81 | |||
82 | /* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */ | ||
83 | unsigned char raster_order; | ||
84 | }; | ||
85 | |||
86 | struct lcd_sync_arg { | ||
87 | int back_porch; | ||
88 | int front_porch; | ||
89 | int pulse_width; | ||
90 | }; | ||
91 | |||
92 | /* ioctls */ | ||
93 | #define FBIOGET_CONTRAST _IOR('F', 1, int) | ||
94 | #define FBIOPUT_CONTRAST _IOW('F', 2, int) | ||
95 | #define FBIGET_BRIGHTNESS _IOR('F', 3, int) | ||
96 | #define FBIPUT_BRIGHTNESS _IOW('F', 3, int) | ||
97 | #define FBIGET_COLOR _IOR('F', 5, int) | ||
98 | #define FBIPUT_COLOR _IOW('F', 6, int) | ||
99 | #define FBIPUT_HSYNC _IOW('F', 9, int) | ||
100 | #define FBIPUT_VSYNC _IOW('F', 10, int) | ||
101 | |||
102 | #endif /* ifndef DA8XX_FB_H */ | ||
103 | |||