diff options
Diffstat (limited to 'include')
237 files changed, 4586 insertions, 2864 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index e27dc8f29972..b9beceb33141 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -63,7 +63,7 @@ | |||
63 | 63 | ||
64 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 64 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
65 | 65 | ||
66 | #define ACPI_CA_VERSION 0x20060127 | 66 | #define ACPI_CA_VERSION 0x20060608 |
67 | 67 | ||
68 | /* | 68 | /* |
69 | * OS name, used for the _OS object. The _OS object is essentially obsolete, | 69 | * OS name, used for the _OS object. The _OS object is essentially obsolete, |
@@ -81,6 +81,7 @@ | |||
81 | #define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ | 81 | #define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ |
82 | #define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ | 82 | #define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ |
83 | #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ | 83 | #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ |
84 | #define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */ | ||
84 | 85 | ||
85 | /* | 86 | /* |
86 | * Should the subsystem abort the loading of an ACPI table if the | 87 | * Should the subsystem abort the loading of an ACPI table if the |
@@ -102,9 +103,9 @@ | |||
102 | 103 | ||
103 | #define ACPI_MAX_SEMAPHORE_COUNT 256 | 104 | #define ACPI_MAX_SEMAPHORE_COUNT 256 |
104 | 105 | ||
105 | /* Max reference count (for debug only) */ | 106 | /* Maximum object reference count (detects object deletion issues) */ |
106 | 107 | ||
107 | #define ACPI_MAX_REFERENCE_COUNT 0x400 | 108 | #define ACPI_MAX_REFERENCE_COUNT 0x800 |
108 | 109 | ||
109 | /* Size of cached memory mapping for system memory operation region */ | 110 | /* Size of cached memory mapping for system memory operation region */ |
110 | 111 | ||
@@ -171,12 +172,7 @@ | |||
171 | 172 | ||
172 | /* Array sizes. Used for range checking also */ | 173 | /* Array sizes. Used for range checking also */ |
173 | 174 | ||
174 | #define ACPI_NUM_ACCESS_TYPES 6 | 175 | #define ACPI_MAX_MATCH_OPCODE 5 |
175 | #define ACPI_NUM_UPDATE_RULES 3 | ||
176 | #define ACPI_NUM_LOCK_RULES 2 | ||
177 | #define ACPI_NUM_MATCH_OPS 6 | ||
178 | #define ACPI_NUM_OPCODES 256 | ||
179 | #define ACPI_NUM_FIELD_NAMES 2 | ||
180 | 176 | ||
181 | /* RSDP checksums */ | 177 | /* RSDP checksums */ |
182 | 178 | ||
@@ -187,10 +183,6 @@ | |||
187 | 183 | ||
188 | #define ACPI_SMBUS_BUFFER_SIZE 34 | 184 | #define ACPI_SMBUS_BUFFER_SIZE 34 |
189 | 185 | ||
190 | /* Number of strings associated with the _OSI reserved method */ | ||
191 | |||
192 | #define ACPI_NUM_OSI_STRINGS 10 | ||
193 | |||
194 | /****************************************************************************** | 186 | /****************************************************************************** |
195 | * | 187 | * |
196 | * ACPI AML Debugger | 188 | * ACPI AML Debugger |
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 11a8fe39cb04..9a7d6921f534 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h | |||
@@ -50,26 +50,72 @@ | |||
50 | #define BLOCK_PAREN 1 | 50 | #define BLOCK_PAREN 1 |
51 | #define BLOCK_BRACE 2 | 51 | #define BLOCK_BRACE 2 |
52 | #define BLOCK_COMMA_LIST 4 | 52 | #define BLOCK_COMMA_LIST 4 |
53 | #define ACPI_DEFAULT_RESNAME *(u32 *) "__RD" | ||
53 | 54 | ||
54 | struct acpi_external_list { | 55 | struct acpi_external_list { |
55 | char *path; | 56 | char *path; |
57 | char *internal_path; | ||
56 | struct acpi_external_list *next; | 58 | struct acpi_external_list *next; |
59 | u32 value; | ||
60 | u16 length; | ||
61 | u8 type; | ||
57 | }; | 62 | }; |
58 | 63 | ||
59 | extern struct acpi_external_list *acpi_gbl_external_list; | 64 | extern struct acpi_external_list *acpi_gbl_external_list; |
60 | 65 | ||
61 | /* Strings used for decoding flags to ASL keywords */ | 66 | typedef const struct acpi_dmtable_info { |
67 | u8 opcode; | ||
68 | u8 offset; | ||
69 | char *name; | ||
70 | |||
71 | } acpi_dmtable_info; | ||
72 | |||
73 | /* | ||
74 | * Values for Opcode above. | ||
75 | * Note: 0-7 must not change, used as a flag shift value | ||
76 | */ | ||
77 | #define ACPI_DMT_FLAG0 0 | ||
78 | #define ACPI_DMT_FLAG1 1 | ||
79 | #define ACPI_DMT_FLAG2 2 | ||
80 | #define ACPI_DMT_FLAG3 3 | ||
81 | #define ACPI_DMT_FLAG4 4 | ||
82 | #define ACPI_DMT_FLAG5 5 | ||
83 | #define ACPI_DMT_FLAG6 6 | ||
84 | #define ACPI_DMT_FLAG7 7 | ||
85 | #define ACPI_DMT_FLAGS0 8 | ||
86 | #define ACPI_DMT_FLAGS2 9 | ||
87 | #define ACPI_DMT_UINT8 10 | ||
88 | #define ACPI_DMT_UINT16 11 | ||
89 | #define ACPI_DMT_UINT24 12 | ||
90 | #define ACPI_DMT_UINT32 13 | ||
91 | #define ACPI_DMT_UINT56 14 | ||
92 | #define ACPI_DMT_UINT64 15 | ||
93 | #define ACPI_DMT_STRING 16 | ||
94 | #define ACPI_DMT_NAME4 17 | ||
95 | #define ACPI_DMT_NAME6 18 | ||
96 | #define ACPI_DMT_NAME8 19 | ||
97 | #define ACPI_DMT_CHKSUM 20 | ||
98 | #define ACPI_DMT_SPACEID 21 | ||
99 | #define ACPI_DMT_GAS 22 | ||
100 | #define ACPI_DMT_MADT 23 | ||
101 | #define ACPI_DMT_SRAT 24 | ||
102 | #define ACPI_DMT_EXIT 25 | ||
62 | 103 | ||
63 | extern const char *acpi_gbl_word_decode[4]; | 104 | typedef |
64 | extern const char *acpi_gbl_irq_decode[2]; | 105 | void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table); |
65 | extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; | 106 | |
66 | extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; | 107 | struct acpi_dmtable_data { |
67 | extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; | 108 | char *signature; |
68 | extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; | 109 | struct acpi_dmtable_info *table_info; |
110 | ACPI_TABLE_HANDLER table_handler; | ||
111 | }; | ||
69 | 112 | ||
70 | struct acpi_op_walk_info { | 113 | struct acpi_op_walk_info { |
71 | u32 level; | 114 | u32 level; |
115 | u32 last_level; | ||
116 | u32 count; | ||
72 | u32 bit_offset; | 117 | u32 bit_offset; |
118 | u32 flags; | ||
73 | struct acpi_walk_state *walk_state; | 119 | struct acpi_walk_state *walk_state; |
74 | }; | 120 | }; |
75 | 121 | ||
@@ -77,6 +123,100 @@ typedef | |||
77 | acpi_status(*asl_walk_callback) (union acpi_parse_object * op, | 123 | acpi_status(*asl_walk_callback) (union acpi_parse_object * op, |
78 | u32 level, void *context); | 124 | u32 level, void *context); |
79 | 125 | ||
126 | struct acpi_resource_tag { | ||
127 | u32 bit_index; | ||
128 | char *tag; | ||
129 | }; | ||
130 | |||
131 | /* Strings used for decoding flags to ASL keywords */ | ||
132 | |||
133 | extern const char *acpi_gbl_word_decode[]; | ||
134 | extern const char *acpi_gbl_irq_decode[]; | ||
135 | extern const char *acpi_gbl_lock_rule[]; | ||
136 | extern const char *acpi_gbl_access_types[]; | ||
137 | extern const char *acpi_gbl_update_rules[]; | ||
138 | extern const char *acpi_gbl_match_ops[]; | ||
139 | |||
140 | extern struct acpi_dmtable_info acpi_dm_table_info_asf0[]; | ||
141 | extern struct acpi_dmtable_info acpi_dm_table_info_asf1[]; | ||
142 | extern struct acpi_dmtable_info acpi_dm_table_info_asf2[]; | ||
143 | extern struct acpi_dmtable_info acpi_dm_table_info_asf3[]; | ||
144 | extern struct acpi_dmtable_info acpi_dm_table_info_asf4[]; | ||
145 | extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[]; | ||
146 | extern struct acpi_dmtable_info acpi_dm_table_info_boot[]; | ||
147 | extern struct acpi_dmtable_info acpi_dm_table_info_cpep[]; | ||
148 | extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[]; | ||
149 | extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[]; | ||
150 | extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[]; | ||
151 | extern struct acpi_dmtable_info acpi_dm_table_info_facs[]; | ||
152 | extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[]; | ||
153 | extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[]; | ||
154 | extern struct acpi_dmtable_info acpi_dm_table_info_gas[]; | ||
155 | extern struct acpi_dmtable_info acpi_dm_table_info_header[]; | ||
156 | extern struct acpi_dmtable_info acpi_dm_table_info_hpet[]; | ||
157 | extern struct acpi_dmtable_info acpi_dm_table_info_madt[]; | ||
158 | extern struct acpi_dmtable_info acpi_dm_table_info_madt0[]; | ||
159 | extern struct acpi_dmtable_info acpi_dm_table_info_madt1[]; | ||
160 | extern struct acpi_dmtable_info acpi_dm_table_info_madt2[]; | ||
161 | extern struct acpi_dmtable_info acpi_dm_table_info_madt3[]; | ||
162 | extern struct acpi_dmtable_info acpi_dm_table_info_madt4[]; | ||
163 | extern struct acpi_dmtable_info acpi_dm_table_info_madt5[]; | ||
164 | extern struct acpi_dmtable_info acpi_dm_table_info_madt6[]; | ||
165 | extern struct acpi_dmtable_info acpi_dm_table_info_madt7[]; | ||
166 | extern struct acpi_dmtable_info acpi_dm_table_info_madt8[]; | ||
167 | extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[]; | ||
168 | extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[]; | ||
169 | extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[]; | ||
170 | extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[]; | ||
171 | extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[]; | ||
172 | extern struct acpi_dmtable_info acpi_dm_table_info_sbst[]; | ||
173 | extern struct acpi_dmtable_info acpi_dm_table_info_slit[]; | ||
174 | extern struct acpi_dmtable_info acpi_dm_table_info_spcr[]; | ||
175 | extern struct acpi_dmtable_info acpi_dm_table_info_spmi[]; | ||
176 | extern struct acpi_dmtable_info acpi_dm_table_info_srat[]; | ||
177 | extern struct acpi_dmtable_info acpi_dm_table_info_srat0[]; | ||
178 | extern struct acpi_dmtable_info acpi_dm_table_info_srat1[]; | ||
179 | extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[]; | ||
180 | extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[]; | ||
181 | |||
182 | /* | ||
183 | * dmtable | ||
184 | */ | ||
185 | void acpi_dm_dump_data_table(struct acpi_table_header *table); | ||
186 | |||
187 | void | ||
188 | acpi_dm_dump_table(u32 table_length, | ||
189 | u32 table_offset, | ||
190 | void *table, | ||
191 | u32 sub_table_length, struct acpi_dmtable_info *info); | ||
192 | |||
193 | void acpi_dm_line_header(u32 offset, u32 byte_length, char *name); | ||
194 | |||
195 | void acpi_dm_line_header2(u32 offset, u32 byte_length, char *name, u32 value); | ||
196 | |||
197 | /* | ||
198 | * dmtbdump | ||
199 | */ | ||
200 | void acpi_dm_dump_asf(struct acpi_table_header *table); | ||
201 | |||
202 | void acpi_dm_dump_cpep(struct acpi_table_header *table); | ||
203 | |||
204 | void acpi_dm_dump_fadt(struct acpi_table_header *table); | ||
205 | |||
206 | void acpi_dm_dump_srat(struct acpi_table_header *table); | ||
207 | |||
208 | void acpi_dm_dump_mcfg(struct acpi_table_header *table); | ||
209 | |||
210 | void acpi_dm_dump_madt(struct acpi_table_header *table); | ||
211 | |||
212 | u32 acpi_dm_dump_rsdp(struct acpi_table_header *table); | ||
213 | |||
214 | void acpi_dm_dump_rsdt(struct acpi_table_header *table); | ||
215 | |||
216 | void acpi_dm_dump_slit(struct acpi_table_header *table); | ||
217 | |||
218 | void acpi_dm_dump_xsdt(struct acpi_table_header *table); | ||
219 | |||
80 | /* | 220 | /* |
81 | * dmwalk | 221 | * dmwalk |
82 | */ | 222 | */ |
@@ -84,6 +224,11 @@ void | |||
84 | acpi_dm_disassemble(struct acpi_walk_state *walk_state, | 224 | acpi_dm_disassemble(struct acpi_walk_state *walk_state, |
85 | union acpi_parse_object *origin, u32 num_opcodes); | 225 | union acpi_parse_object *origin, u32 num_opcodes); |
86 | 226 | ||
227 | void | ||
228 | acpi_dm_walk_parse_tree(union acpi_parse_object *op, | ||
229 | asl_walk_callback descending_callback, | ||
230 | asl_walk_callback ascending_callback, void *context); | ||
231 | |||
87 | /* | 232 | /* |
88 | * dmopcode | 233 | * dmopcode |
89 | */ | 234 | */ |
@@ -166,6 +311,7 @@ void acpi_dm_dump_integer64(u64 value, char *name); | |||
166 | 311 | ||
167 | void | 312 | void |
168 | acpi_dm_resource_template(struct acpi_op_walk_info *info, | 313 | acpi_dm_resource_template(struct acpi_op_walk_info *info, |
314 | union acpi_parse_object *op, | ||
169 | u8 * byte_data, u32 byte_count); | 315 | u8 * byte_data, u32 byte_count); |
170 | 316 | ||
171 | u8 acpi_dm_is_resource_template(union acpi_parse_object *op); | 317 | u8 acpi_dm_is_resource_template(union acpi_parse_object *op); |
@@ -176,6 +322,8 @@ void acpi_dm_bit_list(u16 mask); | |||
176 | 322 | ||
177 | void acpi_dm_decode_attribute(u8 attribute); | 323 | void acpi_dm_decode_attribute(u8 attribute); |
178 | 324 | ||
325 | void acpi_dm_descriptor_name(void); | ||
326 | |||
179 | /* | 327 | /* |
180 | * dmresrcl | 328 | * dmresrcl |
181 | */ | 329 | */ |
@@ -248,6 +396,15 @@ acpi_dm_vendor_small_descriptor(union aml_resource *resource, | |||
248 | /* | 396 | /* |
249 | * dmutils | 397 | * dmutils |
250 | */ | 398 | */ |
251 | void acpi_dm_add_to_external_list(char *path); | 399 | void acpi_dm_add_to_external_list(char *path, u8 type, u32 value); |
400 | |||
401 | /* | ||
402 | * dmrestag | ||
403 | */ | ||
404 | void acpi_dm_find_resources(union acpi_parse_object *root); | ||
405 | |||
406 | void | ||
407 | acpi_dm_check_resource_reference(union acpi_parse_object *op, | ||
408 | struct acpi_walk_state *walk_state); | ||
252 | 409 | ||
253 | #endif /* __ACDISASM_H__ */ | 410 | #endif /* __ACDISASM_H__ */ |
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index c41a926ff317..288f84903af7 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h | |||
@@ -194,7 +194,9 @@ acpi_status | |||
194 | acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, | 194 | acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, |
195 | union acpi_operand_object *return_desc); | 195 | union acpi_operand_object *return_desc); |
196 | 196 | ||
197 | void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); | 197 | void |
198 | acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, | ||
199 | struct acpi_walk_state *walk_state); | ||
198 | 200 | ||
199 | acpi_status | 201 | acpi_status |
200 | acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, | 202 | acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, |
@@ -302,7 +304,7 @@ acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state, | |||
302 | struct acpi_namespace_node *method_node, | 304 | struct acpi_namespace_node *method_node, |
303 | u8 * aml_start, | 305 | u8 * aml_start, |
304 | u32 aml_length, | 306 | u32 aml_length, |
305 | struct acpi_parameter_info *info, u8 pass_number); | 307 | struct acpi_evaluate_info *info, u8 pass_number); |
306 | 308 | ||
307 | acpi_status | 309 | acpi_status |
308 | acpi_ds_obj_stack_pop_and_delete(u32 pop_count, | 310 | acpi_ds_obj_stack_pop_and_delete(u32 pop_count, |
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h index f2717be4fe0d..234142828e1a 100644 --- a/include/acpi/acevents.h +++ b/include/acpi/acevents.h | |||
@@ -93,7 +93,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, | |||
93 | */ | 93 | */ |
94 | u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); | 94 | u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); |
95 | 95 | ||
96 | acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback); | 96 | acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback); |
97 | 97 | ||
98 | acpi_status | 98 | acpi_status |
99 | acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | 99 | acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
@@ -138,7 +138,7 @@ acpi_status | |||
138 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | 138 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, |
139 | u32 function, | 139 | u32 function, |
140 | acpi_physical_address address, | 140 | acpi_physical_address address, |
141 | u32 bit_width, void *value); | 141 | u32 bit_width, acpi_integer * value); |
142 | 142 | ||
143 | acpi_status | 143 | acpi_status |
144 | acpi_ev_attach_region(union acpi_operand_object *handler_obj, | 144 | acpi_ev_attach_region(union acpi_operand_object *handler_obj, |
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index dc768aa580e4..797ca1ea5214 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -160,8 +160,9 @@ | |||
160 | #define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML) | 160 | #define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001F | AE_CODE_AML) |
161 | #define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x0020 | AE_CODE_AML) | 161 | #define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x0020 | AE_CODE_AML) |
162 | #define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x0021 | AE_CODE_AML) | 162 | #define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x0021 | AE_CODE_AML) |
163 | #define AE_AML_ILLEGAL_ADDRESS (acpi_status) (0x0022 | AE_CODE_AML) | ||
163 | 164 | ||
164 | #define AE_CODE_AML_MAX 0x0021 | 165 | #define AE_CODE_AML_MAX 0x0022 |
165 | 166 | ||
166 | /* | 167 | /* |
167 | * Internal exceptions used for control | 168 | * Internal exceptions used for control |
@@ -275,7 +276,8 @@ char const *acpi_gbl_exception_names_aml[] = { | |||
275 | "AE_AML_NO_RESOURCE_END_TAG", | 276 | "AE_AML_NO_RESOURCE_END_TAG", |
276 | "AE_AML_BAD_RESOURCE_VALUE", | 277 | "AE_AML_BAD_RESOURCE_VALUE", |
277 | "AE_AML_CIRCULAR_REFERENCE", | 278 | "AE_AML_CIRCULAR_REFERENCE", |
278 | "AE_AML_BAD_RESOURCE_LENGTH" | 279 | "AE_AML_BAD_RESOURCE_LENGTH", |
280 | "AE_AML_ILLEGAL_ADDRESS" | ||
279 | }; | 281 | }; |
280 | 282 | ||
281 | char const *acpi_gbl_exception_names_ctrl[] = { | 283 | char const *acpi_gbl_exception_names_ctrl[] = { |
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index 734cc77bf2c7..14531d48f6b6 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h | |||
@@ -107,6 +107,7 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags; | |||
107 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) | 107 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) |
108 | * 4) Allow ANY object type to be a source operand for the Store() operator | 108 | * 4) Allow ANY object type to be a source operand for the Store() operator |
109 | * 5) Allow unresolved references (invalid target name) in package objects | 109 | * 5) Allow unresolved references (invalid target name) in package objects |
110 | * 6) Enable warning messages for behavior that is not ACPI spec compliant | ||
110 | */ | 111 | */ |
111 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); | 112 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); |
112 | 113 | ||
@@ -114,7 +115,7 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); | |||
114 | * Automatically serialize ALL control methods? Default is FALSE, meaning | 115 | * Automatically serialize ALL control methods? Default is FALSE, meaning |
115 | * to use the Serialized/not_serialized method flags on a per method basis. | 116 | * to use the Serialized/not_serialized method flags on a per method basis. |
116 | * Only change this if the ASL code is poorly written and cannot handle | 117 | * Only change this if the ASL code is poorly written and cannot handle |
117 | * reentrancy even though methods are marked "not_serialized". | 118 | * reentrancy even though methods are marked "NotSerialized". |
118 | */ | 119 | */ |
119 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); | 120 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); |
120 | 121 | ||
@@ -149,10 +150,10 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE); | |||
149 | ACPI_EXTERN u32 acpi_gbl_table_flags; | 150 | ACPI_EXTERN u32 acpi_gbl_table_flags; |
150 | ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; | 151 | ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; |
151 | ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; | 152 | ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; |
152 | ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; | 153 | ACPI_EXTERN struct xsdt_descriptor *acpi_gbl_XSDT; |
153 | ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; | 154 | ACPI_EXTERN struct fadt_descriptor *acpi_gbl_FADT; |
154 | ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; | 155 | ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; |
155 | ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; | 156 | ACPI_EXTERN struct facs_descriptor *acpi_gbl_FACS; |
156 | ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; | 157 | ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; |
157 | /* | 158 | /* |
158 | * Since there may be multiple SSDTs and PSDTs, a single pointer is not | 159 | * Since there may be multiple SSDTs and PSDTs, a single pointer is not |
@@ -177,15 +178,15 @@ ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; | |||
177 | /* | 178 | /* |
178 | * ACPI Table info arrays | 179 | * ACPI Table info arrays |
179 | */ | 180 | */ |
180 | extern struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; | 181 | extern struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1]; |
181 | extern struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES]; | 182 | extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1]; |
182 | 183 | ||
183 | /* | 184 | /* |
184 | * Predefined mutex objects. This array contains the | 185 | * Predefined mutex objects. This array contains the |
185 | * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. | 186 | * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. |
186 | * (The table maps local handles to the real OS handles) | 187 | * (The table maps local handles to the real OS handles) |
187 | */ | 188 | */ |
188 | ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; | 189 | ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX]; |
189 | 190 | ||
190 | /***************************************************************************** | 191 | /***************************************************************************** |
191 | * | 192 | * |
@@ -203,6 +204,7 @@ ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; | |||
203 | 204 | ||
204 | /* Object caches */ | 205 | /* Object caches */ |
205 | 206 | ||
207 | ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache; | ||
206 | ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; | 208 | ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; |
207 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; | 209 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; |
208 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; | 210 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; |
@@ -244,7 +246,6 @@ extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; | |||
244 | extern const char *acpi_gbl_highest_dstate_names[4]; | 246 | extern const char *acpi_gbl_highest_dstate_names[4]; |
245 | extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; | 247 | extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; |
246 | extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; | 248 | extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; |
247 | extern const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS]; | ||
248 | 249 | ||
249 | /***************************************************************************** | 250 | /***************************************************************************** |
250 | * | 251 | * |
@@ -291,14 +292,6 @@ ACPI_EXTERN u8 acpi_gbl_cm_single_step; | |||
291 | 292 | ||
292 | /***************************************************************************** | 293 | /***************************************************************************** |
293 | * | 294 | * |
294 | * Parser globals | ||
295 | * | ||
296 | ****************************************************************************/ | ||
297 | |||
298 | ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; | ||
299 | |||
300 | /***************************************************************************** | ||
301 | * | ||
302 | * Hardware globals | 295 | * Hardware globals |
303 | * | 296 | * |
304 | ****************************************************************************/ | 297 | ****************************************************************************/ |
@@ -321,7 +314,11 @@ ACPI_EXTERN struct acpi_fixed_event_handler | |||
321 | ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; | 314 | ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; |
322 | ACPI_EXTERN struct acpi_gpe_block_info | 315 | ACPI_EXTERN struct acpi_gpe_block_info |
323 | *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; | 316 | *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; |
317 | |||
318 | /* Spinlocks */ | ||
319 | |||
324 | ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; | 320 | ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; |
321 | ACPI_EXTERN acpi_handle acpi_gbl_hardware_lock; | ||
325 | 322 | ||
326 | /***************************************************************************** | 323 | /***************************************************************************** |
327 | * | 324 | * |
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 8361820d2970..1eeca7adca95 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h | |||
@@ -44,7 +44,10 @@ | |||
44 | #ifndef __ACLOCAL_H__ | 44 | #ifndef __ACLOCAL_H__ |
45 | #define __ACLOCAL_H__ | 45 | #define __ACLOCAL_H__ |
46 | 46 | ||
47 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
48 | |||
47 | #define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ | 49 | #define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ |
50 | #define ACPI_INFINITE_CONCURRENCY 0xFF | ||
48 | 51 | ||
49 | typedef void *acpi_mutex; | 52 | typedef void *acpi_mutex; |
50 | typedef u32 acpi_mutex_handle; | 53 | typedef u32 acpi_mutex_handle; |
@@ -69,52 +72,55 @@ union acpi_parse_object; | |||
69 | * Predefined handles for the mutex objects used within the subsystem | 72 | * Predefined handles for the mutex objects used within the subsystem |
70 | * All mutex objects are automatically created by acpi_ut_mutex_initialize. | 73 | * All mutex objects are automatically created by acpi_ut_mutex_initialize. |
71 | * | 74 | * |
72 | * The acquire/release ordering protocol is implied via this list. Mutexes | 75 | * The acquire/release ordering protocol is implied via this list. Mutexes |
73 | * with a lower value must be acquired before mutexes with a higher value. | 76 | * with a lower value must be acquired before mutexes with a higher value. |
74 | * | 77 | * |
75 | * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also! | 78 | * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names |
79 | * table below also! | ||
76 | */ | 80 | */ |
77 | #define ACPI_MTX_EXECUTE 0 | 81 | #define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ |
78 | #define ACPI_MTX_INTERPRETER 1 | 82 | #define ACPI_MTX_CONTROL_METHOD 1 /* Control method termination [TBD: may no longer be necessary] */ |
79 | #define ACPI_MTX_PARSER 2 | 83 | #define ACPI_MTX_TABLES 2 /* Data for ACPI tables */ |
80 | #define ACPI_MTX_DISPATCHER 3 | 84 | #define ACPI_MTX_NAMESPACE 3 /* ACPI Namespace */ |
81 | #define ACPI_MTX_TABLES 4 | 85 | #define ACPI_MTX_EVENTS 4 /* Data for ACPI events */ |
82 | #define ACPI_MTX_OP_REGIONS 5 | 86 | #define ACPI_MTX_CACHES 5 /* Internal caches, general purposes */ |
83 | #define ACPI_MTX_NAMESPACE 6 | 87 | #define ACPI_MTX_MEMORY 6 /* Debug memory tracking lists */ |
84 | #define ACPI_MTX_EVENTS 7 | 88 | #define ACPI_MTX_DEBUG_CMD_COMPLETE 7 /* AML debugger */ |
85 | #define ACPI_MTX_HARDWARE 8 | 89 | #define ACPI_MTX_DEBUG_CMD_READY 8 /* AML debugger */ |
86 | #define ACPI_MTX_CACHES 9 | 90 | |
87 | #define ACPI_MTX_MEMORY 10 | 91 | #define ACPI_MAX_MUTEX 8 |
88 | #define ACPI_MTX_DEBUG_CMD_COMPLETE 11 | 92 | #define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 |
89 | #define ACPI_MTX_DEBUG_CMD_READY 12 | ||
90 | |||
91 | #define MAX_MUTEX 12 | ||
92 | #define NUM_MUTEX MAX_MUTEX+1 | ||
93 | 93 | ||
94 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 94 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
95 | #ifdef DEFINE_ACPI_GLOBALS | 95 | #ifdef DEFINE_ACPI_GLOBALS |
96 | 96 | ||
97 | /* Names for the mutexes used in the subsystem */ | 97 | /* Debug names for the mutexes above */ |
98 | 98 | ||
99 | static char *acpi_gbl_mutex_names[] = { | 99 | static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = { |
100 | "ACPI_MTX_Execute", | ||
101 | "ACPI_MTX_Interpreter", | 100 | "ACPI_MTX_Interpreter", |
102 | "ACPI_MTX_Parser", | 101 | "ACPI_MTX_Method", |
103 | "ACPI_MTX_Dispatcher", | ||
104 | "ACPI_MTX_Tables", | 102 | "ACPI_MTX_Tables", |
105 | "ACPI_MTX_op_regions", | ||
106 | "ACPI_MTX_Namespace", | 103 | "ACPI_MTX_Namespace", |
107 | "ACPI_MTX_Events", | 104 | "ACPI_MTX_Events", |
108 | "ACPI_MTX_Hardware", | ||
109 | "ACPI_MTX_Caches", | 105 | "ACPI_MTX_Caches", |
110 | "ACPI_MTX_Memory", | 106 | "ACPI_MTX_Memory", |
111 | "ACPI_MTX_debug_cmd_complete", | 107 | "ACPI_MTX_DebugCmdComplete", |
112 | "ACPI_MTX_debug_cmd_ready", | 108 | "ACPI_MTX_DebugCmdReady" |
113 | }; | 109 | }; |
114 | 110 | ||
115 | #endif | 111 | #endif |
116 | #endif | 112 | #endif |
117 | 113 | ||
114 | /* | ||
115 | * Predefined handles for spinlocks used within the subsystem. | ||
116 | * These spinlocks are created by acpi_ut_mutex_initialize | ||
117 | */ | ||
118 | #define ACPI_LOCK_GPES 0 | ||
119 | #define ACPI_LOCK_HARDWARE 1 | ||
120 | |||
121 | #define ACPI_MAX_LOCK 1 | ||
122 | #define ACPI_NUM_LOCK ACPI_MAX_LOCK+1 | ||
123 | |||
118 | /* Owner IDs are used to track namespace nodes for selective deletion */ | 124 | /* Owner IDs are used to track namespace nodes for selective deletion */ |
119 | 125 | ||
120 | typedef u8 acpi_owner_id; | 126 | typedef u8 acpi_owner_id; |
@@ -129,7 +135,7 @@ typedef u8 acpi_owner_id; | |||
129 | struct acpi_mutex_info { | 135 | struct acpi_mutex_info { |
130 | acpi_mutex mutex; | 136 | acpi_mutex mutex; |
131 | u32 use_count; | 137 | u32 use_count; |
132 | u32 thread_id; | 138 | acpi_thread_id thread_id; |
133 | }; | 139 | }; |
134 | 140 | ||
135 | /* Lock flag parameter for various interfaces */ | 141 | /* Lock flag parameter for various interfaces */ |
@@ -144,6 +150,8 @@ struct acpi_mutex_info { | |||
144 | #define ACPI_FIELD_DWORD_GRANULARITY 4 | 150 | #define ACPI_FIELD_DWORD_GRANULARITY 4 |
145 | #define ACPI_FIELD_QWORD_GRANULARITY 8 | 151 | #define ACPI_FIELD_QWORD_GRANULARITY 8 |
146 | 152 | ||
153 | #define ACPI_ENTRY_NOT_FOUND NULL | ||
154 | |||
147 | /***************************************************************************** | 155 | /***************************************************************************** |
148 | * | 156 | * |
149 | * Namespace typedefs and structs | 157 | * Namespace typedefs and structs |
@@ -158,49 +166,55 @@ typedef enum { | |||
158 | ACPI_IMODE_EXECUTE = 0x0E | 166 | ACPI_IMODE_EXECUTE = 0x0E |
159 | } acpi_interpreter_mode; | 167 | } acpi_interpreter_mode; |
160 | 168 | ||
161 | /* | ||
162 | * The Node describes a named object that appears in the AML | ||
163 | * An acpi_node is used to store Nodes. | ||
164 | * | ||
165 | * data_type is used to differentiate between internal descriptors, and MUST | ||
166 | * be the first byte in this structure. | ||
167 | */ | ||
168 | union acpi_name_union { | 169 | union acpi_name_union { |
169 | u32 integer; | 170 | u32 integer; |
170 | char ascii[4]; | 171 | char ascii[4]; |
171 | }; | 172 | }; |
172 | 173 | ||
174 | /* | ||
175 | * The Namespace Node describes a named object that appears in the AML. | ||
176 | * descriptor_type is used to differentiate between internal descriptors. | ||
177 | * | ||
178 | * The node is optimized for both 32-bit and 64-bit platforms: | ||
179 | * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. | ||
180 | * | ||
181 | * Note: The descriptor_type and Type fields must appear in the identical | ||
182 | * position in both the struct acpi_namespace_node and union acpi_operand_object | ||
183 | * structures. | ||
184 | */ | ||
173 | struct acpi_namespace_node { | 185 | struct acpi_namespace_node { |
174 | u8 descriptor; /* Used to differentiate object descriptor types */ | 186 | union acpi_operand_object *object; /* Interpreter object */ |
175 | u8 type; /* Type associated with this name */ | 187 | u8 descriptor_type; /* Differentiate object descriptor types */ |
176 | u16 reference_count; /* Current count of references and children */ | 188 | u8 type; /* ACPI Type associated with this name */ |
189 | u8 flags; /* Miscellaneous flags */ | ||
190 | acpi_owner_id owner_id; /* Node creator */ | ||
177 | union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ | 191 | union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ |
178 | union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ | ||
179 | struct acpi_namespace_node *child; /* First child */ | 192 | struct acpi_namespace_node *child; /* First child */ |
180 | struct acpi_namespace_node *peer; /* Next peer */ | 193 | struct acpi_namespace_node *peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */ |
181 | u8 owner_id; /* Who created this node */ | ||
182 | u8 flags; | ||
183 | |||
184 | /* Fields used by the ASL compiler only */ | ||
185 | 194 | ||
186 | #ifdef ACPI_ASL_COMPILER | 195 | /* |
187 | u32 value; | 196 | * The following fields are used by the ASL compiler and disassembler only |
197 | */ | ||
198 | #ifdef ACPI_LARGE_NAMESPACE_NODE | ||
188 | union acpi_parse_object *op; | 199 | union acpi_parse_object *op; |
200 | u32 value; | ||
201 | u32 length; | ||
189 | #endif | 202 | #endif |
190 | }; | 203 | }; |
191 | 204 | ||
192 | #define ACPI_ENTRY_NOT_FOUND NULL | 205 | /* Namespace Node flags */ |
193 | 206 | ||
194 | /* Node flags */ | 207 | #define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ |
208 | #define ANOBJ_DATA_WIDTH_32 0x02 /* Parent table uses 32-bit math */ | ||
209 | #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ | ||
210 | #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ | ||
211 | #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ | ||
195 | 212 | ||
196 | #define ANOBJ_RESERVED 0x01 | 213 | #define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */ |
197 | #define ANOBJ_END_OF_PEER_LIST 0x02 | 214 | #define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */ |
198 | #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ | 215 | #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* i_aSL only: Method has at least one return value */ |
199 | #define ANOBJ_METHOD_ARG 0x08 | 216 | #define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */ |
200 | #define ANOBJ_METHOD_LOCAL 0x10 | 217 | #define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */ |
201 | #define ANOBJ_METHOD_NO_RETVAL 0x20 | ||
202 | #define ANOBJ_METHOD_SOME_NO_RETVAL 0x40 | ||
203 | #define ANOBJ_IS_BIT_OFFSET 0x80 | ||
204 | 218 | ||
205 | /* | 219 | /* |
206 | * ACPI Table Descriptor. One per ACPI table | 220 | * ACPI Table Descriptor. One per ACPI table |
@@ -212,8 +226,8 @@ struct acpi_table_desc { | |||
212 | struct acpi_table_header *pointer; | 226 | struct acpi_table_header *pointer; |
213 | u8 *aml_start; | 227 | u8 *aml_start; |
214 | u64 physical_address; | 228 | u64 physical_address; |
215 | u32 aml_length; | ||
216 | acpi_size length; | 229 | acpi_size length; |
230 | u32 aml_length; | ||
217 | acpi_owner_id owner_id; | 231 | acpi_owner_id owner_id; |
218 | u8 type; | 232 | u8 type; |
219 | u8 allocation; | 233 | u8 allocation; |
@@ -276,6 +290,9 @@ struct acpi_create_field_info { | |||
276 | u8 field_type; | 290 | u8 field_type; |
277 | }; | 291 | }; |
278 | 292 | ||
293 | typedef | ||
294 | acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); | ||
295 | |||
279 | /* | 296 | /* |
280 | * Bitmapped ACPI types. Used internally only | 297 | * Bitmapped ACPI types. Used internally only |
281 | */ | 298 | */ |
@@ -377,7 +394,7 @@ struct acpi_gpe_walk_info { | |||
377 | struct acpi_gpe_block_info *gpe_block; | 394 | struct acpi_gpe_block_info *gpe_block; |
378 | }; | 395 | }; |
379 | 396 | ||
380 | typedef acpi_status(*ACPI_GPE_CALLBACK) (struct acpi_gpe_xrupt_info * | 397 | typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info * |
381 | gpe_xrupt_info, | 398 | gpe_xrupt_info, |
382 | struct acpi_gpe_block_info * | 399 | struct acpi_gpe_block_info * |
383 | gpe_block); | 400 | gpe_block); |
@@ -416,13 +433,14 @@ struct acpi_field_info { | |||
416 | #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 | 433 | #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 |
417 | #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 | 434 | #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 |
418 | 435 | ||
419 | #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ | 436 | #define ACPI_STATE_COMMON \ |
420 | u8 data_type; /* To differentiate various internal objs */\ | 437 | void *next; \ |
421 | u8 flags; \ | 438 | u8 descriptor_type; /* To differentiate various internal objs */\ |
422 | u16 value; \ | 439 | u8 flags; \ |
423 | u16 state; \ | 440 | u16 value; \ |
424 | u16 reserved; \ | 441 | u16 state; |
425 | void *next; | 442 | |
443 | /* There are 2 bytes available here until the next natural alignment boundary */ | ||
426 | 444 | ||
427 | struct acpi_common_state { | 445 | struct acpi_common_state { |
428 | ACPI_STATE_COMMON}; | 446 | ACPI_STATE_COMMON}; |
@@ -438,12 +456,12 @@ struct acpi_update_state { | |||
438 | * Pkg state - used to traverse nested package structures | 456 | * Pkg state - used to traverse nested package structures |
439 | */ | 457 | */ |
440 | struct acpi_pkg_state { | 458 | struct acpi_pkg_state { |
441 | ACPI_STATE_COMMON union acpi_operand_object *source_object; | 459 | ACPI_STATE_COMMON u16 index; |
460 | union acpi_operand_object *source_object; | ||
442 | union acpi_operand_object *dest_object; | 461 | union acpi_operand_object *dest_object; |
443 | struct acpi_walk_state *walk_state; | 462 | struct acpi_walk_state *walk_state; |
444 | void *this_target_obj; | 463 | void *this_target_obj; |
445 | u32 num_packages; | 464 | u32 num_packages; |
446 | u16 index; | ||
447 | }; | 465 | }; |
448 | 466 | ||
449 | /* | 467 | /* |
@@ -451,10 +469,10 @@ struct acpi_pkg_state { | |||
451 | * Allows nesting of these constructs | 469 | * Allows nesting of these constructs |
452 | */ | 470 | */ |
453 | struct acpi_control_state { | 471 | struct acpi_control_state { |
454 | ACPI_STATE_COMMON union acpi_parse_object *predicate_op; | 472 | ACPI_STATE_COMMON u16 opcode; |
473 | union acpi_parse_object *predicate_op; | ||
455 | u8 *aml_predicate_start; /* Start of if/while predicate */ | 474 | u8 *aml_predicate_start; /* Start of if/while predicate */ |
456 | u8 *package_end; /* End of if/while block */ | 475 | u8 *package_end; /* End of if/while block */ |
457 | u16 opcode; | ||
458 | }; | 476 | }; |
459 | 477 | ||
460 | /* | 478 | /* |
@@ -465,11 +483,11 @@ struct acpi_scope_state { | |||
465 | }; | 483 | }; |
466 | 484 | ||
467 | struct acpi_pscope_state { | 485 | struct acpi_pscope_state { |
468 | ACPI_STATE_COMMON union acpi_parse_object *op; /* Current op being parsed */ | 486 | ACPI_STATE_COMMON u32 arg_count; /* Number of fixed arguments */ |
487 | union acpi_parse_object *op; /* Current op being parsed */ | ||
469 | u8 *arg_end; /* Current argument end */ | 488 | u8 *arg_end; /* Current argument end */ |
470 | u8 *pkg_end; /* Current package end */ | 489 | u8 *pkg_end; /* Current package end */ |
471 | u32 arg_list; /* Next argument to parse */ | 490 | u32 arg_list; /* Next argument to parse */ |
472 | u32 arg_count; /* Number of fixed arguments */ | ||
473 | }; | 491 | }; |
474 | 492 | ||
475 | /* | 493 | /* |
@@ -477,10 +495,10 @@ struct acpi_pscope_state { | |||
477 | * states are created when there are nested control methods executing. | 495 | * states are created when there are nested control methods executing. |
478 | */ | 496 | */ |
479 | struct acpi_thread_state { | 497 | struct acpi_thread_state { |
480 | ACPI_STATE_COMMON struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ | 498 | ACPI_STATE_COMMON u8 current_sync_level; /* Mutex Sync (nested acquire) level */ |
499 | struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ | ||
481 | union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ | 500 | union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ |
482 | u32 thread_id; /* Running thread ID */ | 501 | acpi_thread_id thread_id; /* Running thread ID */ |
483 | u8 current_sync_level; /* Mutex Sync (nested acquire) level */ | ||
484 | }; | 502 | }; |
485 | 503 | ||
486 | /* | 504 | /* |
@@ -488,10 +506,9 @@ struct acpi_thread_state { | |||
488 | * AML arguments | 506 | * AML arguments |
489 | */ | 507 | */ |
490 | struct acpi_result_values { | 508 | struct acpi_result_values { |
491 | ACPI_STATE_COMMON | 509 | ACPI_STATE_COMMON u8 num_results; |
492 | union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS]; | ||
493 | u8 num_results; | ||
494 | u8 last_insert; | 510 | u8 last_insert; |
511 | union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS]; | ||
495 | }; | 512 | }; |
496 | 513 | ||
497 | typedef | 514 | typedef |
@@ -546,7 +563,7 @@ struct acpi_opcode_info { | |||
546 | #endif | 563 | #endif |
547 | u32 parse_args; /* Grammar/Parse time arguments */ | 564 | u32 parse_args; /* Grammar/Parse time arguments */ |
548 | u32 runtime_args; /* Interpret time arguments */ | 565 | u32 runtime_args; /* Interpret time arguments */ |
549 | u32 flags; /* Misc flags */ | 566 | u16 flags; /* Misc flags */ |
550 | u8 object_type; /* Corresponding internal object type */ | 567 | u8 object_type; /* Corresponding internal object type */ |
551 | u8 class; /* Opcode class */ | 568 | u8 class; /* Opcode class */ |
552 | u8 type; /* Opcode type */ | 569 | u8 type; /* Opcode type */ |
@@ -563,29 +580,31 @@ union acpi_parse_value { | |||
563 | }; | 580 | }; |
564 | 581 | ||
565 | #define ACPI_PARSE_COMMON \ | 582 | #define ACPI_PARSE_COMMON \ |
566 | u8 data_type; /* To differentiate various internal objs */\ | 583 | union acpi_parse_object *parent; /* Parent op */\ |
567 | u8 flags; /* Type of Op */\ | 584 | u8 descriptor_type; /* To differentiate various internal objs */\ |
568 | u16 aml_opcode; /* AML opcode */\ | 585 | u8 flags; /* Type of Op */\ |
569 | u32 aml_offset; /* Offset of declaration in AML */\ | 586 | u16 aml_opcode; /* AML opcode */\ |
570 | union acpi_parse_object *parent; /* Parent op */\ | 587 | u32 aml_offset; /* Offset of declaration in AML */\ |
571 | union acpi_parse_object *next; /* Next op */\ | 588 | union acpi_parse_object *next; /* Next op */\ |
589 | struct acpi_namespace_node *node; /* For use by interpreter */\ | ||
590 | union acpi_parse_value value; /* Value or args associated with the opcode */\ | ||
572 | ACPI_DISASM_ONLY_MEMBERS (\ | 591 | ACPI_DISASM_ONLY_MEMBERS (\ |
573 | u8 disasm_flags; /* Used during AML disassembly */\ | 592 | u8 disasm_flags; /* Used during AML disassembly */\ |
574 | u8 disasm_opcode; /* Subtype used for disassembly */\ | 593 | u8 disasm_opcode; /* Subtype used for disassembly */\ |
575 | char aml_op_name[16]) /* Op name (debug only) */\ | 594 | char aml_op_name[16]) /* Op name (debug only) */ |
576 | /* NON-DEBUG members below: */\ | 595 | |
577 | struct acpi_namespace_node *node; /* For use by interpreter */\ | 596 | #define ACPI_DASM_BUFFER 0x00 |
578 | union acpi_parse_value value; /* Value or args associated with the opcode */ | 597 | #define ACPI_DASM_RESOURCE 0x01 |
579 | 598 | #define ACPI_DASM_STRING 0x02 | |
580 | #define ACPI_DASM_BUFFER 0x00 | 599 | #define ACPI_DASM_UNICODE 0x03 |
581 | #define ACPI_DASM_RESOURCE 0x01 | 600 | #define ACPI_DASM_EISAID 0x04 |
582 | #define ACPI_DASM_STRING 0x02 | 601 | #define ACPI_DASM_MATCHOP 0x05 |
583 | #define ACPI_DASM_UNICODE 0x03 | 602 | #define ACPI_DASM_LNOT_PREFIX 0x06 |
584 | #define ACPI_DASM_EISAID 0x04 | 603 | #define ACPI_DASM_LNOT_SUFFIX 0x07 |
585 | #define ACPI_DASM_MATCHOP 0x05 | 604 | #define ACPI_DASM_IGNORE 0x08 |
586 | 605 | ||
587 | /* | 606 | /* |
588 | * generic operation (for example: If, While, Store) | 607 | * Generic operation (for example: If, While, Store) |
589 | */ | 608 | */ |
590 | struct acpi_parse_obj_common { | 609 | struct acpi_parse_obj_common { |
591 | ACPI_PARSE_COMMON}; | 610 | ACPI_PARSE_COMMON}; |
@@ -601,7 +620,7 @@ struct acpi_parse_obj_named { | |||
601 | u32 name; /* 4-byte name or zero if no name */ | 620 | u32 name; /* 4-byte name or zero if no name */ |
602 | }; | 621 | }; |
603 | 622 | ||
604 | /* The parse node is the fundamental element of the parse tree */ | 623 | /* This version is used by the i_aSL compiler only */ |
605 | 624 | ||
606 | #define ACPI_MAX_PARSEOP_NAME 20 | 625 | #define ACPI_MAX_PARSEOP_NAME 20 |
607 | 626 | ||
@@ -643,7 +662,6 @@ union acpi_parse_object { | |||
643 | * method. | 662 | * method. |
644 | */ | 663 | */ |
645 | struct acpi_parse_state { | 664 | struct acpi_parse_state { |
646 | u32 aml_size; | ||
647 | u8 *aml_start; /* First AML byte */ | 665 | u8 *aml_start; /* First AML byte */ |
648 | u8 *aml; /* Next AML byte */ | 666 | u8 *aml; /* Next AML byte */ |
649 | u8 *aml_end; /* (last + 1) AML byte */ | 667 | u8 *aml_end; /* (last + 1) AML byte */ |
@@ -653,22 +671,23 @@ struct acpi_parse_state { | |||
653 | struct acpi_namespace_node *start_node; | 671 | struct acpi_namespace_node *start_node; |
654 | union acpi_generic_state *scope; /* Current scope */ | 672 | union acpi_generic_state *scope; /* Current scope */ |
655 | union acpi_parse_object *start_scope; | 673 | union acpi_parse_object *start_scope; |
674 | u32 aml_size; | ||
656 | }; | 675 | }; |
657 | 676 | ||
658 | /* Parse object flags */ | 677 | /* Parse object flags */ |
659 | 678 | ||
660 | #define ACPI_PARSEOP_GENERIC 0x01 | 679 | #define ACPI_PARSEOP_GENERIC 0x01 |
661 | #define ACPI_PARSEOP_NAMED 0x02 | 680 | #define ACPI_PARSEOP_NAMED 0x02 |
662 | #define ACPI_PARSEOP_DEFERRED 0x04 | 681 | #define ACPI_PARSEOP_DEFERRED 0x04 |
663 | #define ACPI_PARSEOP_BYTELIST 0x08 | 682 | #define ACPI_PARSEOP_BYTELIST 0x08 |
664 | #define ACPI_PARSEOP_IN_CACHE 0x80 | 683 | #define ACPI_PARSEOP_IN_CACHE 0x80 |
665 | 684 | ||
666 | /* Parse object disasm_flags */ | 685 | /* Parse object disasm_flags */ |
667 | 686 | ||
668 | #define ACPI_PARSEOP_IGNORE 0x01 | 687 | #define ACPI_PARSEOP_IGNORE 0x01 |
669 | #define ACPI_PARSEOP_PARAMLIST 0x02 | 688 | #define ACPI_PARSEOP_PARAMLIST 0x02 |
670 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 | 689 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 |
671 | #define ACPI_PARSEOP_SPECIAL 0x10 | 690 | #define ACPI_PARSEOP_SPECIAL 0x10 |
672 | 691 | ||
673 | /***************************************************************************** | 692 | /***************************************************************************** |
674 | * | 693 | * |
@@ -676,8 +695,8 @@ struct acpi_parse_state { | |||
676 | * | 695 | * |
677 | ****************************************************************************/ | 696 | ****************************************************************************/ |
678 | 697 | ||
679 | #define PCI_ROOT_HID_STRING "PNP0A03" | 698 | #define PCI_ROOT_HID_STRING "PNP0A03" |
680 | #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" | 699 | #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" |
681 | 700 | ||
682 | struct acpi_bit_register_info { | 701 | struct acpi_bit_register_info { |
683 | u8 parent_register; | 702 | u8 parent_register; |
@@ -710,13 +729,14 @@ struct acpi_bit_register_info { | |||
710 | #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ | 729 | #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ |
711 | #define ACPI_BITMASK_WAKE_STATUS 0x8000 | 730 | #define ACPI_BITMASK_WAKE_STATUS 0x8000 |
712 | 731 | ||
713 | #define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ | 732 | #define ACPI_BITMASK_ALL_FIXED_STATUS (\ |
714 | ACPI_BITMASK_BUS_MASTER_STATUS | \ | 733 | ACPI_BITMASK_TIMER_STATUS | \ |
715 | ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ | 734 | ACPI_BITMASK_BUS_MASTER_STATUS | \ |
716 | ACPI_BITMASK_POWER_BUTTON_STATUS | \ | 735 | ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ |
717 | ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ | 736 | ACPI_BITMASK_POWER_BUTTON_STATUS | \ |
718 | ACPI_BITMASK_RT_CLOCK_STATUS | \ | 737 | ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ |
719 | ACPI_BITMASK_WAKE_STATUS) | 738 | ACPI_BITMASK_RT_CLOCK_STATUS | \ |
739 | ACPI_BITMASK_WAKE_STATUS) | ||
720 | 740 | ||
721 | #define ACPI_BITMASK_TIMER_ENABLE 0x0001 | 741 | #define ACPI_BITMASK_TIMER_ENABLE 0x0001 |
722 | #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 | 742 | #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 |
@@ -820,7 +840,7 @@ struct acpi_bit_register_info { | |||
820 | * | 840 | * |
821 | ****************************************************************************/ | 841 | ****************************************************************************/ |
822 | 842 | ||
823 | #define ACPI_ASCII_ZERO 0x30 | 843 | #define ACPI_ASCII_ZERO 0x30 |
824 | 844 | ||
825 | /***************************************************************************** | 845 | /***************************************************************************** |
826 | * | 846 | * |
@@ -842,9 +862,9 @@ struct acpi_integrity_info { | |||
842 | u32 objects; | 862 | u32 objects; |
843 | }; | 863 | }; |
844 | 864 | ||
845 | #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 | 865 | #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 |
846 | #define ACPI_DB_CONSOLE_OUTPUT 0x02 | 866 | #define ACPI_DB_CONSOLE_OUTPUT 0x02 |
847 | #define ACPI_DB_DUPLICATE_OUTPUT 0x03 | 867 | #define ACPI_DB_DUPLICATE_OUTPUT 0x03 |
848 | 868 | ||
849 | /***************************************************************************** | 869 | /***************************************************************************** |
850 | * | 870 | * |
@@ -854,18 +874,18 @@ struct acpi_integrity_info { | |||
854 | 874 | ||
855 | /* Entry for a memory allocation (debug only) */ | 875 | /* Entry for a memory allocation (debug only) */ |
856 | 876 | ||
857 | #define ACPI_MEM_MALLOC 0 | 877 | #define ACPI_MEM_MALLOC 0 |
858 | #define ACPI_MEM_CALLOC 1 | 878 | #define ACPI_MEM_CALLOC 1 |
859 | #define ACPI_MAX_MODULE_NAME 16 | 879 | #define ACPI_MAX_MODULE_NAME 16 |
860 | 880 | ||
861 | #define ACPI_COMMON_DEBUG_MEM_HEADER \ | 881 | #define ACPI_COMMON_DEBUG_MEM_HEADER \ |
862 | struct acpi_debug_mem_block *previous; \ | 882 | struct acpi_debug_mem_block *previous; \ |
863 | struct acpi_debug_mem_block *next; \ | 883 | struct acpi_debug_mem_block *next; \ |
864 | u32 size; \ | 884 | u32 size; \ |
865 | u32 component; \ | 885 | u32 component; \ |
866 | u32 line; \ | 886 | u32 line; \ |
867 | char module[ACPI_MAX_MODULE_NAME]; \ | 887 | char module[ACPI_MAX_MODULE_NAME]; \ |
868 | u8 alloc_type; | 888 | u8 alloc_type; |
869 | 889 | ||
870 | struct acpi_debug_mem_header { | 890 | struct acpi_debug_mem_header { |
871 | ACPI_COMMON_DEBUG_MEM_HEADER}; | 891 | ACPI_COMMON_DEBUG_MEM_HEADER}; |
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index f2be2a881730..38f9aa4bef00 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -56,6 +56,10 @@ | |||
56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) | 56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) |
57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) | 57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) |
58 | 58 | ||
59 | /* Size calculation */ | ||
60 | |||
61 | #define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) | ||
62 | |||
59 | #if ACPI_MACHINE_WIDTH == 16 | 63 | #if ACPI_MACHINE_WIDTH == 16 |
60 | 64 | ||
61 | /* | 65 | /* |
@@ -99,7 +103,7 @@ | |||
99 | * printf() format helpers | 103 | * printf() format helpers |
100 | */ | 104 | */ |
101 | 105 | ||
102 | /* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ | 106 | /* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */ |
103 | 107 | ||
104 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) | 108 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) |
105 | 109 | ||
@@ -130,7 +134,6 @@ | |||
130 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) | 134 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) |
131 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) | 135 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) |
132 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) | 136 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) |
133 | #define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) | ||
134 | 137 | ||
135 | #if ACPI_MACHINE_WIDTH == 16 | 138 | #if ACPI_MACHINE_WIDTH == 16 |
136 | #define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) | 139 | #define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) |
@@ -141,6 +144,12 @@ | |||
141 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) | 144 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) |
142 | #endif | 145 | #endif |
143 | 146 | ||
147 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | ||
148 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b))) | ||
149 | #else | ||
150 | #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char,(a)), ACPI_CAST_PTR (char,(b)), ACPI_NAME_SIZE)) | ||
151 | #endif | ||
152 | |||
144 | /* | 153 | /* |
145 | * Macros for moving data around to/from buffers that are possibly unaligned. | 154 | * Macros for moving data around to/from buffers that are possibly unaligned. |
146 | * If the hardware supports the transfer of unaligned data, just do the store. | 155 | * If the hardware supports the transfer of unaligned data, just do the store. |
@@ -341,29 +350,33 @@ | |||
341 | /* | 350 | /* |
342 | * Rounding macros (Power of two boundaries only) | 351 | * Rounding macros (Power of two boundaries only) |
343 | */ | 352 | */ |
344 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ | 353 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ |
345 | (~(((acpi_native_uint) boundary)-1))) | 354 | (~(((acpi_native_uint) boundary)-1))) |
346 | 355 | ||
347 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ | 356 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ |
348 | (((acpi_native_uint) boundary)-1)) & \ | 357 | (((acpi_native_uint) boundary)-1)) & \ |
349 | (~(((acpi_native_uint) boundary)-1))) | 358 | (~(((acpi_native_uint) boundary)-1))) |
350 | 359 | ||
351 | #define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) | 360 | /* Note: sizeof(acpi_native_uint) evaluates to either 2, 4, or 8 */ |
352 | #define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) | 361 | |
353 | #define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY) | 362 | #define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4) |
363 | #define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8) | ||
364 | #define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_native_uint)) | ||
354 | 365 | ||
355 | #define ACPI_ROUND_UP_to_32_bITS(a) ACPI_ROUND_UP(a,4) | 366 | #define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4) |
356 | #define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) | 367 | #define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8) |
357 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) | 368 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_native_uint)) |
358 | 369 | ||
359 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) | 370 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) |
360 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) | 371 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) |
361 | 372 | ||
362 | #define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) | 373 | #define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) |
363 | 374 | ||
364 | /* Generic (non-power-of-two) rounding */ | 375 | /* Generic (non-power-of-two) rounding */ |
365 | 376 | ||
366 | #define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) | 377 | #define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) |
378 | |||
379 | #define ACPI_IS_MISALIGNED(value) (((acpi_native_uint)value) & (sizeof(acpi_native_uint)-1)) | ||
367 | 380 | ||
368 | /* | 381 | /* |
369 | * Bitmask creation | 382 | * Bitmask creation |
@@ -371,10 +384,10 @@ | |||
371 | * MASK_BITS_ABOVE creates a mask starting AT the position and above | 384 | * MASK_BITS_ABOVE creates a mask starting AT the position and above |
372 | * MASK_BITS_BELOW creates a mask starting one bit BELOW the position | 385 | * MASK_BITS_BELOW creates a mask starting one bit BELOW the position |
373 | */ | 386 | */ |
374 | #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) | 387 | #define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((u32) (position)))) |
375 | #define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) | 388 | #define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((u32) (position))) |
376 | 389 | ||
377 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) | 390 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) |
378 | 391 | ||
379 | /* Bitfields within ACPI registers */ | 392 | /* Bitfields within ACPI registers */ |
380 | 393 | ||
@@ -396,8 +409,8 @@ | |||
396 | * | 409 | * |
397 | * The "Descriptor" field is the first field in both structures. | 410 | * The "Descriptor" field is the first field in both structures. |
398 | */ | 411 | */ |
399 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) | 412 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type) |
400 | #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) | 413 | #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t) |
401 | 414 | ||
402 | /* Macro to test the object type */ | 415 | /* Macro to test the object type */ |
403 | 416 | ||
@@ -486,7 +499,6 @@ | |||
486 | #define ACPI_ERROR(plist) | 499 | #define ACPI_ERROR(plist) |
487 | #define ACPI_ERROR_NAMESPACE(s,e) | 500 | #define ACPI_ERROR_NAMESPACE(s,e) |
488 | #define ACPI_ERROR_METHOD(s,n,p,e) | 501 | #define ACPI_ERROR_METHOD(s,n,p,e) |
489 | |||
490 | #endif | 502 | #endif |
491 | 503 | ||
492 | /* | 504 | /* |
@@ -514,12 +526,12 @@ | |||
514 | #define ACPI_GET_FUNCTION_NAME _acpi_function_name | 526 | #define ACPI_GET_FUNCTION_NAME _acpi_function_name |
515 | /* | 527 | /* |
516 | * The Name parameter should be the procedure name as a quoted string. | 528 | * The Name parameter should be the procedure name as a quoted string. |
517 | * This is declared as a local string ("my_function_name") so that it can | 529 | * This is declared as a local string ("MyFunctionName") so that it can |
518 | * be also used by the function exit macros below. | 530 | * be also used by the function exit macros below. |
519 | * Note: (const char) is used to be compatible with the debug interfaces | 531 | * Note: (const char) is used to be compatible with the debug interfaces |
520 | * and macros such as __FUNCTION__. | 532 | * and macros such as __FUNCTION__. |
521 | */ | 533 | */ |
522 | #define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = name; | 534 | #define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = #name; |
523 | 535 | ||
524 | #else | 536 | #else |
525 | /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ | 537 | /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ |
@@ -528,13 +540,13 @@ | |||
528 | #endif | 540 | #endif |
529 | 541 | ||
530 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ | 542 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ |
531 | acpi_ut_trace(ACPI_DEBUG_PARAMETERS) | 543 | acpi_ut_trace(ACPI_DEBUG_PARAMETERS) |
532 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ | 544 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ |
533 | acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) | 545 | acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) |
534 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ | 546 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ |
535 | acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) | 547 | acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) |
536 | #define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ | 548 | #define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ |
537 | acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) | 549 | acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) |
538 | 550 | ||
539 | #define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() | 551 | #define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() |
540 | 552 | ||
@@ -543,7 +555,7 @@ | |||
543 | * WARNING: These macros include a return statement. This is usually considered | 555 | * WARNING: These macros include a return statement. This is usually considered |
544 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. | 556 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. |
545 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros | 557 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros |
546 | * so that "_acpi_function_name" is defined. | 558 | * so that "_AcpiFunctionName" is defined. |
547 | * | 559 | * |
548 | * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining | 560 | * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining |
549 | * about these constructs. | 561 | * about these constructs. |
@@ -654,6 +666,7 @@ | |||
654 | #define ACPI_DUMP_STACK_ENTRY(a) | 666 | #define ACPI_DUMP_STACK_ENTRY(a) |
655 | #define ACPI_DUMP_OPERANDS(a,b,c,d,e) | 667 | #define ACPI_DUMP_OPERANDS(a,b,c,d,e) |
656 | #define ACPI_DUMP_ENTRY(a,b) | 668 | #define ACPI_DUMP_ENTRY(a,b) |
669 | #define ACPI_DUMP_TABLES(a,b) | ||
657 | #define ACPI_DUMP_PATHNAME(a,b,c,d) | 670 | #define ACPI_DUMP_PATHNAME(a,b,c,d) |
658 | #define ACPI_DUMP_RESOURCE_LIST(a) | 671 | #define ACPI_DUMP_RESOURCE_LIST(a) |
659 | #define ACPI_DUMP_BUFFER(a,b) | 672 | #define ACPI_DUMP_BUFFER(a,b) |
@@ -709,19 +722,19 @@ | |||
709 | 722 | ||
710 | /* Memory allocation */ | 723 | /* Memory allocation */ |
711 | 724 | ||
712 | #define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) | 725 | #define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) |
713 | #define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) | 726 | #define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) |
714 | #define ACPI_MEM_FREE(a) acpi_os_free(a) | 727 | #define ACPI_FREE(a) acpi_os_free(a) |
715 | #define ACPI_MEM_TRACKING(a) | 728 | #define ACPI_MEM_TRACKING(a) |
716 | 729 | ||
717 | #else | 730 | #else |
718 | 731 | ||
719 | /* Memory allocation */ | 732 | /* Memory allocation */ |
720 | 733 | ||
721 | #define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) | 734 | #define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) |
722 | #define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) | 735 | #define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) |
723 | #define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) | 736 | #define ACPI_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) |
724 | #define ACPI_MEM_TRACKING(a) a | 737 | #define ACPI_MEM_TRACKING(a) a |
725 | 738 | ||
726 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ | 739 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ |
727 | 740 | ||
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index b667a804fc8a..83b52f9f899a 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h | |||
@@ -63,6 +63,8 @@ | |||
63 | #define ACPI_NS_DONT_OPEN_SCOPE 0x02 | 63 | #define ACPI_NS_DONT_OPEN_SCOPE 0x02 |
64 | #define ACPI_NS_NO_PEER_SEARCH 0x04 | 64 | #define ACPI_NS_NO_PEER_SEARCH 0x04 |
65 | #define ACPI_NS_ERROR_IF_FOUND 0x08 | 65 | #define ACPI_NS_ERROR_IF_FOUND 0x08 |
66 | #define ACPI_NS_PREFIX_IS_SCOPE 0x10 | ||
67 | #define ACPI_NS_EXTERNAL 0x20 | ||
66 | 68 | ||
67 | #define ACPI_NS_WALK_UNLOCK TRUE | 69 | #define ACPI_NS_WALK_UNLOCK TRUE |
68 | #define ACPI_NS_WALK_NO_UNLOCK FALSE | 70 | #define ACPI_NS_WALK_NO_UNLOCK FALSE |
@@ -171,19 +173,17 @@ acpi_ns_dump_objects(acpi_object_type type, | |||
171 | /* | 173 | /* |
172 | * nseval - Namespace evaluation functions | 174 | * nseval - Namespace evaluation functions |
173 | */ | 175 | */ |
174 | acpi_status acpi_ns_evaluate_by_handle(struct acpi_parameter_info *info); | 176 | acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info); |
175 | |||
176 | acpi_status | ||
177 | acpi_ns_evaluate_by_name(char *pathname, struct acpi_parameter_info *info); | ||
178 | |||
179 | acpi_status | ||
180 | acpi_ns_evaluate_relative(char *pathname, struct acpi_parameter_info *info); | ||
181 | 177 | ||
182 | /* | 178 | /* |
183 | * nsnames - Name and Scope manipulation | 179 | * nsnames - Name and Scope manipulation |
184 | */ | 180 | */ |
185 | u32 acpi_ns_opens_scope(acpi_object_type type); | 181 | u32 acpi_ns_opens_scope(acpi_object_type type); |
186 | 182 | ||
183 | void | ||
184 | acpi_ns_build_external_path(struct acpi_namespace_node *node, | ||
185 | acpi_size size, char *name_buffer); | ||
186 | |||
187 | char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node); | 187 | char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node); |
188 | 188 | ||
189 | char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state); | 189 | char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state); |
@@ -196,9 +196,9 @@ u8 | |||
196 | acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for); | 196 | acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for); |
197 | 197 | ||
198 | acpi_status | 198 | acpi_status |
199 | acpi_ns_get_node_by_path(char *external_pathname, | 199 | acpi_ns_get_node(struct acpi_namespace_node *prefix_node, |
200 | struct acpi_namespace_node *in_prefix_node, | 200 | char *external_pathname, |
201 | u32 flags, struct acpi_namespace_node **out_node); | 201 | u32 flags, struct acpi_namespace_node **out_node); |
202 | 202 | ||
203 | acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node); | 203 | acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node); |
204 | 204 | ||
@@ -241,10 +241,10 @@ acpi_ns_search_and_enter(u32 entry_name, | |||
241 | u32 flags, struct acpi_namespace_node **ret_node); | 241 | u32 flags, struct acpi_namespace_node **ret_node); |
242 | 242 | ||
243 | acpi_status | 243 | acpi_status |
244 | acpi_ns_search_node(u32 entry_name, | 244 | acpi_ns_search_one_scope(u32 entry_name, |
245 | struct acpi_namespace_node *node, | 245 | struct acpi_namespace_node *node, |
246 | acpi_object_type type, | 246 | acpi_object_type type, |
247 | struct acpi_namespace_node **ret_node); | 247 | struct acpi_namespace_node **ret_node); |
248 | 248 | ||
249 | void | 249 | void |
250 | acpi_ns_install_node(struct acpi_walk_state *walk_state, | 250 | acpi_ns_install_node(struct acpi_walk_state *walk_state, |
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index d130cfed8d55..1747d94084d8 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h | |||
@@ -1,7 +1,7 @@ | |||
1 | 1 | ||
2 | /****************************************************************************** | 2 | /****************************************************************************** |
3 | * | 3 | * |
4 | * Name: acobject.h - Definition of union acpi_operand_object (Internal object only) | 4 | * Name: acobject.h - Definition of union acpi_operand_object (Internal object only) |
5 | * | 5 | * |
6 | *****************************************************************************/ | 6 | *****************************************************************************/ |
7 | 7 | ||
@@ -45,10 +45,12 @@ | |||
45 | #ifndef _ACOBJECT_H | 45 | #ifndef _ACOBJECT_H |
46 | #define _ACOBJECT_H | 46 | #define _ACOBJECT_H |
47 | 47 | ||
48 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
49 | |||
48 | /* | 50 | /* |
49 | * The union acpi_operand_object is used to pass AML operands from the dispatcher | 51 | * The union acpi_operand_object is used to pass AML operands from the dispatcher |
50 | * to the interpreter, and to keep track of the various handlers such as | 52 | * to the interpreter, and to keep track of the various handlers such as |
51 | * address space handlers and notify handlers. The object is a constant | 53 | * address space handlers and notify handlers. The object is a constant |
52 | * size in order to allow it to be cached and reused. | 54 | * size in order to allow it to be cached and reused. |
53 | */ | 55 | */ |
54 | 56 | ||
@@ -61,17 +63,25 @@ | |||
61 | /* | 63 | /* |
62 | * Common area for all objects. | 64 | * Common area for all objects. |
63 | * | 65 | * |
64 | * data_type is used to differentiate between internal descriptors, and MUST | 66 | * descriptor_type is used to differentiate between internal descriptors, and |
65 | * be the first byte in this structure. | 67 | * must be in the same place across all descriptors |
68 | * | ||
69 | * Note: The descriptor_type and Type fields must appear in the identical | ||
70 | * position in both the struct acpi_namespace_node and union acpi_operand_object | ||
71 | * structures. | ||
66 | */ | 72 | */ |
67 | #define ACPI_OBJECT_COMMON_HEADER /* SIZE/ALIGNMENT: 32 bits, one ptr plus trailing 8-bit flag */\ | 73 | #define ACPI_OBJECT_COMMON_HEADER \ |
68 | u8 descriptor; /* To differentiate various internal objs */\ | 74 | union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ |
69 | u8 type; /* acpi_object_type */\ | 75 | u8 descriptor_type; /* To differentiate various internal objs */\ |
70 | u16 reference_count; /* For object deletion management */\ | 76 | u8 type; /* acpi_object_type */\ |
71 | union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ | 77 | u16 reference_count; /* For object deletion management */\ |
72 | u8 flags; | 78 | u8 flags; |
73 | 79 | /* | |
74 | /* Values for flag byte above */ | 80 | * Note: There are 3 bytes available here before the |
81 | * next natural alignment boundary (for both 32/64 cases) | ||
82 | */ | ||
83 | |||
84 | /* Values for Flag byte above */ | ||
75 | 85 | ||
76 | #define AOPOBJ_AML_CONSTANT 0x01 | 86 | #define AOPOBJ_AML_CONSTANT 0x01 |
77 | #define AOPOBJ_STATIC_POINTER 0x02 | 87 | #define AOPOBJ_STATIC_POINTER 0x02 |
@@ -79,36 +89,7 @@ | |||
79 | #define AOPOBJ_OBJECT_INITIALIZED 0x08 | 89 | #define AOPOBJ_OBJECT_INITIALIZED 0x08 |
80 | #define AOPOBJ_SETUP_COMPLETE 0x10 | 90 | #define AOPOBJ_SETUP_COMPLETE 0x10 |
81 | #define AOPOBJ_SINGLE_DATUM 0x20 | 91 | #define AOPOBJ_SINGLE_DATUM 0x20 |
82 | 92 | #define AOPOBJ_INVALID 0x40 /* Used if host OS won't allow an op_region address */ | |
83 | /* | ||
84 | * Common bitfield for the field objects | ||
85 | * "Field Datum" -- a datum from the actual field object | ||
86 | * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field | ||
87 | */ | ||
88 | #define ACPI_COMMON_FIELD_INFO /* SIZE/ALIGNMENT: 24 bits + three 32-bit values */\ | ||
89 | u8 field_flags; /* Access, update, and lock bits */\ | ||
90 | u8 attribute; /* From access_as keyword */\ | ||
91 | u8 access_byte_width; /* Read/Write size in bytes */\ | ||
92 | u32 bit_length; /* Length of field in bits */\ | ||
93 | u32 base_byte_offset; /* Byte offset within containing object */\ | ||
94 | u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ | ||
95 | u8 access_bit_width; /* Read/Write size in bits (8-64) */\ | ||
96 | u32 value; /* Value to store into the Bank or Index register */\ | ||
97 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
98 | |||
99 | /* | ||
100 | * Fields common to both Strings and Buffers | ||
101 | */ | ||
102 | #define ACPI_COMMON_BUFFER_INFO \ | ||
103 | u32 length; | ||
104 | |||
105 | /* | ||
106 | * Common fields for objects that support ASL notifications | ||
107 | */ | ||
108 | #define ACPI_COMMON_NOTIFY_INFO \ | ||
109 | union acpi_operand_object *system_notify; /* Handler for system notifies */\ | ||
110 | union acpi_operand_object *device_notify; /* Handler for driver notifies */\ | ||
111 | union acpi_operand_object *handler; /* Handler for Address space */ | ||
112 | 93 | ||
113 | /****************************************************************************** | 94 | /****************************************************************************** |
114 | * | 95 | * |
@@ -125,25 +106,31 @@ struct acpi_object_integer { | |||
125 | 106 | ||
126 | /* | 107 | /* |
127 | * Note: The String and Buffer object must be identical through the Pointer | 108 | * Note: The String and Buffer object must be identical through the Pointer |
128 | * element. There is code that depends on this. | 109 | * and length elements. There is code that depends on this. |
110 | * | ||
111 | * Fields common to both Strings and Buffers | ||
129 | */ | 112 | */ |
113 | #define ACPI_COMMON_BUFFER_INFO(_type) \ | ||
114 | _type *pointer; \ | ||
115 | u32 length; | ||
116 | |||
130 | struct acpi_object_string { /* Null terminated, ASCII characters only */ | 117 | struct acpi_object_string { /* Null terminated, ASCII characters only */ |
131 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO char *pointer; /* String in AML stream or allocated string */ | 118 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(char) /* String in AML stream or allocated string */ |
132 | }; | 119 | }; |
133 | 120 | ||
134 | struct acpi_object_buffer { | 121 | struct acpi_object_buffer { |
135 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO u8 * pointer; /* Buffer in AML stream or allocated buffer */ | 122 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(u8) /* Buffer in AML stream or allocated buffer */ |
136 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
137 | u8 *aml_start; | ||
138 | u32 aml_length; | 123 | u32 aml_length; |
124 | u8 *aml_start; | ||
125 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
139 | }; | 126 | }; |
140 | 127 | ||
141 | struct acpi_object_package { | 128 | struct acpi_object_package { |
142 | ACPI_OBJECT_COMMON_HEADER u32 count; /* # of elements in package */ | 129 | ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Link back to parent node */ |
143 | u32 aml_length; | ||
144 | u8 *aml_start; | ||
145 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
146 | union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ | 130 | union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ |
131 | u8 *aml_start; | ||
132 | u32 aml_length; | ||
133 | u32 count; /* # of elements in package */ | ||
147 | }; | 134 | }; |
148 | 135 | ||
149 | /****************************************************************************** | 136 | /****************************************************************************** |
@@ -156,23 +143,6 @@ struct acpi_object_event { | |||
156 | ACPI_OBJECT_COMMON_HEADER void *semaphore; | 143 | ACPI_OBJECT_COMMON_HEADER void *semaphore; |
157 | }; | 144 | }; |
158 | 145 | ||
159 | #define ACPI_INFINITE_CONCURRENCY 0xFF | ||
160 | |||
161 | typedef | ||
162 | acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); | ||
163 | |||
164 | struct acpi_object_method { | ||
165 | ACPI_OBJECT_COMMON_HEADER u8 method_flags; | ||
166 | u8 param_count; | ||
167 | u32 aml_length; | ||
168 | void *semaphore; | ||
169 | u8 *aml_start; | ||
170 | ACPI_INTERNAL_METHOD implementation; | ||
171 | u8 concurrency; | ||
172 | u8 thread_count; | ||
173 | acpi_owner_id owner_id; | ||
174 | }; | ||
175 | |||
176 | struct acpi_object_mutex { | 146 | struct acpi_object_mutex { |
177 | ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ | 147 | ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ |
178 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ | 148 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ |
@@ -186,11 +156,23 @@ struct acpi_object_mutex { | |||
186 | 156 | ||
187 | struct acpi_object_region { | 157 | struct acpi_object_region { |
188 | ACPI_OBJECT_COMMON_HEADER u8 space_id; | 158 | ACPI_OBJECT_COMMON_HEADER u8 space_id; |
189 | union acpi_operand_object *handler; /* Handler for region access */ | ||
190 | struct acpi_namespace_node *node; /* Containing namespace node */ | 159 | struct acpi_namespace_node *node; /* Containing namespace node */ |
160 | union acpi_operand_object *handler; /* Handler for region access */ | ||
191 | union acpi_operand_object *next; | 161 | union acpi_operand_object *next; |
192 | u32 length; | ||
193 | acpi_physical_address address; | 162 | acpi_physical_address address; |
163 | u32 length; | ||
164 | }; | ||
165 | |||
166 | struct acpi_object_method { | ||
167 | ACPI_OBJECT_COMMON_HEADER u8 method_flags; | ||
168 | u8 param_count; | ||
169 | u8 concurrency; | ||
170 | void *semaphore; | ||
171 | u8 *aml_start; | ||
172 | ACPI_INTERNAL_METHOD implementation; | ||
173 | u32 aml_length; | ||
174 | u8 thread_count; | ||
175 | acpi_owner_id owner_id; | ||
194 | }; | 176 | }; |
195 | 177 | ||
196 | /****************************************************************************** | 178 | /****************************************************************************** |
@@ -199,6 +181,14 @@ struct acpi_object_region { | |||
199 | * | 181 | * |
200 | *****************************************************************************/ | 182 | *****************************************************************************/ |
201 | 183 | ||
184 | /* | ||
185 | * Common fields for objects that support ASL notifications | ||
186 | */ | ||
187 | #define ACPI_COMMON_NOTIFY_INFO \ | ||
188 | union acpi_operand_object *system_notify; /* Handler for system notifies */\ | ||
189 | union acpi_operand_object *device_notify; /* Handler for driver notifies */\ | ||
190 | union acpi_operand_object *handler; /* Handler for Address space */ | ||
191 | |||
202 | struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ | 192 | struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ |
203 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; | 193 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; |
204 | 194 | ||
@@ -213,9 +203,9 @@ struct acpi_object_power_resource { | |||
213 | }; | 203 | }; |
214 | 204 | ||
215 | struct acpi_object_processor { | 205 | struct acpi_object_processor { |
216 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 proc_id; | 206 | ACPI_OBJECT_COMMON_HEADER u8 proc_id; |
217 | u32 length; | 207 | u8 length; |
218 | acpi_io_address address; | 208 | ACPI_COMMON_NOTIFY_INFO acpi_io_address address; |
219 | }; | 209 | }; |
220 | 210 | ||
221 | struct acpi_object_thermal_zone { | 211 | struct acpi_object_thermal_zone { |
@@ -227,9 +217,24 @@ ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; | |||
227 | * | 217 | * |
228 | *****************************************************************************/ | 218 | *****************************************************************************/ |
229 | 219 | ||
220 | /* | ||
221 | * Common bitfield for the field objects | ||
222 | * "Field Datum" -- a datum from the actual field object | ||
223 | * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field | ||
224 | */ | ||
225 | #define ACPI_COMMON_FIELD_INFO \ | ||
226 | u8 field_flags; /* Access, update, and lock bits */\ | ||
227 | u8 attribute; /* From access_as keyword */\ | ||
228 | u8 access_byte_width; /* Read/Write size in bytes */\ | ||
229 | struct acpi_namespace_node *node; /* Link back to parent node */\ | ||
230 | u32 bit_length; /* Length of field in bits */\ | ||
231 | u32 base_byte_offset; /* Byte offset within containing object */\ | ||
232 | u32 value; /* Value to store into the Bank or Index register */\ | ||
233 | u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ | ||
234 | u8 access_bit_width; /* Read/Write size in bits (8-64) */ | ||
235 | |||
230 | struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ | 236 | struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ |
231 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing Operation Region object */ | 237 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Parent Operation Region object (REGION/BANK fields only) */ |
232 | /* (REGION/BANK fields only) */ | ||
233 | }; | 238 | }; |
234 | 239 | ||
235 | struct acpi_object_region_field { | 240 | struct acpi_object_region_field { |
@@ -244,7 +249,7 @@ struct acpi_object_bank_field { | |||
244 | struct acpi_object_index_field { | 249 | struct acpi_object_index_field { |
245 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO | 250 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO |
246 | /* | 251 | /* |
247 | * No "region_obj" pointer needed since the Index and Data registers | 252 | * No "RegionObj" pointer needed since the Index and Data registers |
248 | * are each field definitions unto themselves. | 253 | * are each field definitions unto themselves. |
249 | */ | 254 | */ |
250 | union acpi_operand_object *index_obj; /* Index register */ | 255 | union acpi_operand_object *index_obj; /* Index register */ |
@@ -269,13 +274,9 @@ struct acpi_object_notify_handler { | |||
269 | void *context; | 274 | void *context; |
270 | }; | 275 | }; |
271 | 276 | ||
272 | /* Flags for address handler */ | ||
273 | |||
274 | #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1 | ||
275 | |||
276 | struct acpi_object_addr_handler { | 277 | struct acpi_object_addr_handler { |
277 | ACPI_OBJECT_COMMON_HEADER u8 space_id; | 278 | ACPI_OBJECT_COMMON_HEADER u8 space_id; |
278 | u16 hflags; | 279 | u8 handler_flags; |
279 | acpi_adr_space_handler handler; | 280 | acpi_adr_space_handler handler; |
280 | struct acpi_namespace_node *node; /* Parent device */ | 281 | struct acpi_namespace_node *node; /* Parent device */ |
281 | void *context; | 282 | void *context; |
@@ -284,6 +285,10 @@ struct acpi_object_addr_handler { | |||
284 | union acpi_operand_object *next; | 285 | union acpi_operand_object *next; |
285 | }; | 286 | }; |
286 | 287 | ||
288 | /* Flags for address handler (handler_flags) */ | ||
289 | |||
290 | #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01 | ||
291 | |||
287 | /****************************************************************************** | 292 | /****************************************************************************** |
288 | * | 293 | * |
289 | * Special internal objects | 294 | * Special internal objects |
@@ -297,10 +302,10 @@ struct acpi_object_addr_handler { | |||
297 | struct acpi_object_reference { | 302 | struct acpi_object_reference { |
298 | ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ | 303 | ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ |
299 | u16 opcode; | 304 | u16 opcode; |
300 | u32 offset; /* Used for arg_op, local_op, and index_op */ | 305 | void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ |
301 | void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ | ||
302 | struct acpi_namespace_node *node; | 306 | struct acpi_namespace_node *node; |
303 | union acpi_operand_object **where; | 307 | union acpi_operand_object **where; |
308 | u32 offset; /* Used for arg_op, local_op, and index_op */ | ||
304 | }; | 309 | }; |
305 | 310 | ||
306 | /* | 311 | /* |
@@ -311,12 +316,10 @@ struct acpi_object_reference { | |||
311 | * Currently: Region and field_unit types | 316 | * Currently: Region and field_unit types |
312 | */ | 317 | */ |
313 | struct acpi_object_extra { | 318 | struct acpi_object_extra { |
314 | ACPI_OBJECT_COMMON_HEADER u8 byte_fill1; | 319 | ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ |
315 | u16 word_fill1; | ||
316 | u32 aml_length; | ||
317 | u8 *aml_start; | ||
318 | struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ | ||
319 | void *region_context; /* Region-specific data */ | 320 | void *region_context; /* Region-specific data */ |
321 | u8 *aml_start; | ||
322 | u32 aml_length; | ||
320 | }; | 323 | }; |
321 | 324 | ||
322 | /* Additional data that can be attached to namespace nodes */ | 325 | /* Additional data that can be attached to namespace nodes */ |
@@ -391,8 +394,13 @@ union acpi_operand_object { | |||
391 | #define ACPI_DESC_TYPE_NAMED 0x0F | 394 | #define ACPI_DESC_TYPE_NAMED 0x0F |
392 | #define ACPI_DESC_TYPE_MAX 0x0F | 395 | #define ACPI_DESC_TYPE_MAX 0x0F |
393 | 396 | ||
397 | struct acpi_common_descriptor { | ||
398 | void *common_pointer; | ||
399 | u8 descriptor_type; /* To differentiate various internal objs */ | ||
400 | }; | ||
401 | |||
394 | union acpi_descriptor { | 402 | union acpi_descriptor { |
395 | u8 descriptor_id; /* To differentiate various internal objs */ | 403 | struct acpi_common_descriptor common; |
396 | union acpi_operand_object object; | 404 | union acpi_operand_object object; |
397 | struct acpi_namespace_node node; | 405 | struct acpi_namespace_node node; |
398 | union acpi_parse_object op; | 406 | union acpi_parse_object op; |
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h index e6d78bd9e90a..7659a46bc432 100644 --- a/include/acpi/acopcode.h +++ b/include/acpi/acopcode.h | |||
@@ -94,7 +94,7 @@ | |||
94 | #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) | 94 | #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) |
95 | #define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME) | 95 | #define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME) |
96 | #define ARGP_CONTINUE_OP ARG_NONE | 96 | #define ARGP_CONTINUE_OP ARG_NONE |
97 | #define ARGP_COPY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SIMPLENAME) | 97 | #define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME) |
98 | #define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) | 98 | #define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) |
99 | #define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) | 99 | #define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) |
100 | #define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) | 100 | #define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) |
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 7785d481dc3e..8d5039d0b430 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
@@ -50,7 +50,7 @@ | |||
50 | * component basis and a per-exception-type basis. | 50 | * component basis and a per-exception-type basis. |
51 | */ | 51 | */ |
52 | 52 | ||
53 | /* Component IDs are used in the global "debug_layer" */ | 53 | /* Component IDs are used in the global "DebugLayer" */ |
54 | 54 | ||
55 | #define ACPI_UTILITIES 0x00000001 | 55 | #define ACPI_UTILITIES 0x00000001 |
56 | #define ACPI_HARDWARE 0x00000002 | 56 | #define ACPI_HARDWARE 0x00000002 |
@@ -121,7 +121,7 @@ | |||
121 | #define ACPI_LV_INTERRUPTS 0x08000000 | 121 | #define ACPI_LV_INTERRUPTS 0x08000000 |
122 | #define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2 | 122 | #define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2 |
123 | 123 | ||
124 | /* Exceptionally verbose output -- also used in the global "debug_level" */ | 124 | /* Exceptionally verbose output -- also used in the global "DebugLevel" */ |
125 | 125 | ||
126 | #define ACPI_LV_AML_DISASSEMBLE 0x10000000 | 126 | #define ACPI_LV_AML_DISASSEMBLE 0x10000000 |
127 | #define ACPI_LV_VERBOSE_INFO 0x20000000 | 127 | #define ACPI_LV_VERBOSE_INFO 0x20000000 |
@@ -135,7 +135,7 @@ | |||
135 | */ | 135 | */ |
136 | #define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS | 136 | #define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS |
137 | 137 | ||
138 | /* Exception level -- used in the global "debug_level" */ | 138 | /* Exception level -- used in the global "DebugLevel" */ |
139 | 139 | ||
140 | #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) | 140 | #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) |
141 | #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) | 141 | #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) |
@@ -144,13 +144,13 @@ | |||
144 | 144 | ||
145 | /* | 145 | /* |
146 | * These two levels are essentially obsolete, all instances in the | 146 | * These two levels are essentially obsolete, all instances in the |
147 | * ACPICA core code have been replaced by REPORT_ERROR and REPORT_WARNING | 147 | * ACPICA core code have been replaced by ACPI_ERROR and ACPI_WARNING |
148 | * (Kept here because some drivers may still use them) | 148 | * (Kept here because some drivers may still use them) |
149 | */ | 149 | */ |
150 | #define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) | 150 | #define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) |
151 | #define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) | 151 | #define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) |
152 | 152 | ||
153 | /* Trace level -- also used in the global "debug_level" */ | 153 | /* Trace level -- also used in the global "DebugLevel" */ |
154 | 154 | ||
155 | #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) | 155 | #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) |
156 | #define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS) | 156 | #define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS) |
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h index 5a1ff484af33..9d49d3c41cd9 100644 --- a/include/acpi/acparser.h +++ b/include/acpi/acparser.h | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | #define OP_HAS_RETURN_VALUE 1 | 47 | #define OP_HAS_RETURN_VALUE 1 |
48 | 48 | ||
49 | /* variable # arguments */ | 49 | /* Variable number of arguments. This field must be 32 bits */ |
50 | 50 | ||
51 | #define ACPI_VAR_ARGS ACPI_UINT32_MAX | 51 | #define ACPI_VAR_ARGS ACPI_UINT32_MAX |
52 | 52 | ||
@@ -71,7 +71,7 @@ | |||
71 | /* | 71 | /* |
72 | * psxface - Parser external interfaces | 72 | * psxface - Parser external interfaces |
73 | */ | 73 | */ |
74 | acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info); | 74 | acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info); |
75 | 75 | ||
76 | /* | 76 | /* |
77 | * psargs - Parse AML opcode arguments | 77 | * psargs - Parse AML opcode arguments |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 6dca3d542080..a2b3e390a503 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #ifndef __ACPI_BUS_H__ | 26 | #ifndef __ACPI_BUS_H__ |
27 | #define __ACPI_BUS_H__ | 27 | #define __ACPI_BUS_H__ |
28 | 28 | ||
29 | #include <linux/kobject.h> | 29 | #include <linux/device.h> |
30 | 30 | ||
31 | #include <acpi/acpi.h> | 31 | #include <acpi/acpi.h> |
32 | 32 | ||
@@ -59,7 +59,7 @@ acpi_evaluate_reference(acpi_handle handle, | |||
59 | 59 | ||
60 | #define ACPI_BUS_FILE_ROOT "acpi" | 60 | #define ACPI_BUS_FILE_ROOT "acpi" |
61 | extern struct proc_dir_entry *acpi_root_dir; | 61 | extern struct proc_dir_entry *acpi_root_dir; |
62 | extern FADT_DESCRIPTOR acpi_fadt; | 62 | extern struct fadt_descriptor acpi_fadt; |
63 | 63 | ||
64 | enum acpi_bus_removal_type { | 64 | enum acpi_bus_removal_type { |
65 | ACPI_BUS_REMOVAL_NORMAL = 0, | 65 | ACPI_BUS_REMOVAL_NORMAL = 0, |
@@ -169,7 +169,8 @@ struct acpi_device_flags { | |||
169 | u32 power_manageable:1; | 169 | u32 power_manageable:1; |
170 | u32 performance_manageable:1; | 170 | u32 performance_manageable:1; |
171 | u32 wake_capable:1; /* Wakeup(_PRW) supported? */ | 171 | u32 wake_capable:1; /* Wakeup(_PRW) supported? */ |
172 | u32 reserved:20; | 172 | u32 force_power_state:1; |
173 | u32 reserved:19; | ||
173 | }; | 174 | }; |
174 | 175 | ||
175 | /* File System */ | 176 | /* File System */ |
@@ -296,6 +297,7 @@ struct acpi_device { | |||
296 | struct acpi_driver *driver; | 297 | struct acpi_driver *driver; |
297 | void *driver_data; | 298 | void *driver_data; |
298 | struct kobject kobj; | 299 | struct kobject kobj; |
300 | struct device dev; | ||
299 | }; | 301 | }; |
300 | 302 | ||
301 | #define acpi_driver_data(d) ((d)->driver_data) | 303 | #define acpi_driver_data(d) ((d)->driver_data) |
@@ -327,7 +329,7 @@ int acpi_bus_set_power(acpi_handle handle, int state); | |||
327 | int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data); | 329 | int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data); |
328 | int acpi_bus_receive_event(struct acpi_bus_event *event); | 330 | int acpi_bus_receive_event(struct acpi_bus_event *event); |
329 | int acpi_bus_register_driver(struct acpi_driver *driver); | 331 | int acpi_bus_register_driver(struct acpi_driver *driver); |
330 | int acpi_bus_unregister_driver(struct acpi_driver *driver); | 332 | void acpi_bus_unregister_driver(struct acpi_driver *driver); |
331 | int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, | 333 | int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, |
332 | acpi_handle handle, int type); | 334 | acpi_handle handle, int type); |
333 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); | 335 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); |
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h new file mode 100644 index 000000000000..1049f2a0a6db --- /dev/null +++ b/include/acpi/acpi_numa.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef __ACPI_NUMA_H | ||
2 | #define __ACPI_NUMA_H | ||
3 | |||
4 | #ifdef CONFIG_ACPI_NUMA | ||
5 | #include <linux/kernel.h> | ||
6 | |||
7 | /* Proximity bitmap length */ | ||
8 | #if MAX_NUMNODES > 256 | ||
9 | #define MAX_PXM_DOMAINS MAX_NUMNODES | ||
10 | #else | ||
11 | #define MAX_PXM_DOMAINS (256) /* Old pxm spec is defined 8 bit */ | ||
12 | #endif | ||
13 | |||
14 | extern int __cpuinitdata pxm_to_node_map[MAX_PXM_DOMAINS]; | ||
15 | extern int __cpuinitdata node_to_pxm_map[MAX_NUMNODES]; | ||
16 | |||
17 | extern int __cpuinit pxm_to_node(int); | ||
18 | extern int __cpuinit node_to_pxm(int); | ||
19 | extern int __cpuinit acpi_map_pxm_to_node(int); | ||
20 | extern void __cpuinit acpi_unmap_pxm_to_node(int); | ||
21 | |||
22 | #endif /* CONFIG_ACPI_NUMA */ | ||
23 | #endif /* __ACP_NUMA_H */ | ||
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 970e9a6372c3..8f473c83b7c4 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -50,12 +50,16 @@ | |||
50 | #include "platform/acenv.h" | 50 | #include "platform/acenv.h" |
51 | #include "actypes.h" | 51 | #include "actypes.h" |
52 | 52 | ||
53 | /* Priorities for acpi_os_queue_for_execution */ | 53 | /* Types for acpi_os_execute */ |
54 | 54 | ||
55 | #define OSD_PRIORITY_GPE 1 | 55 | typedef enum { |
56 | #define OSD_PRIORITY_HIGH 2 | 56 | OSL_GLOBAL_LOCK_HANDLER, |
57 | #define OSD_PRIORITY_MED 3 | 57 | OSL_NOTIFY_HANDLER, |
58 | #define OSD_PRIORITY_LO 4 | 58 | OSL_GPE_HANDLER, |
59 | OSL_DEBUGGER_THREAD, | ||
60 | OSL_EC_POLL_HANDLER, | ||
61 | OSL_EC_BURST_HANDLER | ||
62 | } acpi_execute_type; | ||
59 | 63 | ||
60 | #define ACPI_NO_UNIT_LIMIT ((u32) -1) | 64 | #define ACPI_NO_UNIT_LIMIT ((u32) -1) |
61 | #define ACPI_MUTEX_SEM 1 | 65 | #define ACPI_MUTEX_SEM 1 |
@@ -161,13 +165,11 @@ acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); | |||
161 | /* | 165 | /* |
162 | * Threads and Scheduling | 166 | * Threads and Scheduling |
163 | */ | 167 | */ |
164 | u32 acpi_os_get_thread_id(void); | 168 | acpi_thread_id acpi_os_get_thread_id(void); |
165 | 169 | ||
166 | acpi_status | 170 | acpi_status |
167 | acpi_os_queue_for_execution(u32 priority, | 171 | acpi_os_execute(acpi_execute_type type, |
168 | acpi_osd_exec_callback function, void *context); | 172 | acpi_osd_exec_callback function, void *context); |
169 | |||
170 | void acpi_os_wait_events_complete(void *context); | ||
171 | 173 | ||
172 | void acpi_os_wait_events_complete(void *context); | 174 | void acpi_os_wait_events_complete(void *context); |
173 | 175 | ||
@@ -214,6 +216,12 @@ acpi_os_derive_pci_id(acpi_handle rhandle, | |||
214 | /* | 216 | /* |
215 | * Miscellaneous | 217 | * Miscellaneous |
216 | */ | 218 | */ |
219 | acpi_status acpi_os_validate_interface(char *interface); | ||
220 | |||
221 | acpi_status | ||
222 | acpi_os_validate_address(u8 space_id, | ||
223 | acpi_physical_address address, acpi_size length); | ||
224 | |||
217 | u8 acpi_os_readable(void *pointer, acpi_size length); | 225 | u8 acpi_os_readable(void *pointer, acpi_size length); |
218 | 226 | ||
219 | #ifdef ACPI_FUTURE_USAGE | 227 | #ifdef ACPI_FUTURE_USAGE |
@@ -255,11 +263,4 @@ char *acpi_os_get_next_filename(void *dir_handle); | |||
255 | 263 | ||
256 | void acpi_os_close_directory(void *dir_handle); | 264 | void acpi_os_close_directory(void *dir_handle); |
257 | 265 | ||
258 | /* | ||
259 | * Debug | ||
260 | */ | ||
261 | void | ||
262 | acpi_os_dbg_assert(void *failed_assertion, | ||
263 | void *file_name, u32 line_number, char *message); | ||
264 | |||
265 | #endif /* __ACPIOSXF_H__ */ | 266 | #endif /* __ACPIOSXF_H__ */ |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 66cf2ecef57a..049e9aa1b867 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -268,7 +268,7 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); | |||
268 | * Resource interfaces | 268 | * Resource interfaces |
269 | */ | 269 | */ |
270 | typedef | 270 | typedef |
271 | acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource, | 271 | acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, |
272 | void *context); | 272 | void *context); |
273 | 273 | ||
274 | acpi_status | 274 | acpi_status |
@@ -290,7 +290,7 @@ acpi_get_possible_resources(acpi_handle device_handle, | |||
290 | acpi_status | 290 | acpi_status |
291 | acpi_walk_resources(acpi_handle device_handle, | 291 | acpi_walk_resources(acpi_handle device_handle, |
292 | char *name, | 292 | char *name, |
293 | ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); | 293 | acpi_walk_resource_callback user_function, void *context); |
294 | 294 | ||
295 | acpi_status | 295 | acpi_status |
296 | acpi_set_current_resources(acpi_handle device_handle, | 296 | acpi_set_current_resources(acpi_handle device_handle, |
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index fa02e8083381..ad11fc13fbef 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h | |||
@@ -164,23 +164,26 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | |||
164 | /* | 164 | /* |
165 | * rsutils | 165 | * rsutils |
166 | */ | 166 | */ |
167 | |||
167 | acpi_status | 168 | acpi_status |
168 | acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 169 | acpi_rs_get_prt_method_data(struct acpi_namespace_node *node, |
170 | struct acpi_buffer *ret_buffer); | ||
169 | 171 | ||
170 | acpi_status | 172 | acpi_status |
171 | acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 173 | acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, |
174 | struct acpi_buffer *ret_buffer); | ||
172 | 175 | ||
173 | #ifdef ACPI_FUTURE_USAGE | ||
174 | acpi_status | 176 | acpi_status |
175 | acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 177 | acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, |
176 | #endif /* ACPI_FUTURE_USAGE */ | 178 | struct acpi_buffer *ret_buffer); |
177 | 179 | ||
178 | acpi_status | 180 | acpi_status |
179 | acpi_rs_get_method_data(acpi_handle handle, | 181 | acpi_rs_get_method_data(acpi_handle handle, |
180 | char *path, struct acpi_buffer *ret_buffer); | 182 | char *path, struct acpi_buffer *ret_buffer); |
181 | 183 | ||
182 | acpi_status | 184 | acpi_status |
183 | acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 185 | acpi_rs_set_srs_method_data(struct acpi_namespace_node *node, |
186 | struct acpi_buffer *ret_buffer); | ||
184 | 187 | ||
185 | /* | 188 | /* |
186 | * rscalc | 189 | * rscalc |
@@ -198,8 +201,9 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, | |||
198 | acpi_size * buffer_size_needed); | 201 | acpi_size * buffer_size_needed); |
199 | 202 | ||
200 | acpi_status | 203 | acpi_status |
201 | acpi_rs_convert_aml_to_resources(u8 * aml_buffer, | 204 | acpi_rs_convert_aml_to_resources(u8 * aml, |
202 | u32 aml_buffer_length, u8 * output_buffer); | 205 | u32 length, |
206 | u32 offset, u8 resource_index, void **context); | ||
203 | 207 | ||
204 | acpi_status | 208 | acpi_status |
205 | acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, | 209 | acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, |
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index d8c1c2cdac0c..5e8095f0f78f 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h | |||
@@ -44,6 +44,8 @@ | |||
44 | #ifndef __ACSTRUCT_H__ | 44 | #ifndef __ACSTRUCT_H__ |
45 | #define __ACSTRUCT_H__ | 45 | #define __ACSTRUCT_H__ |
46 | 46 | ||
47 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
48 | |||
47 | /***************************************************************************** | 49 | /***************************************************************************** |
48 | * | 50 | * |
49 | * Tree walking typedefs and structs | 51 | * Tree walking typedefs and structs |
@@ -51,67 +53,76 @@ | |||
51 | ****************************************************************************/ | 53 | ****************************************************************************/ |
52 | 54 | ||
53 | /* | 55 | /* |
54 | * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through | 56 | * Walk state - current state of a parse tree walk. Used for both a leisurely |
55 | * the tree (for whatever reason), and for control method execution. | 57 | * stroll through the tree (for whatever reason), and for control method |
58 | * execution. | ||
56 | */ | 59 | */ |
57 | #define ACPI_NEXT_OP_DOWNWARD 1 | 60 | #define ACPI_NEXT_OP_DOWNWARD 1 |
58 | #define ACPI_NEXT_OP_UPWARD 2 | 61 | #define ACPI_NEXT_OP_UPWARD 2 |
59 | 62 | ||
63 | /* | ||
64 | * Groups of definitions for walk_type used for different implementations of | ||
65 | * walkers (never simultaneously) - flags for interpreter: | ||
66 | */ | ||
60 | #define ACPI_WALK_NON_METHOD 0 | 67 | #define ACPI_WALK_NON_METHOD 0 |
61 | #define ACPI_WALK_METHOD 1 | 68 | #define ACPI_WALK_METHOD 0x01 |
62 | #define ACPI_WALK_METHOD_RESTART 2 | 69 | #define ACPI_WALK_METHOD_RESTART 0x02 |
63 | #define ACPI_WALK_CONST_REQUIRED 3 | 70 | |
64 | #define ACPI_WALK_CONST_OPTIONAL 4 | 71 | /* Flags for i_aSL compiler only */ |
72 | |||
73 | #define ACPI_WALK_CONST_REQUIRED 0x10 | ||
74 | #define ACPI_WALK_CONST_OPTIONAL 0x20 | ||
65 | 75 | ||
66 | struct acpi_walk_state { | 76 | struct acpi_walk_state { |
67 | u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */ | 77 | struct acpi_walk_state *next; /* Next walk_state in list */ |
78 | u8 descriptor_type; /* To differentiate various internal objs */ | ||
68 | u8 walk_type; | 79 | u8 walk_type; |
69 | acpi_owner_id owner_id; /* Owner of objects created during the walk */ | 80 | u16 opcode; /* Current AML opcode */ |
70 | u8 last_predicate; /* Result of last predicate */ | ||
71 | u8 current_result; /* */ | ||
72 | u8 next_op_info; /* Info about next_op */ | 81 | u8 next_op_info; /* Info about next_op */ |
73 | u8 num_operands; /* Stack pointer for Operands[] array */ | 82 | u8 num_operands; /* Stack pointer for Operands[] array */ |
83 | acpi_owner_id owner_id; /* Owner of objects created during the walk */ | ||
84 | u8 last_predicate; /* Result of last predicate */ | ||
85 | u8 current_result; | ||
74 | u8 return_used; | 86 | u8 return_used; |
75 | u16 opcode; /* Current AML opcode */ | ||
76 | u8 scope_depth; | 87 | u8 scope_depth; |
77 | u8 pass_number; /* Parse pass during table load */ | 88 | u8 pass_number; /* Parse pass during table load */ |
78 | u32 arg_count; /* push for fixed or var args */ | ||
79 | u32 aml_offset; | 89 | u32 aml_offset; |
80 | u32 arg_types; | 90 | u32 arg_types; |
81 | u32 method_breakpoint; /* For single stepping */ | 91 | u32 method_breakpoint; /* For single stepping */ |
82 | u32 user_breakpoint; /* User AML breakpoint */ | 92 | u32 user_breakpoint; /* User AML breakpoint */ |
83 | u32 parse_flags; | 93 | u32 parse_flags; |
94 | |||
95 | struct acpi_parse_state parser_state; /* Current state of parser */ | ||
84 | u32 prev_arg_types; | 96 | u32 prev_arg_types; |
97 | u32 arg_count; /* push for fixed or var args */ | ||
85 | 98 | ||
86 | u8 *aml_last_while; | ||
87 | struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ | 99 | struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ |
100 | struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ | ||
101 | union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ | ||
102 | union acpi_operand_object **params; | ||
103 | |||
104 | u8 *aml_last_while; | ||
88 | union acpi_operand_object **caller_return_desc; | 105 | union acpi_operand_object **caller_return_desc; |
89 | union acpi_generic_state *control_state; /* List of control states (nested IFs) */ | 106 | union acpi_generic_state *control_state; /* List of control states (nested IFs) */ |
90 | struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ | 107 | struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ |
91 | struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ | 108 | struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ |
92 | union acpi_operand_object *implicit_return_obj; | 109 | union acpi_operand_object *implicit_return_obj; |
93 | struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ | ||
94 | struct acpi_namespace_node *method_call_node; /* Called method Node */ | 110 | struct acpi_namespace_node *method_call_node; /* Called method Node */ |
95 | union acpi_parse_object *method_call_op; /* method_call Op if running a method */ | 111 | union acpi_parse_object *method_call_op; /* method_call Op if running a method */ |
96 | union acpi_operand_object *method_desc; /* Method descriptor if running a method */ | 112 | union acpi_operand_object *method_desc; /* Method descriptor if running a method */ |
97 | struct acpi_namespace_node *method_node; /* Method node if running a method. */ | 113 | struct acpi_namespace_node *method_node; /* Method node if running a method. */ |
98 | union acpi_parse_object *op; /* Current parser op */ | 114 | union acpi_parse_object *op; /* Current parser op */ |
99 | union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ | ||
100 | const struct acpi_opcode_info *op_info; /* Info on current opcode */ | 115 | const struct acpi_opcode_info *op_info; /* Info on current opcode */ |
101 | union acpi_parse_object *origin; /* Start of walk [Obsolete] */ | 116 | union acpi_parse_object *origin; /* Start of walk [Obsolete] */ |
102 | union acpi_operand_object **params; | ||
103 | struct acpi_parse_state parser_state; /* Current state of parser */ | ||
104 | union acpi_operand_object *result_obj; | 117 | union acpi_operand_object *result_obj; |
105 | union acpi_generic_state *results; /* Stack of accumulated results */ | 118 | union acpi_generic_state *results; /* Stack of accumulated results */ |
106 | union acpi_operand_object *return_desc; /* Return object, if any */ | 119 | union acpi_operand_object *return_desc; /* Return object, if any */ |
107 | union acpi_generic_state *scope_info; /* Stack of nested scopes */ | 120 | union acpi_generic_state *scope_info; /* Stack of nested scopes */ |
108 | |||
109 | union acpi_parse_object *prev_op; /* Last op that was processed */ | 121 | union acpi_parse_object *prev_op; /* Last op that was processed */ |
110 | union acpi_parse_object *next_op; /* next op to be processed */ | 122 | union acpi_parse_object *next_op; /* next op to be processed */ |
123 | struct acpi_thread_state *thread; | ||
111 | acpi_parse_downwards descending_callback; | 124 | acpi_parse_downwards descending_callback; |
112 | acpi_parse_upwards ascending_callback; | 125 | acpi_parse_upwards ascending_callback; |
113 | struct acpi_thread_state *thread; | ||
114 | struct acpi_walk_state *next; /* Next walk_state in list */ | ||
115 | }; | 126 | }; |
116 | 127 | ||
117 | /* Info used by acpi_ps_init_objects */ | 128 | /* Info used by acpi_ps_init_objects */ |
@@ -131,32 +142,6 @@ struct acpi_init_walk_info { | |||
131 | struct acpi_table_desc *table_desc; | 142 | struct acpi_table_desc *table_desc; |
132 | }; | 143 | }; |
133 | 144 | ||
134 | /* Info used by acpi_ns_initialize_devices */ | ||
135 | |||
136 | struct acpi_device_walk_info { | ||
137 | u16 device_count; | ||
138 | u16 num_STA; | ||
139 | u16 num_INI; | ||
140 | struct acpi_table_desc *table_desc; | ||
141 | }; | ||
142 | |||
143 | /* TBD: [Restructure] Merge with struct above */ | ||
144 | |||
145 | struct acpi_walk_info { | ||
146 | u32 debug_level; | ||
147 | u32 count; | ||
148 | acpi_owner_id owner_id; | ||
149 | u8 display_type; | ||
150 | }; | ||
151 | |||
152 | /* Display Types */ | ||
153 | |||
154 | #define ACPI_DISPLAY_SUMMARY (u8) 0 | ||
155 | #define ACPI_DISPLAY_OBJECTS (u8) 1 | ||
156 | #define ACPI_DISPLAY_MASK (u8) 1 | ||
157 | |||
158 | #define ACPI_DISPLAY_SHORT (u8) 2 | ||
159 | |||
160 | struct acpi_get_devices_info { | 145 | struct acpi_get_devices_info { |
161 | acpi_walk_callback user_function; | 146 | acpi_walk_callback user_function; |
162 | void *context; | 147 | void *context; |
@@ -189,16 +174,21 @@ union acpi_aml_operands { | |||
189 | } mid; | 174 | } mid; |
190 | }; | 175 | }; |
191 | 176 | ||
192 | /* Internal method parameter list */ | 177 | /* |
193 | 178 | * Structure used to pass object evaluation parameters. | |
194 | struct acpi_parameter_info { | 179 | * Purpose is to reduce CPU stack use. |
195 | struct acpi_namespace_node *node; | 180 | */ |
181 | struct acpi_evaluate_info { | ||
182 | struct acpi_namespace_node *prefix_node; | ||
183 | char *pathname; | ||
196 | union acpi_operand_object *obj_desc; | 184 | union acpi_operand_object *obj_desc; |
197 | union acpi_operand_object **parameters; | 185 | union acpi_operand_object **parameters; |
186 | struct acpi_namespace_node *resolved_node; | ||
198 | union acpi_operand_object *return_object; | 187 | union acpi_operand_object *return_object; |
199 | u8 pass_number; | 188 | u8 pass_number; |
200 | u8 parameter_type; | 189 | u8 parameter_type; |
201 | u8 return_object_type; | 190 | u8 return_object_type; |
191 | u8 flags; | ||
202 | }; | 192 | }; |
203 | 193 | ||
204 | /* Types for parameter_type above */ | 194 | /* Types for parameter_type above */ |
@@ -206,4 +196,35 @@ struct acpi_parameter_info { | |||
206 | #define ACPI_PARAM_ARGS 0 | 196 | #define ACPI_PARAM_ARGS 0 |
207 | #define ACPI_PARAM_GPE 1 | 197 | #define ACPI_PARAM_GPE 1 |
208 | 198 | ||
199 | /* Values for Flags above */ | ||
200 | |||
201 | #define ACPI_IGNORE_RETURN_VALUE 1 | ||
202 | |||
203 | /* Info used by acpi_ns_initialize_devices */ | ||
204 | |||
205 | struct acpi_device_walk_info { | ||
206 | u16 device_count; | ||
207 | u16 num_STA; | ||
208 | u16 num_INI; | ||
209 | struct acpi_table_desc *table_desc; | ||
210 | struct acpi_evaluate_info *evaluate_info; | ||
211 | }; | ||
212 | |||
213 | /* TBD: [Restructure] Merge with struct above */ | ||
214 | |||
215 | struct acpi_walk_info { | ||
216 | u32 debug_level; | ||
217 | u32 count; | ||
218 | acpi_owner_id owner_id; | ||
219 | u8 display_type; | ||
220 | }; | ||
221 | |||
222 | /* Display Types */ | ||
223 | |||
224 | #define ACPI_DISPLAY_SUMMARY (u8) 0 | ||
225 | #define ACPI_DISPLAY_OBJECTS (u8) 1 | ||
226 | #define ACPI_DISPLAY_MASK (u8) 1 | ||
227 | |||
228 | #define ACPI_DISPLAY_SHORT (u8) 2 | ||
229 | |||
209 | #endif | 230 | #endif |
diff --git a/include/acpi/actables.h b/include/acpi/actables.h index 30a47542e1c8..4dbaf02fe526 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h | |||
@@ -136,7 +136,11 @@ acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc); | |||
136 | acpi_status | 136 | acpi_status |
137 | acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); | 137 | acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); |
138 | 138 | ||
139 | u8 acpi_tb_generate_checksum(void *buffer, u32 length); | 139 | u8 acpi_tb_sum_table(void *buffer, u32 length); |
140 | |||
141 | u8 acpi_tb_generate_checksum(struct acpi_table_header *table); | ||
142 | |||
143 | void acpi_tb_set_checksum(struct acpi_table_header *table); | ||
140 | 144 | ||
141 | acpi_status | 145 | acpi_status |
142 | acpi_tb_validate_table_header(struct acpi_table_header *table_header); | 146 | acpi_tb_validate_table_header(struct acpi_table_header *table_header); |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index ed53f842dad4..b125ceed9cb7 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Name: actbl.h - Table data structures defined in ACPI specification | 3 | * Name: actbl.h - Basic ACPI Table Definitions |
4 | * | 4 | * |
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
@@ -45,66 +45,45 @@ | |||
45 | #define __ACTBL_H__ | 45 | #define __ACTBL_H__ |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. | 48 | * Values for description table header signatures. Useful because they make |
49 | * This is the only type that is even remotely portable. Anything else is not | 49 | * it more difficult to inadvertently type in the wrong signature. |
50 | * portable, so do not use any other bitfield types. | ||
51 | */ | ||
52 | |||
53 | /* | ||
54 | * Values for description table header signatures | ||
55 | */ | 50 | */ |
56 | #define RSDP_NAME "RSDP" | ||
57 | #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ | ||
58 | #define APIC_SIG "APIC" /* Multiple APIC Description Table */ | ||
59 | #define DSDT_SIG "DSDT" /* Differentiated System Description Table */ | 51 | #define DSDT_SIG "DSDT" /* Differentiated System Description Table */ |
60 | #define FADT_SIG "FACP" /* Fixed ACPI Description Table */ | 52 | #define FADT_SIG "FACP" /* Fixed ACPI Description Table */ |
61 | #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ | 53 | #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ |
62 | #define PSDT_SIG "PSDT" /* Persistent System Description Table */ | 54 | #define PSDT_SIG "PSDT" /* Persistent System Description Table */ |
55 | #define RSDP_SIG "RSD PTR " /* Root System Description Pointer */ | ||
63 | #define RSDT_SIG "RSDT" /* Root System Description Table */ | 56 | #define RSDT_SIG "RSDT" /* Root System Description Table */ |
64 | #define XSDT_SIG "XSDT" /* Extended System Description Table */ | 57 | #define XSDT_SIG "XSDT" /* Extended System Description Table */ |
65 | #define SSDT_SIG "SSDT" /* Secondary System Description Table */ | 58 | #define SSDT_SIG "SSDT" /* Secondary System Description Table */ |
66 | #define SBST_SIG "SBST" /* Smart Battery Specification Table */ | 59 | #define RSDP_NAME "RSDP" |
67 | #define SPIC_SIG "SPIC" /* IOSAPIC table */ | ||
68 | #define BOOT_SIG "BOOT" /* Boot table */ | ||
69 | |||
70 | #define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ | ||
71 | 60 | ||
72 | /* | 61 | /* |
73 | * Common table types. The base code can remain | 62 | * All tables and structures must be byte-packed to match the ACPI |
74 | * constant if the underlying tables are changed | 63 | * specification, since the tables are provided by the system BIOS |
75 | */ | 64 | */ |
76 | #define RSDT_DESCRIPTOR struct rsdt_descriptor_rev2 | ||
77 | #define XSDT_DESCRIPTOR struct xsdt_descriptor_rev2 | ||
78 | #define FACS_DESCRIPTOR struct facs_descriptor_rev2 | ||
79 | #define FADT_DESCRIPTOR struct fadt_descriptor_rev2 | ||
80 | |||
81 | #pragma pack(1) | 65 | #pragma pack(1) |
82 | 66 | ||
83 | /* | 67 | /* |
84 | * ACPI Version-independent tables | 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. | ||
85 | * | 72 | * |
86 | * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) | 73 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. |
87 | * are in separate files. | 74 | * This is the only type that is even remotely portable. Anything else is not |
75 | * portable, so do not use any other bitfield types. | ||
88 | */ | 76 | */ |
89 | struct rsdp_descriptor { /* Root System Descriptor Pointer */ | ||
90 | char signature[8]; /* ACPI signature, contains "RSD PTR " */ | ||
91 | u8 checksum; /* ACPI 1.0 checksum */ | ||
92 | char oem_id[6]; /* OEM identification */ | ||
93 | u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ | ||
94 | u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ | ||
95 | u32 length; /* XSDT Length in bytes, including header */ | ||
96 | u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */ | ||
97 | u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */ | ||
98 | char reserved[3]; /* Reserved, must be zero */ | ||
99 | }; | ||
100 | 77 | ||
101 | struct acpi_common_facs { /* Common FACS for internal use */ | 78 | /******************************************************************************* |
102 | u32 *global_lock; | 79 | * |
103 | u64 *firmware_waking_vector; | 80 | * ACPI Table Header. This common header is used by all tables except the |
104 | u8 vector_width; | 81 | * RSDP and FACS. The define is used for direct inclusion of header into |
105 | }; | 82 | * other ACPI tables |
83 | * | ||
84 | ******************************************************************************/ | ||
106 | 85 | ||
107 | #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ | 86 | #define ACPI_TABLE_HEADER_DEF \ |
108 | char signature[4]; /* ASCII table signature */\ | 87 | char signature[4]; /* ASCII table signature */\ |
109 | u32 length; /* Length of table in bytes, including this header */\ | 88 | u32 length; /* Length of table in bytes, including this header */\ |
110 | u8 revision; /* ACPI Specification minor version # */\ | 89 | u8 revision; /* ACPI Specification minor version # */\ |
@@ -112,154 +91,239 @@ struct acpi_common_facs { /* Common FACS for internal use */ | |||
112 | char oem_id[6]; /* ASCII OEM identification */\ | 91 | char oem_id[6]; /* ASCII OEM identification */\ |
113 | char oem_table_id[8]; /* ASCII OEM table identification */\ | 92 | char oem_table_id[8]; /* ASCII OEM table identification */\ |
114 | u32 oem_revision; /* OEM revision number */\ | 93 | u32 oem_revision; /* OEM revision number */\ |
115 | char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ | 94 | char asl_compiler_id[4]; /* ASCII ASL compiler vendor ID */\ |
116 | u32 asl_compiler_revision; /* ASL compiler version */ | 95 | u32 asl_compiler_revision; /* ASL compiler version */ |
117 | 96 | ||
118 | struct acpi_table_header { /* ACPI common table header */ | 97 | struct acpi_table_header { |
119 | ACPI_TABLE_HEADER_DEF}; | 98 | ACPI_TABLE_HEADER_DEF}; |
120 | 99 | ||
121 | /* | 100 | /* |
122 | * MADT values and structures | 101 | * GAS - Generic Address Structure (ACPI 2.0+) |
123 | */ | 102 | */ |
103 | struct acpi_generic_address { | ||
104 | u8 address_space_id; /* Address space where struct or register exists */ | ||
105 | u8 register_bit_width; /* Size in bits of given register */ | ||
106 | u8 register_bit_offset; /* Bit offset within the register */ | ||
107 | u8 access_width; /* Minimum Access size (ACPI 3.0) */ | ||
108 | u64 address; /* 64-bit address of struct or register */ | ||
109 | }; | ||
124 | 110 | ||
125 | /* Values for MADT PCATCompat */ | 111 | /******************************************************************************* |
112 | * | ||
113 | * RSDP - Root System Description Pointer (Signature is "RSD PTR ") | ||
114 | * | ||
115 | ******************************************************************************/ | ||
116 | |||
117 | struct rsdp_descriptor { | ||
118 | char signature[8]; /* ACPI signature, contains "RSD PTR " */ | ||
119 | u8 checksum; /* ACPI 1.0 checksum */ | ||
120 | char oem_id[6]; /* OEM identification */ | ||
121 | u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ | ||
122 | u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ | ||
123 | u32 length; /* Table length in bytes, including header (ACPI 2.0+) */ | ||
124 | u64 xsdt_physical_address; /* 64-bit physical address of the XSDT (ACPI 2.0+) */ | ||
125 | u8 extended_checksum; /* Checksum of entire table (ACPI 2.0+) */ | ||
126 | u8 reserved[3]; /* Reserved, must be zero */ | ||
127 | }; | ||
126 | 128 | ||
127 | #define DUAL_PIC 0 | 129 | #define ACPI_RSDP_REV0_SIZE 20 /* Size of original ACPI 1.0 RSDP */ |
128 | #define MULTIPLE_APIC 1 | ||
129 | 130 | ||
130 | /* Master MADT */ | 131 | /******************************************************************************* |
132 | * | ||
133 | * RSDT/XSDT - Root System Description Tables | ||
134 | * | ||
135 | ******************************************************************************/ | ||
131 | 136 | ||
132 | struct multiple_apic_table { | 137 | struct rsdt_descriptor { |
133 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 138 | ACPI_TABLE_HEADER_DEF u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ |
134 | u32 local_apic_address; /* Physical address of local APIC */ | 139 | }; |
140 | |||
141 | struct xsdt_descriptor { | ||
142 | ACPI_TABLE_HEADER_DEF u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | ||
143 | }; | ||
144 | |||
145 | /******************************************************************************* | ||
146 | * | ||
147 | * FACS - Firmware ACPI Control Structure (FACS) | ||
148 | * | ||
149 | ******************************************************************************/ | ||
150 | |||
151 | struct facs_descriptor { | ||
152 | char signature[4]; /* ASCII table signature */ | ||
153 | u32 length; /* Length of structure, in bytes */ | ||
154 | u32 hardware_signature; /* Hardware configuration signature */ | ||
155 | u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector */ | ||
156 | u32 global_lock; /* Global Lock for shared hardware resources */ | ||
135 | 157 | ||
136 | /* Flags (32 bits) */ | 158 | /* Flags (32 bits) */ |
137 | 159 | ||
138 | u8 PCATcompat:1; /* 00: System also has dual 8259s */ | 160 | u8 S4bios_f:1; /* 00: S4BIOS support is present */ |
139 | u8:7; /* 01-07: Reserved, must be zero */ | 161 | u8:7; /* 01-07: Reserved, must be zero */ |
140 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | 162 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ |
141 | }; | ||
142 | 163 | ||
143 | /* Values for Type in APIC_HEADER_DEF */ | 164 | u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ |
165 | u8 version; /* Version of this table (ACPI 2.0+) */ | ||
166 | u8 reserved[31]; /* Reserved, must be zero */ | ||
167 | }; | ||
144 | 168 | ||
145 | #define APIC_PROCESSOR 0 | 169 | #define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */ |
146 | #define APIC_IO 1 | 170 | #define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */ |
147 | #define APIC_XRUPT_OVERRIDE 2 | ||
148 | #define APIC_NMI 3 | ||
149 | #define APIC_LOCAL_NMI 4 | ||
150 | #define APIC_ADDRESS_OVERRIDE 5 | ||
151 | #define APIC_IO_SAPIC 6 | ||
152 | #define APIC_LOCAL_SAPIC 7 | ||
153 | #define APIC_XRUPT_SOURCE 8 | ||
154 | #define APIC_RESERVED 9 /* 9 and greater are reserved */ | ||
155 | 171 | ||
156 | /* | 172 | /* |
157 | * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) | 173 | * Common FACS - This is a version-independent FACS structure used for internal use only |
158 | */ | 174 | */ |
159 | #define APIC_HEADER_DEF /* Common APIC sub-structure header */\ | 175 | struct acpi_common_facs { |
160 | u8 type; \ | 176 | u32 *global_lock; |
161 | u8 length; | 177 | u64 *firmware_waking_vector; |
162 | 178 | u8 vector_width; | |
163 | struct apic_header { | ||
164 | APIC_HEADER_DEF}; | ||
165 | |||
166 | /* Values for MPS INTI flags */ | ||
167 | |||
168 | #define POLARITY_CONFORMS 0 | ||
169 | #define POLARITY_ACTIVE_HIGH 1 | ||
170 | #define POLARITY_RESERVED 2 | ||
171 | #define POLARITY_ACTIVE_LOW 3 | ||
172 | |||
173 | #define TRIGGER_CONFORMS 0 | ||
174 | #define TRIGGER_EDGE 1 | ||
175 | #define TRIGGER_RESERVED 2 | ||
176 | #define TRIGGER_LEVEL 3 | ||
177 | |||
178 | /* Common flag definitions (16 bits each) */ | ||
179 | |||
180 | #define MPS_INTI_FLAGS \ | ||
181 | u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ | ||
182 | u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ | ||
183 | u8 : 4; /* 04-07: Reserved, must be zero */\ | ||
184 | u8 reserved1; /* 08-15: Reserved, must be zero */ | ||
185 | |||
186 | #define LOCAL_APIC_FLAGS \ | ||
187 | u8 processor_enabled: 1; /* 00: Processor is usable if set */\ | ||
188 | u8 : 7; /* 01-07: Reserved, must be zero */\ | ||
189 | u8 reserved2; /* 08-15: Reserved, must be zero */ | ||
190 | |||
191 | /* Sub-structures for MADT */ | ||
192 | |||
193 | struct madt_processor_apic { | ||
194 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ | ||
195 | u8 local_apic_id; /* Processor's local APIC id */ | ||
196 | LOCAL_APIC_FLAGS}; | ||
197 | |||
198 | struct madt_io_apic { | ||
199 | APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ | ||
200 | u8 reserved; /* Reserved - must be zero */ | ||
201 | u32 address; /* APIC physical address */ | ||
202 | u32 interrupt; /* Global system interrupt where INTI | ||
203 | * lines start */ | ||
204 | }; | 179 | }; |
205 | 180 | ||
206 | struct madt_interrupt_override { | 181 | /******************************************************************************* |
207 | APIC_HEADER_DEF u8 bus; /* 0 - ISA */ | 182 | * |
208 | u8 source; /* Interrupt source (IRQ) */ | 183 | * FADT - Fixed ACPI Description Table (Signature "FACP") |
209 | u32 interrupt; /* Global system interrupt */ | 184 | * |
210 | MPS_INTI_FLAGS}; | 185 | ******************************************************************************/ |
186 | |||
187 | /* Fields common to all versions of the FADT */ | ||
188 | |||
189 | #define ACPI_FADT_COMMON \ | ||
190 | ACPI_TABLE_HEADER_DEF \ | ||
191 | u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ | ||
192 | u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ | ||
193 | u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \ | ||
194 | u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \ | ||
195 | u16 sci_int; /* System vector of SCI interrupt */ \ | ||
196 | u32 smi_cmd; /* Port address of SMI command port */ \ | ||
197 | u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ \ | ||
198 | u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ \ | ||
199 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \ | ||
200 | u8 pstate_cnt; /* Processor performance state control*/ \ | ||
201 | u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Event Reg Blk */ \ | ||
202 | u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Event Reg Blk */ \ | ||
203 | u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \ | ||
204 | u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \ | ||
205 | u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \ | ||
206 | u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \ | ||
207 | u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \ | ||
208 | u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \ | ||
209 | u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ \ | ||
210 | u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ \ | ||
211 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \ | ||
212 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \ | ||
213 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \ | ||
214 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \ | ||
215 | u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \ | ||
216 | u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \ | ||
217 | u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \ | ||
218 | u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \ | ||
219 | u16 flush_size; /* Processor's memory cache line width, in bytes */ \ | ||
220 | u16 flush_stride; /* Number of flush strides that need to be read */ \ | ||
221 | u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ \ | ||
222 | u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \ | ||
223 | u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \ | ||
224 | u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \ | ||
225 | u8 century; /* Index to century in RTC CMOS RAM */ \ | ||
226 | u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ \ | ||
227 | u8 reserved2; /* Reserved, must be zero */ | ||
211 | 228 | ||
212 | struct madt_nmi_source { | 229 | /* |
213 | APIC_HEADER_DEF MPS_INTI_FLAGS u32 interrupt; /* Global system interrupt */ | 230 | * ACPI 2.0+ FADT |
231 | */ | ||
232 | struct fadt_descriptor { | ||
233 | ACPI_FADT_COMMON | ||
234 | /* Flags (32 bits) */ | ||
235 | u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ | ||
236 | u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ | ||
237 | u8 proc_c1:1; /* 02: All processors support C1 state */ | ||
238 | u8 plvl2_up:1; /* 03: C2 state works on MP system */ | ||
239 | u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ | ||
240 | u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ | ||
241 | u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ | ||
242 | u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ | ||
243 | u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */ | ||
244 | u8 dock_cap:1; /* 09: Docking supported */ | ||
245 | u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */ | ||
246 | u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */ | ||
247 | u8 headless:1; /* 12: No local video capabilities or local input devices */ | ||
248 | u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */ | ||
249 | |||
250 | u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ | ||
251 | u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */ | ||
252 | u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ | ||
253 | u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */ | ||
254 | u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ | ||
255 | u8 force_apic_physical_destination_mode:1; /* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */ | ||
256 | u8:4; /* 20-23: Reserved, must be zero */ | ||
257 | u8 reserved3; /* 24-31: Reserved, must be zero */ | ||
258 | |||
259 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | ||
260 | u8 reset_value; /* Value to write to the reset_register port to reset the system */ | ||
261 | u8 reserved4[3]; /* These three bytes must be zero */ | ||
262 | u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ | ||
263 | u64 Xdsdt; /* 64-bit physical address of DSDT */ | ||
264 | struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ | ||
265 | struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ | ||
266 | struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ | ||
267 | struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ | ||
268 | struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ | ||
269 | struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ | ||
270 | struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ | ||
271 | struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ | ||
214 | }; | 272 | }; |
215 | 273 | ||
216 | struct madt_local_apic_nmi { | 274 | /* |
217 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ | 275 | * "Down-revved" ACPI 2.0 FADT descriptor |
218 | MPS_INTI_FLAGS u8 lint; /* LINTn to which NMI is connected */ | 276 | * Defined here to allow compiler to generate the length of the struct |
277 | */ | ||
278 | struct fadt_descriptor_rev2_minus { | ||
279 | ACPI_FADT_COMMON u32 flags; | ||
280 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | ||
281 | u8 reset_value; /* Value to write to the reset_register port to reset the system. */ | ||
282 | u8 reserved7[3]; /* Reserved, must be zero */ | ||
219 | }; | 283 | }; |
220 | 284 | ||
221 | struct madt_address_override { | 285 | /* |
222 | APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ | 286 | * ACPI 1.0 FADT |
223 | u64 address; /* APIC physical address */ | 287 | * Defined here to allow compiler to generate the length of the struct |
288 | */ | ||
289 | struct fadt_descriptor_rev1 { | ||
290 | ACPI_FADT_COMMON u32 flags; | ||
224 | }; | 291 | }; |
225 | 292 | ||
226 | struct madt_io_sapic { | 293 | /* FADT: Prefered Power Management Profiles */ |
227 | APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ | ||
228 | u8 reserved; /* Reserved, must be zero */ | ||
229 | u32 interrupt_base; /* Glocal interrupt for SAPIC start */ | ||
230 | u64 address; /* SAPIC physical address */ | ||
231 | }; | ||
232 | 294 | ||
233 | struct madt_local_sapic { | 295 | #define PM_UNSPECIFIED 0 |
234 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ | 296 | #define PM_DESKTOP 1 |
235 | u8 local_sapic_id; /* SAPIC ID */ | 297 | #define PM_MOBILE 2 |
236 | u8 local_sapic_eid; /* SAPIC EID */ | 298 | #define PM_WORKSTATION 3 |
237 | u8 reserved[3]; /* Reserved, must be zero */ | 299 | #define PM_ENTERPRISE_SERVER 4 |
238 | LOCAL_APIC_FLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ | 300 | #define PM_SOHO_SERVER 5 |
239 | char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ | 301 | #define PM_APPLIANCE_PC 6 |
240 | }; | ||
241 | 302 | ||
242 | struct madt_interrupt_source { | 303 | /* FADT: Boot Arch Flags */ |
243 | APIC_HEADER_DEF MPS_INTI_FLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ | ||
244 | u8 processor_id; /* Processor ID */ | ||
245 | u8 processor_eid; /* Processor EID */ | ||
246 | u8 io_sapic_vector; /* Vector value for PMI interrupts */ | ||
247 | u32 interrupt; /* Global system interrupt */ | ||
248 | u32 flags; /* Interrupt Source Flags */ | ||
249 | }; | ||
250 | 304 | ||
251 | /* | 305 | #define BAF_LEGACY_DEVICES 0x0001 |
252 | * Smart Battery | 306 | #define BAF_8042_KEYBOARD_CONTROLLER 0x0002 |
253 | */ | 307 | |
254 | struct smart_battery_table { | 308 | #define FADT2_REVISION_ID 3 |
255 | ACPI_TABLE_HEADER_DEF u32 warning_level; | 309 | #define FADT2_MINUS_REVISION_ID 2 |
256 | u32 low_level; | 310 | |
257 | u32 critical_level; | 311 | /* Reset to default packing */ |
258 | }; | ||
259 | 312 | ||
260 | #pragma pack() | 313 | #pragma pack() |
261 | 314 | ||
262 | /* | 315 | /* |
316 | * This macro is temporary until the table bitfield flag definitions | ||
317 | * are removed and replaced by a Flags field. | ||
318 | */ | ||
319 | #define ACPI_FLAG_OFFSET(d,f,o) (u8) (ACPI_OFFSET (d,f) + \ | ||
320 | sizeof(((d *)0)->f) + o) | ||
321 | /* | ||
322 | * Get the remaining ACPI tables | ||
323 | */ | ||
324 | #include "actbl1.h" | ||
325 | |||
326 | /* | ||
263 | * ACPI Table information. We save the table address, length, | 327 | * ACPI Table information. We save the table address, length, |
264 | * and type of memory allocation (mapped or allocated) for each | 328 | * and type of memory allocation (mapped or allocated) for each |
265 | * table for 1) when we exit, and 2) if a new table is installed | 329 | * table for 1) when we exit, and 2) if a new table is installed |
@@ -290,27 +354,17 @@ struct acpi_table_support { | |||
290 | u8 flags; | 354 | u8 flags; |
291 | }; | 355 | }; |
292 | 356 | ||
293 | /* | ||
294 | * Get the ACPI version-specific tables | ||
295 | */ | ||
296 | #include "actbl1.h" /* Acpi 1.0 table definitions */ | ||
297 | #include "actbl2.h" /* Acpi 2.0 table definitions */ | ||
298 | |||
299 | extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, | 357 | extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, |
300 | * needed for certain workarounds */ | 358 | * needed for certain workarounds */ |
359 | /* Macros used to generate offsets to specific table fields */ | ||
301 | 360 | ||
302 | #pragma pack(1) | 361 | #define ACPI_FACS_OFFSET(f) (u8) ACPI_OFFSET (struct facs_descriptor,f) |
303 | /* | 362 | #define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct fadt_descriptor, f) |
304 | * High performance timer | 363 | #define ACPI_GAS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_generic_address,f) |
305 | */ | 364 | #define ACPI_HDR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_header,f) |
306 | struct hpet_table { | 365 | #define ACPI_RSDP_OFFSET(f) (u8) ACPI_OFFSET (struct rsdp_descriptor,f) |
307 | ACPI_TABLE_HEADER_DEF u32 hardware_id; | ||
308 | struct acpi_generic_address base_address; | ||
309 | u8 hpet_number; | ||
310 | u16 clock_tick; | ||
311 | u8 attributes; | ||
312 | }; | ||
313 | 366 | ||
314 | #pragma pack() | 367 | #define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct fadt_descriptor,f,o) |
368 | #define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct facs_descriptor,f,o) | ||
315 | 369 | ||
316 | #endif /* __ACTBL_H__ */ | 370 | #endif /* __ACTBL_H__ */ |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index cd428d57add0..745a6445a4f9 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Name: actbl1.h - ACPI 1.0 tables | 3 | * Name: actbl1.h - Additional ACPI table definitions |
4 | * | 4 | * |
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
@@ -44,92 +44,599 @@ | |||
44 | #ifndef __ACTBL1_H__ | 44 | #ifndef __ACTBL1_H__ |
45 | #define __ACTBL1_H__ | 45 | #define __ACTBL1_H__ |
46 | 46 | ||
47 | /******************************************************************************* | ||
48 | * | ||
49 | * Additional ACPI Tables | ||
50 | * | ||
51 | * These tables are not consumed directly by the ACPICA subsystem, but are | ||
52 | * included here to support device drivers and the AML disassembler. | ||
53 | * | ||
54 | ******************************************************************************/ | ||
55 | |||
56 | /* | ||
57 | * Values for description table header signatures. Useful because they make | ||
58 | * it more difficult to inadvertently type in the wrong signature. | ||
59 | */ | ||
60 | #define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */ | ||
61 | #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ | ||
62 | #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ | ||
63 | #define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ | ||
64 | #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ | ||
65 | #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ | ||
66 | #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ | ||
67 | #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ | ||
68 | #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ | ||
69 | #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ | ||
70 | #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ | ||
71 | #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ | ||
72 | #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ | ||
73 | #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ | ||
74 | #define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ | ||
75 | |||
76 | /* Legacy names */ | ||
77 | |||
78 | #define APIC_SIG "APIC" /* Multiple APIC Description Table */ | ||
79 | #define BOOT_SIG "BOOT" /* Simple Boot Flag Table */ | ||
80 | #define SBST_SIG "SBST" /* Smart Battery Specification Table */ | ||
81 | |||
82 | /* | ||
83 | * All tables must be byte-packed to match the ACPI specification, since | ||
84 | * the tables are provided by the system BIOS. | ||
85 | */ | ||
47 | #pragma pack(1) | 86 | #pragma pack(1) |
48 | 87 | ||
49 | /* | 88 | /* |
50 | * ACPI 1.0 Root System Description Table (RSDT) | 89 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. |
90 | * This is the only type that is even remotely portable. Anything else is not | ||
91 | * portable, so do not use any other bitfield types. | ||
51 | */ | 92 | */ |
52 | struct rsdt_descriptor_rev1 { | 93 | |
53 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 94 | /******************************************************************************* |
54 | u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | 95 | * |
55 | }; | 96 | * ASF - Alert Standard Format table (Signature "ASF!") |
97 | * | ||
98 | ******************************************************************************/ | ||
99 | |||
100 | struct acpi_table_asf { | ||
101 | ACPI_TABLE_HEADER_DEF}; | ||
102 | |||
103 | #define ACPI_ASF_HEADER_DEF \ | ||
104 | u8 type; \ | ||
105 | u8 reserved; \ | ||
106 | u16 length; | ||
107 | |||
108 | struct acpi_asf_header { | ||
109 | ACPI_ASF_HEADER_DEF}; | ||
110 | |||
111 | /* Values for Type field */ | ||
112 | |||
113 | #define ASF_INFO 0 | ||
114 | #define ASF_ALERT 1 | ||
115 | #define ASF_CONTROL 2 | ||
116 | #define ASF_BOOT 3 | ||
117 | #define ASF_ADDRESS 4 | ||
118 | #define ASF_RESERVED 5 | ||
56 | 119 | ||
57 | /* | 120 | /* |
58 | * ACPI 1.0 Firmware ACPI Control Structure (FACS) | 121 | * ASF subtables |
59 | */ | 122 | */ |
60 | struct facs_descriptor_rev1 { | 123 | |
61 | char signature[4]; /* ASCII table signature */ | 124 | /* 0: ASF Information */ |
62 | u32 length; /* Length of structure in bytes */ | 125 | |
63 | u32 hardware_signature; /* Hardware configuration signature */ | 126 | struct acpi_asf_info { |
64 | u32 firmware_waking_vector; /* ACPI OS waking vector */ | 127 | ACPI_ASF_HEADER_DEF u8 min_reset_value; |
65 | u32 global_lock; /* Global Lock */ | 128 | u8 min_poll_interval; |
129 | u16 system_id; | ||
130 | u32 mfg_id; | ||
131 | u8 flags; | ||
132 | u8 reserved2[3]; | ||
133 | }; | ||
134 | |||
135 | /* 1: ASF Alerts */ | ||
136 | |||
137 | struct acpi_asf_alert { | ||
138 | ACPI_ASF_HEADER_DEF u8 assert_mask; | ||
139 | u8 deassert_mask; | ||
140 | u8 alerts; | ||
141 | u8 data_length; | ||
142 | u8 array[1]; | ||
143 | }; | ||
144 | |||
145 | /* 2: ASF Remote Control */ | ||
146 | |||
147 | struct acpi_asf_remote { | ||
148 | ACPI_ASF_HEADER_DEF u8 controls; | ||
149 | u8 data_length; | ||
150 | u16 reserved2; | ||
151 | u8 array[1]; | ||
152 | }; | ||
153 | |||
154 | /* 3: ASF RMCP Boot Options */ | ||
155 | |||
156 | struct acpi_asf_rmcp { | ||
157 | ACPI_ASF_HEADER_DEF u8 capabilities[7]; | ||
158 | u8 completion_code; | ||
159 | u32 enterprise_id; | ||
160 | u8 command; | ||
161 | u16 parameter; | ||
162 | u16 boot_options; | ||
163 | u16 oem_parameters; | ||
164 | }; | ||
165 | |||
166 | /* 4: ASF Address */ | ||
167 | |||
168 | struct acpi_asf_address { | ||
169 | ACPI_ASF_HEADER_DEF u8 eprom_address; | ||
170 | u8 devices; | ||
171 | u8 smbus_addresses[1]; | ||
172 | }; | ||
173 | |||
174 | /******************************************************************************* | ||
175 | * | ||
176 | * BOOT - Simple Boot Flag Table | ||
177 | * | ||
178 | ******************************************************************************/ | ||
179 | |||
180 | struct acpi_table_boot { | ||
181 | ACPI_TABLE_HEADER_DEF u8 cmos_index; /* Index in CMOS RAM for the boot register */ | ||
182 | u8 reserved[3]; | ||
183 | }; | ||
184 | |||
185 | /******************************************************************************* | ||
186 | * | ||
187 | * CPEP - Corrected Platform Error Polling table | ||
188 | * | ||
189 | ******************************************************************************/ | ||
190 | |||
191 | struct acpi_table_cpep { | ||
192 | ACPI_TABLE_HEADER_DEF u64 reserved; | ||
193 | }; | ||
194 | |||
195 | /* Subtable */ | ||
196 | |||
197 | struct acpi_cpep_polling { | ||
198 | u8 type; | ||
199 | u8 length; | ||
200 | u8 processor_id; /* Processor ID */ | ||
201 | u8 processor_eid; /* Processor EID */ | ||
202 | u32 polling_interval; /* Polling interval (msec) */ | ||
203 | }; | ||
204 | |||
205 | /******************************************************************************* | ||
206 | * | ||
207 | * DBGP - Debug Port table | ||
208 | * | ||
209 | ******************************************************************************/ | ||
210 | |||
211 | struct acpi_table_dbgp { | ||
212 | ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ | ||
213 | u8 reserved[3]; | ||
214 | struct acpi_generic_address debug_port; | ||
215 | }; | ||
216 | |||
217 | /******************************************************************************* | ||
218 | * | ||
219 | * ECDT - Embedded Controller Boot Resources Table | ||
220 | * | ||
221 | ******************************************************************************/ | ||
222 | |||
223 | struct ec_boot_resources { | ||
224 | ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */ | ||
225 | struct acpi_generic_address ec_data; /* Address of EC data register */ | ||
226 | u32 uid; /* Unique ID - must be same as the EC _UID method */ | ||
227 | u8 gpe_bit; /* The GPE for the EC */ | ||
228 | u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ | ||
229 | }; | ||
230 | |||
231 | /******************************************************************************* | ||
232 | * | ||
233 | * HPET - High Precision Event Timer table | ||
234 | * | ||
235 | ******************************************************************************/ | ||
236 | |||
237 | struct acpi_hpet_table { | ||
238 | ACPI_TABLE_HEADER_DEF u32 hardware_id; /* Hardware ID of event timer block */ | ||
239 | struct acpi_generic_address base_address; /* Address of event timer block */ | ||
240 | u8 hpet_number; /* HPET sequence number */ | ||
241 | u16 clock_tick; /* Main counter min tick, periodic mode */ | ||
242 | u8 attributes; | ||
243 | }; | ||
244 | |||
245 | #if 0 /* HPET flags to be converted to macros */ | ||
246 | struct { /* Flags (8 bits) */ | ||
247 | u8 page_protect:1; /* 00: No page protection */ | ||
248 | u8 page_protect4:1; /* 01: 4_kB page protected */ | ||
249 | u8 page_protect64:1; /* 02: 64_kB page protected */ | ||
250 | u8:5; /* 03-07: Reserved, must be zero */ | ||
251 | } flags; | ||
252 | #endif | ||
253 | |||
254 | /******************************************************************************* | ||
255 | * | ||
256 | * MADT - Multiple APIC Description Table | ||
257 | * | ||
258 | ******************************************************************************/ | ||
259 | |||
260 | struct multiple_apic_table { | ||
261 | ACPI_TABLE_HEADER_DEF u32 local_apic_address; /* Physical address of local APIC */ | ||
66 | 262 | ||
67 | /* Flags (32 bits) */ | 263 | /* Flags (32 bits) */ |
68 | 264 | ||
69 | u8 S4bios_f:1; /* 00: S4BIOS support is present */ | 265 | u8 PCATcompat:1; /* 00: System also has dual 8259s */ |
70 | u8:7; /* 01-07: Reserved, must be zero */ | 266 | u8:7; /* 01-07: Reserved, must be zero */ |
71 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | 267 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ |
72 | |||
73 | u8 reserved2[40]; /* Reserved, must be zero */ | ||
74 | }; | 268 | }; |
75 | 269 | ||
270 | /* Values for MADT PCATCompat */ | ||
271 | |||
272 | #define DUAL_PIC 0 | ||
273 | #define MULTIPLE_APIC 1 | ||
274 | |||
275 | /* Common MADT Sub-table header */ | ||
276 | |||
277 | #define APIC_HEADER_DEF \ | ||
278 | u8 type; \ | ||
279 | u8 length; | ||
280 | |||
281 | struct apic_header { | ||
282 | APIC_HEADER_DEF}; | ||
283 | |||
284 | /* Values for Type in struct apic_header */ | ||
285 | |||
286 | #define APIC_PROCESSOR 0 | ||
287 | #define APIC_IO 1 | ||
288 | #define APIC_XRUPT_OVERRIDE 2 | ||
289 | #define APIC_NMI 3 | ||
290 | #define APIC_LOCAL_NMI 4 | ||
291 | #define APIC_ADDRESS_OVERRIDE 5 | ||
292 | #define APIC_IO_SAPIC 6 | ||
293 | #define APIC_LOCAL_SAPIC 7 | ||
294 | #define APIC_XRUPT_SOURCE 8 | ||
295 | #define APIC_RESERVED 9 /* 9 and greater are reserved */ | ||
296 | |||
297 | /* Flag definitions for MADT sub-tables */ | ||
298 | |||
299 | #define ACPI_MADT_IFLAGS /* INTI flags (16 bits) */ \ | ||
300 | u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ | ||
301 | u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ | ||
302 | u8 : 4; /* 04-07: Reserved, must be zero */\ | ||
303 | u8 reserved1; /* 08-15: Reserved, must be zero */ | ||
304 | |||
305 | #define ACPI_MADT_LFLAGS /* Local Sapic flags (32 bits) */ \ | ||
306 | u8 processor_enabled: 1; /* 00: Processor is usable if set */\ | ||
307 | u8 : 7; /* 01-07: Reserved, must be zero */\ | ||
308 | u8 reserved2[3]; /* 08-31: Reserved, must be zero */ | ||
309 | |||
310 | /* Values for MPS INTI flags */ | ||
311 | |||
312 | #define POLARITY_CONFORMS 0 | ||
313 | #define POLARITY_ACTIVE_HIGH 1 | ||
314 | #define POLARITY_RESERVED 2 | ||
315 | #define POLARITY_ACTIVE_LOW 3 | ||
316 | |||
317 | #define TRIGGER_CONFORMS 0 | ||
318 | #define TRIGGER_EDGE 1 | ||
319 | #define TRIGGER_RESERVED 2 | ||
320 | #define TRIGGER_LEVEL 3 | ||
321 | |||
76 | /* | 322 | /* |
77 | * ACPI 1.0 Fixed ACPI Description Table (FADT) | 323 | * MADT Sub-tables, correspond to Type in struct apic_header |
78 | */ | 324 | */ |
79 | struct fadt_descriptor_rev1 { | 325 | |
80 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 326 | /* 0: processor APIC */ |
81 | u32 firmware_ctrl; /* Physical address of FACS */ | 327 | |
82 | u32 dsdt; /* Physical address of DSDT */ | 328 | struct madt_processor_apic { |
83 | u8 model; /* System Interrupt Model */ | 329 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
84 | u8 reserved1; /* Reserved, must be zero */ | 330 | u8 local_apic_id; /* Processor's local APIC id */ |
85 | u16 sci_int; /* System vector of SCI interrupt */ | 331 | ACPI_MADT_LFLAGS}; |
86 | u32 smi_cmd; /* Port address of SMI command port */ | 332 | |
87 | u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ | 333 | /* 1: IO APIC */ |
88 | u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ | 334 | |
89 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ | 335 | struct madt_io_apic { |
90 | u8 reserved2; /* Reserved, must be zero */ | 336 | APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ |
91 | u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ | 337 | u8 reserved; /* Reserved - must be zero */ |
92 | u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ | 338 | u32 address; /* APIC physical address */ |
93 | u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ | 339 | u32 interrupt; /* Global system interrupt where INTI lines start */ |
94 | u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ | 340 | }; |
95 | u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ | 341 | |
96 | u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ | 342 | /* 2: Interrupt Override */ |
97 | u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ | 343 | |
98 | u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ | 344 | struct madt_interrupt_override { |
99 | u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ | 345 | APIC_HEADER_DEF u8 bus; /* 0 - ISA */ |
100 | u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ | 346 | u8 source; /* Interrupt source (IRQ) */ |
101 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ | 347 | u32 interrupt; /* Global system interrupt */ |
102 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ | 348 | ACPI_MADT_IFLAGS}; |
103 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ | 349 | |
104 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ | 350 | /* 3: NMI Sources */ |
105 | u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ | 351 | |
106 | u8 reserved3; /* Reserved, must be zero */ | 352 | struct madt_nmi_source { |
107 | u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ | 353 | APIC_HEADER_DEF ACPI_MADT_IFLAGS u32 interrupt; /* Global system interrupt */ |
108 | u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ | 354 | }; |
109 | u16 flush_size; /* Size of area read to flush caches */ | 355 | |
110 | u16 flush_stride; /* Stride used in flushing caches */ | 356 | /* 4: Local APIC NMI */ |
111 | u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ | 357 | |
112 | u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ | 358 | struct madt_local_apic_nmi { |
113 | u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ | 359 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
114 | u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ | 360 | ACPI_MADT_IFLAGS u8 lint; /* LINTn to which NMI is connected */ |
115 | u8 century; /* Index to century in RTC CMOS RAM */ | 361 | }; |
116 | u8 reserved4[3]; /* Reserved, must be zero */ | 362 | |
363 | /* 5: Address Override */ | ||
364 | |||
365 | struct madt_address_override { | ||
366 | APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ | ||
367 | u64 address; /* APIC physical address */ | ||
368 | }; | ||
369 | |||
370 | /* 6: I/O Sapic */ | ||
371 | |||
372 | struct madt_io_sapic { | ||
373 | APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ | ||
374 | u8 reserved; /* Reserved, must be zero */ | ||
375 | u32 interrupt_base; /* Glocal interrupt for SAPIC start */ | ||
376 | u64 address; /* SAPIC physical address */ | ||
377 | }; | ||
378 | |||
379 | /* 7: Local Sapic */ | ||
380 | |||
381 | struct madt_local_sapic { | ||
382 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ | ||
383 | u8 local_sapic_id; /* SAPIC ID */ | ||
384 | u8 local_sapic_eid; /* SAPIC EID */ | ||
385 | u8 reserved[3]; /* Reserved, must be zero */ | ||
386 | ACPI_MADT_LFLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ | ||
387 | char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ | ||
388 | }; | ||
389 | |||
390 | /* 8: Platform Interrupt Source */ | ||
391 | |||
392 | struct madt_interrupt_source { | ||
393 | APIC_HEADER_DEF ACPI_MADT_IFLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ | ||
394 | u8 processor_id; /* Processor ID */ | ||
395 | u8 processor_eid; /* Processor EID */ | ||
396 | u8 io_sapic_vector; /* Vector value for PMI interrupts */ | ||
397 | u32 interrupt; /* Global system interrupt */ | ||
398 | u32 flags; /* Interrupt Source Flags */ | ||
399 | }; | ||
400 | |||
401 | #ifdef DUPLICATE_DEFINITION_WITH_LINUX_ACPI_H | ||
402 | /******************************************************************************* | ||
403 | * | ||
404 | * MCFG - PCI Memory Mapped Configuration table and sub-table | ||
405 | * | ||
406 | ******************************************************************************/ | ||
407 | |||
408 | struct acpi_table_mcfg { | ||
409 | ACPI_TABLE_HEADER_DEF u8 reserved[8]; | ||
410 | }; | ||
411 | |||
412 | struct acpi_mcfg_allocation { | ||
413 | u64 base_address; /* Base address, processor-relative */ | ||
414 | u16 pci_segment; /* PCI segment group number */ | ||
415 | u8 start_bus_number; /* Starting PCI Bus number */ | ||
416 | u8 end_bus_number; /* Final PCI Bus number */ | ||
417 | u32 reserved; | ||
418 | }; | ||
419 | #endif | ||
420 | |||
421 | /******************************************************************************* | ||
422 | * | ||
423 | * SBST - Smart Battery Specification Table | ||
424 | * | ||
425 | ******************************************************************************/ | ||
426 | |||
427 | struct smart_battery_table { | ||
428 | ACPI_TABLE_HEADER_DEF u32 warning_level; | ||
429 | u32 low_level; | ||
430 | u32 critical_level; | ||
431 | }; | ||
432 | |||
433 | /******************************************************************************* | ||
434 | * | ||
435 | * SLIT - System Locality Distance Information Table | ||
436 | * | ||
437 | ******************************************************************************/ | ||
438 | |||
439 | struct system_locality_info { | ||
440 | ACPI_TABLE_HEADER_DEF u64 locality_count; | ||
441 | u8 entry[1][1]; | ||
442 | }; | ||
443 | |||
444 | /******************************************************************************* | ||
445 | * | ||
446 | * SPCR - Serial Port Console Redirection table | ||
447 | * | ||
448 | ******************************************************************************/ | ||
449 | |||
450 | struct acpi_table_spcr { | ||
451 | ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ | ||
452 | u8 reserved[3]; | ||
453 | struct acpi_generic_address serial_port; | ||
454 | u8 interrupt_type; | ||
455 | u8 pc_interrupt; | ||
456 | u32 interrupt; | ||
457 | u8 baud_rate; | ||
458 | u8 parity; | ||
459 | u8 stop_bits; | ||
460 | u8 flow_control; | ||
461 | u8 terminal_type; | ||
462 | u8 reserved2; | ||
463 | u16 pci_device_id; | ||
464 | u16 pci_vendor_id; | ||
465 | u8 pci_bus; | ||
466 | u8 pci_device; | ||
467 | u8 pci_function; | ||
468 | u32 pci_flags; | ||
469 | u8 pci_segment; | ||
470 | u32 reserved3; | ||
471 | }; | ||
472 | |||
473 | /******************************************************************************* | ||
474 | * | ||
475 | * SPMI - Server Platform Management Interface table | ||
476 | * | ||
477 | ******************************************************************************/ | ||
478 | |||
479 | struct acpi_table_spmi { | ||
480 | ACPI_TABLE_HEADER_DEF u8 reserved; | ||
481 | u8 interface_type; | ||
482 | u16 spec_revision; /* Version of IPMI */ | ||
483 | u8 interrupt_type; | ||
484 | u8 gpe_number; /* GPE assigned */ | ||
485 | u8 reserved2; | ||
486 | u8 pci_device_flag; | ||
487 | u32 interrupt; | ||
488 | struct acpi_generic_address ipmi_register; | ||
489 | u8 pci_segment; | ||
490 | u8 pci_bus; | ||
491 | u8 pci_device; | ||
492 | u8 pci_function; | ||
493 | }; | ||
494 | |||
495 | /******************************************************************************* | ||
496 | * | ||
497 | * SRAT - System Resource Affinity Table | ||
498 | * | ||
499 | ******************************************************************************/ | ||
500 | |||
501 | struct system_resource_affinity { | ||
502 | ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ | ||
503 | u64 reserved2; /* Reserved, must be zero */ | ||
504 | }; | ||
505 | |||
506 | /* SRAT common sub-table header */ | ||
507 | |||
508 | #define SRAT_SUBTABLE_HEADER \ | ||
509 | u8 type; \ | ||
510 | u8 length; | ||
511 | |||
512 | /* Values for Type above */ | ||
513 | |||
514 | #define SRAT_CPU_AFFINITY 0 | ||
515 | #define SRAT_MEMORY_AFFINITY 1 | ||
516 | #define SRAT_RESERVED 2 | ||
517 | |||
518 | /* SRAT sub-tables */ | ||
519 | |||
520 | struct static_resource_alloc { | ||
521 | SRAT_SUBTABLE_HEADER u8 proximity_domain_lo; | ||
522 | u8 apic_id; | ||
523 | |||
524 | /* Flags (32 bits) */ | ||
525 | |||
526 | u8 enabled:1; /* 00: Use affinity structure */ | ||
527 | u8:7; /* 01-07: Reserved, must be zero */ | ||
528 | u8 reserved3[3]; /* 08-31: Reserved, must be zero */ | ||
529 | |||
530 | u8 local_sapic_eid; | ||
531 | u8 proximity_domain_hi[3]; | ||
532 | u32 reserved4; /* Reserved, must be zero */ | ||
533 | }; | ||
534 | |||
535 | struct memory_affinity { | ||
536 | SRAT_SUBTABLE_HEADER u32 proximity_domain; | ||
537 | u16 reserved3; | ||
538 | u64 base_address; | ||
539 | u64 address_length; | ||
540 | u32 reserved4; | ||
117 | 541 | ||
118 | /* Flags (32 bits) */ | 542 | /* Flags (32 bits) */ |
119 | 543 | ||
120 | u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ | 544 | u8 enabled:1; /* 00: Use affinity structure */ |
121 | u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ | 545 | u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */ |
122 | u8 proc_c1:1; /* 02: All processors support C1 state */ | 546 | u8 non_volatile:1; /* 02: Memory is non-volatile */ |
123 | u8 plvl2_up:1; /* 03: C2 state works on MP system */ | 547 | u8:5; /* 03-07: Reserved, must be zero */ |
124 | u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ | 548 | u8 reserved5[3]; /* 08-31: Reserved, must be zero */ |
125 | u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ | 549 | |
126 | u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ | 550 | u64 reserved6; /* Reserved, must be zero */ |
127 | u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ | 551 | }; |
128 | u8 tmr_val_ext:1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */ | 552 | |
129 | u8:7; /* 09-15: Reserved, must be zero */ | 553 | /******************************************************************************* |
130 | u8 reserved5[2]; /* 16-31: Reserved, must be zero */ | 554 | * |
555 | * TCPA - Trusted Computing Platform Alliance table | ||
556 | * | ||
557 | ******************************************************************************/ | ||
558 | |||
559 | struct acpi_table_tcpa { | ||
560 | ACPI_TABLE_HEADER_DEF u16 reserved; | ||
561 | u32 max_log_length; /* Maximum length for the event log area */ | ||
562 | u64 log_address; /* Address of the event log area */ | ||
131 | }; | 563 | }; |
132 | 564 | ||
565 | /******************************************************************************* | ||
566 | * | ||
567 | * WDRT - Watchdog Resource Table | ||
568 | * | ||
569 | ******************************************************************************/ | ||
570 | |||
571 | struct acpi_table_wdrt { | ||
572 | ACPI_TABLE_HEADER_DEF u32 header_length; /* Watchdog Header Length */ | ||
573 | u8 pci_segment; /* PCI Segment number */ | ||
574 | u8 pci_bus; /* PCI Bus number */ | ||
575 | u8 pci_device; /* PCI Device number */ | ||
576 | u8 pci_function; /* PCI Function number */ | ||
577 | u32 timer_period; /* Period of one timer count (msec) */ | ||
578 | u32 max_count; /* Maximum counter value supported */ | ||
579 | u32 min_count; /* Minimum counter value */ | ||
580 | u8 flags; | ||
581 | u8 reserved[3]; | ||
582 | u32 entries; /* Number of watchdog entries that follow */ | ||
583 | }; | ||
584 | |||
585 | #if 0 /* Flags, will be converted to macros */ | ||
586 | u8 enabled:1; /* 00: Timer enabled */ | ||
587 | u8:6; /* 01-06: Reserved */ | ||
588 | u8 sleep_stop:1; /* 07: Timer stopped in sleep state */ | ||
589 | #endif | ||
590 | |||
591 | /* Macros used to generate offsets to specific table fields */ | ||
592 | |||
593 | #define ACPI_ASF0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_info,f) | ||
594 | #define ACPI_ASF1_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_alert,f) | ||
595 | #define ACPI_ASF2_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_remote,f) | ||
596 | #define ACPI_ASF3_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_rmcp,f) | ||
597 | #define ACPI_ASF4_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_address,f) | ||
598 | #define ACPI_BOOT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_boot,f) | ||
599 | #define ACPI_CPEP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_cpep,f) | ||
600 | #define ACPI_CPEP0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_cpep_polling,f) | ||
601 | #define ACPI_DBGP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_dbgp,f) | ||
602 | #define ACPI_ECDT_OFFSET(f) (u8) ACPI_OFFSET (struct ec_boot_resources,f) | ||
603 | #define ACPI_HPET_OFFSET(f) (u8) ACPI_OFFSET (struct hpet_table,f) | ||
604 | #define ACPI_MADT_OFFSET(f) (u8) ACPI_OFFSET (struct multiple_apic_table,f) | ||
605 | #define ACPI_MADT0_OFFSET(f) (u8) ACPI_OFFSET (struct madt_processor_apic,f) | ||
606 | #define ACPI_MADT1_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_apic,f) | ||
607 | #define ACPI_MADT2_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_override,f) | ||
608 | #define ACPI_MADT3_OFFSET(f) (u8) ACPI_OFFSET (struct madt_nmi_source,f) | ||
609 | #define ACPI_MADT4_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_apic_nmi,f) | ||
610 | #define ACPI_MADT5_OFFSET(f) (u8) ACPI_OFFSET (struct madt_address_override,f) | ||
611 | #define ACPI_MADT6_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_sapic,f) | ||
612 | #define ACPI_MADT7_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_sapic,f) | ||
613 | #define ACPI_MADT8_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_source,f) | ||
614 | #define ACPI_MADTH_OFFSET(f) (u8) ACPI_OFFSET (struct apic_header,f) | ||
615 | #define ACPI_MCFG_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_mcfg,f) | ||
616 | #define ACPI_MCFG0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_mcfg_allocation,f) | ||
617 | #define ACPI_SBST_OFFSET(f) (u8) ACPI_OFFSET (struct smart_battery_table,f) | ||
618 | #define ACPI_SLIT_OFFSET(f) (u8) ACPI_OFFSET (struct system_locality_info,f) | ||
619 | #define ACPI_SPCR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spcr,f) | ||
620 | #define ACPI_SPMI_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spmi,f) | ||
621 | #define ACPI_SRAT_OFFSET(f) (u8) ACPI_OFFSET (struct system_resource_affinity,f) | ||
622 | #define ACPI_SRAT0_OFFSET(f) (u8) ACPI_OFFSET (struct static_resource_alloc,f) | ||
623 | #define ACPI_SRAT1_OFFSET(f) (u8) ACPI_OFFSET (struct memory_affinity,f) | ||
624 | #define ACPI_TCPA_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_tcpa,f) | ||
625 | #define ACPI_WDRT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_wdrt,f) | ||
626 | |||
627 | #define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct hpet_table,f,o) | ||
628 | #define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct static_resource_alloc,f,o) | ||
629 | #define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct memory_affinity,f,o) | ||
630 | #define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct multiple_apic_table,f,o) | ||
631 | #define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_processor_apic,f,o) | ||
632 | #define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_override,f,o) | ||
633 | #define ACPI_MADT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_nmi_source,f,o) | ||
634 | #define ACPI_MADT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_apic_nmi,f,o) | ||
635 | #define ACPI_MADT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_sapic,f,o) | ||
636 | #define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_source,f,o) | ||
637 | |||
638 | /* Reset to default packing */ | ||
639 | |||
133 | #pragma pack() | 640 | #pragma pack() |
134 | 641 | ||
135 | #endif /* __ACTBL1_H__ */ | 642 | #endif /* __ACTBL1_H__ */ |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index dfc7ac1094bb..67efe6cad27b 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
@@ -44,234 +44,6 @@ | |||
44 | #ifndef __ACTBL2_H__ | 44 | #ifndef __ACTBL2_H__ |
45 | #define __ACTBL2_H__ | 45 | #define __ACTBL2_H__ |
46 | 46 | ||
47 | /* | 47 | /* Code moved to both actbl.h and actbl1.h */ |
48 | * Prefered Power Management Profiles | ||
49 | */ | ||
50 | #define PM_UNSPECIFIED 0 | ||
51 | #define PM_DESKTOP 1 | ||
52 | #define PM_MOBILE 2 | ||
53 | #define PM_WORKSTATION 3 | ||
54 | #define PM_ENTERPRISE_SERVER 4 | ||
55 | #define PM_SOHO_SERVER 5 | ||
56 | #define PM_APPLIANCE_PC 6 | ||
57 | |||
58 | /* | ||
59 | * ACPI Boot Arch Flags | ||
60 | */ | ||
61 | #define BAF_LEGACY_DEVICES 0x0001 | ||
62 | #define BAF_8042_KEYBOARD_CONTROLLER 0x0002 | ||
63 | |||
64 | #define FADT2_REVISION_ID 3 | ||
65 | #define FADT2_MINUS_REVISION_ID 2 | ||
66 | |||
67 | #pragma pack(1) | ||
68 | |||
69 | /* | ||
70 | * ACPI 2.0 Root System Description Table (RSDT) | ||
71 | */ | ||
72 | struct rsdt_descriptor_rev2 { | ||
73 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | ||
74 | u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | ||
75 | }; | ||
76 | |||
77 | /* | ||
78 | * ACPI 2.0 Extended System Description Table (XSDT) | ||
79 | */ | ||
80 | struct xsdt_descriptor_rev2 { | ||
81 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | ||
82 | u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | ||
83 | }; | ||
84 | |||
85 | /* | ||
86 | * ACPI 2.0 Firmware ACPI Control Structure (FACS) | ||
87 | */ | ||
88 | struct facs_descriptor_rev2 { | ||
89 | char signature[4]; /* ASCII table signature */ | ||
90 | u32 length; /* Length of structure, in bytes */ | ||
91 | u32 hardware_signature; /* Hardware configuration signature */ | ||
92 | u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */ | ||
93 | u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ | ||
94 | |||
95 | /* Flags (32 bits) */ | ||
96 | |||
97 | u8 S4bios_f:1; /* 00: S4BIOS support is present */ | ||
98 | u8:7; /* 01-07: Reserved, must be zero */ | ||
99 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | ||
100 | |||
101 | u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */ | ||
102 | u8 version; /* Version of this table */ | ||
103 | u8 reserved3[31]; /* Reserved, must be zero */ | ||
104 | }; | ||
105 | |||
106 | /* | ||
107 | * ACPI 2.0+ Generic Address Structure (GAS) | ||
108 | */ | ||
109 | struct acpi_generic_address { | ||
110 | u8 address_space_id; /* Address space where struct or register exists. */ | ||
111 | u8 register_bit_width; /* Size in bits of given register */ | ||
112 | u8 register_bit_offset; /* Bit offset within the register */ | ||
113 | u8 access_width; /* Minimum Access size (ACPI 3.0) */ | ||
114 | u64 address; /* 64-bit address of struct or register */ | ||
115 | }; | ||
116 | |||
117 | #define FADT_REV2_COMMON \ | ||
118 | u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ | ||
119 | u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ | ||
120 | u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \ | ||
121 | u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \ | ||
122 | u16 sci_int; /* System vector of SCI interrupt */ \ | ||
123 | u32 smi_cmd; /* Port address of SMI command port */ \ | ||
124 | u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ \ | ||
125 | u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ \ | ||
126 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \ | ||
127 | u8 pstate_cnt; /* Processor performance state control*/ \ | ||
128 | u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ \ | ||
129 | u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ \ | ||
130 | u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \ | ||
131 | u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \ | ||
132 | u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \ | ||
133 | u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \ | ||
134 | u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \ | ||
135 | u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \ | ||
136 | u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ \ | ||
137 | u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ \ | ||
138 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \ | ||
139 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \ | ||
140 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \ | ||
141 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \ | ||
142 | u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \ | ||
143 | u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \ | ||
144 | u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \ | ||
145 | u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \ | ||
146 | u16 flush_size; /* Number of flush strides that need to be read */ \ | ||
147 | u16 flush_stride; /* Processor's memory cache line width, in bytes */ \ | ||
148 | u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ \ | ||
149 | u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \ | ||
150 | u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \ | ||
151 | u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \ | ||
152 | u8 century; /* Index to century in RTC CMOS RAM */ \ | ||
153 | u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ | ||
154 | |||
155 | /* | ||
156 | * ACPI 2.0+ Fixed ACPI Description Table (FADT) | ||
157 | */ | ||
158 | struct fadt_descriptor_rev2 { | ||
159 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | ||
160 | FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */ | ||
161 | |||
162 | /* Flags (32 bits) */ | ||
163 | |||
164 | u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ | ||
165 | u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ | ||
166 | u8 proc_c1:1; /* 02: All processors support C1 state */ | ||
167 | u8 plvl2_up:1; /* 03: C2 state works on MP system */ | ||
168 | u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ | ||
169 | u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ | ||
170 | u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ | ||
171 | u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ | ||
172 | u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */ | ||
173 | u8 dock_cap:1; /* 09: Docking supported */ | ||
174 | u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */ | ||
175 | u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */ | ||
176 | u8 headless:1; /* 12: No local video capabilities or local input devices */ | ||
177 | u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */ | ||
178 | |||
179 | u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ | ||
180 | u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */ | ||
181 | u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ | ||
182 | u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */ | ||
183 | u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ | ||
184 | u8 force_apic_physical_destination_mode:1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */ | ||
185 | u8:4; /* 20-23: Reserved, must be zero */ | ||
186 | u8 reserved3; /* 24-31: Reserved, must be zero */ | ||
187 | |||
188 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | ||
189 | u8 reset_value; /* Value to write to the reset_register port to reset the system */ | ||
190 | u8 reserved4[3]; /* These three bytes must be zero */ | ||
191 | u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ | ||
192 | u64 Xdsdt; /* 64-bit physical address of DSDT */ | ||
193 | struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ | ||
194 | struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ | ||
195 | struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ | ||
196 | struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ | ||
197 | struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ | ||
198 | struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ | ||
199 | struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ | ||
200 | struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ | ||
201 | }; | ||
202 | |||
203 | /* "Down-revved" ACPI 2.0 FADT descriptor */ | ||
204 | |||
205 | struct fadt_descriptor_rev2_minus { | ||
206 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | ||
207 | FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */ | ||
208 | u32 flags; | ||
209 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | ||
210 | u8 reset_value; /* Value to write to the reset_register port to reset the system. */ | ||
211 | u8 reserved7[3]; /* Reserved, must be zero */ | ||
212 | }; | ||
213 | |||
214 | /* ECDT - Embedded Controller Boot Resources Table */ | ||
215 | |||
216 | struct ec_boot_resources { | ||
217 | ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */ | ||
218 | struct acpi_generic_address ec_data; /* Address of EC data register */ | ||
219 | u32 uid; /* Unique ID - must be same as the EC _UID method */ | ||
220 | u8 gpe_bit; /* The GPE for the EC */ | ||
221 | u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ | ||
222 | }; | ||
223 | |||
224 | /* SRAT - System Resource Affinity Table */ | ||
225 | |||
226 | struct static_resource_alloc { | ||
227 | u8 type; | ||
228 | u8 length; | ||
229 | u8 proximity_domain_lo; | ||
230 | u8 apic_id; | ||
231 | |||
232 | /* Flags (32 bits) */ | ||
233 | |||
234 | u8 enabled:1; /* 00: Use affinity structure */ | ||
235 | u8:7; /* 01-07: Reserved, must be zero */ | ||
236 | u8 reserved3[3]; /* 08-31: Reserved, must be zero */ | ||
237 | |||
238 | u8 local_sapic_eid; | ||
239 | u8 proximity_domain_hi[3]; | ||
240 | u32 reserved4; /* Reserved, must be zero */ | ||
241 | }; | ||
242 | |||
243 | struct memory_affinity { | ||
244 | u8 type; | ||
245 | u8 length; | ||
246 | u32 proximity_domain; | ||
247 | u16 reserved3; | ||
248 | u64 base_address; | ||
249 | u64 address_length; | ||
250 | u32 reserved4; | ||
251 | |||
252 | /* Flags (32 bits) */ | ||
253 | |||
254 | u8 enabled:1; /* 00: Use affinity structure */ | ||
255 | u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */ | ||
256 | u8 non_volatile:1; /* 02: Memory is non-volatile */ | ||
257 | u8:5; /* 03-07: Reserved, must be zero */ | ||
258 | u8 reserved5[3]; /* 08-31: Reserved, must be zero */ | ||
259 | |||
260 | u64 reserved6; /* Reserved, must be zero */ | ||
261 | }; | ||
262 | |||
263 | struct system_resource_affinity { | ||
264 | ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ | ||
265 | u64 reserved2; /* Reserved, must be zero */ | ||
266 | }; | ||
267 | |||
268 | /* SLIT - System Locality Distance Information Table */ | ||
269 | |||
270 | struct system_locality_info { | ||
271 | ACPI_TABLE_HEADER_DEF u64 locality_count; | ||
272 | u8 entry[1][1]; | ||
273 | }; | ||
274 | |||
275 | #pragma pack() | ||
276 | 48 | ||
277 | #endif /* __ACTBL2_H__ */ | 49 | #endif /* __ACTBL2_H__ */ |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 7ca89cde706e..77cf1236b05a 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -44,6 +44,8 @@ | |||
44 | #ifndef __ACTYPES_H__ | 44 | #ifndef __ACTYPES_H__ |
45 | #define __ACTYPES_H__ | 45 | #define __ACTYPES_H__ |
46 | 46 | ||
47 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
48 | |||
47 | /* | 49 | /* |
48 | * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header | 50 | * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header |
49 | * and must be either 16, 32, or 64 | 51 | * and must be either 16, 32, or 64 |
@@ -154,7 +156,6 @@ typedef u64 acpi_physical_address; | |||
154 | #define ACPI_MAX_PTR ACPI_UINT64_MAX | 156 | #define ACPI_MAX_PTR ACPI_UINT64_MAX |
155 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX | 157 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX |
156 | 158 | ||
157 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000008 | ||
158 | #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ | 159 | #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ |
159 | 160 | ||
160 | /* | 161 | /* |
@@ -195,8 +196,6 @@ typedef u64 acpi_physical_address; | |||
195 | #define ACPI_MAX_PTR ACPI_UINT32_MAX | 196 | #define ACPI_MAX_PTR ACPI_UINT32_MAX |
196 | #define ACPI_SIZE_MAX ACPI_UINT32_MAX | 197 | #define ACPI_SIZE_MAX ACPI_UINT32_MAX |
197 | 198 | ||
198 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 | ||
199 | |||
200 | /******************************************************************************* | 199 | /******************************************************************************* |
201 | * | 200 | * |
202 | * Types specific to 16-bit targets | 201 | * Types specific to 16-bit targets |
@@ -223,7 +222,6 @@ typedef char *acpi_physical_address; | |||
223 | #define ACPI_MAX_PTR ACPI_UINT16_MAX | 222 | #define ACPI_MAX_PTR ACPI_UINT16_MAX |
224 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX | 223 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX |
225 | 224 | ||
226 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 | ||
227 | #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ | 225 | #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ |
228 | 226 | ||
229 | /* 64-bit integers cannot be supported */ | 227 | /* 64-bit integers cannot be supported */ |
@@ -254,7 +252,7 @@ typedef acpi_native_uint acpi_size; | |||
254 | /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ | 252 | /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ |
255 | 253 | ||
256 | #ifndef acpi_uintptr_t | 254 | #ifndef acpi_uintptr_t |
257 | #define acpi_uintptr_t void * | 255 | #define acpi_uintptr_t void * |
258 | #endif | 256 | #endif |
259 | 257 | ||
260 | /* | 258 | /* |
@@ -263,7 +261,7 @@ typedef acpi_native_uint acpi_size; | |||
263 | * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) | 261 | * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) |
264 | */ | 262 | */ |
265 | #ifndef acpi_cache_t | 263 | #ifndef acpi_cache_t |
266 | #define acpi_cache_t struct acpi_memory_list | 264 | #define acpi_cache_t struct acpi_memory_list |
267 | #endif | 265 | #endif |
268 | 266 | ||
269 | /* | 267 | /* |
@@ -271,7 +269,7 @@ typedef acpi_native_uint acpi_size; | |||
271 | * lock and unlock OSL interfaces. | 269 | * lock and unlock OSL interfaces. |
272 | */ | 270 | */ |
273 | #ifndef acpi_cpu_flags | 271 | #ifndef acpi_cpu_flags |
274 | #define acpi_cpu_flags acpi_native_uint | 272 | #define acpi_cpu_flags acpi_native_uint |
275 | #endif | 273 | #endif |
276 | 274 | ||
277 | /* | 275 | /* |
@@ -292,6 +290,21 @@ typedef acpi_native_uint acpi_size; | |||
292 | #define ACPI_UNUSED_VAR | 290 | #define ACPI_UNUSED_VAR |
293 | #endif | 291 | #endif |
294 | 292 | ||
293 | /* | ||
294 | * All ACPICA functions that are available to the rest of the kernel are | ||
295 | * tagged with this macro which can be defined as appropriate for the host. | ||
296 | */ | ||
297 | #ifndef ACPI_EXPORT_SYMBOL | ||
298 | #define ACPI_EXPORT_SYMBOL(symbol) | ||
299 | #endif | ||
300 | |||
301 | /* | ||
302 | * thread_id is returned by acpi_os_get_thread_id. | ||
303 | */ | ||
304 | #ifndef acpi_thread_id | ||
305 | #define acpi_thread_id acpi_native_uint | ||
306 | #endif | ||
307 | |||
295 | /******************************************************************************* | 308 | /******************************************************************************* |
296 | * | 309 | * |
297 | * Independent types | 310 | * Independent types |
@@ -477,15 +490,15 @@ typedef u64 acpi_integer; | |||
477 | */ | 490 | */ |
478 | typedef u32 acpi_table_type; | 491 | typedef u32 acpi_table_type; |
479 | 492 | ||
480 | #define ACPI_TABLE_RSDP (acpi_table_type) 0 | 493 | #define ACPI_TABLE_ID_RSDP (acpi_table_type) 0 |
481 | #define ACPI_TABLE_DSDT (acpi_table_type) 1 | 494 | #define ACPI_TABLE_ID_DSDT (acpi_table_type) 1 |
482 | #define ACPI_TABLE_FADT (acpi_table_type) 2 | 495 | #define ACPI_TABLE_ID_FADT (acpi_table_type) 2 |
483 | #define ACPI_TABLE_FACS (acpi_table_type) 3 | 496 | #define ACPI_TABLE_ID_FACS (acpi_table_type) 3 |
484 | #define ACPI_TABLE_PSDT (acpi_table_type) 4 | 497 | #define ACPI_TABLE_ID_PSDT (acpi_table_type) 4 |
485 | #define ACPI_TABLE_SSDT (acpi_table_type) 5 | 498 | #define ACPI_TABLE_ID_SSDT (acpi_table_type) 5 |
486 | #define ACPI_TABLE_XSDT (acpi_table_type) 6 | 499 | #define ACPI_TABLE_ID_XSDT (acpi_table_type) 6 |
487 | #define ACPI_TABLE_MAX 6 | 500 | #define ACPI_TABLE_ID_MAX 6 |
488 | #define NUM_ACPI_TABLE_TYPES (ACPI_TABLE_MAX+1) | 501 | #define ACPI_NUM_TABLE_TYPES (ACPI_TABLE_ID_MAX+1) |
489 | 502 | ||
490 | /* | 503 | /* |
491 | * Types associated with ACPI names and objects. The first group of | 504 | * Types associated with ACPI names and objects. The first group of |
@@ -816,7 +829,7 @@ struct acpi_system_info { | |||
816 | u32 debug_level; | 829 | u32 debug_level; |
817 | u32 debug_layer; | 830 | u32 debug_layer; |
818 | u32 num_table_types; | 831 | u32 num_table_types; |
819 | struct acpi_table_info table_info[NUM_ACPI_TABLE_TYPES]; | 832 | struct acpi_table_info table_info[ACPI_TABLE_ID_MAX + 1]; |
820 | }; | 833 | }; |
821 | 834 | ||
822 | /* | 835 | /* |
@@ -858,7 +871,7 @@ acpi_status(*acpi_adr_space_handler) (u32 function, | |||
858 | void *handler_context, | 871 | void *handler_context, |
859 | void *region_context); | 872 | void *region_context); |
860 | 873 | ||
861 | #define ACPI_DEFAULT_HANDLER NULL | 874 | #define ACPI_DEFAULT_HANDLER NULL |
862 | 875 | ||
863 | typedef | 876 | typedef |
864 | acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, | 877 | acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, |
@@ -911,12 +924,13 @@ struct acpi_compatible_id_list { | |||
911 | #define ACPI_STA_DEVICE_PRESENT 0x01 | 924 | #define ACPI_STA_DEVICE_PRESENT 0x01 |
912 | #define ACPI_STA_DEVICE_ENABLED 0x02 | 925 | #define ACPI_STA_DEVICE_ENABLED 0x02 |
913 | #define ACPI_STA_DEVICE_UI 0x04 | 926 | #define ACPI_STA_DEVICE_UI 0x04 |
914 | #define ACPI_STA_DEVICE_OK 0x08 | 927 | #define ACPI_STA_DEVICE_FUNCTIONING 0x08 |
928 | #define ACPI_STA_DEVICE_OK 0x08 /* Synonym */ | ||
915 | #define ACPI_STA_BATTERY_PRESENT 0x10 | 929 | #define ACPI_STA_BATTERY_PRESENT 0x10 |
916 | 930 | ||
917 | #define ACPI_COMMON_OBJ_INFO \ | 931 | #define ACPI_COMMON_OBJ_INFO \ |
918 | acpi_object_type type; /* ACPI object type */ \ | 932 | acpi_object_type type; /* ACPI object type */ \ |
919 | acpi_name name /* ACPI object Name */ | 933 | acpi_name name /* ACPI object Name */ |
920 | 934 | ||
921 | struct acpi_obj_info_header { | 935 | struct acpi_obj_info_header { |
922 | ACPI_COMMON_OBJ_INFO; | 936 | ACPI_COMMON_OBJ_INFO; |
@@ -957,7 +971,7 @@ struct acpi_mem_space_context { | |||
957 | * Definitions for Resource Attributes | 971 | * Definitions for Resource Attributes |
958 | */ | 972 | */ |
959 | typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ | 973 | typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ |
960 | typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */ | 974 | typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */ |
961 | 975 | ||
962 | /* | 976 | /* |
963 | * Memory Attributes | 977 | * Memory Attributes |
@@ -972,8 +986,8 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (6 | |||
972 | 986 | ||
973 | /* | 987 | /* |
974 | * IO Attributes | 988 | * IO Attributes |
975 | * The ISA Io ranges are: n000-n0_ffh, n400-n4_ffh, n800-n8_ffh, n_c00-n_cFFh. | 989 | * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. |
976 | * The non-ISA Io ranges are: n100-n3_ffh, n500-n7_ffh, n900-n_bFfh, n_cd0-n_fFFh. | 990 | * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh. |
977 | */ | 991 | */ |
978 | #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 | 992 | #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 |
979 | #define ACPI_ISA_ONLY_RANGES (u8) 0x02 | 993 | #define ACPI_ISA_ONLY_RANGES (u8) 0x02 |
@@ -1171,12 +1185,12 @@ struct acpi_resource_source { | |||
1171 | /* Fields common to all address descriptors, 16/32/64 bit */ | 1185 | /* Fields common to all address descriptors, 16/32/64 bit */ |
1172 | 1186 | ||
1173 | #define ACPI_RESOURCE_ADDRESS_COMMON \ | 1187 | #define ACPI_RESOURCE_ADDRESS_COMMON \ |
1174 | u8 resource_type; \ | 1188 | u8 resource_type; \ |
1175 | u8 producer_consumer; \ | 1189 | u8 producer_consumer; \ |
1176 | u8 decode; \ | 1190 | u8 decode; \ |
1177 | u8 min_address_fixed; \ | 1191 | u8 min_address_fixed; \ |
1178 | u8 max_address_fixed; \ | 1192 | u8 max_address_fixed; \ |
1179 | union acpi_resource_attribute info; | 1193 | union acpi_resource_attribute info; |
1180 | 1194 | ||
1181 | struct acpi_resource_address { | 1195 | struct acpi_resource_address { |
1182 | ACPI_RESOURCE_ADDRESS_COMMON}; | 1196 | ACPI_RESOURCE_ADDRESS_COMMON}; |
@@ -1297,16 +1311,6 @@ struct acpi_resource { | |||
1297 | 1311 | ||
1298 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) | 1312 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) |
1299 | 1313 | ||
1300 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | ||
1301 | #define ACPI_ALIGN_RESOURCE_SIZE(length) (length) | ||
1302 | #else | ||
1303 | #define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) | ||
1304 | #endif | ||
1305 | |||
1306 | /* | ||
1307 | * END: of definitions for Resource Attributes | ||
1308 | */ | ||
1309 | |||
1310 | struct acpi_pci_routing_table { | 1314 | struct acpi_pci_routing_table { |
1311 | u32 length; | 1315 | u32 length; |
1312 | u32 pin; | 1316 | u32 pin; |
@@ -1315,8 +1319,4 @@ struct acpi_pci_routing_table { | |||
1315 | char source[4]; /* pad to 64 bits so sizeof() works in all cases */ | 1319 | char source[4]; /* pad to 64 bits so sizeof() works in all cases */ |
1316 | }; | 1320 | }; |
1317 | 1321 | ||
1318 | /* | ||
1319 | * END: of definitions for PCI Routing tables | ||
1320 | */ | ||
1321 | |||
1322 | #endif /* __ACTYPES_H__ */ | 1322 | #endif /* __ACTYPES_H__ */ |
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 0927765df6aa..ba039ea1a057 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h | |||
@@ -50,24 +50,24 @@ extern const u8 acpi_gbl_resource_aml_sizes[]; | |||
50 | 50 | ||
51 | #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) | 51 | #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) |
52 | 52 | ||
53 | extern const char *acpi_gbl_BMdecode[2]; | 53 | extern const char *acpi_gbl_bm_decode[]; |
54 | extern const char *acpi_gbl_config_decode[4]; | 54 | extern const char *acpi_gbl_config_decode[]; |
55 | extern const char *acpi_gbl_consume_decode[2]; | 55 | extern const char *acpi_gbl_consume_decode[]; |
56 | extern const char *acpi_gbl_DECdecode[2]; | 56 | extern const char *acpi_gbl_dec_decode[]; |
57 | extern const char *acpi_gbl_HEdecode[2]; | 57 | extern const char *acpi_gbl_he_decode[]; |
58 | extern const char *acpi_gbl_io_decode[2]; | 58 | extern const char *acpi_gbl_io_decode[]; |
59 | extern const char *acpi_gbl_LLdecode[2]; | 59 | extern const char *acpi_gbl_ll_decode[]; |
60 | extern const char *acpi_gbl_max_decode[2]; | 60 | extern const char *acpi_gbl_max_decode[]; |
61 | extern const char *acpi_gbl_MEMdecode[4]; | 61 | extern const char *acpi_gbl_mem_decode[]; |
62 | extern const char *acpi_gbl_min_decode[2]; | 62 | extern const char *acpi_gbl_min_decode[]; |
63 | extern const char *acpi_gbl_MTPdecode[4]; | 63 | extern const char *acpi_gbl_mtp_decode[]; |
64 | extern const char *acpi_gbl_RNGdecode[4]; | 64 | extern const char *acpi_gbl_rng_decode[]; |
65 | extern const char *acpi_gbl_RWdecode[2]; | 65 | extern const char *acpi_gbl_rw_decode[]; |
66 | extern const char *acpi_gbl_SHRdecode[2]; | 66 | extern const char *acpi_gbl_shr_decode[]; |
67 | extern const char *acpi_gbl_SIZdecode[4]; | 67 | extern const char *acpi_gbl_siz_decode[]; |
68 | extern const char *acpi_gbl_TRSdecode[2]; | 68 | extern const char *acpi_gbl_trs_decode[]; |
69 | extern const char *acpi_gbl_TTPdecode[2]; | 69 | extern const char *acpi_gbl_ttp_decode[]; |
70 | extern const char *acpi_gbl_TYPdecode[4]; | 70 | extern const char *acpi_gbl_typ_decode[]; |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | /* Types for Resource descriptor entries */ | 73 | /* Types for Resource descriptor entries */ |
@@ -78,6 +78,12 @@ extern const char *acpi_gbl_TYPdecode[4]; | |||
78 | #define ACPI_SMALL_VARIABLE_LENGTH 3 | 78 | #define ACPI_SMALL_VARIABLE_LENGTH 3 |
79 | 79 | ||
80 | typedef | 80 | typedef |
81 | acpi_status(*acpi_walk_aml_callback) (u8 * aml, | ||
82 | u32 length, | ||
83 | u32 offset, | ||
84 | u8 resource_index, void **context); | ||
85 | |||
86 | typedef | ||
81 | acpi_status(*acpi_pkg_callback) (u8 object_type, | 87 | acpi_status(*acpi_pkg_callback) (u8 object_type, |
82 | union acpi_operand_object * source_object, | 88 | union acpi_operand_object * source_object, |
83 | union acpi_generic_state * state, | 89 | union acpi_generic_state * state, |
@@ -277,6 +283,8 @@ acpi_ut_ptr_exit(u32 line_number, | |||
277 | 283 | ||
278 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); | 284 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); |
279 | 285 | ||
286 | void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display); | ||
287 | |||
280 | void acpi_ut_report_error(char *module_name, u32 line_number); | 288 | void acpi_ut_report_error(char *module_name, u32 line_number); |
281 | 289 | ||
282 | void acpi_ut_report_info(char *module_name, u32 line_number); | 290 | void acpi_ut_report_info(char *module_name, u32 line_number); |
@@ -445,6 +453,8 @@ acpi_ut_short_divide(acpi_integer in_dividend, | |||
445 | /* | 453 | /* |
446 | * utmisc | 454 | * utmisc |
447 | */ | 455 | */ |
456 | u8 acpi_ut_is_aml_table(struct acpi_table_header *table); | ||
457 | |||
448 | acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); | 458 | acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); |
449 | 459 | ||
450 | void acpi_ut_release_owner_id(acpi_owner_id * owner_id); | 460 | void acpi_ut_release_owner_id(acpi_owner_id * owner_id); |
@@ -460,7 +470,9 @@ void acpi_ut_print_string(char *string, u8 max_length); | |||
460 | 470 | ||
461 | u8 acpi_ut_valid_acpi_name(u32 name); | 471 | u8 acpi_ut_valid_acpi_name(u32 name); |
462 | 472 | ||
463 | u8 acpi_ut_valid_acpi_character(char character); | 473 | acpi_name acpi_ut_repair_name(acpi_name name); |
474 | |||
475 | u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position); | ||
464 | 476 | ||
465 | acpi_status | 477 | acpi_status |
466 | acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); | 478 | acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); |
@@ -469,6 +481,25 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); | |||
469 | 481 | ||
470 | #define ACPI_ANY_BASE 0 | 482 | #define ACPI_ANY_BASE 0 |
471 | 483 | ||
484 | u32 acpi_ut_dword_byte_swap(u32 value); | ||
485 | |||
486 | void acpi_ut_set_integer_width(u8 revision); | ||
487 | |||
488 | #ifdef ACPI_DEBUG_OUTPUT | ||
489 | void | ||
490 | acpi_ut_display_init_pathname(u8 type, | ||
491 | struct acpi_namespace_node *obj_handle, | ||
492 | char *path); | ||
493 | #endif | ||
494 | |||
495 | /* | ||
496 | * utresrc | ||
497 | */ | ||
498 | acpi_status | ||
499 | acpi_ut_walk_aml_resources(u8 * aml, | ||
500 | acpi_size aml_length, | ||
501 | acpi_walk_aml_callback user_function, void **context); | ||
502 | |||
472 | acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); | 503 | acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); |
473 | 504 | ||
474 | u32 acpi_ut_get_descriptor_length(void *aml); | 505 | u32 acpi_ut_get_descriptor_length(void *aml); |
@@ -483,20 +514,6 @@ acpi_status | |||
483 | acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, | 514 | acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, |
484 | u8 ** end_tag); | 515 | u8 ** end_tag); |
485 | 516 | ||
486 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); | ||
487 | |||
488 | u32 acpi_ut_dword_byte_swap(u32 value); | ||
489 | |||
490 | void acpi_ut_set_integer_width(u8 revision); | ||
491 | |||
492 | #ifdef ACPI_DEBUG_OUTPUT | ||
493 | void | ||
494 | acpi_ut_display_init_pathname(u8 type, | ||
495 | struct acpi_namespace_node *obj_handle, | ||
496 | char *path); | ||
497 | |||
498 | #endif | ||
499 | |||
500 | /* | 517 | /* |
501 | * utmutex - mutex support | 518 | * utmutex - mutex support |
502 | */ | 519 | */ |
@@ -523,14 +540,15 @@ acpi_ut_initialize_buffer(struct acpi_buffer *buffer, | |||
523 | 540 | ||
524 | void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); | 541 | void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); |
525 | 542 | ||
526 | void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line); | 543 | void *acpi_ut_allocate_zeroed(acpi_size size, |
544 | u32 component, char *module, u32 line); | ||
527 | 545 | ||
528 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS | 546 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS |
529 | void *acpi_ut_allocate_and_track(acpi_size size, | 547 | void *acpi_ut_allocate_and_track(acpi_size size, |
530 | u32 component, char *module, u32 line); | 548 | u32 component, char *module, u32 line); |
531 | 549 | ||
532 | void *acpi_ut_callocate_and_track(acpi_size size, | 550 | void *acpi_ut_allocate_zeroed_and_track(acpi_size size, |
533 | u32 component, char *module, u32 line); | 551 | u32 component, char *module, u32 line); |
534 | 552 | ||
535 | void | 553 | void |
536 | acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); | 554 | acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); |
@@ -540,6 +558,11 @@ void acpi_ut_dump_allocation_info(void); | |||
540 | #endif /* ACPI_FUTURE_USAGE */ | 558 | #endif /* ACPI_FUTURE_USAGE */ |
541 | 559 | ||
542 | void acpi_ut_dump_allocations(u32 component, char *module); | 560 | void acpi_ut_dump_allocations(u32 component, char *module); |
561 | |||
562 | acpi_status | ||
563 | acpi_ut_create_list(char *list_name, | ||
564 | u16 object_size, struct acpi_memory_list **return_cache); | ||
565 | |||
543 | #endif | 566 | #endif |
544 | 567 | ||
545 | #endif /* _ACUTILS_H */ | 568 | #endif /* _ACUTILS_H */ |
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h index 37964a59aef8..cf18426a87b1 100644 --- a/include/acpi/amlcode.h +++ b/include/acpi/amlcode.h | |||
@@ -180,8 +180,10 @@ | |||
180 | #define AML_BANK_FIELD_OP (u16) 0x5b87 | 180 | #define AML_BANK_FIELD_OP (u16) 0x5b87 |
181 | #define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ | 181 | #define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ |
182 | 182 | ||
183 | /* Bogus opcodes (they are actually two separate opcodes) */ | 183 | /* |
184 | 184 | * Combination opcodes (actually two one-byte opcodes) | |
185 | * Used by the disassembler and i_aSL compiler | ||
186 | */ | ||
185 | #define AML_LGREATEREQUAL_OP (u16) 0x9295 | 187 | #define AML_LGREATEREQUAL_OP (u16) 0x9295 |
186 | #define AML_LLESSEQUAL_OP (u16) 0x9294 | 188 | #define AML_LLESSEQUAL_OP (u16) 0x9294 |
187 | #define AML_LNOTEQUAL_OP (u16) 0x9293 | 189 | #define AML_LNOTEQUAL_OP (u16) 0x9293 |
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index fb4735315ad3..be03818af9d1 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h | |||
@@ -42,39 +42,45 @@ | |||
42 | * POSSIBILITY OF SUCH DAMAGES. | 42 | * POSSIBILITY OF SUCH DAMAGES. |
43 | */ | 43 | */ |
44 | 44 | ||
45 | /* acpisrc:struct_defs -- for acpisrc conversion */ | ||
46 | |||
45 | #ifndef __AMLRESRC_H | 47 | #ifndef __AMLRESRC_H |
46 | #define __AMLRESRC_H | 48 | #define __AMLRESRC_H |
47 | 49 | ||
48 | #define ASL_RESNAME_ADDRESS "_ADR" | 50 | /* |
49 | #define ASL_RESNAME_ALIGNMENT "_ALN" | 51 | * Resource descriptor tags, as defined in the ACPI specification. |
50 | #define ASL_RESNAME_ADDRESSSPACE "_ASI" | 52 | * Used to symbolically reference fields within a descriptor. |
51 | #define ASL_RESNAME_ACCESSSIZE "_ASZ" | 53 | */ |
52 | #define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT" | 54 | #define ACPI_RESTAG_ADDRESS "_ADR" |
53 | #define ASL_RESNAME_BASEADDRESS "_BAS" | 55 | #define ACPI_RESTAG_ALIGNMENT "_ALN" |
54 | #define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ | 56 | #define ACPI_RESTAG_ADDRESSSPACE "_ASI" |
55 | #define ASL_RESNAME_DECODE "_DEC" | 57 | #define ACPI_RESTAG_ACCESSSIZE "_ASZ" |
56 | #define ASL_RESNAME_DMA "_DMA" | 58 | #define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT" |
57 | #define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ | 59 | #define ACPI_RESTAG_BASEADDRESS "_BAS" |
58 | #define ASL_RESNAME_GRANULARITY "_GRA" | 60 | #define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */ |
59 | #define ASL_RESNAME_INTERRUPT "_INT" | 61 | #define ACPI_RESTAG_DECODE "_DEC" |
60 | #define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ | 62 | #define ACPI_RESTAG_DMA "_DMA" |
61 | #define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ | 63 | #define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ |
62 | #define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ | 64 | #define ACPI_RESTAG_GRANULARITY "_GRA" |
63 | #define ASL_RESNAME_LENGTH "_LEN" | 65 | #define ACPI_RESTAG_INTERRUPT "_INT" |
64 | #define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ | 66 | #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ |
65 | #define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ | 67 | #define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ |
66 | #define ASL_RESNAME_MAXADDR "_MAX" | 68 | #define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ |
67 | #define ASL_RESNAME_MINADDR "_MIN" | 69 | #define ACPI_RESTAG_LENGTH "_LEN" |
68 | #define ASL_RESNAME_MAXTYPE "_MAF" | 70 | #define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ |
69 | #define ASL_RESNAME_MINTYPE "_MIF" | 71 | #define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ |
70 | #define ASL_RESNAME_REGISTERBITOFFSET "_RBO" | 72 | #define ACPI_RESTAG_MAXADDR "_MAX" |
71 | #define ASL_RESNAME_REGISTERBITWIDTH "_RBW" | 73 | #define ACPI_RESTAG_MINADDR "_MIN" |
72 | #define ASL_RESNAME_RANGETYPE "_RNG" | 74 | #define ACPI_RESTAG_MAXTYPE "_MAF" |
73 | #define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ | 75 | #define ACPI_RESTAG_MINTYPE "_MIF" |
74 | #define ASL_RESNAME_TRANSLATION "_TRA" | 76 | #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" |
75 | #define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ | 77 | #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" |
76 | #define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */ | 78 | #define ACPI_RESTAG_RANGETYPE "_RNG" |
77 | #define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ | 79 | #define ACPI_RESTAG_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ |
80 | #define ACPI_RESTAG_TRANSLATION "_TRA" | ||
81 | #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ | ||
82 | #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ | ||
83 | #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */ | ||
78 | 84 | ||
79 | /* Default sizes for "small" resource descriptors */ | 85 | /* Default sizes for "small" resource descriptors */ |
80 | 86 | ||
@@ -109,7 +115,7 @@ struct asl_resource_node { | |||
109 | * SMALL descriptors | 115 | * SMALL descriptors |
110 | */ | 116 | */ |
111 | #define AML_RESOURCE_SMALL_HEADER_COMMON \ | 117 | #define AML_RESOURCE_SMALL_HEADER_COMMON \ |
112 | u8 descriptor_type; | 118 | u8 descriptor_type; |
113 | 119 | ||
114 | struct aml_resource_small_header { | 120 | struct aml_resource_small_header { |
115 | AML_RESOURCE_SMALL_HEADER_COMMON}; | 121 | AML_RESOURCE_SMALL_HEADER_COMMON}; |
@@ -162,8 +168,8 @@ struct aml_resource_end_tag { | |||
162 | * LARGE descriptors | 168 | * LARGE descriptors |
163 | */ | 169 | */ |
164 | #define AML_RESOURCE_LARGE_HEADER_COMMON \ | 170 | #define AML_RESOURCE_LARGE_HEADER_COMMON \ |
165 | u8 descriptor_type;\ | 171 | u8 descriptor_type;\ |
166 | u16 resource_length; | 172 | u16 resource_length; |
167 | 173 | ||
168 | struct aml_resource_large_header { | 174 | struct aml_resource_large_header { |
169 | AML_RESOURCE_LARGE_HEADER_COMMON}; | 175 | AML_RESOURCE_LARGE_HEADER_COMMON}; |
@@ -194,9 +200,9 @@ struct aml_resource_fixed_memory32 { | |||
194 | }; | 200 | }; |
195 | 201 | ||
196 | #define AML_RESOURCE_ADDRESS_COMMON \ | 202 | #define AML_RESOURCE_ADDRESS_COMMON \ |
197 | u8 resource_type; \ | 203 | u8 resource_type; \ |
198 | u8 flags; \ | 204 | u8 flags; \ |
199 | u8 specific_flags; | 205 | u8 specific_flags; |
200 | 206 | ||
201 | struct aml_resource_address { | 207 | struct aml_resource_address { |
202 | AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; | 208 | AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; |
@@ -266,6 +272,7 @@ struct aml_resource_generic_register { | |||
266 | union aml_resource { | 272 | union aml_resource { |
267 | /* Descriptor headers */ | 273 | /* Descriptor headers */ |
268 | 274 | ||
275 | u8 descriptor_type; | ||
269 | struct aml_resource_small_header small_header; | 276 | struct aml_resource_small_header small_header; |
270 | struct aml_resource_large_header large_header; | 277 | struct aml_resource_large_header large_header; |
271 | 278 | ||
@@ -296,9 +303,9 @@ union aml_resource { | |||
296 | /* Utility overlays */ | 303 | /* Utility overlays */ |
297 | 304 | ||
298 | struct aml_resource_address address; | 305 | struct aml_resource_address address; |
299 | u32 u32_item; | 306 | u32 dword_item; |
300 | u16 u16_item; | 307 | u16 word_item; |
301 | u8 U8item; | 308 | u8 byte_item; |
302 | }; | 309 | }; |
303 | 310 | ||
304 | #endif | 311 | #endif |
diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h index 3fa81d55cd0c..c5472be6f3a2 100644 --- a/include/acpi/pdc_intel.h +++ b/include/acpi/pdc_intel.h | |||
@@ -18,6 +18,11 @@ | |||
18 | ACPI_PDC_C_C1_HALT | \ | 18 | ACPI_PDC_C_C1_HALT | \ |
19 | ACPI_PDC_P_FFH) | 19 | ACPI_PDC_P_FFH) |
20 | 20 | ||
21 | #define ACPI_PDC_EST_CAPABILITY_SWSMP (ACPI_PDC_SMP_C1PT | \ | ||
22 | ACPI_PDC_C_C1_HALT | \ | ||
23 | ACPI_PDC_SMP_P_SWCOORD | \ | ||
24 | ACPI_PDC_P_FFH) | ||
25 | |||
21 | #define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \ | 26 | #define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \ |
22 | ACPI_PDC_SMP_C1PT | \ | 27 | ACPI_PDC_SMP_C1PT | \ |
23 | ACPI_PDC_C_C1_HALT) | 28 | ACPI_PDC_C_C1_HALT) |
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 223ec6467108..453a469fd397 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -49,33 +49,41 @@ | |||
49 | */ | 49 | */ |
50 | 50 | ||
51 | #ifdef ACPI_LIBRARY | 51 | #ifdef ACPI_LIBRARY |
52 | /* | ||
53 | * Note: The non-debug version of the acpi_library does not contain any | ||
54 | * debug support, for minimimal size. The debug version uses ACPI_FULL_DEBUG | ||
55 | */ | ||
52 | #define ACPI_USE_LOCAL_CACHE | 56 | #define ACPI_USE_LOCAL_CACHE |
53 | #endif | 57 | #endif |
54 | 58 | ||
55 | #ifdef ACPI_DUMP_APP | 59 | #ifdef ACPI_ASL_COMPILER |
56 | #ifndef MSDOS | ||
57 | #define ACPI_DEBUG_OUTPUT | 60 | #define ACPI_DEBUG_OUTPUT |
58 | #endif | ||
59 | #define ACPI_APPLICATION | 61 | #define ACPI_APPLICATION |
60 | #define ACPI_DISASSEMBLER | 62 | #define ACPI_DISASSEMBLER |
61 | #define ACPI_NO_METHOD_EXECUTION | 63 | #define ACPI_CONSTANT_EVAL_ONLY |
64 | #define ACPI_LARGE_NAMESPACE_NODE | ||
65 | #define ACPI_DATA_TABLE_DISASSEMBLY | ||
62 | #endif | 66 | #endif |
63 | 67 | ||
64 | #ifdef ACPI_EXEC_APP | 68 | #ifdef ACPI_EXEC_APP |
65 | #undef DEBUGGER_THREADING | 69 | #undef DEBUGGER_THREADING |
66 | #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED | 70 | #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED |
67 | #define ACPI_DEBUG_OUTPUT | 71 | #define ACPI_FULL_DEBUG |
68 | #define ACPI_APPLICATION | 72 | #define ACPI_APPLICATION |
69 | #define ACPI_DEBUGGER | 73 | #define ACPI_DEBUGGER |
70 | #define ACPI_DISASSEMBLER | ||
71 | #define ACPI_MUTEX_DEBUG | 74 | #define ACPI_MUTEX_DEBUG |
75 | #define ACPI_DBG_TRACK_ALLOCATIONS | ||
72 | #endif | 76 | #endif |
73 | 77 | ||
74 | #ifdef ACPI_ASL_COMPILER | 78 | #ifdef ACPI_DASM_APP |
79 | #ifndef MSDOS | ||
75 | #define ACPI_DEBUG_OUTPUT | 80 | #define ACPI_DEBUG_OUTPUT |
81 | #endif | ||
76 | #define ACPI_APPLICATION | 82 | #define ACPI_APPLICATION |
77 | #define ACPI_DISASSEMBLER | 83 | #define ACPI_DISASSEMBLER |
78 | #define ACPI_CONSTANT_EVAL_ONLY | 84 | #define ACPI_NO_METHOD_EXECUTION |
85 | #define ACPI_LARGE_NAMESPACE_NODE | ||
86 | #define ACPI_DATA_TABLE_DISASSEMBLY | ||
79 | #endif | 87 | #endif |
80 | 88 | ||
81 | #ifdef ACPI_APPLICATION | 89 | #ifdef ACPI_APPLICATION |
@@ -83,6 +91,12 @@ | |||
83 | #define ACPI_USE_LOCAL_CACHE | 91 | #define ACPI_USE_LOCAL_CACHE |
84 | #endif | 92 | #endif |
85 | 93 | ||
94 | #ifdef ACPI_FULL_DEBUG | ||
95 | #define ACPI_DEBUGGER | ||
96 | #define ACPI_DEBUG_OUTPUT | ||
97 | #define ACPI_DISASSEMBLER | ||
98 | #endif | ||
99 | |||
86 | /* | 100 | /* |
87 | * Environment configuration. The purpose of this file is to interface to the | 101 | * Environment configuration. The purpose of this file is to interface to the |
88 | * local generation environment. | 102 | * local generation environment. |
@@ -137,7 +151,7 @@ | |||
137 | #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ | 151 | #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ |
138 | #include "acdos16.h" | 152 | #include "acdos16.h" |
139 | 153 | ||
140 | #elif defined(__FreeBSD__) | 154 | #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
141 | #include "acfreebsd.h" | 155 | #include "acfreebsd.h" |
142 | 156 | ||
143 | #elif defined(__NetBSD__) | 157 | #elif defined(__NetBSD__) |
@@ -163,17 +177,6 @@ | |||
163 | 177 | ||
164 | #endif | 178 | #endif |
165 | 179 | ||
166 | /* | ||
167 | * Memory allocation tracking. Used only if | ||
168 | * 1) This is the debug version | ||
169 | * 2) This is NOT a 16-bit version of the code (not enough real-mode memory) | ||
170 | */ | ||
171 | #ifdef ACPI_DEBUG_OUTPUT | ||
172 | #if ACPI_MACHINE_WIDTH != 16 | ||
173 | #define ACPI_DBG_TRACK_ALLOCATIONS | ||
174 | #endif | ||
175 | #endif | ||
176 | |||
177 | /*! [End] no source code translation !*/ | 180 | /*! [End] no source code translation !*/ |
178 | 181 | ||
179 | /* | 182 | /* |
@@ -271,8 +274,8 @@ typedef char *va_list; | |||
271 | /* | 274 | /* |
272 | * Storage alignment properties | 275 | * Storage alignment properties |
273 | */ | 276 | */ |
274 | #define _AUPBND (sizeof (acpi_native_uint) - 1) | 277 | #define _AUPBND (sizeof (acpi_native_int) - 1) |
275 | #define _ADNBND (sizeof (acpi_native_uint) - 1) | 278 | #define _ADNBND (sizeof (acpi_native_int) - 1) |
276 | 279 | ||
277 | /* | 280 | /* |
278 | * Variable argument list macro definitions | 281 | * Variable argument list macro definitions |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 3c6a6205853a..277d35bced03 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -51,27 +51,22 @@ | |||
51 | 51 | ||
52 | #include <linux/string.h> | 52 | #include <linux/string.h> |
53 | #include <linux/kernel.h> | 53 | #include <linux/kernel.h> |
54 | #include <linux/module.h> | ||
54 | #include <linux/ctype.h> | 55 | #include <linux/ctype.h> |
55 | #include <asm/system.h> | 56 | #include <asm/system.h> |
56 | #include <asm/atomic.h> | 57 | #include <asm/atomic.h> |
57 | #include <asm/div64.h> | 58 | #include <asm/div64.h> |
58 | #include <asm/acpi.h> | 59 | #include <asm/acpi.h> |
60 | #include <linux/slab.h> | ||
59 | 61 | ||
60 | #define strtoul simple_strtoul | 62 | /* Host-dependent types and defines */ |
61 | |||
62 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG | ||
63 | 63 | ||
64 | /* Type(s) for the OSL */ | 64 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG |
65 | 65 | #define acpi_cache_t kmem_cache_t | |
66 | #ifdef ACPI_USE_LOCAL_CACHE | 66 | #define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol); |
67 | #define acpi_cache_t struct acpi_memory_list | 67 | #define strtoul simple_strtoul |
68 | #else | ||
69 | #include <linux/slab.h> | ||
70 | #define acpi_cache_t kmem_cache_t | ||
71 | #endif | ||
72 | 68 | ||
73 | /* Full namespace pathname length limit - arbitrary */ | 69 | /* Full namespace pathname length limit - arbitrary */ |
74 | |||
75 | #define ACPI_PATHNAME_MAX 256 | 70 | #define ACPI_PATHNAME_MAX 256 |
76 | 71 | ||
77 | #else /* !__KERNEL__ */ | 72 | #else /* !__KERNEL__ */ |
@@ -103,4 +98,8 @@ | |||
103 | 98 | ||
104 | #define acpi_cpu_flags unsigned long | 99 | #define acpi_cpu_flags unsigned long |
105 | 100 | ||
101 | #define acpi_thread_id u32 | ||
102 | |||
103 | static inline acpi_thread_id acpi_os_get_thread_id(void) { return 0; } | ||
104 | |||
106 | #endif /* __ACLINUX_H__ */ | 105 | #endif /* __ACLINUX_H__ */ |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index ef7d83a41470..77371b3cdc44 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __ACPI_PROCESSOR_H | 2 | #define __ACPI_PROCESSOR_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <linux/cpu.h> | ||
5 | 6 | ||
6 | #include <asm/acpi.h> | 7 | #include <asm/acpi.h> |
7 | 8 | ||
@@ -17,6 +18,17 @@ | |||
17 | 18 | ||
18 | #define ACPI_PDC_REVISION_ID 0x1 | 19 | #define ACPI_PDC_REVISION_ID 0x1 |
19 | 20 | ||
21 | #define ACPI_PSD_REV0_REVISION 0 /* Support for _PSD as in ACPI 3.0 */ | ||
22 | #define ACPI_PSD_REV0_ENTRIES 5 | ||
23 | |||
24 | /* | ||
25 | * Types of coordination defined in ACPI 3.0. Same macros can be used across | ||
26 | * P, C and T states | ||
27 | */ | ||
28 | #define DOMAIN_COORD_TYPE_SW_ALL 0xfc | ||
29 | #define DOMAIN_COORD_TYPE_SW_ANY 0xfd | ||
30 | #define DOMAIN_COORD_TYPE_HW_ALL 0xfe | ||
31 | |||
20 | /* Power Management */ | 32 | /* Power Management */ |
21 | 33 | ||
22 | struct acpi_processor_cx; | 34 | struct acpi_processor_cx; |
@@ -65,6 +77,14 @@ struct acpi_processor_power { | |||
65 | 77 | ||
66 | /* Performance Management */ | 78 | /* Performance Management */ |
67 | 79 | ||
80 | struct acpi_psd_package { | ||
81 | acpi_integer num_entries; | ||
82 | acpi_integer revision; | ||
83 | acpi_integer domain; | ||
84 | acpi_integer coord_type; | ||
85 | acpi_integer num_processors; | ||
86 | } __attribute__ ((packed)); | ||
87 | |||
68 | struct acpi_pct_register { | 88 | struct acpi_pct_register { |
69 | u8 descriptor; | 89 | u8 descriptor; |
70 | u16 length; | 90 | u16 length; |
@@ -91,7 +111,9 @@ struct acpi_processor_performance { | |||
91 | struct acpi_pct_register status_register; | 111 | struct acpi_pct_register status_register; |
92 | unsigned int state_count; | 112 | unsigned int state_count; |
93 | struct acpi_processor_px *states; | 113 | struct acpi_processor_px *states; |
94 | 114 | struct acpi_psd_package domain_info; | |
115 | cpumask_t shared_cpu_map; | ||
116 | unsigned int shared_type; | ||
95 | }; | 117 | }; |
96 | 118 | ||
97 | /* Throttling Control */ | 119 | /* Throttling Control */ |
@@ -160,6 +182,9 @@ struct acpi_processor_errata { | |||
160 | } piix4; | 182 | } piix4; |
161 | }; | 183 | }; |
162 | 184 | ||
185 | extern int acpi_processor_preregister_performance( | ||
186 | struct acpi_processor_performance **performance); | ||
187 | |||
163 | extern int acpi_processor_register_performance(struct acpi_processor_performance | 188 | extern int acpi_processor_register_performance(struct acpi_processor_performance |
164 | *performance, unsigned int cpu); | 189 | *performance, unsigned int cpu); |
165 | extern void acpi_processor_unregister_performance(struct | 190 | extern void acpi_processor_unregister_performance(struct |
diff --git a/include/asm-alpha/irq.h b/include/asm-alpha/irq.h index f6de033718a0..917b9fe372cf 100644 --- a/include/asm-alpha/irq.h +++ b/include/asm-alpha/irq.h | |||
@@ -92,8 +92,4 @@ extern void enable_irq(unsigned int); | |||
92 | struct pt_regs; | 92 | struct pt_regs; |
93 | extern void (*perf_irq)(unsigned long, struct pt_regs *); | 93 | extern void (*perf_irq)(unsigned long, struct pt_regs *); |
94 | 94 | ||
95 | struct irqaction; | ||
96 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
97 | |||
98 | |||
99 | #endif /* _ALPHA_IRQ_H */ | 95 | #endif /* _ALPHA_IRQ_H */ |
diff --git a/include/asm-alpha/vga.h b/include/asm-alpha/vga.h index 8ca4f6b2da19..ed06f59b544d 100644 --- a/include/asm-alpha/vga.h +++ b/include/asm-alpha/vga.h | |||
@@ -46,6 +46,6 @@ extern void scr_memcpyw(u16 *d, const u16 *s, unsigned int count); | |||
46 | #define vga_readb(a) readb((u8 __iomem *)(a)) | 46 | #define vga_readb(a) readb((u8 __iomem *)(a)) |
47 | #define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a)) | 47 | #define vga_writeb(v,a) writeb(v, (u8 __iomem *)(a)) |
48 | 48 | ||
49 | #define VGA_MAP_MEM(x) ((unsigned long) ioremap(x, 0)) | 49 | #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap(x, s)) |
50 | 50 | ||
51 | #endif | 51 | #endif |
diff --git a/include/asm-arm/arch-imx/imx-dma.h b/include/asm-arm/arch-imx/imx-dma.h index f2063c1d610d..599f03e5a9ef 100644 --- a/include/asm-arm/arch-imx/imx-dma.h +++ b/include/asm-arm/arch-imx/imx-dma.h | |||
@@ -46,7 +46,7 @@ | |||
46 | struct imx_dma_channel { | 46 | struct imx_dma_channel { |
47 | const char *name; | 47 | const char *name; |
48 | void (*irq_handler) (int, void *, struct pt_regs *); | 48 | void (*irq_handler) (int, void *, struct pt_regs *); |
49 | void (*err_handler) (int, void *, struct pt_regs *); | 49 | void (*err_handler) (int, void *, struct pt_regs *, int errcode); |
50 | void *data; | 50 | void *data; |
51 | dmamode_t dma_mode; | 51 | dmamode_t dma_mode; |
52 | struct scatterlist *sg; | 52 | struct scatterlist *sg; |
@@ -58,6 +58,10 @@ struct imx_dma_channel { | |||
58 | 58 | ||
59 | extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS]; | 59 | extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS]; |
60 | 60 | ||
61 | #define IMX_DMA_ERR_BURST 1 | ||
62 | #define IMX_DMA_ERR_REQUEST 2 | ||
63 | #define IMX_DMA_ERR_TRANSFER 4 | ||
64 | #define IMX_DMA_ERR_BUFFER 8 | ||
61 | 65 | ||
62 | /* The type to distinguish channel numbers parameter from ordinal int type */ | 66 | /* The type to distinguish channel numbers parameter from ordinal int type */ |
63 | typedef int imx_dmach_t; | 67 | typedef int imx_dmach_t; |
@@ -74,7 +78,7 @@ imx_dma_setup_sg(imx_dmach_t dma_ch, | |||
74 | int | 78 | int |
75 | imx_dma_setup_handlers(imx_dmach_t dma_ch, | 79 | imx_dma_setup_handlers(imx_dmach_t dma_ch, |
76 | void (*irq_handler) (int, void *, struct pt_regs *), | 80 | void (*irq_handler) (int, void *, struct pt_regs *), |
77 | void (*err_handler) (int, void *, struct pt_regs *), void *data); | 81 | void (*err_handler) (int, void *, struct pt_regs *, int), void *data); |
78 | 82 | ||
79 | void imx_dma_enable(imx_dmach_t dma_ch); | 83 | void imx_dma_enable(imx_dmach_t dma_ch); |
80 | 84 | ||
diff --git a/include/asm-arm/arch-ixp23xx/ixp23xx.h b/include/asm-arm/arch-ixp23xx/ixp23xx.h index 01efdbd1180f..d0a72201ee96 100644 --- a/include/asm-arm/arch-ixp23xx/ixp23xx.h +++ b/include/asm-arm/arch-ixp23xx/ixp23xx.h | |||
@@ -124,6 +124,7 @@ | |||
124 | 124 | ||
125 | #define IXP23XX_EXP_UNIT_FUSE IXP23XX_EXP_CFG_REG(0x28) | 125 | #define IXP23XX_EXP_UNIT_FUSE IXP23XX_EXP_CFG_REG(0x28) |
126 | #define IXP23XX_EXP_MSF_MUX IXP23XX_EXP_CFG_REG(0x30) | 126 | #define IXP23XX_EXP_MSF_MUX IXP23XX_EXP_CFG_REG(0x30) |
127 | #define IXP23XX_EXP_CFG_FUSE IXP23XX_EXP_CFG_REG(0x34) | ||
127 | 128 | ||
128 | #define IXP23XX_EXP_BUS_PHYS 0x90000000 | 129 | #define IXP23XX_EXP_BUS_PHYS 0x90000000 |
129 | #define IXP23XX_EXP_BUS_WINDOW_SIZE 0x01000000 | 130 | #define IXP23XX_EXP_BUS_WINDOW_SIZE 0x01000000 |
@@ -265,6 +266,8 @@ | |||
265 | #define IXP23XX_PCI_UNIT_RESET (1 << 1) | 266 | #define IXP23XX_PCI_UNIT_RESET (1 << 1) |
266 | #define IXP23XX_XSCALE_RESET (1 << 0) | 267 | #define IXP23XX_XSCALE_RESET (1 << 0) |
267 | 268 | ||
269 | #define IXP23XX_UENGINE_CSR_VIRT_BASE (IXP23XX_CAP_CSR_VIRT + 0x18000) | ||
270 | |||
268 | 271 | ||
269 | /**************************************************************************** | 272 | /**************************************************************************** |
270 | * PCI CSRs. | 273 | * PCI CSRs. |
diff --git a/include/asm-arm/arch-ixp23xx/platform.h b/include/asm-arm/arch-ixp23xx/platform.h index e4d99060a049..19a73b39c864 100644 --- a/include/asm-arm/arch-ixp23xx/platform.h +++ b/include/asm-arm/arch-ixp23xx/platform.h | |||
@@ -14,6 +14,21 @@ | |||
14 | 14 | ||
15 | #ifndef __ASSEMBLY__ | 15 | #ifndef __ASSEMBLY__ |
16 | 16 | ||
17 | extern inline unsigned long ixp2000_reg_read(volatile void *reg) | ||
18 | { | ||
19 | return *((volatile unsigned long *)reg); | ||
20 | } | ||
21 | |||
22 | extern inline void ixp2000_reg_write(volatile void *reg, unsigned long val) | ||
23 | { | ||
24 | *((volatile unsigned long *)reg) = val; | ||
25 | } | ||
26 | |||
27 | extern inline void ixp2000_reg_wrb(volatile void *reg, unsigned long val) | ||
28 | { | ||
29 | *((volatile unsigned long *)reg) = val; | ||
30 | } | ||
31 | |||
17 | struct pci_sys_data; | 32 | struct pci_sys_data; |
18 | 33 | ||
19 | void ixp23xx_map_io(void); | 34 | void ixp23xx_map_io(void); |
diff --git a/include/asm-arm/arch-netx/eth.h b/include/asm-arm/arch-netx/eth.h new file mode 100644 index 000000000000..643c90ef8b72 --- /dev/null +++ b/include/asm-arm/arch-netx/eth.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-netx/eth.h | ||
3 | * | ||
4 | * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 | ||
8 | * as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef ASMARM_ARCH_ETH_H | ||
21 | #define ASMARM_ARCH_ETH_H | ||
22 | |||
23 | struct netxeth_platform_data { | ||
24 | unsigned int xcno; /* number of xmac/xpec engine this eth uses */ | ||
25 | }; | ||
26 | |||
27 | #endif | ||
diff --git a/include/asm-arm/arch-pnx4008/debug-macro.S b/include/asm-arm/arch-pnx4008/debug-macro.S index eb3839de389a..67d18a203d23 100644 --- a/include/asm-arm/arch-pnx4008/debug-macro.S +++ b/include/asm-arm/arch-pnx4008/debug-macro.S | |||
@@ -19,9 +19,5 @@ | |||
19 | addne \rx, \rx, #0xf4000000 | 19 | addne \rx, \rx, #0xf4000000 |
20 | .endm | 20 | .endm |
21 | 21 | ||
22 | .macro senduart,rd,rx | ||
23 | strb \rd, [\rx, #0x0] | ||
24 | .endm | ||
25 | |||
26 | #define UART_SHIFT 2 | 22 | #define UART_SHIFT 2 |
27 | #include <asm/hardware/debug-8250.S> | 23 | #include <asm/hardware/debug-8250.S> |
diff --git a/include/asm-arm/arch-pnx4008/gpio.h b/include/asm-arm/arch-pnx4008/gpio.h index 1fa5a77c3010..d01bf83d55c2 100644 --- a/include/asm-arm/arch-pnx4008/gpio.h +++ b/include/asm-arm/arch-pnx4008/gpio.h | |||
@@ -127,6 +127,79 @@ | |||
127 | #define GPIO_ISOUT(K) ((GPIO_TYPE_MASK(K) == GPIO_OUT) && (GPIO_BIT(K) & GPIO_OUT_MASK)) | 127 | #define GPIO_ISOUT(K) ((GPIO_TYPE_MASK(K) == GPIO_OUT) && (GPIO_BIT(K) & GPIO_OUT_MASK)) |
128 | #define GPIO_ISIN(K) ((GPIO_TYPE_MASK(K) == GPIO_IN) && (GPIO_BIT(K) & GPIO_IN_MASK)) | 128 | #define GPIO_ISIN(K) ((GPIO_TYPE_MASK(K) == GPIO_IN) && (GPIO_BIT(K) & GPIO_IN_MASK)) |
129 | 129 | ||
130 | /* Start Enable Pin Interrupts - table 58 page 66 */ | ||
131 | |||
132 | #define SE_PIN_BASE_INT 32 | ||
133 | |||
134 | #define SE_U7_RX_INT 63 | ||
135 | #define SE_U7_HCTS_INT 62 | ||
136 | #define SE_BT_CLKREQ_INT 61 | ||
137 | #define SE_U6_IRRX_INT 60 | ||
138 | /*59 unused*/ | ||
139 | #define SE_U5_RX_INT 58 | ||
140 | #define SE_GPI_11_INT 57 | ||
141 | #define SE_U3_RX_INT 56 | ||
142 | #define SE_U2_HCTS_INT 55 | ||
143 | #define SE_U2_RX_INT 54 | ||
144 | #define SE_U1_RX_INT 53 | ||
145 | #define SE_DISP_SYNC_INT 52 | ||
146 | /*51 unused*/ | ||
147 | #define SE_SDIO_INT_N 50 | ||
148 | #define SE_MSDIO_START_INT 49 | ||
149 | #define SE_GPI_06_INT 48 | ||
150 | #define SE_GPI_05_INT 47 | ||
151 | #define SE_GPI_04_INT 46 | ||
152 | #define SE_GPI_03_INT 45 | ||
153 | #define SE_GPI_02_INT 44 | ||
154 | #define SE_GPI_01_INT 43 | ||
155 | #define SE_GPI_00_INT 42 | ||
156 | #define SE_SYSCLKEN_PIN_INT 41 | ||
157 | #define SE_SPI1_DATAIN_INT 40 | ||
158 | #define SE_GPI_07_INT 39 | ||
159 | #define SE_SPI2_DATAIN_INT 38 | ||
160 | #define SE_GPI_10_INT 37 | ||
161 | #define SE_GPI_09_INT 36 | ||
162 | #define SE_GPI_08_INT 35 | ||
163 | /*34-32 unused*/ | ||
164 | |||
165 | /* Start Enable Internal Interrupts - table 57 page 65 */ | ||
166 | |||
167 | #define SE_INT_BASE_INT 0 | ||
168 | |||
169 | #define SE_TS_IRQ 31 | ||
170 | #define SE_TS_P_INT 30 | ||
171 | #define SE_TS_AUX_INT 29 | ||
172 | /*27-28 unused*/ | ||
173 | #define SE_USB_AHB_NEED_CLK_INT 26 | ||
174 | #define SE_MSTIMER_INT 25 | ||
175 | #define SE_RTC_INT 24 | ||
176 | #define SE_USB_NEED_CLK_INT 23 | ||
177 | #define SE_USB_INT 22 | ||
178 | #define SE_USB_I2C_INT 21 | ||
179 | #define SE_USB_OTG_TIMER_INT 20 | ||
180 | #define SE_USB_OTG_ATX_INT_N 19 | ||
181 | /*18 unused*/ | ||
182 | #define SE_DSP_GPIO4_INT 17 | ||
183 | #define SE_KEY_IRQ 16 | ||
184 | #define SE_DSP_SLAVEPORT_INT 15 | ||
185 | #define SE_DSP_GPIO1_INT 14 | ||
186 | #define SE_DSP_GPIO0_INT 13 | ||
187 | #define SE_DSP_AHB_INT 12 | ||
188 | /*11-6 unused*/ | ||
189 | #define SE_GPIO_05_INT 5 | ||
190 | #define SE_GPIO_04_INT 4 | ||
191 | #define SE_GPIO_03_INT 3 | ||
192 | #define SE_GPIO_02_INT 2 | ||
193 | #define SE_GPIO_01_INT 1 | ||
194 | #define SE_GPIO_00_INT 0 | ||
195 | |||
196 | #define START_INT_REG_BIT(irq) (1<<((irq)&0x1F)) | ||
197 | |||
198 | #define START_INT_ER_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x20 + (((irq)&(0x1<<5))>>1))) | ||
199 | #define START_INT_RSR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x24 + (((irq)&(0x1<<5))>>1))) | ||
200 | #define START_INT_SR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x28 + (((irq)&(0x1<<5))>>1))) | ||
201 | #define START_INT_APR_REG(irq) IO_ADDRESS((PNX4008_PWRMAN_BASE + 0x2C + (((irq)&(0x1<<5))>>1))) | ||
202 | |||
130 | extern int pnx4008_gpio_register_pin(unsigned short pin); | 203 | extern int pnx4008_gpio_register_pin(unsigned short pin); |
131 | extern int pnx4008_gpio_unregister_pin(unsigned short pin); | 204 | extern int pnx4008_gpio_unregister_pin(unsigned short pin); |
132 | extern unsigned long pnx4008_gpio_read_pin(unsigned short pin); | 205 | extern unsigned long pnx4008_gpio_read_pin(unsigned short pin); |
@@ -136,4 +209,33 @@ extern int pnx4008_gpio_read_pin_direction(unsigned short pin); | |||
136 | extern int pnx4008_gpio_set_pin_mux(unsigned short pin, int output); | 209 | extern int pnx4008_gpio_set_pin_mux(unsigned short pin, int output); |
137 | extern int pnx4008_gpio_read_pin_mux(unsigned short pin); | 210 | extern int pnx4008_gpio_read_pin_mux(unsigned short pin); |
138 | 211 | ||
212 | static inline void start_int_umask(u8 irq) | ||
213 | { | ||
214 | __raw_writel(__raw_readl(START_INT_ER_REG(irq)) | | ||
215 | START_INT_REG_BIT(irq), START_INT_ER_REG(irq)); | ||
216 | } | ||
217 | |||
218 | static inline void start_int_mask(u8 irq) | ||
219 | { | ||
220 | __raw_writel(__raw_readl(START_INT_ER_REG(irq)) & | ||
221 | ~START_INT_REG_BIT(irq), START_INT_ER_REG(irq)); | ||
222 | } | ||
223 | |||
224 | static inline void start_int_ack(u8 irq) | ||
225 | { | ||
226 | __raw_writel(START_INT_REG_BIT(irq), START_INT_RSR_REG(irq)); | ||
227 | } | ||
228 | |||
229 | static inline void start_int_set_falling_edge(u8 irq) | ||
230 | { | ||
231 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) & | ||
232 | ~START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); | ||
233 | } | ||
234 | |||
235 | static inline void start_int_set_rising_edge(u8 irq) | ||
236 | { | ||
237 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) | | ||
238 | START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); | ||
239 | } | ||
240 | |||
139 | #endif /* _PNX4008_GPIO_H_ */ | 241 | #endif /* _PNX4008_GPIO_H_ */ |
diff --git a/include/asm-arm/arch-pnx4008/pm.h b/include/asm-arm/arch-pnx4008/pm.h index c660486670fb..bac1634cb3e0 100644 --- a/include/asm-arm/arch-pnx4008/pm.h +++ b/include/asm-arm/arch-pnx4008/pm.h | |||
@@ -29,34 +29,5 @@ extern void pnx4008_cpu_standby(void); | |||
29 | extern int pnx4008_startup_pll(struct clk *); | 29 | extern int pnx4008_startup_pll(struct clk *); |
30 | extern int pnx4008_shutdown_pll(struct clk *); | 30 | extern int pnx4008_shutdown_pll(struct clk *); |
31 | 31 | ||
32 | static inline void start_int_umask(u8 irq) | ||
33 | { | ||
34 | __raw_writel(__raw_readl(START_INT_ER_REG(irq)) | | ||
35 | START_INT_REG_BIT(irq), START_INT_ER_REG(irq)); | ||
36 | } | ||
37 | |||
38 | static inline void start_int_mask(u8 irq) | ||
39 | { | ||
40 | __raw_writel(__raw_readl(START_INT_ER_REG(irq)) & | ||
41 | ~START_INT_REG_BIT(irq), START_INT_ER_REG(irq)); | ||
42 | } | ||
43 | |||
44 | static inline void start_int_ack(u8 irq) | ||
45 | { | ||
46 | __raw_writel(START_INT_REG_BIT(irq), START_INT_RSR_REG(irq)); | ||
47 | } | ||
48 | |||
49 | static inline void start_int_set_falling_edge(u8 irq) | ||
50 | { | ||
51 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) & | ||
52 | ~START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); | ||
53 | } | ||
54 | |||
55 | static inline void start_int_set_rising_edge(u8 irq) | ||
56 | { | ||
57 | __raw_writel(__raw_readl(START_INT_APR_REG(irq)) | | ||
58 | START_INT_REG_BIT(irq), START_INT_APR_REG(irq)); | ||
59 | } | ||
60 | |||
61 | #endif /* ASSEMBLER */ | 32 | #endif /* ASSEMBLER */ |
62 | #endif /* __ASM_ARCH_PNX4008_PM_H */ | 33 | #endif /* __ASM_ARCH_PNX4008_PM_H */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-dsc.h b/include/asm-arm/arch-s3c2410/regs-dsc.h index a023b0434efe..ba13a2c9e547 100644 --- a/include/asm-arm/arch-s3c2410/regs-dsc.h +++ b/include/asm-arm/arch-s3c2410/regs-dsc.h | |||
@@ -170,7 +170,7 @@ | |||
170 | #define S3C2440_DSC1_CS1_4mA (3<<2) | 170 | #define S3C2440_DSC1_CS1_4mA (3<<2) |
171 | #define S3C2440_DSC1_CS1_MASK (3<<2) | 171 | #define S3C2440_DSC1_CS1_MASK (3<<2) |
172 | 172 | ||
173 | #define S3C2440_DSC1_CS0 (S3C2440_SELECT_DSC1 | 0 | 173 | #define S3C2440_DSC1_CS0 (S3C2440_SELECT_DSC1 | 0) |
174 | #define S3C2440_DSC1_CS0_10mA (0<<0) | 174 | #define S3C2440_DSC1_CS0_10mA (0<<0) |
175 | #define S3C2440_DSC1_CS0_8mA (1<<0) | 175 | #define S3C2440_DSC1_CS0_8mA (1<<0) |
176 | #define S3C2440_DSC1_CS0_6mA (2<<0) | 176 | #define S3C2440_DSC1_CS0_6mA (2<<0) |
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h index 60b5105c9c93..66e67e60bc56 100644 --- a/include/asm-arm/irq.h +++ b/include/asm-arm/irq.h | |||
@@ -47,10 +47,6 @@ void disable_irq_wake(unsigned int irq); | |||
47 | void enable_irq_wake(unsigned int irq); | 47 | void enable_irq_wake(unsigned int irq); |
48 | int setup_irq(unsigned int, struct irqaction *); | 48 | int setup_irq(unsigned int, struct irqaction *); |
49 | 49 | ||
50 | struct irqaction; | ||
51 | struct pt_regs; | ||
52 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
53 | |||
54 | extern void migrate_irqs(void); | 50 | extern void migrate_irqs(void); |
55 | #endif | 51 | #endif |
56 | 52 | ||
diff --git a/include/asm-arm/thread_notify.h b/include/asm-arm/thread_notify.h new file mode 100644 index 000000000000..8866e5216840 --- /dev/null +++ b/include/asm-arm/thread_notify.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/thread_notify.h | ||
3 | * | ||
4 | * Copyright (C) 2006 Russell King. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef ASMARM_THREAD_NOTIFY_H | ||
11 | #define ASMARM_THREAD_NOTIFY_H | ||
12 | |||
13 | #ifdef __KERNEL__ | ||
14 | |||
15 | #ifndef __ASSEMBLY__ | ||
16 | |||
17 | #include <linux/notifier.h> | ||
18 | #include <asm/thread_info.h> | ||
19 | |||
20 | static inline int thread_register_notifier(struct notifier_block *n) | ||
21 | { | ||
22 | extern struct atomic_notifier_head thread_notify_head; | ||
23 | return atomic_notifier_chain_register(&thread_notify_head, n); | ||
24 | } | ||
25 | |||
26 | static inline void thread_unregister_notifier(struct notifier_block *n) | ||
27 | { | ||
28 | extern struct atomic_notifier_head thread_notify_head; | ||
29 | atomic_notifier_chain_unregister(&thread_notify_head, n); | ||
30 | } | ||
31 | |||
32 | static inline void thread_notify(unsigned long rc, struct thread_info *thread) | ||
33 | { | ||
34 | extern struct atomic_notifier_head thread_notify_head; | ||
35 | atomic_notifier_call_chain(&thread_notify_head, rc, thread); | ||
36 | } | ||
37 | |||
38 | #endif | ||
39 | |||
40 | /* | ||
41 | * These are the reason codes for the thread notifier. | ||
42 | */ | ||
43 | #define THREAD_NOTIFY_FLUSH 0 | ||
44 | #define THREAD_NOTIFY_RELEASE 1 | ||
45 | #define THREAD_NOTIFY_SWITCH 2 | ||
46 | |||
47 | #endif | ||
48 | #endif | ||
diff --git a/include/asm-arm/vga.h b/include/asm-arm/vga.h index 926e5ee128e9..1e0b913c3d71 100644 --- a/include/asm-arm/vga.h +++ b/include/asm-arm/vga.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <asm/hardware.h> | 4 | #include <asm/hardware.h> |
5 | #include <asm/io.h> | 5 | #include <asm/io.h> |
6 | 6 | ||
7 | #define VGA_MAP_MEM(x) (PCIMEM_BASE + (x)) | 7 | #define VGA_MAP_MEM(x,s) (PCIMEM_BASE + (x)) |
8 | 8 | ||
9 | #define vga_readb(x) (*((volatile unsigned char *)x)) | 9 | #define vga_readb(x) (*((volatile unsigned char *)x)) |
10 | #define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x)) | 10 | #define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x)) |
diff --git a/include/asm-arm26/irq.h b/include/asm-arm26/irq.h index 06bd5a543d13..9aaac87efba9 100644 --- a/include/asm-arm26/irq.h +++ b/include/asm-arm26/irq.h | |||
@@ -44,9 +44,5 @@ extern void enable_irq(unsigned int); | |||
44 | 44 | ||
45 | int set_irq_type(unsigned int irq, unsigned int type); | 45 | int set_irq_type(unsigned int irq, unsigned int type); |
46 | 46 | ||
47 | int setup_irq(unsigned int, struct irqaction *); | ||
48 | struct pt_regs; | ||
49 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
50 | |||
51 | #endif | 47 | #endif |
52 | 48 | ||
diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h index 9a4ff03c3969..066386ac238e 100644 --- a/include/asm-frv/atomic.h +++ b/include/asm-frv/atomic.h | |||
@@ -227,7 +227,7 @@ extern unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsig | |||
227 | break; \ | 227 | break; \ |
228 | \ | 228 | \ |
229 | default: \ | 229 | default: \ |
230 | __xg_orig = 0; \ | 230 | __xg_orig = (__typeof__(__xg_orig))0; \ |
231 | asm volatile("break"); \ | 231 | asm volatile("break"); \ |
232 | break; \ | 232 | break; \ |
233 | } \ | 233 | } \ |
@@ -247,7 +247,7 @@ extern uint32_t __xchg_32(uint32_t i, volatile void *v); | |||
247 | switch (sizeof(__xg_orig)) { \ | 247 | switch (sizeof(__xg_orig)) { \ |
248 | case 4: __xg_orig = (__typeof__(*(ptr))) __xchg_32((uint32_t) x, __xg_ptr); break; \ | 248 | case 4: __xg_orig = (__typeof__(*(ptr))) __xchg_32((uint32_t) x, __xg_ptr); break; \ |
249 | default: \ | 249 | default: \ |
250 | __xg_orig = 0; \ | 250 | __xg_orig = (__typeof__(__xg_orig))0; \ |
251 | asm volatile("break"); \ | 251 | asm volatile("break"); \ |
252 | break; \ | 252 | break; \ |
253 | } \ | 253 | } \ |
diff --git a/include/asm-frv/checksum.h b/include/asm-frv/checksum.h index 10236f6802db..42bf0db2287a 100644 --- a/include/asm-frv/checksum.h +++ b/include/asm-frv/checksum.h | |||
@@ -43,7 +43,7 @@ unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum); | |||
43 | * here even more important to align src and dst on a 32-bit (or even | 43 | * here even more important to align src and dst on a 32-bit (or even |
44 | * better 64-bit) boundary | 44 | * better 64-bit) boundary |
45 | */ | 45 | */ |
46 | extern unsigned int csum_partial_copy_from_user(const char *src, char *dst, | 46 | extern unsigned int csum_partial_copy_from_user(const char __user *src, char *dst, |
47 | int len, int sum, int *csum_err); | 47 | int len, int sum, int *csum_err); |
48 | 48 | ||
49 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | 49 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ |
diff --git a/include/asm-frv/highmem.h b/include/asm-frv/highmem.h index cfbf7d3a1feb..e2247c22a638 100644 --- a/include/asm-frv/highmem.h +++ b/include/asm-frv/highmem.h | |||
@@ -134,7 +134,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) | |||
134 | 134 | ||
135 | default: | 135 | default: |
136 | BUG(); | 136 | BUG(); |
137 | return 0; | 137 | return NULL; |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
diff --git a/include/asm-frv/io.h b/include/asm-frv/io.h index b56eba59e3cd..7765f5528894 100644 --- a/include/asm-frv/io.h +++ b/include/asm-frv/io.h | |||
@@ -40,13 +40,13 @@ static inline unsigned long _swapl(unsigned long v) | |||
40 | //#define __iormb() asm volatile("membar") | 40 | //#define __iormb() asm volatile("membar") |
41 | //#define __iowmb() asm volatile("membar") | 41 | //#define __iowmb() asm volatile("membar") |
42 | 42 | ||
43 | #define __raw_readb(addr) __builtin_read8((void *) (addr)) | 43 | #define __raw_readb __builtin_read8 |
44 | #define __raw_readw(addr) __builtin_read16((void *) (addr)) | 44 | #define __raw_readw __builtin_read16 |
45 | #define __raw_readl(addr) __builtin_read32((void *) (addr)) | 45 | #define __raw_readl __builtin_read32 |
46 | 46 | ||
47 | #define __raw_writeb(datum, addr) __builtin_write8((void *) (addr), datum) | 47 | #define __raw_writeb(datum, addr) __builtin_write8(addr, datum) |
48 | #define __raw_writew(datum, addr) __builtin_write16((void *) (addr), datum) | 48 | #define __raw_writew(datum, addr) __builtin_write16(addr, datum) |
49 | #define __raw_writel(datum, addr) __builtin_write32((void *) (addr), datum) | 49 | #define __raw_writel(datum, addr) __builtin_write32(addr, datum) |
50 | 50 | ||
51 | static inline void io_outsb(unsigned int addr, const void *buf, int len) | 51 | static inline void io_outsb(unsigned int addr, const void *buf, int len) |
52 | { | 52 | { |
@@ -116,7 +116,7 @@ static inline void memset_io(volatile void __iomem *addr, unsigned char val, int | |||
116 | memset((void __force *) addr, val, count); | 116 | memset((void __force *) addr, val, count); |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline void memcpy_fromio(void *dst, volatile void __iomem *src, int count) | 119 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) |
120 | { | 120 | { |
121 | memcpy(dst, (void __force *) src, count); | 121 | memcpy(dst, (void __force *) src, count); |
122 | } | 122 | } |
@@ -128,12 +128,12 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int | |||
128 | 128 | ||
129 | static inline uint8_t inb(unsigned long addr) | 129 | static inline uint8_t inb(unsigned long addr) |
130 | { | 130 | { |
131 | return __builtin_read8((void *)addr); | 131 | return __builtin_read8((void __iomem *)addr); |
132 | } | 132 | } |
133 | 133 | ||
134 | static inline uint16_t inw(unsigned long addr) | 134 | static inline uint16_t inw(unsigned long addr) |
135 | { | 135 | { |
136 | uint16_t ret = __builtin_read16((void *)addr); | 136 | uint16_t ret = __builtin_read16((void __iomem *)addr); |
137 | 137 | ||
138 | if (__is_PCI_IO(addr)) | 138 | if (__is_PCI_IO(addr)) |
139 | ret = _swapw(ret); | 139 | ret = _swapw(ret); |
@@ -143,7 +143,7 @@ static inline uint16_t inw(unsigned long addr) | |||
143 | 143 | ||
144 | static inline uint32_t inl(unsigned long addr) | 144 | static inline uint32_t inl(unsigned long addr) |
145 | { | 145 | { |
146 | uint32_t ret = __builtin_read32((void *)addr); | 146 | uint32_t ret = __builtin_read32((void __iomem *)addr); |
147 | 147 | ||
148 | if (__is_PCI_IO(addr)) | 148 | if (__is_PCI_IO(addr)) |
149 | ret = _swapl(ret); | 149 | ret = _swapl(ret); |
@@ -153,21 +153,21 @@ static inline uint32_t inl(unsigned long addr) | |||
153 | 153 | ||
154 | static inline void outb(uint8_t datum, unsigned long addr) | 154 | static inline void outb(uint8_t datum, unsigned long addr) |
155 | { | 155 | { |
156 | __builtin_write8((void *)addr, datum); | 156 | __builtin_write8((void __iomem *)addr, datum); |
157 | } | 157 | } |
158 | 158 | ||
159 | static inline void outw(uint16_t datum, unsigned long addr) | 159 | static inline void outw(uint16_t datum, unsigned long addr) |
160 | { | 160 | { |
161 | if (__is_PCI_IO(addr)) | 161 | if (__is_PCI_IO(addr)) |
162 | datum = _swapw(datum); | 162 | datum = _swapw(datum); |
163 | __builtin_write16((void *)addr, datum); | 163 | __builtin_write16((void __iomem *)addr, datum); |
164 | } | 164 | } |
165 | 165 | ||
166 | static inline void outl(uint32_t datum, unsigned long addr) | 166 | static inline void outl(uint32_t datum, unsigned long addr) |
167 | { | 167 | { |
168 | if (__is_PCI_IO(addr)) | 168 | if (__is_PCI_IO(addr)) |
169 | datum = _swapl(datum); | 169 | datum = _swapl(datum); |
170 | __builtin_write32((void *)addr, datum); | 170 | __builtin_write32((void __iomem *)addr, datum); |
171 | } | 171 | } |
172 | 172 | ||
173 | #define inb_p(addr) inb(addr) | 173 | #define inb_p(addr) inb(addr) |
@@ -189,12 +189,12 @@ static inline void outl(uint32_t datum, unsigned long addr) | |||
189 | 189 | ||
190 | static inline uint8_t readb(const volatile void __iomem *addr) | 190 | static inline uint8_t readb(const volatile void __iomem *addr) |
191 | { | 191 | { |
192 | return __builtin_read8((volatile uint8_t __force *) addr); | 192 | return __builtin_read8((__force void volatile __iomem *) addr); |
193 | } | 193 | } |
194 | 194 | ||
195 | static inline uint16_t readw(const volatile void __iomem *addr) | 195 | static inline uint16_t readw(const volatile void __iomem *addr) |
196 | { | 196 | { |
197 | uint16_t ret = __builtin_read16((volatile uint16_t __force *)addr); | 197 | uint16_t ret = __builtin_read16((__force void volatile __iomem *)addr); |
198 | 198 | ||
199 | if (__is_PCI_MEM(addr)) | 199 | if (__is_PCI_MEM(addr)) |
200 | ret = _swapw(ret); | 200 | ret = _swapw(ret); |
@@ -203,7 +203,7 @@ static inline uint16_t readw(const volatile void __iomem *addr) | |||
203 | 203 | ||
204 | static inline uint32_t readl(const volatile void __iomem *addr) | 204 | static inline uint32_t readl(const volatile void __iomem *addr) |
205 | { | 205 | { |
206 | uint32_t ret = __builtin_read32((volatile uint32_t __force *)addr); | 206 | uint32_t ret = __builtin_read32((__force void volatile __iomem *)addr); |
207 | 207 | ||
208 | if (__is_PCI_MEM(addr)) | 208 | if (__is_PCI_MEM(addr)) |
209 | ret = _swapl(ret); | 209 | ret = _swapl(ret); |
@@ -217,7 +217,7 @@ static inline uint32_t readl(const volatile void __iomem *addr) | |||
217 | 217 | ||
218 | static inline void writeb(uint8_t datum, volatile void __iomem *addr) | 218 | static inline void writeb(uint8_t datum, volatile void __iomem *addr) |
219 | { | 219 | { |
220 | __builtin_write8((volatile uint8_t __force *) addr, datum); | 220 | __builtin_write8(addr, datum); |
221 | if (__is_PCI_MEM(addr)) | 221 | if (__is_PCI_MEM(addr)) |
222 | __flush_PCI_writes(); | 222 | __flush_PCI_writes(); |
223 | } | 223 | } |
@@ -227,7 +227,7 @@ static inline void writew(uint16_t datum, volatile void __iomem *addr) | |||
227 | if (__is_PCI_MEM(addr)) | 227 | if (__is_PCI_MEM(addr)) |
228 | datum = _swapw(datum); | 228 | datum = _swapw(datum); |
229 | 229 | ||
230 | __builtin_write16((volatile uint16_t __force *) addr, datum); | 230 | __builtin_write16(addr, datum); |
231 | if (__is_PCI_MEM(addr)) | 231 | if (__is_PCI_MEM(addr)) |
232 | __flush_PCI_writes(); | 232 | __flush_PCI_writes(); |
233 | } | 233 | } |
@@ -237,7 +237,7 @@ static inline void writel(uint32_t datum, volatile void __iomem *addr) | |||
237 | if (__is_PCI_MEM(addr)) | 237 | if (__is_PCI_MEM(addr)) |
238 | datum = _swapl(datum); | 238 | datum = _swapl(datum); |
239 | 239 | ||
240 | __builtin_write32((volatile uint32_t __force *) addr, datum); | 240 | __builtin_write32(addr, datum); |
241 | if (__is_PCI_MEM(addr)) | 241 | if (__is_PCI_MEM(addr)) |
242 | __flush_PCI_writes(); | 242 | __flush_PCI_writes(); |
243 | } | 243 | } |
@@ -271,7 +271,7 @@ static inline void __iomem *ioremap_fullcache(unsigned long physaddr, unsigned l | |||
271 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); | 271 | return __ioremap(physaddr, size, IOMAP_FULL_CACHING); |
272 | } | 272 | } |
273 | 273 | ||
274 | extern void iounmap(void __iomem *addr); | 274 | extern void iounmap(void volatile __iomem *addr); |
275 | 275 | ||
276 | static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) | 276 | static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) |
277 | { | 277 | { |
diff --git a/include/asm-frv/mb-regs.h b/include/asm-frv/mb-regs.h index 93fa732fb0cd..219e5f926f18 100644 --- a/include/asm-frv/mb-regs.h +++ b/include/asm-frv/mb-regs.h | |||
@@ -16,6 +16,17 @@ | |||
16 | #include <asm/sections.h> | 16 | #include <asm/sections.h> |
17 | #include <asm/mem-layout.h> | 17 | #include <asm/mem-layout.h> |
18 | 18 | ||
19 | #ifndef __ASSEMBLY__ | ||
20 | /* gcc builtins, annotated */ | ||
21 | |||
22 | unsigned long __builtin_read8(volatile void __iomem *); | ||
23 | unsigned long __builtin_read16(volatile void __iomem *); | ||
24 | unsigned long __builtin_read32(volatile void __iomem *); | ||
25 | void __builtin_write8(volatile void __iomem *, unsigned char); | ||
26 | void __builtin_write16(volatile void __iomem *, unsigned short); | ||
27 | void __builtin_write32(volatile void __iomem *, unsigned long); | ||
28 | #endif | ||
29 | |||
19 | #define __region_IO KERNEL_IO_START /* the region from 0xe0000000 to 0xffffffff has suitable | 30 | #define __region_IO KERNEL_IO_START /* the region from 0xe0000000 to 0xffffffff has suitable |
20 | * protection laid over the top for use in memory-mapped | 31 | * protection laid over the top for use in memory-mapped |
21 | * I/O | 32 | * I/O |
@@ -59,7 +70,7 @@ | |||
59 | #define __region_PCI_MEM (__region_CS2 + 0x08000000UL) | 70 | #define __region_PCI_MEM (__region_CS2 + 0x08000000UL) |
60 | #define __flush_PCI_writes() \ | 71 | #define __flush_PCI_writes() \ |
61 | do { \ | 72 | do { \ |
62 | __builtin_write8((volatile void *) __region_PCI_MEM, 0); \ | 73 | __builtin_write8((volatile void __iomem *) __region_PCI_MEM, 0); \ |
63 | } while(0) | 74 | } while(0) |
64 | 75 | ||
65 | #define __is_PCI_IO(addr) \ | 76 | #define __is_PCI_IO(addr) \ |
@@ -83,15 +94,15 @@ extern int __nongprelbss mb93090_mb00_detected; | |||
83 | #define __set_LEDS(X) \ | 94 | #define __set_LEDS(X) \ |
84 | do { \ | 95 | do { \ |
85 | if (mb93090_mb00_detected) \ | 96 | if (mb93090_mb00_detected) \ |
86 | __builtin_write32((void *) __addr_LEDS(), ~(X)); \ | 97 | __builtin_write32((void __iomem *) __addr_LEDS(), ~(X)); \ |
87 | } while (0) | 98 | } while (0) |
88 | #else | 99 | #else |
89 | #define __set_LEDS(X) | 100 | #define __set_LEDS(X) |
90 | #endif | 101 | #endif |
91 | 102 | ||
92 | #define __addr_LCD() (__region_CS2 + 0x01200008UL) | 103 | #define __addr_LCD() (__region_CS2 + 0x01200008UL) |
93 | #define __get_LCD(B) __builtin_read32((volatile void *) (B)) | 104 | #define __get_LCD(B) __builtin_read32((volatile void __iomem *) (B)) |
94 | #define __set_LCD(B,X) __builtin_write32((volatile void *) (B), (X)) | 105 | #define __set_LCD(B,X) __builtin_write32((volatile void __iomem *) (B), (X)) |
95 | 106 | ||
96 | #define LCD_D 0x000000ff /* LCD data bus */ | 107 | #define LCD_D 0x000000ff /* LCD data bus */ |
97 | #define LCD_RW 0x00000100 /* LCD R/W signal */ | 108 | #define LCD_RW 0x00000100 /* LCD R/W signal */ |
@@ -161,11 +172,11 @@ do { \ | |||
161 | #define __get_CLKIN() 66000000UL | 172 | #define __get_CLKIN() 66000000UL |
162 | 173 | ||
163 | #define __addr_LEDS() (__region_CS2 + 0x00000023UL) | 174 | #define __addr_LEDS() (__region_CS2 + 0x00000023UL) |
164 | #define __set_LEDS(X) __builtin_write8((volatile void *) __addr_LEDS(), (X)) | 175 | #define __set_LEDS(X) __builtin_write8((volatile void __iomem *) __addr_LEDS(), (X)) |
165 | 176 | ||
166 | #define __addr_FPGATR() (__region_CS2 + 0x00000030UL) | 177 | #define __addr_FPGATR() (__region_CS2 + 0x00000030UL) |
167 | #define __set_FPGATR(X) __builtin_write32((volatile void *) __addr_FPGATR(), (X)) | 178 | #define __set_FPGATR(X) __builtin_write32((volatile void __iomem *) __addr_FPGATR(), (X)) |
168 | #define __get_FPGATR() __builtin_read32((volatile void *) __addr_FPGATR()) | 179 | #define __get_FPGATR() __builtin_read32((volatile void __iomem *) __addr_FPGATR()) |
169 | 180 | ||
170 | #define MB93093_FPGA_FPGATR_AUDIO_CLK 0x00000003 | 181 | #define MB93093_FPGA_FPGATR_AUDIO_CLK 0x00000003 |
171 | 182 | ||
@@ -180,7 +191,7 @@ do { \ | |||
180 | #define MB93093_FPGA_SWR_PUSHSWMASK (0x1F<<26) | 191 | #define MB93093_FPGA_SWR_PUSHSWMASK (0x1F<<26) |
181 | #define MB93093_FPGA_SWR_PUSHSW4 (1<<29) | 192 | #define MB93093_FPGA_SWR_PUSHSW4 (1<<29) |
182 | 193 | ||
183 | #define __addr_FPGA_SWR ((volatile void *)(__region_CS2 + 0x28UL)) | 194 | #define __addr_FPGA_SWR ((volatile void __iomem *)(__region_CS2 + 0x28UL)) |
184 | #define __get_FPGA_PUSHSW1_5() (__builtin_read32(__addr_FPGA_SWR) & MB93093_FPGA_SWR_PUSHSWMASK) | 195 | #define __get_FPGA_PUSHSW1_5() (__builtin_read32(__addr_FPGA_SWR) & MB93093_FPGA_SWR_PUSHSWMASK) |
185 | 196 | ||
186 | 197 | ||
diff --git a/include/asm-frv/signal.h b/include/asm-frv/signal.h index 67366894780f..dcc1b3592918 100644 --- a/include/asm-frv/signal.h +++ b/include/asm-frv/signal.h | |||
@@ -114,13 +114,13 @@ struct old_sigaction { | |||
114 | __sighandler_t sa_handler; | 114 | __sighandler_t sa_handler; |
115 | old_sigset_t sa_mask; | 115 | old_sigset_t sa_mask; |
116 | unsigned long sa_flags; | 116 | unsigned long sa_flags; |
117 | void (*sa_restorer)(void); | 117 | __sigrestore_t sa_restorer; |
118 | }; | 118 | }; |
119 | 119 | ||
120 | struct sigaction { | 120 | struct sigaction { |
121 | __sighandler_t sa_handler; | 121 | __sighandler_t sa_handler; |
122 | unsigned long sa_flags; | 122 | unsigned long sa_flags; |
123 | void (*sa_restorer)(void); | 123 | __sigrestore_t sa_restorer; |
124 | sigset_t sa_mask; /* mask last for extensibility */ | 124 | sigset_t sa_mask; /* mask last for extensibility */ |
125 | }; | 125 | }; |
126 | 126 | ||
@@ -146,7 +146,7 @@ struct sigaction { | |||
146 | #endif /* __KERNEL__ */ | 146 | #endif /* __KERNEL__ */ |
147 | 147 | ||
148 | typedef struct sigaltstack { | 148 | typedef struct sigaltstack { |
149 | void *ss_sp; | 149 | void __user *ss_sp; |
150 | int ss_flags; | 150 | int ss_flags; |
151 | size_t ss_size; | 151 | size_t ss_size; |
152 | } stack_t; | 152 | } stack_t; |
diff --git a/include/asm-frv/uaccess.h b/include/asm-frv/uaccess.h index a1d140438863..3d90e1018ee2 100644 --- a/include/asm-frv/uaccess.h +++ b/include/asm-frv/uaccess.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #define HAVE_ARCH_UNMAPPED_AREA /* we decide where to put mmaps */ | 23 | #define HAVE_ARCH_UNMAPPED_AREA /* we decide where to put mmaps */ |
24 | 24 | ||
25 | #define __ptr(x) ((unsigned long *)(x)) | 25 | #define __ptr(x) ((unsigned long __force *)(x)) |
26 | 26 | ||
27 | #define VERIFY_READ 0 | 27 | #define VERIFY_READ 0 |
28 | #define VERIFY_WRITE 1 | 28 | #define VERIFY_WRITE 1 |
@@ -64,7 +64,7 @@ static inline int ___range_ok(unsigned long addr, unsigned long size) | |||
64 | 64 | ||
65 | #define __range_ok(addr,size) ___range_ok((unsigned long) (addr), (unsigned long) (size)) | 65 | #define __range_ok(addr,size) ___range_ok((unsigned long) (addr), (unsigned long) (size)) |
66 | 66 | ||
67 | #define access_ok(type,addr,size) (__range_ok((addr), (size)) == 0) | 67 | #define access_ok(type,addr,size) (__range_ok((void __user *)(addr), (size)) == 0) |
68 | #define __access_ok(addr,size) (__range_ok((addr), (size)) == 0) | 68 | #define __access_ok(addr,size) (__range_ok((addr), (size)) == 0) |
69 | 69 | ||
70 | /* | 70 | /* |
@@ -97,6 +97,7 @@ extern unsigned long search_exception_table(unsigned long); | |||
97 | int __pu_err = 0; \ | 97 | int __pu_err = 0; \ |
98 | \ | 98 | \ |
99 | typeof(*(ptr)) __pu_val = (x); \ | 99 | typeof(*(ptr)) __pu_val = (x); \ |
100 | __chk_user_ptr(ptr); \ | ||
100 | \ | 101 | \ |
101 | switch (sizeof (*(ptr))) { \ | 102 | switch (sizeof (*(ptr))) { \ |
102 | case 1: \ | 103 | case 1: \ |
@@ -120,7 +121,7 @@ extern unsigned long search_exception_table(unsigned long); | |||
120 | 121 | ||
121 | #define put_user(x, ptr) \ | 122 | #define put_user(x, ptr) \ |
122 | ({ \ | 123 | ({ \ |
123 | typeof(&*ptr) _p = (ptr); \ | 124 | typeof(*(ptr)) __user *_p = (ptr); \ |
124 | int _e; \ | 125 | int _e; \ |
125 | \ | 126 | \ |
126 | _e = __range_ok(_p, sizeof(*_p)); \ | 127 | _e = __range_ok(_p, sizeof(*_p)); \ |
@@ -175,33 +176,44 @@ do { \ | |||
175 | */ | 176 | */ |
176 | #define __get_user(x, ptr) \ | 177 | #define __get_user(x, ptr) \ |
177 | ({ \ | 178 | ({ \ |
178 | typeof(*(ptr)) __gu_val = 0; \ | ||
179 | int __gu_err = 0; \ | 179 | int __gu_err = 0; \ |
180 | __chk_user_ptr(ptr); \ | ||
180 | \ | 181 | \ |
181 | switch (sizeof(*(ptr))) { \ | 182 | switch (sizeof(*(ptr))) { \ |
182 | case 1: \ | 183 | case 1: { \ |
183 | __get_user_asm(__gu_err, *(u8*)&__gu_val, ptr, "ub", "=r"); \ | 184 | unsigned char __gu_val; \ |
185 | __get_user_asm(__gu_err, __gu_val, ptr, "ub", "=r"); \ | ||
186 | (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \ | ||
184 | break; \ | 187 | break; \ |
185 | case 2: \ | 188 | } \ |
186 | __get_user_asm(__gu_err, *(u16*)&__gu_val, ptr, "uh", "=r"); \ | 189 | case 2: { \ |
190 | unsigned short __gu_val; \ | ||
191 | __get_user_asm(__gu_err, __gu_val, ptr, "uh", "=r"); \ | ||
192 | (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \ | ||
187 | break; \ | 193 | break; \ |
188 | case 4: \ | 194 | } \ |
189 | __get_user_asm(__gu_err, *(u32*)&__gu_val, ptr, "", "=r"); \ | 195 | case 4: { \ |
196 | unsigned int __gu_val; \ | ||
197 | __get_user_asm(__gu_err, __gu_val, ptr, "", "=r"); \ | ||
198 | (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \ | ||
190 | break; \ | 199 | break; \ |
191 | case 8: \ | 200 | } \ |
192 | __get_user_asm(__gu_err, *(u64*)&__gu_val, ptr, "d", "=e"); \ | 201 | case 8: { \ |
202 | unsigned long long __gu_val; \ | ||
203 | __get_user_asm(__gu_err, __gu_val, ptr, "d", "=e"); \ | ||
204 | (x) = *(__force __typeof__(*(ptr)) *) &__gu_val; \ | ||
193 | break; \ | 205 | break; \ |
206 | } \ | ||
194 | default: \ | 207 | default: \ |
195 | __gu_err = __get_user_bad(); \ | 208 | __gu_err = __get_user_bad(); \ |
196 | break; \ | 209 | break; \ |
197 | } \ | 210 | } \ |
198 | (x) = __gu_val; \ | ||
199 | __gu_err; \ | 211 | __gu_err; \ |
200 | }) | 212 | }) |
201 | 213 | ||
202 | #define get_user(x, ptr) \ | 214 | #define get_user(x, ptr) \ |
203 | ({ \ | 215 | ({ \ |
204 | typeof(&*ptr) _p = (ptr); \ | 216 | const typeof(*(ptr)) __user *_p = (ptr);\ |
205 | int _e; \ | 217 | int _e; \ |
206 | \ | 218 | \ |
207 | _e = __range_ok(_p, sizeof(*_p)); \ | 219 | _e = __range_ok(_p, sizeof(*_p)); \ |
@@ -248,19 +260,20 @@ do { \ | |||
248 | /* | 260 | /* |
249 | * | 261 | * |
250 | */ | 262 | */ |
263 | #define ____force(x) (__force void *)(void __user *)(x) | ||
251 | #ifdef CONFIG_MMU | 264 | #ifdef CONFIG_MMU |
252 | extern long __memset_user(void *dst, unsigned long count); | 265 | extern long __memset_user(void *dst, unsigned long count); |
253 | extern long __memcpy_user(void *dst, const void *src, unsigned long count); | 266 | extern long __memcpy_user(void *dst, const void *src, unsigned long count); |
254 | 267 | ||
255 | #define clear_user(dst,count) __memset_user((dst), (count)) | 268 | #define clear_user(dst,count) __memset_user(____force(dst), (count)) |
256 | #define __copy_from_user_inatomic(to, from, n) __memcpy_user((to), (from), (n)) | 269 | #define __copy_from_user_inatomic(to, from, n) __memcpy_user((to), ____force(from), (n)) |
257 | #define __copy_to_user_inatomic(to, from, n) __memcpy_user((to), (from), (n)) | 270 | #define __copy_to_user_inatomic(to, from, n) __memcpy_user(____force(to), (from), (n)) |
258 | 271 | ||
259 | #else | 272 | #else |
260 | 273 | ||
261 | #define clear_user(dst,count) (memset((dst), 0, (count)), 0) | 274 | #define clear_user(dst,count) (memset(____force(dst), 0, (count)), 0) |
262 | #define __copy_from_user_inatomic(to, from, n) (memcpy((to), (from), (n)), 0) | 275 | #define __copy_from_user_inatomic(to, from, n) (memcpy((to), ____force(from), (n)), 0) |
263 | #define __copy_to_user_inatomic(to, from, n) (memcpy((to), (from), (n)), 0) | 276 | #define __copy_to_user_inatomic(to, from, n) (memcpy(____force(to), (from), (n)), 0) |
264 | 277 | ||
265 | #endif | 278 | #endif |
266 | 279 | ||
@@ -278,7 +291,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n) | |||
278 | return __copy_from_user_inatomic(to, from, n); | 291 | return __copy_from_user_inatomic(to, from, n); |
279 | } | 292 | } |
280 | 293 | ||
281 | static inline long copy_from_user(void *to, const void *from, unsigned long n) | 294 | static inline long copy_from_user(void *to, const void __user *from, unsigned long n) |
282 | { | 295 | { |
283 | unsigned long ret = n; | 296 | unsigned long ret = n; |
284 | 297 | ||
@@ -291,16 +304,13 @@ static inline long copy_from_user(void *to, const void *from, unsigned long n) | |||
291 | return ret; | 304 | return ret; |
292 | } | 305 | } |
293 | 306 | ||
294 | static inline long copy_to_user(void *to, const void *from, unsigned long n) | 307 | static inline long copy_to_user(void __user *to, const void *from, unsigned long n) |
295 | { | 308 | { |
296 | return likely(__access_ok(to, n)) ? __copy_to_user(to, from, n) : n; | 309 | return likely(__access_ok(to, n)) ? __copy_to_user(to, from, n) : n; |
297 | } | 310 | } |
298 | 311 | ||
299 | #define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; }) | 312 | extern long strncpy_from_user(char *dst, const char __user *src, long count); |
300 | #define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; }) | 313 | extern long strnlen_user(const char __user *src, long count); |
301 | |||
302 | extern long strncpy_from_user(char *dst, const char *src, long count); | ||
303 | extern long strnlen_user(const char *src, long count); | ||
304 | 314 | ||
305 | #define strlen_user(str) strnlen_user(str, 32767) | 315 | #define strlen_user(str) strnlen_user(str, 32767) |
306 | 316 | ||
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h index 7c2e712c3b73..b80dbd839475 100644 --- a/include/asm-frv/unistd.h +++ b/include/asm-frv/unistd.h | |||
@@ -306,7 +306,7 @@ | |||
306 | #define __NR_mknodat 297 | 306 | #define __NR_mknodat 297 |
307 | #define __NR_fchownat 298 | 307 | #define __NR_fchownat 298 |
308 | #define __NR_futimesat 299 | 308 | #define __NR_futimesat 299 |
309 | #define __NR_newfstatat 300 | 309 | #define __NR_fstatat64 300 |
310 | #define __NR_unlinkat 301 | 310 | #define __NR_unlinkat 301 |
311 | #define __NR_renameat 302 | 311 | #define __NR_renameat 302 |
312 | #define __NR_linkat 303 | 312 | #define __NR_linkat 303 |
@@ -460,24 +460,7 @@ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg | |||
460 | * some others too. | 460 | * some others too. |
461 | */ | 461 | */ |
462 | #define __NR__exit __NR_exit | 462 | #define __NR__exit __NR_exit |
463 | static inline _syscall0(int,pause) | ||
464 | static inline _syscall0(int,sync) | ||
465 | static inline _syscall0(pid_t,setsid) | ||
466 | static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
467 | static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
468 | static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
469 | static inline _syscall1(int,dup,int,fd) | ||
470 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | 463 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) |
471 | static inline _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
472 | static inline _syscall1(int,close,int,fd) | ||
473 | static inline _syscall1(int,_exit,int,exitcode) | ||
474 | static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
475 | static inline _syscall1(int,delete_module,const char *,name) | ||
476 | |||
477 | static inline pid_t wait(int * wait_stat) | ||
478 | { | ||
479 | return waitpid(-1,wait_stat,0); | ||
480 | } | ||
481 | 464 | ||
482 | #endif /* __KERNEL_SYSCALLS__ */ | 465 | #endif /* __KERNEL_SYSCALLS__ */ |
483 | 466 | ||
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index 0cfb086dd373..8078cbd2c016 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h | |||
@@ -23,29 +23,23 @@ | |||
23 | 23 | ||
24 | #endif /* CONFIG_DISCONTIGMEM */ | 24 | #endif /* CONFIG_DISCONTIGMEM */ |
25 | 25 | ||
26 | #ifdef CONFIG_OUT_OF_LINE_PFN_TO_PAGE | ||
27 | struct page; | ||
28 | /* this is useful when inlined pfn_to_page is too big */ | ||
29 | extern struct page *pfn_to_page(unsigned long pfn); | ||
30 | extern unsigned long page_to_pfn(struct page *page); | ||
31 | #else | ||
32 | /* | 26 | /* |
33 | * supports 3 memory models. | 27 | * supports 3 memory models. |
34 | */ | 28 | */ |
35 | #if defined(CONFIG_FLATMEM) | 29 | #if defined(CONFIG_FLATMEM) |
36 | 30 | ||
37 | #define pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) | 31 | #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) |
38 | #define page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ | 32 | #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ |
39 | ARCH_PFN_OFFSET) | 33 | ARCH_PFN_OFFSET) |
40 | #elif defined(CONFIG_DISCONTIGMEM) | 34 | #elif defined(CONFIG_DISCONTIGMEM) |
41 | 35 | ||
42 | #define pfn_to_page(pfn) \ | 36 | #define __pfn_to_page(pfn) \ |
43 | ({ unsigned long __pfn = (pfn); \ | 37 | ({ unsigned long __pfn = (pfn); \ |
44 | unsigned long __nid = arch_pfn_to_nid(pfn); \ | 38 | unsigned long __nid = arch_pfn_to_nid(pfn); \ |
45 | NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ | 39 | NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ |
46 | }) | 40 | }) |
47 | 41 | ||
48 | #define page_to_pfn(pg) \ | 42 | #define __page_to_pfn(pg) \ |
49 | ({ struct page *__pg = (pg); \ | 43 | ({ struct page *__pg = (pg); \ |
50 | struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ | 44 | struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ |
51 | (unsigned long)(__pg - __pgdat->node_mem_map) + \ | 45 | (unsigned long)(__pg - __pgdat->node_mem_map) + \ |
@@ -57,18 +51,27 @@ extern unsigned long page_to_pfn(struct page *page); | |||
57 | * Note: section's mem_map is encorded to reflect its start_pfn. | 51 | * Note: section's mem_map is encorded to reflect its start_pfn. |
58 | * section[i].section_mem_map == mem_map's address - start_pfn; | 52 | * section[i].section_mem_map == mem_map's address - start_pfn; |
59 | */ | 53 | */ |
60 | #define page_to_pfn(pg) \ | 54 | #define __page_to_pfn(pg) \ |
61 | ({ struct page *__pg = (pg); \ | 55 | ({ struct page *__pg = (pg); \ |
62 | int __sec = page_to_section(__pg); \ | 56 | int __sec = page_to_section(__pg); \ |
63 | __pg - __section_mem_map_addr(__nr_to_section(__sec)); \ | 57 | __pg - __section_mem_map_addr(__nr_to_section(__sec)); \ |
64 | }) | 58 | }) |
65 | 59 | ||
66 | #define pfn_to_page(pfn) \ | 60 | #define __pfn_to_page(pfn) \ |
67 | ({ unsigned long __pfn = (pfn); \ | 61 | ({ unsigned long __pfn = (pfn); \ |
68 | struct mem_section *__sec = __pfn_to_section(__pfn); \ | 62 | struct mem_section *__sec = __pfn_to_section(__pfn); \ |
69 | __section_mem_map_addr(__sec) + __pfn; \ | 63 | __section_mem_map_addr(__sec) + __pfn; \ |
70 | }) | 64 | }) |
71 | #endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ | 65 | #endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ |
66 | |||
67 | #ifdef CONFIG_OUT_OF_LINE_PFN_TO_PAGE | ||
68 | struct page; | ||
69 | /* this is useful when inlined pfn_to_page is too big */ | ||
70 | extern struct page *pfn_to_page(unsigned long pfn); | ||
71 | extern unsigned long page_to_pfn(struct page *page); | ||
72 | #else | ||
73 | #define page_to_pfn __page_to_pfn | ||
74 | #define pfn_to_page __pfn_to_page | ||
72 | #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */ | 75 | #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */ |
73 | 76 | ||
74 | #endif /* __ASSEMBLY__ */ | 77 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/asm-h8300/irq.h b/include/asm-h8300/irq.h index 73065f5bda0e..42a3ac424a9e 100644 --- a/include/asm-h8300/irq.h +++ b/include/asm-h8300/irq.h | |||
@@ -63,8 +63,4 @@ extern void enable_irq(unsigned int); | |||
63 | extern void disable_irq(unsigned int); | 63 | extern void disable_irq(unsigned int); |
64 | #define disable_irq_nosync(x) disable_irq(x) | 64 | #define disable_irq_nosync(x) disable_irq(x) |
65 | 65 | ||
66 | struct irqaction; | ||
67 | struct pt_regs; | ||
68 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
69 | |||
70 | #endif /* _H8300_IRQ_H_ */ | 66 | #endif /* _H8300_IRQ_H_ */ |
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h index e201decea0c9..d79e9ee10fd7 100644 --- a/include/asm-i386/alternative.h +++ b/include/asm-i386/alternative.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <asm/types.h> | ||
7 | |||
6 | struct alt_instr { | 8 | struct alt_instr { |
7 | u8 *instr; /* original instruction */ | 9 | u8 *instr; /* original instruction */ |
8 | u8 *replacement; | 10 | u8 *replacement; |
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index cc9b940fb7e8..1d8362cb2c5d 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
@@ -138,8 +138,6 @@ void switch_ipi_to_APIC_timer(void *cpumask); | |||
138 | 138 | ||
139 | extern int timer_over_8254; | 139 | extern int timer_over_8254; |
140 | 140 | ||
141 | extern int modern_apic(void); | ||
142 | |||
143 | #else /* !CONFIG_X86_LOCAL_APIC */ | 141 | #else /* !CONFIG_X86_LOCAL_APIC */ |
144 | static inline void lapic_shutdown(void) { } | 142 | static inline void lapic_shutdown(void) { } |
145 | 143 | ||
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h index 5e4a35af2921..9f6995341fdc 100644 --- a/include/asm-i386/apicdef.h +++ b/include/asm-i386/apicdef.h | |||
@@ -121,7 +121,6 @@ | |||
121 | */ | 121 | */ |
122 | #define u32 unsigned int | 122 | #define u32 unsigned int |
123 | 123 | ||
124 | #define lapic ((volatile struct local_apic *)APIC_BASE) | ||
125 | 124 | ||
126 | struct local_apic { | 125 | struct local_apic { |
127 | 126 | ||
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h index b44bfc6239cb..3ecedbafa8ce 100644 --- a/include/asm-i386/cpufeature.h +++ b/include/asm-i386/cpufeature.h | |||
@@ -88,6 +88,12 @@ | |||
88 | #define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */ | 88 | #define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */ |
89 | #define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */ | 89 | #define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */ |
90 | #define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */ | 90 | #define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */ |
91 | #define X86_FEATURE_ACE2 (5*32+ 8) /* Advanced Cryptography Engine v2 */ | ||
92 | #define X86_FEATURE_ACE2_EN (5*32+ 9) /* ACE v2 enabled */ | ||
93 | #define X86_FEATURE_PHE (5*32+ 10) /* PadLock Hash Engine */ | ||
94 | #define X86_FEATURE_PHE_EN (5*32+ 11) /* PHE enabled */ | ||
95 | #define X86_FEATURE_PMM (5*32+ 12) /* PadLock Montgomery Multiplier */ | ||
96 | #define X86_FEATURE_PMM_EN (5*32+ 13) /* PMM enabled */ | ||
91 | 97 | ||
92 | /* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */ | 98 | /* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */ |
93 | #define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */ | 99 | #define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */ |
@@ -121,6 +127,12 @@ | |||
121 | #define cpu_has_xstore_enabled boot_cpu_has(X86_FEATURE_XSTORE_EN) | 127 | #define cpu_has_xstore_enabled boot_cpu_has(X86_FEATURE_XSTORE_EN) |
122 | #define cpu_has_xcrypt boot_cpu_has(X86_FEATURE_XCRYPT) | 128 | #define cpu_has_xcrypt boot_cpu_has(X86_FEATURE_XCRYPT) |
123 | #define cpu_has_xcrypt_enabled boot_cpu_has(X86_FEATURE_XCRYPT_EN) | 129 | #define cpu_has_xcrypt_enabled boot_cpu_has(X86_FEATURE_XCRYPT_EN) |
130 | #define cpu_has_ace2 boot_cpu_has(X86_FEATURE_ACE2) | ||
131 | #define cpu_has_ace2_enabled boot_cpu_has(X86_FEATURE_ACE2_EN) | ||
132 | #define cpu_has_phe boot_cpu_has(X86_FEATURE_PHE) | ||
133 | #define cpu_has_phe_enabled boot_cpu_has(X86_FEATURE_PHE_EN) | ||
134 | #define cpu_has_pmm boot_cpu_has(X86_FEATURE_PMM) | ||
135 | #define cpu_has_pmm_enabled boot_cpu_has(X86_FEATURE_PMM_EN) | ||
124 | 136 | ||
125 | #endif /* __ASM_I386_CPUFEATURE_H */ | 137 | #endif /* __ASM_I386_CPUFEATURE_H */ |
126 | 138 | ||
diff --git a/include/asm-i386/mce.h b/include/asm-i386/mce.h new file mode 100644 index 000000000000..7cc1a973bf00 --- /dev/null +++ b/include/asm-i386/mce.h | |||
@@ -0,0 +1,5 @@ | |||
1 | #ifdef CONFIG_X86_MCE | ||
2 | extern void mcheck_init(struct cpuinfo_x86 *c); | ||
3 | #else | ||
4 | #define mcheck_init(c) do {} while(0) | ||
5 | #endif | ||
diff --git a/include/asm-i386/msi.h b/include/asm-i386/msi.h index f041d4495faf..b11c4b7dfaef 100644 --- a/include/asm-i386/msi.h +++ b/include/asm-i386/msi.h | |||
@@ -9,7 +9,15 @@ | |||
9 | #include <asm/desc.h> | 9 | #include <asm/desc.h> |
10 | #include <mach_apic.h> | 10 | #include <mach_apic.h> |
11 | 11 | ||
12 | #define LAST_DEVICE_VECTOR 232 | 12 | #define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1) |
13 | #define MSI_TARGET_CPU_SHIFT 12 | 13 | #define MSI_TARGET_CPU_SHIFT 12 |
14 | 14 | ||
15 | extern struct msi_ops msi_apic_ops; | ||
16 | |||
17 | static inline int msi_arch_init(void) | ||
18 | { | ||
19 | msi_register(&msi_apic_ops); | ||
20 | return 0; | ||
21 | } | ||
22 | |||
15 | #endif /* ASM_MSI_H */ | 23 | #endif /* ASM_MSI_H */ |
diff --git a/include/asm-i386/mtrr.h b/include/asm-i386/mtrr.h index 5a46de08efea..07f063ae26ea 100644 --- a/include/asm-i386/mtrr.h +++ b/include/asm-i386/mtrr.h | |||
@@ -76,6 +76,8 @@ extern int mtrr_add_page (unsigned long base, unsigned long size, | |||
76 | extern int mtrr_del (int reg, unsigned long base, unsigned long size); | 76 | extern int mtrr_del (int reg, unsigned long base, unsigned long size); |
77 | extern int mtrr_del_page (int reg, unsigned long base, unsigned long size); | 77 | extern int mtrr_del_page (int reg, unsigned long base, unsigned long size); |
78 | extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi); | 78 | extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi); |
79 | extern void mtrr_ap_init(void); | ||
80 | extern void mtrr_bp_init(void); | ||
79 | # else | 81 | # else |
80 | static __inline__ int mtrr_add (unsigned long base, unsigned long size, | 82 | static __inline__ int mtrr_add (unsigned long base, unsigned long size, |
81 | unsigned int type, char increment) | 83 | unsigned int type, char increment) |
@@ -100,6 +102,8 @@ static __inline__ int mtrr_del_page (int reg, unsigned long base, | |||
100 | 102 | ||
101 | static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {;} | 103 | static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {;} |
102 | 104 | ||
105 | #define mtrr_ap_init() do {} while (0) | ||
106 | #define mtrr_bp_init() do {} while (0) | ||
103 | # endif | 107 | # endif |
104 | 108 | ||
105 | #endif | 109 | #endif |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 4df3818e4122..0c83cf12eec9 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -728,18 +728,4 @@ extern unsigned long boot_option_idle_override; | |||
728 | extern void enable_sep_cpu(void); | 728 | extern void enable_sep_cpu(void); |
729 | extern int sysenter_setup(void); | 729 | extern int sysenter_setup(void); |
730 | 730 | ||
731 | #ifdef CONFIG_MTRR | ||
732 | extern void mtrr_ap_init(void); | ||
733 | extern void mtrr_bp_init(void); | ||
734 | #else | ||
735 | #define mtrr_ap_init() do {} while (0) | ||
736 | #define mtrr_bp_init() do {} while (0) | ||
737 | #endif | ||
738 | |||
739 | #ifdef CONFIG_X86_MCE | ||
740 | extern void mcheck_init(struct cpuinfo_x86 *c); | ||
741 | #else | ||
742 | #define mcheck_init(c) do {} while(0) | ||
743 | #endif | ||
744 | |||
745 | #endif /* __ASM_I386_PROCESSOR_H */ | 731 | #endif /* __ASM_I386_PROCESSOR_H */ |
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h index 1ec65523ea5e..8462f8e0e658 100644 --- a/include/asm-i386/uaccess.h +++ b/include/asm-i386/uaccess.h | |||
@@ -58,7 +58,7 @@ extern struct movsl_mask { | |||
58 | __chk_user_ptr(addr); \ | 58 | __chk_user_ptr(addr); \ |
59 | asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \ | 59 | asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \ |
60 | :"=&r" (flag), "=r" (sum) \ | 60 | :"=&r" (flag), "=r" (sum) \ |
61 | :"1" (addr),"g" ((int)(size)),"g" (current_thread_info()->addr_limit.seg)); \ | 61 | :"1" (addr),"g" ((int)(size)),"rm" (current_thread_info()->addr_limit.seg)); \ |
62 | flag; }) | 62 | flag; }) |
63 | 63 | ||
64 | /** | 64 | /** |
@@ -390,6 +390,8 @@ unsigned long __must_check __copy_to_user_ll(void __user *to, | |||
390 | const void *from, unsigned long n); | 390 | const void *from, unsigned long n); |
391 | unsigned long __must_check __copy_from_user_ll(void *to, | 391 | unsigned long __must_check __copy_from_user_ll(void *to, |
392 | const void __user *from, unsigned long n); | 392 | const void __user *from, unsigned long n); |
393 | unsigned long __must_check __copy_from_user_ll_nocache(void *to, | ||
394 | const void __user *from, unsigned long n); | ||
393 | 395 | ||
394 | /* | 396 | /* |
395 | * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault | 397 | * Here we special-case 1, 2 and 4-byte copy_*_user invocations. On a fault |
@@ -478,12 +480,43 @@ __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) | |||
478 | return __copy_from_user_ll(to, from, n); | 480 | return __copy_from_user_ll(to, from, n); |
479 | } | 481 | } |
480 | 482 | ||
483 | #define ARCH_HAS_NOCACHE_UACCESS | ||
484 | |||
485 | static __always_inline unsigned long __copy_from_user_inatomic_nocache(void *to, | ||
486 | const void __user *from, unsigned long n) | ||
487 | { | ||
488 | if (__builtin_constant_p(n)) { | ||
489 | unsigned long ret; | ||
490 | |||
491 | switch (n) { | ||
492 | case 1: | ||
493 | __get_user_size(*(u8 *)to, from, 1, ret, 1); | ||
494 | return ret; | ||
495 | case 2: | ||
496 | __get_user_size(*(u16 *)to, from, 2, ret, 2); | ||
497 | return ret; | ||
498 | case 4: | ||
499 | __get_user_size(*(u32 *)to, from, 4, ret, 4); | ||
500 | return ret; | ||
501 | } | ||
502 | } | ||
503 | return __copy_from_user_ll_nocache(to, from, n); | ||
504 | } | ||
505 | |||
481 | static __always_inline unsigned long | 506 | static __always_inline unsigned long |
482 | __copy_from_user(void *to, const void __user *from, unsigned long n) | 507 | __copy_from_user(void *to, const void __user *from, unsigned long n) |
483 | { | 508 | { |
484 | might_sleep(); | 509 | might_sleep(); |
485 | return __copy_from_user_inatomic(to, from, n); | 510 | return __copy_from_user_inatomic(to, from, n); |
486 | } | 511 | } |
512 | |||
513 | static __always_inline unsigned long | ||
514 | __copy_from_user_nocache(void *to, const void __user *from, unsigned long n) | ||
515 | { | ||
516 | might_sleep(); | ||
517 | return __copy_from_user_inatomic_nocache(to, from, n); | ||
518 | } | ||
519 | |||
487 | unsigned long __must_check copy_to_user(void __user *to, | 520 | unsigned long __must_check copy_to_user(void __user *to, |
488 | const void *from, unsigned long n); | 521 | const void *from, unsigned long n); |
489 | unsigned long __must_check copy_from_user(void *to, | 522 | unsigned long __must_check copy_from_user(void *to, |
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index de2ccc149e34..fc1c8ddae149 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
@@ -322,10 +322,11 @@ | |||
322 | #define __NR_sync_file_range 314 | 322 | #define __NR_sync_file_range 314 |
323 | #define __NR_tee 315 | 323 | #define __NR_tee 315 |
324 | #define __NR_vmsplice 316 | 324 | #define __NR_vmsplice 316 |
325 | #define __NR_move_pages 317 | ||
325 | 326 | ||
326 | #ifdef __KERNEL__ | 327 | #ifdef __KERNEL__ |
327 | 328 | ||
328 | #define NR_syscalls 317 | 329 | #define NR_syscalls 318 |
329 | 330 | ||
330 | /* | 331 | /* |
331 | * user-visible error numbers are in the range -1 - -128: see | 332 | * user-visible error numbers are in the range -1 - -128: see |
diff --git a/include/asm-i386/vga.h b/include/asm-i386/vga.h index ef0c0e50cc95..0ecf68ac03aa 100644 --- a/include/asm-i386/vga.h +++ b/include/asm-i386/vga.h | |||
@@ -12,7 +12,7 @@ | |||
12 | * access the videoram directly without any black magic. | 12 | * access the videoram directly without any black magic. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) | 15 | #define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x) |
16 | 16 | ||
17 | #define vga_readb(x) (*(x)) | 17 | #define vga_readb(x) (*(x)) |
18 | #define vga_writeb(x,y) (*(y) = (x)) | 18 | #define vga_writeb(x,y) (*(y) = (x)) |
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h index 0cf119b42f7d..ea8b8c407ab4 100644 --- a/include/asm-ia64/hw_irq.h +++ b/include/asm-ia64/hw_irq.h | |||
@@ -47,9 +47,19 @@ typedef u8 ia64_vector; | |||
47 | #define IA64_CMC_VECTOR 0x1f /* corrected machine-check interrupt vector */ | 47 | #define IA64_CMC_VECTOR 0x1f /* corrected machine-check interrupt vector */ |
48 | /* | 48 | /* |
49 | * Vectors 0x20-0x2f are reserved for legacy ISA IRQs. | 49 | * Vectors 0x20-0x2f are reserved for legacy ISA IRQs. |
50 | * Use vectors 0x30-0xe7 as the default device vector range for ia64. | ||
51 | * Platforms may choose to reduce this range in platform_irq_setup, but the | ||
52 | * platform range must fall within | ||
53 | * [IA64_DEF_FIRST_DEVICE_VECTOR..IA64_DEF_LAST_DEVICE_VECTOR] | ||
50 | */ | 54 | */ |
51 | #define IA64_FIRST_DEVICE_VECTOR 0x30 | 55 | extern int ia64_first_device_vector; |
52 | #define IA64_LAST_DEVICE_VECTOR 0xe7 | 56 | extern int ia64_last_device_vector; |
57 | |||
58 | #define IA64_DEF_FIRST_DEVICE_VECTOR 0x30 | ||
59 | #define IA64_DEF_LAST_DEVICE_VECTOR 0xe7 | ||
60 | #define IA64_FIRST_DEVICE_VECTOR ia64_first_device_vector | ||
61 | #define IA64_LAST_DEVICE_VECTOR ia64_last_device_vector | ||
62 | #define IA64_MAX_DEVICE_VECTORS (IA64_DEF_LAST_DEVICE_VECTOR - IA64_DEF_FIRST_DEVICE_VECTOR + 1) | ||
53 | #define IA64_NUM_DEVICE_VECTORS (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1) | 63 | #define IA64_NUM_DEVICE_VECTORS (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1) |
54 | 64 | ||
55 | #define IA64_MCA_RENDEZ_VECTOR 0xe8 /* MCA rendez interrupt */ | 65 | #define IA64_MCA_RENDEZ_VECTOR 0xe8 /* MCA rendez interrupt */ |
@@ -83,6 +93,7 @@ extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt | |||
83 | 93 | ||
84 | extern int assign_irq_vector (int irq); /* allocate a free vector */ | 94 | extern int assign_irq_vector (int irq); /* allocate a free vector */ |
85 | extern void free_irq_vector (int vector); | 95 | extern void free_irq_vector (int vector); |
96 | extern int reserve_irq_vector (int vector); | ||
86 | extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); | 97 | extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); |
87 | extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); | 98 | extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); |
88 | 99 | ||
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index 0df72a134c8b..15b545a897a4 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
@@ -75,6 +75,7 @@ typedef unsigned char ia64_mv_readb_relaxed_t (const volatile void __iomem *); | |||
75 | typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); | 75 | typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); |
76 | typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); | 76 | typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); |
77 | typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); | 77 | typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); |
78 | typedef int ia64_mv_msi_init_t (void); | ||
78 | 79 | ||
79 | static inline void | 80 | static inline void |
80 | machvec_noop (void) | 81 | machvec_noop (void) |
@@ -153,6 +154,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *); | |||
153 | # define platform_readl_relaxed ia64_mv.readl_relaxed | 154 | # define platform_readl_relaxed ia64_mv.readl_relaxed |
154 | # define platform_readq_relaxed ia64_mv.readq_relaxed | 155 | # define platform_readq_relaxed ia64_mv.readq_relaxed |
155 | # define platform_migrate ia64_mv.migrate | 156 | # define platform_migrate ia64_mv.migrate |
157 | # define platform_msi_init ia64_mv.msi_init | ||
156 | # endif | 158 | # endif |
157 | 159 | ||
158 | /* __attribute__((__aligned__(16))) is required to make size of the | 160 | /* __attribute__((__aligned__(16))) is required to make size of the |
@@ -202,6 +204,7 @@ struct ia64_machine_vector { | |||
202 | ia64_mv_readl_relaxed_t *readl_relaxed; | 204 | ia64_mv_readl_relaxed_t *readl_relaxed; |
203 | ia64_mv_readq_relaxed_t *readq_relaxed; | 205 | ia64_mv_readq_relaxed_t *readq_relaxed; |
204 | ia64_mv_migrate_t *migrate; | 206 | ia64_mv_migrate_t *migrate; |
207 | ia64_mv_msi_init_t *msi_init; | ||
205 | } __attribute__((__aligned__(16))); /* align attrib? see above comment */ | 208 | } __attribute__((__aligned__(16))); /* align attrib? see above comment */ |
206 | 209 | ||
207 | #define MACHVEC_INIT(name) \ | 210 | #define MACHVEC_INIT(name) \ |
@@ -247,6 +250,7 @@ struct ia64_machine_vector { | |||
247 | platform_readl_relaxed, \ | 250 | platform_readl_relaxed, \ |
248 | platform_readq_relaxed, \ | 251 | platform_readq_relaxed, \ |
249 | platform_migrate, \ | 252 | platform_migrate, \ |
253 | platform_msi_init, \ | ||
250 | } | 254 | } |
251 | 255 | ||
252 | extern struct ia64_machine_vector ia64_mv; | 256 | extern struct ia64_machine_vector ia64_mv; |
@@ -400,5 +404,8 @@ extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size | |||
400 | #ifndef platform_migrate | 404 | #ifndef platform_migrate |
401 | # define platform_migrate machvec_noop_task | 405 | # define platform_migrate machvec_noop_task |
402 | #endif | 406 | #endif |
407 | #ifndef platform_msi_init | ||
408 | # define platform_msi_init ((ia64_mv_msi_init_t*)NULL) | ||
409 | #endif | ||
403 | 410 | ||
404 | #endif /* _ASM_IA64_MACHVEC_H */ | 411 | #endif /* _ASM_IA64_MACHVEC_H */ |
diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h index da1d43755afe..cf724dc79d8c 100644 --- a/include/asm-ia64/machvec_sn2.h +++ b/include/asm-ia64/machvec_sn2.h | |||
@@ -67,6 +67,8 @@ extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device; | |||
67 | extern ia64_mv_dma_mapping_error sn_dma_mapping_error; | 67 | extern ia64_mv_dma_mapping_error sn_dma_mapping_error; |
68 | extern ia64_mv_dma_supported sn_dma_supported; | 68 | extern ia64_mv_dma_supported sn_dma_supported; |
69 | extern ia64_mv_migrate_t sn_migrate; | 69 | extern ia64_mv_migrate_t sn_migrate; |
70 | extern ia64_mv_msi_init_t sn_msi_init; | ||
71 | |||
70 | 72 | ||
71 | /* | 73 | /* |
72 | * This stuff has dual use! | 74 | * This stuff has dual use! |
@@ -117,6 +119,11 @@ extern ia64_mv_migrate_t sn_migrate; | |||
117 | #define platform_dma_mapping_error sn_dma_mapping_error | 119 | #define platform_dma_mapping_error sn_dma_mapping_error |
118 | #define platform_dma_supported sn_dma_supported | 120 | #define platform_dma_supported sn_dma_supported |
119 | #define platform_migrate sn_migrate | 121 | #define platform_migrate sn_migrate |
122 | #ifdef CONFIG_PCI_MSI | ||
123 | #define platform_msi_init sn_msi_init | ||
124 | #else | ||
125 | #define platform_msi_init ((ia64_mv_msi_init_t*)NULL) | ||
126 | #endif | ||
120 | 127 | ||
121 | #include <asm/sn/io.h> | 128 | #include <asm/sn/io.h> |
122 | 129 | ||
diff --git a/include/asm-ia64/msi.h b/include/asm-ia64/msi.h index 97890f7762b3..bb92b0dbde2f 100644 --- a/include/asm-ia64/msi.h +++ b/include/asm-ia64/msi.h | |||
@@ -14,4 +14,16 @@ static inline void set_intr_gate (int nr, void *func) {} | |||
14 | #define ack_APIC_irq ia64_eoi | 14 | #define ack_APIC_irq ia64_eoi |
15 | #define MSI_TARGET_CPU_SHIFT 4 | 15 | #define MSI_TARGET_CPU_SHIFT 4 |
16 | 16 | ||
17 | extern struct msi_ops msi_apic_ops; | ||
18 | |||
19 | static inline int msi_arch_init(void) | ||
20 | { | ||
21 | if (platform_msi_init) | ||
22 | return platform_msi_init(); | ||
23 | |||
24 | /* default ops for most ia64 platforms */ | ||
25 | msi_register(&msi_apic_ops); | ||
26 | return 0; | ||
27 | } | ||
28 | |||
17 | #endif /* ASM_MSI_H */ | 29 | #endif /* ASM_MSI_H */ |
diff --git a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h index 60a51a406eec..12b54ddb06be 100644 --- a/include/asm-ia64/sn/intr.h +++ b/include/asm-ia64/sn/intr.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define _ASM_IA64_SN_INTR_H | 10 | #define _ASM_IA64_SN_INTR_H |
11 | 11 | ||
12 | #include <linux/rcupdate.h> | 12 | #include <linux/rcupdate.h> |
13 | #include <asm/sn/types.h> | ||
13 | 14 | ||
14 | #define SGI_UART_VECTOR 0xe9 | 15 | #define SGI_UART_VECTOR 0xe9 |
15 | 16 | ||
@@ -40,6 +41,7 @@ struct sn_irq_info { | |||
40 | int irq_cpuid; /* kernel logical cpuid */ | 41 | int irq_cpuid; /* kernel logical cpuid */ |
41 | int irq_irq; /* the IRQ number */ | 42 | int irq_irq; /* the IRQ number */ |
42 | int irq_int_bit; /* Bridge interrupt pin */ | 43 | int irq_int_bit; /* Bridge interrupt pin */ |
44 | /* <0 means MSI */ | ||
43 | u64 irq_xtalkaddr; /* xtalkaddr IRQ is sent to */ | 45 | u64 irq_xtalkaddr; /* xtalkaddr IRQ is sent to */ |
44 | int irq_bridge_type;/* pciio asic type (pciio.h) */ | 46 | int irq_bridge_type;/* pciio asic type (pciio.h) */ |
45 | void *irq_bridge; /* bridge generating irq */ | 47 | void *irq_bridge; /* bridge generating irq */ |
@@ -53,6 +55,12 @@ struct sn_irq_info { | |||
53 | }; | 55 | }; |
54 | 56 | ||
55 | extern void sn_send_IPI_phys(int, long, int, int); | 57 | extern void sn_send_IPI_phys(int, long, int, int); |
58 | extern u64 sn_intr_alloc(nasid_t, int, | ||
59 | struct sn_irq_info *, | ||
60 | int, nasid_t, int); | ||
61 | extern void sn_intr_free(nasid_t, int, struct sn_irq_info *); | ||
62 | extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int); | ||
63 | extern struct list_head **sn_irq_lh; | ||
56 | 64 | ||
57 | #define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector) | 65 | #define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector) |
58 | 66 | ||
diff --git a/include/asm-ia64/sn/pcibr_provider.h b/include/asm-ia64/sn/pcibr_provider.h index 51260ab70d91..e3b0c3fe5eed 100644 --- a/include/asm-ia64/sn/pcibr_provider.h +++ b/include/asm-ia64/sn/pcibr_provider.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #define PCI32_ATE_V (0x1 << 0) | 55 | #define PCI32_ATE_V (0x1 << 0) |
56 | #define PCI32_ATE_CO (0x1 << 1) | 56 | #define PCI32_ATE_CO (0x1 << 1) |
57 | #define PCI32_ATE_PREC (0x1 << 2) | 57 | #define PCI32_ATE_PREC (0x1 << 2) |
58 | #define PCI32_ATE_MSI (0x1 << 2) | ||
58 | #define PCI32_ATE_PREF (0x1 << 3) | 59 | #define PCI32_ATE_PREF (0x1 << 3) |
59 | #define PCI32_ATE_BAR (0x1 << 4) | 60 | #define PCI32_ATE_BAR (0x1 << 4) |
60 | #define PCI32_ATE_ADDR_SHFT 12 | 61 | #define PCI32_ATE_ADDR_SHFT 12 |
@@ -117,8 +118,8 @@ struct pcibus_info { | |||
117 | 118 | ||
118 | extern int pcibr_init_provider(void); | 119 | extern int pcibr_init_provider(void); |
119 | extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *); | 120 | extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *); |
120 | extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t); | 121 | extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t, int type); |
121 | extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t); | 122 | extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t, int type); |
122 | extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); | 123 | extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); |
123 | 124 | ||
124 | /* | 125 | /* |
diff --git a/include/asm-ia64/sn/pcibus_provider_defs.h b/include/asm-ia64/sn/pcibus_provider_defs.h index ce3f6c328241..8f7c83d0f6d3 100644 --- a/include/asm-ia64/sn/pcibus_provider_defs.h +++ b/include/asm-ia64/sn/pcibus_provider_defs.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. | 6 | * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. |
7 | */ | 7 | */ |
8 | #ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H | 8 | #ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H |
9 | #define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H | 9 | #define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H |
@@ -45,13 +45,24 @@ struct pci_controller; | |||
45 | */ | 45 | */ |
46 | 46 | ||
47 | struct sn_pcibus_provider { | 47 | struct sn_pcibus_provider { |
48 | dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t); | 48 | dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t, int flags); |
49 | dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t); | 49 | dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t, int flags); |
50 | void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); | 50 | void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); |
51 | void * (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *); | 51 | void * (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *); |
52 | void (*force_interrupt)(struct sn_irq_info *); | 52 | void (*force_interrupt)(struct sn_irq_info *); |
53 | void (*target_interrupt)(struct sn_irq_info *); | 53 | void (*target_interrupt)(struct sn_irq_info *); |
54 | }; | 54 | }; |
55 | 55 | ||
56 | /* | ||
57 | * Flags used by the map interfaces | ||
58 | * bits 3:0 specifies format of passed in address | ||
59 | * bit 4 specifies that address is to be used for MSI | ||
60 | */ | ||
61 | |||
62 | #define SN_DMA_ADDRTYPE(x) ((x) & 0xf) | ||
63 | #define SN_DMA_ADDR_PHYS 1 /* address is an xio address. */ | ||
64 | #define SN_DMA_ADDR_XIO 2 /* address is phys memory */ | ||
65 | #define SN_DMA_MSI 0x10 /* Bus address is to be used for MSI */ | ||
66 | |||
56 | extern struct sn_pcibus_provider *sn_pci_provider[]; | 67 | extern struct sn_pcibus_provider *sn_pci_provider[]; |
57 | #endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ | 68 | #endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ |
diff --git a/include/asm-ia64/sn/tiocp.h b/include/asm-ia64/sn/tiocp.h index f47c08ab483c..e8ad0bb5b6c5 100644 --- a/include/asm-ia64/sn/tiocp.h +++ b/include/asm-ia64/sn/tiocp.h | |||
@@ -3,13 +3,14 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 2003-2004 Silicon Graphics, Inc. All rights reserved. | 6 | * Copyright (C) 2003-2005 Silicon Graphics, Inc. All rights reserved. |
7 | */ | 7 | */ |
8 | #ifndef _ASM_IA64_SN_PCI_TIOCP_H | 8 | #ifndef _ASM_IA64_SN_PCI_TIOCP_H |
9 | #define _ASM_IA64_SN_PCI_TIOCP_H | 9 | #define _ASM_IA64_SN_PCI_TIOCP_H |
10 | 10 | ||
11 | #define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL | 11 | #define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL |
12 | #define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60) | 12 | #define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60) |
13 | #define TIOCP_PCI64_CMDTYPE_MSI (0x3ull << 60) | ||
13 | 14 | ||
14 | 15 | ||
15 | /***************************************************************************** | 16 | /***************************************************************************** |
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index 632f2eedf72c..bb0eb727dcd0 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h | |||
@@ -265,7 +265,7 @@ | |||
265 | #define __NR_keyctl 1273 | 265 | #define __NR_keyctl 1273 |
266 | #define __NR_ioprio_set 1274 | 266 | #define __NR_ioprio_set 1274 |
267 | #define __NR_ioprio_get 1275 | 267 | #define __NR_ioprio_get 1275 |
268 | /* 1276 is available for reuse (was briefly sys_set_zone_reclaim) */ | 268 | #define __NR_move_pages 1276 |
269 | #define __NR_inotify_init 1277 | 269 | #define __NR_inotify_init 1277 |
270 | #define __NR_inotify_add_watch 1278 | 270 | #define __NR_inotify_add_watch 1278 |
271 | #define __NR_inotify_rm_watch 1279 | 271 | #define __NR_inotify_rm_watch 1279 |
diff --git a/include/asm-ia64/vga.h b/include/asm-ia64/vga.h index 091177cda223..02184ecd8208 100644 --- a/include/asm-ia64/vga.h +++ b/include/asm-ia64/vga.h | |||
@@ -17,7 +17,7 @@ | |||
17 | extern unsigned long vga_console_iobase; | 17 | extern unsigned long vga_console_iobase; |
18 | extern unsigned long vga_console_membase; | 18 | extern unsigned long vga_console_membase; |
19 | 19 | ||
20 | #define VGA_MAP_MEM(x) ((unsigned long) ioremap_nocache(vga_console_membase + (x), 0)) | 20 | #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap_nocache(vga_console_membase + (x), s)) |
21 | 21 | ||
22 | #define vga_readb(x) (*(x)) | 22 | #define vga_readb(x) (*(x)) |
23 | #define vga_writeb(x,y) (*(y) = (x)) | 23 | #define vga_writeb(x,y) (*(y) = (x)) |
diff --git a/include/asm-m32r/vga.h b/include/asm-m32r/vga.h index d0f4b6eed7a3..533163447cc9 100644 --- a/include/asm-m32r/vga.h +++ b/include/asm-m32r/vga.h | |||
@@ -14,7 +14,7 @@ | |||
14 | * access the videoram directly without any black magic. | 14 | * access the videoram directly without any black magic. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) | 17 | #define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x) |
18 | 18 | ||
19 | #define vga_readb(x) (*(x)) | 19 | #define vga_readb(x) (*(x)) |
20 | #define vga_writeb(x,y) (*(y) = (x)) | 20 | #define vga_writeb(x,y) (*(y) = (x)) |
diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index b4f48b2a6a57..9727ca9d9f26 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h | |||
@@ -130,8 +130,4 @@ extern volatile unsigned int num_spurious; | |||
130 | */ | 130 | */ |
131 | extern irq_node_t *new_irq_node(void); | 131 | extern irq_node_t *new_irq_node(void); |
132 | 132 | ||
133 | struct irqaction; | ||
134 | struct pt_regs; | ||
135 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
136 | |||
137 | #endif /* _M68K_IRQ_H_ */ | 133 | #endif /* _M68K_IRQ_H_ */ |
diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h index 352799e71f08..8455f778b601 100644 --- a/include/asm-m68k/processor.h +++ b/include/asm-m68k/processor.h | |||
@@ -71,10 +71,10 @@ struct thread_struct { | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | #define INIT_THREAD { \ | 73 | #define INIT_THREAD { \ |
74 | ksp: sizeof(init_stack) + (unsigned long) init_stack, \ | 74 | .ksp = sizeof(init_stack) + (unsigned long) init_stack, \ |
75 | sr: PS_S, \ | 75 | .sr = PS_S, \ |
76 | fs: __KERNEL_DS, \ | 76 | .fs = __KERNEL_DS, \ |
77 | info: INIT_THREAD_INFO(init_task) \ | 77 | .info = INIT_THREAD_INFO(init_task), \ |
78 | } | 78 | } |
79 | 79 | ||
80 | /* | 80 | /* |
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h index 2ffd87b0a769..b761ef218cea 100644 --- a/include/asm-m68k/uaccess.h +++ b/include/asm-m68k/uaccess.h | |||
@@ -4,8 +4,9 @@ | |||
4 | /* | 4 | /* |
5 | * User space memory access functions | 5 | * User space memory access functions |
6 | */ | 6 | */ |
7 | #include <linux/compiler.h> | ||
7 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
8 | #include <linux/sched.h> | 9 | #include <linux/types.h> |
9 | #include <asm/segment.h> | 10 | #include <asm/segment.h> |
10 | 11 | ||
11 | #define VERIFY_READ 0 | 12 | #define VERIFY_READ 0 |
@@ -32,858 +33,315 @@ struct exception_table_entry | |||
32 | unsigned long insn, fixup; | 33 | unsigned long insn, fixup; |
33 | }; | 34 | }; |
34 | 35 | ||
36 | extern int __put_user_bad(void); | ||
37 | extern int __get_user_bad(void); | ||
38 | |||
39 | #define __put_user_asm(res, x, ptr, bwl, reg, err) \ | ||
40 | asm volatile ("\n" \ | ||
41 | "1: moves."#bwl" %2,%1\n" \ | ||
42 | "2:\n" \ | ||
43 | " .section .fixup,\"ax\"\n" \ | ||
44 | " .even\n" \ | ||
45 | "10: moveq.l %3,%0\n" \ | ||
46 | " jra 2b\n" \ | ||
47 | " .previous\n" \ | ||
48 | "\n" \ | ||
49 | " .section __ex_table,\"a\"\n" \ | ||
50 | " .align 4\n" \ | ||
51 | " .long 1b,10b\n" \ | ||
52 | " .long 2b,10b\n" \ | ||
53 | " .previous" \ | ||
54 | : "+d" (res), "=m" (*(ptr)) \ | ||
55 | : #reg (x), "i" (err)) | ||
35 | 56 | ||
36 | /* | 57 | /* |
37 | * These are the main single-value transfer routines. They automatically | 58 | * These are the main single-value transfer routines. They automatically |
38 | * use the right size if we just have the right pointer type. | 59 | * use the right size if we just have the right pointer type. |
39 | */ | 60 | */ |
40 | 61 | ||
41 | #define put_user(x, ptr) \ | 62 | #define __put_user(x, ptr) \ |
42 | ({ \ | 63 | ({ \ |
43 | int __pu_err; \ | 64 | typeof(*(ptr)) __pu_val = (x); \ |
44 | typeof(*(ptr)) __pu_val = (x); \ | 65 | int __pu_err = 0; \ |
45 | __chk_user_ptr(ptr); \ | 66 | __chk_user_ptr(ptr); \ |
46 | switch (sizeof (*(ptr))) { \ | 67 | switch (sizeof (*(ptr))) { \ |
47 | case 1: \ | 68 | case 1: \ |
48 | __put_user_asm(__pu_err, __pu_val, ptr, b); \ | 69 | __put_user_asm(__pu_err, __pu_val, ptr, b, d, -EFAULT); \ |
49 | break; \ | 70 | break; \ |
50 | case 2: \ | 71 | case 2: \ |
51 | __put_user_asm(__pu_err, __pu_val, ptr, w); \ | 72 | __put_user_asm(__pu_err, __pu_val, ptr, w, d, -EFAULT); \ |
52 | break; \ | 73 | break; \ |
53 | case 4: \ | 74 | case 4: \ |
54 | __put_user_asm(__pu_err, __pu_val, ptr, l); \ | 75 | __put_user_asm(__pu_err, __pu_val, ptr, l, r, -EFAULT); \ |
55 | break; \ | 76 | break; \ |
56 | case 8: \ | 77 | case 8: \ |
57 | __pu_err = __constant_copy_to_user(ptr, &__pu_val, 8); \ | 78 | { \ |
58 | break; \ | 79 | const void *__pu_ptr = (ptr); \ |
59 | default: \ | 80 | asm volatile ("\n" \ |
60 | __pu_err = __put_user_bad(); \ | 81 | "1: moves.l %2,(%1)+\n" \ |
61 | break; \ | 82 | "2: moves.l %R2,(%1)\n" \ |
62 | } \ | 83 | "3:\n" \ |
63 | __pu_err; \ | 84 | " .section .fixup,\"ax\"\n" \ |
85 | " .even\n" \ | ||
86 | "10: movel %3,%0\n" \ | ||
87 | " jra 3b\n" \ | ||
88 | " .previous\n" \ | ||
89 | "\n" \ | ||
90 | " .section __ex_table,\"a\"\n" \ | ||
91 | " .align 4\n" \ | ||
92 | " .long 1b,10b\n" \ | ||
93 | " .long 2b,10b\n" \ | ||
94 | " .long 3b,10b\n" \ | ||
95 | " .previous" \ | ||
96 | : "+d" (__pu_err), "+a" (__pu_ptr) \ | ||
97 | : "r" (__pu_val), "i" (-EFAULT) \ | ||
98 | : "memory"); \ | ||
99 | break; \ | ||
100 | } \ | ||
101 | default: \ | ||
102 | __pu_err = __put_user_bad(); \ | ||
103 | break; \ | ||
104 | } \ | ||
105 | __pu_err; \ | ||
64 | }) | 106 | }) |
65 | #define __put_user(x, ptr) put_user(x, ptr) | 107 | #define put_user(x, ptr) __put_user(x, ptr) |
66 | 108 | ||
67 | extern int __put_user_bad(void); | ||
68 | 109 | ||
69 | /* | 110 | #define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({ \ |
70 | * Tell gcc we read from memory instead of writing: this is because | 111 | type __gu_val; \ |
71 | * we do not write to any memory gcc knows about, so there are no | 112 | asm volatile ("\n" \ |
72 | * aliasing issues. | 113 | "1: moves."#bwl" %2,%1\n" \ |
73 | */ | 114 | "2:\n" \ |
74 | #define __put_user_asm(err,x,ptr,bwl) \ | 115 | " .section .fixup,\"ax\"\n" \ |
75 | __asm__ __volatile__ \ | 116 | " .even\n" \ |
76 | ("21:moves" #bwl " %2,%1\n" \ | 117 | "10: move.l %3,%0\n" \ |
77 | "1:\n" \ | 118 | " sub."#bwl" %1,%1\n" \ |
78 | ".section .fixup,\"ax\"\n" \ | 119 | " jra 2b\n" \ |
79 | " .even\n" \ | 120 | " .previous\n" \ |
80 | "2: movel %3,%0\n" \ | 121 | "\n" \ |
81 | " jra 1b\n" \ | 122 | " .section __ex_table,\"a\"\n" \ |
82 | ".previous\n" \ | 123 | " .align 4\n" \ |
83 | ".section __ex_table,\"a\"\n" \ | 124 | " .long 1b,10b\n" \ |
84 | " .align 4\n" \ | 125 | " .previous" \ |
85 | " .long 21b,2b\n" \ | 126 | : "+d" (res), "=&" #reg (__gu_val) \ |
86 | " .long 1b,2b\n" \ | 127 | : "m" (*(ptr)), "i" (err)); \ |
87 | ".previous" \ | 128 | (x) = (typeof(*(ptr)))(long)__gu_val; \ |
88 | : "=d"(err) \ | ||
89 | : "m"(*(ptr)), "r"(x), "i"(-EFAULT), "0"(0)) | ||
90 | |||
91 | #define get_user(x, ptr) \ | ||
92 | ({ \ | ||
93 | int __gu_err; \ | ||
94 | typeof(*(ptr)) __gu_val; \ | ||
95 | __chk_user_ptr(ptr); \ | ||
96 | switch (sizeof(*(ptr))) { \ | ||
97 | case 1: \ | ||
98 | __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ | ||
99 | break; \ | ||
100 | case 2: \ | ||
101 | __get_user_asm(__gu_err, __gu_val, ptr, w, "=r"); \ | ||
102 | break; \ | ||
103 | case 4: \ | ||
104 | __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ | ||
105 | break; \ | ||
106 | case 8: \ | ||
107 | __gu_err = __constant_copy_from_user(&__gu_val, ptr, 8); \ | ||
108 | break; \ | ||
109 | default: \ | ||
110 | __gu_val = (typeof(*(ptr)))0; \ | ||
111 | __gu_err = __get_user_bad(); \ | ||
112 | break; \ | ||
113 | } \ | ||
114 | (x) = __gu_val; \ | ||
115 | __gu_err; \ | ||
116 | }) | 129 | }) |
117 | #define __get_user(x, ptr) get_user(x, ptr) | ||
118 | 130 | ||
119 | extern int __get_user_bad(void); | 131 | #define __get_user(x, ptr) \ |
132 | ({ \ | ||
133 | int __gu_err = 0; \ | ||
134 | __chk_user_ptr(ptr); \ | ||
135 | switch (sizeof(*(ptr))) { \ | ||
136 | case 1: \ | ||
137 | __get_user_asm(__gu_err, x, ptr, u8, b, d, -EFAULT); \ | ||
138 | break; \ | ||
139 | case 2: \ | ||
140 | __get_user_asm(__gu_err, x, ptr, u16, w, d, -EFAULT); \ | ||
141 | break; \ | ||
142 | case 4: \ | ||
143 | __get_user_asm(__gu_err, x, ptr, u32, l, r, -EFAULT); \ | ||
144 | break; \ | ||
145 | /* case 8: disabled because gcc-4.1 has a broken typeof \ | ||
146 | { \ | ||
147 | const void *__gu_ptr = (ptr); \ | ||
148 | u64 __gu_val; \ | ||
149 | asm volatile ("\n" \ | ||
150 | "1: moves.l (%2)+,%1\n" \ | ||
151 | "2: moves.l (%2),%R1\n" \ | ||
152 | "3:\n" \ | ||
153 | " .section .fixup,\"ax\"\n" \ | ||
154 | " .even\n" \ | ||
155 | "10: move.l %3,%0\n" \ | ||
156 | " sub.l %1,%1\n" \ | ||
157 | " sub.l %R1,%R1\n" \ | ||
158 | " jra 3b\n" \ | ||
159 | " .previous\n" \ | ||
160 | "\n" \ | ||
161 | " .section __ex_table,\"a\"\n" \ | ||
162 | " .align 4\n" \ | ||
163 | " .long 1b,10b\n" \ | ||
164 | " .long 2b,10b\n" \ | ||
165 | " .previous" \ | ||
166 | : "+d" (__gu_err), "=&r" (__gu_val), \ | ||
167 | "+a" (__gu_ptr) \ | ||
168 | : "i" (-EFAULT) \ | ||
169 | : "memory"); \ | ||
170 | (x) = (typeof(*(ptr)))__gu_val; \ | ||
171 | break; \ | ||
172 | } */ \ | ||
173 | default: \ | ||
174 | __gu_err = __get_user_bad(); \ | ||
175 | break; \ | ||
176 | } \ | ||
177 | __gu_err; \ | ||
178 | }) | ||
179 | #define get_user(x, ptr) __get_user(x, ptr) | ||
120 | 180 | ||
121 | #define __get_user_asm(err,x,ptr,bwl,reg) \ | 181 | unsigned long __generic_copy_from_user(void *to, const void __user *from, unsigned long n); |
122 | __asm__ __volatile__ \ | 182 | unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned long n); |
123 | ("1: moves" #bwl " %2,%1\n" \ | ||
124 | "2:\n" \ | ||
125 | ".section .fixup,\"ax\"\n" \ | ||
126 | " .even\n" \ | ||
127 | "3: movel %3,%0\n" \ | ||
128 | " sub" #bwl " %1,%1\n" \ | ||
129 | " jra 2b\n" \ | ||
130 | ".previous\n" \ | ||
131 | ".section __ex_table,\"a\"\n" \ | ||
132 | " .align 4\n" \ | ||
133 | " .long 1b,3b\n" \ | ||
134 | ".previous" \ | ||
135 | : "=d"(err), reg(x) \ | ||
136 | : "m"(*(ptr)), "i" (-EFAULT), "0"(0)) | ||
137 | 183 | ||
138 | static inline unsigned long | 184 | static __always_inline unsigned long |
139 | __generic_copy_from_user(void *to, const void __user *from, unsigned long n) | 185 | __constant_copy_from_user(void *to, const void __user *from, unsigned long n) |
140 | { | ||
141 | unsigned long tmp; | ||
142 | __asm__ __volatile__ | ||
143 | (" tstl %2\n" | ||
144 | " jeq 2f\n" | ||
145 | "1: movesl (%1)+,%3\n" | ||
146 | " movel %3,(%0)+\n" | ||
147 | " subql #1,%2\n" | ||
148 | " jne 1b\n" | ||
149 | "2: movel %4,%2\n" | ||
150 | " bclr #1,%2\n" | ||
151 | " jeq 4f\n" | ||
152 | "3: movesw (%1)+,%3\n" | ||
153 | " movew %3,(%0)+\n" | ||
154 | "4: bclr #0,%2\n" | ||
155 | " jeq 6f\n" | ||
156 | "5: movesb (%1)+,%3\n" | ||
157 | " moveb %3,(%0)+\n" | ||
158 | "6:\n" | ||
159 | ".section .fixup,\"ax\"\n" | ||
160 | " .even\n" | ||
161 | "7: movel %2,%%d0\n" | ||
162 | "71:clrl (%0)+\n" | ||
163 | " subql #1,%%d0\n" | ||
164 | " jne 71b\n" | ||
165 | " lsll #2,%2\n" | ||
166 | " addl %4,%2\n" | ||
167 | " btst #1,%4\n" | ||
168 | " jne 81f\n" | ||
169 | " btst #0,%4\n" | ||
170 | " jne 91f\n" | ||
171 | " jra 6b\n" | ||
172 | "8: addql #2,%2\n" | ||
173 | "81:clrw (%0)+\n" | ||
174 | " btst #0,%4\n" | ||
175 | " jne 91f\n" | ||
176 | " jra 6b\n" | ||
177 | "9: addql #1,%2\n" | ||
178 | "91:clrb (%0)+\n" | ||
179 | " jra 6b\n" | ||
180 | ".previous\n" | ||
181 | ".section __ex_table,\"a\"\n" | ||
182 | " .align 4\n" | ||
183 | " .long 1b,7b\n" | ||
184 | " .long 3b,8b\n" | ||
185 | " .long 5b,9b\n" | ||
186 | ".previous" | ||
187 | : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp) | ||
188 | : "d"(n & 3), "0"(to), "1"(from), "2"(n/4) | ||
189 | : "d0", "memory"); | ||
190 | return n; | ||
191 | } | ||
192 | |||
193 | static inline unsigned long | ||
194 | __generic_copy_to_user(void __user *to, const void *from, unsigned long n) | ||
195 | { | 186 | { |
196 | unsigned long tmp; | 187 | unsigned long res = 0, tmp; |
197 | __asm__ __volatile__ | ||
198 | (" tstl %2\n" | ||
199 | " jeq 3f\n" | ||
200 | "1: movel (%1)+,%3\n" | ||
201 | "22:movesl %3,(%0)+\n" | ||
202 | "2: subql #1,%2\n" | ||
203 | " jne 1b\n" | ||
204 | "3: movel %4,%2\n" | ||
205 | " bclr #1,%2\n" | ||
206 | " jeq 4f\n" | ||
207 | " movew (%1)+,%3\n" | ||
208 | "24:movesw %3,(%0)+\n" | ||
209 | "4: bclr #0,%2\n" | ||
210 | " jeq 5f\n" | ||
211 | " moveb (%1)+,%3\n" | ||
212 | "25:movesb %3,(%0)+\n" | ||
213 | "5:\n" | ||
214 | ".section .fixup,\"ax\"\n" | ||
215 | " .even\n" | ||
216 | "60:addql #1,%2\n" | ||
217 | "6: lsll #2,%2\n" | ||
218 | " addl %4,%2\n" | ||
219 | " jra 5b\n" | ||
220 | "7: addql #2,%2\n" | ||
221 | " jra 5b\n" | ||
222 | "8: addql #1,%2\n" | ||
223 | " jra 5b\n" | ||
224 | ".previous\n" | ||
225 | ".section __ex_table,\"a\"\n" | ||
226 | " .align 4\n" | ||
227 | " .long 1b,60b\n" | ||
228 | " .long 22b,6b\n" | ||
229 | " .long 2b,6b\n" | ||
230 | " .long 24b,7b\n" | ||
231 | " .long 3b,60b\n" | ||
232 | " .long 4b,7b\n" | ||
233 | " .long 25b,8b\n" | ||
234 | " .long 5b,8b\n" | ||
235 | ".previous" | ||
236 | : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp) | ||
237 | : "r"(n & 3), "0"(to), "1"(from), "2"(n / 4) | ||
238 | : "memory"); | ||
239 | return n; | ||
240 | } | ||
241 | 188 | ||
242 | #define __copy_from_user_big(to, from, n, fixup, copy) \ | 189 | /* limit the inlined version to 3 moves */ |
243 | __asm__ __volatile__ \ | 190 | if (n == 11 || n > 12) |
244 | ("10: movesl (%1)+,%%d0\n" \ | 191 | return __generic_copy_from_user(to, from, n); |
245 | " movel %%d0,(%0)+\n" \ | ||
246 | " subql #1,%2\n" \ | ||
247 | " jne 10b\n" \ | ||
248 | ".section .fixup,\"ax\"\n" \ | ||
249 | " .even\n" \ | ||
250 | "11: movel %2,%%d0\n" \ | ||
251 | "13: clrl (%0)+\n" \ | ||
252 | " subql #1,%%d0\n" \ | ||
253 | " jne 13b\n" \ | ||
254 | " lsll #2,%2\n" \ | ||
255 | fixup "\n" \ | ||
256 | " jra 12f\n" \ | ||
257 | ".previous\n" \ | ||
258 | ".section __ex_table,\"a\"\n" \ | ||
259 | " .align 4\n" \ | ||
260 | " .long 10b,11b\n" \ | ||
261 | ".previous\n" \ | ||
262 | copy "\n" \ | ||
263 | "12:" \ | ||
264 | : "=a"(to), "=a"(from), "=d"(n) \ | ||
265 | : "0"(to), "1"(from), "2"(n/4) \ | ||
266 | : "d0", "memory") | ||
267 | 192 | ||
268 | static inline unsigned long | 193 | switch (n) { |
269 | __constant_copy_from_user(void *to, const void __user *from, unsigned long n) | ||
270 | { | ||
271 | switch (n) { | ||
272 | case 0: | ||
273 | break; | ||
274 | case 1: | ||
275 | __asm__ __volatile__ | ||
276 | ("1: movesb (%1)+,%%d0\n" | ||
277 | " moveb %%d0,(%0)+\n" | ||
278 | "2:\n" | ||
279 | ".section .fixup,\"ax\"\n" | ||
280 | " .even\n" | ||
281 | "3: addql #1,%2\n" | ||
282 | " clrb (%0)+\n" | ||
283 | " jra 2b\n" | ||
284 | ".previous\n" | ||
285 | ".section __ex_table,\"a\"\n" | ||
286 | " .align 4\n" | ||
287 | " .long 1b,3b\n" | ||
288 | ".previous" | ||
289 | : "=a"(to), "=a"(from), "=d"(n) | ||
290 | : "0"(to), "1"(from), "2"(0) | ||
291 | : "d0", "memory"); | ||
292 | break; | ||
293 | case 2: | ||
294 | __asm__ __volatile__ | ||
295 | ("1: movesw (%1)+,%%d0\n" | ||
296 | " movew %%d0,(%0)+\n" | ||
297 | "2:\n" | ||
298 | ".section .fixup,\"ax\"\n" | ||
299 | " .even\n" | ||
300 | "3: addql #2,%2\n" | ||
301 | " clrw (%0)+\n" | ||
302 | " jra 2b\n" | ||
303 | ".previous\n" | ||
304 | ".section __ex_table,\"a\"\n" | ||
305 | " .align 4\n" | ||
306 | " .long 1b,3b\n" | ||
307 | ".previous" | ||
308 | : "=a"(to), "=a"(from), "=d"(n) | ||
309 | : "0"(to), "1"(from), "2"(0) | ||
310 | : "d0", "memory"); | ||
311 | break; | ||
312 | case 3: | ||
313 | __asm__ __volatile__ | ||
314 | ("1: movesw (%1)+,%%d0\n" | ||
315 | " movew %%d0,(%0)+\n" | ||
316 | "2: movesb (%1)+,%%d0\n" | ||
317 | " moveb %%d0,(%0)+\n" | ||
318 | "3:" | ||
319 | ".section .fixup,\"ax\"\n" | ||
320 | " .even\n" | ||
321 | "4: addql #2,%2\n" | ||
322 | " clrw (%0)+\n" | ||
323 | "5: addql #1,%2\n" | ||
324 | " clrb (%0)+\n" | ||
325 | " jra 3b\n" | ||
326 | ".previous\n" | ||
327 | ".section __ex_table,\"a\"\n" | ||
328 | " .align 4\n" | ||
329 | " .long 1b,4b\n" | ||
330 | " .long 2b,5b\n" | ||
331 | ".previous" | ||
332 | : "=a"(to), "=a"(from), "=d"(n) | ||
333 | : "0"(to), "1"(from), "2"(0) | ||
334 | : "d0", "memory"); | ||
335 | break; | ||
336 | case 4: | ||
337 | __asm__ __volatile__ | ||
338 | ("1: movesl (%1)+,%%d0\n" | ||
339 | " movel %%d0,(%0)+\n" | ||
340 | "2:" | ||
341 | ".section .fixup,\"ax\"\n" | ||
342 | " .even\n" | ||
343 | "3: addql #4,%2\n" | ||
344 | " clrl (%0)+\n" | ||
345 | " jra 2b\n" | ||
346 | ".previous\n" | ||
347 | ".section __ex_table,\"a\"\n" | ||
348 | " .align 4\n" | ||
349 | " .long 1b,3b\n" | ||
350 | ".previous" | ||
351 | : "=a"(to), "=a"(from), "=d"(n) | ||
352 | : "0"(to), "1"(from), "2"(0) | ||
353 | : "d0", "memory"); | ||
354 | break; | ||
355 | case 8: | ||
356 | __asm__ __volatile__ | ||
357 | ("1: movesl (%1)+,%%d0\n" | ||
358 | " movel %%d0,(%0)+\n" | ||
359 | "2: movesl (%1)+,%%d0\n" | ||
360 | " movel %%d0,(%0)+\n" | ||
361 | "3:" | ||
362 | ".section .fixup,\"ax\"\n" | ||
363 | " .even\n" | ||
364 | "4: addql #4,%2\n" | ||
365 | " clrl (%0)+\n" | ||
366 | "5: addql #4,%2\n" | ||
367 | " clrl (%0)+\n" | ||
368 | " jra 3b\n" | ||
369 | ".previous\n" | ||
370 | ".section __ex_table,\"a\"\n" | ||
371 | " .align 4\n" | ||
372 | " .long 1b,4b\n" | ||
373 | " .long 2b,5b\n" | ||
374 | ".previous" | ||
375 | : "=a"(to), "=a"(from), "=d"(n) | ||
376 | : "0"(to), "1"(from), "2"(0) | ||
377 | : "d0", "memory"); | ||
378 | break; | ||
379 | case 12: | ||
380 | __asm__ __volatile__ | ||
381 | ("1: movesl (%1)+,%%d0\n" | ||
382 | " movel %%d0,(%0)+\n" | ||
383 | "2: movesl (%1)+,%%d0\n" | ||
384 | " movel %%d0,(%0)+\n" | ||
385 | "3: movesl (%1)+,%%d0\n" | ||
386 | " movel %%d0,(%0)+\n" | ||
387 | "4:" | ||
388 | ".section .fixup,\"ax\"\n" | ||
389 | " .even\n" | ||
390 | "5: addql #4,%2\n" | ||
391 | " clrl (%0)+\n" | ||
392 | "6: addql #4,%2\n" | ||
393 | " clrl (%0)+\n" | ||
394 | "7: addql #4,%2\n" | ||
395 | " clrl (%0)+\n" | ||
396 | " jra 4b\n" | ||
397 | ".previous\n" | ||
398 | ".section __ex_table,\"a\"\n" | ||
399 | " .align 4\n" | ||
400 | " .long 1b,5b\n" | ||
401 | " .long 2b,6b\n" | ||
402 | " .long 3b,7b\n" | ||
403 | ".previous" | ||
404 | : "=a"(to), "=a"(from), "=d"(n) | ||
405 | : "0"(to), "1"(from), "2"(0) | ||
406 | : "d0", "memory"); | ||
407 | break; | ||
408 | case 16: | ||
409 | __asm__ __volatile__ | ||
410 | ("1: movesl (%1)+,%%d0\n" | ||
411 | " movel %%d0,(%0)+\n" | ||
412 | "2: movesl (%1)+,%%d0\n" | ||
413 | " movel %%d0,(%0)+\n" | ||
414 | "3: movesl (%1)+,%%d0\n" | ||
415 | " movel %%d0,(%0)+\n" | ||
416 | "4: movesl (%1)+,%%d0\n" | ||
417 | " movel %%d0,(%0)+\n" | ||
418 | "5:" | ||
419 | ".section .fixup,\"ax\"\n" | ||
420 | " .even\n" | ||
421 | "6: addql #4,%2\n" | ||
422 | " clrl (%0)+\n" | ||
423 | "7: addql #4,%2\n" | ||
424 | " clrl (%0)+\n" | ||
425 | "8: addql #4,%2\n" | ||
426 | " clrl (%0)+\n" | ||
427 | "9: addql #4,%2\n" | ||
428 | " clrl (%0)+\n" | ||
429 | " jra 5b\n" | ||
430 | ".previous\n" | ||
431 | ".section __ex_table,\"a\"\n" | ||
432 | " .align 4\n" | ||
433 | " .long 1b,6b\n" | ||
434 | " .long 2b,7b\n" | ||
435 | " .long 3b,8b\n" | ||
436 | " .long 4b,9b\n" | ||
437 | ".previous" | ||
438 | : "=a"(to), "=a"(from), "=d"(n) | ||
439 | : "0"(to), "1"(from), "2"(0) | ||
440 | : "d0", "memory"); | ||
441 | break; | ||
442 | default: | ||
443 | switch (n & 3) { | ||
444 | case 0: | ||
445 | __copy_from_user_big(to, from, n, "", ""); | ||
446 | break; | ||
447 | case 1: | 194 | case 1: |
448 | __copy_from_user_big(to, from, n, | 195 | __get_user_asm(res, *(u8 *)to, (u8 *)from, u8, b, d, 1); |
449 | /* fixup */ | 196 | return res; |
450 | "1: addql #1,%2\n" | ||
451 | " clrb (%0)+", | ||
452 | /* copy */ | ||
453 | "2: movesb (%1)+,%%d0\n" | ||
454 | " moveb %%d0,(%0)+\n" | ||
455 | ".section __ex_table,\"a\"\n" | ||
456 | " .long 2b,1b\n" | ||
457 | ".previous"); | ||
458 | break; | ||
459 | case 2: | 197 | case 2: |
460 | __copy_from_user_big(to, from, n, | 198 | __get_user_asm(res, *(u16 *)to, (u16 *)from, u16, w, d, 2); |
461 | /* fixup */ | 199 | return res; |
462 | "1: addql #2,%2\n" | 200 | case 4: |
463 | " clrw (%0)+", | 201 | __get_user_asm(res, *(u32 *)to, (u32 *)from, u32, l, r, 4); |
464 | /* copy */ | 202 | return res; |
465 | "2: movesw (%1)+,%%d0\n" | ||
466 | " movew %%d0,(%0)+\n" | ||
467 | ".section __ex_table,\"a\"\n" | ||
468 | " .long 2b,1b\n" | ||
469 | ".previous"); | ||
470 | break; | ||
471 | case 3: | ||
472 | __copy_from_user_big(to, from, n, | ||
473 | /* fixup */ | ||
474 | "1: addql #2,%2\n" | ||
475 | " clrw (%0)+\n" | ||
476 | "2: addql #1,%2\n" | ||
477 | " clrb (%0)+", | ||
478 | /* copy */ | ||
479 | "3: movesw (%1)+,%%d0\n" | ||
480 | " movew %%d0,(%0)+\n" | ||
481 | "4: movesb (%1)+,%%d0\n" | ||
482 | " moveb %%d0,(%0)+\n" | ||
483 | ".section __ex_table,\"a\"\n" | ||
484 | " .long 3b,1b\n" | ||
485 | " .long 4b,2b\n" | ||
486 | ".previous"); | ||
487 | break; | ||
488 | } | 203 | } |
489 | break; | ||
490 | } | ||
491 | return n; | ||
492 | } | ||
493 | 204 | ||
494 | #define __copy_to_user_big(to, from, n, fixup, copy) \ | 205 | asm volatile ("\n" |
495 | __asm__ __volatile__ \ | 206 | " .ifndef .Lfrom_user\n" |
496 | ("10: movel (%1)+,%%d0\n" \ | 207 | " .set .Lfrom_user,1\n" |
497 | "31: movesl %%d0,(%0)+\n" \ | 208 | " .macro copy_from_user to,from,tmp\n" |
498 | "11: subql #1,%2\n" \ | 209 | " .if .Lcnt >= 4\n" |
499 | " jne 10b\n" \ | 210 | "1: moves.l (\\from)+,\\tmp\n" |
500 | "41:\n" \ | 211 | " move.l \\tmp,(\\to)+\n" |
501 | ".section .fixup,\"ax\"\n" \ | 212 | " .set .Lcnt,.Lcnt-4\n" |
502 | " .even\n" \ | 213 | " .elseif .Lcnt & 2\n" |
503 | "22: addql #1,%2\n" \ | 214 | "1: moves.w (\\from)+,\\tmp\n" |
504 | "12: lsll #2,%2\n" \ | 215 | " move.w \\tmp,(\\to)+\n" |
505 | fixup "\n" \ | 216 | " .set .Lcnt,.Lcnt-2\n" |
506 | " jra 13f\n" \ | 217 | " .elseif .Lcnt & 1\n" |
507 | ".previous\n" \ | 218 | "1: moves.b (\\from)+,\\tmp\n" |
508 | ".section __ex_table,\"a\"\n" \ | 219 | " move.b \\tmp,(\\to)+\n" |
509 | " .align 4\n" \ | 220 | " .set .Lcnt,.Lcnt-1\n" |
510 | " .long 10b,22b\n" \ | 221 | " .else\n" |
511 | " .long 31b,12b\n" \ | 222 | " .exitm\n" |
512 | " .long 11b,12b\n" \ | 223 | " .endif\n" |
513 | " .long 41b,22b\n" \ | 224 | "\n" |
514 | ".previous\n" \ | 225 | " .section __ex_table,\"a\"\n" |
515 | copy "\n" \ | 226 | " .align 4\n" |
516 | "13:" \ | 227 | " .long 1b,3f\n" |
517 | : "=a"(to), "=a"(from), "=d"(n) \ | 228 | " .previous\n" |
518 | : "0"(to), "1"(from), "2"(n/4) \ | 229 | " .endm\n" |
519 | : "d0", "memory") | 230 | " .endif\n" |
231 | "\n" | ||
232 | " .set .Lcnt,%c4\n" | ||
233 | " copy_from_user %1,%2,%3\n" | ||
234 | " copy_from_user %1,%2,%3\n" | ||
235 | " copy_from_user %1,%2,%3\n" | ||
236 | "2:\n" | ||
237 | " .section .fixup,\"ax\"\n" | ||
238 | " .even\n" | ||
239 | "3: moveq.l %4,%0\n" | ||
240 | " move.l %5,%1\n" | ||
241 | " .rept %c4 / 4\n" | ||
242 | " clr.l (%1)+\n" | ||
243 | " .endr\n" | ||
244 | " .if %c4 & 2\n" | ||
245 | " clr.w (%1)+\n" | ||
246 | " .endif\n" | ||
247 | " .if %c4 & 1\n" | ||
248 | " clr.b (%1)+\n" | ||
249 | " .endif\n" | ||
250 | " jra 2b\n" | ||
251 | " .previous\n" | ||
252 | : "+r" (res), "+a" (to), "+a" (from), "=&d" (tmp) | ||
253 | : "i" (n), "g" (to) | ||
254 | : "memory"); | ||
520 | 255 | ||
521 | #define __copy_to_user_inatomic __copy_to_user | 256 | return res; |
522 | #define __copy_from_user_inatomic __copy_from_user | 257 | } |
523 | 258 | ||
524 | static inline unsigned long | 259 | static __always_inline unsigned long |
525 | __constant_copy_to_user(void __user *to, const void *from, unsigned long n) | 260 | __constant_copy_to_user(void __user *to, const void *from, unsigned long n) |
526 | { | 261 | { |
527 | switch (n) { | 262 | unsigned long res = 0, tmp; |
528 | case 0: | 263 | |
529 | break; | 264 | /* limit the inlined version to 3 moves */ |
530 | case 1: | 265 | if (n == 11 || n > 12) |
531 | __asm__ __volatile__ | 266 | return __generic_copy_to_user(to, from, n); |
532 | (" moveb (%1)+,%%d0\n" | 267 | |
533 | "21:movesb %%d0,(%0)+\n" | 268 | switch (n) { |
534 | "1:\n" | ||
535 | ".section .fixup,\"ax\"\n" | ||
536 | " .even\n" | ||
537 | "2: addql #1,%2\n" | ||
538 | " jra 1b\n" | ||
539 | ".previous\n" | ||
540 | ".section __ex_table,\"a\"\n" | ||
541 | " .align 4\n " | ||
542 | " .long 21b,2b\n" | ||
543 | " .long 1b,2b\n" | ||
544 | ".previous" | ||
545 | : "=a"(to), "=a"(from), "=d"(n) | ||
546 | : "0"(to), "1"(from), "2"(0) | ||
547 | : "d0", "memory"); | ||
548 | break; | ||
549 | case 2: | ||
550 | __asm__ __volatile__ | ||
551 | (" movew (%1)+,%%d0\n" | ||
552 | "21:movesw %%d0,(%0)+\n" | ||
553 | "1:\n" | ||
554 | ".section .fixup,\"ax\"\n" | ||
555 | " .even\n" | ||
556 | "2: addql #2,%2\n" | ||
557 | " jra 1b\n" | ||
558 | ".previous\n" | ||
559 | ".section __ex_table,\"a\"\n" | ||
560 | " .align 4\n" | ||
561 | " .long 21b,2b\n" | ||
562 | " .long 1b,2b\n" | ||
563 | ".previous" | ||
564 | : "=a"(to), "=a"(from), "=d"(n) | ||
565 | : "0"(to), "1"(from), "2"(0) | ||
566 | : "d0", "memory"); | ||
567 | break; | ||
568 | case 3: | ||
569 | __asm__ __volatile__ | ||
570 | (" movew (%1)+,%%d0\n" | ||
571 | "21:movesw %%d0,(%0)+\n" | ||
572 | "1: moveb (%1)+,%%d0\n" | ||
573 | "22:movesb %%d0,(%0)+\n" | ||
574 | "2:\n" | ||
575 | ".section .fixup,\"ax\"\n" | ||
576 | " .even\n" | ||
577 | "3: addql #2,%2\n" | ||
578 | "4: addql #1,%2\n" | ||
579 | " jra 2b\n" | ||
580 | ".previous\n" | ||
581 | ".section __ex_table,\"a\"\n" | ||
582 | " .align 4\n" | ||
583 | " .long 21b,3b\n" | ||
584 | " .long 1b,3b\n" | ||
585 | " .long 22b,4b\n" | ||
586 | " .long 2b,4b\n" | ||
587 | ".previous" | ||
588 | : "=a"(to), "=a"(from), "=d"(n) | ||
589 | : "0"(to), "1"(from), "2"(0) | ||
590 | : "d0", "memory"); | ||
591 | break; | ||
592 | case 4: | ||
593 | __asm__ __volatile__ | ||
594 | (" movel (%1)+,%%d0\n" | ||
595 | "21:movesl %%d0,(%0)+\n" | ||
596 | "1:\n" | ||
597 | ".section .fixup,\"ax\"\n" | ||
598 | " .even\n" | ||
599 | "2: addql #4,%2\n" | ||
600 | " jra 1b\n" | ||
601 | ".previous\n" | ||
602 | ".section __ex_table,\"a\"\n" | ||
603 | " .align 4\n" | ||
604 | " .long 21b,2b\n" | ||
605 | " .long 1b,2b\n" | ||
606 | ".previous" | ||
607 | : "=a"(to), "=a"(from), "=d"(n) | ||
608 | : "0"(to), "1"(from), "2"(0) | ||
609 | : "d0", "memory"); | ||
610 | break; | ||
611 | case 8: | ||
612 | __asm__ __volatile__ | ||
613 | (" movel (%1)+,%%d0\n" | ||
614 | "21:movesl %%d0,(%0)+\n" | ||
615 | "1: movel (%1)+,%%d0\n" | ||
616 | "22:movesl %%d0,(%0)+\n" | ||
617 | "2:\n" | ||
618 | ".section .fixup,\"ax\"\n" | ||
619 | " .even\n" | ||
620 | "3: addql #4,%2\n" | ||
621 | "4: addql #4,%2\n" | ||
622 | " jra 2b\n" | ||
623 | ".previous\n" | ||
624 | ".section __ex_table,\"a\"\n" | ||
625 | " .align 4\n" | ||
626 | " .long 21b,3b\n" | ||
627 | " .long 1b,3b\n" | ||
628 | " .long 22b,4b\n" | ||
629 | " .long 2b,4b\n" | ||
630 | ".previous" | ||
631 | : "=a"(to), "=a"(from), "=d"(n) | ||
632 | : "0"(to), "1"(from), "2"(0) | ||
633 | : "d0", "memory"); | ||
634 | break; | ||
635 | case 12: | ||
636 | __asm__ __volatile__ | ||
637 | (" movel (%1)+,%%d0\n" | ||
638 | "21:movesl %%d0,(%0)+\n" | ||
639 | "1: movel (%1)+,%%d0\n" | ||
640 | "22:movesl %%d0,(%0)+\n" | ||
641 | "2: movel (%1)+,%%d0\n" | ||
642 | "23:movesl %%d0,(%0)+\n" | ||
643 | "3:\n" | ||
644 | ".section .fixup,\"ax\"\n" | ||
645 | " .even\n" | ||
646 | "4: addql #4,%2\n" | ||
647 | "5: addql #4,%2\n" | ||
648 | "6: addql #4,%2\n" | ||
649 | " jra 3b\n" | ||
650 | ".previous\n" | ||
651 | ".section __ex_table,\"a\"\n" | ||
652 | " .align 4\n" | ||
653 | " .long 21b,4b\n" | ||
654 | " .long 1b,4b\n" | ||
655 | " .long 22b,5b\n" | ||
656 | " .long 2b,5b\n" | ||
657 | " .long 23b,6b\n" | ||
658 | " .long 3b,6b\n" | ||
659 | ".previous" | ||
660 | : "=a"(to), "=a"(from), "=d"(n) | ||
661 | : "0"(to), "1"(from), "2"(0) | ||
662 | : "d0", "memory"); | ||
663 | break; | ||
664 | case 16: | ||
665 | __asm__ __volatile__ | ||
666 | (" movel (%1)+,%%d0\n" | ||
667 | "21:movesl %%d0,(%0)+\n" | ||
668 | "1: movel (%1)+,%%d0\n" | ||
669 | "22:movesl %%d0,(%0)+\n" | ||
670 | "2: movel (%1)+,%%d0\n" | ||
671 | "23:movesl %%d0,(%0)+\n" | ||
672 | "3: movel (%1)+,%%d0\n" | ||
673 | "24:movesl %%d0,(%0)+\n" | ||
674 | "4:" | ||
675 | ".section .fixup,\"ax\"\n" | ||
676 | " .even\n" | ||
677 | "5: addql #4,%2\n" | ||
678 | "6: addql #4,%2\n" | ||
679 | "7: addql #4,%2\n" | ||
680 | "8: addql #4,%2\n" | ||
681 | " jra 4b\n" | ||
682 | ".previous\n" | ||
683 | ".section __ex_table,\"a\"\n" | ||
684 | " .align 4\n" | ||
685 | " .long 21b,5b\n" | ||
686 | " .long 1b,5b\n" | ||
687 | " .long 22b,6b\n" | ||
688 | " .long 2b,6b\n" | ||
689 | " .long 23b,7b\n" | ||
690 | " .long 3b,7b\n" | ||
691 | " .long 24b,8b\n" | ||
692 | " .long 4b,8b\n" | ||
693 | ".previous" | ||
694 | : "=a"(to), "=a"(from), "=d"(n) | ||
695 | : "0"(to), "1"(from), "2"(0) | ||
696 | : "d0", "memory"); | ||
697 | break; | ||
698 | default: | ||
699 | switch (n & 3) { | ||
700 | case 0: | ||
701 | __copy_to_user_big(to, from, n, "", ""); | ||
702 | break; | ||
703 | case 1: | 269 | case 1: |
704 | __copy_to_user_big(to, from, n, | 270 | __put_user_asm(res, *(u8 *)from, (u8 *)to, b, d, 1); |
705 | /* fixup */ | 271 | return res; |
706 | "1: addql #1,%2", | ||
707 | /* copy */ | ||
708 | " moveb (%1)+,%%d0\n" | ||
709 | "22:movesb %%d0,(%0)+\n" | ||
710 | "2:" | ||
711 | ".section __ex_table,\"a\"\n" | ||
712 | " .long 22b,1b\n" | ||
713 | " .long 2b,1b\n" | ||
714 | ".previous"); | ||
715 | break; | ||
716 | case 2: | 272 | case 2: |
717 | __copy_to_user_big(to, from, n, | 273 | __put_user_asm(res, *(u16 *)from, (u16 *)to, w, d, 2); |
718 | /* fixup */ | 274 | return res; |
719 | "1: addql #2,%2", | 275 | case 4: |
720 | /* copy */ | 276 | __put_user_asm(res, *(u32 *)from, (u32 *)to, l, r, 4); |
721 | " movew (%1)+,%%d0\n" | 277 | return res; |
722 | "22:movesw %%d0,(%0)+\n" | ||
723 | "2:" | ||
724 | ".section __ex_table,\"a\"\n" | ||
725 | " .long 22b,1b\n" | ||
726 | " .long 2b,1b\n" | ||
727 | ".previous"); | ||
728 | break; | ||
729 | case 3: | ||
730 | __copy_to_user_big(to, from, n, | ||
731 | /* fixup */ | ||
732 | "1: addql #2,%2\n" | ||
733 | "2: addql #1,%2", | ||
734 | /* copy */ | ||
735 | " movew (%1)+,%%d0\n" | ||
736 | "23:movesw %%d0,(%0)+\n" | ||
737 | "3: moveb (%1)+,%%d0\n" | ||
738 | "24:movesb %%d0,(%0)+\n" | ||
739 | "4:" | ||
740 | ".section __ex_table,\"a\"\n" | ||
741 | " .long 23b,1b\n" | ||
742 | " .long 3b,1b\n" | ||
743 | " .long 24b,2b\n" | ||
744 | " .long 4b,2b\n" | ||
745 | ".previous"); | ||
746 | break; | ||
747 | } | 278 | } |
748 | break; | 279 | |
749 | } | 280 | asm volatile ("\n" |
750 | return n; | 281 | " .ifndef .Lto_user\n" |
282 | " .set .Lto_user,1\n" | ||
283 | " .macro copy_to_user to,from,tmp\n" | ||
284 | " .if .Lcnt >= 4\n" | ||
285 | " move.l (\\from)+,\\tmp\n" | ||
286 | "11: moves.l \\tmp,(\\to)+\n" | ||
287 | "12: .set .Lcnt,.Lcnt-4\n" | ||
288 | " .elseif .Lcnt & 2\n" | ||
289 | " move.w (\\from)+,\\tmp\n" | ||
290 | "11: moves.w \\tmp,(\\to)+\n" | ||
291 | "12: .set .Lcnt,.Lcnt-2\n" | ||
292 | " .elseif .Lcnt & 1\n" | ||
293 | " move.b (\\from)+,\\tmp\n" | ||
294 | "11: moves.b \\tmp,(\\to)+\n" | ||
295 | "12: .set .Lcnt,.Lcnt-1\n" | ||
296 | " .else\n" | ||
297 | " .exitm\n" | ||
298 | " .endif\n" | ||
299 | "\n" | ||
300 | " .section __ex_table,\"a\"\n" | ||
301 | " .align 4\n" | ||
302 | " .long 11b,3f\n" | ||
303 | " .long 12b,3f\n" | ||
304 | " .previous\n" | ||
305 | " .endm\n" | ||
306 | " .endif\n" | ||
307 | "\n" | ||
308 | " .set .Lcnt,%c4\n" | ||
309 | " copy_to_user %1,%2,%3\n" | ||
310 | " copy_to_user %1,%2,%3\n" | ||
311 | " copy_to_user %1,%2,%3\n" | ||
312 | "2:\n" | ||
313 | " .section .fixup,\"ax\"\n" | ||
314 | " .even\n" | ||
315 | "3: moveq.l %4,%0\n" | ||
316 | " jra 2b\n" | ||
317 | " .previous\n" | ||
318 | : "+r" (res), "+a" (to), "+a" (from), "=&d" (tmp) | ||
319 | : "i" (n) | ||
320 | : "memory"); | ||
321 | |||
322 | return res; | ||
751 | } | 323 | } |
752 | 324 | ||
753 | #define copy_from_user(to, from, n) \ | 325 | #define __copy_from_user(to, from, n) \ |
754 | (__builtin_constant_p(n) ? \ | 326 | (__builtin_constant_p(n) ? \ |
755 | __constant_copy_from_user(to, from, n) : \ | 327 | __constant_copy_from_user(to, from, n) : \ |
756 | __generic_copy_from_user(to, from, n)) | 328 | __generic_copy_from_user(to, from, n)) |
757 | 329 | ||
758 | #define copy_to_user(to, from, n) \ | 330 | #define __copy_to_user(to, from, n) \ |
759 | (__builtin_constant_p(n) ? \ | 331 | (__builtin_constant_p(n) ? \ |
760 | __constant_copy_to_user(to, from, n) : \ | 332 | __constant_copy_to_user(to, from, n) : \ |
761 | __generic_copy_to_user(to, from, n)) | 333 | __generic_copy_to_user(to, from, n)) |
762 | 334 | ||
763 | #define __copy_from_user(to, from, n) copy_from_user(to, from, n) | 335 | #define __copy_to_user_inatomic __copy_to_user |
764 | #define __copy_to_user(to, from, n) copy_to_user(to, from, n) | 336 | #define __copy_from_user_inatomic __copy_from_user |
765 | 337 | ||
766 | /* | 338 | #define copy_from_user(to, from, n) __copy_from_user(to, from, n) |
767 | * Copy a null terminated string from userspace. | 339 | #define copy_to_user(to, from, n) __copy_to_user(to, from, n) |
768 | */ | ||
769 | 340 | ||
770 | static inline long | 341 | long strncpy_from_user(char *dst, const char __user *src, long count); |
771 | strncpy_from_user(char *dst, const char __user *src, long count) | 342 | long strnlen_user(const char __user *src, long n); |
772 | { | 343 | unsigned long clear_user(void __user *to, unsigned long n); |
773 | long res; | ||
774 | if (count == 0) return count; | ||
775 | __asm__ __volatile__ | ||
776 | ("1: movesb (%2)+,%%d0\n" | ||
777 | "12:moveb %%d0,(%1)+\n" | ||
778 | " jeq 2f\n" | ||
779 | " subql #1,%3\n" | ||
780 | " jne 1b\n" | ||
781 | "2: subl %3,%0\n" | ||
782 | "3:\n" | ||
783 | ".section .fixup,\"ax\"\n" | ||
784 | " .even\n" | ||
785 | "4: movel %4,%0\n" | ||
786 | " jra 3b\n" | ||
787 | ".previous\n" | ||
788 | ".section __ex_table,\"a\"\n" | ||
789 | " .align 4\n" | ||
790 | " .long 1b,4b\n" | ||
791 | " .long 12b,4b\n" | ||
792 | ".previous" | ||
793 | : "=d"(res), "=a"(dst), "=a"(src), "=d"(count) | ||
794 | : "i"(-EFAULT), "0"(count), "1"(dst), "2"(src), "3"(count) | ||
795 | : "d0", "memory"); | ||
796 | return res; | ||
797 | } | ||
798 | |||
799 | /* | ||
800 | * Return the size of a string (including the ending 0) | ||
801 | * | ||
802 | * Return 0 on exception, a value greater than N if too long | ||
803 | */ | ||
804 | static inline long strnlen_user(const char __user *src, long n) | ||
805 | { | ||
806 | long res; | ||
807 | |||
808 | res = -(unsigned long)src; | ||
809 | __asm__ __volatile__ | ||
810 | ("1:\n" | ||
811 | " tstl %2\n" | ||
812 | " jeq 3f\n" | ||
813 | "2: movesb (%1)+,%%d0\n" | ||
814 | "22:\n" | ||
815 | " subql #1,%2\n" | ||
816 | " tstb %%d0\n" | ||
817 | " jne 1b\n" | ||
818 | " jra 4f\n" | ||
819 | "3:\n" | ||
820 | " addql #1,%0\n" | ||
821 | "4:\n" | ||
822 | " addl %1,%0\n" | ||
823 | "5:\n" | ||
824 | ".section .fixup,\"ax\"\n" | ||
825 | " .even\n" | ||
826 | "6: moveq %3,%0\n" | ||
827 | " jra 5b\n" | ||
828 | ".previous\n" | ||
829 | ".section __ex_table,\"a\"\n" | ||
830 | " .align 4\n" | ||
831 | " .long 2b,6b\n" | ||
832 | " .long 22b,6b\n" | ||
833 | ".previous" | ||
834 | : "=d"(res), "=a"(src), "=d"(n) | ||
835 | : "i"(0), "0"(res), "1"(src), "2"(n) | ||
836 | : "d0"); | ||
837 | return res; | ||
838 | } | ||
839 | 344 | ||
840 | #define strlen_user(str) strnlen_user(str, 32767) | 345 | #define strlen_user(str) strnlen_user(str, 32767) |
841 | 346 | ||
842 | /* | ||
843 | * Zero Userspace | ||
844 | */ | ||
845 | |||
846 | static inline unsigned long | ||
847 | clear_user(void __user *to, unsigned long n) | ||
848 | { | ||
849 | __asm__ __volatile__ | ||
850 | (" tstl %1\n" | ||
851 | " jeq 3f\n" | ||
852 | "1: movesl %3,(%0)+\n" | ||
853 | "2: subql #1,%1\n" | ||
854 | " jne 1b\n" | ||
855 | "3: movel %2,%1\n" | ||
856 | " bclr #1,%1\n" | ||
857 | " jeq 4f\n" | ||
858 | "24:movesw %3,(%0)+\n" | ||
859 | "4: bclr #0,%1\n" | ||
860 | " jeq 5f\n" | ||
861 | "25:movesb %3,(%0)+\n" | ||
862 | "5:\n" | ||
863 | ".section .fixup,\"ax\"\n" | ||
864 | " .even\n" | ||
865 | "61:addql #1,%1\n" | ||
866 | "6: lsll #2,%1\n" | ||
867 | " addl %2,%1\n" | ||
868 | " jra 5b\n" | ||
869 | "7: addql #2,%1\n" | ||
870 | " jra 5b\n" | ||
871 | "8: addql #1,%1\n" | ||
872 | " jra 5b\n" | ||
873 | ".previous\n" | ||
874 | ".section __ex_table,\"a\"\n" | ||
875 | " .align 4\n" | ||
876 | " .long 1b,61b\n" | ||
877 | " .long 2b,6b\n" | ||
878 | " .long 3b,61b\n" | ||
879 | " .long 24b,7b\n" | ||
880 | " .long 4b,7b\n" | ||
881 | " .long 25b,8b\n" | ||
882 | " .long 5b,8b\n" | ||
883 | ".previous" | ||
884 | : "=a"(to), "=d"(n) | ||
885 | : "r"(n & 3), "r"(0), "0"(to), "1"(n/4)); | ||
886 | return n; | ||
887 | } | ||
888 | |||
889 | #endif /* _M68K_UACCESS_H */ | 347 | #endif /* _M68K_UACCESS_H */ |
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h index f236fe92156f..7c0b6296b45c 100644 --- a/include/asm-m68k/unistd.h +++ b/include/asm-m68k/unistd.h | |||
@@ -410,46 +410,7 @@ __syscall_return(type,__res); \ | |||
410 | 410 | ||
411 | #ifdef __KERNEL_SYSCALLS__ | 411 | #ifdef __KERNEL_SYSCALLS__ |
412 | 412 | ||
413 | #include <linux/compiler.h> | ||
414 | #include <linux/interrupt.h> | ||
415 | #include <linux/types.h> | ||
416 | |||
417 | /* | ||
418 | * we need this inline - forking from kernel space will result | ||
419 | * in NO COPY ON WRITE (!!!), until an execve is executed. This | ||
420 | * is no problem, but for the stack. This is handled by not letting | ||
421 | * main() use the stack at all after fork(). Thus, no function | ||
422 | * calls - which means inline code for fork too, as otherwise we | ||
423 | * would use the stack upon exit from 'fork()'. | ||
424 | * | ||
425 | * Actually only pause and fork are needed inline, so that there | ||
426 | * won't be any messing with the stack from main(), but we define | ||
427 | * some others too. | ||
428 | */ | ||
429 | #define __NR__exit __NR_exit | ||
430 | static inline _syscall0(pid_t,setsid) | ||
431 | static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) | ||
432 | static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) | ||
433 | static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) | ||
434 | static inline _syscall1(int,dup,int,fd) | ||
435 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) | 413 | static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) |
436 | static inline _syscall3(int,open,const char *,file,int,flag,int,mode) | ||
437 | static inline _syscall1(int,close,int,fd) | ||
438 | static inline _syscall1(int,_exit,int,exitcode) | ||
439 | static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) | ||
440 | |||
441 | asmlinkage long sys_mmap2( | ||
442 | unsigned long addr, unsigned long len, | ||
443 | unsigned long prot, unsigned long flags, | ||
444 | unsigned long fd, unsigned long pgoff); | ||
445 | asmlinkage int sys_execve(char *name, char **argv, char **envp); | ||
446 | asmlinkage int sys_pipe(unsigned long *fildes); | ||
447 | struct pt_regs; | ||
448 | struct sigaction; | ||
449 | asmlinkage long sys_rt_sigaction(int sig, | ||
450 | const struct sigaction __user *act, | ||
451 | struct sigaction __user *oact, | ||
452 | size_t sigsetsize); | ||
453 | 414 | ||
454 | #endif /* __KERNEL_SYSCALLS__ */ | 415 | #endif /* __KERNEL_SYSCALLS__ */ |
455 | 416 | ||
diff --git a/include/asm-m68knommu/irq.h b/include/asm-m68knommu/irq.h index 2b408842a30e..c5247516fcfe 100644 --- a/include/asm-m68knommu/irq.h +++ b/include/asm-m68knommu/irq.h | |||
@@ -87,8 +87,4 @@ extern void (*mach_disable_irq)(unsigned int); | |||
87 | #define disable_irq(x) do { } while (0) | 87 | #define disable_irq(x) do { } while (0) |
88 | #define disable_irq_nosync(x) disable_irq(x) | 88 | #define disable_irq_nosync(x) disable_irq(x) |
89 | 89 | ||
90 | struct irqaction; | ||
91 | struct pt_regs; | ||
92 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
93 | |||
94 | #endif /* _M68K_IRQ_H_ */ | 90 | #endif /* _M68K_IRQ_H_ */ |
diff --git a/include/asm-m68knommu/ptrace.h b/include/asm-m68knommu/ptrace.h index f65bd90749e6..1e19c457de7d 100644 --- a/include/asm-m68knommu/ptrace.h +++ b/include/asm-m68knommu/ptrace.h | |||
@@ -70,7 +70,7 @@ struct switch_stack { | |||
70 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | 70 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ |
71 | #define PTRACE_GETREGS 12 | 71 | #define PTRACE_GETREGS 12 |
72 | #define PTRACE_SETREGS 13 | 72 | #define PTRACE_SETREGS 13 |
73 | #ifdef COFNIG_FPU | 73 | #ifdef CONFIG_FPU |
74 | #define PTRACE_GETFPREGS 14 | 74 | #define PTRACE_GETFPREGS 14 |
75 | #define PTRACE_SETFPREGS 15 | 75 | #define PTRACE_SETFPREGS 15 |
76 | #endif | 76 | #endif |
diff --git a/include/asm-mips/mach-au1x00/au1xxx_psc.h b/include/asm-mips/mach-au1x00/au1xxx_psc.h index 5c3e2a38ce12..d7cbacdd21fe 100644 --- a/include/asm-mips/mach-au1x00/au1xxx_psc.h +++ b/include/asm-mips/mach-au1x00/au1xxx_psc.h | |||
@@ -39,7 +39,12 @@ | |||
39 | #define PSC0_BASE_ADDR 0xb1a00000 | 39 | #define PSC0_BASE_ADDR 0xb1a00000 |
40 | #define PSC1_BASE_ADDR 0xb1b00000 | 40 | #define PSC1_BASE_ADDR 0xb1b00000 |
41 | #define PSC2_BASE_ADDR 0xb0a00000 | 41 | #define PSC2_BASE_ADDR 0xb0a00000 |
42 | #define PSC3_BASE_ADDR 0xb0d00000 | 42 | #define PSC3_BASE_ADDR 0xb0b00000 |
43 | #endif | ||
44 | |||
45 | #ifdef CONFIG_SOC_AU1200 | ||
46 | #define PSC0_BASE_ADDR 0xb1a00000 | ||
47 | #define PSC1_BASE_ADDR 0xb1b00000 | ||
43 | #endif | 48 | #endif |
44 | 49 | ||
45 | /* The PSC select and control registers are common to | 50 | /* The PSC select and control registers are common to |
@@ -227,6 +232,8 @@ typedef struct psc_i2s { | |||
227 | #define PSC_I2SCFG_DD_DISABLE (1 << 27) | 232 | #define PSC_I2SCFG_DD_DISABLE (1 << 27) |
228 | #define PSC_I2SCFG_DE_ENABLE (1 << 26) | 233 | #define PSC_I2SCFG_DE_ENABLE (1 << 26) |
229 | #define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16) | 234 | #define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16) |
235 | #define PSC_I2SCFG_WS(n) ((n & 0xFF) << 16) | ||
236 | #define PSC_I2SCFG_WS_MASK (PSC_I2SCFG_WS(0x3F)) | ||
230 | #define PSC_I2SCFG_WI (1 << 15) | 237 | #define PSC_I2SCFG_WI (1 << 15) |
231 | 238 | ||
232 | #define PSC_I2SCFG_DIV_MASK (3 << 13) | 239 | #define PSC_I2SCFG_DIV_MASK (3 << 13) |
diff --git a/include/asm-mips/mach-db1x00/db1x00.h b/include/asm-mips/mach-db1x00/db1x00.h index 8fbb4b42a8b5..0f5f4c29f4e8 100644 --- a/include/asm-mips/mach-db1x00/db1x00.h +++ b/include/asm-mips/mach-db1x00/db1x00.h | |||
@@ -30,8 +30,20 @@ | |||
30 | 30 | ||
31 | 31 | ||
32 | #ifdef CONFIG_MIPS_DB1550 | 32 | #ifdef CONFIG_MIPS_DB1550 |
33 | |||
34 | #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX | ||
35 | #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX | ||
36 | #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX | ||
37 | #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX | ||
38 | |||
39 | #define SPI_PSC_BASE PSC0_BASE_ADDR | ||
40 | #define AC97_PSC_BASE PSC1_BASE_ADDR | ||
41 | #define SMBUS_PSC_BASE PSC2_BASE_ADDR | ||
42 | #define I2S_PSC_BASE PSC3_BASE_ADDR | ||
43 | |||
33 | #define BCSR_KSEG1_ADDR 0xAF000000 | 44 | #define BCSR_KSEG1_ADDR 0xAF000000 |
34 | #define NAND_PHYS_ADDR 0x20000000 | 45 | #define NAND_PHYS_ADDR 0x20000000 |
46 | |||
35 | #else | 47 | #else |
36 | #define BCSR_KSEG1_ADDR 0xAE000000 | 48 | #define BCSR_KSEG1_ADDR 0xAE000000 |
37 | #endif | 49 | #endif |
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h index dc231c89bef9..f53ec54c92ff 100644 --- a/include/asm-mips/mmzone.h +++ b/include/asm-mips/mmzone.h | |||
@@ -10,7 +10,6 @@ | |||
10 | 10 | ||
11 | #ifdef CONFIG_DISCONTIGMEM | 11 | #ifdef CONFIG_DISCONTIGMEM |
12 | 12 | ||
13 | #define kvaddr_to_nid(kvaddr) pa_to_nid(__pa(kvaddr)) | ||
14 | #define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT) | 13 | #define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT) |
15 | 14 | ||
16 | #endif /* CONFIG_DISCONTIGMEM */ | 15 | #endif /* CONFIG_DISCONTIGMEM */ |
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h index 34755c0a6398..c1dd0b10bc27 100644 --- a/include/asm-mips/vga.h +++ b/include/asm-mips/vga.h | |||
@@ -13,7 +13,7 @@ | |||
13 | * access the videoram directly without any black magic. | 13 | * access the videoram directly without any black magic. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #define VGA_MAP_MEM(x) (0xb0000000L + (unsigned long)(x)) | 16 | #define VGA_MAP_MEM(x,s) (0xb0000000L + (unsigned long)(x)) |
17 | 17 | ||
18 | #define vga_readb(x) (*(x)) | 18 | #define vga_readb(x) (*(x)) |
19 | #define vga_writeb(x,y) (*(y) = (x)) | 19 | #define vga_writeb(x,y) (*(y) = (x)) |
diff --git a/include/asm-parisc/mmzone.h b/include/asm-parisc/mmzone.h index ceb9b73199d1..c87813662d4d 100644 --- a/include/asm-parisc/mmzone.h +++ b/include/asm-parisc/mmzone.h | |||
@@ -14,11 +14,6 @@ extern struct node_map_data node_data[]; | |||
14 | 14 | ||
15 | #define NODE_DATA(nid) (&node_data[nid].pg_data) | 15 | #define NODE_DATA(nid) (&node_data[nid].pg_data) |
16 | 16 | ||
17 | /* | ||
18 | * Given a kernel address, find the home node of the underlying memory. | ||
19 | */ | ||
20 | #define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT) | ||
21 | |||
22 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | 17 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) |
23 | #define node_end_pfn(nid) \ | 18 | #define node_end_pfn(nid) \ |
24 | ({ \ | 19 | ({ \ |
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index d1c2a4405660..76e2f08c3c83 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h | |||
@@ -288,8 +288,8 @@ static __inline__ int test_le_bit(unsigned long nr, | |||
288 | #define __test_and_clear_le_bit(nr, addr) \ | 288 | #define __test_and_clear_le_bit(nr, addr) \ |
289 | __test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) | 289 | __test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr)) |
290 | 290 | ||
291 | #define find_first_zero_le_bit(addr, size) find_next_zero_le_bit((addr), (size), 0) | 291 | #define find_first_zero_le_bit(addr, size) generic_find_next_zero_le_bit((addr), (size), 0) |
292 | unsigned long find_next_zero_le_bit(const unsigned long *addr, | 292 | unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, |
293 | unsigned long size, unsigned long offset); | 293 | unsigned long size, unsigned long offset); |
294 | 294 | ||
295 | /* Bitmap functions for the ext2 filesystem */ | 295 | /* Bitmap functions for the ext2 filesystem */ |
@@ -309,7 +309,7 @@ unsigned long find_next_zero_le_bit(const unsigned long *addr, | |||
309 | #define ext2_find_first_zero_bit(addr, size) \ | 309 | #define ext2_find_first_zero_bit(addr, size) \ |
310 | find_first_zero_le_bit((unsigned long*)addr, size) | 310 | find_first_zero_le_bit((unsigned long*)addr, size) |
311 | #define ext2_find_next_zero_bit(addr, size, off) \ | 311 | #define ext2_find_next_zero_bit(addr, size, off) \ |
312 | find_next_zero_le_bit((unsigned long*)addr, size, off) | 312 | generic_find_next_zero_le_bit((unsigned long*)addr, size, off) |
313 | 313 | ||
314 | /* Bitmap functions for the minix filesystem. */ | 314 | /* Bitmap functions for the minix filesystem. */ |
315 | 315 | ||
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index f6265c2a0dd2..fab41c280aa1 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
@@ -24,6 +24,9 @@ | |||
24 | #define PPC_FEATURE_ICACHE_SNOOP 0x00002000 | 24 | #define PPC_FEATURE_ICACHE_SNOOP 0x00002000 |
25 | #define PPC_FEATURE_ARCH_2_05 0x00001000 | 25 | #define PPC_FEATURE_ARCH_2_05 0x00001000 |
26 | 26 | ||
27 | #define PPC_FEATURE_TRUE_LE 0x00000002 | ||
28 | #define PPC_FEATURE_PPC_LE 0x00000001 | ||
29 | |||
27 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
28 | #ifndef __ASSEMBLY__ | 31 | #ifndef __ASSEMBLY__ |
29 | 32 | ||
@@ -69,6 +72,13 @@ struct cpu_spec { | |||
69 | /* Processor specific oprofile operations */ | 72 | /* Processor specific oprofile operations */ |
70 | enum powerpc_oprofile_type oprofile_type; | 73 | enum powerpc_oprofile_type oprofile_type; |
71 | 74 | ||
75 | /* Bit locations inside the mmcra change */ | ||
76 | unsigned long oprofile_mmcra_sihv; | ||
77 | unsigned long oprofile_mmcra_sipr; | ||
78 | |||
79 | /* Bits to clear during an oprofile exception */ | ||
80 | unsigned long oprofile_mmcra_clear; | ||
81 | |||
72 | /* Name of processor class, for the ELF AT_PLATFORM entry */ | 82 | /* Name of processor class, for the ELF AT_PLATFORM entry */ |
73 | char *platform; | 83 | char *platform; |
74 | }; | 84 | }; |
@@ -104,6 +114,8 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
104 | #define CPU_FTR_NO_BTIC ASM_CONST(0x0000000000040000) | 114 | #define CPU_FTR_NO_BTIC ASM_CONST(0x0000000000040000) |
105 | #define CPU_FTR_BIG_PHYS ASM_CONST(0x0000000000080000) | 115 | #define CPU_FTR_BIG_PHYS ASM_CONST(0x0000000000080000) |
106 | #define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) | 116 | #define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) |
117 | #define CPU_FTR_PPC_LE ASM_CONST(0x0000000000200000) | ||
118 | #define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) | ||
107 | 119 | ||
108 | #ifdef __powerpc64__ | 120 | #ifdef __powerpc64__ |
109 | /* Add the 64b processor unique features in the top half of the word */ | 121 | /* Add the 64b processor unique features in the top half of the word */ |
@@ -117,7 +129,6 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
117 | #define CPU_FTR_SMT ASM_CONST(0x0000010000000000) | 129 | #define CPU_FTR_SMT ASM_CONST(0x0000010000000000) |
118 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) | 130 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) |
119 | #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) | 131 | #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) |
120 | #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) | ||
121 | #define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000) | 132 | #define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000) |
122 | #define CPU_FTR_PAUSE_ZERO ASM_CONST(0x0000200000000000) | 133 | #define CPU_FTR_PAUSE_ZERO ASM_CONST(0x0000200000000000) |
123 | #define CPU_FTR_PURR ASM_CONST(0x0000400000000000) | 134 | #define CPU_FTR_PURR ASM_CONST(0x0000400000000000) |
@@ -134,7 +145,6 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
134 | #define CPU_FTR_SMT ASM_CONST(0x0) | 145 | #define CPU_FTR_SMT ASM_CONST(0x0) |
135 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0) | 146 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0) |
136 | #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0) | 147 | #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0) |
137 | #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0) | ||
138 | #define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0) | 148 | #define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0) |
139 | #define CPU_FTR_PURR ASM_CONST(0x0) | 149 | #define CPU_FTR_PURR ASM_CONST(0x0) |
140 | #endif | 150 | #endif |
@@ -192,92 +202,95 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
192 | #define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE) | 202 | #define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE) |
193 | #define CPU_FTRS_603 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 203 | #define CPU_FTRS_603 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
194 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ | 204 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ |
195 | CPU_FTR_MAYBE_CAN_NAP) | 205 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
196 | #define CPU_FTRS_604 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 206 | #define CPU_FTRS_604 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
197 | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE) | 207 | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE | \ |
208 | CPU_FTR_PPC_LE) | ||
198 | #define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 209 | #define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
199 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 210 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
200 | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP) | 211 | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
201 | #define CPU_FTRS_740 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 212 | #define CPU_FTRS_740 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
202 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 213 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
203 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP) | 214 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ |
215 | CPU_FTR_PPC_LE) | ||
204 | #define CPU_FTRS_750 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 216 | #define CPU_FTRS_750 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
205 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 217 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
206 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP) | 218 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ |
219 | CPU_FTR_PPC_LE) | ||
207 | #define CPU_FTRS_750FX1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 220 | #define CPU_FTRS_750FX1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
208 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 221 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
209 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | 222 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ |
210 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM) | 223 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM | CPU_FTR_PPC_LE) |
211 | #define CPU_FTRS_750FX2 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 224 | #define CPU_FTRS_750FX2 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
212 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 225 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
213 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | 226 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ |
214 | CPU_FTR_NO_DPM) | 227 | CPU_FTR_NO_DPM | CPU_FTR_PPC_LE) |
215 | #define CPU_FTRS_750FX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 228 | #define CPU_FTRS_750FX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
216 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 229 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
217 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | 230 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ |
218 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS) | 231 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) |
219 | #define CPU_FTRS_750GX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ | 232 | #define CPU_FTRS_750GX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ |
220 | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | \ | 233 | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | \ |
221 | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ | 234 | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \ |
222 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS) | 235 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) |
223 | #define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 236 | #define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
224 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 237 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
225 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ | 238 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ |
226 | CPU_FTR_MAYBE_CAN_NAP) | 239 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
227 | #define CPU_FTRS_7400 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 240 | #define CPU_FTRS_7400 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
228 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ | 241 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \ |
229 | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ | 242 | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \ |
230 | CPU_FTR_MAYBE_CAN_NAP) | 243 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_PPC_LE) |
231 | #define CPU_FTRS_7450_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 244 | #define CPU_FTRS_7450_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
232 | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 245 | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
233 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 246 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
234 | CPU_FTR_NEED_COHERENT) | 247 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
235 | #define CPU_FTRS_7450_21 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 248 | #define CPU_FTRS_7450_21 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
236 | CPU_FTR_USE_TB | \ | 249 | CPU_FTR_USE_TB | \ |
237 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 250 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
238 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 251 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
239 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ | 252 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ |
240 | CPU_FTR_NEED_COHERENT) | 253 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
241 | #define CPU_FTRS_7450_23 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 254 | #define CPU_FTRS_7450_23 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
242 | CPU_FTR_USE_TB | \ | 255 | CPU_FTR_USE_TB | \ |
243 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 256 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
244 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 257 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
245 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT) | 258 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
246 | #define CPU_FTRS_7455_1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 259 | #define CPU_FTRS_7455_1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
247 | CPU_FTR_USE_TB | \ | 260 | CPU_FTR_USE_TB | \ |
248 | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \ | 261 | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \ |
249 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \ | 262 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \ |
250 | CPU_FTR_NEED_COHERENT) | 263 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
251 | #define CPU_FTRS_7455_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 264 | #define CPU_FTRS_7455_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
252 | CPU_FTR_USE_TB | \ | 265 | CPU_FTR_USE_TB | \ |
253 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 266 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
254 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 267 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
255 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ | 268 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \ |
256 | CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS) | 269 | CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS | CPU_FTR_PPC_LE) |
257 | #define CPU_FTRS_7455 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 270 | #define CPU_FTRS_7455 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
258 | CPU_FTR_USE_TB | \ | 271 | CPU_FTR_USE_TB | \ |
259 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 272 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
260 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 273 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
261 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ | 274 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ |
262 | CPU_FTR_NEED_COHERENT) | 275 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
263 | #define CPU_FTRS_7447_10 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 276 | #define CPU_FTRS_7447_10 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
264 | CPU_FTR_USE_TB | \ | 277 | CPU_FTR_USE_TB | \ |
265 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 278 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
266 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 279 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
267 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ | 280 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ |
268 | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC) | 281 | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC | CPU_FTR_PPC_LE) |
269 | #define CPU_FTRS_7447 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 282 | #define CPU_FTRS_7447 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
270 | CPU_FTR_USE_TB | \ | 283 | CPU_FTR_USE_TB | \ |
271 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 284 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
272 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 285 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
273 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ | 286 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ |
274 | CPU_FTR_NEED_COHERENT) | 287 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
275 | #define CPU_FTRS_7447A (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 288 | #define CPU_FTRS_7447A (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
276 | CPU_FTR_USE_TB | \ | 289 | CPU_FTR_USE_TB | \ |
277 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ | 290 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \ |
278 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ | 291 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \ |
279 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ | 292 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \ |
280 | CPU_FTR_NEED_COHERENT) | 293 | CPU_FTR_NEED_COHERENT | CPU_FTR_PPC_LE) |
281 | #define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 294 | #define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
282 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB) | 295 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB) |
283 | #define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ | 296 | #define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \ |
@@ -287,13 +300,6 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
287 | CPU_FTR_COMMON) | 300 | CPU_FTR_COMMON) |
288 | #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | 301 | #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ |
289 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) | 302 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) |
290 | #define CPU_FTRS_POWER3_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | ||
291 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE) | ||
292 | #define CPU_FTRS_POWER4_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | ||
293 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_NODSISRALIGN) | ||
294 | #define CPU_FTRS_970_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \ | ||
295 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_ALTIVEC_COMP | \ | ||
296 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN) | ||
297 | #define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB) | 303 | #define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB) |
298 | #define CPU_FTRS_40X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 304 | #define CPU_FTRS_40X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
299 | CPU_FTR_NODSISRALIGN) | 305 | CPU_FTR_NODSISRALIGN) |
@@ -307,7 +313,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
307 | #define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) | 313 | #define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) |
308 | #ifdef __powerpc64__ | 314 | #ifdef __powerpc64__ |
309 | #define CPU_FTRS_POWER3 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 315 | #define CPU_FTRS_POWER3 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
310 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR) | 316 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | CPU_FTR_PPC_LE) |
311 | #define CPU_FTRS_RS64 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 317 | #define CPU_FTRS_RS64 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
312 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ | 318 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \ |
313 | CPU_FTR_MMCRA | CPU_FTR_CTRL) | 319 | CPU_FTR_MMCRA | CPU_FTR_CTRL) |
@@ -320,12 +326,12 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
320 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ | 326 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ |
321 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 327 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
322 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | 328 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ |
323 | CPU_FTR_MMCRA_SIHV | CPU_FTR_PURR) | 329 | CPU_FTR_PURR) |
324 | #define CPU_FTRS_POWER6 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 330 | #define CPU_FTRS_POWER6 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
325 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ | 331 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ |
326 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 332 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
327 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | 333 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ |
328 | CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE) | 334 | CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE | CPU_FTR_REAL_LE) |
329 | #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 335 | #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
330 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ | 336 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ |
331 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 337 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
@@ -354,12 +360,6 @@ enum { | |||
354 | #else | 360 | #else |
355 | CPU_FTRS_GENERIC_32 | | 361 | CPU_FTRS_GENERIC_32 | |
356 | #endif | 362 | #endif |
357 | #ifdef CONFIG_PPC64BRIDGE | ||
358 | CPU_FTRS_POWER3_32 | | ||
359 | #endif | ||
360 | #ifdef CONFIG_POWER4 | ||
361 | CPU_FTRS_POWER4_32 | CPU_FTRS_970_32 | | ||
362 | #endif | ||
363 | #ifdef CONFIG_8xx | 363 | #ifdef CONFIG_8xx |
364 | CPU_FTRS_8XX | | 364 | CPU_FTRS_8XX | |
365 | #endif | 365 | #endif |
@@ -399,12 +399,6 @@ enum { | |||
399 | #else | 399 | #else |
400 | CPU_FTRS_GENERIC_32 & | 400 | CPU_FTRS_GENERIC_32 & |
401 | #endif | 401 | #endif |
402 | #ifdef CONFIG_PPC64BRIDGE | ||
403 | CPU_FTRS_POWER3_32 & | ||
404 | #endif | ||
405 | #ifdef CONFIG_POWER4 | ||
406 | CPU_FTRS_POWER4_32 & CPU_FTRS_970_32 & | ||
407 | #endif | ||
408 | #ifdef CONFIG_8xx | 402 | #ifdef CONFIG_8xx |
409 | CPU_FTRS_8XX & | 403 | CPU_FTRS_8XX & |
410 | #endif | 404 | #endif |
diff --git a/include/asm-powerpc/delay.h b/include/asm-powerpc/delay.h index 057a60955474..f9200a65c632 100644 --- a/include/asm-powerpc/delay.h +++ b/include/asm-powerpc/delay.h | |||
@@ -17,5 +17,18 @@ | |||
17 | extern void __delay(unsigned long loops); | 17 | extern void __delay(unsigned long loops); |
18 | extern void udelay(unsigned long usecs); | 18 | extern void udelay(unsigned long usecs); |
19 | 19 | ||
20 | /* | ||
21 | * On shared processor machines the generic implementation of mdelay can | ||
22 | * result in large errors. While each iteration of the loop inside mdelay | ||
23 | * is supposed to take 1ms, the hypervisor could sleep our partition for | ||
24 | * longer (eg 10ms). With the right timing these errors can add up. | ||
25 | * | ||
26 | * Since there is no 32bit overflow issue on 64bit kernels, just call | ||
27 | * udelay directly. | ||
28 | */ | ||
29 | #ifdef CONFIG_PPC64 | ||
30 | #define mdelay(n) udelay((n) * 1000) | ||
31 | #endif | ||
32 | |||
20 | #endif /* __KERNEL__ */ | 33 | #endif /* __KERNEL__ */ |
21 | #endif /* _ASM_POWERPC_DELAY_H */ | 34 | #endif /* _ASM_POWERPC_DELAY_H */ |
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h index e9c86b1eedab..4df3e80118f4 100644 --- a/include/asm-powerpc/eeh.h +++ b/include/asm-powerpc/eeh.h | |||
@@ -292,8 +292,6 @@ static inline void eeh_memcpy_toio(volatile void __iomem *dest, const void *src, | |||
292 | static inline u8 eeh_inb(unsigned long port) | 292 | static inline u8 eeh_inb(unsigned long port) |
293 | { | 293 | { |
294 | u8 val; | 294 | u8 val; |
295 | if (!_IO_IS_VALID(port)) | ||
296 | return ~0; | ||
297 | val = in_8((u8 __iomem *)(port+pci_io_base)); | 295 | val = in_8((u8 __iomem *)(port+pci_io_base)); |
298 | if (EEH_POSSIBLE_ERROR(val, u8)) | 296 | if (EEH_POSSIBLE_ERROR(val, u8)) |
299 | return eeh_check_failure((void __iomem *)(port), val); | 297 | return eeh_check_failure((void __iomem *)(port), val); |
@@ -302,15 +300,12 @@ static inline u8 eeh_inb(unsigned long port) | |||
302 | 300 | ||
303 | static inline void eeh_outb(u8 val, unsigned long port) | 301 | static inline void eeh_outb(u8 val, unsigned long port) |
304 | { | 302 | { |
305 | if (_IO_IS_VALID(port)) | 303 | out_8((u8 __iomem *)(port+pci_io_base), val); |
306 | out_8((u8 __iomem *)(port+pci_io_base), val); | ||
307 | } | 304 | } |
308 | 305 | ||
309 | static inline u16 eeh_inw(unsigned long port) | 306 | static inline u16 eeh_inw(unsigned long port) |
310 | { | 307 | { |
311 | u16 val; | 308 | u16 val; |
312 | if (!_IO_IS_VALID(port)) | ||
313 | return ~0; | ||
314 | val = in_le16((u16 __iomem *)(port+pci_io_base)); | 309 | val = in_le16((u16 __iomem *)(port+pci_io_base)); |
315 | if (EEH_POSSIBLE_ERROR(val, u16)) | 310 | if (EEH_POSSIBLE_ERROR(val, u16)) |
316 | return eeh_check_failure((void __iomem *)(port), val); | 311 | return eeh_check_failure((void __iomem *)(port), val); |
@@ -319,15 +314,12 @@ static inline u16 eeh_inw(unsigned long port) | |||
319 | 314 | ||
320 | static inline void eeh_outw(u16 val, unsigned long port) | 315 | static inline void eeh_outw(u16 val, unsigned long port) |
321 | { | 316 | { |
322 | if (_IO_IS_VALID(port)) | 317 | out_le16((u16 __iomem *)(port+pci_io_base), val); |
323 | out_le16((u16 __iomem *)(port+pci_io_base), val); | ||
324 | } | 318 | } |
325 | 319 | ||
326 | static inline u32 eeh_inl(unsigned long port) | 320 | static inline u32 eeh_inl(unsigned long port) |
327 | { | 321 | { |
328 | u32 val; | 322 | u32 val; |
329 | if (!_IO_IS_VALID(port)) | ||
330 | return ~0; | ||
331 | val = in_le32((u32 __iomem *)(port+pci_io_base)); | 323 | val = in_le32((u32 __iomem *)(port+pci_io_base)); |
332 | if (EEH_POSSIBLE_ERROR(val, u32)) | 324 | if (EEH_POSSIBLE_ERROR(val, u32)) |
333 | return eeh_check_failure((void __iomem *)(port), val); | 325 | return eeh_check_failure((void __iomem *)(port), val); |
@@ -336,8 +328,7 @@ static inline u32 eeh_inl(unsigned long port) | |||
336 | 328 | ||
337 | static inline void eeh_outl(u32 val, unsigned long port) | 329 | static inline void eeh_outl(u32 val, unsigned long port) |
338 | { | 330 | { |
339 | if (_IO_IS_VALID(port)) | 331 | out_le32((u32 __iomem *)(port+pci_io_base), val); |
340 | out_le32((u32 __iomem *)(port+pci_io_base), val); | ||
341 | } | 332 | } |
342 | 333 | ||
343 | /* in-string eeh macros */ | 334 | /* in-string eeh macros */ |
diff --git a/include/asm-powerpc/eeh_event.h b/include/asm-powerpc/eeh_event.h index 93d55a2bebfd..dc6bf0ffb796 100644 --- a/include/asm-powerpc/eeh_event.h +++ b/include/asm-powerpc/eeh_event.h | |||
@@ -18,8 +18,8 @@ | |||
18 | * Copyright (c) 2005 Linas Vepstas <linas@linas.org> | 18 | * Copyright (c) 2005 Linas Vepstas <linas@linas.org> |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef ASM_PPC64_EEH_EVENT_H | 21 | #ifndef ASM_POWERPC_EEH_EVENT_H |
22 | #define ASM_PPC64_EEH_EVENT_H | 22 | #define ASM_POWERPC_EEH_EVENT_H |
23 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
24 | 24 | ||
25 | /** EEH event -- structure holding pci controller data that describes | 25 | /** EEH event -- structure holding pci controller data that describes |
@@ -39,7 +39,7 @@ struct eeh_event { | |||
39 | * @dev pci device | 39 | * @dev pci device |
40 | * | 40 | * |
41 | * This routine builds a PCI error event which will be delivered | 41 | * This routine builds a PCI error event which will be delivered |
42 | * to all listeners on the peh_notifier_chain. | 42 | * to all listeners on the eeh_notifier_chain. |
43 | * | 43 | * |
44 | * This routine can be called within an interrupt context; | 44 | * This routine can be called within an interrupt context; |
45 | * the actual event will be delivered in a normal context | 45 | * the actual event will be delivered in a normal context |
@@ -51,7 +51,7 @@ int eeh_send_failure_event (struct device_node *dn, | |||
51 | int time_unavail); | 51 | int time_unavail); |
52 | 52 | ||
53 | /* Main recovery function */ | 53 | /* Main recovery function */ |
54 | void handle_eeh_events (struct eeh_event *); | 54 | struct pci_dn * handle_eeh_events (struct eeh_event *); |
55 | 55 | ||
56 | #endif /* __KERNEL__ */ | 56 | #endif /* __KERNEL__ */ |
57 | #endif /* ASM_PPC64_EEH_EVENT_H */ | 57 | #endif /* ASM_POWERPC_EEH_EVENT_H */ |
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index 99c18b71aa82..9a83a987d396 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h | |||
@@ -293,7 +293,7 @@ do { \ | |||
293 | NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ | 293 | NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ |
294 | NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ | 294 | NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ |
295 | NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ | 295 | NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ |
296 | VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->thread.vdso_base) \ | 296 | VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base) \ |
297 | } while (0) | 297 | } while (0) |
298 | 298 | ||
299 | /* PowerPC64 relocations defined by the ABIs */ | 299 | /* PowerPC64 relocations defined by the ABIs */ |
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index 6cc7e1fb7bfd..0d3c4e85711a 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h | |||
@@ -102,6 +102,15 @@ | |||
102 | #define H_PP1 (1UL<<(63-62)) | 102 | #define H_PP1 (1UL<<(63-62)) |
103 | #define H_PP2 (1UL<<(63-63)) | 103 | #define H_PP2 (1UL<<(63-63)) |
104 | 104 | ||
105 | /* VASI States */ | ||
106 | #define H_VASI_INVALID 0 | ||
107 | #define H_VASI_ENABLED 1 | ||
108 | #define H_VASI_ABORTED 2 | ||
109 | #define H_VASI_SUSPENDING 3 | ||
110 | #define H_VASI_SUSPENDED 4 | ||
111 | #define H_VASI_RESUMED 5 | ||
112 | #define H_VASI_COMPLETED 6 | ||
113 | |||
105 | /* DABRX flags */ | 114 | /* DABRX flags */ |
106 | #define H_DABRX_HYPERVISOR (1UL<<(63-61)) | 115 | #define H_DABRX_HYPERVISOR (1UL<<(63-61)) |
107 | #define H_DABRX_KERNEL (1UL<<(63-62)) | 116 | #define H_DABRX_KERNEL (1UL<<(63-62)) |
@@ -190,6 +199,7 @@ | |||
190 | #define H_QUERY_INT_STATE 0x1E4 | 199 | #define H_QUERY_INT_STATE 0x1E4 |
191 | #define H_POLL_PENDING 0x1D8 | 200 | #define H_POLL_PENDING 0x1D8 |
192 | #define H_JOIN 0x298 | 201 | #define H_JOIN 0x298 |
202 | #define H_VASI_STATE 0x2A4 | ||
193 | #define H_ENABLE_CRQ 0x2B0 | 203 | #define H_ENABLE_CRQ 0x2B0 |
194 | 204 | ||
195 | #ifndef __ASSEMBLY__ | 205 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-powerpc/immap_86xx.h b/include/asm-powerpc/immap_86xx.h new file mode 100644 index 000000000000..d905b6622268 --- /dev/null +++ b/include/asm-powerpc/immap_86xx.h | |||
@@ -0,0 +1,199 @@ | |||
1 | /* | ||
2 | * MPC86xx Internal Memory Map | ||
3 | * | ||
4 | * Author: Jeff Brown | ||
5 | * | ||
6 | * Copyright 2004 Freescale Semiconductor, Inc | ||
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 __ASM_POWERPC_IMMAP_86XX_H__ | ||
16 | #define __ASM_POWERPC_IMMAP_86XX_H__ | ||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | /* Eventually this should define all the IO block registers in 86xx */ | ||
20 | |||
21 | /* PCI Registers */ | ||
22 | typedef struct ccsr_pci { | ||
23 | uint cfg_addr; /* 0x.000 - PCI Configuration Address Register */ | ||
24 | uint cfg_data; /* 0x.004 - PCI Configuration Data Register */ | ||
25 | uint int_ack; /* 0x.008 - PCI Interrupt Acknowledge Register */ | ||
26 | char res1[3060]; | ||
27 | uint potar0; /* 0x.c00 - PCI Outbound Transaction Address Register 0 */ | ||
28 | uint potear0; /* 0x.c04 - PCI Outbound Translation Extended Address Register 0 */ | ||
29 | uint powbar0; /* 0x.c08 - PCI Outbound Window Base Address Register 0 */ | ||
30 | char res2[4]; | ||
31 | uint powar0; /* 0x.c10 - PCI Outbound Window Attributes Register 0 */ | ||
32 | char res3[12]; | ||
33 | uint potar1; /* 0x.c20 - PCI Outbound Transaction Address Register 1 */ | ||
34 | uint potear1; /* 0x.c24 - PCI Outbound Translation Extended Address Register 1 */ | ||
35 | uint powbar1; /* 0x.c28 - PCI Outbound Window Base Address Register 1 */ | ||
36 | char res4[4]; | ||
37 | uint powar1; /* 0x.c30 - PCI Outbound Window Attributes Register 1 */ | ||
38 | char res5[12]; | ||
39 | uint potar2; /* 0x.c40 - PCI Outbound Transaction Address Register 2 */ | ||
40 | uint potear2; /* 0x.c44 - PCI Outbound Translation Extended Address Register 2 */ | ||
41 | uint powbar2; /* 0x.c48 - PCI Outbound Window Base Address Register 2 */ | ||
42 | char res6[4]; | ||
43 | uint powar2; /* 0x.c50 - PCI Outbound Window Attributes Register 2 */ | ||
44 | char res7[12]; | ||
45 | uint potar3; /* 0x.c60 - PCI Outbound Transaction Address Register 3 */ | ||
46 | uint potear3; /* 0x.c64 - PCI Outbound Translation Extended Address Register 3 */ | ||
47 | uint powbar3; /* 0x.c68 - PCI Outbound Window Base Address Register 3 */ | ||
48 | char res8[4]; | ||
49 | uint powar3; /* 0x.c70 - PCI Outbound Window Attributes Register 3 */ | ||
50 | char res9[12]; | ||
51 | uint potar4; /* 0x.c80 - PCI Outbound Transaction Address Register 4 */ | ||
52 | uint potear4; /* 0x.c84 - PCI Outbound Translation Extended Address Register 4 */ | ||
53 | uint powbar4; /* 0x.c88 - PCI Outbound Window Base Address Register 4 */ | ||
54 | char res10[4]; | ||
55 | uint powar4; /* 0x.c90 - PCI Outbound Window Attributes Register 4 */ | ||
56 | char res11[268]; | ||
57 | uint pitar3; /* 0x.da0 - PCI Inbound Translation Address Register 3 */ | ||
58 | char res12[4]; | ||
59 | uint piwbar3; /* 0x.da8 - PCI Inbound Window Base Address Register 3 */ | ||
60 | uint piwbear3; /* 0x.dac - PCI Inbound Window Base Extended Address Register 3 */ | ||
61 | uint piwar3; /* 0x.db0 - PCI Inbound Window Attributes Register 3 */ | ||
62 | char res13[12]; | ||
63 | uint pitar2; /* 0x.dc0 - PCI Inbound Translation Address Register 2 */ | ||
64 | char res14[4]; | ||
65 | uint piwbar2; /* 0x.dc8 - PCI Inbound Window Base Address Register 2 */ | ||
66 | uint piwbear2; /* 0x.dcc - PCI Inbound Window Base Extended Address Register 2 */ | ||
67 | uint piwar2; /* 0x.dd0 - PCI Inbound Window Attributes Register 2 */ | ||
68 | char res15[12]; | ||
69 | uint pitar1; /* 0x.de0 - PCI Inbound Translation Address Register 1 */ | ||
70 | char res16[4]; | ||
71 | uint piwbar1; /* 0x.de8 - PCI Inbound Window Base Address Register 1 */ | ||
72 | char res17[4]; | ||
73 | uint piwar1; /* 0x.df0 - PCI Inbound Window Attributes Register 1 */ | ||
74 | char res18[12]; | ||
75 | uint err_dr; /* 0x.e00 - PCI Error Detect Register */ | ||
76 | uint err_cap_dr; /* 0x.e04 - PCI Error Capture Disable Register */ | ||
77 | uint err_en; /* 0x.e08 - PCI Error Enable Register */ | ||
78 | uint err_attrib; /* 0x.e0c - PCI Error Attributes Capture Register */ | ||
79 | uint err_addr; /* 0x.e10 - PCI Error Address Capture Register */ | ||
80 | uint err_ext_addr; /* 0x.e14 - PCI Error Extended Address Capture Register */ | ||
81 | uint err_dl; /* 0x.e18 - PCI Error Data Low Capture Register */ | ||
82 | uint err_dh; /* 0x.e1c - PCI Error Data High Capture Register */ | ||
83 | uint gas_timr; /* 0x.e20 - PCI Gasket Timer Register */ | ||
84 | uint pci_timr; /* 0x.e24 - PCI Timer Register */ | ||
85 | char res19[472]; | ||
86 | } ccsr_pci_t; | ||
87 | |||
88 | /* PCI Express Registers */ | ||
89 | typedef struct ccsr_pex { | ||
90 | uint pex_config_addr; /* 0x.000 - PCI Express Configuration Address Register */ | ||
91 | uint pex_config_data; /* 0x.004 - PCI Express Configuration Data Register */ | ||
92 | char res1[4]; | ||
93 | uint pex_otb_cpl_tor; /* 0x.00c - PCI Express Outbound completion timeout register */ | ||
94 | uint pex_conf_tor; /* 0x.010 - PCI Express configuration timeout register */ | ||
95 | char res2[12]; | ||
96 | uint pex_pme_mes_dr; /* 0x.020 - PCI Express PME and message detect register */ | ||
97 | uint pex_pme_mes_disr; /* 0x.024 - PCI Express PME and message disable register */ | ||
98 | uint pex_pme_mes_ier; /* 0x.028 - PCI Express PME and message interrupt enable register */ | ||
99 | uint pex_pmcr; /* 0x.02c - PCI Express power management command register */ | ||
100 | char res3[3024]; | ||
101 | uint pexotar0; /* 0x.c00 - PCI Express outbound translation address register 0 */ | ||
102 | uint pexotear0; /* 0x.c04 - PCI Express outbound translation extended address register 0*/ | ||
103 | char res4[8]; | ||
104 | uint pexowar0; /* 0x.c10 - PCI Express outbound window attributes register 0*/ | ||
105 | char res5[12]; | ||
106 | uint pexotar1; /* 0x.c20 - PCI Express outbound translation address register 1 */ | ||
107 | uint pexotear1; /* 0x.c24 - PCI Express outbound translation extended address register 1*/ | ||
108 | uint pexowbar1; /* 0x.c28 - PCI Express outbound window base address register 1*/ | ||
109 | char res6[4]; | ||
110 | uint pexowar1; /* 0x.c30 - PCI Express outbound window attributes register 1*/ | ||
111 | char res7[12]; | ||
112 | uint pexotar2; /* 0x.c40 - PCI Express outbound translation address register 2 */ | ||
113 | uint pexotear2; /* 0x.c44 - PCI Express outbound translation extended address register 2*/ | ||
114 | uint pexowbar2; /* 0x.c48 - PCI Express outbound window base address register 2*/ | ||
115 | char res8[4]; | ||
116 | uint pexowar2; /* 0x.c50 - PCI Express outbound window attributes register 2*/ | ||
117 | char res9[12]; | ||
118 | uint pexotar3; /* 0x.c60 - PCI Express outbound translation address register 3 */ | ||
119 | uint pexotear3; /* 0x.c64 - PCI Express outbound translation extended address register 3*/ | ||
120 | uint pexowbar3; /* 0x.c68 - PCI Express outbound window base address register 3*/ | ||
121 | char res10[4]; | ||
122 | uint pexowar3; /* 0x.c70 - PCI Express outbound window attributes register 3*/ | ||
123 | char res11[12]; | ||
124 | uint pexotar4; /* 0x.c80 - PCI Express outbound translation address register 4 */ | ||
125 | uint pexotear4; /* 0x.c84 - PCI Express outbound translation extended address register 4*/ | ||
126 | uint pexowbar4; /* 0x.c88 - PCI Express outbound window base address register 4*/ | ||
127 | char res12[4]; | ||
128 | uint pexowar4; /* 0x.c90 - PCI Express outbound window attributes register 4*/ | ||
129 | char res13[12]; | ||
130 | char res14[256]; | ||
131 | uint pexitar3; /* 0x.da0 - PCI Express inbound translation address register 3 */ | ||
132 | char res15[4]; | ||
133 | uint pexiwbar3; /* 0x.da8 - PCI Express inbound window base address register 3 */ | ||
134 | uint pexiwbear3; /* 0x.dac - PCI Express inbound window base extended address register 3 */ | ||
135 | uint pexiwar3; /* 0x.db0 - PCI Express inbound window attributes register 3 */ | ||
136 | char res16[12]; | ||
137 | uint pexitar2; /* 0x.dc0 - PCI Express inbound translation address register 2 */ | ||
138 | char res17[4]; | ||
139 | uint pexiwbar2; /* 0x.dc8 - PCI Express inbound window base address register 2 */ | ||
140 | uint pexiwbear2; /* 0x.dcc - PCI Express inbound window base extended address register 2 */ | ||
141 | uint pexiwar2; /* 0x.dd0 - PCI Express inbound window attributes register 2 */ | ||
142 | char res18[12]; | ||
143 | uint pexitar1; /* 0x.de0 - PCI Express inbound translation address register 2 */ | ||
144 | char res19[4]; | ||
145 | uint pexiwbar1; /* 0x.de8 - PCI Express inbound window base address register 2 */ | ||
146 | uint pexiwbear1; /* 0x.dec - PCI Express inbound window base extended address register 2 */ | ||
147 | uint pexiwar1; /* 0x.df0 - PCI Express inbound window attributes register 2 */ | ||
148 | char res20[12]; | ||
149 | uint pex_err_dr; /* 0x.e00 - PCI Express error detect register */ | ||
150 | char res21[4]; | ||
151 | uint pex_err_en; /* 0x.e08 - PCI Express error interrupt enable register */ | ||
152 | char res22[4]; | ||
153 | uint pex_err_disr; /* 0x.e10 - PCI Express error disable register */ | ||
154 | char res23[12]; | ||
155 | uint pex_err_cap_stat; /* 0x.e20 - PCI Express error capture status register */ | ||
156 | char res24[4]; | ||
157 | uint pex_err_cap_r0; /* 0x.e28 - PCI Express error capture register 0 */ | ||
158 | uint pex_err_cap_r1; /* 0x.e2c - PCI Express error capture register 0 */ | ||
159 | uint pex_err_cap_r2; /* 0x.e30 - PCI Express error capture register 0 */ | ||
160 | uint pex_err_cap_r3; /* 0x.e34 - PCI Express error capture register 0 */ | ||
161 | } ccsr_pex_t; | ||
162 | |||
163 | /* Global Utility Registers */ | ||
164 | typedef struct ccsr_guts { | ||
165 | uint porpllsr; /* 0x.0000 - POR PLL Ratio Status Register */ | ||
166 | uint porbmsr; /* 0x.0004 - POR Boot Mode Status Register */ | ||
167 | uint porimpscr; /* 0x.0008 - POR I/O Impedance Status and Control Register */ | ||
168 | uint pordevsr; /* 0x.000c - POR I/O Device Status Register */ | ||
169 | uint pordbgmsr; /* 0x.0010 - POR Debug Mode Status Register */ | ||
170 | char res1[12]; | ||
171 | uint gpporcr; /* 0x.0020 - General-Purpose POR Configuration Register */ | ||
172 | char res2[12]; | ||
173 | uint gpiocr; /* 0x.0030 - GPIO Control Register */ | ||
174 | char res3[12]; | ||
175 | uint gpoutdr; /* 0x.0040 - General-Purpose Output Data Register */ | ||
176 | char res4[12]; | ||
177 | uint gpindr; /* 0x.0050 - General-Purpose Input Data Register */ | ||
178 | char res5[12]; | ||
179 | uint pmuxcr; /* 0x.0060 - Alternate Function Signal Multiplex Control */ | ||
180 | char res6[12]; | ||
181 | uint devdisr; /* 0x.0070 - Device Disable Control */ | ||
182 | char res7[12]; | ||
183 | uint powmgtcsr; /* 0x.0080 - Power Management Status and Control Register */ | ||
184 | char res8[12]; | ||
185 | uint mcpsumr; /* 0x.0090 - Machine Check Summary Register */ | ||
186 | char res9[12]; | ||
187 | uint pvr; /* 0x.00a0 - Processor Version Register */ | ||
188 | uint svr; /* 0x.00a4 - System Version Register */ | ||
189 | char res10[3416]; | ||
190 | uint clkocr; /* 0x.0e00 - Clock Out Select Register */ | ||
191 | char res11[12]; | ||
192 | uint ddrdllcr; /* 0x.0e10 - DDR DLL Control Register */ | ||
193 | char res12[12]; | ||
194 | uint lbcdllcr; /* 0x.0e20 - LBC DLL Control Register */ | ||
195 | char res13[61916]; | ||
196 | } ccsr_guts_t; | ||
197 | |||
198 | #endif /* __ASM_POWERPC_IMMAP_86XX_H__ */ | ||
199 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index f1c2469b8844..a9496f34b048 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
@@ -40,12 +40,6 @@ extern int check_legacy_ioport(unsigned long base_port); | |||
40 | 40 | ||
41 | extern unsigned long isa_io_base; | 41 | extern unsigned long isa_io_base; |
42 | extern unsigned long pci_io_base; | 42 | extern unsigned long pci_io_base; |
43 | extern unsigned long io_page_mask; | ||
44 | |||
45 | #define MAX_ISA_PORT 0x10000 | ||
46 | |||
47 | #define _IO_IS_VALID(port) ((port) >= MAX_ISA_PORT || (1 << (port>>PAGE_SHIFT)) \ | ||
48 | & io_page_mask) | ||
49 | 43 | ||
50 | #ifdef CONFIG_PPC_ISERIES | 44 | #ifdef CONFIG_PPC_ISERIES |
51 | /* __raw_* accessors aren't supported on iSeries */ | 45 | /* __raw_* accessors aren't supported on iSeries */ |
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h index 2acf7b29ef06..a5e98641a2ae 100644 --- a/include/asm-powerpc/iommu.h +++ b/include/asm-powerpc/iommu.h | |||
@@ -66,7 +66,8 @@ extern void iommu_free_table(struct device_node *dn); | |||
66 | /* Initializes an iommu_table based in values set in the passed-in | 66 | /* Initializes an iommu_table based in values set in the passed-in |
67 | * structure | 67 | * structure |
68 | */ | 68 | */ |
69 | extern struct iommu_table *iommu_init_table(struct iommu_table * tbl); | 69 | extern struct iommu_table *iommu_init_table(struct iommu_table * tbl, |
70 | int nid); | ||
70 | 71 | ||
71 | extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl, | 72 | extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl, |
72 | struct scatterlist *sglist, int nelems, unsigned long mask, | 73 | struct scatterlist *sglist, int nelems, unsigned long mask, |
@@ -75,7 +76,8 @@ extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
75 | int nelems, enum dma_data_direction direction); | 76 | int nelems, enum dma_data_direction direction); |
76 | 77 | ||
77 | extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, | 78 | extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, |
78 | dma_addr_t *dma_handle, unsigned long mask, gfp_t flag); | 79 | dma_addr_t *dma_handle, unsigned long mask, |
80 | gfp_t flag, int node); | ||
79 | extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, | 81 | extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, |
80 | void *vaddr, dma_addr_t dma_handle); | 82 | void *vaddr, dma_addr_t dma_handle); |
81 | extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, | 83 | extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, |
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index 1e9f25330307..a10feec29d4d 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h | |||
@@ -347,6 +347,92 @@ extern u64 ppc64_interrupt_controller; | |||
347 | #define SIU_INT_PC1 ((uint)0x3e+CPM_IRQ_OFFSET) | 347 | #define SIU_INT_PC1 ((uint)0x3e+CPM_IRQ_OFFSET) |
348 | #define SIU_INT_PC0 ((uint)0x3f+CPM_IRQ_OFFSET) | 348 | #define SIU_INT_PC0 ((uint)0x3f+CPM_IRQ_OFFSET) |
349 | 349 | ||
350 | #elif defined(CONFIG_PPC_86xx) | ||
351 | #include <asm/mpc86xx.h> | ||
352 | |||
353 | #define NR_EPIC_INTS 48 | ||
354 | #ifndef NR_8259_INTS | ||
355 | #define NR_8259_INTS 16 /*ULI 1575 can route 12 interrupts */ | ||
356 | #endif | ||
357 | #define NUM_8259_INTERRUPTS NR_8259_INTS | ||
358 | |||
359 | #ifndef I8259_OFFSET | ||
360 | #define I8259_OFFSET 0 | ||
361 | #endif | ||
362 | |||
363 | #define NR_IRQS 256 | ||
364 | |||
365 | /* Internal IRQs on MPC86xx OpenPIC */ | ||
366 | |||
367 | #ifndef MPC86xx_OPENPIC_IRQ_OFFSET | ||
368 | #define MPC86xx_OPENPIC_IRQ_OFFSET NR_8259_INTS | ||
369 | #endif | ||
370 | |||
371 | /* The 48 internal sources */ | ||
372 | #define MPC86xx_IRQ_NULL ( 0 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
373 | #define MPC86xx_IRQ_MCM ( 1 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
374 | #define MPC86xx_IRQ_DDR ( 2 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
375 | #define MPC86xx_IRQ_LBC ( 3 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
376 | #define MPC86xx_IRQ_DMA0 ( 4 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
377 | #define MPC86xx_IRQ_DMA1 ( 5 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
378 | #define MPC86xx_IRQ_DMA2 ( 6 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
379 | #define MPC86xx_IRQ_DMA3 ( 7 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
380 | |||
381 | /* no 10,11 */ | ||
382 | #define MPC86xx_IRQ_UART2 (12 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
383 | #define MPC86xx_IRQ_TSEC1_TX (13 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
384 | #define MPC86xx_IRQ_TSEC1_RX (14 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
385 | #define MPC86xx_IRQ_TSEC3_TX (15 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
386 | #define MPC86xx_IRQ_TSEC3_RX (16 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
387 | #define MPC86xx_IRQ_TSEC3_ERROR (17 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
388 | #define MPC86xx_IRQ_TSEC1_ERROR (18 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
389 | #define MPC86xx_IRQ_TSEC2_TX (19 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
390 | #define MPC86xx_IRQ_TSEC2_RX (20 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
391 | #define MPC86xx_IRQ_TSEC4_TX (21 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
392 | #define MPC86xx_IRQ_TSEC4_RX (22 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
393 | #define MPC86xx_IRQ_TSEC4_ERROR (23 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
394 | #define MPC86xx_IRQ_TSEC2_ERROR (24 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
395 | /* no 25 */ | ||
396 | #define MPC86xx_IRQ_UART1 (26 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
397 | #define MPC86xx_IRQ_IIC (27 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
398 | #define MPC86xx_IRQ_PERFMON (28 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
399 | /* no 29,30,31 */ | ||
400 | #define MPC86xx_IRQ_SRIO_ERROR (32 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
401 | #define MPC86xx_IRQ_SRIO_OUT_BELL (33 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
402 | #define MPC86xx_IRQ_SRIO_IN_BELL (34 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
403 | /* no 35,36 */ | ||
404 | #define MPC86xx_IRQ_SRIO_OUT_MSG1 (37 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
405 | #define MPC86xx_IRQ_SRIO_IN_MSG1 (38 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
406 | #define MPC86xx_IRQ_SRIO_OUT_MSG2 (39 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
407 | #define MPC86xx_IRQ_SRIO_IN_MSG2 (40 + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
408 | |||
409 | /* The 12 external interrupt lines */ | ||
410 | #define MPC86xx_IRQ_EXT_BASE 48 | ||
411 | #define MPC86xx_IRQ_EXT0 (0 + MPC86xx_IRQ_EXT_BASE \ | ||
412 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
413 | #define MPC86xx_IRQ_EXT1 (1 + MPC86xx_IRQ_EXT_BASE \ | ||
414 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
415 | #define MPC86xx_IRQ_EXT2 (2 + MPC86xx_IRQ_EXT_BASE \ | ||
416 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
417 | #define MPC86xx_IRQ_EXT3 (3 + MPC86xx_IRQ_EXT_BASE \ | ||
418 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
419 | #define MPC86xx_IRQ_EXT4 (4 + MPC86xx_IRQ_EXT_BASE \ | ||
420 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
421 | #define MPC86xx_IRQ_EXT5 (5 + MPC86xx_IRQ_EXT_BASE \ | ||
422 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
423 | #define MPC86xx_IRQ_EXT6 (6 + MPC86xx_IRQ_EXT_BASE \ | ||
424 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
425 | #define MPC86xx_IRQ_EXT7 (7 + MPC86xx_IRQ_EXT_BASE \ | ||
426 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
427 | #define MPC86xx_IRQ_EXT8 (8 + MPC86xx_IRQ_EXT_BASE \ | ||
428 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
429 | #define MPC86xx_IRQ_EXT9 (9 + MPC86xx_IRQ_EXT_BASE \ | ||
430 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
431 | #define MPC86xx_IRQ_EXT10 (10 + MPC86xx_IRQ_EXT_BASE \ | ||
432 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
433 | #define MPC86xx_IRQ_EXT11 (11 + MPC86xx_IRQ_EXT_BASE \ | ||
434 | + MPC86xx_OPENPIC_IRQ_OFFSET) | ||
435 | |||
350 | #else /* CONFIG_40x + CONFIG_8xx */ | 436 | #else /* CONFIG_40x + CONFIG_8xx */ |
351 | /* | 437 | /* |
352 | * this is the # irq's for all ppc arch's (pmac/chrp/prep) | 438 | * this is the # irq's for all ppc arch's (pmac/chrp/prep) |
diff --git a/include/asm-powerpc/iseries/iommu.h b/include/asm-powerpc/iseries/iommu.h new file mode 100644 index 000000000000..0edbfe10cb37 --- /dev/null +++ b/include/asm-powerpc/iseries/iommu.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef _ASM_POWERPC_ISERIES_IOMMU_H | ||
2 | #define _ASM_POWERPC_ISERIES_IOMMU_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2005 Stephen Rothwell, IBM Corporation | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the: | ||
19 | * Free Software Foundation, Inc., | ||
20 | * 59 Temple Place, Suite 330, | ||
21 | * Boston, MA 02111-1307 USA | ||
22 | */ | ||
23 | |||
24 | struct device_node; | ||
25 | struct iommu_table; | ||
26 | |||
27 | /* Creates table for an individual device node */ | ||
28 | extern void iommu_devnode_init_iSeries(struct device_node *dn); | ||
29 | |||
30 | /* Get table parameters from HV */ | ||
31 | extern void iommu_table_getparms_iSeries(unsigned long busno, | ||
32 | unsigned char slotno, unsigned char virtbus, | ||
33 | struct iommu_table *tbl); | ||
34 | |||
35 | #endif /* _ASM_POWERPC_ISERIES_IOMMU_H */ | ||
diff --git a/include/asm-powerpc/kdump.h b/include/asm-powerpc/kdump.h index a87aed00d61f..5a5c3b5ab1e0 100644 --- a/include/asm-powerpc/kdump.h +++ b/include/asm-powerpc/kdump.h | |||
@@ -1,13 +1,38 @@ | |||
1 | #ifndef _PPC64_KDUMP_H | 1 | #ifndef _PPC64_KDUMP_H |
2 | #define _PPC64_KDUMP_H | 2 | #define _PPC64_KDUMP_H |
3 | 3 | ||
4 | /* Kdump kernel runs at 32 MB, change at your peril. */ | ||
5 | #define KDUMP_KERNELBASE 0x2000000 | ||
6 | |||
4 | /* How many bytes to reserve at zero for kdump. The reserve limit should | 7 | /* How many bytes to reserve at zero for kdump. The reserve limit should |
5 | * be greater or equal to the trampoline's end address. */ | 8 | * be greater or equal to the trampoline's end address. |
9 | * Reserve to the end of the FWNMI area, see head_64.S */ | ||
6 | #define KDUMP_RESERVE_LIMIT 0x8000 | 10 | #define KDUMP_RESERVE_LIMIT 0x8000 |
7 | 11 | ||
12 | #ifdef CONFIG_CRASH_DUMP | ||
13 | |||
14 | #define PHYSICAL_START KDUMP_KERNELBASE | ||
8 | #define KDUMP_TRAMPOLINE_START 0x0100 | 15 | #define KDUMP_TRAMPOLINE_START 0x0100 |
9 | #define KDUMP_TRAMPOLINE_END 0x3000 | 16 | #define KDUMP_TRAMPOLINE_END 0x3000 |
10 | 17 | ||
11 | extern void kdump_setup(void); | 18 | #else /* !CONFIG_CRASH_DUMP */ |
19 | |||
20 | #define PHYSICAL_START 0x0 | ||
21 | |||
22 | #endif /* CONFIG_CRASH_DUMP */ | ||
23 | |||
24 | #ifndef __ASSEMBLY__ | ||
25 | #ifdef CONFIG_CRASH_DUMP | ||
26 | |||
27 | extern void reserve_kdump_trampoline(void); | ||
28 | extern void setup_kdump_trampoline(void); | ||
29 | |||
30 | #else /* !CONFIG_CRASH_DUMP */ | ||
31 | |||
32 | static inline void reserve_kdump_trampoline(void) { ; } | ||
33 | static inline void setup_kdump_trampoline(void) { ; } | ||
34 | |||
35 | #endif /* CONFIG_CRASH_DUMP */ | ||
36 | #endif /* __ASSEMBLY__ */ | ||
12 | 37 | ||
13 | #endif /* __PPC64_KDUMP_H */ | 38 | #endif /* __PPC64_KDUMP_H */ |
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h index 6a2af2f6853b..efe8872ec583 100644 --- a/include/asm-powerpc/kexec.h +++ b/include/asm-powerpc/kexec.h | |||
@@ -31,9 +31,10 @@ | |||
31 | #define KEXEC_ARCH KEXEC_ARCH_PPC | 31 | #define KEXEC_ARCH KEXEC_ARCH_PPC |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #ifndef __ASSEMBLY__ | ||
35 | |||
34 | #ifdef CONFIG_KEXEC | 36 | #ifdef CONFIG_KEXEC |
35 | 37 | ||
36 | #ifndef __ASSEMBLY__ | ||
37 | #ifdef __powerpc64__ | 38 | #ifdef __powerpc64__ |
38 | /* | 39 | /* |
39 | * This function is responsible for capturing register states if coming | 40 | * This function is responsible for capturing register states if coming |
@@ -123,8 +124,19 @@ extern int default_machine_kexec_prepare(struct kimage *image); | |||
123 | extern void default_machine_crash_shutdown(struct pt_regs *regs); | 124 | extern void default_machine_crash_shutdown(struct pt_regs *regs); |
124 | 125 | ||
125 | extern void machine_kexec_simple(struct kimage *image); | 126 | extern void machine_kexec_simple(struct kimage *image); |
127 | extern int overlaps_crashkernel(unsigned long start, unsigned long size); | ||
128 | extern void reserve_crashkernel(void); | ||
129 | |||
130 | #else /* !CONFIG_KEXEC */ | ||
131 | |||
132 | static inline int overlaps_crashkernel(unsigned long start, unsigned long size) | ||
133 | { | ||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | static inline void reserve_crashkernel(void) { ; } | ||
126 | 138 | ||
127 | #endif /* ! __ASSEMBLY__ */ | ||
128 | #endif /* CONFIG_KEXEC */ | 139 | #endif /* CONFIG_KEXEC */ |
140 | #endif /* ! __ASSEMBLY__ */ | ||
129 | #endif /* __KERNEL__ */ | 141 | #endif /* __KERNEL__ */ |
130 | #endif /* _ASM_POWERPC_KEXEC_H */ | 142 | #endif /* _ASM_POWERPC_KEXEC_H */ |
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index 3e7d37aa4a6d..73db1f71329d 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h | |||
@@ -237,6 +237,11 @@ struct machdep_calls { | |||
237 | */ | 237 | */ |
238 | void (*machine_kexec)(struct kimage *image); | 238 | void (*machine_kexec)(struct kimage *image); |
239 | #endif /* CONFIG_KEXEC */ | 239 | #endif /* CONFIG_KEXEC */ |
240 | |||
241 | #ifdef CONFIG_PCI_MSI | ||
242 | int (*enable_msi)(struct pci_dev *pdev); | ||
243 | void (*disable_msi)(struct pci_dev *pdev); | ||
244 | #endif /* CONFIG_PCI_MSI */ | ||
240 | }; | 245 | }; |
241 | 246 | ||
242 | extern void power4_idle(void); | 247 | extern void power4_idle(void); |
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h index 31f721994bd8..3a5ebe229af5 100644 --- a/include/asm-powerpc/mmu.h +++ b/include/asm-powerpc/mmu.h | |||
@@ -96,6 +96,8 @@ extern char initial_stab[]; | |||
96 | #define HPTE_R_FLAGS ASM_CONST(0x00000000000003ff) | 96 | #define HPTE_R_FLAGS ASM_CONST(0x00000000000003ff) |
97 | #define HPTE_R_PP ASM_CONST(0x0000000000000003) | 97 | #define HPTE_R_PP ASM_CONST(0x0000000000000003) |
98 | #define HPTE_R_N ASM_CONST(0x0000000000000004) | 98 | #define HPTE_R_N ASM_CONST(0x0000000000000004) |
99 | #define HPTE_R_C ASM_CONST(0x0000000000000080) | ||
100 | #define HPTE_R_R ASM_CONST(0x0000000000000100) | ||
99 | 101 | ||
100 | /* Values for PP (assumes Ks=0, Kp=1) */ | 102 | /* Values for PP (assumes Ks=0, Kp=1) */ |
101 | /* pp0 will always be 0 for linux */ | 103 | /* pp0 will always be 0 for linux */ |
@@ -163,6 +165,16 @@ struct mmu_psize_def | |||
163 | extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; | 165 | extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; |
164 | extern int mmu_linear_psize; | 166 | extern int mmu_linear_psize; |
165 | extern int mmu_virtual_psize; | 167 | extern int mmu_virtual_psize; |
168 | extern int mmu_vmalloc_psize; | ||
169 | extern int mmu_io_psize; | ||
170 | |||
171 | /* | ||
172 | * If the processor supports 64k normal pages but not 64k cache | ||
173 | * inhibited pages, we have to be prepared to switch processes | ||
174 | * to use 4k pages when they create cache-inhibited mappings. | ||
175 | * If this is the case, mmu_ci_restrictions will be set to 1. | ||
176 | */ | ||
177 | extern int mmu_ci_restrictions; | ||
166 | 178 | ||
167 | #ifdef CONFIG_HUGETLB_PAGE | 179 | #ifdef CONFIG_HUGETLB_PAGE |
168 | /* | 180 | /* |
@@ -254,6 +266,7 @@ extern long iSeries_hpte_insert(unsigned long hpte_group, | |||
254 | 266 | ||
255 | extern void stabs_alloc(void); | 267 | extern void stabs_alloc(void); |
256 | extern void slb_initialize(void); | 268 | extern void slb_initialize(void); |
269 | extern void slb_flush_and_rebolt(void); | ||
257 | extern void stab_initialize(unsigned long stab); | 270 | extern void stab_initialize(unsigned long stab); |
258 | 271 | ||
259 | #endif /* __ASSEMBLY__ */ | 272 | #endif /* __ASSEMBLY__ */ |
@@ -357,9 +370,12 @@ typedef unsigned long mm_context_id_t; | |||
357 | 370 | ||
358 | typedef struct { | 371 | typedef struct { |
359 | mm_context_id_t id; | 372 | mm_context_id_t id; |
373 | u16 user_psize; /* page size index */ | ||
374 | u16 sllp; /* SLB entry page size encoding */ | ||
360 | #ifdef CONFIG_HUGETLB_PAGE | 375 | #ifdef CONFIG_HUGETLB_PAGE |
361 | u16 low_htlb_areas, high_htlb_areas; | 376 | u16 low_htlb_areas, high_htlb_areas; |
362 | #endif | 377 | #endif |
378 | unsigned long vdso_base; | ||
363 | } mm_context_t; | 379 | } mm_context_t; |
364 | 380 | ||
365 | 381 | ||
diff --git a/include/asm-powerpc/mmu_context.h b/include/asm-powerpc/mmu_context.h index 1b8a25fd48f3..8c6b1a6d944f 100644 --- a/include/asm-powerpc/mmu_context.h +++ b/include/asm-powerpc/mmu_context.h | |||
@@ -20,16 +20,9 @@ | |||
20 | * 2 of the License, or (at your option) any later version. | 20 | * 2 of the License, or (at your option) any later version. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | /* | ||
24 | * Getting into a kernel thread, there is no valid user segment, mark | ||
25 | * paca->pgdir NULL so that SLB miss on user addresses will fault | ||
26 | */ | ||
27 | static inline void enter_lazy_tlb(struct mm_struct *mm, | 23 | static inline void enter_lazy_tlb(struct mm_struct *mm, |
28 | struct task_struct *tsk) | 24 | struct task_struct *tsk) |
29 | { | 25 | { |
30 | #ifdef CONFIG_PPC_64K_PAGES | ||
31 | get_paca()->pgdir = NULL; | ||
32 | #endif /* CONFIG_PPC_64K_PAGES */ | ||
33 | } | 26 | } |
34 | 27 | ||
35 | #define NO_CONTEXT 0 | 28 | #define NO_CONTEXT 0 |
@@ -52,13 +45,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
52 | cpu_set(smp_processor_id(), next->cpu_vm_mask); | 45 | cpu_set(smp_processor_id(), next->cpu_vm_mask); |
53 | 46 | ||
54 | /* No need to flush userspace segments if the mm doesnt change */ | 47 | /* No need to flush userspace segments if the mm doesnt change */ |
55 | #ifdef CONFIG_PPC_64K_PAGES | ||
56 | if (prev == next && get_paca()->pgdir == next->pgd) | ||
57 | return; | ||
58 | #else | ||
59 | if (prev == next) | 48 | if (prev == next) |
60 | return; | 49 | return; |
61 | #endif /* CONFIG_PPC_64K_PAGES */ | ||
62 | 50 | ||
63 | #ifdef CONFIG_ALTIVEC | 51 | #ifdef CONFIG_ALTIVEC |
64 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) | 52 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) |
diff --git a/include/asm-powerpc/mpc86xx.h b/include/asm-powerpc/mpc86xx.h new file mode 100644 index 000000000000..d0a6718d188b --- /dev/null +++ b/include/asm-powerpc/mpc86xx.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * MPC86xx definitions | ||
3 | * | ||
4 | * Author: Jeff Brown | ||
5 | * | ||
6 | * Copyright 2004 Freescale Semiconductor, Inc | ||
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 | #ifdef __KERNEL__ | ||
15 | #ifndef __ASM_POWERPC_MPC86xx_H__ | ||
16 | #define __ASM_POWERPC_MPC86xx_H__ | ||
17 | |||
18 | #include <linux/config.h> | ||
19 | #include <asm/mmu.h> | ||
20 | |||
21 | #ifdef CONFIG_PPC_86xx | ||
22 | |||
23 | #ifdef CONFIG_MPC8641_HPCN | ||
24 | #include <platforms/86xx/mpc8641_hpcn.h> | ||
25 | #endif | ||
26 | |||
27 | #define _IO_BASE isa_io_base | ||
28 | #define _ISA_MEM_BASE isa_mem_base | ||
29 | #ifdef CONFIG_PCI | ||
30 | #define PCI_DRAM_OFFSET pci_dram_offset | ||
31 | #else | ||
32 | #define PCI_DRAM_OFFSET 0 | ||
33 | #endif | ||
34 | |||
35 | #define CPU0_BOOT_RELEASE 0x01000000 | ||
36 | #define CPU1_BOOT_RELEASE 0x02000000 | ||
37 | #define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE) | ||
38 | #define MCM_PORT_CONFIG_OFFSET 0x1010 | ||
39 | |||
40 | /* Offset from CCSRBAR */ | ||
41 | #define MPC86xx_OPENPIC_OFFSET (0x40000) | ||
42 | #define MPC86xx_MCM_OFFSET (0x00000) | ||
43 | #define MPC86xx_MCM_SIZE (0x02000) | ||
44 | |||
45 | #endif /* CONFIG_PPC_86xx */ | ||
46 | #endif /* __ASM_POWERPC_MPC86xx_H__ */ | ||
47 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h index 6b9e78142f4f..f0d22ac34b96 100644 --- a/include/asm-powerpc/mpic.h +++ b/include/asm-powerpc/mpic.h | |||
@@ -22,6 +22,10 @@ | |||
22 | #define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 | 22 | #define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 |
23 | #define MPIC_GREG_GCONF_BASE_MASK 0x000fffff | 23 | #define MPIC_GREG_GCONF_BASE_MASK 0x000fffff |
24 | #define MPIC_GREG_GLOBAL_CONF_1 0x00030 | 24 | #define MPIC_GREG_GLOBAL_CONF_1 0x00030 |
25 | #define MPIC_GREG_GLOBAL_CONF_1_SIE 0x08000000 | ||
26 | #define MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK 0x70000000 | ||
27 | #define MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(r) \ | ||
28 | (((r) << 28) & MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK) | ||
25 | #define MPIC_GREG_VENDOR_0 0x00040 | 29 | #define MPIC_GREG_VENDOR_0 0x00040 |
26 | #define MPIC_GREG_VENDOR_1 0x00050 | 30 | #define MPIC_GREG_VENDOR_1 0x00050 |
27 | #define MPIC_GREG_VENDOR_2 0x00060 | 31 | #define MPIC_GREG_VENDOR_2 0x00060 |
@@ -284,6 +288,12 @@ extern int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs); | |||
284 | /* This one gets to the primary mpic */ | 288 | /* This one gets to the primary mpic */ |
285 | extern int mpic_get_irq(struct pt_regs *regs); | 289 | extern int mpic_get_irq(struct pt_regs *regs); |
286 | 290 | ||
291 | /* Set the EPIC clock ratio */ | ||
292 | void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); | ||
293 | |||
294 | /* Enable/Disable EPIC serial interrupt mode */ | ||
295 | void mpic_set_serial_int(struct mpic *mpic, int enable); | ||
296 | |||
287 | /* global mpic for pSeries */ | 297 | /* global mpic for pSeries */ |
288 | extern struct mpic *pSeries_mpic; | 298 | extern struct mpic *pSeries_mpic; |
289 | 299 | ||
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h index 3c6f644d49b4..2d4585f06209 100644 --- a/include/asm-powerpc/paca.h +++ b/include/asm-powerpc/paca.h | |||
@@ -78,11 +78,9 @@ struct paca_struct { | |||
78 | u64 exmc[10]; /* used for machine checks */ | 78 | u64 exmc[10]; /* used for machine checks */ |
79 | u64 exslb[10]; /* used for SLB/segment table misses | 79 | u64 exslb[10]; /* used for SLB/segment table misses |
80 | * on the linear mapping */ | 80 | * on the linear mapping */ |
81 | #ifdef CONFIG_PPC_64K_PAGES | ||
82 | pgd_t *pgdir; | ||
83 | #endif /* CONFIG_PPC_64K_PAGES */ | ||
84 | 81 | ||
85 | mm_context_t context; | 82 | mm_context_t context; |
83 | u16 vmalloc_sllp; | ||
86 | u16 slb_cache[SLB_CACHE_ENTRIES]; | 84 | u16 slb_cache[SLB_CACHE_ENTRIES]; |
87 | u16 slb_cache_ptr; | 85 | u16 slb_cache_ptr; |
88 | 86 | ||
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h index f0469b961359..fb597b37c2a2 100644 --- a/include/asm-powerpc/page.h +++ b/include/asm-powerpc/page.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | #include <asm/asm-compat.h> | 14 | #include <asm/asm-compat.h> |
15 | #include <asm/kdump.h> | ||
15 | 16 | ||
16 | /* | 17 | /* |
17 | * On PPC32 page size is 4K. For PPC64 we support either 4K or 64K software | 18 | * On PPC32 page size is 4K. For PPC64 we support either 4K or 64K software |
@@ -51,13 +52,6 @@ | |||
51 | * If you want to test if something's a kernel address, use is_kernel_addr(). | 52 | * If you want to test if something's a kernel address, use is_kernel_addr(). |
52 | */ | 53 | */ |
53 | 54 | ||
54 | #ifdef CONFIG_CRASH_DUMP | ||
55 | /* Kdump kernel runs at 32 MB, change at your peril. */ | ||
56 | #define PHYSICAL_START 0x2000000 | ||
57 | #else | ||
58 | #define PHYSICAL_START 0x0 | ||
59 | #endif | ||
60 | |||
61 | #define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) | 55 | #define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) |
62 | #define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) | 56 | #define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) |
63 | 57 | ||
@@ -197,6 +191,9 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr, | |||
197 | struct page *p); | 191 | struct page *p); |
198 | extern int page_is_ram(unsigned long pfn); | 192 | extern int page_is_ram(unsigned long pfn); |
199 | 193 | ||
194 | struct vm_area_struct; | ||
195 | extern const char *arch_vma_name(struct vm_area_struct *vma); | ||
196 | |||
200 | #include <asm-generic/memory_model.h> | 197 | #include <asm-generic/memory_model.h> |
201 | #endif /* __ASSEMBLY__ */ | 198 | #endif /* __ASSEMBLY__ */ |
202 | 199 | ||
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index 38de92d41a14..4f55573762bb 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <asm-ppc/pci-bridge.h> | 6 | #include <asm-ppc/pci-bridge.h> |
7 | #else | 7 | #else |
8 | 8 | ||
9 | #include <linux/config.h> | ||
9 | #include <linux/pci.h> | 10 | #include <linux/pci.h> |
10 | #include <linux/list.h> | 11 | #include <linux/list.h> |
11 | 12 | ||
@@ -22,6 +23,7 @@ | |||
22 | struct pci_controller { | 23 | struct pci_controller { |
23 | struct pci_bus *bus; | 24 | struct pci_bus *bus; |
24 | char is_dynamic; | 25 | char is_dynamic; |
26 | int node; | ||
25 | void *arch_data; | 27 | void *arch_data; |
26 | struct list_head list_node; | 28 | struct list_head list_node; |
27 | 29 | ||
@@ -78,12 +80,6 @@ struct pci_dn { | |||
78 | struct iommu_table *iommu_table; /* for phb's or bridges */ | 80 | struct iommu_table *iommu_table; /* for phb's or bridges */ |
79 | struct pci_dev *pcidev; /* back-pointer to the pci device */ | 81 | struct pci_dev *pcidev; /* back-pointer to the pci device */ |
80 | struct device_node *node; /* back-pointer to the device_node */ | 82 | struct device_node *node; /* back-pointer to the device_node */ |
81 | #ifdef CONFIG_PPC_ISERIES | ||
82 | struct list_head Device_List; | ||
83 | int Irq; /* Assigned IRQ */ | ||
84 | int Flags; /* Possible flags(disable/bist)*/ | ||
85 | u8 LogicalSlot; /* Hv Slot Index for Tces */ | ||
86 | #endif | ||
87 | u32 config_space[16]; /* saved PCI config space */ | 83 | u32 config_space[16]; /* saved PCI config space */ |
88 | }; | 84 | }; |
89 | 85 | ||
@@ -171,6 +167,12 @@ static inline unsigned long pci_address_to_pio(phys_addr_t address) | |||
171 | #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ | 167 | #define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */ |
172 | #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ | 168 | #define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */ |
173 | 169 | ||
170 | #ifdef CONFIG_NUMA | ||
171 | #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE)) | ||
172 | #else | ||
173 | #define PHB_SET_NODE(PHB, NODE) ((PHB)->node = -1) | ||
174 | #endif | ||
175 | |||
174 | #endif /* CONFIG_PPC64 */ | 176 | #endif /* CONFIG_PPC64 */ |
175 | #endif /* __KERNEL__ */ | 177 | #endif /* __KERNEL__ */ |
176 | #endif | 178 | #endif |
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h index b2e18629932a..e7036155672e 100644 --- a/include/asm-powerpc/pgtable-4k.h +++ b/include/asm-powerpc/pgtable-4k.h | |||
@@ -78,6 +78,8 @@ | |||
78 | 78 | ||
79 | #define pte_iterate_hashed_end() } while(0) | 79 | #define pte_iterate_hashed_end() } while(0) |
80 | 80 | ||
81 | #define pte_pagesize_index(pte) MMU_PAGE_4K | ||
82 | |||
81 | /* | 83 | /* |
82 | * 4-level page tables related bits | 84 | * 4-level page tables related bits |
83 | */ | 85 | */ |
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h index 653915014dcd..4b7126c53f37 100644 --- a/include/asm-powerpc/pgtable-64k.h +++ b/include/asm-powerpc/pgtable-64k.h | |||
@@ -90,6 +90,8 @@ | |||
90 | 90 | ||
91 | #define pte_iterate_hashed_end() } while(0); } } while(0) | 91 | #define pte_iterate_hashed_end() } while(0); } } while(0) |
92 | 92 | ||
93 | #define pte_pagesize_index(pte) \ | ||
94 | (((pte) & _PAGE_COMBO)? MMU_PAGE_4K: MMU_PAGE_64K) | ||
93 | 95 | ||
94 | #endif /* __ASSEMBLY__ */ | 96 | #endif /* __ASSEMBLY__ */ |
95 | #endif /* __KERNEL__ */ | 97 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h index 964e312a1ffc..8dbf5ad8150f 100644 --- a/include/asm-powerpc/pgtable.h +++ b/include/asm-powerpc/pgtable.h | |||
@@ -46,8 +46,8 @@ struct mm_struct; | |||
46 | /* | 46 | /* |
47 | * Define the address range of the vmalloc VM area. | 47 | * Define the address range of the vmalloc VM area. |
48 | */ | 48 | */ |
49 | #define VMALLOC_START (0xD000000000000000ul) | 49 | #define VMALLOC_START ASM_CONST(0xD000000000000000) |
50 | #define VMALLOC_SIZE (0x80000000000UL) | 50 | #define VMALLOC_SIZE ASM_CONST(0x80000000000) |
51 | #define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) | 51 | #define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) |
52 | 52 | ||
53 | /* | 53 | /* |
@@ -412,12 +412,6 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | |||
412 | flush_tlb_pending(); | 412 | flush_tlb_pending(); |
413 | } | 413 | } |
414 | pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS); | 414 | pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS); |
415 | |||
416 | #ifdef CONFIG_PPC_64K_PAGES | ||
417 | if (mmu_virtual_psize != MMU_PAGE_64K) | ||
418 | pte = __pte(pte_val(pte) | _PAGE_COMBO); | ||
419 | #endif /* CONFIG_PPC_64K_PAGES */ | ||
420 | |||
421 | *ptep = pte; | 415 | *ptep = pte; |
422 | } | 416 | } |
423 | 417 | ||
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index 93f83efeb310..22e54a2a6604 100644 --- a/include/asm-powerpc/processor.h +++ b/include/asm-powerpc/processor.h | |||
@@ -149,11 +149,11 @@ struct thread_struct { | |||
149 | unsigned int val; /* Floating point status */ | 149 | unsigned int val; /* Floating point status */ |
150 | } fpscr; | 150 | } fpscr; |
151 | int fpexc_mode; /* floating-point exception mode */ | 151 | int fpexc_mode; /* floating-point exception mode */ |
152 | unsigned int align_ctl; /* alignment handling control */ | ||
152 | #ifdef CONFIG_PPC64 | 153 | #ifdef CONFIG_PPC64 |
153 | unsigned long start_tb; /* Start purr when proc switched in */ | 154 | unsigned long start_tb; /* Start purr when proc switched in */ |
154 | unsigned long accum_tb; /* Total accumilated purr for process */ | 155 | unsigned long accum_tb; /* Total accumilated purr for process */ |
155 | #endif | 156 | #endif |
156 | unsigned long vdso_base; /* base of the vDSO library */ | ||
157 | unsigned long dabr; /* Data address breakpoint register */ | 157 | unsigned long dabr; /* Data address breakpoint register */ |
158 | #ifdef CONFIG_ALTIVEC | 158 | #ifdef CONFIG_ALTIVEC |
159 | /* Complete AltiVec register set */ | 159 | /* Complete AltiVec register set */ |
@@ -190,7 +190,7 @@ struct thread_struct { | |||
190 | .fs = KERNEL_DS, \ | 190 | .fs = KERNEL_DS, \ |
191 | .fpr = {0}, \ | 191 | .fpr = {0}, \ |
192 | .fpscr = { .val = 0, }, \ | 192 | .fpscr = { .val = 0, }, \ |
193 | .fpexc_mode = MSR_FE0|MSR_FE1, \ | 193 | .fpexc_mode = 0, \ |
194 | } | 194 | } |
195 | #endif | 195 | #endif |
196 | 196 | ||
@@ -212,6 +212,18 @@ unsigned long get_wchan(struct task_struct *p); | |||
212 | extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr); | 212 | extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr); |
213 | extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val); | 213 | extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val); |
214 | 214 | ||
215 | #define GET_ENDIAN(tsk, adr) get_endian((tsk), (adr)) | ||
216 | #define SET_ENDIAN(tsk, val) set_endian((tsk), (val)) | ||
217 | |||
218 | extern int get_endian(struct task_struct *tsk, unsigned long adr); | ||
219 | extern int set_endian(struct task_struct *tsk, unsigned int val); | ||
220 | |||
221 | #define GET_UNALIGN_CTL(tsk, adr) get_unalign_ctl((tsk), (adr)) | ||
222 | #define SET_UNALIGN_CTL(tsk, val) set_unalign_ctl((tsk), (val)) | ||
223 | |||
224 | extern int get_unalign_ctl(struct task_struct *tsk, unsigned long adr); | ||
225 | extern int set_unalign_ctl(struct task_struct *tsk, unsigned int val); | ||
226 | |||
215 | static inline unsigned int __unpack_fe01(unsigned long msr_bits) | 227 | static inline unsigned int __unpack_fe01(unsigned long msr_bits) |
216 | { | 228 | { |
217 | return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8); | 229 | return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8); |
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index f4e2ca6fd53f..010d186d095b 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
@@ -229,7 +229,16 @@ extern int of_address_to_resource(struct device_node *dev, int index, | |||
229 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, | 229 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, |
230 | struct resource *r); | 230 | struct resource *r); |
231 | 231 | ||
232 | /* Parse the ibm,dma-window property of an OF node into the busno, phys and | ||
233 | * size parameters. | ||
234 | */ | ||
235 | void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop, | ||
236 | unsigned long *busno, unsigned long *phys, unsigned long *size); | ||
237 | |||
232 | extern void kdump_move_device_tree(void); | 238 | extern void kdump_move_device_tree(void); |
233 | 239 | ||
240 | /* CPU OF node matching */ | ||
241 | struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); | ||
242 | |||
234 | #endif /* __KERNEL__ */ | 243 | #endif /* __KERNEL__ */ |
235 | #endif /* _POWERPC_PROM_H */ | 244 | #endif /* _POWERPC_PROM_H */ |
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h index 9c550b314823..dc4cb9cc73a1 100644 --- a/include/asm-powerpc/ptrace.h +++ b/include/asm-powerpc/ptrace.h | |||
@@ -229,13 +229,13 @@ do { \ | |||
229 | #define PTRACE_GET_DEBUGREG 25 | 229 | #define PTRACE_GET_DEBUGREG 25 |
230 | #define PTRACE_SET_DEBUGREG 26 | 230 | #define PTRACE_SET_DEBUGREG 26 |
231 | 231 | ||
232 | #ifdef __powerpc64__ | ||
233 | /* Additional PTRACE requests implemented on PowerPC. */ | 232 | /* Additional PTRACE requests implemented on PowerPC. */ |
234 | #define PPC_PTRACE_GETREGS 0x99 /* Get GPRs 0 - 31 */ | 233 | #define PPC_PTRACE_GETREGS 0x99 /* Get GPRs 0 - 31 */ |
235 | #define PPC_PTRACE_SETREGS 0x98 /* Set GPRs 0 - 31 */ | 234 | #define PPC_PTRACE_SETREGS 0x98 /* Set GPRs 0 - 31 */ |
236 | #define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */ | 235 | #define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */ |
237 | #define PPC_PTRACE_SETFPREGS 0x96 /* Set FPRs 0 - 31 */ | 236 | #define PPC_PTRACE_SETFPREGS 0x96 /* Set FPRs 0 - 31 */ |
238 | 237 | ||
238 | #ifdef __powerpc64__ | ||
239 | /* Calls to trace a 64bit program from a 32bit program */ | 239 | /* Calls to trace a 64bit program from a 32bit program */ |
240 | #define PPC_PTRACE_PEEKTEXT_3264 0x95 | 240 | #define PPC_PTRACE_PEEKTEXT_3264 0x95 |
241 | #define PPC_PTRACE_PEEKDATA_3264 0x94 | 241 | #define PPC_PTRACE_PEEKDATA_3264 0x94 |
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h index bd467bf5cf5a..cf73475a0c69 100644 --- a/include/asm-powerpc/reg.h +++ b/include/asm-powerpc/reg.h | |||
@@ -93,8 +93,8 @@ | |||
93 | #define MSR_LE __MASK(MSR_LE_LG) /* Little Endian */ | 93 | #define MSR_LE __MASK(MSR_LE_LG) /* Little Endian */ |
94 | 94 | ||
95 | #ifdef CONFIG_PPC64 | 95 | #ifdef CONFIG_PPC64 |
96 | #define MSR_ MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF | 96 | #define MSR_ MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF |MSR_HV |
97 | #define MSR_KERNEL MSR_ | MSR_SF | MSR_HV | 97 | #define MSR_KERNEL MSR_ | MSR_SF |
98 | 98 | ||
99 | #define MSR_USER32 MSR_ | MSR_PR | MSR_EE | 99 | #define MSR_USER32 MSR_ | MSR_PR | MSR_EE |
100 | #define MSR_USER64 MSR_USER32 | MSR_SF | 100 | #define MSR_USER64 MSR_USER32 | MSR_SF |
@@ -153,7 +153,7 @@ | |||
153 | #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ | 153 | #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ |
154 | #define DABR_TRANSLATION (1UL << 2) | 154 | #define DABR_TRANSLATION (1UL << 2) |
155 | #define SPRN_DAR 0x013 /* Data Address Register */ | 155 | #define SPRN_DAR 0x013 /* Data Address Register */ |
156 | #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ | 156 | #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ |
157 | #define DSISR_NOHPTE 0x40000000 /* no translation found */ | 157 | #define DSISR_NOHPTE 0x40000000 /* no translation found */ |
158 | #define DSISR_PROTFAULT 0x08000000 /* protection fault */ | 158 | #define DSISR_PROTFAULT 0x08000000 /* protection fault */ |
159 | #define DSISR_ISSTORE 0x02000000 /* access was a store */ | 159 | #define DSISR_ISSTORE 0x02000000 /* access was a store */ |
@@ -258,16 +258,16 @@ | |||
258 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ | 258 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ |
259 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ | 259 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ |
260 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ | 260 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ |
261 | #define SPRN_HID6 0x3F9 /* BE HID 6 */ | 261 | #define SPRN_HID6 0x3F9 /* BE HID 6 */ |
262 | #define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */ | 262 | #define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */ |
263 | #define HID6_DLP (1<<20) /* Disable all large page modes (4K only) */ | 263 | #define HID6_DLP (1<<20) /* Disable all large page modes (4K only) */ |
264 | #define SPRN_TSC_CELL 0x399 /* Thread switch control on Cell */ | 264 | #define SPRN_TSC_CELL 0x399 /* Thread switch control on Cell */ |
265 | #define TSC_CELL_DEC_ENABLE_0 0x400000 /* Decrementer Interrupt */ | 265 | #define TSC_CELL_DEC_ENABLE_0 0x400000 /* Decrementer Interrupt */ |
266 | #define TSC_CELL_DEC_ENABLE_1 0x200000 /* Decrementer Interrupt */ | 266 | #define TSC_CELL_DEC_ENABLE_1 0x200000 /* Decrementer Interrupt */ |
267 | #define TSC_CELL_EE_ENABLE 0x100000 /* External Interrupt */ | 267 | #define TSC_CELL_EE_ENABLE 0x100000 /* External Interrupt */ |
268 | #define TSC_CELL_EE_BOOST 0x080000 /* External Interrupt Boost */ | 268 | #define TSC_CELL_EE_BOOST 0x080000 /* External Interrupt Boost */ |
269 | #define SPRN_TSC 0x3FD /* Thread switch control on others */ | 269 | #define SPRN_TSC 0x3FD /* Thread switch control on others */ |
270 | #define SPRN_TST 0x3FC /* Thread switch timeout on others */ | 270 | #define SPRN_TST 0x3FC /* Thread switch timeout on others */ |
271 | #if !defined(SPRN_IAC1) && !defined(SPRN_IAC2) | 271 | #if !defined(SPRN_IAC1) && !defined(SPRN_IAC2) |
272 | #define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */ | 272 | #define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */ |
273 | #define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */ | 273 | #define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */ |
@@ -362,7 +362,7 @@ | |||
362 | #endif | 362 | #endif |
363 | #define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */ | 363 | #define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */ |
364 | #define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */ | 364 | #define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */ |
365 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Reg */ | 365 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Reg */ |
366 | #define SPRN_PVR 0x11F /* Processor Version Register */ | 366 | #define SPRN_PVR 0x11F /* Processor Version Register */ |
367 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ | 367 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ |
368 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ | 368 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ |
@@ -386,6 +386,8 @@ | |||
386 | #define SRR1_WAKEMT 0x00280000 /* mtctrl */ | 386 | #define SRR1_WAKEMT 0x00280000 /* mtctrl */ |
387 | #define SRR1_WAKEDEC 0x00180000 /* Decrementer interrupt */ | 387 | #define SRR1_WAKEDEC 0x00180000 /* Decrementer interrupt */ |
388 | #define SRR1_WAKETHERM 0x00100000 /* Thermal management interrupt */ | 388 | #define SRR1_WAKETHERM 0x00100000 /* Thermal management interrupt */ |
389 | #define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */ | ||
390 | #define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */ | ||
389 | 391 | ||
390 | #ifndef SPRN_SVR | 392 | #ifndef SPRN_SVR |
391 | #define SPRN_SVR 0x11E /* System Version Register */ | 393 | #define SPRN_SVR 0x11E /* System Version Register */ |
@@ -443,6 +445,10 @@ | |||
443 | #define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ | 445 | #define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ |
444 | #define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ | 446 | #define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ |
445 | #define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */ | 447 | #define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */ |
448 | #define POWER6_MMCRA_SIHV 0x0000040000000000ULL | ||
449 | #define POWER6_MMCRA_SIPR 0x0000020000000000ULL | ||
450 | #define POWER6_MMCRA_THRM 0x00000020UL | ||
451 | #define POWER6_MMCRA_OTHER 0x0000000EUL | ||
446 | #define SPRN_PMC1 787 | 452 | #define SPRN_PMC1 787 |
447 | #define SPRN_PMC2 788 | 453 | #define SPRN_PMC2 788 |
448 | #define SPRN_PMC3 789 | 454 | #define SPRN_PMC3 789 |
@@ -495,6 +501,19 @@ | |||
495 | #define MMCR0_PMC2_LOADMISSTIME 0x5 | 501 | #define MMCR0_PMC2_LOADMISSTIME 0x5 |
496 | #endif | 502 | #endif |
497 | 503 | ||
504 | /* | ||
505 | * An mtfsf instruction with the L bit set. On CPUs that support this a | ||
506 | * full 64bits of FPSCR is restored and on other CPUs it is ignored. | ||
507 | * | ||
508 | * Until binutils gets the new form of mtfsf, hardwire the instruction. | ||
509 | */ | ||
510 | #ifdef CONFIG_PPC64 | ||
511 | #define MTFSF_L(REG) \ | ||
512 | .long (0xfc00058e | ((0xff) << 17) | ((REG) << 11) | (1 << 25)) | ||
513 | #else | ||
514 | #define MTFSF_L(REG) mtfsf 0xff, (REG) | ||
515 | #endif | ||
516 | |||
498 | /* Processor Version Register (PVR) field extraction */ | 517 | /* Processor Version Register (PVR) field extraction */ |
499 | 518 | ||
500 | #define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */ | 519 | #define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */ |
@@ -559,20 +578,20 @@ | |||
559 | 578 | ||
560 | /* 64-bit processors */ | 579 | /* 64-bit processors */ |
561 | /* XXX the prefix should be PVR_, we'll do a global sweep to fix it one day */ | 580 | /* XXX the prefix should be PVR_, we'll do a global sweep to fix it one day */ |
562 | #define PV_NORTHSTAR 0x0033 | 581 | #define PV_NORTHSTAR 0x0033 |
563 | #define PV_PULSAR 0x0034 | 582 | #define PV_PULSAR 0x0034 |
564 | #define PV_POWER4 0x0035 | 583 | #define PV_POWER4 0x0035 |
565 | #define PV_ICESTAR 0x0036 | 584 | #define PV_ICESTAR 0x0036 |
566 | #define PV_SSTAR 0x0037 | 585 | #define PV_SSTAR 0x0037 |
567 | #define PV_POWER4p 0x0038 | 586 | #define PV_POWER4p 0x0038 |
568 | #define PV_970 0x0039 | 587 | #define PV_970 0x0039 |
569 | #define PV_POWER5 0x003A | 588 | #define PV_POWER5 0x003A |
570 | #define PV_POWER5p 0x003B | 589 | #define PV_POWER5p 0x003B |
571 | #define PV_970FX 0x003C | 590 | #define PV_970FX 0x003C |
572 | #define PV_630 0x0040 | 591 | #define PV_630 0x0040 |
573 | #define PV_630p 0x0041 | 592 | #define PV_630p 0x0041 |
574 | #define PV_970MP 0x0044 | 593 | #define PV_970MP 0x0044 |
575 | #define PV_BE 0x0070 | 594 | #define PV_BE 0x0070 |
576 | 595 | ||
577 | /* | 596 | /* |
578 | * Number of entries in the SLB. If this ever changes we should handle | 597 | * Number of entries in the SLB. If this ever changes we should handle |
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h index f43c6835e62a..02e213e3d69f 100644 --- a/include/asm-powerpc/rtas.h +++ b/include/asm-powerpc/rtas.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #define RTAS_RMOBUF_MAX (64 * 1024) | 24 | #define RTAS_RMOBUF_MAX (64 * 1024) |
25 | 25 | ||
26 | /* RTAS return status codes */ | 26 | /* RTAS return status codes */ |
27 | #define RTAS_NOT_SUSPENDABLE -9004 | ||
27 | #define RTAS_BUSY -2 /* RTAS Busy */ | 28 | #define RTAS_BUSY -2 /* RTAS Busy */ |
28 | #define RTAS_EXTENDED_DELAY_MIN 9900 | 29 | #define RTAS_EXTENDED_DELAY_MIN 9900 |
29 | #define RTAS_EXTENDED_DELAY_MAX 9905 | 30 | #define RTAS_EXTENDED_DELAY_MAX 9905 |
@@ -177,12 +178,8 @@ extern unsigned long rtas_get_boot_time(void); | |||
177 | extern void rtas_get_rtc_time(struct rtc_time *rtc_time); | 178 | extern void rtas_get_rtc_time(struct rtc_time *rtc_time); |
178 | extern int rtas_set_rtc_time(struct rtc_time *rtc_time); | 179 | extern int rtas_set_rtc_time(struct rtc_time *rtc_time); |
179 | 180 | ||
180 | /* Given an RTAS status code of 9900..9905 compute the hinted delay */ | 181 | extern unsigned int rtas_busy_delay_time(int status); |
181 | unsigned int rtas_extended_busy_delay_time(int status); | 182 | extern unsigned int rtas_busy_delay(int status); |
182 | static inline int rtas_is_extended_busy(int status) | ||
183 | { | ||
184 | return status >= 9900 && status <= 9909; | ||
185 | } | ||
186 | 183 | ||
187 | extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); | 184 | extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); |
188 | 185 | ||
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index 95713f397357..9609d3ee8798 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h | |||
@@ -24,8 +24,8 @@ | |||
24 | #define _SPU_H | 24 | #define _SPU_H |
25 | #ifdef __KERNEL__ | 25 | #ifdef __KERNEL__ |
26 | 26 | ||
27 | #include <linux/kref.h> | ||
28 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <linux/sysdev.h> | ||
29 | 29 | ||
30 | #define LS_SIZE (256 * 1024) | 30 | #define LS_SIZE (256 * 1024) |
31 | #define LS_ADDR_MASK (LS_SIZE - 1) | 31 | #define LS_ADDR_MASK (LS_SIZE - 1) |
@@ -122,7 +122,6 @@ struct spu { | |||
122 | u64 flags; | 122 | u64 flags; |
123 | u64 dar; | 123 | u64 dar; |
124 | u64 dsisr; | 124 | u64 dsisr; |
125 | struct kref kref; | ||
126 | size_t ls_size; | 125 | size_t ls_size; |
127 | unsigned int slb_replace; | 126 | unsigned int slb_replace; |
128 | struct mm_struct *mm; | 127 | struct mm_struct *mm; |
@@ -134,7 +133,6 @@ struct spu { | |||
134 | int class_0_pending; | 133 | int class_0_pending; |
135 | spinlock_t register_lock; | 134 | spinlock_t register_lock; |
136 | 135 | ||
137 | u32 stop_code; | ||
138 | void (* wbox_callback)(struct spu *spu); | 136 | void (* wbox_callback)(struct spu *spu); |
139 | void (* ibox_callback)(struct spu *spu); | 137 | void (* ibox_callback)(struct spu *spu); |
140 | void (* stop_callback)(struct spu *spu); | 138 | void (* stop_callback)(struct spu *spu); |
@@ -143,6 +141,8 @@ struct spu { | |||
143 | char irq_c0[8]; | 141 | char irq_c0[8]; |
144 | char irq_c1[8]; | 142 | char irq_c1[8]; |
145 | char irq_c2[8]; | 143 | char irq_c2[8]; |
144 | |||
145 | struct sys_device sysdev; | ||
146 | }; | 146 | }; |
147 | 147 | ||
148 | struct spu *spu_alloc(void); | 148 | struct spu *spu_alloc(void); |
@@ -181,29 +181,6 @@ static inline void unregister_spu_syscalls(struct spufs_calls *calls) | |||
181 | #endif /* MODULE */ | 181 | #endif /* MODULE */ |
182 | 182 | ||
183 | 183 | ||
184 | /* access to priv1 registers */ | ||
185 | void spu_int_mask_and(struct spu *spu, int class, u64 mask); | ||
186 | void spu_int_mask_or(struct spu *spu, int class, u64 mask); | ||
187 | void spu_int_mask_set(struct spu *spu, int class, u64 mask); | ||
188 | u64 spu_int_mask_get(struct spu *spu, int class); | ||
189 | void spu_int_stat_clear(struct spu *spu, int class, u64 stat); | ||
190 | u64 spu_int_stat_get(struct spu *spu, int class); | ||
191 | void spu_int_route_set(struct spu *spu, u64 route); | ||
192 | u64 spu_mfc_dar_get(struct spu *spu); | ||
193 | u64 spu_mfc_dsisr_get(struct spu *spu); | ||
194 | void spu_mfc_dsisr_set(struct spu *spu, u64 dsisr); | ||
195 | void spu_mfc_sdr_set(struct spu *spu, u64 sdr); | ||
196 | void spu_mfc_sr1_set(struct spu *spu, u64 sr1); | ||
197 | u64 spu_mfc_sr1_get(struct spu *spu); | ||
198 | void spu_mfc_tclass_id_set(struct spu *spu, u64 tclass_id); | ||
199 | u64 spu_mfc_tclass_id_get(struct spu *spu); | ||
200 | void spu_tlb_invalidate(struct spu *spu); | ||
201 | void spu_resource_allocation_groupID_set(struct spu *spu, u64 id); | ||
202 | u64 spu_resource_allocation_groupID_get(struct spu *spu); | ||
203 | void spu_resource_allocation_enable_set(struct spu *spu, u64 enable); | ||
204 | u64 spu_resource_allocation_enable_get(struct spu *spu); | ||
205 | |||
206 | |||
207 | /* | 184 | /* |
208 | * This defines the Local Store, Problem Area and Privlege Area of an SPU. | 185 | * This defines the Local Store, Problem Area and Privlege Area of an SPU. |
209 | */ | 186 | */ |
diff --git a/include/asm-powerpc/spu_csa.h b/include/asm-powerpc/spu_csa.h index ba18d7d4dde2..964c2d38ccb7 100644 --- a/include/asm-powerpc/spu_csa.h +++ b/include/asm-powerpc/spu_csa.h | |||
@@ -86,10 +86,18 @@ struct spu_lscsa { | |||
86 | struct spu_reg128 event_mask; | 86 | struct spu_reg128 event_mask; |
87 | struct spu_reg128 srr0; | 87 | struct spu_reg128 srr0; |
88 | struct spu_reg128 stopped_status; | 88 | struct spu_reg128 stopped_status; |
89 | struct spu_reg128 pad[119]; /* 'ls' must be page-aligned. */ | 89 | |
90 | unsigned char ls[LS_SIZE]; | 90 | /* |
91 | * 'ls' must be page-aligned on all configurations. | ||
92 | * Since we don't want to rely on having the spu-gcc | ||
93 | * installed to build the kernel and this structure | ||
94 | * is used in the SPU-side code, make it 64k-page | ||
95 | * aligned for now. | ||
96 | */ | ||
97 | unsigned char ls[LS_SIZE] __attribute__((aligned(65536))); | ||
91 | }; | 98 | }; |
92 | 99 | ||
100 | #ifndef __SPU__ | ||
93 | /* | 101 | /* |
94 | * struct spu_problem_collapsed - condensed problem state area, w/o pads. | 102 | * struct spu_problem_collapsed - condensed problem state area, w/o pads. |
95 | */ | 103 | */ |
@@ -250,6 +258,7 @@ extern int spu_restore(struct spu_state *new, struct spu *spu); | |||
250 | extern int spu_switch(struct spu_state *prev, struct spu_state *new, | 258 | extern int spu_switch(struct spu_state *prev, struct spu_state *new, |
251 | struct spu *spu); | 259 | struct spu *spu); |
252 | 260 | ||
261 | #endif /* !__SPU__ */ | ||
253 | #endif /* __KERNEL__ */ | 262 | #endif /* __KERNEL__ */ |
254 | #endif /* !__ASSEMBLY__ */ | 263 | #endif /* !__ASSEMBLY__ */ |
255 | #endif /* _SPU_CSA_H_ */ | 264 | #endif /* _SPU_CSA_H_ */ |
diff --git a/include/asm-powerpc/spu_priv1.h b/include/asm-powerpc/spu_priv1.h new file mode 100644 index 000000000000..300c458b6d06 --- /dev/null +++ b/include/asm-powerpc/spu_priv1.h | |||
@@ -0,0 +1,182 @@ | |||
1 | /* | ||
2 | * Defines an spu hypervisor abstraction layer. | ||
3 | * | ||
4 | * Copyright 2006 Sony Corp. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #if !defined(_SPU_PRIV1_H) | ||
21 | #define _SPU_PRIV1_H | ||
22 | #if defined(__KERNEL__) | ||
23 | |||
24 | struct spu; | ||
25 | |||
26 | /* access to priv1 registers */ | ||
27 | |||
28 | struct spu_priv1_ops | ||
29 | { | ||
30 | void (*int_mask_and) (struct spu *spu, int class, u64 mask); | ||
31 | void (*int_mask_or) (struct spu *spu, int class, u64 mask); | ||
32 | void (*int_mask_set) (struct spu *spu, int class, u64 mask); | ||
33 | u64 (*int_mask_get) (struct spu *spu, int class); | ||
34 | void (*int_stat_clear) (struct spu *spu, int class, u64 stat); | ||
35 | u64 (*int_stat_get) (struct spu *spu, int class); | ||
36 | void (*cpu_affinity_set) (struct spu *spu, int cpu); | ||
37 | u64 (*mfc_dar_get) (struct spu *spu); | ||
38 | u64 (*mfc_dsisr_get) (struct spu *spu); | ||
39 | void (*mfc_dsisr_set) (struct spu *spu, u64 dsisr); | ||
40 | void (*mfc_sdr_set) (struct spu *spu, u64 sdr); | ||
41 | void (*mfc_sr1_set) (struct spu *spu, u64 sr1); | ||
42 | u64 (*mfc_sr1_get) (struct spu *spu); | ||
43 | void (*mfc_tclass_id_set) (struct spu *spu, u64 tclass_id); | ||
44 | u64 (*mfc_tclass_id_get) (struct spu *spu); | ||
45 | void (*tlb_invalidate) (struct spu *spu); | ||
46 | void (*resource_allocation_groupID_set) (struct spu *spu, u64 id); | ||
47 | u64 (*resource_allocation_groupID_get) (struct spu *spu); | ||
48 | void (*resource_allocation_enable_set) (struct spu *spu, u64 enable); | ||
49 | u64 (*resource_allocation_enable_get) (struct spu *spu); | ||
50 | }; | ||
51 | |||
52 | extern const struct spu_priv1_ops* spu_priv1_ops; | ||
53 | |||
54 | static inline void | ||
55 | spu_int_mask_and (struct spu *spu, int class, u64 mask) | ||
56 | { | ||
57 | spu_priv1_ops->int_mask_and(spu, class, mask); | ||
58 | } | ||
59 | |||
60 | static inline void | ||
61 | spu_int_mask_or (struct spu *spu, int class, u64 mask) | ||
62 | { | ||
63 | spu_priv1_ops->int_mask_or(spu, class, mask); | ||
64 | } | ||
65 | |||
66 | static inline void | ||
67 | spu_int_mask_set (struct spu *spu, int class, u64 mask) | ||
68 | { | ||
69 | spu_priv1_ops->int_mask_set(spu, class, mask); | ||
70 | } | ||
71 | |||
72 | static inline u64 | ||
73 | spu_int_mask_get (struct spu *spu, int class) | ||
74 | { | ||
75 | return spu_priv1_ops->int_mask_get(spu, class); | ||
76 | } | ||
77 | |||
78 | static inline void | ||
79 | spu_int_stat_clear (struct spu *spu, int class, u64 stat) | ||
80 | { | ||
81 | spu_priv1_ops->int_stat_clear(spu, class, stat); | ||
82 | } | ||
83 | |||
84 | static inline u64 | ||
85 | spu_int_stat_get (struct spu *spu, int class) | ||
86 | { | ||
87 | return spu_priv1_ops->int_stat_get (spu, class); | ||
88 | } | ||
89 | |||
90 | static inline void | ||
91 | spu_cpu_affinity_set (struct spu *spu, int cpu) | ||
92 | { | ||
93 | spu_priv1_ops->cpu_affinity_set(spu, cpu); | ||
94 | } | ||
95 | |||
96 | static inline u64 | ||
97 | spu_mfc_dar_get (struct spu *spu) | ||
98 | { | ||
99 | return spu_priv1_ops->mfc_dar_get(spu); | ||
100 | } | ||
101 | |||
102 | static inline u64 | ||
103 | spu_mfc_dsisr_get (struct spu *spu) | ||
104 | { | ||
105 | return spu_priv1_ops->mfc_dsisr_get(spu); | ||
106 | } | ||
107 | |||
108 | static inline void | ||
109 | spu_mfc_dsisr_set (struct spu *spu, u64 dsisr) | ||
110 | { | ||
111 | spu_priv1_ops->mfc_dsisr_set(spu, dsisr); | ||
112 | } | ||
113 | |||
114 | static inline void | ||
115 | spu_mfc_sdr_set (struct spu *spu, u64 sdr) | ||
116 | { | ||
117 | spu_priv1_ops->mfc_sdr_set(spu, sdr); | ||
118 | } | ||
119 | |||
120 | static inline void | ||
121 | spu_mfc_sr1_set (struct spu *spu, u64 sr1) | ||
122 | { | ||
123 | spu_priv1_ops->mfc_sr1_set(spu, sr1); | ||
124 | } | ||
125 | |||
126 | static inline u64 | ||
127 | spu_mfc_sr1_get (struct spu *spu) | ||
128 | { | ||
129 | return spu_priv1_ops->mfc_sr1_get(spu); | ||
130 | } | ||
131 | |||
132 | static inline void | ||
133 | spu_mfc_tclass_id_set (struct spu *spu, u64 tclass_id) | ||
134 | { | ||
135 | spu_priv1_ops->mfc_tclass_id_set(spu, tclass_id); | ||
136 | } | ||
137 | |||
138 | static inline u64 | ||
139 | spu_mfc_tclass_id_get (struct spu *spu) | ||
140 | { | ||
141 | return spu_priv1_ops->mfc_tclass_id_get(spu); | ||
142 | } | ||
143 | |||
144 | static inline void | ||
145 | spu_tlb_invalidate (struct spu *spu) | ||
146 | { | ||
147 | spu_priv1_ops->tlb_invalidate(spu); | ||
148 | } | ||
149 | |||
150 | static inline void | ||
151 | spu_resource_allocation_groupID_set (struct spu *spu, u64 id) | ||
152 | { | ||
153 | spu_priv1_ops->resource_allocation_groupID_set(spu, id); | ||
154 | } | ||
155 | |||
156 | static inline u64 | ||
157 | spu_resource_allocation_groupID_get (struct spu *spu) | ||
158 | { | ||
159 | return spu_priv1_ops->resource_allocation_groupID_get(spu); | ||
160 | } | ||
161 | |||
162 | static inline void | ||
163 | spu_resource_allocation_enable_set (struct spu *spu, u64 enable) | ||
164 | { | ||
165 | spu_priv1_ops->resource_allocation_enable_set(spu, enable); | ||
166 | } | ||
167 | |||
168 | static inline u64 | ||
169 | spu_resource_allocation_enable_get (struct spu *spu) | ||
170 | { | ||
171 | return spu_priv1_ops->resource_allocation_enable_get(spu); | ||
172 | } | ||
173 | |||
174 | /* The declarations folowing are put here for convenience | ||
175 | * and only intended to be used by the platform setup code | ||
176 | * for initializing spu_priv1_ops. | ||
177 | */ | ||
178 | |||
179 | extern const struct spu_priv1_ops spu_priv1_mmio_ops; | ||
180 | |||
181 | #endif /* __KERNEL__ */ | ||
182 | #endif | ||
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h new file mode 100644 index 000000000000..eac85ce101b6 --- /dev/null +++ b/include/asm-powerpc/systbl.h | |||
@@ -0,0 +1,306 @@ | |||
1 | /* | ||
2 | * List of powerpc syscalls. For the meaning of the _SPU suffix see | ||
3 | * arch/powerpc/platforms/cell/spu_callbacks.c | ||
4 | */ | ||
5 | |||
6 | SYSCALL(restart_syscall) | ||
7 | SYSCALL(exit) | ||
8 | PPC_SYS(fork) | ||
9 | SYSCALL_SPU(read) | ||
10 | SYSCALL_SPU(write) | ||
11 | COMPAT_SYS_SPU(open) | ||
12 | SYSCALL_SPU(close) | ||
13 | COMPAT_SYS_SPU(waitpid) | ||
14 | COMPAT_SYS_SPU(creat) | ||
15 | SYSCALL_SPU(link) | ||
16 | SYSCALL_SPU(unlink) | ||
17 | COMPAT_SYS(execve) | ||
18 | SYSCALL_SPU(chdir) | ||
19 | COMPAT_SYS_SPU(time) | ||
20 | SYSCALL_SPU(mknod) | ||
21 | SYSCALL_SPU(chmod) | ||
22 | SYSCALL_SPU(lchown) | ||
23 | SYSCALL(ni_syscall) | ||
24 | OLDSYS(stat) | ||
25 | SYSX_SPU(sys_lseek,ppc32_lseek,sys_lseek) | ||
26 | SYSCALL_SPU(getpid) | ||
27 | COMPAT_SYS(mount) | ||
28 | SYSX(sys_ni_syscall,sys_oldumount,sys_oldumount) | ||
29 | SYSCALL_SPU(setuid) | ||
30 | SYSCALL_SPU(getuid) | ||
31 | COMPAT_SYS_SPU(stime) | ||
32 | COMPAT_SYS(ptrace) | ||
33 | SYSCALL_SPU(alarm) | ||
34 | OLDSYS(fstat) | ||
35 | COMPAT_SYS(pause) | ||
36 | COMPAT_SYS(utime) | ||
37 | SYSCALL(ni_syscall) | ||
38 | SYSCALL(ni_syscall) | ||
39 | COMPAT_SYS_SPU(access) | ||
40 | COMPAT_SYS_SPU(nice) | ||
41 | SYSCALL(ni_syscall) | ||
42 | SYSCALL_SPU(sync) | ||
43 | COMPAT_SYS_SPU(kill) | ||
44 | SYSCALL_SPU(rename) | ||
45 | COMPAT_SYS_SPU(mkdir) | ||
46 | SYSCALL_SPU(rmdir) | ||
47 | SYSCALL_SPU(dup) | ||
48 | SYSCALL_SPU(pipe) | ||
49 | COMPAT_SYS_SPU(times) | ||
50 | SYSCALL(ni_syscall) | ||
51 | SYSCALL_SPU(brk) | ||
52 | SYSCALL_SPU(setgid) | ||
53 | SYSCALL_SPU(getgid) | ||
54 | SYSCALL(signal) | ||
55 | SYSCALL_SPU(geteuid) | ||
56 | SYSCALL_SPU(getegid) | ||
57 | SYSCALL(acct) | ||
58 | SYSCALL(umount) | ||
59 | SYSCALL(ni_syscall) | ||
60 | COMPAT_SYS_SPU(ioctl) | ||
61 | COMPAT_SYS_SPU(fcntl) | ||
62 | SYSCALL(ni_syscall) | ||
63 | COMPAT_SYS_SPU(setpgid) | ||
64 | SYSCALL(ni_syscall) | ||
65 | SYSX(sys_ni_syscall,sys_olduname, sys_olduname) | ||
66 | COMPAT_SYS_SPU(umask) | ||
67 | SYSCALL_SPU(chroot) | ||
68 | SYSCALL(ustat) | ||
69 | SYSCALL_SPU(dup2) | ||
70 | SYSCALL_SPU(getppid) | ||
71 | SYSCALL_SPU(getpgrp) | ||
72 | SYSCALL_SPU(setsid) | ||
73 | SYS32ONLY(sigaction) | ||
74 | SYSCALL_SPU(sgetmask) | ||
75 | COMPAT_SYS_SPU(ssetmask) | ||
76 | SYSCALL_SPU(setreuid) | ||
77 | SYSCALL_SPU(setregid) | ||
78 | SYS32ONLY(sigsuspend) | ||
79 | COMPAT_SYS(sigpending) | ||
80 | COMPAT_SYS_SPU(sethostname) | ||
81 | COMPAT_SYS_SPU(setrlimit) | ||
82 | COMPAT_SYS(old_getrlimit) | ||
83 | COMPAT_SYS_SPU(getrusage) | ||
84 | COMPAT_SYS_SPU(gettimeofday) | ||
85 | COMPAT_SYS_SPU(settimeofday) | ||
86 | COMPAT_SYS_SPU(getgroups) | ||
87 | COMPAT_SYS_SPU(setgroups) | ||
88 | SYSX(sys_ni_syscall,sys_ni_syscall,ppc_select) | ||
89 | SYSCALL_SPU(symlink) | ||
90 | OLDSYS(lstat) | ||
91 | COMPAT_SYS_SPU(readlink) | ||
92 | SYSCALL(uselib) | ||
93 | SYSCALL(swapon) | ||
94 | SYSCALL(reboot) | ||
95 | SYSX(sys_ni_syscall,old32_readdir,old_readdir) | ||
96 | SYSCALL_SPU(mmap) | ||
97 | SYSCALL_SPU(munmap) | ||
98 | SYSCALL_SPU(truncate) | ||
99 | SYSCALL_SPU(ftruncate) | ||
100 | SYSCALL_SPU(fchmod) | ||
101 | SYSCALL_SPU(fchown) | ||
102 | COMPAT_SYS_SPU(getpriority) | ||
103 | COMPAT_SYS_SPU(setpriority) | ||
104 | SYSCALL(ni_syscall) | ||
105 | COMPAT_SYS(statfs) | ||
106 | COMPAT_SYS(fstatfs) | ||
107 | SYSCALL(ni_syscall) | ||
108 | COMPAT_SYS_SPU(socketcall) | ||
109 | COMPAT_SYS_SPU(syslog) | ||
110 | COMPAT_SYS_SPU(setitimer) | ||
111 | COMPAT_SYS_SPU(getitimer) | ||
112 | COMPAT_SYS_SPU(newstat) | ||
113 | COMPAT_SYS_SPU(newlstat) | ||
114 | COMPAT_SYS_SPU(newfstat) | ||
115 | SYSX(sys_ni_syscall,sys_uname,sys_uname) | ||
116 | SYSCALL(ni_syscall) | ||
117 | SYSCALL_SPU(vhangup) | ||
118 | SYSCALL(ni_syscall) | ||
119 | SYSCALL(ni_syscall) | ||
120 | COMPAT_SYS_SPU(wait4) | ||
121 | SYSCALL(swapoff) | ||
122 | COMPAT_SYS_SPU(sysinfo) | ||
123 | COMPAT_SYS(ipc) | ||
124 | SYSCALL_SPU(fsync) | ||
125 | SYS32ONLY(sigreturn) | ||
126 | PPC_SYS(clone) | ||
127 | COMPAT_SYS_SPU(setdomainname) | ||
128 | PPC_SYS_SPU(newuname) | ||
129 | SYSCALL(ni_syscall) | ||
130 | COMPAT_SYS_SPU(adjtimex) | ||
131 | SYSCALL_SPU(mprotect) | ||
132 | SYSX(sys_ni_syscall,compat_sys_sigprocmask,sys_sigprocmask) | ||
133 | SYSCALL(ni_syscall) | ||
134 | SYSCALL(init_module) | ||
135 | SYSCALL(delete_module) | ||
136 | SYSCALL(ni_syscall) | ||
137 | SYSCALL(quotactl) | ||
138 | COMPAT_SYS_SPU(getpgid) | ||
139 | SYSCALL_SPU(fchdir) | ||
140 | SYSCALL_SPU(bdflush) | ||
141 | COMPAT_SYS(sysfs) | ||
142 | SYSX_SPU(ppc64_personality,ppc64_personality,sys_personality) | ||
143 | SYSCALL(ni_syscall) | ||
144 | SYSCALL_SPU(setfsuid) | ||
145 | SYSCALL_SPU(setfsgid) | ||
146 | SYSCALL_SPU(llseek) | ||
147 | COMPAT_SYS_SPU(getdents) | ||
148 | SYSX_SPU(sys_select,ppc32_select,ppc_select) | ||
149 | SYSCALL_SPU(flock) | ||
150 | SYSCALL_SPU(msync) | ||
151 | COMPAT_SYS_SPU(readv) | ||
152 | COMPAT_SYS_SPU(writev) | ||
153 | COMPAT_SYS_SPU(getsid) | ||
154 | SYSCALL_SPU(fdatasync) | ||
155 | COMPAT_SYS(sysctl) | ||
156 | SYSCALL_SPU(mlock) | ||
157 | SYSCALL_SPU(munlock) | ||
158 | SYSCALL_SPU(mlockall) | ||
159 | SYSCALL_SPU(munlockall) | ||
160 | COMPAT_SYS_SPU(sched_setparam) | ||
161 | COMPAT_SYS_SPU(sched_getparam) | ||
162 | COMPAT_SYS_SPU(sched_setscheduler) | ||
163 | COMPAT_SYS_SPU(sched_getscheduler) | ||
164 | SYSCALL_SPU(sched_yield) | ||
165 | COMPAT_SYS_SPU(sched_get_priority_max) | ||
166 | COMPAT_SYS_SPU(sched_get_priority_min) | ||
167 | COMPAT_SYS_SPU(sched_rr_get_interval) | ||
168 | COMPAT_SYS_SPU(nanosleep) | ||
169 | SYSCALL_SPU(mremap) | ||
170 | SYSCALL_SPU(setresuid) | ||
171 | SYSCALL_SPU(getresuid) | ||
172 | SYSCALL(ni_syscall) | ||
173 | SYSCALL_SPU(poll) | ||
174 | COMPAT_SYS(nfsservctl) | ||
175 | SYSCALL_SPU(setresgid) | ||
176 | SYSCALL_SPU(getresgid) | ||
177 | COMPAT_SYS_SPU(prctl) | ||
178 | COMPAT_SYS(rt_sigreturn) | ||
179 | COMPAT_SYS(rt_sigaction) | ||
180 | COMPAT_SYS(rt_sigprocmask) | ||
181 | COMPAT_SYS(rt_sigpending) | ||
182 | COMPAT_SYS(rt_sigtimedwait) | ||
183 | COMPAT_SYS(rt_sigqueueinfo) | ||
184 | COMPAT_SYS(rt_sigsuspend) | ||
185 | COMPAT_SYS_SPU(pread64) | ||
186 | COMPAT_SYS_SPU(pwrite64) | ||
187 | SYSCALL_SPU(chown) | ||
188 | SYSCALL_SPU(getcwd) | ||
189 | SYSCALL_SPU(capget) | ||
190 | SYSCALL_SPU(capset) | ||
191 | COMPAT_SYS(sigaltstack) | ||
192 | SYSX_SPU(sys_sendfile64,compat_sys_sendfile,sys_sendfile) | ||
193 | SYSCALL(ni_syscall) | ||
194 | SYSCALL(ni_syscall) | ||
195 | PPC_SYS(vfork) | ||
196 | COMPAT_SYS_SPU(getrlimit) | ||
197 | COMPAT_SYS_SPU(readahead) | ||
198 | SYS32ONLY(mmap2) | ||
199 | SYS32ONLY(truncate64) | ||
200 | SYS32ONLY(ftruncate64) | ||
201 | SYSX(sys_ni_syscall,sys_stat64,sys_stat64) | ||
202 | SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64) | ||
203 | SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64) | ||
204 | SYSCALL(pciconfig_read) | ||
205 | SYSCALL(pciconfig_write) | ||
206 | SYSCALL(pciconfig_iobase) | ||
207 | SYSCALL(ni_syscall) | ||
208 | SYSCALL_SPU(getdents64) | ||
209 | SYSCALL_SPU(pivot_root) | ||
210 | SYSX(sys_ni_syscall,compat_sys_fcntl64,sys_fcntl64) | ||
211 | SYSCALL_SPU(madvise) | ||
212 | SYSCALL_SPU(mincore) | ||
213 | SYSCALL_SPU(gettid) | ||
214 | SYSCALL_SPU(tkill) | ||
215 | SYSCALL_SPU(setxattr) | ||
216 | SYSCALL_SPU(lsetxattr) | ||
217 | SYSCALL_SPU(fsetxattr) | ||
218 | SYSCALL_SPU(getxattr) | ||
219 | SYSCALL_SPU(lgetxattr) | ||
220 | SYSCALL_SPU(fgetxattr) | ||
221 | SYSCALL_SPU(listxattr) | ||
222 | SYSCALL_SPU(llistxattr) | ||
223 | SYSCALL_SPU(flistxattr) | ||
224 | SYSCALL_SPU(removexattr) | ||
225 | SYSCALL_SPU(lremovexattr) | ||
226 | SYSCALL_SPU(fremovexattr) | ||
227 | COMPAT_SYS_SPU(futex) | ||
228 | COMPAT_SYS_SPU(sched_setaffinity) | ||
229 | COMPAT_SYS_SPU(sched_getaffinity) | ||
230 | SYSCALL(ni_syscall) | ||
231 | SYSCALL(ni_syscall) | ||
232 | SYS32ONLY(sendfile64) | ||
233 | COMPAT_SYS_SPU(io_setup) | ||
234 | SYSCALL_SPU(io_destroy) | ||
235 | COMPAT_SYS_SPU(io_getevents) | ||
236 | COMPAT_SYS_SPU(io_submit) | ||
237 | SYSCALL_SPU(io_cancel) | ||
238 | SYSCALL(set_tid_address) | ||
239 | SYSX_SPU(sys_fadvise64,ppc32_fadvise64,sys_fadvise64) | ||
240 | SYSCALL(exit_group) | ||
241 | SYSX(sys_lookup_dcookie,ppc32_lookup_dcookie,sys_lookup_dcookie) | ||
242 | SYSCALL_SPU(epoll_create) | ||
243 | SYSCALL_SPU(epoll_ctl) | ||
244 | SYSCALL_SPU(epoll_wait) | ||
245 | SYSCALL_SPU(remap_file_pages) | ||
246 | SYSX_SPU(sys_timer_create,compat_sys_timer_create,sys_timer_create) | ||
247 | COMPAT_SYS_SPU(timer_settime) | ||
248 | COMPAT_SYS_SPU(timer_gettime) | ||
249 | SYSCALL_SPU(timer_getoverrun) | ||
250 | SYSCALL_SPU(timer_delete) | ||
251 | COMPAT_SYS_SPU(clock_settime) | ||
252 | COMPAT_SYS_SPU(clock_gettime) | ||
253 | COMPAT_SYS_SPU(clock_getres) | ||
254 | COMPAT_SYS_SPU(clock_nanosleep) | ||
255 | SYSX(ppc64_swapcontext,ppc32_swapcontext,ppc_swapcontext) | ||
256 | COMPAT_SYS_SPU(tgkill) | ||
257 | COMPAT_SYS_SPU(utimes) | ||
258 | COMPAT_SYS_SPU(statfs64) | ||
259 | COMPAT_SYS_SPU(fstatfs64) | ||
260 | SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64) | ||
261 | PPC_SYS_SPU(rtas) | ||
262 | OLDSYS(debug_setcontext) | ||
263 | SYSCALL(ni_syscall) | ||
264 | SYSCALL(ni_syscall) | ||
265 | COMPAT_SYS(mbind) | ||
266 | COMPAT_SYS(get_mempolicy) | ||
267 | COMPAT_SYS(set_mempolicy) | ||
268 | COMPAT_SYS(mq_open) | ||
269 | SYSCALL(mq_unlink) | ||
270 | COMPAT_SYS(mq_timedsend) | ||
271 | COMPAT_SYS(mq_timedreceive) | ||
272 | COMPAT_SYS(mq_notify) | ||
273 | COMPAT_SYS(mq_getsetattr) | ||
274 | COMPAT_SYS(kexec_load) | ||
275 | COMPAT_SYS(add_key) | ||
276 | COMPAT_SYS(request_key) | ||
277 | COMPAT_SYS(keyctl) | ||
278 | COMPAT_SYS(waitid) | ||
279 | COMPAT_SYS(ioprio_set) | ||
280 | COMPAT_SYS(ioprio_get) | ||
281 | SYSCALL(inotify_init) | ||
282 | SYSCALL(inotify_add_watch) | ||
283 | SYSCALL(inotify_rm_watch) | ||
284 | SYSCALL(spu_run) | ||
285 | SYSCALL(spu_create) | ||
286 | COMPAT_SYS(pselect6) | ||
287 | COMPAT_SYS(ppoll) | ||
288 | SYSCALL_SPU(unshare) | ||
289 | SYSCALL_SPU(splice) | ||
290 | SYSCALL_SPU(tee) | ||
291 | SYSCALL_SPU(vmsplice) | ||
292 | COMPAT_SYS_SPU(openat) | ||
293 | SYSCALL_SPU(mkdirat) | ||
294 | SYSCALL_SPU(mknodat) | ||
295 | SYSCALL_SPU(fchownat) | ||
296 | COMPAT_SYS_SPU(futimesat) | ||
297 | SYSX_SPU(sys_newfstatat, sys_fstatat64, sys_fstatat64) | ||
298 | SYSCALL_SPU(unlinkat) | ||
299 | SYSCALL_SPU(renameat) | ||
300 | SYSCALL_SPU(linkat) | ||
301 | SYSCALL_SPU(symlinkat) | ||
302 | SYSCALL_SPU(readlinkat) | ||
303 | SYSCALL_SPU(fchmodat) | ||
304 | SYSCALL_SPU(faccessat) | ||
305 | COMPAT_SYS_SPU(get_robust_list) | ||
306 | COMPAT_SYS_SPU(set_robust_list) | ||
diff --git a/include/asm-powerpc/tce.h b/include/asm-powerpc/tce.h index 6fa200ad7a7f..c9483adbf599 100644 --- a/include/asm-powerpc/tce.h +++ b/include/asm-powerpc/tce.h | |||
@@ -35,32 +35,15 @@ | |||
35 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) | 35 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) |
36 | #define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT) | 36 | #define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT) |
37 | 37 | ||
38 | 38 | #define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */ | |
39 | /* tce_entry | 39 | |
40 | * Used by pSeries (SMP) and iSeries/pSeries LPAR, but there it's | 40 | #define TCE_RPN_MASK 0xfffffffffful /* 40-bit RPN (4K pages) */ |
41 | * abstracted so layout is irrelevant. | 41 | #define TCE_RPN_SHIFT 12 |
42 | */ | 42 | #define TCE_VALID 0x800 /* TCE valid */ |
43 | union tce_entry { | 43 | #define TCE_ALLIO 0x400 /* TCE valid for all lpars */ |
44 | unsigned long te_word; | 44 | #define TCE_PCI_WRITE 0x2 /* write from PCI allowed */ |
45 | struct { | 45 | #define TCE_PCI_READ 0x1 /* read from PCI allowed */ |
46 | unsigned int tb_cacheBits :6; /* Cache hash bits - not used */ | 46 | #define TCE_VB_WRITE 0x1 /* write from VB allowed */ |
47 | unsigned int tb_rsvd :6; | ||
48 | unsigned long tb_rpn :40; /* Real page number */ | ||
49 | unsigned int tb_valid :1; /* Tce is valid (vb only) */ | ||
50 | unsigned int tb_allio :1; /* Tce is valid for all lps (vb only) */ | ||
51 | unsigned int tb_lpindex :8; /* LpIndex for user of TCE (vb only) */ | ||
52 | unsigned int tb_pciwr :1; /* Write allowed (pci only) */ | ||
53 | unsigned int tb_rdwr :1; /* Read allowed (pci), Write allowed (vb) */ | ||
54 | } te_bits; | ||
55 | #define te_cacheBits te_bits.tb_cacheBits | ||
56 | #define te_rpn te_bits.tb_rpn | ||
57 | #define te_valid te_bits.tb_valid | ||
58 | #define te_allio te_bits.tb_allio | ||
59 | #define te_lpindex te_bits.tb_lpindex | ||
60 | #define te_pciwr te_bits.tb_pciwr | ||
61 | #define te_rdwr te_bits.tb_rdwr | ||
62 | }; | ||
63 | |||
64 | 47 | ||
65 | #endif /* __KERNEL__ */ | 48 | #endif /* __KERNEL__ */ |
66 | #endif /* _ASM_POWERPC_TCE_H */ | 49 | #endif /* _ASM_POWERPC_TCE_H */ |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 19c575f39164..92f3e5507d22 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -31,8 +31,13 @@ static inline int node_to_first_cpu(int node) | |||
31 | 31 | ||
32 | int of_node_to_nid(struct device_node *device); | 32 | int of_node_to_nid(struct device_node *device); |
33 | 33 | ||
34 | #define pcibus_to_node(node) (-1) | 34 | struct pci_bus; |
35 | #define pcibus_to_cpumask(bus) (cpu_online_map) | 35 | extern int pcibus_to_node(struct pci_bus *bus); |
36 | |||
37 | #define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \ | ||
38 | CPU_MASK_ALL : \ | ||
39 | node_to_cpumask(pcibus_to_node(bus)) \ | ||
40 | ) | ||
36 | 41 | ||
37 | /* sched_domains SD_NODE_INIT for PPC64 machines */ | 42 | /* sched_domains SD_NODE_INIT for PPC64 machines */ |
38 | #define SD_NODE_INIT (struct sched_domain) { \ | 43 | #define SD_NODE_INIT (struct sched_domain) { \ |
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h index 5c4236c342bb..19a1517ac43b 100644 --- a/include/asm-powerpc/udbg.h +++ b/include/asm-powerpc/udbg.h | |||
@@ -23,7 +23,8 @@ extern int udbg_write(const char *s, int n); | |||
23 | extern int udbg_read(char *buf, int buflen); | 23 | extern int udbg_read(char *buf, int buflen); |
24 | 24 | ||
25 | extern void register_early_udbg_console(void); | 25 | extern void register_early_udbg_console(void); |
26 | extern void udbg_printf(const char *fmt, ...); | 26 | extern void udbg_printf(const char *fmt, ...) |
27 | __attribute__ ((format (printf, 1, 2))); | ||
27 | extern void udbg_progress(char *s, unsigned short hex); | 28 | extern void udbg_progress(char *s, unsigned short hex); |
28 | 29 | ||
29 | extern void udbg_init_uart(void __iomem *comport, unsigned int speed, | 30 | extern void udbg_init_uart(void __iomem *comport, unsigned int speed, |
diff --git a/include/asm-powerpc/vga.h b/include/asm-powerpc/vga.h index eadaf2f3d032..a2eac409c1ec 100644 --- a/include/asm-powerpc/vga.h +++ b/include/asm-powerpc/vga.h | |||
@@ -41,9 +41,9 @@ static inline u16 scr_readw(volatile const u16 *addr) | |||
41 | extern unsigned long vgacon_remap_base; | 41 | extern unsigned long vgacon_remap_base; |
42 | 42 | ||
43 | #ifdef __powerpc64__ | 43 | #ifdef __powerpc64__ |
44 | #define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) | 44 | #define VGA_MAP_MEM(x,s) ((unsigned long) ioremap((x), s)) |
45 | #else | 45 | #else |
46 | #define VGA_MAP_MEM(x) (x + vgacon_remap_base) | 46 | #define VGA_MAP_MEM(x,s) (x + vgacon_remap_base) |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #define vga_readb(x) (*(x)) | 49 | #define vga_readb(x) (*(x)) |
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h index be14c59846f9..dc9bd101ca14 100644 --- a/include/asm-powerpc/vio.h +++ b/include/asm-powerpc/vio.h | |||
@@ -63,32 +63,22 @@ struct vio_driver { | |||
63 | struct device_driver driver; | 63 | struct device_driver driver; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | struct vio_bus_ops { | ||
67 | int (*match)(const struct vio_device_id *id, const struct vio_dev *dev); | ||
68 | void (*unregister_device)(struct vio_dev *); | ||
69 | void (*release_device)(struct device *); | ||
70 | }; | ||
71 | |||
72 | extern struct dma_mapping_ops vio_dma_ops; | 66 | extern struct dma_mapping_ops vio_dma_ops; |
73 | extern struct bus_type vio_bus_type; | 67 | extern struct bus_type vio_bus_type; |
74 | extern struct vio_dev vio_bus_device; | ||
75 | 68 | ||
76 | extern int vio_register_driver(struct vio_driver *drv); | 69 | extern int vio_register_driver(struct vio_driver *drv); |
77 | extern void vio_unregister_driver(struct vio_driver *drv); | 70 | extern void vio_unregister_driver(struct vio_driver *drv); |
78 | 71 | ||
79 | extern struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev); | ||
80 | extern void __devinit vio_unregister_device(struct vio_dev *dev); | 72 | extern void __devinit vio_unregister_device(struct vio_dev *dev); |
81 | 73 | ||
82 | extern int vio_bus_init(struct vio_bus_ops *); | ||
83 | |||
84 | #ifdef CONFIG_PPC_PSERIES | ||
85 | struct device_node; | 74 | struct device_node; |
86 | 75 | ||
87 | extern struct vio_dev * __devinit vio_register_device_node( | 76 | extern struct vio_dev * __devinit vio_register_device_node( |
88 | struct device_node *node_vdev); | 77 | struct device_node *node_vdev); |
89 | extern struct vio_dev *vio_find_node(struct device_node *vnode); | 78 | extern const void *vio_get_attribute(struct vio_dev *vdev, char *which, |
90 | extern const void *vio_get_attribute(struct vio_dev *vdev, void *which, | ||
91 | int *length); | 79 | int *length); |
80 | #ifdef CONFIG_PPC_PSERIES | ||
81 | extern struct vio_dev *vio_find_node(struct device_node *vnode); | ||
92 | extern int vio_enable_interrupts(struct vio_dev *dev); | 82 | extern int vio_enable_interrupts(struct vio_dev *dev); |
93 | extern int vio_disable_interrupts(struct vio_dev *dev); | 83 | extern int vio_disable_interrupts(struct vio_dev *dev); |
94 | #endif | 84 | #endif |
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h index 0a70b05b3afb..14584e505ed5 100644 --- a/include/asm-ppc/mmu.h +++ b/include/asm-ppc/mmu.h | |||
@@ -23,25 +23,18 @@ extern phys_addr_t fixup_bigphys_addr(phys_addr_t, phys_addr_t); | |||
23 | #define PHYS_FMT "%16Lx" | 23 | #define PHYS_FMT "%16Lx" |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | /* Default "unsigned long" context */ | 26 | typedef struct { |
27 | typedef unsigned long mm_context_t; | 27 | unsigned long id; |
28 | unsigned long vdso_base; | ||
29 | } mm_context_t; | ||
28 | 30 | ||
29 | /* Hardware Page Table Entry */ | 31 | /* Hardware Page Table Entry */ |
30 | typedef struct _PTE { | 32 | typedef struct _PTE { |
31 | #ifdef CONFIG_PPC64BRIDGE | ||
32 | unsigned long long vsid:52; | ||
33 | unsigned long api:5; | ||
34 | unsigned long :5; | ||
35 | unsigned long h:1; | ||
36 | unsigned long v:1; | ||
37 | unsigned long long rpn:52; | ||
38 | #else /* CONFIG_PPC64BRIDGE */ | ||
39 | unsigned long v:1; /* Entry is valid */ | 33 | unsigned long v:1; /* Entry is valid */ |
40 | unsigned long vsid:24; /* Virtual segment identifier */ | 34 | unsigned long vsid:24; /* Virtual segment identifier */ |
41 | unsigned long h:1; /* Hash algorithm indicator */ | 35 | unsigned long h:1; /* Hash algorithm indicator */ |
42 | unsigned long api:6; /* Abbreviated page index */ | 36 | unsigned long api:6; /* Abbreviated page index */ |
43 | unsigned long rpn:20; /* Real (physical) page number */ | 37 | unsigned long rpn:20; /* Real (physical) page number */ |
44 | #endif /* CONFIG_PPC64BRIDGE */ | ||
45 | unsigned long :3; /* Unused */ | 38 | unsigned long :3; /* Unused */ |
46 | unsigned long r:1; /* Referenced */ | 39 | unsigned long r:1; /* Referenced */ |
47 | unsigned long c:1; /* Changed */ | 40 | unsigned long c:1; /* Changed */ |
@@ -82,11 +75,7 @@ typedef struct _P601_BATU { /* Upper part of BAT for 601 processor */ | |||
82 | } P601_BATU; | 75 | } P601_BATU; |
83 | 76 | ||
84 | typedef struct _BATU { /* Upper part of BAT (all except 601) */ | 77 | typedef struct _BATU { /* Upper part of BAT (all except 601) */ |
85 | #ifdef CONFIG_PPC64BRIDGE | ||
86 | unsigned long long bepi:47; | ||
87 | #else /* CONFIG_PPC64BRIDGE */ | ||
88 | unsigned long bepi:15; /* Effective page index (virtual address) */ | 78 | unsigned long bepi:15; /* Effective page index (virtual address) */ |
89 | #endif /* CONFIG_PPC64BRIDGE */ | ||
90 | unsigned long :4; /* Unused */ | 79 | unsigned long :4; /* Unused */ |
91 | unsigned long bl:11; /* Block size mask */ | 80 | unsigned long bl:11; /* Block size mask */ |
92 | unsigned long vs:1; /* Supervisor valid */ | 81 | unsigned long vs:1; /* Supervisor valid */ |
@@ -101,11 +90,7 @@ typedef struct _P601_BATL { /* Lower part of BAT for 601 processor */ | |||
101 | } P601_BATL; | 90 | } P601_BATL; |
102 | 91 | ||
103 | typedef struct _BATL { /* Lower part of BAT (all except 601) */ | 92 | typedef struct _BATL { /* Lower part of BAT (all except 601) */ |
104 | #ifdef CONFIG_PPC64BRIDGE | ||
105 | unsigned long long brpn:47; | ||
106 | #else /* CONFIG_PPC64BRIDGE */ | ||
107 | unsigned long brpn:15; /* Real page index (physical address) */ | 93 | unsigned long brpn:15; /* Real page index (physical address) */ |
108 | #endif /* CONFIG_PPC64BRIDGE */ | ||
109 | unsigned long :10; /* Unused */ | 94 | unsigned long :10; /* Unused */ |
110 | unsigned long w:1; /* Write-thru cache */ | 95 | unsigned long w:1; /* Write-thru cache */ |
111 | unsigned long i:1; /* Cache inhibit */ | 96 | unsigned long i:1; /* Cache inhibit */ |
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h index 94f2bf71310d..2bc8589cc451 100644 --- a/include/asm-ppc/mmu_context.h +++ b/include/asm-ppc/mmu_context.h | |||
@@ -70,7 +70,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
70 | #else | 70 | #else |
71 | 71 | ||
72 | /* PPC 6xx, 7xx CPUs */ | 72 | /* PPC 6xx, 7xx CPUs */ |
73 | #define NO_CONTEXT ((mm_context_t) -1) | 73 | #define NO_CONTEXT ((unsigned long) -1) |
74 | #define LAST_CONTEXT 32767 | 74 | #define LAST_CONTEXT 32767 |
75 | #define FIRST_CONTEXT 1 | 75 | #define FIRST_CONTEXT 1 |
76 | #endif | 76 | #endif |
@@ -85,7 +85,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
85 | * can be used for debugging on all processors (if you happen to have | 85 | * can be used for debugging on all processors (if you happen to have |
86 | * an Abatron). | 86 | * an Abatron). |
87 | */ | 87 | */ |
88 | extern void set_context(mm_context_t context, pgd_t *pgd); | 88 | extern void set_context(unsigned long contextid, pgd_t *pgd); |
89 | 89 | ||
90 | /* | 90 | /* |
91 | * Bitmap of contexts in use. | 91 | * Bitmap of contexts in use. |
@@ -98,7 +98,7 @@ extern unsigned long context_map[]; | |||
98 | * Its use is an optimization only, we can't rely on this context | 98 | * Its use is an optimization only, we can't rely on this context |
99 | * number to be free, but it usually will be. | 99 | * number to be free, but it usually will be. |
100 | */ | 100 | */ |
101 | extern mm_context_t next_mmu_context; | 101 | extern unsigned long next_mmu_context; |
102 | 102 | ||
103 | /* | 103 | /* |
104 | * If we don't have sufficient contexts to give one to every task | 104 | * If we don't have sufficient contexts to give one to every task |
@@ -117,9 +117,9 @@ extern void steal_context(void); | |||
117 | */ | 117 | */ |
118 | static inline void get_mmu_context(struct mm_struct *mm) | 118 | static inline void get_mmu_context(struct mm_struct *mm) |
119 | { | 119 | { |
120 | mm_context_t ctx; | 120 | unsigned long ctx; |
121 | 121 | ||
122 | if (mm->context != NO_CONTEXT) | 122 | if (mm->context.id != NO_CONTEXT) |
123 | return; | 123 | return; |
124 | #ifdef FEW_CONTEXTS | 124 | #ifdef FEW_CONTEXTS |
125 | while (atomic_dec_if_positive(&nr_free_contexts) < 0) | 125 | while (atomic_dec_if_positive(&nr_free_contexts) < 0) |
@@ -132,7 +132,7 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
132 | ctx = 0; | 132 | ctx = 0; |
133 | } | 133 | } |
134 | next_mmu_context = (ctx + 1) & LAST_CONTEXT; | 134 | next_mmu_context = (ctx + 1) & LAST_CONTEXT; |
135 | mm->context = ctx; | 135 | mm->context.id = ctx; |
136 | #ifdef FEW_CONTEXTS | 136 | #ifdef FEW_CONTEXTS |
137 | context_mm[ctx] = mm; | 137 | context_mm[ctx] = mm; |
138 | #endif | 138 | #endif |
@@ -141,7 +141,12 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
141 | /* | 141 | /* |
142 | * Set up the context for a new address space. | 142 | * Set up the context for a new address space. |
143 | */ | 143 | */ |
144 | #define init_new_context(tsk,mm) (((mm)->context = NO_CONTEXT), 0) | 144 | static inline int init_new_context(struct task_struct *t, struct mm_struct *mm) |
145 | { | ||
146 | mm->context.id = NO_CONTEXT; | ||
147 | mm->context.vdso_base = 0; | ||
148 | return 0; | ||
149 | } | ||
145 | 150 | ||
146 | /* | 151 | /* |
147 | * We're finished using the context for an address space. | 152 | * We're finished using the context for an address space. |
@@ -149,9 +154,9 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
149 | static inline void destroy_context(struct mm_struct *mm) | 154 | static inline void destroy_context(struct mm_struct *mm) |
150 | { | 155 | { |
151 | preempt_disable(); | 156 | preempt_disable(); |
152 | if (mm->context != NO_CONTEXT) { | 157 | if (mm->context.id != NO_CONTEXT) { |
153 | clear_bit(mm->context, context_map); | 158 | clear_bit(mm->context.id, context_map); |
154 | mm->context = NO_CONTEXT; | 159 | mm->context.id = NO_CONTEXT; |
155 | #ifdef FEW_CONTEXTS | 160 | #ifdef FEW_CONTEXTS |
156 | atomic_inc(&nr_free_contexts); | 161 | atomic_inc(&nr_free_contexts); |
157 | #endif | 162 | #endif |
@@ -179,7 +184,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
179 | 184 | ||
180 | /* Setup new userspace context */ | 185 | /* Setup new userspace context */ |
181 | get_mmu_context(next); | 186 | get_mmu_context(next); |
182 | set_context(next->context, next->pgd); | 187 | set_context(next->context.id, next->pgd); |
183 | } | 188 | } |
184 | 189 | ||
185 | #define deactivate_mm(tsk,mm) do { } while (0) | 190 | #define deactivate_mm(tsk,mm) do { } while (0) |
diff --git a/include/asm-ppc/mpc85xx.h b/include/asm-ppc/mpc85xx.h index c25bdd9debf8..9b4851199c76 100644 --- a/include/asm-ppc/mpc85xx.h +++ b/include/asm-ppc/mpc85xx.h | |||
@@ -27,6 +27,9 @@ | |||
27 | #if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS) | 27 | #if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS) |
28 | #include <platforms/85xx/mpc8555_cds.h> | 28 | #include <platforms/85xx/mpc8555_cds.h> |
29 | #endif | 29 | #endif |
30 | #ifdef CONFIG_MPC85xx_CDS | ||
31 | #include <platforms/85xx/mpc85xx_cds.h> | ||
32 | #endif | ||
30 | #ifdef CONFIG_MPC8560_ADS | 33 | #ifdef CONFIG_MPC8560_ADS |
31 | #include <platforms/85xx/mpc8560_ads.h> | 34 | #include <platforms/85xx/mpc8560_ads.h> |
32 | #endif | 35 | #endif |
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 9cb83679836c..51fa7c662917 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
@@ -662,7 +662,7 @@ static inline int __ptep_test_and_clear_young(unsigned int context, unsigned lon | |||
662 | return (old & _PAGE_ACCESSED) != 0; | 662 | return (old & _PAGE_ACCESSED) != 0; |
663 | } | 663 | } |
664 | #define ptep_test_and_clear_young(__vma, __addr, __ptep) \ | 664 | #define ptep_test_and_clear_young(__vma, __addr, __ptep) \ |
665 | __ptep_test_and_clear_young((__vma)->vm_mm->context, __addr, __ptep) | 665 | __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep) |
666 | 666 | ||
667 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | 667 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY |
668 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, | 668 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, |
diff --git a/include/asm-s390/irq.h b/include/asm-s390/irq.h index 916a1aa0b073..bd1a721f7aa2 100644 --- a/include/asm-s390/irq.h +++ b/include/asm-s390/irq.h | |||
@@ -21,10 +21,6 @@ enum interruption_class { | |||
21 | 21 | ||
22 | #define touch_nmi_watchdog() do { } while(0) | 22 | #define touch_nmi_watchdog() do { } while(0) |
23 | 23 | ||
24 | struct irqaction; | ||
25 | struct pt_regs; | ||
26 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
27 | |||
28 | #endif /* __KERNEL__ */ | 24 | #endif /* __KERNEL__ */ |
29 | #endif | 25 | #endif |
30 | 26 | ||
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h index f2d64537e29d..3141ddfea97d 100644 --- a/include/asm-sparc/irq.h +++ b/include/asm-sparc/irq.h | |||
@@ -181,8 +181,4 @@ extern struct sun4m_intregs *sun4m_interrupts; | |||
181 | #define SUN4M_INT_SBUS(x) (1 << (x+7)) | 181 | #define SUN4M_INT_SBUS(x) (1 << (x+7)) |
182 | #define SUN4M_INT_VME(x) (1 << (x)) | 182 | #define SUN4M_INT_VME(x) (1 << (x)) |
183 | 183 | ||
184 | struct irqaction; | ||
185 | struct pt_regs; | ||
186 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
187 | |||
188 | #endif | 184 | #endif |
diff --git a/include/asm-sparc64/vga.h b/include/asm-sparc64/vga.h index 9c57eb363b40..c69d5b2ba19a 100644 --- a/include/asm-sparc64/vga.h +++ b/include/asm-sparc64/vga.h | |||
@@ -28,6 +28,6 @@ static inline u16 scr_readw(const u16 *addr) | |||
28 | return *addr; | 28 | return *addr; |
29 | } | 29 | } |
30 | 30 | ||
31 | #define VGA_MAP_MEM(x) (x) | 31 | #define VGA_MAP_MEM(x,s) (x) |
32 | 32 | ||
33 | #endif | 33 | #endif |
diff --git a/include/asm-v850/irq.h b/include/asm-v850/irq.h index 44431152b36d..1bf096db8f4c 100644 --- a/include/asm-v850/irq.h +++ b/include/asm-v850/irq.h | |||
@@ -62,8 +62,6 @@ extern void disable_irq (unsigned int irq); | |||
62 | /* Disable an irq without waiting. */ | 62 | /* Disable an irq without waiting. */ |
63 | extern void disable_irq_nosync (unsigned int irq); | 63 | extern void disable_irq_nosync (unsigned int irq); |
64 | 64 | ||
65 | extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | ||
66 | |||
67 | #endif /* !__ASSEMBLY__ */ | 65 | #endif /* !__ASSEMBLY__ */ |
68 | 66 | ||
69 | #endif /* __V850_IRQ_H__ */ | 67 | #endif /* __V850_IRQ_H__ */ |
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h index aa1c7b2e438c..2c95a319c056 100644 --- a/include/asm-x86_64/acpi.h +++ b/include/asm-x86_64/acpi.h | |||
@@ -162,6 +162,8 @@ extern int acpi_pci_disabled; | |||
162 | 162 | ||
163 | extern u8 x86_acpiid_to_apicid[]; | 163 | extern u8 x86_acpiid_to_apicid[]; |
164 | 164 | ||
165 | #define ARCH_HAS_POWER_INIT 1 | ||
166 | |||
165 | extern int acpi_skip_timer_override; | 167 | extern int acpi_skip_timer_override; |
166 | 168 | ||
167 | #endif /*__KERNEL__*/ | 169 | #endif /*__KERNEL__*/ |
diff --git a/include/asm-x86_64/apicdef.h b/include/asm-x86_64/apicdef.h index 5a48e9bcf218..1dd40067c67c 100644 --- a/include/asm-x86_64/apicdef.h +++ b/include/asm-x86_64/apicdef.h | |||
@@ -137,8 +137,6 @@ | |||
137 | */ | 137 | */ |
138 | #define u32 unsigned int | 138 | #define u32 unsigned int |
139 | 139 | ||
140 | #define lapic ((volatile struct local_apic *)APIC_BASE) | ||
141 | |||
142 | struct local_apic { | 140 | struct local_apic { |
143 | 141 | ||
144 | /*000*/ struct { u32 __reserved[4]; } __reserved_01; | 142 | /*000*/ struct { u32 __reserved[4]; } __reserved_01; |
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index 70bb9969766e..c38ebdf6f426 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h | |||
@@ -42,7 +42,6 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | |||
42 | 42 | ||
43 | #ifdef CONFIG_DISCONTIGMEM | 43 | #ifdef CONFIG_DISCONTIGMEM |
44 | #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) | 44 | #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) |
45 | #define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr)) | ||
46 | 45 | ||
47 | extern int pfn_valid(unsigned long pfn); | 46 | extern int pfn_valid(unsigned long pfn); |
48 | #endif | 47 | #endif |
diff --git a/include/asm-x86_64/msi.h b/include/asm-x86_64/msi.h index 356e0e82f50b..3ad2346624b2 100644 --- a/include/asm-x86_64/msi.h +++ b/include/asm-x86_64/msi.h | |||
@@ -10,7 +10,15 @@ | |||
10 | #include <asm/mach_apic.h> | 10 | #include <asm/mach_apic.h> |
11 | #include <asm/smp.h> | 11 | #include <asm/smp.h> |
12 | 12 | ||
13 | #define LAST_DEVICE_VECTOR 232 | 13 | #define LAST_DEVICE_VECTOR (FIRST_SYSTEM_VECTOR - 1) |
14 | #define MSI_TARGET_CPU_SHIFT 12 | 14 | #define MSI_TARGET_CPU_SHIFT 12 |
15 | 15 | ||
16 | extern struct msi_ops msi_apic_ops; | ||
17 | |||
18 | static inline int msi_arch_init(void) | ||
19 | { | ||
20 | msi_register(&msi_apic_ops); | ||
21 | return 0; | ||
22 | } | ||
23 | |||
16 | #endif /* ASM_MSI_H */ | 24 | #endif /* ASM_MSI_H */ |
diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h index 1cc92fe02503..933ff11ece15 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86_64/numa.h | |||
@@ -8,7 +8,6 @@ struct bootnode { | |||
8 | }; | 8 | }; |
9 | 9 | ||
10 | extern int compute_hash_shift(struct bootnode *nodes, int numnodes); | 10 | extern int compute_hash_shift(struct bootnode *nodes, int numnodes); |
11 | extern int pxm_to_node(int nid); | ||
12 | 11 | ||
13 | #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) | 12 | #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) |
14 | 13 | ||
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index 0aff22bdbb21..94387c915e53 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h | |||
@@ -617,10 +617,12 @@ __SYSCALL(__NR_tee, sys_tee) | |||
617 | __SYSCALL(__NR_sync_file_range, sys_sync_file_range) | 617 | __SYSCALL(__NR_sync_file_range, sys_sync_file_range) |
618 | #define __NR_vmsplice 278 | 618 | #define __NR_vmsplice 278 |
619 | __SYSCALL(__NR_vmsplice, sys_vmsplice) | 619 | __SYSCALL(__NR_vmsplice, sys_vmsplice) |
620 | #define __NR_move_pages 279 | ||
621 | __SYSCALL(__NR_move_pages, sys_move_pages) | ||
620 | 622 | ||
621 | #ifdef __KERNEL__ | 623 | #ifdef __KERNEL__ |
622 | 624 | ||
623 | #define __NR_syscall_max __NR_vmsplice | 625 | #define __NR_syscall_max __NR_move_pages |
624 | 626 | ||
625 | #ifndef __NO_STUBS | 627 | #ifndef __NO_STUBS |
626 | 628 | ||
diff --git a/include/asm-x86_64/vga.h b/include/asm-x86_64/vga.h index ef0c0e50cc95..0ecf68ac03aa 100644 --- a/include/asm-x86_64/vga.h +++ b/include/asm-x86_64/vga.h | |||
@@ -12,7 +12,7 @@ | |||
12 | * access the videoram directly without any black magic. | 12 | * access the videoram directly without any black magic. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) | 15 | #define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x) |
16 | 16 | ||
17 | #define vga_readb(x) (*(x)) | 17 | #define vga_readb(x) (*(x)) |
18 | #define vga_writeb(x,y) (*(y) = (x)) | 18 | #define vga_writeb(x,y) (*(y) = (x)) |
diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h index bdc00ae9be48..03114f8d1e18 100644 --- a/include/asm-xtensa/checksum.h +++ b/include/asm-xtensa/checksum.h | |||
@@ -43,8 +43,7 @@ asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, i | |||
43 | * Note: when you get a NULL pointer exception here this means someone | 43 | * Note: when you get a NULL pointer exception here this means someone |
44 | * passed in an incorrect kernel address to one of these functions. | 44 | * passed in an incorrect kernel address to one of these functions. |
45 | * | 45 | * |
46 | * If you use these functions directly please don't forget the | 46 | * If you use these functions directly please don't forget the access_ok(). |
47 | * verify_area(). | ||
48 | */ | 47 | */ |
49 | static inline | 48 | static inline |
50 | unsigned int csum_partial_copy_nocheck ( const char *src, char *dst, | 49 | unsigned int csum_partial_copy_nocheck ( const char *src, char *dst, |
diff --git a/include/asm-xtensa/rwsem.h b/include/asm-xtensa/rwsem.h index 3c02b0e033f0..abcd86dc5ab9 100644 --- a/include/asm-xtensa/rwsem.h +++ b/include/asm-xtensa/rwsem.h | |||
@@ -172,4 +172,9 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | |||
172 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); | 172 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); |
173 | } | 173 | } |
174 | 174 | ||
175 | #endif /* _XTENSA_RWSEM_XADD_H */ | 175 | static inline int rwsem_is_locked(struct rw_semaphore *sem) |
176 | { | ||
177 | return (sem->count != 0); | ||
178 | } | ||
179 | |||
180 | #endif /* _XTENSA_RWSEM_H */ | ||
diff --git a/include/asm-xtensa/uaccess.h b/include/asm-xtensa/uaccess.h index 06a22b83ba17..88a64e1144d5 100644 --- a/include/asm-xtensa/uaccess.h +++ b/include/asm-xtensa/uaccess.h | |||
@@ -154,35 +154,6 @@ | |||
154 | .Laccess_ok_\@: | 154 | .Laccess_ok_\@: |
155 | .endm | 155 | .endm |
156 | 156 | ||
157 | /* | ||
158 | * verify_area determines whether a memory access is allowed. It's | ||
159 | * mostly an unnecessary wrapper for access_ok, but we provide it as a | ||
160 | * duplicate of the verify_area() C inline function below. See the | ||
161 | * equivalent C version below for clarity. | ||
162 | * | ||
163 | * On error, verify_area branches to a label indicated by parameter | ||
164 | * <error>. This implies that the macro falls through to the next | ||
165 | * instruction on success. | ||
166 | * | ||
167 | * Note that we assume success is the common case, and we optimize the | ||
168 | * branch fall-through case on success. | ||
169 | * | ||
170 | * On Entry: | ||
171 | * <aa> register containing memory address | ||
172 | * <as> register containing memory size | ||
173 | * <at> temp register | ||
174 | * <error> label to branch to on error; implies fall-through | ||
175 | * macro on success | ||
176 | * On Exit: | ||
177 | * <aa> preserved | ||
178 | * <as> preserved | ||
179 | * <at> destroyed | ||
180 | */ | ||
181 | .macro verify_area aa, as, at, sp, error | ||
182 | access_ok \at, \aa, \as, \sp, \error | ||
183 | .endm | ||
184 | |||
185 | |||
186 | #else /* __ASSEMBLY__ not defined */ | 157 | #else /* __ASSEMBLY__ not defined */ |
187 | 158 | ||
188 | #include <linux/sched.h> | 159 | #include <linux/sched.h> |
@@ -211,11 +182,6 @@ | |||
211 | #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) | 182 | #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) |
212 | #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) | 183 | #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) |
213 | 184 | ||
214 | static inline int verify_area(int type, const void * addr, unsigned long size) | ||
215 | { | ||
216 | return access_ok(type,addr,size) ? 0 : -EFAULT; | ||
217 | } | ||
218 | |||
219 | /* | 185 | /* |
220 | * These are the main single-value transfer routines. They | 186 | * These are the main single-value transfer routines. They |
221 | * automatically use the right size if we just have the right pointer | 187 | * automatically use the right size if we just have the right pointer |
diff --git a/include/asm-xtensa/vga.h b/include/asm-xtensa/vga.h index 23d82f6acb57..1fd8cab3a297 100644 --- a/include/asm-xtensa/vga.h +++ b/include/asm-xtensa/vga.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #ifndef _XTENSA_VGA_H | 11 | #ifndef _XTENSA_VGA_H |
12 | #define _XTENSA_VGA_H | 12 | #define _XTENSA_VGA_H |
13 | 13 | ||
14 | #define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x) | 14 | #define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x) |
15 | 15 | ||
16 | #define vga_readb(x) (*(x)) | 16 | #define vga_readb(x) (*(x)) |
17 | #define vga_writeb(x,y) (*(y) = (x)) | 17 | #define vga_writeb(x,y) (*(y) = (x)) |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 1cf0b91d05bd..90d6df1551ed 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <acpi/acpi.h> | 37 | #include <acpi/acpi.h> |
38 | #include <acpi/acpi_bus.h> | 38 | #include <acpi/acpi_bus.h> |
39 | #include <acpi/acpi_drivers.h> | 39 | #include <acpi/acpi_drivers.h> |
40 | #include <acpi/acpi_numa.h> | ||
40 | #include <asm/acpi.h> | 41 | #include <asm/acpi.h> |
41 | 42 | ||
42 | 43 | ||
@@ -407,10 +408,18 @@ void acpi_table_print_madt_entry (acpi_table_entry_header *madt); | |||
407 | void acpi_table_print_srat_entry (acpi_table_entry_header *srat); | 408 | void acpi_table_print_srat_entry (acpi_table_entry_header *srat); |
408 | 409 | ||
409 | /* the following four functions are architecture-dependent */ | 410 | /* the following four functions are architecture-dependent */ |
411 | #ifdef CONFIG_HAVE_ARCH_PARSE_SRAT | ||
412 | #define NR_NODE_MEMBLKS MAX_NUMNODES | ||
413 | #define acpi_numa_slit_init(slit) do {} while (0) | ||
414 | #define acpi_numa_processor_affinity_init(pa) do {} while (0) | ||
415 | #define acpi_numa_memory_affinity_init(ma) do {} while (0) | ||
416 | #define acpi_numa_arch_fixup() do {} while (0) | ||
417 | #else | ||
410 | void acpi_numa_slit_init (struct acpi_table_slit *slit); | 418 | void acpi_numa_slit_init (struct acpi_table_slit *slit); |
411 | void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); | 419 | void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); |
412 | void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); | 420 | void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); |
413 | void acpi_numa_arch_fixup(void); | 421 | void acpi_numa_arch_fixup(void); |
422 | #endif | ||
414 | 423 | ||
415 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 424 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
416 | /* Arch dependent functions for cpu hotplug support */ | 425 | /* Arch dependent functions for cpu hotplug support */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3457e7b97363..aafe82788b4e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -151,11 +151,9 @@ struct request { | |||
151 | void *elevator_private; | 151 | void *elevator_private; |
152 | void *completion_data; | 152 | void *completion_data; |
153 | 153 | ||
154 | unsigned short ioprio; | ||
155 | |||
156 | int rq_status; /* should split this into a few status bits */ | 154 | int rq_status; /* should split this into a few status bits */ |
157 | struct gendisk *rq_disk; | ||
158 | int errors; | 155 | int errors; |
156 | struct gendisk *rq_disk; | ||
159 | unsigned long start_time; | 157 | unsigned long start_time; |
160 | 158 | ||
161 | /* Number of scatter-gather DMA addr+len pairs after | 159 | /* Number of scatter-gather DMA addr+len pairs after |
@@ -170,8 +168,9 @@ struct request { | |||
170 | */ | 168 | */ |
171 | unsigned short nr_hw_segments; | 169 | unsigned short nr_hw_segments; |
172 | 170 | ||
171 | unsigned short ioprio; | ||
172 | |||
173 | int tag; | 173 | int tag; |
174 | char *buffer; | ||
175 | 174 | ||
176 | int ref_count; | 175 | int ref_count; |
177 | request_queue_t *q; | 176 | request_queue_t *q; |
@@ -179,6 +178,7 @@ struct request { | |||
179 | 178 | ||
180 | struct completion *waiting; | 179 | struct completion *waiting; |
181 | void *special; | 180 | void *special; |
181 | char *buffer; | ||
182 | 182 | ||
183 | /* | 183 | /* |
184 | * when request is used as a packet command carrier | 184 | * when request is used as a packet command carrier |
@@ -187,20 +187,14 @@ struct request { | |||
187 | unsigned char cmd[BLK_MAX_CDB]; | 187 | unsigned char cmd[BLK_MAX_CDB]; |
188 | 188 | ||
189 | unsigned int data_len; | 189 | unsigned int data_len; |
190 | void *data; | ||
191 | |||
192 | unsigned int sense_len; | 190 | unsigned int sense_len; |
191 | void *data; | ||
193 | void *sense; | 192 | void *sense; |
194 | 193 | ||
195 | unsigned int timeout; | 194 | unsigned int timeout; |
196 | int retries; | 195 | int retries; |
197 | 196 | ||
198 | /* | 197 | /* |
199 | * For Power Management requests | ||
200 | */ | ||
201 | struct request_pm_state *pm; | ||
202 | |||
203 | /* | ||
204 | * completion callback. end_io_data should be folded in with waiting | 198 | * completion callback. end_io_data should be folded in with waiting |
205 | */ | 199 | */ |
206 | rq_end_io_fn *end_io; | 200 | rq_end_io_fn *end_io; |
@@ -241,6 +235,7 @@ enum rq_flag_bits { | |||
241 | __REQ_PM_RESUME, /* resume request */ | 235 | __REQ_PM_RESUME, /* resume request */ |
242 | __REQ_PM_SHUTDOWN, /* shutdown request */ | 236 | __REQ_PM_SHUTDOWN, /* shutdown request */ |
243 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | 237 | __REQ_ORDERED_COLOR, /* is before or after barrier */ |
238 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ | ||
244 | __REQ_NR_BITS, /* stops here */ | 239 | __REQ_NR_BITS, /* stops here */ |
245 | }; | 240 | }; |
246 | 241 | ||
@@ -270,6 +265,7 @@ enum rq_flag_bits { | |||
270 | #define REQ_PM_RESUME (1 << __REQ_PM_RESUME) | 265 | #define REQ_PM_RESUME (1 << __REQ_PM_RESUME) |
271 | #define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) | 266 | #define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) |
272 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | 267 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) |
268 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) | ||
273 | 269 | ||
274 | /* | 270 | /* |
275 | * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME | 271 | * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index eb1a867ed245..a7e8cef73d15 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -90,9 +90,9 @@ struct blk_io_trace { | |||
90 | * The remap event | 90 | * The remap event |
91 | */ | 91 | */ |
92 | struct blk_io_trace_remap { | 92 | struct blk_io_trace_remap { |
93 | u32 device; | 93 | __be32 device; |
94 | u32 __pad; | 94 | u32 __pad; |
95 | u64 sector; | 95 | __be64 sector; |
96 | }; | 96 | }; |
97 | 97 | ||
98 | enum { | 98 | enum { |
@@ -224,7 +224,7 @@ static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what, | |||
224 | struct bio *bio, unsigned int pdu) | 224 | struct bio *bio, unsigned int pdu) |
225 | { | 225 | { |
226 | struct blk_trace *bt = q->blk_trace; | 226 | struct blk_trace *bt = q->blk_trace; |
227 | u64 rpdu = cpu_to_be64(pdu); | 227 | __be64 rpdu = cpu_to_be64(pdu); |
228 | 228 | ||
229 | if (likely(!bt)) | 229 | if (likely(!bt)) |
230 | return; | 230 | return; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index da2d107fe2cf..22866fa2d960 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -91,8 +91,8 @@ static inline void *alloc_remap(int nid, unsigned long size) | |||
91 | } | 91 | } |
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | extern unsigned long __initdata nr_kernel_pages; | 94 | extern unsigned long nr_kernel_pages; |
95 | extern unsigned long __initdata nr_all_pages; | 95 | extern unsigned long nr_all_pages; |
96 | 96 | ||
97 | extern void *__init alloc_large_system_hash(const char *tablename, | 97 | extern void *__init alloc_large_system_hash(const char *tablename, |
98 | unsigned long bucketsize, | 98 | unsigned long bucketsize, |
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h index 1417de935057..dbb7769009be 100644 --- a/include/linux/cn_proc.h +++ b/include/linux/cn_proc.h | |||
@@ -3,31 +3,22 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) Matt Helsley, IBM Corp. 2005 | 4 | * Copyright (C) Matt Helsley, IBM Corp. 2005 |
5 | * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin | 5 | * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin |
6 | * Original copyright notice follows: | ||
7 | * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com> | 6 | * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com> |
8 | * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net> | 7 | * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net> |
9 | * | 8 | * |
10 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify it |
11 | * it under the terms of the GNU General Public License as published by | 10 | * under the terms of version 2.1 of the GNU Lesser General Public License |
12 | * the Free Software Foundation; either version 2 of the License, or | 11 | * as published by the Free Software Foundation. |
13 | * (at your option) any later version. | ||
14 | * | 12 | * |
15 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it would be useful, but |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | */ | 16 | */ |
24 | 17 | ||
25 | #ifndef CN_PROC_H | 18 | #ifndef CN_PROC_H |
26 | #define CN_PROC_H | 19 | #define CN_PROC_H |
27 | 20 | ||
28 | #include <linux/types.h> | 21 | #include <linux/types.h> |
29 | #include <linux/time.h> | ||
30 | #include <linux/connector.h> | ||
31 | 22 | ||
32 | /* | 23 | /* |
33 | * Userspace sends this enum to register with the kernel that it is listening | 24 | * Userspace sends this enum to register with the kernel that it is listening |
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index b3ecf8f71d97..7b5c5df5cb69 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h | |||
@@ -36,7 +36,7 @@ extern const struct file_operations coda_ioctl_operations; | |||
36 | 36 | ||
37 | /* operations shared over more than one file */ | 37 | /* operations shared over more than one file */ |
38 | int coda_open(struct inode *i, struct file *f); | 38 | int coda_open(struct inode *i, struct file *f); |
39 | int coda_flush(struct file *f); | 39 | int coda_flush(struct file *f, fl_owner_t id); |
40 | int coda_release(struct inode *i, struct file *f); | 40 | int coda_release(struct inode *i, struct file *f); |
41 | int coda_permission(struct inode *inode, int mask, struct nameidata *nd); | 41 | int coda_permission(struct inode *inode, int mask, struct nameidata *nd); |
42 | int coda_revalidate_inode(struct dentry *); | 42 | int coda_revalidate_inode(struct dentry *); |
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index d539262a8f89..98f6c52c152b 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h | |||
@@ -70,7 +70,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid, | |||
70 | unsigned int cmd, struct PioctlData *data); | 70 | unsigned int cmd, struct PioctlData *data); |
71 | int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); | 71 | int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); |
72 | int venus_fsync(struct super_block *sb, struct CodaFid *fid); | 72 | int venus_fsync(struct super_block *sb, struct CodaFid *fid); |
73 | int venus_statfs(struct super_block *sb, struct kstatfs *sfs); | 73 | int venus_statfs(struct dentry *dentry, struct kstatfs *sfs); |
74 | 74 | ||
75 | 75 | ||
76 | /* messages between coda filesystem in kernel and Venus */ | 76 | /* messages between coda filesystem in kernel and Venus */ |
diff --git a/include/linux/connector.h b/include/linux/connector.h index ad1a22c1c42e..4c02119c6ab9 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -34,8 +34,11 @@ | |||
34 | #define CN_VAL_PROC 0x1 | 34 | #define CN_VAL_PROC 0x1 |
35 | #define CN_IDX_CIFS 0x2 | 35 | #define CN_IDX_CIFS 0x2 |
36 | #define CN_VAL_CIFS 0x1 | 36 | #define CN_VAL_CIFS 0x1 |
37 | #define CN_W1_IDX 0x3 /* w1 communication */ | ||
38 | #define CN_W1_VAL 0x1 | ||
37 | 39 | ||
38 | #define CN_NETLINK_USERS 1 | 40 | |
41 | #define CN_NETLINK_USERS 4 | ||
39 | 42 | ||
40 | /* | 43 | /* |
41 | * Maximum connector's message size. | 44 | * Maximum connector's message size. |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 5aa95011f7e6..466fbe9e4899 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -72,6 +72,8 @@ struct cpufreq_real_policy { | |||
72 | 72 | ||
73 | struct cpufreq_policy { | 73 | struct cpufreq_policy { |
74 | cpumask_t cpus; /* affected CPUs */ | 74 | cpumask_t cpus; /* affected CPUs */ |
75 | unsigned int shared_type; /* ANY or ALL affected CPUs | ||
76 | should set cpufreq */ | ||
75 | unsigned int cpu; /* cpu nr of registered CPU */ | 77 | unsigned int cpu; /* cpu nr of registered CPU */ |
76 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 78 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
77 | 79 | ||
@@ -98,6 +100,8 @@ struct cpufreq_policy { | |||
98 | #define CPUFREQ_INCOMPATIBLE (1) | 100 | #define CPUFREQ_INCOMPATIBLE (1) |
99 | #define CPUFREQ_NOTIFY (2) | 101 | #define CPUFREQ_NOTIFY (2) |
100 | 102 | ||
103 | #define CPUFREQ_SHARED_TYPE_ALL (0) /* All dependent CPUs should set freq */ | ||
104 | #define CPUFREQ_SHARED_TYPE_ANY (1) /* Freq can be set from any dependent CPU */ | ||
101 | 105 | ||
102 | /******************** cpufreq transition notifiers *******************/ | 106 | /******************** cpufreq transition notifiers *******************/ |
103 | 107 | ||
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 836325ee0931..0dd1610a94a9 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -217,7 +217,6 @@ extern struct dentry * d_alloc_anon(struct inode *); | |||
217 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | 217 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); |
218 | extern void shrink_dcache_sb(struct super_block *); | 218 | extern void shrink_dcache_sb(struct super_block *); |
219 | extern void shrink_dcache_parent(struct dentry *); | 219 | extern void shrink_dcache_parent(struct dentry *); |
220 | extern void shrink_dcache_anon(struct hlist_head *); | ||
221 | extern int d_invalidate(struct dentry *); | 220 | extern int d_invalidate(struct dentry *); |
222 | 221 | ||
223 | /* only used at mount-time */ | 222 | /* only used at mount-time */ |
diff --git a/include/linux/delay.h b/include/linux/delay.h index acb74865b973..17ddb55430ae 100644 --- a/include/linux/delay.h +++ b/include/linux/delay.h | |||
@@ -25,10 +25,7 @@ extern unsigned long loops_per_jiffy; | |||
25 | #define MAX_UDELAY_MS 5 | 25 | #define MAX_UDELAY_MS 5 |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #ifdef notdef | 28 | #ifndef mdelay |
29 | #define mdelay(n) (\ | ||
30 | {unsigned long __ms=(n); while (__ms--) udelay(1000);}) | ||
31 | #else | ||
32 | #define mdelay(n) (\ | 29 | #define mdelay(n) (\ |
33 | (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \ | 30 | (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \ |
34 | ({unsigned long __ms=(n); while (__ms--) udelay(1000);})) | 31 | ({unsigned long __ms=(n); while (__ms--) udelay(1000);})) |
diff --git a/include/linux/device.h b/include/linux/device.h index b2e5da2b637b..1e5f30da98bc 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -60,11 +60,6 @@ extern void bus_unregister(struct bus_type * bus); | |||
60 | 60 | ||
61 | extern void bus_rescan_devices(struct bus_type * bus); | 61 | extern void bus_rescan_devices(struct bus_type * bus); |
62 | 62 | ||
63 | extern struct bus_type * get_bus(struct bus_type * bus); | ||
64 | extern void put_bus(struct bus_type * bus); | ||
65 | |||
66 | extern struct bus_type * find_bus(char * name); | ||
67 | |||
68 | /* iterator helpers for buses */ | 63 | /* iterator helpers for buses */ |
69 | 64 | ||
70 | int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, | 65 | int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, |
@@ -147,6 +142,7 @@ struct class { | |||
147 | 142 | ||
148 | struct subsystem subsys; | 143 | struct subsystem subsys; |
149 | struct list_head children; | 144 | struct list_head children; |
145 | struct list_head devices; | ||
150 | struct list_head interfaces; | 146 | struct list_head interfaces; |
151 | struct semaphore sem; /* locks both the children and interfaces lists */ | 147 | struct semaphore sem; /* locks both the children and interfaces lists */ |
152 | 148 | ||
@@ -163,9 +159,6 @@ struct class { | |||
163 | extern int class_register(struct class *); | 159 | extern int class_register(struct class *); |
164 | extern void class_unregister(struct class *); | 160 | extern void class_unregister(struct class *); |
165 | 161 | ||
166 | extern struct class * class_get(struct class *); | ||
167 | extern void class_put(struct class *); | ||
168 | |||
169 | 162 | ||
170 | struct class_attribute { | 163 | struct class_attribute { |
171 | struct attribute attr; | 164 | struct attribute attr; |
@@ -313,6 +306,7 @@ struct device { | |||
313 | struct kobject kobj; | 306 | struct kobject kobj; |
314 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 307 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
315 | struct device_attribute uevent_attr; | 308 | struct device_attribute uevent_attr; |
309 | struct device_attribute *devt_attr; | ||
316 | 310 | ||
317 | struct semaphore sem; /* semaphore to synchronize calls to | 311 | struct semaphore sem; /* semaphore to synchronize calls to |
318 | * its driver. | 312 | * its driver. |
@@ -340,6 +334,11 @@ struct device { | |||
340 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem | 334 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem |
341 | override */ | 335 | override */ |
342 | 336 | ||
337 | /* class_device migration path */ | ||
338 | struct list_head node; | ||
339 | struct class *class; /* optional*/ | ||
340 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | ||
341 | |||
343 | void (*release)(struct device * dev); | 342 | void (*release)(struct device * dev); |
344 | }; | 343 | }; |
345 | 344 | ||
@@ -381,6 +380,13 @@ extern int device_attach(struct device * dev); | |||
381 | extern void driver_attach(struct device_driver * drv); | 380 | extern void driver_attach(struct device_driver * drv); |
382 | extern void device_reprobe(struct device *dev); | 381 | extern void device_reprobe(struct device *dev); |
383 | 382 | ||
383 | /* | ||
384 | * Easy functions for dynamically creating devices on the fly | ||
385 | */ | ||
386 | extern struct device *device_create(struct class *cls, struct device *parent, | ||
387 | dev_t devt, char *fmt, ...) | ||
388 | __attribute__((format(printf,4,5))); | ||
389 | extern void device_destroy(struct class *cls, dev_t devt); | ||
384 | 390 | ||
385 | /* | 391 | /* |
386 | * Platform "fixup" functions - allow the platform to have their say | 392 | * Platform "fixup" functions - allow the platform to have their say |
@@ -410,8 +416,9 @@ extern int firmware_register(struct subsystem *); | |||
410 | extern void firmware_unregister(struct subsystem *); | 416 | extern void firmware_unregister(struct subsystem *); |
411 | 417 | ||
412 | /* debugging and troubleshooting/diagnostic helpers. */ | 418 | /* debugging and troubleshooting/diagnostic helpers. */ |
419 | extern const char *dev_driver_string(struct device *dev); | ||
413 | #define dev_printk(level, dev, format, arg...) \ | 420 | #define dev_printk(level, dev, format, arg...) \ |
414 | printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg) | 421 | printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg) |
415 | 422 | ||
416 | #ifdef DEBUG | 423 | #ifdef DEBUG |
417 | #define dev_dbg(dev, format, arg...) \ | 424 | #define dev_dbg(dev, format, arg...) \ |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index cf2abeca92a0..c6310aef5ab0 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -411,6 +411,8 @@ struct ethtool_ops { | |||
411 | #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ | 411 | #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ |
412 | #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */ | 412 | #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */ |
413 | #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */ | 413 | #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */ |
414 | #define ETHTOOL_GGSO 0x00000023 /* Get GSO enable (ethtool_value) */ | ||
415 | #define ETHTOOL_SGSO 0x00000024 /* Set GSO enable (ethtool_value) */ | ||
414 | 416 | ||
415 | /* compatibility with older code */ | 417 | /* compatibility with older code */ |
416 | #define SPARC_ETH_GSET ETHTOOL_GSET | 418 | #define SPARC_ETH_GSET ETHTOOL_GSET |
diff --git a/include/linux/fs.h b/include/linux/fs.h index ecc8c2c3d8ca..dba4cbd157ee 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -376,7 +376,8 @@ struct address_space_operations { | |||
376 | struct page* (*get_xip_page)(struct address_space *, sector_t, | 376 | struct page* (*get_xip_page)(struct address_space *, sector_t, |
377 | int); | 377 | int); |
378 | /* migrate the contents of a page to the specified target */ | 378 | /* migrate the contents of a page to the specified target */ |
379 | int (*migratepage) (struct page *, struct page *); | 379 | int (*migratepage) (struct address_space *, |
380 | struct page *, struct page *); | ||
380 | }; | 381 | }; |
381 | 382 | ||
382 | struct backing_dev_info; | 383 | struct backing_dev_info; |
@@ -682,6 +683,7 @@ extern spinlock_t files_lock; | |||
682 | #define FL_FLOCK 2 | 683 | #define FL_FLOCK 2 |
683 | #define FL_ACCESS 8 /* not trying to lock, just looking */ | 684 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
684 | #define FL_LEASE 32 /* lease held on this file */ | 685 | #define FL_LEASE 32 /* lease held on this file */ |
686 | #define FL_CLOSE 64 /* unlock on close */ | ||
685 | #define FL_SLEEP 128 /* A blocking lock */ | 687 | #define FL_SLEEP 128 /* A blocking lock */ |
686 | 688 | ||
687 | /* | 689 | /* |
@@ -774,7 +776,6 @@ extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_l | |||
774 | extern int posix_lock_file(struct file *, struct file_lock *); | 776 | extern int posix_lock_file(struct file *, struct file_lock *); |
775 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 777 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
776 | extern int posix_unblock_lock(struct file *, struct file_lock *); | 778 | extern int posix_unblock_lock(struct file *, struct file_lock *); |
777 | extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); | ||
778 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 779 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); |
779 | extern int __break_lease(struct inode *inode, unsigned int flags); | 780 | extern int __break_lease(struct inode *inode, unsigned int flags); |
780 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 781 | extern void lease_get_mtime(struct inode *, struct timespec *time); |
@@ -782,7 +783,6 @@ extern int setlease(struct file *, long, struct file_lock **); | |||
782 | extern int lease_modify(struct file_lock **, int); | 783 | extern int lease_modify(struct file_lock **, int); |
783 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | 784 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); |
784 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | 785 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); |
785 | extern void steal_locks(fl_owner_t from); | ||
786 | 786 | ||
787 | struct fasync_struct { | 787 | struct fasync_struct { |
788 | int magic; | 788 | int magic; |
@@ -1025,7 +1025,7 @@ struct file_operations { | |||
1025 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | 1025 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
1026 | int (*mmap) (struct file *, struct vm_area_struct *); | 1026 | int (*mmap) (struct file *, struct vm_area_struct *); |
1027 | int (*open) (struct inode *, struct file *); | 1027 | int (*open) (struct inode *, struct file *); |
1028 | int (*flush) (struct file *); | 1028 | int (*flush) (struct file *, fl_owner_t id); |
1029 | int (*release) (struct inode *, struct file *); | 1029 | int (*release) (struct inode *, struct file *); |
1030 | int (*fsync) (struct file *, struct dentry *, int datasync); | 1030 | int (*fsync) (struct file *, struct dentry *, int datasync); |
1031 | int (*aio_fsync) (struct kiocb *, int datasync); | 1031 | int (*aio_fsync) (struct kiocb *, int datasync); |
@@ -1097,7 +1097,7 @@ struct super_operations { | |||
1097 | int (*sync_fs)(struct super_block *sb, int wait); | 1097 | int (*sync_fs)(struct super_block *sb, int wait); |
1098 | void (*write_super_lockfs) (struct super_block *); | 1098 | void (*write_super_lockfs) (struct super_block *); |
1099 | void (*unlockfs) (struct super_block *); | 1099 | void (*unlockfs) (struct super_block *); |
1100 | int (*statfs) (struct super_block *, struct kstatfs *); | 1100 | int (*statfs) (struct dentry *, struct kstatfs *); |
1101 | int (*remount_fs) (struct super_block *, int *, char *); | 1101 | int (*remount_fs) (struct super_block *, int *, char *); |
1102 | void (*clear_inode) (struct inode *); | 1102 | void (*clear_inode) (struct inode *); |
1103 | void (*umount_begin) (struct super_block *); | 1103 | void (*umount_begin) (struct super_block *); |
@@ -1270,23 +1270,26 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent, | |||
1270 | struct file_system_type { | 1270 | struct file_system_type { |
1271 | const char *name; | 1271 | const char *name; |
1272 | int fs_flags; | 1272 | int fs_flags; |
1273 | struct super_block *(*get_sb) (struct file_system_type *, int, | 1273 | int (*get_sb) (struct file_system_type *, int, |
1274 | const char *, void *); | 1274 | const char *, void *, struct vfsmount *); |
1275 | void (*kill_sb) (struct super_block *); | 1275 | void (*kill_sb) (struct super_block *); |
1276 | struct module *owner; | 1276 | struct module *owner; |
1277 | struct file_system_type * next; | 1277 | struct file_system_type * next; |
1278 | struct list_head fs_supers; | 1278 | struct list_head fs_supers; |
1279 | }; | 1279 | }; |
1280 | 1280 | ||
1281 | struct super_block *get_sb_bdev(struct file_system_type *fs_type, | 1281 | extern int get_sb_bdev(struct file_system_type *fs_type, |
1282 | int flags, const char *dev_name, void *data, | 1282 | int flags, const char *dev_name, void *data, |
1283 | int (*fill_super)(struct super_block *, void *, int)); | 1283 | int (*fill_super)(struct super_block *, void *, int), |
1284 | struct super_block *get_sb_single(struct file_system_type *fs_type, | 1284 | struct vfsmount *mnt); |
1285 | extern int get_sb_single(struct file_system_type *fs_type, | ||
1285 | int flags, void *data, | 1286 | int flags, void *data, |
1286 | int (*fill_super)(struct super_block *, void *, int)); | 1287 | int (*fill_super)(struct super_block *, void *, int), |
1287 | struct super_block *get_sb_nodev(struct file_system_type *fs_type, | 1288 | struct vfsmount *mnt); |
1289 | extern int get_sb_nodev(struct file_system_type *fs_type, | ||
1288 | int flags, void *data, | 1290 | int flags, void *data, |
1289 | int (*fill_super)(struct super_block *, void *, int)); | 1291 | int (*fill_super)(struct super_block *, void *, int), |
1292 | struct vfsmount *mnt); | ||
1290 | void generic_shutdown_super(struct super_block *sb); | 1293 | void generic_shutdown_super(struct super_block *sb); |
1291 | void kill_block_super(struct super_block *sb); | 1294 | void kill_block_super(struct super_block *sb); |
1292 | void kill_anon_super(struct super_block *sb); | 1295 | void kill_anon_super(struct super_block *sb); |
@@ -1297,8 +1300,10 @@ struct super_block *sget(struct file_system_type *type, | |||
1297 | int (*test)(struct super_block *,void *), | 1300 | int (*test)(struct super_block *,void *), |
1298 | int (*set)(struct super_block *,void *), | 1301 | int (*set)(struct super_block *,void *), |
1299 | void *data); | 1302 | void *data); |
1300 | struct super_block *get_sb_pseudo(struct file_system_type *, char *, | 1303 | extern int get_sb_pseudo(struct file_system_type *, char *, |
1301 | struct super_operations *ops, unsigned long); | 1304 | struct super_operations *ops, unsigned long, |
1305 | struct vfsmount *mnt); | ||
1306 | extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | ||
1302 | int __put_super(struct super_block *sb); | 1307 | int __put_super(struct super_block *sb); |
1303 | int __put_super_and_need_restart(struct super_block *sb); | 1308 | int __put_super_and_need_restart(struct super_block *sb); |
1304 | void unnamed_dev_init(void); | 1309 | void unnamed_dev_init(void); |
@@ -1321,7 +1326,7 @@ extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); | |||
1321 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, | 1326 | extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, |
1322 | struct vfsmount *); | 1327 | struct vfsmount *); |
1323 | 1328 | ||
1324 | extern int vfs_statfs(struct super_block *, struct kstatfs *); | 1329 | extern int vfs_statfs(struct dentry *, struct kstatfs *); |
1325 | 1330 | ||
1326 | /* /sys/fs */ | 1331 | /* /sys/fs */ |
1327 | extern struct subsystem fs_subsys; | 1332 | extern struct subsystem fs_subsys; |
@@ -1742,7 +1747,7 @@ extern int dcache_dir_close(struct inode *, struct file *); | |||
1742 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); | 1747 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); |
1743 | extern int dcache_readdir(struct file *, void *, filldir_t); | 1748 | extern int dcache_readdir(struct file *, void *, filldir_t); |
1744 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 1749 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
1745 | extern int simple_statfs(struct super_block *, struct kstatfs *); | 1750 | extern int simple_statfs(struct dentry *, struct kstatfs *); |
1746 | extern int simple_link(struct dentry *, struct inode *, struct dentry *); | 1751 | extern int simple_link(struct dentry *, struct inode *, struct dentry *); |
1747 | extern int simple_unlink(struct inode *, struct dentry *); | 1752 | extern int simple_unlink(struct inode *, struct dentry *); |
1748 | extern int simple_rmdir(struct inode *, struct dentry *); | 1753 | extern int simple_rmdir(struct inode *, struct dentry *); |
@@ -1768,7 +1773,8 @@ extern void simple_release_fs(struct vfsmount **mount, int *count); | |||
1768 | extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); | 1773 | extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); |
1769 | 1774 | ||
1770 | #ifdef CONFIG_MIGRATION | 1775 | #ifdef CONFIG_MIGRATION |
1771 | extern int buffer_migrate_page(struct page *, struct page *); | 1776 | extern int buffer_migrate_page(struct address_space *, |
1777 | struct page *, struct page *); | ||
1772 | #else | 1778 | #else |
1773 | #define buffer_migrate_page NULL | 1779 | #define buffer_migrate_page NULL |
1774 | #endif | 1780 | #endif |
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 7fd0576a4454..690c42803d2e 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
@@ -4,37 +4,32 @@ | |||
4 | * Uses for this includes on-device special memory, uncached memory | 4 | * Uses for this includes on-device special memory, uncached memory |
5 | * etc. | 5 | * etc. |
6 | * | 6 | * |
7 | * This code is based on the buddy allocator found in the sym53c8xx_2 | ||
8 | * driver, adapted for general purpose use. | ||
9 | * | ||
10 | * This source code is licensed under the GNU General Public License, | 7 | * This source code is licensed under the GNU General Public License, |
11 | * Version 2. See the file COPYING for more details. | 8 | * Version 2. See the file COPYING for more details. |
12 | */ | 9 | */ |
13 | 10 | ||
14 | #include <linux/spinlock.h> | ||
15 | 11 | ||
16 | #define ALLOC_MIN_SHIFT 5 /* 32 bytes minimum */ | ||
17 | /* | 12 | /* |
18 | * Link between free memory chunks of a given size. | 13 | * General purpose special memory pool descriptor. |
19 | */ | 14 | */ |
20 | struct gen_pool_link { | 15 | struct gen_pool { |
21 | struct gen_pool_link *next; | 16 | rwlock_t lock; |
17 | struct list_head chunks; /* list of chunks in this pool */ | ||
18 | int min_alloc_order; /* minimum allocation order */ | ||
22 | }; | 19 | }; |
23 | 20 | ||
24 | /* | 21 | /* |
25 | * Memory pool descriptor. | 22 | * General purpose special memory pool chunk descriptor. |
26 | */ | 23 | */ |
27 | struct gen_pool { | 24 | struct gen_pool_chunk { |
28 | spinlock_t lock; | 25 | spinlock_t lock; |
29 | unsigned long (*get_new_chunk)(struct gen_pool *); | 26 | struct list_head next_chunk; /* next chunk in pool */ |
30 | struct gen_pool *next; | 27 | unsigned long start_addr; /* starting address of memory chunk */ |
31 | struct gen_pool_link *h; | 28 | unsigned long end_addr; /* ending address of memory chunk */ |
32 | unsigned long private; | 29 | unsigned long bits[0]; /* bitmap for allocating memory chunk */ |
33 | int max_chunk_shift; | ||
34 | }; | 30 | }; |
35 | 31 | ||
36 | unsigned long gen_pool_alloc(struct gen_pool *poolp, int size); | 32 | extern struct gen_pool *gen_pool_create(int, int); |
37 | void gen_pool_free(struct gen_pool *mp, unsigned long ptr, int size); | 33 | extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int); |
38 | struct gen_pool *gen_pool_create(int nr_chunks, int max_chunk_shift, | 34 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); |
39 | unsigned long (*fp)(struct gen_pool *), | 35 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); |
40 | unsigned long data); | ||
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index df695e9ae327..4513f9e40937 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -188,7 +188,7 @@ int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr); | |||
188 | int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); | 188 | int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); |
189 | 189 | ||
190 | /* Must be used by hardware driver on module startup/exit */ | 190 | /* Must be used by hardware driver on module startup/exit */ |
191 | int register_hdlc_device(struct net_device *dev); | 191 | #define register_hdlc_device(dev) register_netdev(dev) |
192 | void unregister_hdlc_device(struct net_device *dev); | 192 | void unregister_hdlc_device(struct net_device *dev); |
193 | 193 | ||
194 | struct net_device *alloc_hdlcdev(void *priv); | 194 | struct net_device *alloc_hdlcdev(void *priv); |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 4c5e610fe442..c25a38d8f600 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -23,6 +23,8 @@ int hugetlb_report_node_meminfo(int, char *); | |||
23 | unsigned long hugetlb_total_pages(void); | 23 | unsigned long hugetlb_total_pages(void); |
24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
25 | unsigned long address, int write_access); | 25 | unsigned long address, int write_access); |
26 | int hugetlb_reserve_pages(struct inode *inode, long from, long to); | ||
27 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | ||
26 | 28 | ||
27 | extern unsigned long max_huge_pages; | 29 | extern unsigned long max_huge_pages; |
28 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
@@ -139,8 +141,6 @@ struct hugetlbfs_sb_info { | |||
139 | 141 | ||
140 | struct hugetlbfs_inode_info { | 142 | struct hugetlbfs_inode_info { |
141 | struct shared_policy policy; | 143 | struct shared_policy policy; |
142 | /* Protected by the (global) hugetlb_lock */ | ||
143 | unsigned long prereserved_hpages; | ||
144 | struct inode vfs_inode; | 144 | struct inode vfs_inode; |
145 | }; | 145 | }; |
146 | 146 | ||
@@ -157,10 +157,6 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
157 | extern const struct file_operations hugetlbfs_file_operations; | 157 | extern const struct file_operations hugetlbfs_file_operations; |
158 | extern struct vm_operations_struct hugetlb_vm_ops; | 158 | extern struct vm_operations_struct hugetlb_vm_ops; |
159 | struct file *hugetlb_zero_setup(size_t); | 159 | struct file *hugetlb_zero_setup(size_t); |
160 | int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info, | ||
161 | unsigned long atleast_hpages); | ||
162 | void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info, | ||
163 | unsigned long atmost_hpages); | ||
164 | int hugetlb_get_quota(struct address_space *mapping); | 160 | int hugetlb_get_quota(struct address_space *mapping); |
165 | void hugetlb_put_quota(struct address_space *mapping); | 161 | void hugetlb_put_quota(struct address_space *mapping); |
166 | 162 | ||
diff --git a/include/linux/i2c-ocores.h b/include/linux/i2c-ocores.h new file mode 100644 index 000000000000..8ed591b0887e --- /dev/null +++ b/include/linux/i2c-ocores.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * i2c-ocores.h - definitions for the i2c-ocores interface | ||
3 | * | ||
4 | * Peter Korsgaard <jacmet@sunsite.dk> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef _LINUX_I2C_OCORES_H | ||
12 | #define _LINUX_I2C_OCORES_H | ||
13 | |||
14 | struct ocores_i2c_platform_data { | ||
15 | u32 regstep; /* distance between registers */ | ||
16 | u32 clock_khz; /* input clock in kHz */ | ||
17 | }; | ||
18 | |||
19 | #endif /* _LINUX_I2C_OCORES_H */ | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 0510430e00db..526ddc8eecfb 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -97,13 +97,13 @@ extern s32 i2c_smbus_write_word_data(struct i2c_client * client, | |||
97 | u8 command, u16 value); | 97 | u8 command, u16 value); |
98 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | 98 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, |
99 | u8 command, u8 length, | 99 | u8 command, u8 length, |
100 | u8 *values); | 100 | const u8 *values); |
101 | /* Returns the number of read bytes */ | 101 | /* Returns the number of read bytes */ |
102 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | 102 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, |
103 | u8 command, u8 *values); | 103 | u8 command, u8 *values); |
104 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, | 104 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, |
105 | u8 command, u8 length, | 105 | u8 command, u8 length, |
106 | u8 *values); | 106 | const u8 *values); |
107 | 107 | ||
108 | /* | 108 | /* |
109 | * A driver is capable of handling one or more physical devices present on | 109 | * A driver is capable of handling one or more physical devices present on |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 9e0fefd7884a..70741e170114 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -7,32 +7,13 @@ | |||
7 | #include <linux/bitops.h> | 7 | #include <linux/bitops.h> |
8 | #include <linux/preempt.h> | 8 | #include <linux/preempt.h> |
9 | #include <linux/cpumask.h> | 9 | #include <linux/cpumask.h> |
10 | #include <linux/irqreturn.h> | ||
10 | #include <linux/hardirq.h> | 11 | #include <linux/hardirq.h> |
11 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
12 | #include <asm/atomic.h> | 13 | #include <asm/atomic.h> |
13 | #include <asm/ptrace.h> | 14 | #include <asm/ptrace.h> |
14 | #include <asm/system.h> | 15 | #include <asm/system.h> |
15 | 16 | ||
16 | /* | ||
17 | * For 2.4.x compatibility, 2.4.x can use | ||
18 | * | ||
19 | * typedef void irqreturn_t; | ||
20 | * #define IRQ_NONE | ||
21 | * #define IRQ_HANDLED | ||
22 | * #define IRQ_RETVAL(x) | ||
23 | * | ||
24 | * To mix old-style and new-style irq handler returns. | ||
25 | * | ||
26 | * IRQ_NONE means we didn't handle it. | ||
27 | * IRQ_HANDLED means that we did have a valid interrupt and handled it. | ||
28 | * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled) | ||
29 | */ | ||
30 | typedef int irqreturn_t; | ||
31 | |||
32 | #define IRQ_NONE (0) | ||
33 | #define IRQ_HANDLED (1) | ||
34 | #define IRQ_RETVAL(x) ((x) != 0) | ||
35 | |||
36 | struct irqaction { | 17 | struct irqaction { |
37 | irqreturn_t (*handler)(int, void *, struct pt_regs *); | 18 | irqreturn_t (*handler)(int, void *, struct pt_regs *); |
38 | unsigned long flags; | 19 | unsigned long flags; |
diff --git a/include/linux/ioc4.h b/include/linux/ioc4.h index 3dd18b785ebd..de73a3289cc2 100644 --- a/include/linux/ioc4.h +++ b/include/linux/ioc4.h | |||
@@ -147,6 +147,10 @@ struct ioc4_misc_regs { | |||
147 | #define IOC4_GPCR_EDGE_6 0x40 | 147 | #define IOC4_GPCR_EDGE_6 0x40 |
148 | #define IOC4_GPCR_EDGE_7 0x80 | 148 | #define IOC4_GPCR_EDGE_7 0x80 |
149 | 149 | ||
150 | #define IOC4_VARIANT_IO9 0x0900 | ||
151 | #define IOC4_VARIANT_PCI_RT 0x0901 | ||
152 | #define IOC4_VARIANT_IO10 0x1000 | ||
153 | |||
150 | /* One of these per IOC4 */ | 154 | /* One of these per IOC4 */ |
151 | struct ioc4_driver_data { | 155 | struct ioc4_driver_data { |
152 | struct list_head idd_list; | 156 | struct list_head idd_list; |
@@ -156,6 +160,7 @@ struct ioc4_driver_data { | |||
156 | struct __iomem ioc4_misc_regs *idd_misc_regs; | 160 | struct __iomem ioc4_misc_regs *idd_misc_regs; |
157 | unsigned long count_period; | 161 | unsigned long count_period; |
158 | void *idd_serial_data; | 162 | void *idd_serial_data; |
163 | unsigned int idd_variant; | ||
159 | }; | 164 | }; |
160 | 165 | ||
161 | /* One per submodule */ | 166 | /* One per submodule */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 42c9cd562860..676e00dfb21a 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/cache.h> | 17 | #include <linux/cache.h> |
18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
19 | #include <linux/cpumask.h> | 19 | #include <linux/cpumask.h> |
20 | #include <linux/irqreturn.h> | ||
20 | 21 | ||
21 | #include <asm/irq.h> | 22 | #include <asm/irq.h> |
22 | #include <asm/ptrace.h> | 23 | #include <asm/ptrace.h> |
@@ -164,10 +165,18 @@ static inline void set_irq_info(int irq, cpumask_t mask) | |||
164 | 165 | ||
165 | #endif // CONFIG_SMP | 166 | #endif // CONFIG_SMP |
166 | 167 | ||
168 | #ifdef CONFIG_IRQBALANCE | ||
169 | extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask); | ||
170 | #else | ||
171 | static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask) | ||
172 | { | ||
173 | } | ||
174 | #endif | ||
175 | |||
167 | extern int no_irq_affinity; | 176 | extern int no_irq_affinity; |
168 | extern int noirqdebug_setup(char *str); | 177 | extern int noirqdebug_setup(char *str); |
169 | 178 | ||
170 | extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs, | 179 | extern fastcall irqreturn_t handle_IRQ_event(unsigned int irq, struct pt_regs *regs, |
171 | struct irqaction *action); | 180 | struct irqaction *action); |
172 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); | 181 | extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); |
173 | extern void note_interrupt(unsigned int irq, irq_desc_t *desc, | 182 | extern void note_interrupt(unsigned int irq, irq_desc_t *desc, |
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h new file mode 100644 index 000000000000..881883c2009d --- /dev/null +++ b/include/linux/irqreturn.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* irqreturn.h */ | ||
2 | #ifndef _LINUX_IRQRETURN_H | ||
3 | #define _LINUX_IRQRETURN_H | ||
4 | |||
5 | /* | ||
6 | * For 2.4.x compatibility, 2.4.x can use | ||
7 | * | ||
8 | * typedef void irqreturn_t; | ||
9 | * #define IRQ_NONE | ||
10 | * #define IRQ_HANDLED | ||
11 | * #define IRQ_RETVAL(x) | ||
12 | * | ||
13 | * To mix old-style and new-style irq handler returns. | ||
14 | * | ||
15 | * IRQ_NONE means we didn't handle it. | ||
16 | * IRQ_HANDLED means that we did have a valid interrupt and handled it. | ||
17 | * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled) | ||
18 | */ | ||
19 | typedef int irqreturn_t; | ||
20 | |||
21 | #define IRQ_NONE (0) | ||
22 | #define IRQ_HANDLED (1) | ||
23 | #define IRQ_RETVAL(x) ((x) != 0) | ||
24 | |||
25 | #endif | ||
diff --git a/include/linux/isa.h b/include/linux/isa.h new file mode 100644 index 000000000000..1b855335cb11 --- /dev/null +++ b/include/linux/isa.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * ISA bus. | ||
3 | */ | ||
4 | |||
5 | #ifndef __LINUX_ISA_H | ||
6 | #define __LINUX_ISA_H | ||
7 | |||
8 | #include <linux/device.h> | ||
9 | #include <linux/kernel.h> | ||
10 | |||
11 | struct isa_driver { | ||
12 | int (*match)(struct device *, unsigned int); | ||
13 | int (*probe)(struct device *, unsigned int); | ||
14 | int (*remove)(struct device *, unsigned int); | ||
15 | void (*shutdown)(struct device *, unsigned int); | ||
16 | int (*suspend)(struct device *, unsigned int, pm_message_t); | ||
17 | int (*resume)(struct device *, unsigned int); | ||
18 | |||
19 | struct device_driver driver; | ||
20 | struct device *devices; | ||
21 | }; | ||
22 | |||
23 | #define to_isa_driver(x) container_of((x), struct isa_driver, driver) | ||
24 | |||
25 | int isa_register_driver(struct isa_driver *, unsigned int); | ||
26 | void isa_unregister_driver(struct isa_driver *); | ||
27 | |||
28 | #endif /* __LINUX_ISA_H */ | ||
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 6a425e370cb3..20eb34403d0c 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -501,6 +501,12 @@ struct transaction_s | |||
501 | struct journal_head *t_checkpoint_list; | 501 | struct journal_head *t_checkpoint_list; |
502 | 502 | ||
503 | /* | 503 | /* |
504 | * Doubly-linked circular list of all buffers submitted for IO while | ||
505 | * checkpointing. [j_list_lock] | ||
506 | */ | ||
507 | struct journal_head *t_checkpoint_io_list; | ||
508 | |||
509 | /* | ||
504 | * Doubly-linked circular list of temporary buffers currently undergoing | 510 | * Doubly-linked circular list of temporary buffers currently undergoing |
505 | * IO in the log [j_list_lock] | 511 | * IO in the log [j_list_lock] |
506 | */ | 512 | */ |
@@ -849,7 +855,7 @@ extern void journal_commit_transaction(journal_t *); | |||
849 | 855 | ||
850 | /* Checkpoint list management */ | 856 | /* Checkpoint list management */ |
851 | int __journal_clean_checkpoint_list(journal_t *journal); | 857 | int __journal_clean_checkpoint_list(journal_t *journal); |
852 | void __journal_remove_checkpoint(struct journal_head *); | 858 | int __journal_remove_checkpoint(struct journal_head *); |
853 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); | 859 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); |
854 | 860 | ||
855 | /* Buffer IO */ | 861 | /* Buffer IO */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f4fc576ed4c4..8c21aaa248b4 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -24,6 +24,9 @@ extern const char linux_banner[]; | |||
24 | #define LONG_MAX ((long)(~0UL>>1)) | 24 | #define LONG_MAX ((long)(~0UL>>1)) |
25 | #define LONG_MIN (-LONG_MAX - 1) | 25 | #define LONG_MIN (-LONG_MAX - 1) |
26 | #define ULONG_MAX (~0UL) | 26 | #define ULONG_MAX (~0UL) |
27 | #define LLONG_MAX ((long long)(~0ULL>>1)) | ||
28 | #define LLONG_MIN (-LLONG_MAX - 1) | ||
29 | #define ULLONG_MAX (~0ULL) | ||
27 | 30 | ||
28 | #define STACK_MAGIC 0xdeadbeef | 31 | #define STACK_MAGIC 0xdeadbeef |
29 | 32 | ||
@@ -75,7 +78,7 @@ extern int cond_resched(void); | |||
75 | # define might_sleep() do { might_resched(); } while (0) | 78 | # define might_sleep() do { might_resched(); } while (0) |
76 | #endif | 79 | #endif |
77 | 80 | ||
78 | #define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0) | 81 | #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) |
79 | 82 | ||
80 | #define abs(x) ({ \ | 83 | #define abs(x) ({ \ |
81 | int __x = (x); \ | 84 | int __x = (x); \ |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index cfb3410e32b1..6427949ddf99 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -106,6 +106,7 @@ extern struct page *kimage_alloc_control_pages(struct kimage *image, | |||
106 | extern void crash_kexec(struct pt_regs *); | 106 | extern void crash_kexec(struct pt_regs *); |
107 | int kexec_should_crash(struct task_struct *); | 107 | int kexec_should_crash(struct task_struct *); |
108 | extern struct kimage *kexec_image; | 108 | extern struct kimage *kexec_image; |
109 | extern struct kimage *kexec_crash_image; | ||
109 | 110 | ||
110 | #define KEXEC_ON_CRASH 0x00000001 | 111 | #define KEXEC_ON_CRASH 0x00000001 |
111 | #define KEXEC_ARCH_MASK 0xffff0000 | 112 | #define KEXEC_ARCH_MASK 0xffff0000 |
diff --git a/include/linux/key.h b/include/linux/key.h index cbf464ad9589..e81ebf910d0b 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -205,6 +205,11 @@ struct key_type { | |||
205 | /* match a key against a description */ | 205 | /* match a key against a description */ |
206 | int (*match)(const struct key *key, const void *desc); | 206 | int (*match)(const struct key *key, const void *desc); |
207 | 207 | ||
208 | /* clear some of the data from a key on revokation (optional) | ||
209 | * - the key's semaphore will be write-locked by the caller | ||
210 | */ | ||
211 | void (*revoke)(struct key *key); | ||
212 | |||
208 | /* clear the data from a key (optional) */ | 213 | /* clear the data from a key (optional) */ |
209 | void (*destroy)(struct key *key); | 214 | void (*destroy)(struct key *key); |
210 | 215 | ||
@@ -241,8 +246,9 @@ extern void unregister_key_type(struct key_type *ktype); | |||
241 | 246 | ||
242 | extern struct key *key_alloc(struct key_type *type, | 247 | extern struct key *key_alloc(struct key_type *type, |
243 | const char *desc, | 248 | const char *desc, |
244 | uid_t uid, gid_t gid, key_perm_t perm, | 249 | uid_t uid, gid_t gid, |
245 | int not_in_quota); | 250 | struct task_struct *ctx, |
251 | key_perm_t perm, int not_in_quota); | ||
246 | extern int key_payload_reserve(struct key *key, size_t datalen); | 252 | extern int key_payload_reserve(struct key *key, size_t datalen); |
247 | extern int key_instantiate_and_link(struct key *key, | 253 | extern int key_instantiate_and_link(struct key *key, |
248 | const void *data, | 254 | const void *data, |
@@ -292,7 +298,9 @@ extern int key_unlink(struct key *keyring, | |||
292 | struct key *key); | 298 | struct key *key); |
293 | 299 | ||
294 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, | 300 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, |
295 | int not_in_quota, struct key *dest); | 301 | struct task_struct *ctx, |
302 | int not_in_quota, | ||
303 | struct key *dest); | ||
296 | 304 | ||
297 | extern int keyring_clear(struct key *keyring); | 305 | extern int keyring_clear(struct key *keyring); |
298 | 306 | ||
@@ -313,7 +321,8 @@ extern void keyring_replace_payload(struct key *key, void *replacement); | |||
313 | * the userspace interface | 321 | * the userspace interface |
314 | */ | 322 | */ |
315 | extern struct key root_user_keyring, root_session_keyring; | 323 | extern struct key root_user_keyring, root_session_keyring; |
316 | extern int alloc_uid_keyring(struct user_struct *user); | 324 | extern int alloc_uid_keyring(struct user_struct *user, |
325 | struct task_struct *ctx); | ||
317 | extern void switch_uid_keyring(struct user_struct *new_user); | 326 | extern void switch_uid_keyring(struct user_struct *new_user); |
318 | extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); | 327 | extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); |
319 | extern int copy_thread_group_keys(struct task_struct *tsk); | 328 | extern int copy_thread_group_keys(struct task_struct *tsk); |
@@ -342,7 +351,7 @@ extern void key_init(void); | |||
342 | #define make_key_ref(k) ({ NULL; }) | 351 | #define make_key_ref(k) ({ NULL; }) |
343 | #define key_ref_to_ptr(k) ({ NULL; }) | 352 | #define key_ref_to_ptr(k) ({ NULL; }) |
344 | #define is_key_possessed(k) 0 | 353 | #define is_key_possessed(k) 0 |
345 | #define alloc_uid_keyring(u) 0 | 354 | #define alloc_uid_keyring(u,c) 0 |
346 | #define switch_uid_keyring(u) do { } while(0) | 355 | #define switch_uid_keyring(u) do { } while(0) |
347 | #define __install_session_keyring(t, k) ({ NULL; }) | 356 | #define __install_session_keyring(t, k) ({ NULL; }) |
348 | #define copy_keys(f,t) 0 | 357 | #define copy_keys(f,t) 0 |
@@ -355,6 +364,10 @@ extern void key_init(void); | |||
355 | #define key_fsgid_changed(t) do { } while(0) | 364 | #define key_fsgid_changed(t) do { } while(0) |
356 | #define key_init() do { } while(0) | 365 | #define key_init() do { } while(0) |
357 | 366 | ||
367 | /* Initial keyrings */ | ||
368 | extern struct key root_user_keyring; | ||
369 | extern struct key root_session_keyring; | ||
370 | |||
358 | #endif /* CONFIG_KEYS */ | 371 | #endif /* CONFIG_KEYS */ |
359 | #endif /* __KERNEL__ */ | 372 | #endif /* __KERNEL__ */ |
360 | #endif /* _LINUX_KEY_H */ | 373 | #endif /* _LINUX_KEY_H */ |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c187c53cecd0..2d229327959e 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -190,6 +190,8 @@ struct subsystem _varname##_subsys = { \ | |||
190 | 190 | ||
191 | /* The global /sys/kernel/ subsystem for people to chain off of */ | 191 | /* The global /sys/kernel/ subsystem for people to chain off of */ |
192 | extern struct subsystem kernel_subsys; | 192 | extern struct subsystem kernel_subsys; |
193 | /* The global /sys/hypervisor/ subsystem */ | ||
194 | extern struct subsystem hypervisor_subsys; | ||
193 | 195 | ||
194 | /** | 196 | /** |
195 | * Helpers for setting the kset of registered objects. | 197 | * Helpers for setting the kset of registered objects. |
diff --git a/include/linux/list.h b/include/linux/list.h index 76f05718342c..a02642e4710a 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -197,12 +197,35 @@ static inline void list_del_rcu(struct list_head *entry) | |||
197 | entry->prev = LIST_POISON2; | 197 | entry->prev = LIST_POISON2; |
198 | } | 198 | } |
199 | 199 | ||
200 | /** | ||
201 | * list_replace - replace old entry by new one | ||
202 | * @old : the element to be replaced | ||
203 | * @new : the new element to insert | ||
204 | * Note: if 'old' was empty, it will be overwritten. | ||
205 | */ | ||
206 | static inline void list_replace(struct list_head *old, | ||
207 | struct list_head *new) | ||
208 | { | ||
209 | new->next = old->next; | ||
210 | new->next->prev = new; | ||
211 | new->prev = old->prev; | ||
212 | new->prev->next = new; | ||
213 | } | ||
214 | |||
215 | static inline void list_replace_init(struct list_head *old, | ||
216 | struct list_head *new) | ||
217 | { | ||
218 | list_replace(old, new); | ||
219 | INIT_LIST_HEAD(old); | ||
220 | } | ||
221 | |||
200 | /* | 222 | /* |
201 | * list_replace_rcu - replace old entry by new one | 223 | * list_replace_rcu - replace old entry by new one |
202 | * @old : the element to be replaced | 224 | * @old : the element to be replaced |
203 | * @new : the new element to insert | 225 | * @new : the new element to insert |
204 | * | 226 | * |
205 | * The old entry will be replaced with the new entry atomically. | 227 | * The old entry will be replaced with the new entry atomically. |
228 | * Note: 'old' should not be empty. | ||
206 | */ | 229 | */ |
207 | static inline void list_replace_rcu(struct list_head *old, | 230 | static inline void list_replace_rcu(struct list_head *old, |
208 | struct list_head *new) | 231 | struct list_head *new) |
diff --git a/include/linux/m41t00.h b/include/linux/m41t00.h new file mode 100644 index 000000000000..b423360ca38e --- /dev/null +++ b/include/linux/m41t00.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Definitions for the ST M41T00 family of i2c rtc chips. | ||
3 | * | ||
4 | * Author: Mark A. Greer <mgreer@mvista.com> | ||
5 | * | ||
6 | * 2005, 2006 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef _M41T00_H | ||
13 | #define _M41T00_H | ||
14 | |||
15 | #define M41T00_DRV_NAME "m41t00" | ||
16 | #define M41T00_I2C_ADDR 0x68 | ||
17 | |||
18 | #define M41T00_TYPE_M41T00 0 | ||
19 | #define M41T00_TYPE_M41T81 81 | ||
20 | #define M41T00_TYPE_M41T85 85 | ||
21 | |||
22 | struct m41t00_platform_data { | ||
23 | u8 type; | ||
24 | u8 i2c_addr; | ||
25 | u8 sqw_freq; | ||
26 | }; | ||
27 | |||
28 | /* SQW output disabled, this is default value by power on */ | ||
29 | #define M41T00_SQW_DISABLE (0) | ||
30 | |||
31 | #define M41T00_SQW_32KHZ (1<<4) /* 32.768 KHz */ | ||
32 | #define M41T00_SQW_8KHZ (2<<4) /* 8.192 KHz */ | ||
33 | #define M41T00_SQW_4KHZ (3<<4) /* 4.096 KHz */ | ||
34 | #define M41T00_SQW_2KHZ (4<<4) /* 2.048 KHz */ | ||
35 | #define M41T00_SQW_1KHZ (5<<4) /* 1.024 KHz */ | ||
36 | #define M41T00_SQW_512HZ (6<<4) /* 512 Hz */ | ||
37 | #define M41T00_SQW_256HZ (7<<4) /* 256 Hz */ | ||
38 | #define M41T00_SQW_128HZ (8<<4) /* 128 Hz */ | ||
39 | #define M41T00_SQW_64HZ (9<<4) /* 64 Hz */ | ||
40 | #define M41T00_SQW_32HZ (10<<4) /* 32 Hz */ | ||
41 | #define M41T00_SQW_16HZ (11<<4) /* 16 Hz */ | ||
42 | #define M41T00_SQW_8HZ (12<<4) /* 8 Hz */ | ||
43 | #define M41T00_SQW_4HZ (13<<4) /* 4 Hz */ | ||
44 | #define M41T00_SQW_2HZ (14<<4) /* 2 Hz */ | ||
45 | #define M41T00_SQW_1HZ (15<<4) /* 1 Hz */ | ||
46 | |||
47 | extern ulong m41t00_get_rtc_time(void); | ||
48 | extern int m41t00_set_rtc_time(ulong nowtime); | ||
49 | |||
50 | #endif /* _M41T00_H */ | ||
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 6789c4940c9c..5dba23a1c0d0 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -3,17 +3,17 @@ | |||
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | 5 | ||
6 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | ||
7 | |||
6 | #ifdef CONFIG_MIGRATION | 8 | #ifdef CONFIG_MIGRATION |
7 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | 9 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); |
8 | extern int putback_lru_pages(struct list_head *l); | 10 | extern int putback_lru_pages(struct list_head *l); |
9 | extern int migrate_page(struct page *, struct page *); | 11 | extern int migrate_page(struct address_space *, |
10 | extern void migrate_page_copy(struct page *, struct page *); | 12 | struct page *, struct page *); |
11 | extern int migrate_page_remove_references(struct page *, struct page *, int); | 13 | extern int migrate_pages(struct list_head *l, new_page_t x, unsigned long); |
12 | extern int migrate_pages(struct list_head *l, struct list_head *t, | 14 | |
13 | struct list_head *moved, struct list_head *failed); | 15 | extern int fail_migrate_page(struct address_space *, |
14 | extern int migrate_pages_to(struct list_head *pagelist, | 16 | struct page *, struct page *); |
15 | struct vm_area_struct *vma, int dest); | ||
16 | extern int fail_migrate_page(struct page *, struct page *); | ||
17 | 17 | ||
18 | extern int migrate_prep(void); | 18 | extern int migrate_prep(void); |
19 | 19 | ||
@@ -22,8 +22,8 @@ extern int migrate_prep(void); | |||
22 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | 22 | static inline int isolate_lru_page(struct page *p, struct list_head *list) |
23 | { return -ENOSYS; } | 23 | { return -ENOSYS; } |
24 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | 24 | static inline int putback_lru_pages(struct list_head *l) { return 0; } |
25 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | 25 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
26 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | 26 | unsigned long private) { return -ENOSYS; } |
27 | 27 | ||
28 | static inline int migrate_pages_to(struct list_head *pagelist, | 28 | static inline int migrate_pages_to(struct list_head *pagelist, |
29 | struct vm_area_struct *vma, int dest) { return 0; } | 29 | struct vm_area_struct *vma, int dest) { return 0; } |
diff --git a/include/linux/mm.h b/include/linux/mm.h index e2fa375e478e..3b09444121d9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -199,6 +199,10 @@ struct vm_operations_struct { | |||
199 | void (*close)(struct vm_area_struct * area); | 199 | void (*close)(struct vm_area_struct * area); |
200 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); | 200 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); |
201 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); | 201 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); |
202 | |||
203 | /* notification that a previously read-only page is about to become | ||
204 | * writable, if an error is returned it will cause a SIGBUS */ | ||
205 | int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); | ||
202 | #ifdef CONFIG_NUMA | 206 | #ifdef CONFIG_NUMA |
203 | int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); | 207 | int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); |
204 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, | 208 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, |
@@ -465,10 +469,13 @@ static inline unsigned long page_zonenum(struct page *page) | |||
465 | struct zone; | 469 | struct zone; |
466 | extern struct zone *zone_table[]; | 470 | extern struct zone *zone_table[]; |
467 | 471 | ||
472 | static inline int page_zone_id(struct page *page) | ||
473 | { | ||
474 | return (page->flags >> ZONETABLE_PGSHIFT) & ZONETABLE_MASK; | ||
475 | } | ||
468 | static inline struct zone *page_zone(struct page *page) | 476 | static inline struct zone *page_zone(struct page *page) |
469 | { | 477 | { |
470 | return zone_table[(page->flags >> ZONETABLE_PGSHIFT) & | 478 | return zone_table[page_zone_id(page)]; |
471 | ZONETABLE_MASK]; | ||
472 | } | 479 | } |
473 | 480 | ||
474 | static inline unsigned long page_to_nid(struct page *page) | 481 | static inline unsigned long page_to_nid(struct page *page) |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 9742e3c16222..d6120fa69116 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -197,7 +197,7 @@ struct zone { | |||
197 | 197 | ||
198 | /* | 198 | /* |
199 | * wait_table -- the array holding the hash table | 199 | * wait_table -- the array holding the hash table |
200 | * wait_table_size -- the size of the hash table array | 200 | * wait_table_hash_nr_entries -- the size of the hash table array |
201 | * wait_table_bits -- wait_table_size == (1 << wait_table_bits) | 201 | * wait_table_bits -- wait_table_size == (1 << wait_table_bits) |
202 | * | 202 | * |
203 | * The purpose of all these is to keep track of the people | 203 | * The purpose of all these is to keep track of the people |
@@ -220,7 +220,7 @@ struct zone { | |||
220 | * free_area_init_core() performs the initialization of them. | 220 | * free_area_init_core() performs the initialization of them. |
221 | */ | 221 | */ |
222 | wait_queue_head_t * wait_table; | 222 | wait_queue_head_t * wait_table; |
223 | unsigned long wait_table_size; | 223 | unsigned long wait_table_hash_nr_entries; |
224 | unsigned long wait_table_bits; | 224 | unsigned long wait_table_bits; |
225 | 225 | ||
226 | /* | 226 | /* |
@@ -333,6 +333,9 @@ void wakeup_kswapd(struct zone *zone, int order); | |||
333 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, | 333 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, |
334 | int classzone_idx, int alloc_flags); | 334 | int classzone_idx, int alloc_flags); |
335 | 335 | ||
336 | extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, | ||
337 | unsigned long size); | ||
338 | |||
336 | #ifdef CONFIG_HAVE_MEMORY_PRESENT | 339 | #ifdef CONFIG_HAVE_MEMORY_PRESENT |
337 | void memory_present(int nid, unsigned long start, unsigned long end); | 340 | void memory_present(int nid, unsigned long start, unsigned long end); |
338 | #else | 341 | #else |
@@ -506,6 +509,10 @@ struct mem_section { | |||
506 | * pages. However, it is stored with some other magic. | 509 | * pages. However, it is stored with some other magic. |
507 | * (see sparse.c::sparse_init_one_section()) | 510 | * (see sparse.c::sparse_init_one_section()) |
508 | * | 511 | * |
512 | * Additionally during early boot we encode node id of | ||
513 | * the location of the section here to guide allocation. | ||
514 | * (see sparse.c::memory_present()) | ||
515 | * | ||
509 | * Making it a UL at least makes someone do a cast | 516 | * Making it a UL at least makes someone do a cast |
510 | * before using it wrong. | 517 | * before using it wrong. |
511 | */ | 518 | */ |
@@ -545,6 +552,7 @@ extern int __section_nr(struct mem_section* ms); | |||
545 | #define SECTION_HAS_MEM_MAP (1UL<<1) | 552 | #define SECTION_HAS_MEM_MAP (1UL<<1) |
546 | #define SECTION_MAP_LAST_BIT (1UL<<2) | 553 | #define SECTION_MAP_LAST_BIT (1UL<<2) |
547 | #define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1)) | 554 | #define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1)) |
555 | #define SECTION_NID_SHIFT 2 | ||
548 | 556 | ||
549 | static inline struct page *__section_mem_map_addr(struct mem_section *section) | 557 | static inline struct page *__section_mem_map_addr(struct mem_section *section) |
550 | { | 558 | { |
diff --git a/include/linux/module.h b/include/linux/module.h index c2d89e037af0..2d366098eab5 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -105,6 +105,8 @@ extern struct module __this_module; | |||
105 | * "GPL and additional rights" [GNU Public License v2 rights and more] | 105 | * "GPL and additional rights" [GNU Public License v2 rights and more] |
106 | * "Dual BSD/GPL" [GNU Public License v2 | 106 | * "Dual BSD/GPL" [GNU Public License v2 |
107 | * or BSD license choice] | 107 | * or BSD license choice] |
108 | * "Dual MIT/GPL" [GNU Public License v2 | ||
109 | * or MIT license choice] | ||
108 | * "Dual MPL/GPL" [GNU Public License v2 | 110 | * "Dual MPL/GPL" [GNU Public License v2 |
109 | * or Mozilla license choice] | 111 | * or Mozilla license choice] |
110 | * | 112 | * |
diff --git a/include/linux/mount.h b/include/linux/mount.h index b7472ae91fa4..60718f12caa9 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -17,6 +17,11 @@ | |||
17 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
18 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
19 | 19 | ||
20 | struct super_block; | ||
21 | struct vfsmount; | ||
22 | struct dentry; | ||
23 | struct namespace; | ||
24 | |||
20 | #define MNT_NOSUID 0x01 | 25 | #define MNT_NOSUID 0x01 |
21 | #define MNT_NODEV 0x02 | 26 | #define MNT_NODEV 0x02 |
22 | #define MNT_NOEXEC 0x04 | 27 | #define MNT_NOEXEC 0x04 |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index cead6be467ed..bc747e5d7138 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -308,9 +308,13 @@ struct net_device | |||
308 | #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ | 308 | #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */ |
309 | #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ | 309 | #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ |
310 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ | 310 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ |
311 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ | 311 | #define NETIF_F_GSO 2048 /* Enable software GSO. */ |
312 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | 312 | #define NETIF_F_LLTX 4096 /* LockLess TX */ |
313 | #define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ | 313 | |
314 | /* Segmentation offload features */ | ||
315 | #define NETIF_F_GSO_SHIFT 16 | ||
316 | #define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT) | ||
317 | #define NETIF_F_UFO (SKB_GSO_UDPV4 << NETIF_F_GSO_SHIFT) | ||
314 | 318 | ||
315 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) | 319 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) |
316 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) | 320 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) |
@@ -402,6 +406,9 @@ struct net_device | |||
402 | struct list_head qdisc_list; | 406 | struct list_head qdisc_list; |
403 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 407 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
404 | 408 | ||
409 | /* Partially transmitted GSO packet. */ | ||
410 | struct sk_buff *gso_skb; | ||
411 | |||
405 | /* ingress path synchronizer */ | 412 | /* ingress path synchronizer */ |
406 | spinlock_t ingress_lock; | 413 | spinlock_t ingress_lock; |
407 | struct Qdisc *qdisc_ingress; | 414 | struct Qdisc *qdisc_ingress; |
@@ -536,6 +543,7 @@ struct packet_type { | |||
536 | struct net_device *, | 543 | struct net_device *, |
537 | struct packet_type *, | 544 | struct packet_type *, |
538 | struct net_device *); | 545 | struct net_device *); |
546 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg); | ||
539 | void *af_packet_priv; | 547 | void *af_packet_priv; |
540 | struct list_head list; | 548 | struct list_head list; |
541 | }; | 549 | }; |
@@ -686,7 +694,8 @@ extern int dev_change_name(struct net_device *, char *); | |||
686 | extern int dev_set_mtu(struct net_device *, int); | 694 | extern int dev_set_mtu(struct net_device *, int); |
687 | extern int dev_set_mac_address(struct net_device *, | 695 | extern int dev_set_mac_address(struct net_device *, |
688 | struct sockaddr *); | 696 | struct sockaddr *); |
689 | extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev); | 697 | extern int dev_hard_start_xmit(struct sk_buff *skb, |
698 | struct net_device *dev); | ||
690 | 699 | ||
691 | extern void dev_init(void); | 700 | extern void dev_init(void); |
692 | 701 | ||
@@ -960,6 +969,7 @@ extern int netdev_max_backlog; | |||
960 | extern int weight_p; | 969 | extern int weight_p; |
961 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 970 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
962 | extern int skb_checksum_help(struct sk_buff *skb, int inward); | 971 | extern int skb_checksum_help(struct sk_buff *skb, int inward); |
972 | extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int sg); | ||
963 | #ifdef CONFIG_BUG | 973 | #ifdef CONFIG_BUG |
964 | extern void netdev_rx_csum_fault(struct net_device *dev); | 974 | extern void netdev_rx_csum_fault(struct net_device *dev); |
965 | #else | 975 | #else |
@@ -979,6 +989,13 @@ extern void dev_seq_stop(struct seq_file *seq, void *v); | |||
979 | 989 | ||
980 | extern void linkwatch_run_queue(void); | 990 | extern void linkwatch_run_queue(void); |
981 | 991 | ||
992 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | ||
993 | { | ||
994 | int feature = skb_shinfo(skb)->gso_type << NETIF_F_GSO_SHIFT; | ||
995 | return skb_shinfo(skb)->gso_size && | ||
996 | (dev->features & feature) != feature; | ||
997 | } | ||
998 | |||
982 | #endif /* __KERNEL__ */ | 999 | #endif /* __KERNEL__ */ |
983 | 1000 | ||
984 | #endif /* _LINUX_DEV_H */ | 1001 | #endif /* _LINUX_DEV_H */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 87b8a5703ebc..855b44668caa 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | 6 | ||
7 | #define NETLINK_ROUTE 0 /* Routing/device hook */ | 7 | #define NETLINK_ROUTE 0 /* Routing/device hook */ |
8 | #define NETLINK_W1 1 /* 1-wire subsystem */ | 8 | #define NETLINK_UNUSED 1 /* Unused number */ |
9 | #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ | 9 | #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ |
10 | #define NETLINK_FIREWALL 3 /* Firewalling hook */ | 10 | #define NETLINK_FIREWALL 3 /* Firewalling hook */ |
11 | #define NETLINK_INET_DIAG 4 /* INET socket monitoring */ | 11 | #define NETLINK_INET_DIAG 4 /* INET socket monitoring */ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index d276a4e2f825..0c076d58c676 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -7,6 +7,8 @@ | |||
7 | 7 | ||
8 | #include <linux/percpu.h> | 8 | #include <linux/percpu.h> |
9 | #include <linux/cache.h> | 9 | #include <linux/cache.h> |
10 | #include <linux/types.h> | ||
11 | |||
10 | #include <asm/pgtable.h> | 12 | #include <asm/pgtable.h> |
11 | 13 | ||
12 | /* | 14 | /* |
@@ -88,7 +90,17 @@ | |||
88 | #define PG_nosave_free 18 /* Free, should not be written */ | 90 | #define PG_nosave_free 18 /* Free, should not be written */ |
89 | #define PG_buddy 19 /* Page is free, on buddy lists */ | 91 | #define PG_buddy 19 /* Page is free, on buddy lists */ |
90 | 92 | ||
91 | #define PG_uncached 20 /* Page has been mapped as uncached */ | 93 | |
94 | #if (BITS_PER_LONG > 32) | ||
95 | /* | ||
96 | * 64-bit-only flags build down from bit 31 | ||
97 | * | ||
98 | * 32 bit -------------------------------| FIELDS | FLAGS | | ||
99 | * 64 bit | FIELDS | ?????? FLAGS | | ||
100 | * 63 32 0 | ||
101 | */ | ||
102 | #define PG_uncached 31 /* Page has been mapped as uncached */ | ||
103 | #endif | ||
92 | 104 | ||
93 | /* | 105 | /* |
94 | * Global page accounting. One instance per CPU. Only unsigned longs are | 106 | * Global page accounting. One instance per CPU. Only unsigned longs are |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 7a1af574dedf..1245df7141aa 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -99,6 +99,13 @@ extern struct page * read_cache_page(struct address_space *mapping, | |||
99 | extern int read_cache_pages(struct address_space *mapping, | 99 | extern int read_cache_pages(struct address_space *mapping, |
100 | struct list_head *pages, filler_t *filler, void *data); | 100 | struct list_head *pages, filler_t *filler, void *data); |
101 | 101 | ||
102 | static inline struct page *read_mapping_page(struct address_space *mapping, | ||
103 | unsigned long index, void *data) | ||
104 | { | ||
105 | filler_t *filler = (filler_t *)mapping->a_ops->readpage; | ||
106 | return read_cache_page(mapping, index, filler, data); | ||
107 | } | ||
108 | |||
102 | int add_to_page_cache(struct page *page, struct address_space *mapping, | 109 | int add_to_page_cache(struct page *page, struct address_space *mapping, |
103 | unsigned long index, gfp_t gfp_mask); | 110 | unsigned long index, gfp_t gfp_mask); |
104 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | 111 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 6c4bc773f7b7..62a8c22f5f60 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -162,6 +162,9 @@ struct pci_dev { | |||
162 | unsigned int is_busmaster:1; /* device is busmaster */ | 162 | unsigned int is_busmaster:1; /* device is busmaster */ |
163 | unsigned int no_msi:1; /* device may not use msi */ | 163 | unsigned int no_msi:1; /* device may not use msi */ |
164 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | 164 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ |
165 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | ||
166 | unsigned int msi_enabled:1; | ||
167 | unsigned int msix_enabled:1; | ||
165 | 168 | ||
166 | u32 saved_config_space[16]; /* config space saved at suspend time */ | 169 | u32 saved_config_space[16]; /* config space saved at suspend time */ |
167 | struct hlist_head saved_cap_space; | 170 | struct hlist_head saved_cap_space; |
@@ -496,6 +499,7 @@ int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | |||
496 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | 499 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); |
497 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); | 500 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); |
498 | int pci_assign_resource(struct pci_dev *dev, int i); | 501 | int pci_assign_resource(struct pci_dev *dev, int i); |
502 | int pci_assign_resource_fixed(struct pci_dev *dev, int i); | ||
499 | void pci_restore_bars(struct pci_dev *dev); | 503 | void pci_restore_bars(struct pci_dev *dev); |
500 | 504 | ||
501 | /* ROM control related routines */ | 505 | /* ROM control related routines */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index bcfe9d4f56ae..cde701c13c77 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -352,8 +352,11 @@ | |||
352 | #define PCI_DEVICE_ID_ATI_RS480 0x5950 | 352 | #define PCI_DEVICE_ID_ATI_RS480 0x5950 |
353 | /* ATI IXP Chipset */ | 353 | /* ATI IXP Chipset */ |
354 | #define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 | 354 | #define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349 |
355 | #define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353 | ||
356 | #define PCI_DEVICE_ID_ATI_IXP300_SMBUS 0x4363 | ||
355 | #define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369 | 357 | #define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369 |
356 | #define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e | 358 | #define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e |
359 | #define PCI_DEVICE_ID_ATI_IXP400_SMBUS 0x4372 | ||
357 | #define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 | 360 | #define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 |
358 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 | 361 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 |
359 | #define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a | 362 | #define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a |
@@ -848,7 +851,12 @@ | |||
848 | 851 | ||
849 | 852 | ||
850 | #define PCI_VENDOR_ID_QLOGIC 0x1077 | 853 | #define PCI_VENDOR_ID_QLOGIC 0x1077 |
854 | #define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016 | ||
851 | #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 | 855 | #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 |
856 | #define PCI_DEVICE_ID_QLOGIC_ISP1080 0x1080 | ||
857 | #define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216 | ||
858 | #define PCI_DEVICE_ID_QLOGIC_ISP1240 0x1240 | ||
859 | #define PCI_DEVICE_ID_QLOGIC_ISP1280 0x1280 | ||
852 | #define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 | 860 | #define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 |
853 | #define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 | 861 | #define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 |
854 | #define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 | 862 | #define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 |
@@ -1018,6 +1026,7 @@ | |||
1018 | #define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056 | 1026 | #define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056 |
1019 | #define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057 | 1027 | #define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057 |
1020 | #define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 | 1028 | #define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 |
1029 | #define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d | ||
1021 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 | 1030 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 |
1022 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 | 1031 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 |
1023 | #define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066 | 1032 | #define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066 |
@@ -1127,9 +1136,11 @@ | |||
1127 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 | 1136 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 |
1128 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 | 1137 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 |
1129 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B | 1138 | #define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B |
1139 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SMBUS 0x0264 | ||
1130 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 | 1140 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 |
1131 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 | 1141 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 |
1132 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 | 1142 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 |
1143 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SMBUS 0x0368 | ||
1133 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E | 1144 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E |
1134 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E | 1145 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E |
1135 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F | 1146 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F |
@@ -1946,6 +1957,7 @@ | |||
1946 | 1957 | ||
1947 | #define PCI_VENDOR_ID_MELLANOX 0x15b3 | 1958 | #define PCI_VENDOR_ID_MELLANOX 0x15b3 |
1948 | #define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 | 1959 | #define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44 |
1960 | #define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46 | ||
1949 | #define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 | 1961 | #define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278 |
1950 | #define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 | 1962 | #define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282 |
1951 | #define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c | 1963 | #define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c |
@@ -1969,6 +1981,9 @@ | |||
1969 | #define PCI_VENDOR_ID_NETCELL 0x169c | 1981 | #define PCI_VENDOR_ID_NETCELL 0x169c |
1970 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 | 1982 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 |
1971 | 1983 | ||
1984 | #define PCI_VENDOR_ID_VITESSE 0x1725 | ||
1985 | #define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174 | ||
1986 | |||
1972 | #define PCI_VENDOR_ID_LINKSYS 0x1737 | 1987 | #define PCI_VENDOR_ID_LINKSYS 0x1737 |
1973 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 | 1988 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 |
1974 | 1989 | ||
@@ -2148,6 +2163,7 @@ | |||
2148 | #define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 | 2163 | #define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 |
2149 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e | 2164 | #define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e |
2150 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 | 2165 | #define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 |
2166 | #define PCI_DEVICE_ID_INTEL_GD31244 0x3200 | ||
2151 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 | 2167 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 |
2152 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 | 2168 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 |
2153 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 | 2169 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index d27a78b71297..6bce4a240364 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -197,6 +197,7 @@ | |||
197 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ | 197 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ |
198 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ | 198 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ |
199 | #define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ | 199 | #define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ |
200 | #define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */ | ||
200 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ | 201 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ |
201 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ | 202 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ |
202 | #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ | 203 | #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 66b5de404f22..f5aa593ccf32 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -10,13 +10,14 @@ | |||
10 | #include <linux/smp.h> | 10 | #include <linux/smp.h> |
11 | #include <linux/threads.h> | 11 | #include <linux/threads.h> |
12 | #include <linux/percpu.h> | 12 | #include <linux/percpu.h> |
13 | #include <linux/types.h> | ||
13 | 14 | ||
14 | #ifdef CONFIG_SMP | 15 | #ifdef CONFIG_SMP |
15 | 16 | ||
16 | struct percpu_counter { | 17 | struct percpu_counter { |
17 | spinlock_t lock; | 18 | spinlock_t lock; |
18 | long count; | 19 | s64 count; |
19 | long *counters; | 20 | s32 *counters; |
20 | }; | 21 | }; |
21 | 22 | ||
22 | #if NR_CPUS >= 16 | 23 | #if NR_CPUS >= 16 |
@@ -25,11 +26,11 @@ struct percpu_counter { | |||
25 | #define FBC_BATCH (NR_CPUS*4) | 26 | #define FBC_BATCH (NR_CPUS*4) |
26 | #endif | 27 | #endif |
27 | 28 | ||
28 | static inline void percpu_counter_init(struct percpu_counter *fbc) | 29 | static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) |
29 | { | 30 | { |
30 | spin_lock_init(&fbc->lock); | 31 | spin_lock_init(&fbc->lock); |
31 | fbc->count = 0; | 32 | fbc->count = amount; |
32 | fbc->counters = alloc_percpu(long); | 33 | fbc->counters = alloc_percpu(s32); |
33 | } | 34 | } |
34 | 35 | ||
35 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) | 36 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) |
@@ -37,10 +38,10 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc) | |||
37 | free_percpu(fbc->counters); | 38 | free_percpu(fbc->counters); |
38 | } | 39 | } |
39 | 40 | ||
40 | void percpu_counter_mod(struct percpu_counter *fbc, long amount); | 41 | void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); |
41 | long percpu_counter_sum(struct percpu_counter *fbc); | 42 | s64 percpu_counter_sum(struct percpu_counter *fbc); |
42 | 43 | ||
43 | static inline long percpu_counter_read(struct percpu_counter *fbc) | 44 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) |
44 | { | 45 | { |
45 | return fbc->count; | 46 | return fbc->count; |
46 | } | 47 | } |
@@ -48,13 +49,14 @@ static inline long percpu_counter_read(struct percpu_counter *fbc) | |||
48 | /* | 49 | /* |
49 | * It is possible for the percpu_counter_read() to return a small negative | 50 | * It is possible for the percpu_counter_read() to return a small negative |
50 | * number for some counter which should never be negative. | 51 | * number for some counter which should never be negative. |
52 | * | ||
51 | */ | 53 | */ |
52 | static inline long percpu_counter_read_positive(struct percpu_counter *fbc) | 54 | static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) |
53 | { | 55 | { |
54 | long ret = fbc->count; | 56 | s64 ret = fbc->count; |
55 | 57 | ||
56 | barrier(); /* Prevent reloads of fbc->count */ | 58 | barrier(); /* Prevent reloads of fbc->count */ |
57 | if (ret > 0) | 59 | if (ret >= 0) |
58 | return ret; | 60 | return ret; |
59 | return 1; | 61 | return 1; |
60 | } | 62 | } |
@@ -62,12 +64,12 @@ static inline long percpu_counter_read_positive(struct percpu_counter *fbc) | |||
62 | #else | 64 | #else |
63 | 65 | ||
64 | struct percpu_counter { | 66 | struct percpu_counter { |
65 | long count; | 67 | s64 count; |
66 | }; | 68 | }; |
67 | 69 | ||
68 | static inline void percpu_counter_init(struct percpu_counter *fbc) | 70 | static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) |
69 | { | 71 | { |
70 | fbc->count = 0; | 72 | fbc->count = amount; |
71 | } | 73 | } |
72 | 74 | ||
73 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) | 75 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) |
@@ -75,24 +77,24 @@ static inline void percpu_counter_destroy(struct percpu_counter *fbc) | |||
75 | } | 77 | } |
76 | 78 | ||
77 | static inline void | 79 | static inline void |
78 | percpu_counter_mod(struct percpu_counter *fbc, long amount) | 80 | percpu_counter_mod(struct percpu_counter *fbc, s32 amount) |
79 | { | 81 | { |
80 | preempt_disable(); | 82 | preempt_disable(); |
81 | fbc->count += amount; | 83 | fbc->count += amount; |
82 | preempt_enable(); | 84 | preempt_enable(); |
83 | } | 85 | } |
84 | 86 | ||
85 | static inline long percpu_counter_read(struct percpu_counter *fbc) | 87 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) |
86 | { | 88 | { |
87 | return fbc->count; | 89 | return fbc->count; |
88 | } | 90 | } |
89 | 91 | ||
90 | static inline long percpu_counter_read_positive(struct percpu_counter *fbc) | 92 | static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) |
91 | { | 93 | { |
92 | return fbc->count; | 94 | return fbc->count; |
93 | } | 95 | } |
94 | 96 | ||
95 | static inline long percpu_counter_sum(struct percpu_counter *fbc) | 97 | static inline s64 percpu_counter_sum(struct percpu_counter *fbc) |
96 | { | 98 | { |
97 | return percpu_counter_read_positive(fbc); | 99 | return percpu_counter_read_positive(fbc); |
98 | } | 100 | } |
diff --git a/include/linux/prctl.h b/include/linux/prctl.h index bf022c43a18e..52a9be41250d 100644 --- a/include/linux/prctl.h +++ b/include/linux/prctl.h | |||
@@ -52,4 +52,11 @@ | |||
52 | #define PR_SET_NAME 15 /* Set process name */ | 52 | #define PR_SET_NAME 15 /* Set process name */ |
53 | #define PR_GET_NAME 16 /* Get process name */ | 53 | #define PR_GET_NAME 16 /* Get process name */ |
54 | 54 | ||
55 | /* Get/set process endian */ | ||
56 | #define PR_GET_ENDIAN 19 | ||
57 | #define PR_SET_ENDIAN 20 | ||
58 | # define PR_ENDIAN_BIG 0 | ||
59 | # define PR_ENDIAN_LITTLE 1 /* True little endian mode */ | ||
60 | # define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ | ||
61 | |||
55 | #endif /* _LINUX_PRCTL_H */ | 62 | #endif /* _LINUX_PRCTL_H */ |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 0d36750fc0f1..ee918bc6e18c 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -51,6 +51,10 @@ | |||
51 | #ifdef __KERNEL__ | 51 | #ifdef __KERNEL__ |
52 | /* | 52 | /* |
53 | * Ptrace flags | 53 | * Ptrace flags |
54 | * | ||
55 | * The owner ship rules for task->ptrace which holds the ptrace | ||
56 | * flags is simple. When a task is running it owns it's task->ptrace | ||
57 | * flags. When the a task is stopped the ptracer owns task->ptrace. | ||
54 | */ | 58 | */ |
55 | 59 | ||
56 | #define PT_PTRACED 0x00000001 | 60 | #define PT_PTRACED 0x00000001 |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index dd83cca28001..9158a68140c9 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -23,6 +23,9 @@ | |||
23 | #include <linux/preempt.h> | 23 | #include <linux/preempt.h> |
24 | #include <linux/types.h> | 24 | #include <linux/types.h> |
25 | 25 | ||
26 | #define RADIX_TREE_MAX_TAGS 2 | ||
27 | |||
28 | /* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */ | ||
26 | struct radix_tree_root { | 29 | struct radix_tree_root { |
27 | unsigned int height; | 30 | unsigned int height; |
28 | gfp_t gfp_mask; | 31 | gfp_t gfp_mask; |
@@ -45,8 +48,6 @@ do { \ | |||
45 | (root)->rnode = NULL; \ | 48 | (root)->rnode = NULL; \ |
46 | } while (0) | 49 | } while (0) |
47 | 50 | ||
48 | #define RADIX_TREE_MAX_TAGS 2 | ||
49 | |||
50 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); | 51 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); |
51 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); | 52 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); |
52 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); | 53 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 78ecfa28b1c2..00b340ba6612 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -2,8 +2,8 @@ | |||
2 | #define _LINUX_RAMFS_H | 2 | #define _LINUX_RAMFS_H |
3 | 3 | ||
4 | struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev); | 4 | struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev); |
5 | struct super_block *ramfs_get_sb(struct file_system_type *fs_type, | 5 | extern int ramfs_get_sb(struct file_system_type *fs_type, |
6 | int flags, const char *dev_name, void *data); | 6 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); |
7 | 7 | ||
8 | #ifndef CONFIG_MMU | 8 | #ifndef CONFIG_MMU |
9 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | 9 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index f37006f21664..8d5382e62c08 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
@@ -132,6 +132,10 @@ static inline void rb_set_color(struct rb_node *rb, int color) | |||
132 | #define RB_ROOT (struct rb_root) { NULL, } | 132 | #define RB_ROOT (struct rb_root) { NULL, } |
133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) | 133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) |
134 | 134 | ||
135 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) | ||
136 | #define RB_EMPTY_NODE(node) (rb_parent(node) != node) | ||
137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) | ||
138 | |||
135 | extern void rb_insert_color(struct rb_node *, struct rb_root *); | 139 | extern void rb_insert_color(struct rb_node *, struct rb_root *); |
136 | extern void rb_erase(struct rb_node *, struct rb_root *); | 140 | extern void rb_erase(struct rb_node *, struct rb_root *); |
137 | 141 | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 970284f571a6..6312758393b6 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -246,7 +246,7 @@ extern int rcu_needs_cpu(int cpu); | |||
246 | * softirq handlers will have completed, since in some kernels, these | 246 | * softirq handlers will have completed, since in some kernels, these |
247 | * handlers can run in process context, and can block. | 247 | * handlers can run in process context, and can block. |
248 | * | 248 | * |
249 | * This primitive provides the guarantees made by the (deprecated) | 249 | * This primitive provides the guarantees made by the (now removed) |
250 | * synchronize_kernel() API. In contrast, synchronize_rcu() only | 250 | * synchronize_kernel() API. In contrast, synchronize_rcu() only |
251 | * guarantees that rcu_read_lock() sections will have completed. | 251 | * guarantees that rcu_read_lock() sections will have completed. |
252 | * In "classic RCU", these two guarantees happen to be one and | 252 | * In "classic RCU", these two guarantees happen to be one and |
@@ -264,7 +264,6 @@ extern void FASTCALL(call_rcu(struct rcu_head *head, | |||
264 | void (*func)(struct rcu_head *head))); | 264 | void (*func)(struct rcu_head *head))); |
265 | extern void FASTCALL(call_rcu_bh(struct rcu_head *head, | 265 | extern void FASTCALL(call_rcu_bh(struct rcu_head *head, |
266 | void (*func)(struct rcu_head *head))); | 266 | void (*func)(struct rcu_head *head))); |
267 | extern __deprecated_for_modules void synchronize_kernel(void); | ||
268 | extern void synchronize_rcu(void); | 267 | extern void synchronize_rcu(void); |
269 | void synchronize_idle(void); | 268 | void synchronize_idle(void); |
270 | extern void rcu_barrier(void); | 269 | extern void rcu_barrier(void); |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 2d4c81a220db..bf97b0900014 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -91,7 +91,6 @@ static inline void page_dup_rmap(struct page *page) | |||
91 | */ | 91 | */ |
92 | int page_referenced(struct page *, int is_locked); | 92 | int page_referenced(struct page *, int is_locked); |
93 | int try_to_unmap(struct page *, int ignore_refs); | 93 | int try_to_unmap(struct page *, int ignore_refs); |
94 | void remove_from_swap(struct page *page); | ||
95 | 94 | ||
96 | /* | 95 | /* |
97 | * Called from mm/filemap_xip.c to unmap empty zero page | 96 | * Called from mm/filemap_xip.c to unmap empty zero page |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 267f15257040..38b4791e6a5d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -941,12 +941,11 @@ static inline void put_task_struct(struct task_struct *t) | |||
941 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 941 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
942 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ | 942 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ |
943 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 943 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
944 | #define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ | 944 | #define PF_BORROWED_MM 0x00200000 /* I am a kthread doing use_mm */ |
945 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ | 945 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |
946 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ | 946 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ |
947 | #define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ | 947 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ |
948 | #define PF_SPREAD_PAGE 0x04000000 /* Spread page cache over cpuset */ | 948 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ |
949 | #define PF_SPREAD_SLAB 0x08000000 /* Spread some slab caches over cpuset */ | ||
950 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 949 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
951 | 950 | ||
952 | /* | 951 | /* |
@@ -1225,7 +1224,7 @@ static inline int thread_group_empty(task_t *p) | |||
1225 | (thread_group_leader(p) && !thread_group_empty(p)) | 1224 | (thread_group_leader(p) && !thread_group_empty(p)) |
1226 | 1225 | ||
1227 | /* | 1226 | /* |
1228 | * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring | 1227 | * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring |
1229 | * subscriptions and synchronises with wait4(). Also used in procfs. Also | 1228 | * subscriptions and synchronises with wait4(). Also used in procfs. Also |
1230 | * pins the final release of task.io_context. Also protects ->cpuset. | 1229 | * pins the final release of task.io_context. Also protects ->cpuset. |
1231 | * | 1230 | * |
diff --git a/include/linux/security.h b/include/linux/security.h index 4dfb1b84a9b3..d2c17bd91a29 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -171,9 +171,9 @@ struct swap_info_struct; | |||
171 | * Deallocate and clear the sb->s_security field. | 171 | * Deallocate and clear the sb->s_security field. |
172 | * @sb contains the super_block structure to be modified. | 172 | * @sb contains the super_block structure to be modified. |
173 | * @sb_statfs: | 173 | * @sb_statfs: |
174 | * Check permission before obtaining filesystem statistics for the @sb | 174 | * Check permission before obtaining filesystem statistics for the @mnt |
175 | * filesystem. | 175 | * mountpoint. |
176 | * @sb contains the super_block structure for the filesystem. | 176 | * @dentry is a handle on the superblock for the filesystem. |
177 | * Return 0 if permission is granted. | 177 | * Return 0 if permission is granted. |
178 | * @sb_mount: | 178 | * @sb_mount: |
179 | * Check permission before an object specified by @dev_name is mounted on | 179 | * Check permission before an object specified by @dev_name is mounted on |
@@ -577,6 +577,11 @@ struct swap_info_struct; | |||
577 | * @p contains the task_struct of process. | 577 | * @p contains the task_struct of process. |
578 | * @nice contains the new nice value. | 578 | * @nice contains the new nice value. |
579 | * Return 0 if permission is granted. | 579 | * Return 0 if permission is granted. |
580 | * @task_setioprio | ||
581 | * Check permission before setting the ioprio value of @p to @ioprio. | ||
582 | * @p contains the task_struct of process. | ||
583 | * @ioprio contains the new ioprio value | ||
584 | * Return 0 if permission is granted. | ||
580 | * @task_setrlimit: | 585 | * @task_setrlimit: |
581 | * Check permission before setting the resource limits of the current | 586 | * Check permission before setting the resource limits of the current |
582 | * process for @resource to @new_rlim. The old resource limit values can | 587 | * process for @resource to @new_rlim. The old resource limit values can |
@@ -596,6 +601,10 @@ struct swap_info_struct; | |||
596 | * @p. | 601 | * @p. |
597 | * @p contains the task_struct for process. | 602 | * @p contains the task_struct for process. |
598 | * Return 0 if permission is granted. | 603 | * Return 0 if permission is granted. |
604 | * @task_movememory | ||
605 | * Check permission before moving memory owned by process @p. | ||
606 | * @p contains the task_struct for process. | ||
607 | * Return 0 if permission is granted. | ||
599 | * @task_kill: | 608 | * @task_kill: |
600 | * Check permission before sending signal @sig to @p. @info can be NULL, | 609 | * Check permission before sending signal @sig to @p. @info can be NULL, |
601 | * the constant 1, or a pointer to a siginfo structure. If @info is 1 or | 610 | * the constant 1, or a pointer to a siginfo structure. If @info is 1 or |
@@ -1127,7 +1136,7 @@ struct security_operations { | |||
1127 | int (*sb_copy_data)(struct file_system_type *type, | 1136 | int (*sb_copy_data)(struct file_system_type *type, |
1128 | void *orig, void *copy); | 1137 | void *orig, void *copy); |
1129 | int (*sb_kern_mount) (struct super_block *sb, void *data); | 1138 | int (*sb_kern_mount) (struct super_block *sb, void *data); |
1130 | int (*sb_statfs) (struct super_block * sb); | 1139 | int (*sb_statfs) (struct dentry *dentry); |
1131 | int (*sb_mount) (char *dev_name, struct nameidata * nd, | 1140 | int (*sb_mount) (char *dev_name, struct nameidata * nd, |
1132 | char *type, unsigned long flags, void *data); | 1141 | char *type, unsigned long flags, void *data); |
1133 | int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd); | 1142 | int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd); |
@@ -1210,10 +1219,12 @@ struct security_operations { | |||
1210 | int (*task_getsid) (struct task_struct * p); | 1219 | int (*task_getsid) (struct task_struct * p); |
1211 | int (*task_setgroups) (struct group_info *group_info); | 1220 | int (*task_setgroups) (struct group_info *group_info); |
1212 | int (*task_setnice) (struct task_struct * p, int nice); | 1221 | int (*task_setnice) (struct task_struct * p, int nice); |
1222 | int (*task_setioprio) (struct task_struct * p, int ioprio); | ||
1213 | int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim); | 1223 | int (*task_setrlimit) (unsigned int resource, struct rlimit * new_rlim); |
1214 | int (*task_setscheduler) (struct task_struct * p, int policy, | 1224 | int (*task_setscheduler) (struct task_struct * p, int policy, |
1215 | struct sched_param * lp); | 1225 | struct sched_param * lp); |
1216 | int (*task_getscheduler) (struct task_struct * p); | 1226 | int (*task_getscheduler) (struct task_struct * p); |
1227 | int (*task_movememory) (struct task_struct * p); | ||
1217 | int (*task_kill) (struct task_struct * p, | 1228 | int (*task_kill) (struct task_struct * p, |
1218 | struct siginfo * info, int sig); | 1229 | struct siginfo * info, int sig); |
1219 | int (*task_wait) (struct task_struct * p); | 1230 | int (*task_wait) (struct task_struct * p); |
@@ -1313,7 +1324,7 @@ struct security_operations { | |||
1313 | 1324 | ||
1314 | /* key management security hooks */ | 1325 | /* key management security hooks */ |
1315 | #ifdef CONFIG_KEYS | 1326 | #ifdef CONFIG_KEYS |
1316 | int (*key_alloc)(struct key *key); | 1327 | int (*key_alloc)(struct key *key, struct task_struct *tsk); |
1317 | void (*key_free)(struct key *key); | 1328 | void (*key_free)(struct key *key); |
1318 | int (*key_permission)(key_ref_t key_ref, | 1329 | int (*key_permission)(key_ref_t key_ref, |
1319 | struct task_struct *context, | 1330 | struct task_struct *context, |
@@ -1450,9 +1461,9 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data) | |||
1450 | return security_ops->sb_kern_mount (sb, data); | 1461 | return security_ops->sb_kern_mount (sb, data); |
1451 | } | 1462 | } |
1452 | 1463 | ||
1453 | static inline int security_sb_statfs (struct super_block *sb) | 1464 | static inline int security_sb_statfs (struct dentry *dentry) |
1454 | { | 1465 | { |
1455 | return security_ops->sb_statfs (sb); | 1466 | return security_ops->sb_statfs (dentry); |
1456 | } | 1467 | } |
1457 | 1468 | ||
1458 | static inline int security_sb_mount (char *dev_name, struct nameidata *nd, | 1469 | static inline int security_sb_mount (char *dev_name, struct nameidata *nd, |
@@ -1836,6 +1847,11 @@ static inline int security_task_setnice (struct task_struct *p, int nice) | |||
1836 | return security_ops->task_setnice (p, nice); | 1847 | return security_ops->task_setnice (p, nice); |
1837 | } | 1848 | } |
1838 | 1849 | ||
1850 | static inline int security_task_setioprio (struct task_struct *p, int ioprio) | ||
1851 | { | ||
1852 | return security_ops->task_setioprio (p, ioprio); | ||
1853 | } | ||
1854 | |||
1839 | static inline int security_task_setrlimit (unsigned int resource, | 1855 | static inline int security_task_setrlimit (unsigned int resource, |
1840 | struct rlimit *new_rlim) | 1856 | struct rlimit *new_rlim) |
1841 | { | 1857 | { |
@@ -1854,6 +1870,11 @@ static inline int security_task_getscheduler (struct task_struct *p) | |||
1854 | return security_ops->task_getscheduler (p); | 1870 | return security_ops->task_getscheduler (p); |
1855 | } | 1871 | } |
1856 | 1872 | ||
1873 | static inline int security_task_movememory (struct task_struct *p) | ||
1874 | { | ||
1875 | return security_ops->task_movememory (p); | ||
1876 | } | ||
1877 | |||
1857 | static inline int security_task_kill (struct task_struct *p, | 1878 | static inline int security_task_kill (struct task_struct *p, |
1858 | struct siginfo *info, int sig) | 1879 | struct siginfo *info, int sig) |
1859 | { | 1880 | { |
@@ -2162,7 +2183,7 @@ static inline int security_sb_kern_mount (struct super_block *sb, void *data) | |||
2162 | return 0; | 2183 | return 0; |
2163 | } | 2184 | } |
2164 | 2185 | ||
2165 | static inline int security_sb_statfs (struct super_block *sb) | 2186 | static inline int security_sb_statfs (struct dentry *dentry) |
2166 | { | 2187 | { |
2167 | return 0; | 2188 | return 0; |
2168 | } | 2189 | } |
@@ -2478,6 +2499,11 @@ static inline int security_task_setnice (struct task_struct *p, int nice) | |||
2478 | return 0; | 2499 | return 0; |
2479 | } | 2500 | } |
2480 | 2501 | ||
2502 | static inline int security_task_setioprio (struct task_struct *p, int ioprio) | ||
2503 | { | ||
2504 | return 0; | ||
2505 | } | ||
2506 | |||
2481 | static inline int security_task_setrlimit (unsigned int resource, | 2507 | static inline int security_task_setrlimit (unsigned int resource, |
2482 | struct rlimit *new_rlim) | 2508 | struct rlimit *new_rlim) |
2483 | { | 2509 | { |
@@ -2496,6 +2522,11 @@ static inline int security_task_getscheduler (struct task_struct *p) | |||
2496 | return 0; | 2522 | return 0; |
2497 | } | 2523 | } |
2498 | 2524 | ||
2525 | static inline int security_task_movememory (struct task_struct *p) | ||
2526 | { | ||
2527 | return 0; | ||
2528 | } | ||
2529 | |||
2499 | static inline int security_task_kill (struct task_struct *p, | 2530 | static inline int security_task_kill (struct task_struct *p, |
2500 | struct siginfo *info, int sig) | 2531 | struct siginfo *info, int sig) |
2501 | { | 2532 | { |
@@ -3008,9 +3039,10 @@ static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid | |||
3008 | 3039 | ||
3009 | #ifdef CONFIG_KEYS | 3040 | #ifdef CONFIG_KEYS |
3010 | #ifdef CONFIG_SECURITY | 3041 | #ifdef CONFIG_SECURITY |
3011 | static inline int security_key_alloc(struct key *key) | 3042 | static inline int security_key_alloc(struct key *key, |
3043 | struct task_struct *tsk) | ||
3012 | { | 3044 | { |
3013 | return security_ops->key_alloc(key); | 3045 | return security_ops->key_alloc(key, tsk); |
3014 | } | 3046 | } |
3015 | 3047 | ||
3016 | static inline void security_key_free(struct key *key) | 3048 | static inline void security_key_free(struct key *key) |
@@ -3027,7 +3059,8 @@ static inline int security_key_permission(key_ref_t key_ref, | |||
3027 | 3059 | ||
3028 | #else | 3060 | #else |
3029 | 3061 | ||
3030 | static inline int security_key_alloc(struct key *key) | 3062 | static inline int security_key_alloc(struct key *key, |
3063 | struct task_struct *tsk) | ||
3031 | { | 3064 | { |
3032 | return 0; | 3065 | return 0; |
3033 | } | 3066 | } |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 66f8819f9568..16eef03ce0eb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -134,9 +134,10 @@ struct skb_frag_struct { | |||
134 | struct skb_shared_info { | 134 | struct skb_shared_info { |
135 | atomic_t dataref; | 135 | atomic_t dataref; |
136 | unsigned short nr_frags; | 136 | unsigned short nr_frags; |
137 | unsigned short tso_size; | 137 | unsigned short gso_size; |
138 | unsigned short tso_segs; | 138 | /* Warning: this field is not always filled in (UFO)! */ |
139 | unsigned short ufo_size; | 139 | unsigned short gso_segs; |
140 | unsigned short gso_type; | ||
140 | unsigned int ip6_frag_id; | 141 | unsigned int ip6_frag_id; |
141 | struct sk_buff *frag_list; | 142 | struct sk_buff *frag_list; |
142 | skb_frag_t frags[MAX_SKB_FRAGS]; | 143 | skb_frag_t frags[MAX_SKB_FRAGS]; |
@@ -168,6 +169,11 @@ enum { | |||
168 | SKB_FCLONE_CLONE, | 169 | SKB_FCLONE_CLONE, |
169 | }; | 170 | }; |
170 | 171 | ||
172 | enum { | ||
173 | SKB_GSO_TCPV4 = 1 << 0, | ||
174 | SKB_GSO_UDPV4 = 1 << 1, | ||
175 | }; | ||
176 | |||
171 | /** | 177 | /** |
172 | * struct sk_buff - socket buffer | 178 | * struct sk_buff - socket buffer |
173 | * @next: Next buffer in list | 179 | * @next: Next buffer in list |
@@ -209,6 +215,8 @@ enum { | |||
209 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 215 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
210 | * @tc_index: Traffic control index | 216 | * @tc_index: Traffic control index |
211 | * @tc_verd: traffic control verdict | 217 | * @tc_verd: traffic control verdict |
218 | * @dma_cookie: a cookie to one of several possible DMA operations | ||
219 | * done by skb DMA functions | ||
212 | * @secmark: security marking | 220 | * @secmark: security marking |
213 | */ | 221 | */ |
214 | 222 | ||
@@ -345,7 +353,7 @@ extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | |||
345 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | 353 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, |
346 | int newheadroom, int newtailroom, | 354 | int newheadroom, int newtailroom, |
347 | gfp_t priority); | 355 | gfp_t priority); |
348 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); | 356 | extern int skb_pad(struct sk_buff *skb, int pad); |
349 | #define dev_kfree_skb(a) kfree_skb(a) | 357 | #define dev_kfree_skb(a) kfree_skb(a) |
350 | extern void skb_over_panic(struct sk_buff *skb, int len, | 358 | extern void skb_over_panic(struct sk_buff *skb, int len, |
351 | void *here); | 359 | void *here); |
@@ -1122,16 +1130,15 @@ static inline int skb_cow(struct sk_buff *skb, unsigned int headroom) | |||
1122 | * | 1130 | * |
1123 | * Pads up a buffer to ensure the trailing bytes exist and are | 1131 | * Pads up a buffer to ensure the trailing bytes exist and are |
1124 | * blanked. If the buffer already contains sufficient data it | 1132 | * blanked. If the buffer already contains sufficient data it |
1125 | * is untouched. Returns the buffer, which may be a replacement | 1133 | * is untouched. Otherwise it is extended. Returns zero on |
1126 | * for the original, or NULL for out of memory - in which case | 1134 | * success. The skb is freed on error. |
1127 | * the original buffer is still freed. | ||
1128 | */ | 1135 | */ |
1129 | 1136 | ||
1130 | static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len) | 1137 | static inline int skb_padto(struct sk_buff *skb, unsigned int len) |
1131 | { | 1138 | { |
1132 | unsigned int size = skb->len; | 1139 | unsigned int size = skb->len; |
1133 | if (likely(size >= len)) | 1140 | if (likely(size >= len)) |
1134 | return skb; | 1141 | return 0; |
1135 | return skb_pad(skb, len-size); | 1142 | return skb_pad(skb, len-size); |
1136 | } | 1143 | } |
1137 | 1144 | ||
@@ -1292,6 +1299,7 @@ extern void skb_split(struct sk_buff *skb, | |||
1292 | struct sk_buff *skb1, const u32 len); | 1299 | struct sk_buff *skb1, const u32 len); |
1293 | 1300 | ||
1294 | extern void skb_release_data(struct sk_buff *skb); | 1301 | extern void skb_release_data(struct sk_buff *skb); |
1302 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int sg); | ||
1295 | 1303 | ||
1296 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 1304 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
1297 | int len, void *buffer) | 1305 | int len, void *buffer) |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 9dc93163e065..45ad55b70d1c 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -86,6 +86,51 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, void*); | |||
86 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) | 86 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) |
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | /** | ||
90 | * kmalloc - allocate memory | ||
91 | * @size: how many bytes of memory are required. | ||
92 | * @flags: the type of memory to allocate. | ||
93 | * | ||
94 | * kmalloc is the normal method of allocating memory | ||
95 | * in the kernel. | ||
96 | * | ||
97 | * The @flags argument may be one of: | ||
98 | * | ||
99 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
100 | * | ||
101 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
102 | * | ||
103 | * %GFP_ATOMIC - Allocation will not sleep. | ||
104 | * For example, use this inside interrupt handlers. | ||
105 | * | ||
106 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
107 | * | ||
108 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
109 | * | ||
110 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
111 | * | ||
112 | * Also it is possible to set different flags by OR'ing | ||
113 | * in one or more of the following additional @flags: | ||
114 | * | ||
115 | * %__GFP_COLD - Request cache-cold pages instead of | ||
116 | * trying to return cache-warm pages. | ||
117 | * | ||
118 | * %__GFP_DMA - Request memory from the DMA-capable zone. | ||
119 | * | ||
120 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
121 | * | ||
122 | * %__GFP_HIGHMEM - Allocated memory may be from highmem. | ||
123 | * | ||
124 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
125 | * (think twice before using). | ||
126 | * | ||
127 | * %__GFP_NORETRY - If memory is not immediately available, | ||
128 | * then give up at once. | ||
129 | * | ||
130 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
131 | * | ||
132 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
133 | */ | ||
89 | static inline void *kmalloc(size_t size, gfp_t flags) | 134 | static inline void *kmalloc(size_t size, gfp_t flags) |
90 | { | 135 | { |
91 | if (__builtin_constant_p(size)) { | 136 | if (__builtin_constant_p(size)) { |
@@ -111,6 +156,11 @@ found: | |||
111 | 156 | ||
112 | extern void *__kzalloc(size_t, gfp_t); | 157 | extern void *__kzalloc(size_t, gfp_t); |
113 | 158 | ||
159 | /** | ||
160 | * kzalloc - allocate memory. The memory is set to zero. | ||
161 | * @size: how many bytes of memory are required. | ||
162 | * @flags: the type of memory to allocate (see kmalloc). | ||
163 | */ | ||
114 | static inline void *kzalloc(size_t size, gfp_t flags) | 164 | static inline void *kzalloc(size_t size, gfp_t flags) |
115 | { | 165 | { |
116 | if (__builtin_constant_p(size)) { | 166 | if (__builtin_constant_p(size)) { |
diff --git a/include/linux/string.h b/include/linux/string.h index c61306da8c52..e4c755860316 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -56,6 +56,7 @@ extern char * strnchr(const char *, size_t, int); | |||
56 | #ifndef __HAVE_ARCH_STRRCHR | 56 | #ifndef __HAVE_ARCH_STRRCHR |
57 | extern char * strrchr(const char *,int); | 57 | extern char * strrchr(const char *,int); |
58 | #endif | 58 | #endif |
59 | extern char * strstrip(char *); | ||
59 | #ifndef __HAVE_ARCH_STRSTR | 60 | #ifndef __HAVE_ARCH_STRSTR |
60 | extern char * strstr(const char *,const char *); | 61 | extern char * strstr(const char *,const char *); |
61 | #endif | 62 | #endif |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 96e31aa64cc7..e82cb10fb3ea 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -71,6 +71,7 @@ struct saved_context; | |||
71 | void __save_processor_state(struct saved_context *ctxt); | 71 | void __save_processor_state(struct saved_context *ctxt); |
72 | void __restore_processor_state(struct saved_context *ctxt); | 72 | void __restore_processor_state(struct saved_context *ctxt); |
73 | unsigned long get_safe_page(gfp_t gfp_mask); | 73 | unsigned long get_safe_page(gfp_t gfp_mask); |
74 | int swsusp_add_arch_pages(unsigned long start, unsigned long end); | ||
74 | 75 | ||
75 | /* | 76 | /* |
76 | * XXX: We try to keep some more pages free so that I/O operations succeed | 77 | * XXX: We try to keep some more pages free so that I/O operations succeed |
diff --git a/include/linux/swap.h b/include/linux/swap.h index aca9bfae208f..dc3f3aa0c83e 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -28,7 +28,14 @@ static inline int current_is_kswapd(void) | |||
28 | * the type/offset into the pte as 5/27 as well. | 28 | * the type/offset into the pte as 5/27 as well. |
29 | */ | 29 | */ |
30 | #define MAX_SWAPFILES_SHIFT 5 | 30 | #define MAX_SWAPFILES_SHIFT 5 |
31 | #ifndef CONFIG_MIGRATION | ||
31 | #define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) | 32 | #define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) |
33 | #else | ||
34 | /* Use last two entries for page migration swap entries */ | ||
35 | #define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2) | ||
36 | #define SWP_MIGRATION_READ MAX_SWAPFILES | ||
37 | #define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1) | ||
38 | #endif | ||
32 | 39 | ||
33 | /* | 40 | /* |
34 | * Magic header for a swap area. The first part of the union is | 41 | * Magic header for a swap area. The first part of the union is |
@@ -48,12 +55,14 @@ union swap_header { | |||
48 | char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */ | 55 | char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */ |
49 | } magic; | 56 | } magic; |
50 | struct { | 57 | struct { |
51 | char bootbits[1024]; /* Space for disklabel etc. */ | 58 | char bootbits[1024]; /* Space for disklabel etc. */ |
52 | unsigned int version; | 59 | __u32 version; |
53 | unsigned int last_page; | 60 | __u32 last_page; |
54 | unsigned int nr_badpages; | 61 | __u32 nr_badpages; |
55 | unsigned int padding[125]; | 62 | unsigned char sws_uuid[16]; |
56 | unsigned int badpages[1]; | 63 | unsigned char sws_volume[16]; |
64 | __u32 padding[117]; | ||
65 | __u32 badpages[1]; | ||
57 | } info; | 66 | } info; |
58 | }; | 67 | }; |
59 | 68 | ||
@@ -176,20 +185,7 @@ extern unsigned long try_to_free_pages(struct zone **, gfp_t); | |||
176 | extern unsigned long shrink_all_memory(unsigned long nr_pages); | 185 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
177 | extern int vm_swappiness; | 186 | extern int vm_swappiness; |
178 | extern int remove_mapping(struct address_space *mapping, struct page *page); | 187 | extern int remove_mapping(struct address_space *mapping, struct page *page); |
179 | 188 | extern long vm_total_pages; | |
180 | /* possible outcome of pageout() */ | ||
181 | typedef enum { | ||
182 | /* failed to write page out, page is locked */ | ||
183 | PAGE_KEEP, | ||
184 | /* move page to the active list, page is locked */ | ||
185 | PAGE_ACTIVATE, | ||
186 | /* page has been sent to the disk successfully, page is unlocked */ | ||
187 | PAGE_SUCCESS, | ||
188 | /* page is clean and locked */ | ||
189 | PAGE_CLEAN, | ||
190 | } pageout_t; | ||
191 | |||
192 | extern pageout_t pageout(struct page *page, struct address_space *mapping); | ||
193 | 189 | ||
194 | #ifdef CONFIG_NUMA | 190 | #ifdef CONFIG_NUMA |
195 | extern int zone_reclaim_mode; | 191 | extern int zone_reclaim_mode; |
@@ -250,7 +246,6 @@ extern int remove_exclusive_swap_page(struct page *); | |||
250 | struct backing_dev_info; | 246 | struct backing_dev_info; |
251 | 247 | ||
252 | extern spinlock_t swap_lock; | 248 | extern spinlock_t swap_lock; |
253 | extern int remove_vma_swap(struct vm_area_struct *vma, struct page *page); | ||
254 | 249 | ||
255 | /* linux/mm/thrash.c */ | 250 | /* linux/mm/thrash.c */ |
256 | extern struct mm_struct * swap_token_mm; | 251 | extern struct mm_struct * swap_token_mm; |
@@ -288,18 +283,60 @@ static inline void disable_swap_token(void) | |||
288 | #define free_pages_and_swap_cache(pages, nr) \ | 283 | #define free_pages_and_swap_cache(pages, nr) \ |
289 | release_pages((pages), (nr), 0); | 284 | release_pages((pages), (nr), 0); |
290 | 285 | ||
291 | #define show_swap_cache_info() /*NOTHING*/ | 286 | static inline void show_swap_cache_info(void) |
292 | #define free_swap_and_cache(swp) /*NOTHING*/ | 287 | { |
293 | #define swap_duplicate(swp) /*NOTHING*/ | 288 | } |
294 | #define swap_free(swp) /*NOTHING*/ | 289 | |
295 | #define read_swap_cache_async(swp,vma,addr) NULL | 290 | static inline void free_swap_and_cache(swp_entry_t swp) |
296 | #define lookup_swap_cache(swp) NULL | 291 | { |
297 | #define valid_swaphandles(swp, off) 0 | 292 | } |
293 | |||
294 | static inline int swap_duplicate(swp_entry_t swp) | ||
295 | { | ||
296 | return 0; | ||
297 | } | ||
298 | |||
299 | static inline void swap_free(swp_entry_t swp) | ||
300 | { | ||
301 | } | ||
302 | |||
303 | static inline struct page *read_swap_cache_async(swp_entry_t swp, | ||
304 | struct vm_area_struct *vma, unsigned long addr) | ||
305 | { | ||
306 | return NULL; | ||
307 | } | ||
308 | |||
309 | static inline struct page *lookup_swap_cache(swp_entry_t swp) | ||
310 | { | ||
311 | return NULL; | ||
312 | } | ||
313 | |||
314 | static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset) | ||
315 | { | ||
316 | return 0; | ||
317 | } | ||
318 | |||
298 | #define can_share_swap_page(p) (page_mapcount(p) == 1) | 319 | #define can_share_swap_page(p) (page_mapcount(p) == 1) |
299 | #define move_to_swap_cache(p, swp) 1 | 320 | |
300 | #define move_from_swap_cache(p, i, m) 1 | 321 | static inline int move_to_swap_cache(struct page *page, swp_entry_t entry) |
301 | #define __delete_from_swap_cache(p) /*NOTHING*/ | 322 | { |
302 | #define delete_from_swap_cache(p) /*NOTHING*/ | 323 | return 1; |
324 | } | ||
325 | |||
326 | static inline int move_from_swap_cache(struct page *page, unsigned long index, | ||
327 | struct address_space *mapping) | ||
328 | { | ||
329 | return 1; | ||
330 | } | ||
331 | |||
332 | static inline void __delete_from_swap_cache(struct page *page) | ||
333 | { | ||
334 | } | ||
335 | |||
336 | static inline void delete_from_swap_cache(struct page *page) | ||
337 | { | ||
338 | } | ||
339 | |||
303 | #define swap_token_default_timeout 0 | 340 | #define swap_token_default_timeout 0 |
304 | 341 | ||
305 | static inline int remove_exclusive_swap_page(struct page *p) | 342 | static inline int remove_exclusive_swap_page(struct page *p) |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 87b9d14c710d..ec639aa3a1d3 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -67,3 +67,56 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry) | |||
67 | BUG_ON(pte_file(__swp_entry_to_pte(arch_entry))); | 67 | BUG_ON(pte_file(__swp_entry_to_pte(arch_entry))); |
68 | return __swp_entry_to_pte(arch_entry); | 68 | return __swp_entry_to_pte(arch_entry); |
69 | } | 69 | } |
70 | |||
71 | #ifdef CONFIG_MIGRATION | ||
72 | static inline swp_entry_t make_migration_entry(struct page *page, int write) | ||
73 | { | ||
74 | BUG_ON(!PageLocked(page)); | ||
75 | return swp_entry(write ? SWP_MIGRATION_WRITE : SWP_MIGRATION_READ, | ||
76 | page_to_pfn(page)); | ||
77 | } | ||
78 | |||
79 | static inline int is_migration_entry(swp_entry_t entry) | ||
80 | { | ||
81 | return unlikely(swp_type(entry) == SWP_MIGRATION_READ || | ||
82 | swp_type(entry) == SWP_MIGRATION_WRITE); | ||
83 | } | ||
84 | |||
85 | static inline int is_write_migration_entry(swp_entry_t entry) | ||
86 | { | ||
87 | return unlikely(swp_type(entry) == SWP_MIGRATION_WRITE); | ||
88 | } | ||
89 | |||
90 | static inline struct page *migration_entry_to_page(swp_entry_t entry) | ||
91 | { | ||
92 | struct page *p = pfn_to_page(swp_offset(entry)); | ||
93 | /* | ||
94 | * Any use of migration entries may only occur while the | ||
95 | * corresponding page is locked | ||
96 | */ | ||
97 | BUG_ON(!PageLocked(p)); | ||
98 | return p; | ||
99 | } | ||
100 | |||
101 | static inline void make_migration_entry_read(swp_entry_t *entry) | ||
102 | { | ||
103 | *entry = swp_entry(SWP_MIGRATION_READ, swp_offset(*entry)); | ||
104 | } | ||
105 | |||
106 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | ||
107 | unsigned long address); | ||
108 | #else | ||
109 | |||
110 | #define make_migration_entry(page, write) swp_entry(0, 0) | ||
111 | #define is_migration_entry(swp) 0 | ||
112 | #define migration_entry_to_page(swp) NULL | ||
113 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } | ||
114 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | ||
115 | unsigned long address) { } | ||
116 | static inline int is_write_migration_entry(swp_entry_t entry) | ||
117 | { | ||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | #endif | ||
122 | |||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index bd67a4413df7..33785b79d548 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -516,6 +516,16 @@ asmlinkage long sys_set_mempolicy(int mode, unsigned long __user *nmask, | |||
516 | asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, | 516 | asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode, |
517 | const unsigned long __user *from, | 517 | const unsigned long __user *from, |
518 | const unsigned long __user *to); | 518 | const unsigned long __user *to); |
519 | asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages, | ||
520 | const void __user * __user *pages, | ||
521 | const int __user *nodes, | ||
522 | int __user *status, | ||
523 | int flags); | ||
524 | asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page, | ||
525 | __u32 __user *pages, | ||
526 | const int __user *nodes, | ||
527 | int __user *status, | ||
528 | int flags); | ||
519 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, | 529 | asmlinkage long sys_mbind(unsigned long start, unsigned long len, |
520 | unsigned long mode, | 530 | unsigned long mode, |
521 | unsigned long __user *nmask, | 531 | unsigned long __user *nmask, |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index cee944dbdcd4..c7132029af0f 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -186,6 +186,7 @@ enum | |||
186 | VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ | 186 | VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ |
187 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ | 187 | VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ |
188 | VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ | 188 | VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ |
189 | VM_PANIC_ON_OOM=33, /* panic at out-of-memory */ | ||
189 | }; | 190 | }; |
190 | 191 | ||
191 | 192 | ||
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index 2a4b432e1176..166a2e58c287 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h | |||
@@ -37,11 +37,27 @@ struct sysdev_class { | |||
37 | struct kset kset; | 37 | struct kset kset; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | struct sysdev_class_attribute { | ||
41 | struct attribute attr; | ||
42 | ssize_t (*show)(struct sysdev_class *, char *); | ||
43 | ssize_t (*store)(struct sysdev_class *, const char *, size_t); | ||
44 | }; | ||
45 | |||
46 | #define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ | ||
47 | struct sysdev_class_attribute attr_##_name = { \ | ||
48 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | ||
49 | .show = _show, \ | ||
50 | .store = _store, \ | ||
51 | }; | ||
52 | |||
40 | 53 | ||
41 | extern int sysdev_class_register(struct sysdev_class *); | 54 | extern int sysdev_class_register(struct sysdev_class *); |
42 | extern void sysdev_class_unregister(struct sysdev_class *); | 55 | extern void sysdev_class_unregister(struct sysdev_class *); |
43 | 56 | ||
44 | 57 | extern int sysdev_class_create_file(struct sysdev_class *, | |
58 | struct sysdev_class_attribute *); | ||
59 | extern void sysdev_class_remove_file(struct sysdev_class *, | ||
60 | struct sysdev_class_attribute *); | ||
45 | /** | 61 | /** |
46 | * Auxillary system device drivers. | 62 | * Auxillary system device drivers. |
47 | */ | 63 | */ |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 420a689c3fb4..8ebf497907f8 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -18,7 +18,6 @@ | |||
18 | #define _LINUX_TCP_H | 18 | #define _LINUX_TCP_H |
19 | 19 | ||
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <linux/dmaengine.h> | ||
22 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
23 | 22 | ||
24 | struct tcphdr { | 23 | struct tcphdr { |
@@ -161,6 +160,7 @@ struct tcp_info | |||
161 | #ifdef __KERNEL__ | 160 | #ifdef __KERNEL__ |
162 | 161 | ||
163 | #include <linux/skbuff.h> | 162 | #include <linux/skbuff.h> |
163 | #include <linux/dmaengine.h> | ||
164 | #include <net/sock.h> | 164 | #include <net/sock.h> |
165 | #include <net/inet_connection_sock.h> | 165 | #include <net/inet_connection_sock.h> |
166 | #include <net/inet_timewait_sock.h> | 166 | #include <net/inet_timewait_sock.h> |
diff --git a/include/linux/tty.h b/include/linux/tty.h index e898eeb94166..cb35ca50a0a6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -290,7 +290,9 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); | |||
290 | extern int tty_unregister_ldisc(int disc); | 290 | extern int tty_unregister_ldisc(int disc); |
291 | extern int tty_register_driver(struct tty_driver *driver); | 291 | extern int tty_register_driver(struct tty_driver *driver); |
292 | extern int tty_unregister_driver(struct tty_driver *driver); | 292 | extern int tty_unregister_driver(struct tty_driver *driver); |
293 | extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); | 293 | extern struct class_device *tty_register_device(struct tty_driver *driver, |
294 | unsigned index, | ||
295 | struct device *dev); | ||
294 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); | 296 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); |
295 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, | 297 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, |
296 | int buflen); | 298 | int buflen); |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h new file mode 100644 index 000000000000..391e7ed1eb3f --- /dev/null +++ b/include/linux/uaccess.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef __LINUX_UACCESS_H__ | ||
2 | #define __LINUX_UACCESS_H__ | ||
3 | |||
4 | #include <asm/uaccess.h> | ||
5 | |||
6 | #ifndef ARCH_HAS_NOCACHE_UACCESS | ||
7 | |||
8 | static inline unsigned long __copy_from_user_inatomic_nocache(void *to, | ||
9 | const void __user *from, unsigned long n) | ||
10 | { | ||
11 | return __copy_from_user_inatomic(to, from, n); | ||
12 | } | ||
13 | |||
14 | static inline unsigned long __copy_from_user_nocache(void *to, | ||
15 | const void __user *from, unsigned long n) | ||
16 | { | ||
17 | return __copy_from_user(to, from, n); | ||
18 | } | ||
19 | |||
20 | #endif /* ARCH_HAS_NOCACHE_UACCESS */ | ||
21 | |||
22 | #endif /* __LINUX_UACCESS_H__ */ | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index 1f492c0c7047..8dead32e7ebf 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -40,6 +40,8 @@ struct usb_driver; | |||
40 | * Devices may also have class-specific or vendor-specific descriptors. | 40 | * Devices may also have class-specific or vendor-specific descriptors. |
41 | */ | 41 | */ |
42 | 42 | ||
43 | struct ep_device; | ||
44 | |||
43 | /** | 45 | /** |
44 | * struct usb_host_endpoint - host-side endpoint descriptor and queue | 46 | * struct usb_host_endpoint - host-side endpoint descriptor and queue |
45 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder | 47 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder |
@@ -57,7 +59,7 @@ struct usb_host_endpoint { | |||
57 | struct usb_endpoint_descriptor desc; | 59 | struct usb_endpoint_descriptor desc; |
58 | struct list_head urb_list; | 60 | struct list_head urb_list; |
59 | void *hcpriv; | 61 | void *hcpriv; |
60 | struct kobject *kobj; /* For sysfs info */ | 62 | struct ep_device *ep_dev; /* For sysfs info */ |
61 | 63 | ||
62 | unsigned char *extra; /* Extra descriptors */ | 64 | unsigned char *extra; /* Extra descriptors */ |
63 | int extralen; | 65 | int extralen; |
@@ -101,7 +103,8 @@ enum usb_interface_condition { | |||
101 | * @condition: binding state of the interface: not bound, binding | 103 | * @condition: binding state of the interface: not bound, binding |
102 | * (in probe()), bound to a driver, or unbinding (in disconnect()) | 104 | * (in probe()), bound to a driver, or unbinding (in disconnect()) |
103 | * @dev: driver model's view of this device | 105 | * @dev: driver model's view of this device |
104 | * @class_dev: driver model's class view of this device. | 106 | * @usb_dev: if an interface is bound to the USB major, this will point |
107 | * to the sysfs representation for that device. | ||
105 | * | 108 | * |
106 | * USB device drivers attach to interfaces on a physical device. Each | 109 | * USB device drivers attach to interfaces on a physical device. Each |
107 | * interface encapsulates a single high level function, such as feeding | 110 | * interface encapsulates a single high level function, such as feeding |
@@ -141,7 +144,7 @@ struct usb_interface { | |||
141 | * bound to */ | 144 | * bound to */ |
142 | enum usb_interface_condition condition; /* state of binding */ | 145 | enum usb_interface_condition condition; /* state of binding */ |
143 | struct device dev; /* interface specific device info */ | 146 | struct device dev; /* interface specific device info */ |
144 | struct class_device *class_dev; | 147 | struct device *usb_dev; /* pointer to the usb class's device, if any */ |
145 | }; | 148 | }; |
146 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 149 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
147 | #define interface_to_usbdev(intf) \ | 150 | #define interface_to_usbdev(intf) \ |
@@ -358,7 +361,7 @@ struct usb_device { | |||
358 | char *serial; /* iSerialNumber string, if present */ | 361 | char *serial; /* iSerialNumber string, if present */ |
359 | 362 | ||
360 | struct list_head filelist; | 363 | struct list_head filelist; |
361 | struct class_device *class_dev; | 364 | struct device *usbfs_dev; |
362 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ | 365 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ |
363 | 366 | ||
364 | /* | 367 | /* |
@@ -386,6 +389,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev, | |||
386 | 389 | ||
387 | /* USB port reset for device reinitialization */ | 390 | /* USB port reset for device reinitialization */ |
388 | extern int usb_reset_device(struct usb_device *dev); | 391 | extern int usb_reset_device(struct usb_device *dev); |
392 | extern int usb_reset_composite_device(struct usb_device *dev, | ||
393 | struct usb_interface *iface); | ||
389 | 394 | ||
390 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | 395 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); |
391 | 396 | ||
@@ -554,6 +559,10 @@ struct usb_dynids { | |||
554 | * do (or don't) show up otherwise in the filesystem. | 559 | * do (or don't) show up otherwise in the filesystem. |
555 | * @suspend: Called when the device is going to be suspended by the system. | 560 | * @suspend: Called when the device is going to be suspended by the system. |
556 | * @resume: Called when the device is being resumed by the system. | 561 | * @resume: Called when the device is being resumed by the system. |
562 | * @pre_reset: Called by usb_reset_composite_device() when the device | ||
563 | * is about to be reset. | ||
564 | * @post_reset: Called by usb_reset_composite_device() after the device | ||
565 | * has been reset. | ||
557 | * @id_table: USB drivers use ID table to support hotplugging. | 566 | * @id_table: USB drivers use ID table to support hotplugging. |
558 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set | 567 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set |
559 | * or your driver's probe function will never get called. | 568 | * or your driver's probe function will never get called. |
@@ -592,6 +601,9 @@ struct usb_driver { | |||
592 | int (*suspend) (struct usb_interface *intf, pm_message_t message); | 601 | int (*suspend) (struct usb_interface *intf, pm_message_t message); |
593 | int (*resume) (struct usb_interface *intf); | 602 | int (*resume) (struct usb_interface *intf); |
594 | 603 | ||
604 | void (*pre_reset) (struct usb_interface *intf); | ||
605 | void (*post_reset) (struct usb_interface *intf); | ||
606 | |||
595 | const struct usb_device_id *id_table; | 607 | const struct usb_device_id *id_table; |
596 | 608 | ||
597 | struct usb_dynids dynids; | 609 | struct usb_dynids dynids; |
@@ -1008,6 +1020,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe, | |||
1008 | extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, | 1020 | extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, |
1009 | __u8 request, __u8 requesttype, __u16 value, __u16 index, | 1021 | __u8 request, __u8 requesttype, __u16 value, __u16 index, |
1010 | void *data, __u16 size, int timeout); | 1022 | void *data, __u16 size, int timeout); |
1023 | extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe, | ||
1024 | void *data, int len, int *actual_length, int timeout); | ||
1011 | extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, | 1025 | extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, |
1012 | void *data, int len, int *actual_length, | 1026 | void *data, int len, int *actual_length, |
1013 | int timeout); | 1027 | int timeout); |
diff --git a/include/linux/usb_cdc.h b/include/linux/usb/cdc.h index ba617c372455..ba617c372455 100644 --- a/include/linux/usb_cdc.h +++ b/include/linux/usb/cdc.h | |||
diff --git a/include/linux/usb_input.h b/include/linux/usb/input.h index 716e0cc16043..716e0cc16043 100644 --- a/include/linux/usb_input.h +++ b/include/linux/usb/input.h | |||
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb/isp116x.h index 436dd8a2b64a..436dd8a2b64a 100644 --- a/include/linux/usb_isp116x.h +++ b/include/linux/usb/isp116x.h | |||
diff --git a/include/linux/usb_sl811.h b/include/linux/usb/sl811.h index 4f2d012d7309..397ee3b3d7f3 100644 --- a/include/linux/usb_sl811.h +++ b/include/linux/usb/sl811.h | |||
@@ -14,13 +14,13 @@ struct sl811_platform_data { | |||
14 | u8 power; | 14 | u8 power; |
15 | 15 | ||
16 | /* sl811 relies on an external source of VBUS current */ | 16 | /* sl811 relies on an external source of VBUS current */ |
17 | void (*port_power)(struct device *dev, int is_on); | 17 | void (*port_power)(struct device *dev, int is_on); |
18 | 18 | ||
19 | /* pulse sl811 nRST (probably with a GPIO) */ | 19 | /* pulse sl811 nRST (probably with a GPIO) */ |
20 | void (*reset)(struct device *dev); | 20 | void (*reset)(struct device *dev); |
21 | 21 | ||
22 | // some boards need something like these: | 22 | // some boards need something like these: |
23 | // int (*check_overcurrent)(struct device *dev); | 23 | // int (*check_overcurrent)(struct device *dev); |
24 | // void (*clock_enable)(struct device *dev, int is_on); | 24 | // void (*clock_enable)(struct device *dev, int is_on); |
25 | }; | 25 | }; |
26 | 26 | ||
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 1d5577b2b752..f6024ab4eff0 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -4,10 +4,13 @@ | |||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <asm/page.h> /* pgprot_t */ | 5 | #include <asm/page.h> /* pgprot_t */ |
6 | 6 | ||
7 | struct vm_area_struct; | ||
8 | |||
7 | /* bits in vm_struct->flags */ | 9 | /* bits in vm_struct->flags */ |
8 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ | 10 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
9 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 11 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
10 | #define VM_MAP 0x00000004 /* vmap()ed pages */ | 12 | #define VM_MAP 0x00000004 /* vmap()ed pages */ |
13 | #define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ | ||
11 | /* bits [20..32] reserved for arch specific ioremap internals */ | 14 | /* bits [20..32] reserved for arch specific ioremap internals */ |
12 | 15 | ||
13 | /* | 16 | /* |
@@ -32,9 +35,11 @@ struct vm_struct { | |||
32 | * Highlevel APIs for driver use | 35 | * Highlevel APIs for driver use |
33 | */ | 36 | */ |
34 | extern void *vmalloc(unsigned long size); | 37 | extern void *vmalloc(unsigned long size); |
38 | extern void *vmalloc_user(unsigned long size); | ||
35 | extern void *vmalloc_node(unsigned long size, int node); | 39 | extern void *vmalloc_node(unsigned long size, int node); |
36 | extern void *vmalloc_exec(unsigned long size); | 40 | extern void *vmalloc_exec(unsigned long size); |
37 | extern void *vmalloc_32(unsigned long size); | 41 | extern void *vmalloc_32(unsigned long size); |
42 | extern void *vmalloc_32_user(unsigned long size); | ||
38 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 43 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
39 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, | 44 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, |
40 | pgprot_t prot); | 45 | pgprot_t prot); |
@@ -45,6 +50,9 @@ extern void vfree(void *addr); | |||
45 | extern void *vmap(struct page **pages, unsigned int count, | 50 | extern void *vmap(struct page **pages, unsigned int count, |
46 | unsigned long flags, pgprot_t prot); | 51 | unsigned long flags, pgprot_t prot); |
47 | extern void vunmap(void *addr); | 52 | extern void vunmap(void *addr); |
53 | |||
54 | extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, | ||
55 | unsigned long pgoff); | ||
48 | 56 | ||
49 | /* | 57 | /* |
50 | * Lowlevel-APIs (not for driver use!) | 58 | * Lowlevel-APIs (not for driver use!) |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 56f92fcbe94a..9e38b566d0e7 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -50,14 +50,15 @@ struct writeback_control { | |||
50 | * a hint that the filesystem need only write out the pages inside that | 50 | * a hint that the filesystem need only write out the pages inside that |
51 | * byterange. The byte at `end' is included in the writeout request. | 51 | * byterange. The byte at `end' is included in the writeout request. |
52 | */ | 52 | */ |
53 | loff_t start; | 53 | loff_t range_start; |
54 | loff_t end; | 54 | loff_t range_end; |
55 | 55 | ||
56 | unsigned nonblocking:1; /* Don't get stuck on request queues */ | 56 | unsigned nonblocking:1; /* Don't get stuck on request queues */ |
57 | unsigned encountered_congestion:1; /* An output: a queue is full */ | 57 | unsigned encountered_congestion:1; /* An output: a queue is full */ |
58 | unsigned for_kupdate:1; /* A kupdate writeback */ | 58 | unsigned for_kupdate:1; /* A kupdate writeback */ |
59 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 59 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
60 | unsigned for_writepages:1; /* This is a writepages() call */ | 60 | unsigned for_writepages:1; /* This is a writepages() call */ |
61 | unsigned range_cyclic:1; /* range_start is cyclic */ | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | /* | 64 | /* |
diff --git a/include/linux/zconf.h b/include/linux/zconf.h index f1cfd66b9554..0beb75e38caa 100644 --- a/include/linux/zconf.h +++ b/include/linux/zconf.h | |||
@@ -35,6 +35,18 @@ | |||
35 | # define MAX_WBITS 15 /* 32K LZ77 window */ | 35 | # define MAX_WBITS 15 /* 32K LZ77 window */ |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | /* default windowBits for decompression. MAX_WBITS is for compression only */ | ||
39 | #ifndef DEF_WBITS | ||
40 | # define DEF_WBITS MAX_WBITS | ||
41 | #endif | ||
42 | |||
43 | /* default memLevel */ | ||
44 | #if MAX_MEM_LEVEL >= 8 | ||
45 | # define DEF_MEM_LEVEL 8 | ||
46 | #else | ||
47 | # define DEF_MEM_LEVEL MAX_MEM_LEVEL | ||
48 | #endif | ||
49 | |||
38 | /* Type declarations */ | 50 | /* Type declarations */ |
39 | 51 | ||
40 | typedef unsigned char Byte; /* 8 bits */ | 52 | typedef unsigned char Byte; /* 8 bits */ |
diff --git a/include/linux/zlib.h b/include/linux/zlib.h index 4fa32f0d4df8..9e3192a7dc6f 100644 --- a/include/linux/zlib.h +++ b/include/linux/zlib.h | |||
@@ -1,7 +1,6 @@ | |||
1 | /* zlib.h -- interface of the 'zlib' general purpose compression library | 1 | /* zlib.h -- interface of the 'zlib' general purpose compression library |
2 | version 1.1.3, July 9th, 1998 | ||
3 | 2 | ||
4 | Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler | 3 | Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler |
5 | 4 | ||
6 | This software is provided 'as-is', without any express or implied | 5 | This software is provided 'as-is', without any express or implied |
7 | warranty. In no event will the authors be held liable for any damages | 6 | warranty. In no event will the authors be held liable for any damages |
@@ -24,7 +23,7 @@ | |||
24 | 23 | ||
25 | 24 | ||
26 | The data format used by the zlib library is described by RFCs (Request for | 25 | The data format used by the zlib library is described by RFCs (Request for |
27 | Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt | 26 | Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt |
28 | (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). | 27 | (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). |
29 | */ | 28 | */ |
30 | 29 | ||
@@ -33,7 +32,22 @@ | |||
33 | 32 | ||
34 | #include <linux/zconf.h> | 33 | #include <linux/zconf.h> |
35 | 34 | ||
36 | #define ZLIB_VERSION "1.1.3" | 35 | /* zlib deflate based on ZLIB_VERSION "1.1.3" */ |
36 | /* zlib inflate based on ZLIB_VERSION "1.2.3" */ | ||
37 | |||
38 | /* | ||
39 | This is a modified version of zlib for use inside the Linux kernel. | ||
40 | The main changes are to perform all memory allocation in advance. | ||
41 | |||
42 | Inflation Changes: | ||
43 | * Z_PACKET_FLUSH is added and used by ppp_deflate. Before returning | ||
44 | this checks there is no more input data available and the next data | ||
45 | is a STORED block. It also resets the mode to be read for the next | ||
46 | data, all as per PPP requirements. | ||
47 | * Addition of zlib_inflateIncomp which copies incompressible data into | ||
48 | the history window and adjusts the accoutning without calling | ||
49 | zlib_inflate itself to inflate the data. | ||
50 | */ | ||
37 | 51 | ||
38 | /* | 52 | /* |
39 | The 'zlib' compression library provides in-memory compression and | 53 | The 'zlib' compression library provides in-memory compression and |
@@ -48,9 +62,18 @@ | |||
48 | application must provide more input and/or consume the output | 62 | application must provide more input and/or consume the output |
49 | (providing more output space) before each call. | 63 | (providing more output space) before each call. |
50 | 64 | ||
65 | The compressed data format used by default by the in-memory functions is | ||
66 | the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped | ||
67 | around a deflate stream, which is itself documented in RFC 1951. | ||
68 | |||
51 | The library also supports reading and writing files in gzip (.gz) format | 69 | The library also supports reading and writing files in gzip (.gz) format |
52 | with an interface similar to that of stdio. | 70 | with an interface similar to that of stdio. |
53 | 71 | ||
72 | The zlib format was designed to be compact and fast for use in memory | ||
73 | and on communications channels. The gzip format was designed for single- | ||
74 | file compression on file systems, has a larger header than zlib to maintain | ||
75 | directory information, and uses a different, slower check method than zlib. | ||
76 | |||
54 | The library does not install any signal handler. The decoder checks | 77 | The library does not install any signal handler. The decoder checks |
55 | the consistency of the compressed data, so the library should never | 78 | the consistency of the compressed data, so the library should never |
56 | crash even in case of corrupted input. | 79 | crash even in case of corrupted input. |
@@ -119,7 +142,8 @@ typedef z_stream *z_streamp; | |||
119 | #define Z_SYNC_FLUSH 3 | 142 | #define Z_SYNC_FLUSH 3 |
120 | #define Z_FULL_FLUSH 4 | 143 | #define Z_FULL_FLUSH 4 |
121 | #define Z_FINISH 5 | 144 | #define Z_FINISH 5 |
122 | /* Allowed flush values; see deflate() below for details */ | 145 | #define Z_BLOCK 6 /* Only for inflate at present */ |
146 | /* Allowed flush values; see deflate() and inflate() below for details */ | ||
123 | 147 | ||
124 | #define Z_OK 0 | 148 | #define Z_OK 0 |
125 | #define Z_STREAM_END 1 | 149 | #define Z_STREAM_END 1 |
@@ -155,13 +179,6 @@ typedef z_stream *z_streamp; | |||
155 | 179 | ||
156 | /* basic functions */ | 180 | /* basic functions */ |
157 | 181 | ||
158 | extern const char * zlib_zlibVersion (void); | ||
159 | /* The application can compare zlibVersion and ZLIB_VERSION for consistency. | ||
160 | If the first character differs, the library code actually used is | ||
161 | not compatible with the zlib.h header file used by the application. | ||
162 | This check is automatically made by deflateInit and inflateInit. | ||
163 | */ | ||
164 | |||
165 | extern int zlib_deflate_workspacesize (void); | 182 | extern int zlib_deflate_workspacesize (void); |
166 | /* | 183 | /* |
167 | Returns the number of bytes that needs to be allocated for a per- | 184 | Returns the number of bytes that needs to be allocated for a per- |
@@ -315,9 +332,9 @@ extern int zlib_inflateInit (z_streamp strm); | |||
315 | extern int zlib_inflate (z_streamp strm, int flush); | 332 | extern int zlib_inflate (z_streamp strm, int flush); |
316 | /* | 333 | /* |
317 | inflate decompresses as much data as possible, and stops when the input | 334 | inflate decompresses as much data as possible, and stops when the input |
318 | buffer becomes empty or the output buffer becomes full. It may some | 335 | buffer becomes empty or the output buffer becomes full. It may introduce |
319 | introduce some output latency (reading input without producing any output) | 336 | some output latency (reading input without producing any output) except when |
320 | except when forced to flush. | 337 | forced to flush. |
321 | 338 | ||
322 | The detailed semantics are as follows. inflate performs one or both of the | 339 | The detailed semantics are as follows. inflate performs one or both of the |
323 | following actions: | 340 | following actions: |
@@ -341,11 +358,26 @@ extern int zlib_inflate (z_streamp strm, int flush); | |||
341 | must be called again after making room in the output buffer because there | 358 | must be called again after making room in the output buffer because there |
342 | might be more output pending. | 359 | might be more output pending. |
343 | 360 | ||
344 | If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much | 361 | The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, |
345 | output as possible to the output buffer. The flushing behavior of inflate is | 362 | Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much |
346 | not specified for values of the flush parameter other than Z_SYNC_FLUSH | 363 | output as possible to the output buffer. Z_BLOCK requests that inflate() stop |
347 | and Z_FINISH, but the current implementation actually flushes as much output | 364 | if and when it gets to the next deflate block boundary. When decoding the |
348 | as possible anyway. | 365 | zlib or gzip format, this will cause inflate() to return immediately after |
366 | the header and before the first block. When doing a raw inflate, inflate() | ||
367 | will go ahead and process the first block, and will return when it gets to | ||
368 | the end of that block, or when it runs out of data. | ||
369 | |||
370 | The Z_BLOCK option assists in appending to or combining deflate streams. | ||
371 | Also to assist in this, on return inflate() will set strm->data_type to the | ||
372 | number of unused bits in the last byte taken from strm->next_in, plus 64 | ||
373 | if inflate() is currently decoding the last block in the deflate stream, | ||
374 | plus 128 if inflate() returned immediately after decoding an end-of-block | ||
375 | code or decoding the complete header up to just before the first byte of the | ||
376 | deflate stream. The end-of-block will not be indicated until all of the | ||
377 | uncompressed data from that block has been written to strm->next_out. The | ||
378 | number of unused bits may in general be greater than seven, except when | ||
379 | bit 7 of data_type is set, in which case the number of unused bits will be | ||
380 | less than eight. | ||
349 | 381 | ||
350 | inflate() should normally be called until it returns Z_STREAM_END or an | 382 | inflate() should normally be called until it returns Z_STREAM_END or an |
351 | error. However if all decompression is to be performed in a single step | 383 | error. However if all decompression is to be performed in a single step |
@@ -355,29 +387,44 @@ extern int zlib_inflate (z_streamp strm, int flush); | |||
355 | uncompressed data. (The size of the uncompressed data may have been saved | 387 | uncompressed data. (The size of the uncompressed data may have been saved |
356 | by the compressor for this purpose.) The next operation on this stream must | 388 | by the compressor for this purpose.) The next operation on this stream must |
357 | be inflateEnd to deallocate the decompression state. The use of Z_FINISH | 389 | be inflateEnd to deallocate the decompression state. The use of Z_FINISH |
358 | is never required, but can be used to inform inflate that a faster routine | 390 | is never required, but can be used to inform inflate that a faster approach |
359 | may be used for the single inflate() call. | 391 | may be used for the single inflate() call. |
360 | 392 | ||
361 | If a preset dictionary is needed at this point (see inflateSetDictionary | 393 | In this implementation, inflate() always flushes as much output as |
362 | below), inflate sets strm-adler to the adler32 checksum of the | 394 | possible to the output buffer, and always uses the faster approach on the |
363 | dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise | 395 | first call. So the only effect of the flush parameter in this implementation |
364 | it sets strm->adler to the adler32 checksum of all output produced | 396 | is on the return value of inflate(), as noted below, or when it returns early |
365 | so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or | 397 | because Z_BLOCK is used. |
366 | an error code as described below. At the end of the stream, inflate() | 398 | |
367 | checks that its computed adler32 checksum is equal to that saved by the | 399 | If a preset dictionary is needed after this call (see inflateSetDictionary |
368 | compressor and returns Z_STREAM_END only if the checksum is correct. | 400 | below), inflate sets strm->adler to the adler32 checksum of the dictionary |
401 | chosen by the compressor and returns Z_NEED_DICT; otherwise it sets | ||
402 | strm->adler to the adler32 checksum of all output produced so far (that is, | ||
403 | total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described | ||
404 | below. At the end of the stream, inflate() checks that its computed adler32 | ||
405 | checksum is equal to that saved by the compressor and returns Z_STREAM_END | ||
406 | only if the checksum is correct. | ||
407 | |||
408 | inflate() will decompress and check either zlib-wrapped or gzip-wrapped | ||
409 | deflate data. The header type is detected automatically. Any information | ||
410 | contained in the gzip header is not retained, so applications that need that | ||
411 | information should instead use raw inflate, see inflateInit2() below, or | ||
412 | inflateBack() and perform their own processing of the gzip header and | ||
413 | trailer. | ||
369 | 414 | ||
370 | inflate() returns Z_OK if some progress has been made (more input processed | 415 | inflate() returns Z_OK if some progress has been made (more input processed |
371 | or more output produced), Z_STREAM_END if the end of the compressed data has | 416 | or more output produced), Z_STREAM_END if the end of the compressed data has |
372 | been reached and all uncompressed output has been produced, Z_NEED_DICT if a | 417 | been reached and all uncompressed output has been produced, Z_NEED_DICT if a |
373 | preset dictionary is needed at this point, Z_DATA_ERROR if the input data was | 418 | preset dictionary is needed at this point, Z_DATA_ERROR if the input data was |
374 | corrupted (input stream not conforming to the zlib format or incorrect | 419 | corrupted (input stream not conforming to the zlib format or incorrect check |
375 | adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent | 420 | value), Z_STREAM_ERROR if the stream structure was inconsistent (for example |
376 | (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not | 421 | if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, |
377 | enough memory, Z_BUF_ERROR if no progress is possible or if there was not | 422 | Z_BUF_ERROR if no progress is possible or if there was not enough room in the |
378 | enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR | 423 | output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and |
379 | case, the application may then call inflateSync to look for a good | 424 | inflate() can be called again with more input and more output space to |
380 | compression block. | 425 | continue decompressing. If Z_DATA_ERROR is returned, the application may then |
426 | call inflateSync() to look for a good compression block if a partial recovery | ||
427 | of the data is desired. | ||
381 | */ | 428 | */ |
382 | 429 | ||
383 | 430 | ||
@@ -547,16 +594,36 @@ extern int inflateInit2 (z_streamp strm, int windowBits); | |||
547 | The windowBits parameter is the base two logarithm of the maximum window | 594 | The windowBits parameter is the base two logarithm of the maximum window |
548 | size (the size of the history buffer). It should be in the range 8..15 for | 595 | size (the size of the history buffer). It should be in the range 8..15 for |
549 | this version of the library. The default value is 15 if inflateInit is used | 596 | this version of the library. The default value is 15 if inflateInit is used |
550 | instead. If a compressed stream with a larger window size is given as | 597 | instead. windowBits must be greater than or equal to the windowBits value |
551 | input, inflate() will return with the error code Z_DATA_ERROR instead of | 598 | provided to deflateInit2() while compressing, or it must be equal to 15 if |
552 | trying to allocate a larger window. | 599 | deflateInit2() was not used. If a compressed stream with a larger window |
553 | 600 | size is given as input, inflate() will return with the error code | |
554 | inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough | 601 | Z_DATA_ERROR instead of trying to allocate a larger window. |
555 | memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative | 602 | |
556 | memLevel). msg is set to null if there is no error message. inflateInit2 | 603 | windowBits can also be -8..-15 for raw inflate. In this case, -windowBits |
557 | does not perform any decompression apart from reading the zlib header if | 604 | determines the window size. inflate() will then process raw deflate data, |
558 | present: this will be done by inflate(). (So next_in and avail_in may be | 605 | not looking for a zlib or gzip header, not generating a check value, and not |
559 | modified, but next_out and avail_out are unchanged.) | 606 | looking for any check values for comparison at the end of the stream. This |
607 | is for use with other formats that use the deflate compressed data format | ||
608 | such as zip. Those formats provide their own check values. If a custom | ||
609 | format is developed using the raw deflate format for compressed data, it is | ||
610 | recommended that a check value such as an adler32 or a crc32 be applied to | ||
611 | the uncompressed data as is done in the zlib, gzip, and zip formats. For | ||
612 | most applications, the zlib format should be used as is. Note that comments | ||
613 | above on the use in deflateInit2() applies to the magnitude of windowBits. | ||
614 | |||
615 | windowBits can also be greater than 15 for optional gzip decoding. Add | ||
616 | 32 to windowBits to enable zlib and gzip decoding with automatic header | ||
617 | detection, or add 16 to decode only the gzip format (the zlib format will | ||
618 | return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is | ||
619 | a crc32 instead of an adler32. | ||
620 | |||
621 | inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough | ||
622 | memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg | ||
623 | is set to null if there is no error message. inflateInit2 does not perform | ||
624 | any decompression apart from reading the zlib header if present: this will | ||
625 | be done by inflate(). (So next_in and avail_in may be modified, but next_out | ||
626 | and avail_out are unchanged.) | ||
560 | */ | 627 | */ |
561 | 628 | ||
562 | extern int zlib_inflateSetDictionary (z_streamp strm, | 629 | extern int zlib_inflateSetDictionary (z_streamp strm, |
@@ -564,16 +631,19 @@ extern int zlib_inflateSetDictionary (z_streamp strm, | |||
564 | uInt dictLength); | 631 | uInt dictLength); |
565 | /* | 632 | /* |
566 | Initializes the decompression dictionary from the given uncompressed byte | 633 | Initializes the decompression dictionary from the given uncompressed byte |
567 | sequence. This function must be called immediately after a call of inflate | 634 | sequence. This function must be called immediately after a call of inflate, |
568 | if this call returned Z_NEED_DICT. The dictionary chosen by the compressor | 635 | if that call returned Z_NEED_DICT. The dictionary chosen by the compressor |
569 | can be determined from the Adler32 value returned by this call of | 636 | can be determined from the adler32 value returned by that call of inflate. |
570 | inflate. The compressor and decompressor must use exactly the same | 637 | The compressor and decompressor must use exactly the same dictionary (see |
571 | dictionary (see deflateSetDictionary). | 638 | deflateSetDictionary). For raw inflate, this function can be called |
639 | immediately after inflateInit2() or inflateReset() and before any call of | ||
640 | inflate() to set the dictionary. The application must insure that the | ||
641 | dictionary that was used for compression is provided. | ||
572 | 642 | ||
573 | inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a | 643 | inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a |
574 | parameter is invalid (such as NULL dictionary) or the stream state is | 644 | parameter is invalid (such as NULL dictionary) or the stream state is |
575 | inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the | 645 | inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the |
576 | expected one (incorrect Adler32 value). inflateSetDictionary does not | 646 | expected one (incorrect adler32 value). inflateSetDictionary does not |
577 | perform any decompression: this will be done by subsequent calls of | 647 | perform any decompression: this will be done by subsequent calls of |
578 | inflate(). | 648 | inflate(). |
579 | */ | 649 | */ |
@@ -614,40 +684,19 @@ extern int zlib_inflateIncomp (z_stream *strm); | |||
614 | containing the data at next_in (except that the data is not output). | 684 | containing the data at next_in (except that the data is not output). |
615 | */ | 685 | */ |
616 | 686 | ||
617 | /* various hacks, don't look :) */ | ||
618 | |||
619 | /* deflateInit and inflateInit are macros to allow checking the zlib version | ||
620 | * and the compiler's view of z_stream: | ||
621 | */ | ||
622 | extern int zlib_deflateInit_ (z_streamp strm, int level, | ||
623 | const char *version, int stream_size); | ||
624 | extern int zlib_inflateInit_ (z_streamp strm, | ||
625 | const char *version, int stream_size); | ||
626 | extern int zlib_deflateInit2_ (z_streamp strm, int level, int method, | ||
627 | int windowBits, int memLevel, | ||
628 | int strategy, const char *version, | ||
629 | int stream_size); | ||
630 | extern int zlib_inflateInit2_ (z_streamp strm, int windowBits, | ||
631 | const char *version, int stream_size); | ||
632 | #define zlib_deflateInit(strm, level) \ | 687 | #define zlib_deflateInit(strm, level) \ |
633 | zlib_deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) | 688 | zlib_deflateInit2((strm), (level), Z_DEFLATED, MAX_WBITS, \ |
689 | DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY) | ||
634 | #define zlib_inflateInit(strm) \ | 690 | #define zlib_inflateInit(strm) \ |
635 | zlib_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) | 691 | zlib_inflateInit2((strm), DEF_WBITS) |
636 | #define zlib_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ | ||
637 | zlib_deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ | ||
638 | (strategy), ZLIB_VERSION, sizeof(z_stream)) | ||
639 | #define zlib_inflateInit2(strm, windowBits) \ | ||
640 | zlib_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) | ||
641 | 692 | ||
693 | extern int zlib_deflateInit2(z_streamp strm, int level, int method, | ||
694 | int windowBits, int memLevel, | ||
695 | int strategy); | ||
696 | extern int zlib_inflateInit2(z_streamp strm, int windowBits); | ||
642 | 697 | ||
643 | #if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) | 698 | #if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) |
644 | struct internal_state {int dummy;}; /* hack for buggy compilers */ | 699 | struct internal_state {int dummy;}; /* hack for buggy compilers */ |
645 | #endif | 700 | #endif |
646 | 701 | ||
647 | extern const char * zlib_zError (int err); | ||
648 | #if 0 | ||
649 | extern int zlib_inflateSyncPoint (z_streamp z); | ||
650 | #endif | ||
651 | extern const uLong * zlib_get_crc_table (void); | ||
652 | |||
653 | #endif /* _ZLIB_H */ | 702 | #endif /* _ZLIB_H */ |
diff --git a/include/linux/zorro.h b/include/linux/zorro.h index 2f135cf6eef1..913bfc226dda 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #ifndef _LINUX_ZORRO_H | 11 | #ifndef _LINUX_ZORRO_H |
12 | #define _LINUX_ZORRO_H | 12 | #define _LINUX_ZORRO_H |
13 | 13 | ||
14 | #ifndef __ASSEMBLY__ | ||
15 | |||
16 | #include <linux/device.h> | 14 | #include <linux/device.h> |
17 | 15 | ||
18 | 16 | ||
@@ -112,45 +110,6 @@ struct ConfigDev { | |||
112 | __u32 cd_Unused[4]; /* for whatever the driver wants */ | 110 | __u32 cd_Unused[4]; /* for whatever the driver wants */ |
113 | } __attribute__ ((packed)); | 111 | } __attribute__ ((packed)); |
114 | 112 | ||
115 | #else /* __ASSEMBLY__ */ | ||
116 | |||
117 | LN_Succ = 0 | ||
118 | LN_Pred = LN_Succ+4 | ||
119 | LN_Type = LN_Pred+4 | ||
120 | LN_Pri = LN_Type+1 | ||
121 | LN_Name = LN_Pri+1 | ||
122 | LN_sizeof = LN_Name+4 | ||
123 | |||
124 | ER_Type = 0 | ||
125 | ER_Product = ER_Type+1 | ||
126 | ER_Flags = ER_Product+1 | ||
127 | ER_Reserved03 = ER_Flags+1 | ||
128 | ER_Manufacturer = ER_Reserved03+1 | ||
129 | ER_SerialNumber = ER_Manufacturer+2 | ||
130 | ER_InitDiagVec = ER_SerialNumber+4 | ||
131 | ER_Reserved0c = ER_InitDiagVec+2 | ||
132 | ER_Reserved0d = ER_Reserved0c+1 | ||
133 | ER_Reserved0e = ER_Reserved0d+1 | ||
134 | ER_Reserved0f = ER_Reserved0e+1 | ||
135 | ER_sizeof = ER_Reserved0f+1 | ||
136 | |||
137 | CD_Node = 0 | ||
138 | CD_Flags = CD_Node+LN_sizeof | ||
139 | CD_Pad = CD_Flags+1 | ||
140 | CD_Rom = CD_Pad+1 | ||
141 | CD_BoardAddr = CD_Rom+ER_sizeof | ||
142 | CD_BoardSize = CD_BoardAddr+4 | ||
143 | CD_SlotAddr = CD_BoardSize+4 | ||
144 | CD_SlotSize = CD_SlotAddr+2 | ||
145 | CD_Driver = CD_SlotSize+2 | ||
146 | CD_NextCD = CD_Driver+4 | ||
147 | CD_Unused = CD_NextCD+4 | ||
148 | CD_sizeof = CD_Unused+(4*4) | ||
149 | |||
150 | #endif /* __ASSEMBLY__ */ | ||
151 | |||
152 | #ifndef __ASSEMBLY__ | ||
153 | |||
154 | #define ZORRO_NUM_AUTO 16 | 113 | #define ZORRO_NUM_AUTO 16 |
155 | 114 | ||
156 | #ifdef __KERNEL__ | 115 | #ifdef __KERNEL__ |
@@ -290,7 +249,6 @@ extern DECLARE_BITMAP(zorro_unused_z2ram, 128); | |||
290 | #define Z2RAM_CHUNKSHIFT (16) | 249 | #define Z2RAM_CHUNKSHIFT (16) |
291 | 250 | ||
292 | 251 | ||
293 | #endif /* !__ASSEMBLY__ */ | ||
294 | #endif /* __KERNEL__ */ | 252 | #endif /* __KERNEL__ */ |
295 | 253 | ||
296 | #endif /* _LINUX_ZORRO_H */ | 254 | #endif /* _LINUX_ZORRO_H */ |
diff --git a/include/linux/zutil.h b/include/linux/zutil.h index ee0c59cf2136..6adfa9a6ffe9 100644 --- a/include/linux/zutil.h +++ b/include/linux/zutil.h | |||
@@ -23,18 +23,6 @@ typedef unsigned long ulg; | |||
23 | 23 | ||
24 | /* common constants */ | 24 | /* common constants */ |
25 | 25 | ||
26 | #ifndef DEF_WBITS | ||
27 | # define DEF_WBITS MAX_WBITS | ||
28 | #endif | ||
29 | /* default windowBits for decompression. MAX_WBITS is for compression only */ | ||
30 | |||
31 | #if MAX_MEM_LEVEL >= 8 | ||
32 | # define DEF_MEM_LEVEL 8 | ||
33 | #else | ||
34 | # define DEF_MEM_LEVEL MAX_MEM_LEVEL | ||
35 | #endif | ||
36 | /* default memLevel */ | ||
37 | |||
38 | #define STORED_BLOCK 0 | 26 | #define STORED_BLOCK 0 |
39 | #define STATIC_TREES 1 | 27 | #define STATIC_TREES 1 |
40 | #define DYN_TREES 2 | 28 | #define DYN_TREES 2 |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index d5147770ad47..ecc42864b001 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -968,6 +968,7 @@ enum ieee80211_state { | |||
968 | 968 | ||
969 | enum { | 969 | enum { |
970 | IEEE80211_CH_PASSIVE_ONLY = (1 << 0), | 970 | IEEE80211_CH_PASSIVE_ONLY = (1 << 0), |
971 | IEEE80211_CH_80211H_RULES = (1 << 1), | ||
971 | IEEE80211_CH_B_ONLY = (1 << 2), | 972 | IEEE80211_CH_B_ONLY = (1 << 2), |
972 | IEEE80211_CH_NO_IBSS = (1 << 3), | 973 | IEEE80211_CH_NO_IBSS = (1 << 3), |
973 | IEEE80211_CH_UNIFORM_SPREADING = (1 << 4), | 974 | IEEE80211_CH_UNIFORM_SPREADING = (1 << 4), |
@@ -976,10 +977,10 @@ enum { | |||
976 | }; | 977 | }; |
977 | 978 | ||
978 | struct ieee80211_channel { | 979 | struct ieee80211_channel { |
979 | u32 freq; | 980 | u32 freq; /* in MHz */ |
980 | u8 channel; | 981 | u8 channel; |
981 | u8 flags; | 982 | u8 flags; |
982 | u8 max_power; | 983 | u8 max_power; /* in dBm */ |
983 | }; | 984 | }; |
984 | 985 | ||
985 | struct ieee80211_geo { | 986 | struct ieee80211_geo { |
diff --git a/include/net/protocol.h b/include/net/protocol.h index bcaee39bd2ff..3b6dc15c68a5 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -36,6 +36,7 @@ | |||
36 | struct net_protocol { | 36 | struct net_protocol { |
37 | int (*handler)(struct sk_buff *skb); | 37 | int (*handler)(struct sk_buff *skb); |
38 | void (*err_handler)(struct sk_buff *skb, u32 info); | 38 | void (*err_handler)(struct sk_buff *skb, u32 info); |
39 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, int sg); | ||
39 | int no_policy; | 40 | int no_policy; |
40 | }; | 41 | }; |
41 | 42 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index d10dfecb6cbd..2d8d6adf1616 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1030,9 +1030,13 @@ static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst) | |||
1030 | { | 1030 | { |
1031 | __sk_dst_set(sk, dst); | 1031 | __sk_dst_set(sk, dst); |
1032 | sk->sk_route_caps = dst->dev->features; | 1032 | sk->sk_route_caps = dst->dev->features; |
1033 | if (sk->sk_route_caps & NETIF_F_GSO) | ||
1034 | sk->sk_route_caps |= NETIF_F_TSO; | ||
1033 | if (sk->sk_route_caps & NETIF_F_TSO) { | 1035 | if (sk->sk_route_caps & NETIF_F_TSO) { |
1034 | if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len) | 1036 | if (sock_flag(sk, SOCK_NO_LARGESEND) || dst->header_len) |
1035 | sk->sk_route_caps &= ~NETIF_F_TSO; | 1037 | sk->sk_route_caps &= ~NETIF_F_TSO; |
1038 | else | ||
1039 | sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM; | ||
1036 | } | 1040 | } |
1037 | } | 1041 | } |
1038 | 1042 | ||
@@ -1265,6 +1269,7 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |||
1265 | * sk_eat_skb - Release a skb if it is no longer needed | 1269 | * sk_eat_skb - Release a skb if it is no longer needed |
1266 | * @sk: socket to eat this skb from | 1270 | * @sk: socket to eat this skb from |
1267 | * @skb: socket buffer to eat | 1271 | * @skb: socket buffer to eat |
1272 | * @copied_early: flag indicating whether DMA operations copied this data early | ||
1268 | * | 1273 | * |
1269 | * This routine must be called with interrupts disabled or with the socket | 1274 | * This routine must be called with interrupts disabled or with the socket |
1270 | * locked so that the sk_buff queue operation is ok. | 1275 | * locked so that the sk_buff queue operation is ok. |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 5f4eb5c79689..ca3d38dfc00b 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -569,13 +569,13 @@ struct tcp_skb_cb { | |||
569 | */ | 569 | */ |
570 | static inline int tcp_skb_pcount(const struct sk_buff *skb) | 570 | static inline int tcp_skb_pcount(const struct sk_buff *skb) |
571 | { | 571 | { |
572 | return skb_shinfo(skb)->tso_segs; | 572 | return skb_shinfo(skb)->gso_segs; |
573 | } | 573 | } |
574 | 574 | ||
575 | /* This is valid iff tcp_skb_pcount() > 1. */ | 575 | /* This is valid iff tcp_skb_pcount() > 1. */ |
576 | static inline int tcp_skb_mss(const struct sk_buff *skb) | 576 | static inline int tcp_skb_mss(const struct sk_buff *skb) |
577 | { | 577 | { |
578 | return skb_shinfo(skb)->tso_size; | 578 | return skb_shinfo(skb)->gso_size; |
579 | } | 579 | } |
580 | 580 | ||
581 | static inline void tcp_dec_pcount_approx(__u32 *count, | 581 | static inline void tcp_dec_pcount_approx(__u32 *count, |
@@ -1086,6 +1086,8 @@ extern struct request_sock_ops tcp_request_sock_ops; | |||
1086 | 1086 | ||
1087 | extern int tcp_v4_destroy_sock(struct sock *sk); | 1087 | extern int tcp_v4_destroy_sock(struct sock *sk); |
1088 | 1088 | ||
1089 | extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int sg); | ||
1090 | |||
1089 | #ifdef CONFIG_PROC_FS | 1091 | #ifdef CONFIG_PROC_FS |
1090 | extern int tcp4_proc_init(void); | 1092 | extern int tcp4_proc_init(void); |
1091 | extern void tcp4_proc_exit(void); | 1093 | extern void tcp4_proc_exit(void); |
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index b45a73712748..446afc3ea27f 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -378,6 +378,7 @@ | |||
378 | #define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */ | 378 | #define AC97_HAS_NO_MIC (1<<15) /* no MIC volume */ |
379 | #define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */ | 379 | #define AC97_HAS_NO_TONE (1<<16) /* no Tone volume */ |
380 | #define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */ | 380 | #define AC97_HAS_NO_STD_PCM (1<<17) /* no standard AC97 PCM volume and mute */ |
381 | #define AC97_HAS_NO_AUX (1<<18) /* no standard AC97 AUX volume and mute */ | ||
381 | 382 | ||
382 | /* rates indexes */ | 383 | /* rates indexes */ |
383 | #define AC97_RATES_FRONT_DAC 0 | 384 | #define AC97_RATES_FRONT_DAC 0 |
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h index 6691e4aa4ea7..3f2f4042a20d 100644 --- a/include/sound/asequencer.h +++ b/include/sound/asequencer.h | |||
@@ -605,6 +605,10 @@ struct snd_seq_remove_events { | |||
605 | #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */ | 605 | #define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */ |
606 | #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */ | 606 | #define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */ |
607 | /*...*/ | 607 | /*...*/ |
608 | #define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */ | ||
609 | #define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */ | ||
610 | #define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */ | ||
611 | #define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */ | ||
608 | #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */ | 612 | #define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */ |
609 | 613 | ||
610 | /* misc. conditioning flags */ | 614 | /* misc. conditioning flags */ |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 9cc021c7ee11..41885f48ad91 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -137,7 +137,7 @@ enum { | |||
137 | * * | 137 | * * |
138 | *****************************************************************************/ | 138 | *****************************************************************************/ |
139 | 139 | ||
140 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) | 140 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8) |
141 | 141 | ||
142 | typedef unsigned long snd_pcm_uframes_t; | 142 | typedef unsigned long snd_pcm_uframes_t; |
143 | typedef signed long snd_pcm_sframes_t; | 143 | typedef signed long snd_pcm_sframes_t; |
diff --git a/include/sound/core.h b/include/sound/core.h index 5135147f20e8..5d184be0ff72 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -233,9 +233,8 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size | |||
233 | 233 | ||
234 | /* init.c */ | 234 | /* init.c */ |
235 | 235 | ||
236 | extern unsigned int snd_cards_lock; | ||
237 | extern struct snd_card *snd_cards[SNDRV_CARDS]; | 236 | extern struct snd_card *snd_cards[SNDRV_CARDS]; |
238 | extern rwlock_t snd_card_rwlock; | 237 | int snd_card_locked(int card); |
239 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) | 238 | #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) |
240 | #define SND_MIXER_OSS_NOTIFY_REGISTER 0 | 239 | #define SND_MIXER_OSS_NOTIFY_REGISTER 0 |
241 | #define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 | 240 | #define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 |
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h index 186e00ad9e79..884bbf54cd36 100644 --- a/include/sound/emu10k1.h +++ b/include/sound/emu10k1.h | |||
@@ -245,6 +245,7 @@ | |||
245 | #define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ | 245 | #define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ |
246 | #define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ | 246 | #define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ |
247 | #define A_IOCFG_ENABLE_DIGITAL 0x0004 | 247 | #define A_IOCFG_ENABLE_DIGITAL 0x0004 |
248 | #define A_IOCFG_ENABLE_DIGITAL_AUDIGY4 0x0080 | ||
248 | #define A_IOCFG_UNKNOWN_20 0x0020 | 249 | #define A_IOCFG_UNKNOWN_20 0x0020 |
249 | #define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */ | 250 | #define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */ |
250 | #define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */ | 251 | #define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */ |
@@ -1065,6 +1066,7 @@ struct snd_emu_chip_details { | |||
1065 | unsigned char emu1212m; /* EMU 1212m card */ | 1066 | unsigned char emu1212m; /* EMU 1212m card */ |
1066 | unsigned char spi_dac; /* SPI interface for DAC */ | 1067 | unsigned char spi_dac; /* SPI interface for DAC */ |
1067 | unsigned char i2c_adc; /* I2C interface for ADC */ | 1068 | unsigned char i2c_adc; /* I2C interface for ADC */ |
1069 | unsigned char adc_1361t; /* Use Philips 1361T ADC */ | ||
1068 | const char *driver; | 1070 | const char *driver; |
1069 | const char *name; | 1071 | const char *name; |
1070 | const char *id; /* for backward compatibility - can be NULL if not needed */ | 1072 | const char *id; /* for backward compatibility - can be NULL if not needed */ |
diff --git a/include/sound/info.h b/include/sound/info.h index f23d8381c216..74f6996769c7 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
@@ -27,9 +27,9 @@ | |||
27 | /* buffer for information */ | 27 | /* buffer for information */ |
28 | struct snd_info_buffer { | 28 | struct snd_info_buffer { |
29 | char *buffer; /* pointer to begin of buffer */ | 29 | char *buffer; /* pointer to begin of buffer */ |
30 | char *curr; /* current position in buffer */ | 30 | unsigned int curr; /* current position in buffer */ |
31 | unsigned long size; /* current size */ | 31 | unsigned int size; /* current size */ |
32 | unsigned long len; /* total length of buffer */ | 32 | unsigned int len; /* total length of buffer */ |
33 | int stop; /* stop flag */ | 33 | int stop; /* stop flag */ |
34 | int error; /* error code */ | 34 | int error; /* error code */ |
35 | }; | 35 | }; |
@@ -40,8 +40,6 @@ struct snd_info_buffer { | |||
40 | struct snd_info_entry; | 40 | struct snd_info_entry; |
41 | 41 | ||
42 | struct snd_info_entry_text { | 42 | struct snd_info_entry_text { |
43 | unsigned long read_size; | ||
44 | unsigned long write_size; | ||
45 | void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); | 43 | void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); |
46 | void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); | 44 | void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer); |
47 | }; | 45 | }; |
@@ -132,11 +130,9 @@ int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_e | |||
132 | 130 | ||
133 | static inline void snd_info_set_text_ops(struct snd_info_entry *entry, | 131 | static inline void snd_info_set_text_ops(struct snd_info_entry *entry, |
134 | void *private_data, | 132 | void *private_data, |
135 | long read_size, | ||
136 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) | 133 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) |
137 | { | 134 | { |
138 | entry->private_data = private_data; | 135 | entry->private_data = private_data; |
139 | entry->c.text.read_size = read_size; | ||
140 | entry->c.text.read = read; | 136 | entry->c.text.read = read; |
141 | } | 137 | } |
142 | 138 | ||
@@ -167,7 +163,6 @@ static inline int snd_card_proc_new(struct snd_card *card, const char *name, | |||
167 | struct snd_info_entry **entryp) { return -EINVAL; } | 163 | struct snd_info_entry **entryp) { return -EINVAL; } |
168 | static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), | 164 | static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), |
169 | void *private_data, | 165 | void *private_data, |
170 | long read_size, | ||
171 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} | 166 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} |
172 | 167 | ||
173 | static inline int snd_info_check_reserved_words(const char *str) { return 1; } | 168 | static inline int snd_info_check_reserved_words(const char *str) { return 1; } |
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h index 8e97ace78f16..ac504321ea56 100644 --- a/include/sound/mpu401.h +++ b/include/sound/mpu401.h | |||
@@ -45,6 +45,12 @@ | |||
45 | #define MPU401_HW_PC98II 18 /* Roland PC98II */ | 45 | #define MPU401_HW_PC98II 18 /* Roland PC98II */ |
46 | #define MPU401_HW_AUREAL 19 /* Aureal Vortex */ | 46 | #define MPU401_HW_AUREAL 19 /* Aureal Vortex */ |
47 | 47 | ||
48 | #define MPU401_INFO_INPUT (1 << 0) /* input stream */ | ||
49 | #define MPU401_INFO_OUTPUT (1 << 1) /* output stream */ | ||
50 | #define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ | ||
51 | #define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ | ||
52 | #define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ | ||
53 | |||
48 | #define MPU401_MODE_BIT_INPUT 0 | 54 | #define MPU401_MODE_BIT_INPUT 0 |
49 | #define MPU401_MODE_BIT_OUTPUT 1 | 55 | #define MPU401_MODE_BIT_OUTPUT 1 |
50 | #define MPU401_MODE_BIT_INPUT_TRIGGER 2 | 56 | #define MPU401_MODE_BIT_INPUT_TRIGGER 2 |
@@ -62,6 +68,7 @@ struct snd_mpu401 { | |||
62 | struct snd_rawmidi *rmidi; | 68 | struct snd_rawmidi *rmidi; |
63 | 69 | ||
64 | unsigned short hardware; /* MPU401_HW_XXXX */ | 70 | unsigned short hardware; /* MPU401_HW_XXXX */ |
71 | unsigned int info_flags; /* MPU401_INFO_XXX */ | ||
65 | unsigned long port; /* base port of MPU-401 chip */ | 72 | unsigned long port; /* base port of MPU-401 chip */ |
66 | unsigned long cport; /* port + 1 (usually) */ | 73 | unsigned long cport; /* port + 1 (usually) */ |
67 | struct resource *res; /* port resource */ | 74 | struct resource *res; /* port resource */ |
@@ -99,13 +106,16 @@ struct snd_mpu401 { | |||
99 | 106 | ||
100 | */ | 107 | */ |
101 | 108 | ||
102 | irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); | 109 | irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, |
110 | struct pt_regs *regs); | ||
111 | irqreturn_t snd_mpu401_uart_interrupt_tx(int irq, void *dev_id, | ||
112 | struct pt_regs *regs); | ||
103 | 113 | ||
104 | int snd_mpu401_uart_new(struct snd_card *card, | 114 | int snd_mpu401_uart_new(struct snd_card *card, |
105 | int device, | 115 | int device, |
106 | unsigned short hardware, | 116 | unsigned short hardware, |
107 | unsigned long port, | 117 | unsigned long port, |
108 | int integrated, | 118 | unsigned int info_flags, |
109 | int irq, | 119 | int irq, |
110 | int irq_flags, | 120 | int irq_flags, |
111 | struct snd_rawmidi ** rrawmidi); | 121 | struct snd_rawmidi ** rrawmidi); |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 373425895faa..f84d84993a31 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -300,7 +300,6 @@ struct snd_pcm_runtime { | |||
300 | /* -- mmap -- */ | 300 | /* -- mmap -- */ |
301 | volatile struct snd_pcm_mmap_status *status; | 301 | volatile struct snd_pcm_mmap_status *status; |
302 | volatile struct snd_pcm_mmap_control *control; | 302 | volatile struct snd_pcm_mmap_control *control; |
303 | atomic_t mmap_count; | ||
304 | 303 | ||
305 | /* -- locking / scheduling -- */ | 304 | /* -- locking / scheduling -- */ |
306 | wait_queue_head_t sleep; | 305 | wait_queue_head_t sleep; |
@@ -368,7 +367,9 @@ struct snd_pcm_substream { | |||
368 | struct snd_pcm_group *group; /* pointer to current group */ | 367 | struct snd_pcm_group *group; /* pointer to current group */ |
369 | /* -- assigned files -- */ | 368 | /* -- assigned files -- */ |
370 | void *file; | 369 | void *file; |
371 | struct file *ffile; | 370 | int ref_count; |
371 | atomic_t mmap_count; | ||
372 | unsigned int f_flags; | ||
372 | void (*pcm_release)(struct snd_pcm_substream *); | 373 | void (*pcm_release)(struct snd_pcm_substream *); |
373 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 374 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
374 | /* -- OSS things -- */ | 375 | /* -- OSS things -- */ |
@@ -387,7 +388,7 @@ struct snd_pcm_substream { | |||
387 | unsigned int hw_opened: 1; | 388 | unsigned int hw_opened: 1; |
388 | }; | 389 | }; |
389 | 390 | ||
390 | #define SUBSTREAM_BUSY(substream) ((substream)->file != NULL) | 391 | #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0) |
391 | 392 | ||
392 | 393 | ||
393 | struct snd_pcm_str { | 394 | struct snd_pcm_str { |
@@ -825,14 +826,6 @@ int snd_interval_ratnum(struct snd_interval *i, | |||
825 | 826 | ||
826 | void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params); | 827 | void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params); |
827 | void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var); | 828 | void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var); |
828 | int snd_pcm_hw_param_near(struct snd_pcm_substream *substream, | ||
829 | struct snd_pcm_hw_params *params, | ||
830 | snd_pcm_hw_param_t var, | ||
831 | unsigned int val, int *dir); | ||
832 | int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm, | ||
833 | struct snd_pcm_hw_params *params, | ||
834 | snd_pcm_hw_param_t var, | ||
835 | unsigned int val, int dir); | ||
836 | int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); | 829 | int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); |
837 | 830 | ||
838 | int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); | 831 | int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params); |
@@ -979,13 +972,13 @@ struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigne | |||
979 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) | 972 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) |
980 | { | 973 | { |
981 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; | 974 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; |
982 | atomic_inc(&substream->runtime->mmap_count); | 975 | atomic_inc(&substream->mmap_count); |
983 | } | 976 | } |
984 | 977 | ||
985 | static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) | 978 | static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) |
986 | { | 979 | { |
987 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; | 980 | struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data; |
988 | atomic_dec(&substream->runtime->mmap_count); | 981 | atomic_dec(&substream->mmap_count); |
989 | } | 982 | } |
990 | 983 | ||
991 | /* mmap for io-memory area */ | 984 | /* mmap for io-memory area */ |
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index fb18aef77341..85cf1cf4f31a 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h | |||
@@ -22,29 +22,21 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | extern int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params, | 25 | int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, |
26 | snd_pcm_hw_param_t var, const struct snd_mask *val); | 26 | struct snd_pcm_hw_params *params, |
27 | extern unsigned int snd_pcm_hw_param_value_min(const struct snd_pcm_hw_params *params, | 27 | snd_pcm_hw_param_t var, int *dir); |
28 | snd_pcm_hw_param_t var, int *dir); | 28 | int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm, |
29 | extern unsigned int snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params, | 29 | struct snd_pcm_hw_params *params, |
30 | snd_pcm_hw_param_t var, int *dir); | 30 | snd_pcm_hw_param_t var, int *dir); |
31 | extern int _snd_pcm_hw_param_min(struct snd_pcm_hw_params *params, | 31 | int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params, |
32 | snd_pcm_hw_param_t var, unsigned int val, int dir); | 32 | snd_pcm_hw_param_t var, int *dir); |
33 | extern int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params, | ||
34 | snd_pcm_hw_param_t var); | ||
35 | extern int _snd_pcm_hw_param_set(struct snd_pcm_hw_params *params, | ||
36 | snd_pcm_hw_param_t var, unsigned int val, int dir); | ||
37 | |||
38 | /* To share the same code we have alsa-lib */ | ||
39 | #define INLINE static inline | ||
40 | #define assert(a) (void)(a) | ||
41 | 33 | ||
42 | #define SNDRV_MASK_BITS 64 /* we use so far 64bits only */ | 34 | #define SNDRV_MASK_BITS 64 /* we use so far 64bits only */ |
43 | #define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32) | 35 | #define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32) |
44 | #define MASK_OFS(i) ((i) >> 5) | 36 | #define MASK_OFS(i) ((i) >> 5) |
45 | #define MASK_BIT(i) (1U << ((i) & 31)) | 37 | #define MASK_BIT(i) (1U << ((i) & 31)) |
46 | 38 | ||
47 | INLINE unsigned int ld2(u_int32_t v) | 39 | static inline unsigned int ld2(u_int32_t v) |
48 | { | 40 | { |
49 | unsigned r = 0; | 41 | unsigned r = 0; |
50 | 42 | ||
@@ -69,22 +61,22 @@ INLINE unsigned int ld2(u_int32_t v) | |||
69 | return r; | 61 | return r; |
70 | } | 62 | } |
71 | 63 | ||
72 | INLINE size_t snd_mask_sizeof(void) | 64 | static inline size_t snd_mask_sizeof(void) |
73 | { | 65 | { |
74 | return sizeof(struct snd_mask); | 66 | return sizeof(struct snd_mask); |
75 | } | 67 | } |
76 | 68 | ||
77 | INLINE void snd_mask_none(struct snd_mask *mask) | 69 | static inline void snd_mask_none(struct snd_mask *mask) |
78 | { | 70 | { |
79 | memset(mask, 0, sizeof(*mask)); | 71 | memset(mask, 0, sizeof(*mask)); |
80 | } | 72 | } |
81 | 73 | ||
82 | INLINE void snd_mask_any(struct snd_mask *mask) | 74 | static inline void snd_mask_any(struct snd_mask *mask) |
83 | { | 75 | { |
84 | memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); | 76 | memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); |
85 | } | 77 | } |
86 | 78 | ||
87 | INLINE int snd_mask_empty(const struct snd_mask *mask) | 79 | static inline int snd_mask_empty(const struct snd_mask *mask) |
88 | { | 80 | { |
89 | int i; | 81 | int i; |
90 | for (i = 0; i < SNDRV_MASK_SIZE; i++) | 82 | for (i = 0; i < SNDRV_MASK_SIZE; i++) |
@@ -93,10 +85,9 @@ INLINE int snd_mask_empty(const struct snd_mask *mask) | |||
93 | return 1; | 85 | return 1; |
94 | } | 86 | } |
95 | 87 | ||
96 | INLINE unsigned int snd_mask_min(const struct snd_mask *mask) | 88 | static inline unsigned int snd_mask_min(const struct snd_mask *mask) |
97 | { | 89 | { |
98 | int i; | 90 | int i; |
99 | assert(!snd_mask_empty(mask)); | ||
100 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { | 91 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { |
101 | if (mask->bits[i]) | 92 | if (mask->bits[i]) |
102 | return ffs(mask->bits[i]) - 1 + (i << 5); | 93 | return ffs(mask->bits[i]) - 1 + (i << 5); |
@@ -104,10 +95,9 @@ INLINE unsigned int snd_mask_min(const struct snd_mask *mask) | |||
104 | return 0; | 95 | return 0; |
105 | } | 96 | } |
106 | 97 | ||
107 | INLINE unsigned int snd_mask_max(const struct snd_mask *mask) | 98 | static inline unsigned int snd_mask_max(const struct snd_mask *mask) |
108 | { | 99 | { |
109 | int i; | 100 | int i; |
110 | assert(!snd_mask_empty(mask)); | ||
111 | for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) { | 101 | for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) { |
112 | if (mask->bits[i]) | 102 | if (mask->bits[i]) |
113 | return ld2(mask->bits[i]) + (i << 5); | 103 | return ld2(mask->bits[i]) + (i << 5); |
@@ -115,70 +105,68 @@ INLINE unsigned int snd_mask_max(const struct snd_mask *mask) | |||
115 | return 0; | 105 | return 0; |
116 | } | 106 | } |
117 | 107 | ||
118 | INLINE void snd_mask_set(struct snd_mask *mask, unsigned int val) | 108 | static inline void snd_mask_set(struct snd_mask *mask, unsigned int val) |
119 | { | 109 | { |
120 | assert(val <= SNDRV_MASK_BITS); | ||
121 | mask->bits[MASK_OFS(val)] |= MASK_BIT(val); | 110 | mask->bits[MASK_OFS(val)] |= MASK_BIT(val); |
122 | } | 111 | } |
123 | 112 | ||
124 | INLINE void snd_mask_reset(struct snd_mask *mask, unsigned int val) | 113 | static inline void snd_mask_reset(struct snd_mask *mask, unsigned int val) |
125 | { | 114 | { |
126 | assert(val <= SNDRV_MASK_BITS); | ||
127 | mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); | 115 | mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); |
128 | } | 116 | } |
129 | 117 | ||
130 | INLINE void snd_mask_set_range(struct snd_mask *mask, unsigned int from, unsigned int to) | 118 | static inline void snd_mask_set_range(struct snd_mask *mask, |
119 | unsigned int from, unsigned int to) | ||
131 | { | 120 | { |
132 | unsigned int i; | 121 | unsigned int i; |
133 | assert(to <= SNDRV_MASK_BITS && from <= to); | ||
134 | for (i = from; i <= to; i++) | 122 | for (i = from; i <= to; i++) |
135 | mask->bits[MASK_OFS(i)] |= MASK_BIT(i); | 123 | mask->bits[MASK_OFS(i)] |= MASK_BIT(i); |
136 | } | 124 | } |
137 | 125 | ||
138 | INLINE void snd_mask_reset_range(struct snd_mask *mask, unsigned int from, unsigned int to) | 126 | static inline void snd_mask_reset_range(struct snd_mask *mask, |
127 | unsigned int from, unsigned int to) | ||
139 | { | 128 | { |
140 | unsigned int i; | 129 | unsigned int i; |
141 | assert(to <= SNDRV_MASK_BITS && from <= to); | ||
142 | for (i = from; i <= to; i++) | 130 | for (i = from; i <= to; i++) |
143 | mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); | 131 | mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); |
144 | } | 132 | } |
145 | 133 | ||
146 | INLINE void snd_mask_leave(struct snd_mask *mask, unsigned int val) | 134 | static inline void snd_mask_leave(struct snd_mask *mask, unsigned int val) |
147 | { | 135 | { |
148 | unsigned int v; | 136 | unsigned int v; |
149 | assert(val <= SNDRV_MASK_BITS); | ||
150 | v = mask->bits[MASK_OFS(val)] & MASK_BIT(val); | 137 | v = mask->bits[MASK_OFS(val)] & MASK_BIT(val); |
151 | snd_mask_none(mask); | 138 | snd_mask_none(mask); |
152 | mask->bits[MASK_OFS(val)] = v; | 139 | mask->bits[MASK_OFS(val)] = v; |
153 | } | 140 | } |
154 | 141 | ||
155 | INLINE void snd_mask_intersect(struct snd_mask *mask, const struct snd_mask *v) | 142 | static inline void snd_mask_intersect(struct snd_mask *mask, |
143 | const struct snd_mask *v) | ||
156 | { | 144 | { |
157 | int i; | 145 | int i; |
158 | for (i = 0; i < SNDRV_MASK_SIZE; i++) | 146 | for (i = 0; i < SNDRV_MASK_SIZE; i++) |
159 | mask->bits[i] &= v->bits[i]; | 147 | mask->bits[i] &= v->bits[i]; |
160 | } | 148 | } |
161 | 149 | ||
162 | INLINE int snd_mask_eq(const struct snd_mask *mask, const struct snd_mask *v) | 150 | static inline int snd_mask_eq(const struct snd_mask *mask, |
151 | const struct snd_mask *v) | ||
163 | { | 152 | { |
164 | return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); | 153 | return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); |
165 | } | 154 | } |
166 | 155 | ||
167 | INLINE void snd_mask_copy(struct snd_mask *mask, const struct snd_mask *v) | 156 | static inline void snd_mask_copy(struct snd_mask *mask, |
157 | const struct snd_mask *v) | ||
168 | { | 158 | { |
169 | *mask = *v; | 159 | *mask = *v; |
170 | } | 160 | } |
171 | 161 | ||
172 | INLINE int snd_mask_test(const struct snd_mask *mask, unsigned int val) | 162 | static inline int snd_mask_test(const struct snd_mask *mask, unsigned int val) |
173 | { | 163 | { |
174 | assert(val <= SNDRV_MASK_BITS); | ||
175 | return mask->bits[MASK_OFS(val)] & MASK_BIT(val); | 164 | return mask->bits[MASK_OFS(val)] & MASK_BIT(val); |
176 | } | 165 | } |
177 | 166 | ||
178 | INLINE int snd_mask_single(const struct snd_mask *mask) | 167 | static inline int snd_mask_single(const struct snd_mask *mask) |
179 | { | 168 | { |
180 | int i, c = 0; | 169 | int i, c = 0; |
181 | assert(!snd_mask_empty(mask)); | ||
182 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { | 170 | for (i = 0; i < SNDRV_MASK_SIZE; i++) { |
183 | if (! mask->bits[i]) | 171 | if (! mask->bits[i]) |
184 | continue; | 172 | continue; |
@@ -191,10 +179,10 @@ INLINE int snd_mask_single(const struct snd_mask *mask) | |||
191 | return 1; | 179 | return 1; |
192 | } | 180 | } |
193 | 181 | ||
194 | INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v) | 182 | static inline int snd_mask_refine(struct snd_mask *mask, |
183 | const struct snd_mask *v) | ||
195 | { | 184 | { |
196 | struct snd_mask old; | 185 | struct snd_mask old; |
197 | assert(!snd_mask_empty(mask)); | ||
198 | snd_mask_copy(&old, mask); | 186 | snd_mask_copy(&old, mask); |
199 | snd_mask_intersect(mask, v); | 187 | snd_mask_intersect(mask, v); |
200 | if (snd_mask_empty(mask)) | 188 | if (snd_mask_empty(mask)) |
@@ -202,27 +190,24 @@ INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v) | |||
202 | return !snd_mask_eq(mask, &old); | 190 | return !snd_mask_eq(mask, &old); |
203 | } | 191 | } |
204 | 192 | ||
205 | INLINE int snd_mask_refine_first(struct snd_mask *mask) | 193 | static inline int snd_mask_refine_first(struct snd_mask *mask) |
206 | { | 194 | { |
207 | assert(!snd_mask_empty(mask)); | ||
208 | if (snd_mask_single(mask)) | 195 | if (snd_mask_single(mask)) |
209 | return 0; | 196 | return 0; |
210 | snd_mask_leave(mask, snd_mask_min(mask)); | 197 | snd_mask_leave(mask, snd_mask_min(mask)); |
211 | return 1; | 198 | return 1; |
212 | } | 199 | } |
213 | 200 | ||
214 | INLINE int snd_mask_refine_last(struct snd_mask *mask) | 201 | static inline int snd_mask_refine_last(struct snd_mask *mask) |
215 | { | 202 | { |
216 | assert(!snd_mask_empty(mask)); | ||
217 | if (snd_mask_single(mask)) | 203 | if (snd_mask_single(mask)) |
218 | return 0; | 204 | return 0; |
219 | snd_mask_leave(mask, snd_mask_max(mask)); | 205 | snd_mask_leave(mask, snd_mask_max(mask)); |
220 | return 1; | 206 | return 1; |
221 | } | 207 | } |
222 | 208 | ||
223 | INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) | 209 | static inline int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) |
224 | { | 210 | { |
225 | assert(!snd_mask_empty(mask)); | ||
226 | if (snd_mask_min(mask) >= val) | 211 | if (snd_mask_min(mask) >= val) |
227 | return 0; | 212 | return 0; |
228 | snd_mask_reset_range(mask, 0, val - 1); | 213 | snd_mask_reset_range(mask, 0, val - 1); |
@@ -231,9 +216,8 @@ INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val) | |||
231 | return 1; | 216 | return 1; |
232 | } | 217 | } |
233 | 218 | ||
234 | INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) | 219 | static inline int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) |
235 | { | 220 | { |
236 | assert(!snd_mask_empty(mask)); | ||
237 | if (snd_mask_max(mask) <= val) | 221 | if (snd_mask_max(mask) <= val) |
238 | return 0; | 222 | return 0; |
239 | snd_mask_reset_range(mask, val + 1, SNDRV_MASK_BITS); | 223 | snd_mask_reset_range(mask, val + 1, SNDRV_MASK_BITS); |
@@ -242,10 +226,9 @@ INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val) | |||
242 | return 1; | 226 | return 1; |
243 | } | 227 | } |
244 | 228 | ||
245 | INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) | 229 | static inline int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) |
246 | { | 230 | { |
247 | int changed; | 231 | int changed; |
248 | assert(!snd_mask_empty(mask)); | ||
249 | changed = !snd_mask_single(mask); | 232 | changed = !snd_mask_single(mask); |
250 | snd_mask_leave(mask, val); | 233 | snd_mask_leave(mask, val); |
251 | if (snd_mask_empty(mask)) | 234 | if (snd_mask_empty(mask)) |
@@ -253,13 +236,12 @@ INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val) | |||
253 | return changed; | 236 | return changed; |
254 | } | 237 | } |
255 | 238 | ||
256 | INLINE int snd_mask_value(const struct snd_mask *mask) | 239 | static inline int snd_mask_value(const struct snd_mask *mask) |
257 | { | 240 | { |
258 | assert(!snd_mask_empty(mask)); | ||
259 | return snd_mask_min(mask); | 241 | return snd_mask_min(mask); |
260 | } | 242 | } |
261 | 243 | ||
262 | INLINE void snd_interval_any(struct snd_interval *i) | 244 | static inline void snd_interval_any(struct snd_interval *i) |
263 | { | 245 | { |
264 | i->min = 0; | 246 | i->min = 0; |
265 | i->openmin = 0; | 247 | i->openmin = 0; |
@@ -269,63 +251,59 @@ INLINE void snd_interval_any(struct snd_interval *i) | |||
269 | i->empty = 0; | 251 | i->empty = 0; |
270 | } | 252 | } |
271 | 253 | ||
272 | INLINE void snd_interval_none(struct snd_interval *i) | 254 | static inline void snd_interval_none(struct snd_interval *i) |
273 | { | 255 | { |
274 | i->empty = 1; | 256 | i->empty = 1; |
275 | } | 257 | } |
276 | 258 | ||
277 | INLINE int snd_interval_checkempty(const struct snd_interval *i) | 259 | static inline int snd_interval_checkempty(const struct snd_interval *i) |
278 | { | 260 | { |
279 | return (i->min > i->max || | 261 | return (i->min > i->max || |
280 | (i->min == i->max && (i->openmin || i->openmax))); | 262 | (i->min == i->max && (i->openmin || i->openmax))); |
281 | } | 263 | } |
282 | 264 | ||
283 | INLINE int snd_interval_empty(const struct snd_interval *i) | 265 | static inline int snd_interval_empty(const struct snd_interval *i) |
284 | { | 266 | { |
285 | return i->empty; | 267 | return i->empty; |
286 | } | 268 | } |
287 | 269 | ||
288 | INLINE int snd_interval_single(const struct snd_interval *i) | 270 | static inline int snd_interval_single(const struct snd_interval *i) |
289 | { | 271 | { |
290 | assert(!snd_interval_empty(i)); | ||
291 | return (i->min == i->max || | 272 | return (i->min == i->max || |
292 | (i->min + 1 == i->max && i->openmax)); | 273 | (i->min + 1 == i->max && i->openmax)); |
293 | } | 274 | } |
294 | 275 | ||
295 | INLINE int snd_interval_value(const struct snd_interval *i) | 276 | static inline int snd_interval_value(const struct snd_interval *i) |
296 | { | 277 | { |
297 | assert(snd_interval_single(i)); | ||
298 | return i->min; | 278 | return i->min; |
299 | } | 279 | } |
300 | 280 | ||
301 | INLINE int snd_interval_min(const struct snd_interval *i) | 281 | static inline int snd_interval_min(const struct snd_interval *i) |
302 | { | 282 | { |
303 | assert(!snd_interval_empty(i)); | ||
304 | return i->min; | 283 | return i->min; |
305 | } | 284 | } |
306 | 285 | ||
307 | INLINE int snd_interval_max(const struct snd_interval *i) | 286 | static inline int snd_interval_max(const struct snd_interval *i) |
308 | { | 287 | { |
309 | unsigned int v; | 288 | unsigned int v; |
310 | assert(!snd_interval_empty(i)); | ||
311 | v = i->max; | 289 | v = i->max; |
312 | if (i->openmax) | 290 | if (i->openmax) |
313 | v--; | 291 | v--; |
314 | return v; | 292 | return v; |
315 | } | 293 | } |
316 | 294 | ||
317 | INLINE int snd_interval_test(const struct snd_interval *i, unsigned int val) | 295 | static inline int snd_interval_test(const struct snd_interval *i, unsigned int val) |
318 | { | 296 | { |
319 | return !((i->min > val || (i->min == val && i->openmin) || | 297 | return !((i->min > val || (i->min == val && i->openmin) || |
320 | i->max < val || (i->max == val && i->openmax))); | 298 | i->max < val || (i->max == val && i->openmax))); |
321 | } | 299 | } |
322 | 300 | ||
323 | INLINE void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s) | 301 | static inline void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s) |
324 | { | 302 | { |
325 | *d = *s; | 303 | *d = *s; |
326 | } | 304 | } |
327 | 305 | ||
328 | INLINE int snd_interval_setinteger(struct snd_interval *i) | 306 | static inline int snd_interval_setinteger(struct snd_interval *i) |
329 | { | 307 | { |
330 | if (i->integer) | 308 | if (i->integer) |
331 | return 0; | 309 | return 0; |
@@ -335,7 +313,7 @@ INLINE int snd_interval_setinteger(struct snd_interval *i) | |||
335 | return 1; | 313 | return 1; |
336 | } | 314 | } |
337 | 315 | ||
338 | INLINE int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2) | 316 | static inline int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2) |
339 | { | 317 | { |
340 | if (i1->empty) | 318 | if (i1->empty) |
341 | return i2->empty; | 319 | return i2->empty; |
@@ -359,8 +337,5 @@ static inline unsigned int sub(unsigned int a, unsigned int b) | |||
359 | return 0; | 337 | return 0; |
360 | } | 338 | } |
361 | 339 | ||
362 | #undef INLINE | ||
363 | #undef assert | ||
364 | |||
365 | #endif /* __SOUND_PCM_PARAMS_H */ | 340 | #endif /* __SOUND_PCM_PARAMS_H */ |
366 | 341 | ||
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h index 584e73dd4793..7dbcd10fa215 100644 --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h | |||
@@ -46,6 +46,7 @@ | |||
46 | 46 | ||
47 | struct snd_rawmidi; | 47 | struct snd_rawmidi; |
48 | struct snd_rawmidi_substream; | 48 | struct snd_rawmidi_substream; |
49 | struct snd_seq_port_info; | ||
49 | 50 | ||
50 | struct snd_rawmidi_ops { | 51 | struct snd_rawmidi_ops { |
51 | int (*open) (struct snd_rawmidi_substream * substream); | 52 | int (*open) (struct snd_rawmidi_substream * substream); |
@@ -57,6 +58,8 @@ struct snd_rawmidi_ops { | |||
57 | struct snd_rawmidi_global_ops { | 58 | struct snd_rawmidi_global_ops { |
58 | int (*dev_register) (struct snd_rawmidi * rmidi); | 59 | int (*dev_register) (struct snd_rawmidi * rmidi); |
59 | int (*dev_unregister) (struct snd_rawmidi * rmidi); | 60 | int (*dev_unregister) (struct snd_rawmidi * rmidi); |
61 | void (*get_port_info)(struct snd_rawmidi *rmidi, int number, | ||
62 | struct snd_seq_port_info *info); | ||
60 | }; | 63 | }; |
61 | 64 | ||
62 | struct snd_rawmidi_runtime { | 65 | struct snd_rawmidi_runtime { |
diff --git a/include/sound/version.h b/include/sound/version.h index 4f0e65808cf1..2ee849d0e198 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h. Generated by configure. */ | 1 | /* include/version.h. Generated by configure. */ |
2 | #define CONFIG_SND_VERSION "1.0.11rc4" | 2 | #define CONFIG_SND_VERSION "1.0.12rc1" |
3 | #define CONFIG_SND_DATE " (Wed Mar 22 10:27:24 2006 UTC)" | 3 | #define CONFIG_SND_DATE " (Thu Jun 22 13:55:50 2006 UTC)" |