diff options
Diffstat (limited to 'include')
417 files changed, 8665 insertions, 6355 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index e27dc8f299..b9beceb331 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 11a8fe39cb..9a7d6921f5 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 c41a926ff3..288f84903a 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 f2717be4fe..234142828e 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 dc768aa580..797ca1ea52 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 734cc77bf2..14531d48f6 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 8361820d29..1eeca7adca 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 f2be2a8817..38f9aa4bef 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 b667a804fc..83b52f9f89 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 d130cfed8d..1747d94084 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 e6d78bd9e9..7659a46bc4 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 7785d481dc..8d5039d0b4 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 5a1ff484af..9d49d3c41c 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 6dca3d5420..43f8c2a23a 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -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, |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 970e9a6372..8f473c83b7 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 66cf2ecef5..049e9aa1b8 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 fa02e80833..ad11fc13fb 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 d8c1c2cdac..5e8095f0f7 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 30a47542e1..4dbaf02fe5 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 ed53f842da..b125ceed9c 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 cd428d57ad..745a6445a4 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 dfc7ac1094..67efe6cad2 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 7ca89cde70..77cf1236b0 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 0927765df6..ba039ea1a0 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 37964a59ae..cf18426a87 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 fb4735315a..be03818af9 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/platform/acenv.h b/include/acpi/platform/acenv.h index 223ec64671..453a469fd3 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 2e6d54569e..b5655a665b 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -52,27 +52,22 @@ | |||
52 | #include <linux/config.h> | 52 | #include <linux/config.h> |
53 | #include <linux/string.h> | 53 | #include <linux/string.h> |
54 | #include <linux/kernel.h> | 54 | #include <linux/kernel.h> |
55 | #include <linux/module.h> | ||
55 | #include <linux/ctype.h> | 56 | #include <linux/ctype.h> |
56 | #include <asm/system.h> | 57 | #include <asm/system.h> |
57 | #include <asm/atomic.h> | 58 | #include <asm/atomic.h> |
58 | #include <asm/div64.h> | 59 | #include <asm/div64.h> |
59 | #include <asm/acpi.h> | 60 | #include <asm/acpi.h> |
61 | #include <linux/slab.h> | ||
60 | 62 | ||
61 | #define strtoul simple_strtoul | 63 | /* Host-dependent types and defines */ |
62 | |||
63 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG | ||
64 | 64 | ||
65 | /* Type(s) for the OSL */ | 65 | #define ACPI_MACHINE_WIDTH BITS_PER_LONG |
66 | 66 | #define acpi_cache_t kmem_cache_t | |
67 | #ifdef ACPI_USE_LOCAL_CACHE | 67 | #define ACPI_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol); |
68 | #define acpi_cache_t struct acpi_memory_list | 68 | #define strtoul simple_strtoul |
69 | #else | ||
70 | #include <linux/slab.h> | ||
71 | #define acpi_cache_t kmem_cache_t | ||
72 | #endif | ||
73 | 69 | ||
74 | /* Full namespace pathname length limit - arbitrary */ | 70 | /* Full namespace pathname length limit - arbitrary */ |
75 | |||
76 | #define ACPI_PATHNAME_MAX 256 | 71 | #define ACPI_PATHNAME_MAX 256 |
77 | 72 | ||
78 | #else /* !__KERNEL__ */ | 73 | #else /* !__KERNEL__ */ |
@@ -104,4 +99,8 @@ | |||
104 | 99 | ||
105 | #define acpi_cpu_flags unsigned long | 100 | #define acpi_cpu_flags unsigned long |
106 | 101 | ||
102 | #define acpi_thread_id u32 | ||
103 | |||
104 | static inline acpi_thread_id acpi_os_get_thread_id(void) { return 0; } | ||
105 | |||
107 | #endif /* __ACLINUX_H__ */ | 106 | #endif /* __ACLINUX_H__ */ |
diff --git a/include/asm-alpha/numnodes.h b/include/asm-alpha/numnodes.h deleted file mode 100644 index cd425827e4..0000000000 --- a/include/asm-alpha/numnodes.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef _ASM_MAX_NUMNODES_H | ||
2 | #define _ASM_MAX_NUMNODES_H | ||
3 | |||
4 | /* Max 128 Nodes - Marvel */ | ||
5 | #define NODES_SHIFT 7 | ||
6 | |||
7 | #endif /* _ASM_MAX_NUMNODES_H */ | ||
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h index 9950706abd..e1432102be 100644 --- a/include/asm-alpha/smp.h +++ b/include/asm-alpha/smp.h | |||
@@ -45,10 +45,8 @@ extern struct cpuinfo_alpha cpu_data[NR_CPUS]; | |||
45 | #define hard_smp_processor_id() __hard_smp_processor_id() | 45 | #define hard_smp_processor_id() __hard_smp_processor_id() |
46 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 46 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
47 | 47 | ||
48 | extern cpumask_t cpu_present_mask; | ||
49 | extern cpumask_t cpu_online_map; | ||
50 | extern int smp_num_cpus; | 48 | extern int smp_num_cpus; |
51 | #define cpu_possible_map cpu_present_mask | 49 | #define cpu_possible_map cpu_present_map |
52 | 50 | ||
53 | int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu); | 51 | int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu); |
54 | 52 | ||
diff --git a/include/asm-alpha/termbits.h b/include/asm-alpha/termbits.h index f4837fa294..5541101b58 100644 --- a/include/asm-alpha/termbits.h +++ b/include/asm-alpha/termbits.h | |||
@@ -148,6 +148,7 @@ struct termios { | |||
148 | #define HUPCL 00040000 | 148 | #define HUPCL 00040000 |
149 | 149 | ||
150 | #define CLOCAL 00100000 | 150 | #define CLOCAL 00100000 |
151 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
151 | #define CRTSCTS 020000000000 /* flow control */ | 152 | #define CRTSCTS 020000000000 /* flow control */ |
152 | 153 | ||
153 | /* c_lflag bits */ | 154 | /* c_lflag bits */ |
diff --git a/include/asm-arm/arch-aaec2000/debug-macro.S b/include/asm-arm/arch-aaec2000/debug-macro.S index e4f1fa539a..7b1fce021d 100644 --- a/include/asm-arm/arch-aaec2000/debug-macro.S +++ b/include/asm-arm/arch-aaec2000/debug-macro.S | |||
@@ -9,6 +9,7 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include "hardware.h" | ||
12 | .macro addruart,rx | 13 | .macro addruart,rx |
13 | mrc p15, 0, \rx, c1, c0 | 14 | mrc p15, 0, \rx, c1, c0 |
14 | tst \rx, #1 @ MMU enabled? | 15 | tst \rx, #1 @ MMU enabled? |
diff --git a/include/asm-arm/arch-aaec2000/entry-macro.S b/include/asm-arm/arch-aaec2000/entry-macro.S index df31313ab0..1eb3503bd1 100644 --- a/include/asm-arm/arch-aaec2000/entry-macro.S +++ b/include/asm-arm/arch-aaec2000/entry-macro.S | |||
@@ -10,6 +10,7 @@ | |||
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | #include <asm/arch/irqs.h> | ||
13 | 14 | ||
14 | .macro disable_fiq | 15 | .macro disable_fiq |
15 | .endm | 16 | .endm |
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_mci.h b/include/asm-arm/arch-at91rm9200/at91rm9200_mci.h new file mode 100644 index 0000000000..f28636d61e --- /dev/null +++ b/include/asm-arm/arch-at91rm9200/at91rm9200_mci.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-at91rm9200/at91rm9200_mci.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
5 | * Copyright (C) SAN People | ||
6 | * | ||
7 | * MultiMedia Card Interface (MCI) registers. | ||
8 | * Based on AT91RM9200 datasheet revision E. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef AT91RM9200_MCI_H | ||
17 | #define AT91RM9200_MCI_H | ||
18 | |||
19 | #define AT91_MCI_CR 0x00 /* Control Register */ | ||
20 | #define AT91_MCI_MCIEN (1 << 0) /* Multi-Media Interface Enable */ | ||
21 | #define AT91_MCI_MCIDIS (1 << 1) /* Multi-Media Interface Disable */ | ||
22 | #define AT91_MCI_PWSEN (1 << 2) /* Power Save Mode Enable */ | ||
23 | #define AT91_MCI_PWSDIS (1 << 3) /* Power Save Mode Disable */ | ||
24 | #define AT91_MCI_SWRST (1 << 7) /* Software Reset */ | ||
25 | |||
26 | #define AT91_MCI_MR 0x04 /* Mode Register */ | ||
27 | #define AT91_MCI_CLKDIV (0xff << 0) /* Clock Divider */ | ||
28 | #define AT91_MCI_PWSDIV (3 << 8) /* Power Saving Divider */ | ||
29 | #define AT91_MCI_PDCPADV (1 << 14) /* PDC Padding Value */ | ||
30 | #define AT91_MCI_PDCMODE (1 << 15) /* PDC-orientated Mode */ | ||
31 | #define AT91_MCI_BLKLEN (0xfff << 18) /* Data Block Length */ | ||
32 | |||
33 | #define AT91_MCI_DTOR 0x08 /* Data Timeout Register */ | ||
34 | #define AT91_MCI_DTOCYC (0xf << 0) /* Data Timeout Cycle Number */ | ||
35 | #define AT91_MCI_DTOMUL (7 << 4) /* Data Timeout Multiplier */ | ||
36 | #define AT91_MCI_DTOMUL_1 (0 << 4) | ||
37 | #define AT91_MCI_DTOMUL_16 (1 << 4) | ||
38 | #define AT91_MCI_DTOMUL_128 (2 << 4) | ||
39 | #define AT91_MCI_DTOMUL_256 (3 << 4) | ||
40 | #define AT91_MCI_DTOMUL_1K (4 << 4) | ||
41 | #define AT91_MCI_DTOMUL_4K (5 << 4) | ||
42 | #define AT91_MCI_DTOMUL_64K (6 << 4) | ||
43 | #define AT91_MCI_DTOMUL_1M (7 << 4) | ||
44 | |||
45 | #define AT91_MCI_SDCR 0x0c /* SD Card Register */ | ||
46 | #define AT91_MCI_SDCSEL (0xf << 0) /* SD Card Selector */ | ||
47 | #define AT91_MCI_SDCBUS (1 << 7) /* 1-bit or 4-bit bus */ | ||
48 | |||
49 | #define AT91_MCI_ARGR 0x10 /* Argument Register */ | ||
50 | |||
51 | #define AT91_MCI_CMDR 0x14 /* Command Register */ | ||
52 | #define AT91_MCI_CMDNB (0x3f << 0) /* Command Number */ | ||
53 | #define AT91_MCI_RSPTYP (3 << 6) /* Response Type */ | ||
54 | #define AT91_MCI_RSPTYP_NONE (0 << 6) | ||
55 | #define AT91_MCI_RSPTYP_48 (1 << 6) | ||
56 | #define AT91_MCI_RSPTYP_136 (2 << 6) | ||
57 | #define AT91_MCI_SPCMD (7 << 8) /* Special Command */ | ||
58 | #define AT91_MCI_SPCMD_NONE (0 << 8) | ||
59 | #define AT91_MCI_SPCMD_INIT (1 << 8) | ||
60 | #define AT91_MCI_SPCMD_SYNC (2 << 8) | ||
61 | #define AT91_MCI_SPCMD_ICMD (4 << 8) | ||
62 | #define AT91_MCI_SPCMD_IRESP (5 << 8) | ||
63 | #define AT91_MCI_OPDCMD (1 << 11) /* Open Drain Command */ | ||
64 | #define AT91_MCI_MAXLAT (1 << 12) /* Max Latency for Command to Response */ | ||
65 | #define AT91_MCI_TRCMD (3 << 16) /* Transfer Command */ | ||
66 | #define AT91_MCI_TRCMD_NONE (0 << 16) | ||
67 | #define AT91_MCI_TRCMD_START (1 << 16) | ||
68 | #define AT91_MCI_TRCMD_STOP (2 << 16) | ||
69 | #define AT91_MCI_TRDIR (1 << 18) /* Transfer Direction */ | ||
70 | #define AT91_MCI_TRTYP (3 << 19) /* Transfer Type */ | ||
71 | #define AT91_MCI_TRTYP_BLOCK (0 << 19) | ||
72 | #define AT91_MCI_TRTYP_MULTIPLE (1 << 19) | ||
73 | #define AT91_MCI_TRTYP_STREAM (2 << 19) | ||
74 | |||
75 | #define AT91_MCI_RSPR(n) (0x20 + ((n) * 4)) /* Response Registers 0-3 */ | ||
76 | #define AT91_MCR_RDR 0x30 /* Receive Data Register */ | ||
77 | #define AT91_MCR_TDR 0x34 /* Transmit Data Register */ | ||
78 | |||
79 | #define AT91_MCI_SR 0x40 /* Status Register */ | ||
80 | #define AT91_MCI_CMDRDY (1 << 0) /* Command Ready */ | ||
81 | #define AT91_MCI_RXRDY (1 << 1) /* Receiver Ready */ | ||
82 | #define AT91_MCI_TXRDY (1 << 2) /* Transmit Ready */ | ||
83 | #define AT91_MCI_BLKE (1 << 3) /* Data Block Ended */ | ||
84 | #define AT91_MCI_DTIP (1 << 4) /* Data Transfer in Progress */ | ||
85 | #define AT91_MCI_NOTBUSY (1 << 5) /* Data Not Busy */ | ||
86 | #define AT91_MCI_ENDRX (1 << 6) /* End of RX Buffer */ | ||
87 | #define AT91_MCI_ENDTX (1 << 7) /* End fo TX Buffer */ | ||
88 | #define AT91_MCI_RXBUFF (1 << 14) /* RX Buffer Full */ | ||
89 | #define AT91_MCI_TXBUFE (1 << 15) /* TX Buffer Empty */ | ||
90 | #define AT91_MCI_RINDE (1 << 16) /* Response Index Error */ | ||
91 | #define AT91_MCI_RDIRE (1 << 17) /* Response Direction Error */ | ||
92 | #define AT91_MCI_RCRCE (1 << 18) /* Response CRC Error */ | ||
93 | #define AT91_MCI_RENDE (1 << 19) /* Response End Bit Error */ | ||
94 | #define AT91_MCI_RTOE (1 << 20) /* Reponse Time-out Error */ | ||
95 | #define AT91_MCI_DCRCE (1 << 21) /* Data CRC Error */ | ||
96 | #define AT91_MCI_DTOE (1 << 22) /* Data Time-out Error */ | ||
97 | #define AT91_MCI_OVRE (1 << 30) /* Overrun */ | ||
98 | #define AT91_MCI_UNRE (1 << 31) /* Underrun */ | ||
99 | |||
100 | #define AT91_MCI_IER 0x44 /* Interrupt Enable Register */ | ||
101 | #define AT91_MCI_IDR 0x48 /* Interrupt Disable Register */ | ||
102 | #define AT91_MCI_IMR 0x4c /* Interrupt Mask Register */ | ||
103 | |||
104 | #endif | ||
diff --git a/include/asm-arm/arch-at91rm9200/board.h b/include/asm-arm/arch-at91rm9200/board.h index 2e7d1139a7..4fdef13d01 100644 --- a/include/asm-arm/arch-at91rm9200/board.h +++ b/include/asm-arm/arch-at91rm9200/board.h | |||
@@ -38,6 +38,8 @@ extern unsigned long at91_master_clock; | |||
38 | extern int at91_serial_map[AT91_NR_UART]; | 38 | extern int at91_serial_map[AT91_NR_UART]; |
39 | extern int at91_console_port; | 39 | extern int at91_console_port; |
40 | 40 | ||
41 | #include <linux/mtd/partitions.h> | ||
42 | |||
41 | /* USB Device */ | 43 | /* USB Device */ |
42 | struct at91_udc_data { | 44 | struct at91_udc_data { |
43 | u8 vbus_pin; /* high == host powering us */ | 45 | u8 vbus_pin; /* high == host powering us */ |
@@ -77,4 +79,26 @@ struct at91_usbh_data { | |||
77 | }; | 79 | }; |
78 | extern void __init at91_add_device_usbh(struct at91_usbh_data *data); | 80 | extern void __init at91_add_device_usbh(struct at91_usbh_data *data); |
79 | 81 | ||
82 | /* NAND / SmartMedia */ | ||
83 | struct at91_nand_data { | ||
84 | u8 enable_pin; /* chip enable */ | ||
85 | u8 det_pin; /* card detect */ | ||
86 | u8 rdy_pin; /* ready/busy */ | ||
87 | u8 ale; /* address line number connected to ALE */ | ||
88 | u8 cle; /* address line number connected to CLE */ | ||
89 | struct mtd_partition* (*partition_info)(int, int*); | ||
90 | }; | ||
91 | extern void __init at91_add_device_nand(struct at91_nand_data *data); | ||
92 | |||
93 | /* I2C*/ | ||
94 | void __init at91_add_device_i2c(void); | ||
95 | |||
96 | /* RTC */ | ||
97 | void __init at91_add_device_rtc(void); | ||
98 | |||
99 | /* LEDs */ | ||
100 | extern u8 at91_leds_cpu; | ||
101 | extern u8 at91_leds_timer; | ||
102 | extern void __init at91_init_leds(u8 cpu_led, u8 timer_led); | ||
103 | |||
80 | #endif | 104 | #endif |
diff --git a/include/asm-arm/arch-at91rm9200/hardware.h b/include/asm-arm/arch-at91rm9200/hardware.h index 2646c01f8e..59e6f44d3a 100644 --- a/include/asm-arm/arch-at91rm9200/hardware.h +++ b/include/asm-arm/arch-at91rm9200/hardware.h | |||
@@ -65,6 +65,9 @@ | |||
65 | /* SmartMedia */ | 65 | /* SmartMedia */ |
66 | #define AT91_SMARTMEDIA_BASE 0x40000000 /* NCS3: Smartmedia physical base address */ | 66 | #define AT91_SMARTMEDIA_BASE 0x40000000 /* NCS3: Smartmedia physical base address */ |
67 | 67 | ||
68 | /* Compact Flash */ | ||
69 | #define AT91_CF_BASE 0x50000000 /* NCS4-NCS6: Compact Flash physical base address */ | ||
70 | |||
68 | /* Multi-Master Memory controller */ | 71 | /* Multi-Master Memory controller */ |
69 | #define AT91_UHP_BASE 0x00300000 /* USB Host controller */ | 72 | #define AT91_UHP_BASE 0x00300000 /* USB Host controller */ |
70 | 73 | ||
diff --git a/include/asm-arm/arch-cl7500/hardware.h b/include/asm-arm/arch-cl7500/hardware.h index 2339b764f6..1adfd18e61 100644 --- a/include/asm-arm/arch-cl7500/hardware.h +++ b/include/asm-arm/arch-cl7500/hardware.h | |||
@@ -53,16 +53,12 @@ | |||
53 | #define SCREEN_END 0xdfc00000 | 53 | #define SCREEN_END 0xdfc00000 |
54 | #define SCREEN_BASE 0xdf800000 | 54 | #define SCREEN_BASE 0xdf800000 |
55 | 55 | ||
56 | #define FLUSH_BASE 0xdf000000 | ||
57 | |||
58 | #define VIDC_BASE (void __iomem *)0xe0400000 | 56 | #define VIDC_BASE (void __iomem *)0xe0400000 |
59 | #define IOMD_BASE IOMEM(0xe0200000) | 57 | #define IOMD_BASE IOMEM(0xe0200000) |
60 | #define IOC_BASE IOMEM(0xe0200000) | 58 | #define IOC_BASE IOMEM(0xe0200000) |
61 | #define FLOPPYDMA_BASE IOMEM(0xe002a000) | 59 | #define FLOPPYDMA_BASE IOMEM(0xe002a000) |
62 | #define PCIO_BASE IOMEM(0xe0010000) | 60 | #define PCIO_BASE IOMEM(0xe0010000) |
63 | 61 | ||
64 | #define FLUSH_BASE_PHYS 0x00000000 /* ROM */ | ||
65 | |||
66 | #define vidc_writel(val) __raw_writel(val, VIDC_BASE) | 62 | #define vidc_writel(val) __raw_writel(val, VIDC_BASE) |
67 | 63 | ||
68 | /* in/out bias for the ISA slot region */ | 64 | /* in/out bias for the ISA slot region */ |
diff --git a/include/asm-arm/arch-cl7500/memory.h b/include/asm-arm/arch-cl7500/memory.h index 34f40a6cec..3178140e24 100644 --- a/include/asm-arm/arch-cl7500/memory.h +++ b/include/asm-arm/arch-cl7500/memory.h | |||
@@ -26,4 +26,10 @@ | |||
26 | #define __virt_to_bus(x) __virt_to_phys(x) | 26 | #define __virt_to_bus(x) __virt_to_phys(x) |
27 | #define __bus_to_virt(x) __phys_to_virt(x) | 27 | #define __bus_to_virt(x) __phys_to_virt(x) |
28 | 28 | ||
29 | /* | ||
30 | * Cache flushing area - ROM | ||
31 | */ | ||
32 | #define FLUSH_BASE_PHYS 0x00000000 | ||
33 | #define FLUSH_BASE 0xdf000000 | ||
34 | |||
29 | #endif | 35 | #endif |
diff --git a/include/asm-arm/arch-ebsa110/debug-macro.S b/include/asm-arm/arch-ebsa110/debug-macro.S index f61cadabe0..9213bfe483 100644 --- a/include/asm-arm/arch-ebsa110/debug-macro.S +++ b/include/asm-arm/arch-ebsa110/debug-macro.S | |||
@@ -18,4 +18,4 @@ | |||
18 | 18 | ||
19 | #define UART_SHIFT 2 | 19 | #define UART_SHIFT 2 |
20 | #define FLOW_CONTROL | 20 | #define FLOW_CONTROL |
21 | #include <asm/hardware/debug-8250.h> | 21 | #include <asm/hardware/debug-8250.S> |
diff --git a/include/asm-arm/arch-ebsa110/hardware.h b/include/asm-arm/arch-ebsa110/hardware.h index 4e41c2358f..3ce864def4 100644 --- a/include/asm-arm/arch-ebsa110/hardware.h +++ b/include/asm-arm/arch-ebsa110/hardware.h | |||
@@ -57,9 +57,6 @@ | |||
57 | /* | 57 | /* |
58 | * RAM definitions | 58 | * RAM definitions |
59 | */ | 59 | */ |
60 | #define FLUSH_BASE_PHYS 0x40000000 | ||
61 | #define FLUSH_BASE 0xdf000000 | ||
62 | |||
63 | #define UNCACHEABLE_ADDR 0xff000000 /* IRQ_STAT */ | 60 | #define UNCACHEABLE_ADDR 0xff000000 /* IRQ_STAT */ |
64 | 61 | ||
65 | #endif | 62 | #endif |
diff --git a/include/asm-arm/arch-ebsa110/memory.h b/include/asm-arm/arch-ebsa110/memory.h index 02f144520c..c7c500e176 100644 --- a/include/asm-arm/arch-ebsa110/memory.h +++ b/include/asm-arm/arch-ebsa110/memory.h | |||
@@ -28,4 +28,10 @@ | |||
28 | #define __virt_to_bus(x) (x) | 28 | #define __virt_to_bus(x) (x) |
29 | #define __bus_to_virt(x) (x) | 29 | #define __bus_to_virt(x) (x) |
30 | 30 | ||
31 | /* | ||
32 | * Cache flushing area - SRAM | ||
33 | */ | ||
34 | #define FLUSH_BASE_PHYS 0x40000000 | ||
35 | #define FLUSH_BASE 0xdf000000 | ||
36 | |||
31 | #endif | 37 | #endif |
diff --git a/include/asm-arm/arch-ebsa110/uncompress.h b/include/asm-arm/arch-ebsa110/uncompress.h index 66b19c7fd9..ae5b775eb0 100644 --- a/include/asm-arm/arch-ebsa110/uncompress.h +++ b/include/asm-arm/arch-ebsa110/uncompress.h | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/serial_reg.h> | 11 | #include <linux/serial_reg.h> |
12 | 12 | ||
13 | #define SERIAL_BASE ((unsigned char *)0xfe000be0) | 13 | #define SERIAL_BASE ((unsigned char *)0xf0000be0) |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * This does not append a newline | 16 | * This does not append a newline |
diff --git a/include/asm-arm/arch-ebsa285/hardware.h b/include/asm-arm/arch-ebsa285/hardware.h index 2ef2200f10..ec51fe9248 100644 --- a/include/asm-arm/arch-ebsa285/hardware.h +++ b/include/asm-arm/arch-ebsa285/hardware.h | |||
@@ -48,9 +48,6 @@ | |||
48 | #define PCICFG0_SIZE 0x01000000 | 48 | #define PCICFG0_SIZE 0x01000000 |
49 | #define PCICFG0_BASE 0xfa000000 | 49 | #define PCICFG0_BASE 0xfa000000 |
50 | 50 | ||
51 | #define FLUSH_SIZE 0x00100000 | ||
52 | #define FLUSH_BASE 0xf9000000 | ||
53 | |||
54 | #define PCIMEM_SIZE 0x01000000 | 51 | #define PCIMEM_SIZE 0x01000000 |
55 | #define PCIMEM_BASE 0xf0000000 | 52 | #define PCIMEM_BASE 0xf0000000 |
56 | 53 | ||
@@ -61,9 +58,6 @@ | |||
61 | #define PCIMEM_SIZE 0x80000000 | 58 | #define PCIMEM_SIZE 0x80000000 |
62 | #define PCIMEM_BASE 0x80000000 | 59 | #define PCIMEM_BASE 0x80000000 |
63 | 60 | ||
64 | #define FLUSH_SIZE 0x00100000 | ||
65 | #define FLUSH_BASE 0x7e000000 | ||
66 | |||
67 | #define WFLUSH_SIZE 0x01000000 | 61 | #define WFLUSH_SIZE 0x01000000 |
68 | #define WFLUSH_BASE 0x7d000000 | 62 | #define WFLUSH_BASE 0x7d000000 |
69 | 63 | ||
@@ -94,7 +88,6 @@ | |||
94 | #define XBUS_SWITCH_J17_11 ((*XBUS_SWITCH) & (1 << 5)) | 88 | #define XBUS_SWITCH_J17_11 ((*XBUS_SWITCH) & (1 << 5)) |
95 | #define XBUS_SWITCH_J17_9 ((*XBUS_SWITCH) & (1 << 6)) | 89 | #define XBUS_SWITCH_J17_9 ((*XBUS_SWITCH) & (1 << 6)) |
96 | 90 | ||
97 | #define FLUSH_BASE_PHYS 0x50000000 | ||
98 | #define UNCACHEABLE_ADDR (ARMCSR_BASE + 0x108) | 91 | #define UNCACHEABLE_ADDR (ARMCSR_BASE + 0x108) |
99 | 92 | ||
100 | 93 | ||
diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h index 09e335cd68..99181ffc7e 100644 --- a/include/asm-arm/arch-ebsa285/memory.h +++ b/include/asm-arm/arch-ebsa285/memory.h | |||
@@ -49,12 +49,22 @@ extern unsigned long __bus_to_virt(unsigned long); | |||
49 | #define TASK_SIZE UL(0xbf000000) | 49 | #define TASK_SIZE UL(0xbf000000) |
50 | #define PAGE_OFFSET UL(0xc0000000) | 50 | #define PAGE_OFFSET UL(0xc0000000) |
51 | 51 | ||
52 | /* | ||
53 | * Cache flushing area. | ||
54 | */ | ||
55 | #define FLUSH_BASE 0xf9000000 | ||
56 | |||
52 | #elif defined(CONFIG_ARCH_CO285) | 57 | #elif defined(CONFIG_ARCH_CO285) |
53 | 58 | ||
54 | /* Task size and page offset at 1.5GB */ | 59 | /* Task size and page offset at 1.5GB */ |
55 | #define TASK_SIZE UL(0x5f000000) | 60 | #define TASK_SIZE UL(0x5f000000) |
56 | #define PAGE_OFFSET UL(0x60000000) | 61 | #define PAGE_OFFSET UL(0x60000000) |
57 | 62 | ||
63 | /* | ||
64 | * Cache flushing area. | ||
65 | */ | ||
66 | #define FLUSH_BASE 0x7e000000 | ||
67 | |||
58 | #else | 68 | #else |
59 | 69 | ||
60 | #error "Undefined footbridge architecture" | 70 | #error "Undefined footbridge architecture" |
@@ -72,4 +82,6 @@ extern unsigned long __bus_to_virt(unsigned long); | |||
72 | */ | 82 | */ |
73 | #define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3) | 83 | #define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3) |
74 | 84 | ||
85 | #define FLUSH_BASE_PHYS 0x50000000 | ||
86 | |||
75 | #endif | 87 | #endif |
diff --git a/include/asm-arm/arch-ep93xx/ts72xx.h b/include/asm-arm/arch-ep93xx/ts72xx.h index 412215e77f..a94f63ff05 100644 --- a/include/asm-arm/arch-ep93xx/ts72xx.h +++ b/include/asm-arm/arch-ep93xx/ts72xx.h | |||
@@ -12,6 +12,8 @@ | |||
12 | * febfc000 [67]0000000 4K NAND data register | 12 | * febfc000 [67]0000000 4K NAND data register |
13 | * febfb000 [67]0400000 4K NAND control register | 13 | * febfb000 [67]0400000 4K NAND control register |
14 | * febfa000 [67]0800000 4K NAND busy register | 14 | * febfa000 [67]0800000 4K NAND busy register |
15 | * febf9000 10800000 4K TS-5620 RTC index register | ||
16 | * febf8000 11700000 4K TS-5620 RTC data register | ||
15 | */ | 17 | */ |
16 | 18 | ||
17 | #define TS72XX_MODEL_PHYS_BASE 0x22000000 | 19 | #define TS72XX_MODEL_PHYS_BASE 0x22000000 |
@@ -58,6 +60,15 @@ | |||
58 | #define TS72XX_NAND_BUSY_SIZE 0x00001000 | 60 | #define TS72XX_NAND_BUSY_SIZE 0x00001000 |
59 | 61 | ||
60 | 62 | ||
63 | #define TS72XX_RTC_INDEX_VIRT_BASE 0xfebf9000 | ||
64 | #define TS72XX_RTC_INDEX_PHYS_BASE 0x10800000 | ||
65 | #define TS72XX_RTC_INDEX_SIZE 0x00001000 | ||
66 | |||
67 | #define TS72XX_RTC_DATA_VIRT_BASE 0xfebf8000 | ||
68 | #define TS72XX_RTC_DATA_PHYS_BASE 0x11700000 | ||
69 | #define TS72XX_RTC_DATA_SIZE 0x00001000 | ||
70 | |||
71 | |||
61 | #ifndef __ASSEMBLY__ | 72 | #ifndef __ASSEMBLY__ |
62 | #include <asm/io.h> | 73 | #include <asm/io.h> |
63 | 74 | ||
diff --git a/include/asm-arm/arch-imx/debug-macro.S b/include/asm-arm/arch-imx/debug-macro.S index 83f552f7bc..c611871643 100644 --- a/include/asm-arm/arch-imx/debug-macro.S +++ b/include/asm-arm/arch-imx/debug-macro.S | |||
@@ -16,7 +16,7 @@ | |||
16 | tst \rx, #1 @ MMU enabled? | 16 | tst \rx, #1 @ MMU enabled? |
17 | moveq \rx, #0x00000000 @ physical | 17 | moveq \rx, #0x00000000 @ physical |
18 | movne \rx, #0xe0000000 @ virtual | 18 | movne \rx, #0xe0000000 @ virtual |
19 | orr \rx, \rx, #0x00200000 | 19 | orreq \rx, \rx, #0x00200000 @ physical |
20 | orr \rx, \rx, #0x00006000 @ UART1 offset | 20 | orr \rx, \rx, #0x00006000 @ UART1 offset |
21 | .endm | 21 | .endm |
22 | 22 | ||
diff --git a/include/asm-arm/arch-imx/dma.h b/include/asm-arm/arch-imx/dma.h index b45fa367d7..621ff2c730 100644 --- a/include/asm-arm/arch-imx/dma.h +++ b/include/asm-arm/arch-imx/dma.h | |||
@@ -17,27 +17,16 @@ | |||
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | |||
20 | #ifndef __ASM_ARCH_DMA_H | 21 | #ifndef __ASM_ARCH_DMA_H |
21 | #define __ASM_ARCH_DMA_H | 22 | #define __ASM_ARCH_DMA_H |
22 | 23 | ||
23 | /* | ||
24 | * DMA registration | ||
25 | */ | ||
26 | |||
27 | typedef enum { | 24 | typedef enum { |
28 | DMA_PRIO_HIGH = 0, | 25 | DMA_PRIO_HIGH = 0, |
29 | DMA_PRIO_MEDIUM = 3, | 26 | DMA_PRIO_MEDIUM = 1, |
30 | DMA_PRIO_LOW = 6 | 27 | DMA_PRIO_LOW = 2 |
31 | } imx_dma_prio; | 28 | } imx_dma_prio; |
32 | 29 | ||
33 | int imx_request_dma(char *name, imx_dma_prio prio, | ||
34 | void (*irq_handler) (int, void *, struct pt_regs *), | ||
35 | void (*err_handler) (int, void *, struct pt_regs *), | ||
36 | void *data); | ||
37 | |||
38 | void imx_free_dma(int dma_ch); | ||
39 | |||
40 | |||
41 | #define DMA_REQ_UART3_T 2 | 30 | #define DMA_REQ_UART3_T 2 |
42 | #define DMA_REQ_UART3_R 3 | 31 | #define DMA_REQ_UART3_R 3 |
43 | #define DMA_REQ_SSI2_T 4 | 32 | #define DMA_REQ_SSI2_T 4 |
diff --git a/include/asm-arm/arch-imx/imx-dma.h b/include/asm-arm/arch-imx/imx-dma.h new file mode 100644 index 0000000000..f2063c1d61 --- /dev/null +++ b/include/asm-arm/arch-imx/imx-dma.h | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/imxads/dma.h | ||
3 | * | ||
4 | * Copyright (C) 1997,1998 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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <asm/dma.h> | ||
22 | |||
23 | #ifndef __ASM_ARCH_IMX_DMA_H | ||
24 | #define __ASM_ARCH_IMX_DMA_H | ||
25 | |||
26 | #define IMX_DMA_CHANNELS 11 | ||
27 | |||
28 | /* | ||
29 | * struct imx_dma_channel - i.MX specific DMA extension | ||
30 | * @name: name specified by DMA client | ||
31 | * @irq_handler: client callback for end of transfer | ||
32 | * @err_handler: client callback for error condition | ||
33 | * @data: clients context data for callbacks | ||
34 | * @dma_mode: direction of the transfer %DMA_MODE_READ or %DMA_MODE_WRITE | ||
35 | * @sg: pointer to the actual read/written chunk for scatter-gather emulation | ||
36 | * @sgbc: counter of processed bytes in the actual read/written chunk | ||
37 | * @resbytes: total residual number of bytes to transfer | ||
38 | * (it can be lower or same as sum of SG mapped chunk sizes) | ||
39 | * @sgcount: number of chunks to be read/written | ||
40 | * | ||
41 | * Structure is used for IMX DMA processing. It would be probably good | ||
42 | * @struct dma_struct in the future for external interfacing and use | ||
43 | * @struct imx_dma_channel only as extension to it. | ||
44 | */ | ||
45 | |||
46 | struct imx_dma_channel { | ||
47 | const char *name; | ||
48 | void (*irq_handler) (int, void *, struct pt_regs *); | ||
49 | void (*err_handler) (int, void *, struct pt_regs *); | ||
50 | void *data; | ||
51 | dmamode_t dma_mode; | ||
52 | struct scatterlist *sg; | ||
53 | unsigned int sgbc; | ||
54 | unsigned int sgcount; | ||
55 | unsigned int resbytes; | ||
56 | int dma_num; | ||
57 | }; | ||
58 | |||
59 | extern struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS]; | ||
60 | |||
61 | |||
62 | /* The type to distinguish channel numbers parameter from ordinal int type */ | ||
63 | typedef int imx_dmach_t; | ||
64 | |||
65 | int | ||
66 | imx_dma_setup_single(imx_dmach_t dma_ch, dma_addr_t dma_address, | ||
67 | unsigned int dma_length, unsigned int dev_addr, dmamode_t dmamode); | ||
68 | |||
69 | int | ||
70 | imx_dma_setup_sg(imx_dmach_t dma_ch, | ||
71 | struct scatterlist *sg, unsigned int sgcount, unsigned int dma_length, | ||
72 | unsigned int dev_addr, dmamode_t dmamode); | ||
73 | |||
74 | int | ||
75 | imx_dma_setup_handlers(imx_dmach_t dma_ch, | ||
76 | void (*irq_handler) (int, void *, struct pt_regs *), | ||
77 | void (*err_handler) (int, void *, struct pt_regs *), void *data); | ||
78 | |||
79 | void imx_dma_enable(imx_dmach_t dma_ch); | ||
80 | |||
81 | void imx_dma_disable(imx_dmach_t dma_ch); | ||
82 | |||
83 | int imx_dma_request(imx_dmach_t dma_ch, const char *name); | ||
84 | |||
85 | void imx_dma_free(imx_dmach_t dma_ch); | ||
86 | |||
87 | int imx_dma_request_by_prio(imx_dmach_t *pdma_ch, const char *name, imx_dma_prio prio); | ||
88 | |||
89 | |||
90 | #endif /* _ASM_ARCH_IMX_DMA_H */ | ||
diff --git a/include/asm-arm/arch-imx/imx-uart.h b/include/asm-arm/arch-imx/imx-uart.h new file mode 100644 index 0000000000..3a685e1780 --- /dev/null +++ b/include/asm-arm/arch-imx/imx-uart.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef ASMARM_ARCH_UART_H | ||
2 | #define ASMARM_ARCH_UART_H | ||
3 | |||
4 | #define IMXUART_HAVE_RTSCTS (1<<0) | ||
5 | |||
6 | struct imxuart_platform_data { | ||
7 | unsigned int flags; | ||
8 | }; | ||
9 | |||
10 | #endif | ||
diff --git a/include/asm-arm/arch-imx/mmc.h b/include/asm-arm/arch-imx/mmc.h new file mode 100644 index 0000000000..1937151665 --- /dev/null +++ b/include/asm-arm/arch-imx/mmc.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef ASMARM_ARCH_MMC_H | ||
2 | #define ASMARM_ARCH_MMC_H | ||
3 | |||
4 | #include <linux/mmc/protocol.h> | ||
5 | |||
6 | struct imxmmc_platform_data { | ||
7 | int (*card_present)(void); | ||
8 | }; | ||
9 | |||
10 | extern void imx_set_mmc_info(struct imxmmc_platform_data *info); | ||
11 | |||
12 | #endif | ||
diff --git a/include/asm-arm/arch-ixp23xx/debug-macro.S b/include/asm-arm/arch-ixp23xx/debug-macro.S index eb99fd69fd..2b25e64024 100644 --- a/include/asm-arm/arch-ixp23xx/debug-macro.S +++ b/include/asm-arm/arch-ixp23xx/debug-macro.S | |||
@@ -17,6 +17,9 @@ | |||
17 | tst \rx, #1 @ mmu enabled? | 17 | tst \rx, #1 @ mmu enabled? |
18 | ldreq \rx, =IXP23XX_PERIPHERAL_PHYS @ physical | 18 | ldreq \rx, =IXP23XX_PERIPHERAL_PHYS @ physical |
19 | ldrne \rx, =IXP23XX_PERIPHERAL_VIRT @ virtual | 19 | ldrne \rx, =IXP23XX_PERIPHERAL_VIRT @ virtual |
20 | #ifdef __ARMEB__ | ||
21 | orr \rx, \rx, #0x00000003 | ||
22 | #endif | ||
20 | .endm | 23 | .endm |
21 | 24 | ||
22 | #define UART_SHIFT 2 | 25 | #define UART_SHIFT 2 |
diff --git a/include/asm-arm/arch-ixp23xx/memory.h b/include/asm-arm/arch-ixp23xx/memory.h index bebcf0aa0d..c85fc06a04 100644 --- a/include/asm-arm/arch-ixp23xx/memory.h +++ b/include/asm-arm/arch-ixp23xx/memory.h | |||
@@ -28,6 +28,7 @@ | |||
28 | * to an address that the kernel can use. | 28 | * to an address that the kernel can use. |
29 | */ | 29 | */ |
30 | #ifndef __ASSEMBLY__ | 30 | #ifndef __ASSEMBLY__ |
31 | #include <asm/mach-types.h> | ||
31 | 32 | ||
32 | #define __virt_to_bus(v) \ | 33 | #define __virt_to_bus(v) \ |
33 | ({ unsigned int ret; \ | 34 | ({ unsigned int ret; \ |
@@ -40,6 +41,22 @@ | |||
40 | data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \ | 41 | data = *((volatile int *)IXP23XX_PCI_SDRAM_BAR); \ |
41 | __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); }) | 42 | __phys_to_virt((((b - (data & 0xfffffff0)) + 0x00000000))); }) |
42 | 43 | ||
44 | /* | ||
45 | * Coherency support. Only supported on A2 CPUs or on A1 | ||
46 | * systems that have the cache coherency workaround. | ||
47 | */ | ||
48 | static inline int __ixp23xx_arch_is_coherent(void) | ||
49 | { | ||
50 | extern unsigned int processor_id; | ||
51 | |||
52 | if (((processor_id & 15) >= 4) || machine_is_roadrunner()) | ||
53 | return 1; | ||
54 | |||
55 | return 0; | ||
56 | } | ||
57 | |||
58 | #define arch_is_coherent() __ixp23xx_arch_is_coherent() | ||
59 | |||
43 | #endif | 60 | #endif |
44 | 61 | ||
45 | 62 | ||
diff --git a/include/asm-arm/arch-ixp23xx/platform.h b/include/asm-arm/arch-ixp23xx/platform.h index f85b4685a4..e4d99060a0 100644 --- a/include/asm-arm/arch-ixp23xx/platform.h +++ b/include/asm-arm/arch-ixp23xx/platform.h | |||
@@ -22,6 +22,7 @@ void ixp23xx_sys_init(void); | |||
22 | int ixp23xx_pci_setup(int, struct pci_sys_data *); | 22 | int ixp23xx_pci_setup(int, struct pci_sys_data *); |
23 | void ixp23xx_pci_preinit(void); | 23 | void ixp23xx_pci_preinit(void); |
24 | struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*); | 24 | struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*); |
25 | void ixp23xx_pci_slave_init(void); | ||
25 | 26 | ||
26 | extern struct sys_timer ixp23xx_timer; | 27 | extern struct sys_timer ixp23xx_timer; |
27 | 28 | ||
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h index 942b622455..b59520e56f 100644 --- a/include/asm-arm/arch-ixp4xx/io.h +++ b/include/asm-arm/arch-ixp4xx/io.h | |||
@@ -260,6 +260,12 @@ out: | |||
260 | 260 | ||
261 | #endif | 261 | #endif |
262 | 262 | ||
263 | #ifndef CONFIG_PCI | ||
264 | |||
265 | #define __io(v) v | ||
266 | |||
267 | #else | ||
268 | |||
263 | /* | 269 | /* |
264 | * IXP4xx does not have a transparent cpu -> PCI I/O translation | 270 | * IXP4xx does not have a transparent cpu -> PCI I/O translation |
265 | * window. Instead, it has a set of registers that must be tweaked | 271 | * window. Instead, it has a set of registers that must be tweaked |
@@ -578,6 +584,7 @@ __ixp4xx_iowrite32_rep(void __iomem *addr, const void *vaddr, u32 count) | |||
578 | 584 | ||
579 | #define ioport_map(port, nr) ((void __iomem*)(port + PIO_OFFSET)) | 585 | #define ioport_map(port, nr) ((void __iomem*)(port + PIO_OFFSET)) |
580 | #define ioport_unmap(addr) | 586 | #define ioport_unmap(addr) |
587 | #endif // !CONFIG_PCI | ||
581 | 588 | ||
582 | #endif // __ASM_ARM_ARCH_IO_H | 589 | #endif // __ASM_ARM_ARCH_IO_H |
583 | 590 | ||
diff --git a/include/asm-arm/arch-ixp4xx/memory.h b/include/asm-arm/arch-ixp4xx/memory.h index ee211d28a3..af9667b57a 100644 --- a/include/asm-arm/arch-ixp4xx/memory.h +++ b/include/asm-arm/arch-ixp4xx/memory.h | |||
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | #define PHYS_OFFSET UL(0x00000000) | 15 | #define PHYS_OFFSET UL(0x00000000) |
16 | 16 | ||
17 | #ifndef __ASSEMBLY__ | 17 | #if !defined(__ASSEMBLY__) && defined(CONFIG_PCI) |
18 | 18 | ||
19 | void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes); | 19 | void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes); |
20 | 20 | ||
diff --git a/include/asm-arm/arch-l7200/hardware.h b/include/asm-arm/arch-l7200/hardware.h index b755079bef..2ab43f3a4a 100644 --- a/include/asm-arm/arch-l7200/hardware.h +++ b/include/asm-arm/arch-l7200/hardware.h | |||
@@ -52,9 +52,6 @@ | |||
52 | #define ISA_SIZE 0x20000000 | 52 | #define ISA_SIZE 0x20000000 |
53 | #define ISA_BASE 0xe0000000 | 53 | #define ISA_BASE 0xe0000000 |
54 | 54 | ||
55 | #define FLUSH_BASE_PHYS 0x40000000 /* ROM */ | ||
56 | #define FLUSH_BASE 0xdf000000 | ||
57 | |||
58 | #define PCIO_BASE IO_BASE | 55 | #define PCIO_BASE IO_BASE |
59 | 56 | ||
60 | #endif | 57 | #endif |
diff --git a/include/asm-arm/arch-l7200/memory.h b/include/asm-arm/arch-l7200/memory.h index 9e50a171f7..402df637e7 100644 --- a/include/asm-arm/arch-l7200/memory.h +++ b/include/asm-arm/arch-l7200/memory.h | |||
@@ -20,4 +20,10 @@ | |||
20 | #define __virt_to_bus(x) __virt_to_phys(x) | 20 | #define __virt_to_bus(x) __virt_to_phys(x) |
21 | #define __bus_to_virt(x) __phys_to_virt(x) | 21 | #define __bus_to_virt(x) __phys_to_virt(x) |
22 | 22 | ||
23 | /* | ||
24 | * Cache flushing area - ROM | ||
25 | */ | ||
26 | #define FLUSH_BASE_PHYS 0x40000000 | ||
27 | #define FLUSH_BASE 0xdf000000 | ||
28 | |||
23 | #endif | 29 | #endif |
diff --git a/include/asm-arm/arch-l7200/serial_l7200.h b/include/asm-arm/arch-l7200/serial_l7200.h index 238c595d97..b1008a9d23 100644 --- a/include/asm-arm/arch-l7200/serial_l7200.h +++ b/include/asm-arm/arch-l7200/serial_l7200.h | |||
@@ -28,7 +28,7 @@ | |||
28 | #define UARTDR 0x00 /* Tx/Rx data */ | 28 | #define UARTDR 0x00 /* Tx/Rx data */ |
29 | #define RXSTAT 0x04 /* Rx status */ | 29 | #define RXSTAT 0x04 /* Rx status */ |
30 | #define H_UBRLCR 0x08 /* mode register high */ | 30 | #define H_UBRLCR 0x08 /* mode register high */ |
31 | #define M_UBRLCR 0x0C /* mode reg mid (MSB of buad)*/ | 31 | #define M_UBRLCR 0x0C /* mode reg mid (MSB of baud)*/ |
32 | #define L_UBRLCR 0x10 /* mode reg low (LSB of baud)*/ | 32 | #define L_UBRLCR 0x10 /* mode reg low (LSB of baud)*/ |
33 | #define UARTCON 0x14 /* control register */ | 33 | #define UARTCON 0x14 /* control register */ |
34 | #define UARTFLG 0x18 /* flag register */ | 34 | #define UARTFLG 0x18 /* flag register */ |
diff --git a/include/asm-arm/arch-l7200/uncompress.h b/include/asm-arm/arch-l7200/uncompress.h index 9fcd40aee3..04be2a0886 100644 --- a/include/asm-arm/arch-l7200/uncompress.h +++ b/include/asm-arm/arch-l7200/uncompress.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * Changelog: | 6 | * Changelog: |
7 | * 05-01-2000 SJH Created | 7 | * 05-01-2000 SJH Created |
8 | * 05-13-2000 SJH Filled in function bodies | 8 | * 05-13-2000 SJH Filled in function bodies |
9 | * 07-26-2000 SJH Removed hard coded buad rate | 9 | * 07-26-2000 SJH Removed hard coded baud rate |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <asm/hardware.h> | 12 | #include <asm/hardware.h> |
diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h index c92bcb8376..9f1a58cbf4 100644 --- a/include/asm-arm/arch-lh7a40x/memory.h +++ b/include/asm-arm/arch-lh7a40x/memory.h | |||
@@ -31,8 +31,6 @@ | |||
31 | 31 | ||
32 | #ifdef CONFIG_DISCONTIGMEM | 32 | #ifdef CONFIG_DISCONTIGMEM |
33 | 33 | ||
34 | #define NODES_SHIFT 4 /* Up to 16 nodes */ | ||
35 | |||
36 | /* | 34 | /* |
37 | * Given a kernel address, find the home node of the underlying memory. | 35 | * Given a kernel address, find the home node of the underlying memory. |
38 | */ | 36 | */ |
diff --git a/include/asm-arm/arch-omap/aic23.h b/include/asm-arm/arch-omap/aic23.h index 590bac25b7..6513065941 100644 --- a/include/asm-arm/arch-omap/aic23.h +++ b/include/asm-arm/arch-omap/aic23.h | |||
@@ -57,6 +57,7 @@ | |||
57 | #define LHV_MIN 0x0000 | 57 | #define LHV_MIN 0x0000 |
58 | 58 | ||
59 | // Analog audio path control register | 59 | // Analog audio path control register |
60 | #define STA_REG(x) ((x)<<6) | ||
60 | #define STE_ENABLED 0x0020 | 61 | #define STE_ENABLED 0x0020 |
61 | #define DAC_SELECTED 0x0010 | 62 | #define DAC_SELECTED 0x0010 |
62 | #define BYPASS_ON 0x0008 | 63 | #define BYPASS_ON 0x0008 |
@@ -109,4 +110,7 @@ | |||
109 | #define TLV320AIC23ID1 (0x1a) // cs low | 110 | #define TLV320AIC23ID1 (0x1a) // cs low |
110 | #define TLV320AIC23ID2 (0x1b) // cs high | 111 | #define TLV320AIC23ID2 (0x1b) // cs high |
111 | 112 | ||
113 | void tlv320aic23_power_up(void); | ||
114 | void tlv320aic23_power_down(void); | ||
115 | |||
112 | #endif /* __ASM_ARCH_AIC23_H */ | 116 | #endif /* __ASM_ARCH_AIC23_H */ |
diff --git a/include/asm-arm/arch-omap/board-ams-delta.h b/include/asm-arm/arch-omap/board-ams-delta.h new file mode 100644 index 0000000000..0070f6d3b7 --- /dev/null +++ b/include/asm-arm/arch-omap/board-ams-delta.h | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/board-ams-delta.h | ||
3 | * | ||
4 | * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | * | ||
11 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
12 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
13 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
14 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
15 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
16 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
17 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
18 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
19 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
20 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License along | ||
23 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
24 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
25 | */ | ||
26 | #ifndef __ASM_ARCH_OMAP_AMS_DELTA_H | ||
27 | #define __ASM_ARCH_OMAP_AMS_DELTA_H | ||
28 | |||
29 | #if defined (CONFIG_MACH_AMS_DELTA) | ||
30 | |||
31 | #define AMS_DELTA_LATCH1_PHYS 0x01000000 | ||
32 | #define AMS_DELTA_LATCH1_VIRT 0xEA000000 | ||
33 | #define AMS_DELTA_MODEM_PHYS 0x04000000 | ||
34 | #define AMS_DELTA_MODEM_VIRT 0xEB000000 | ||
35 | #define AMS_DELTA_LATCH2_PHYS 0x08000000 | ||
36 | #define AMS_DELTA_LATCH2_VIRT 0xEC000000 | ||
37 | |||
38 | #define AMS_DELTA_LATCH1_LED_CAMERA 0x01 | ||
39 | #define AMS_DELTA_LATCH1_LED_ADVERT 0x02 | ||
40 | #define AMS_DELTA_LATCH1_LED_EMAIL 0x04 | ||
41 | #define AMS_DELTA_LATCH1_LED_HANDSFREE 0x08 | ||
42 | #define AMS_DELTA_LATCH1_LED_VOICEMAIL 0x10 | ||
43 | #define AMS_DELTA_LATCH1_LED_VOICE 0x20 | ||
44 | |||
45 | #define AMS_DELTA_LATCH2_LCD_VBLEN 0x0001 | ||
46 | #define AMS_DELTA_LATCH2_LCD_NDISP 0x0002 | ||
47 | #define AMS_DELTA_LATCH2_NAND_NCE 0x0004 | ||
48 | #define AMS_DELTA_LATCH2_NAND_NRE 0x0008 | ||
49 | #define AMS_DELTA_LATCH2_NAND_NWP 0x0010 | ||
50 | #define AMS_DELTA_LATCH2_NAND_NWE 0x0020 | ||
51 | #define AMS_DELTA_LATCH2_NAND_ALE 0x0040 | ||
52 | #define AMS_DELTA_LATCH2_NAND_CLE 0x0080 | ||
53 | #define AMS_DELTA_LATCH2_MODEM_NRESET 0x1000 | ||
54 | #define AMS_DELTA_LATCH2_MODEM_CODEC 0x2000 | ||
55 | |||
56 | #define AMS_DELTA_GPIO_PIN_NAND_RB 12 | ||
57 | |||
58 | #ifndef __ASSEMBLY__ | ||
59 | void ams_delta_latch1_write(u8 mask, u8 value); | ||
60 | void ams_delta_latch2_write(u16 mask, u16 value); | ||
61 | #endif | ||
62 | |||
63 | #endif /* CONFIG_MACH_AMS_DELTA */ | ||
64 | |||
65 | #endif /* __ASM_ARCH_OMAP_AMS_DELTA_H */ | ||
diff --git a/include/asm-arm/arch-omap/board-apollon.h b/include/asm-arm/arch-omap/board-apollon.h new file mode 100644 index 0000000000..de0c5b792c --- /dev/null +++ b/include/asm-arm/arch-omap/board-apollon.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/board-apollon.h | ||
3 | * | ||
4 | * Hardware definitions for Samsung OMAP24XX Apollon board. | ||
5 | * | ||
6 | * Initial creation by Kyungmin Park <kyungmin.park@samsung.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
14 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
15 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
16 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
19 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
20 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
23 | * | ||
24 | * You should have received a copy of the GNU General Public License along | ||
25 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
26 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | |||
29 | #ifndef __ASM_ARCH_OMAP_APOLLON_H | ||
30 | #define __ASM_ARCH_OMAP_APOLLON_H | ||
31 | |||
32 | /* Placeholder for APOLLON specific defines */ | ||
33 | /* GPMC CS0 */ | ||
34 | #define APOLLON_CS0_BASE 0x00000000 | ||
35 | /* GPMC CS1 */ | ||
36 | #define APOLLON_CS1_BASE 0x08000000 | ||
37 | #define APOLLON_ETHR_START (APOLLON_CS1_BASE + 0x300) | ||
38 | #define APOLLON_ETHR_GPIO_IRQ 74 | ||
39 | /* GPMC CS2 - reserved for OneNAND */ | ||
40 | #define APOLLON_CS2_BASE 0x10000000 | ||
41 | /* GPMC CS3 - reserved for NOR or NAND */ | ||
42 | #define APOLLON_CS3_BASE 0x18000000 | ||
43 | |||
44 | #endif /* __ASM_ARCH_OMAP_APOLLON_H */ | ||
45 | |||
diff --git a/include/asm-arm/arch-omap/board-h2.h b/include/asm-arm/arch-omap/board-h2.h index 39ca5a31ae..b2888ef9e9 100644 --- a/include/asm-arm/arch-omap/board-h2.h +++ b/include/asm-arm/arch-omap/board-h2.h | |||
@@ -34,9 +34,5 @@ | |||
34 | /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ | 34 | /* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ |
35 | #define OMAP1610_ETHR_START 0x04000300 | 35 | #define OMAP1610_ETHR_START 0x04000300 |
36 | 36 | ||
37 | /* Samsung NAND flash at CS2B or CS3(NAND Boot) */ | ||
38 | #define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ | ||
39 | #define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ | ||
40 | |||
41 | #endif /* __ASM_ARCH_OMAP_H2_H */ | 37 | #endif /* __ASM_ARCH_OMAP_H2_H */ |
42 | 38 | ||
diff --git a/include/asm-arm/arch-omap/board-h3.h b/include/asm-arm/arch-omap/board-h3.h index 1b12c1dcc2..761ea0a178 100644 --- a/include/asm-arm/arch-omap/board-h3.h +++ b/include/asm-arm/arch-omap/board-h3.h | |||
@@ -30,10 +30,6 @@ | |||
30 | /* In OMAP1710 H3 the Ethernet is directly connected to CS1 */ | 30 | /* In OMAP1710 H3 the Ethernet is directly connected to CS1 */ |
31 | #define OMAP1710_ETHR_START 0x04000300 | 31 | #define OMAP1710_ETHR_START 0x04000300 |
32 | 32 | ||
33 | /* Samsung NAND flash at CS2B or CS3(NAND Boot) */ | ||
34 | #define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ | ||
35 | #define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ | ||
36 | |||
37 | #define MAXIRQNUM (IH_BOARD_BASE) | 33 | #define MAXIRQNUM (IH_BOARD_BASE) |
38 | #define MAXFIQNUM MAXIRQNUM | 34 | #define MAXFIQNUM MAXIRQNUM |
39 | #define MAXSWINUM MAXIRQNUM | 35 | #define MAXSWINUM MAXIRQNUM |
diff --git a/include/asm-arm/arch-omap/board-h4.h b/include/asm-arm/arch-omap/board-h4.h index 33ea29a416..7ef664bc9e 100644 --- a/include/asm-arm/arch-omap/board-h4.h +++ b/include/asm-arm/arch-omap/board-h4.h | |||
@@ -33,12 +33,6 @@ | |||
33 | /* GPMC CS1 */ | 33 | /* GPMC CS1 */ |
34 | #define OMAP24XX_ETHR_START 0x08000300 | 34 | #define OMAP24XX_ETHR_START 0x08000300 |
35 | #define OMAP24XX_ETHR_GPIO_IRQ 92 | 35 | #define OMAP24XX_ETHR_GPIO_IRQ 92 |
36 | 36 | #define H4_CS0_BASE 0x04000000 | |
37 | #define H4_CS0_BASE 0x04000000 | ||
38 | |||
39 | #define H4_CS0_BASE 0x04000000 | ||
40 | |||
41 | #define H4_CS0_BASE 0x04000000 | ||
42 | |||
43 | #endif /* __ASM_ARCH_OMAP_H4_H */ | 37 | #endif /* __ASM_ARCH_OMAP_H4_H */ |
44 | 38 | ||
diff --git a/include/asm-arm/arch-omap/board-netstar.h b/include/asm-arm/arch-omap/board-netstar.h deleted file mode 100644 index 77cc0fb54d..0000000000 --- a/include/asm-arm/arch-omap/board-netstar.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 2N Telekomunikace, Ladislav Michl <michl@2n.cz> | ||
3 | * | ||
4 | * Hardware definitions for OMAP5910 based NetStar board. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_ARCH_NETSTAR_H | ||
12 | #define __ASM_ARCH_NETSTAR_H | ||
13 | |||
14 | #include <asm/arch/tc.h> | ||
15 | |||
16 | #define OMAP_NAND_FLASH_START1 OMAP_CS1_PHYS + (1 << 23) | ||
17 | #define OMAP_NAND_FLASH_START2 OMAP_CS1_PHYS + (2 << 23) | ||
18 | |||
19 | #endif /* __ASM_ARCH_NETSTAR_H */ | ||
diff --git a/include/asm-arm/arch-omap/board-nokia.h b/include/asm-arm/arch-omap/board-nokia.h new file mode 100644 index 0000000000..72deea2034 --- /dev/null +++ b/include/asm-arm/arch-omap/board-nokia.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/board-nokia.h | ||
3 | * | ||
4 | * Information structures for Nokia-specific board config data | ||
5 | * | ||
6 | * Copyright (C) 2005 Nokia Corporation | ||
7 | */ | ||
8 | |||
9 | #ifndef _OMAP_BOARD_NOKIA_H | ||
10 | #define _OMAP_BOARD_NOKIA_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | #define OMAP_TAG_NOKIA_BT 0x4e01 | ||
15 | #define OMAP_TAG_WLAN_CX3110X 0x4e02 | ||
16 | #define OMAP_TAG_CBUS 0x4e03 | ||
17 | #define OMAP_TAG_EM_ASIC_BB5 0x4e04 | ||
18 | |||
19 | |||
20 | #define BT_CHIP_CSR 1 | ||
21 | #define BT_CHIP_TI 2 | ||
22 | |||
23 | #define BT_SYSCLK_12 1 | ||
24 | #define BT_SYSCLK_38_4 2 | ||
25 | |||
26 | struct omap_bluetooth_config { | ||
27 | u8 chip_type; | ||
28 | u8 bt_wakeup_gpio; | ||
29 | u8 host_wakeup_gpio; | ||
30 | u8 reset_gpio; | ||
31 | u8 bt_uart; | ||
32 | u8 bd_addr[6]; | ||
33 | u8 bt_sysclk; | ||
34 | }; | ||
35 | |||
36 | struct omap_wlan_cx3110x_config { | ||
37 | u8 chip_type; | ||
38 | s16 power_gpio; | ||
39 | s16 irq_gpio; | ||
40 | s16 spi_cs_gpio; | ||
41 | }; | ||
42 | |||
43 | struct omap_cbus_config { | ||
44 | s16 clk_gpio; | ||
45 | s16 dat_gpio; | ||
46 | s16 sel_gpio; | ||
47 | }; | ||
48 | |||
49 | struct omap_em_asic_bb5_config { | ||
50 | s16 retu_irq_gpio; | ||
51 | s16 tahvo_irq_gpio; | ||
52 | }; | ||
53 | |||
54 | #endif | ||
diff --git a/include/asm-arm/arch-omap/board-perseus2.h b/include/asm-arm/arch-omap/board-perseus2.h index 691e52a52b..eb74420cb4 100644 --- a/include/asm-arm/arch-omap/board-perseus2.h +++ b/include/asm-arm/arch-omap/board-perseus2.h | |||
@@ -42,8 +42,4 @@ | |||
42 | 42 | ||
43 | #define NR_IRQS (MAXIRQNUM + 1) | 43 | #define NR_IRQS (MAXIRQNUM + 1) |
44 | 44 | ||
45 | /* Samsung NAND flash at CS2B or CS3(NAND Boot) */ | ||
46 | #define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ | ||
47 | #define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ | ||
48 | |||
49 | #endif | 45 | #endif |
diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h index a0040cd866..6d6240a468 100644 --- a/include/asm-arm/arch-omap/board.h +++ b/include/asm-arm/arch-omap/board.h | |||
@@ -21,9 +21,12 @@ | |||
21 | #define OMAP_TAG_LCD 0x4f05 | 21 | #define OMAP_TAG_LCD 0x4f05 |
22 | #define OMAP_TAG_GPIO_SWITCH 0x4f06 | 22 | #define OMAP_TAG_GPIO_SWITCH 0x4f06 |
23 | #define OMAP_TAG_UART 0x4f07 | 23 | #define OMAP_TAG_UART 0x4f07 |
24 | #define OMAP_TAG_FBMEM 0x4f08 | ||
25 | #define OMAP_TAG_STI_CONSOLE 0x4f09 | ||
24 | 26 | ||
25 | #define OMAP_TAG_BOOT_REASON 0x4f80 | 27 | #define OMAP_TAG_BOOT_REASON 0x4f80 |
26 | #define OMAP_TAG_FLASH_PART 0x4f81 | 28 | #define OMAP_TAG_FLASH_PART 0x4f81 |
29 | #define OMAP_TAG_VERSION_STR 0x4f82 | ||
27 | 30 | ||
28 | struct omap_clock_config { | 31 | struct omap_clock_config { |
29 | /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */ | 32 | /* 0 for 12 MHz, 1 for 13 MHz and 2 for 19.2 MHz */ |
@@ -54,6 +57,11 @@ struct omap_serial_console_config { | |||
54 | u32 console_speed; | 57 | u32 console_speed; |
55 | }; | 58 | }; |
56 | 59 | ||
60 | struct omap_sti_console_config { | ||
61 | unsigned enable:1; | ||
62 | u8 channel; | ||
63 | }; | ||
64 | |||
57 | struct omap_usb_config { | 65 | struct omap_usb_config { |
58 | /* Configure drivers according to the connectors on your board: | 66 | /* Configure drivers according to the connectors on your board: |
59 | * - "A" connector (rectagular) | 67 | * - "A" connector (rectagular) |
@@ -87,6 +95,13 @@ struct omap_lcd_config { | |||
87 | char ctrl_name[16]; | 95 | char ctrl_name[16]; |
88 | }; | 96 | }; |
89 | 97 | ||
98 | struct omap_fbmem_config { | ||
99 | u32 fb_sram_start; | ||
100 | u32 fb_sram_size; | ||
101 | u32 fb_sdram_start; | ||
102 | u32 fb_sdram_size; | ||
103 | }; | ||
104 | |||
90 | /* Cover: | 105 | /* Cover: |
91 | * high -> closed | 106 | * high -> closed |
92 | * low -> open | 107 | * low -> open |
@@ -106,6 +121,12 @@ struct omap_gpio_switch_config { | |||
106 | int key_code:24; /* Linux key code */ | 121 | int key_code:24; /* Linux key code */ |
107 | }; | 122 | }; |
108 | 123 | ||
124 | struct omap_uart_config { | ||
125 | /* Bit field of UARTs present; bit 0 --> UART1 */ | ||
126 | unsigned int enabled_uarts; | ||
127 | }; | ||
128 | |||
129 | |||
109 | struct omap_flash_part_config { | 130 | struct omap_flash_part_config { |
110 | char part_table[0]; | 131 | char part_table[0]; |
111 | }; | 132 | }; |
@@ -114,11 +135,14 @@ struct omap_boot_reason_config { | |||
114 | char reason_str[12]; | 135 | char reason_str[12]; |
115 | }; | 136 | }; |
116 | 137 | ||
117 | struct omap_uart_config { | 138 | struct omap_version_config { |
118 | /* Bit field of UARTs present; bit 0 --> UART1 */ | 139 | char component[12]; |
119 | unsigned int enabled_uarts; | 140 | char version[12]; |
120 | }; | 141 | }; |
121 | 142 | ||
143 | |||
144 | #include <asm-arm/arch-omap/board-nokia.h> | ||
145 | |||
122 | struct omap_board_config_entry { | 146 | struct omap_board_config_entry { |
123 | u16 tag; | 147 | u16 tag; |
124 | u16 len; | 148 | u16 len; |
diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h index 46a0402696..3c4eb9fbe4 100644 --- a/include/asm-arm/arch-omap/clock.h +++ b/include/asm-arm/arch-omap/clock.h | |||
@@ -19,6 +19,7 @@ struct clk { | |||
19 | struct list_head node; | 19 | struct list_head node; |
20 | struct module *owner; | 20 | struct module *owner; |
21 | const char *name; | 21 | const char *name; |
22 | int id; | ||
22 | struct clk *parent; | 23 | struct clk *parent; |
23 | unsigned long rate; | 24 | unsigned long rate; |
24 | __u32 flags; | 25 | __u32 flags; |
@@ -57,6 +58,7 @@ extern void propagate_rate(struct clk *clk); | |||
57 | extern void followparent_recalc(struct clk * clk); | 58 | extern void followparent_recalc(struct clk * clk); |
58 | extern void clk_allow_idle(struct clk *clk); | 59 | extern void clk_allow_idle(struct clk *clk); |
59 | extern void clk_deny_idle(struct clk *clk); | 60 | extern void clk_deny_idle(struct clk *clk); |
61 | extern int clk_get_usecount(struct clk *clk); | ||
60 | 62 | ||
61 | /* Clock flags */ | 63 | /* Clock flags */ |
62 | #define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ | 64 | #define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ |
@@ -80,10 +82,11 @@ extern void clk_deny_idle(struct clk *clk); | |||
80 | #define CM_PLL_SEL1 (1 << 18) | 82 | #define CM_PLL_SEL1 (1 << 18) |
81 | #define CM_PLL_SEL2 (1 << 19) | 83 | #define CM_PLL_SEL2 (1 << 19) |
82 | #define CM_SYSCLKOUT_SEL1 (1 << 20) | 84 | #define CM_SYSCLKOUT_SEL1 (1 << 20) |
83 | #define CLOCK_IN_OMAP730 (1 << 21) | 85 | #define CLOCK_IN_OMAP310 (1 << 21) |
84 | #define CLOCK_IN_OMAP1510 (1 << 22) | 86 | #define CLOCK_IN_OMAP730 (1 << 22) |
85 | #define CLOCK_IN_OMAP16XX (1 << 23) | 87 | #define CLOCK_IN_OMAP1510 (1 << 23) |
86 | #define CLOCK_IN_OMAP242X (1 << 24) | 88 | #define CLOCK_IN_OMAP16XX (1 << 24) |
87 | #define CLOCK_IN_OMAP243X (1 << 25) | 89 | #define CLOCK_IN_OMAP242X (1 << 25) |
90 | #define CLOCK_IN_OMAP243X (1 << 26) | ||
88 | 91 | ||
89 | #endif | 92 | #endif |
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h index d4e73efcb8..ca1202312a 100644 --- a/include/asm-arm/arch-omap/dma.h +++ b/include/asm-arm/arch-omap/dma.h | |||
@@ -404,6 +404,7 @@ extern void omap_free_lcd_dma(void); | |||
404 | extern void omap_setup_lcd_dma(void); | 404 | extern void omap_setup_lcd_dma(void); |
405 | extern void omap_enable_lcd_dma(void); | 405 | extern void omap_enable_lcd_dma(void); |
406 | extern void omap_stop_lcd_dma(void); | 406 | extern void omap_stop_lcd_dma(void); |
407 | extern int omap_lcd_dma_ext_running(void); | ||
407 | extern void omap_set_lcd_dma_ext_controller(int external); | 408 | extern void omap_set_lcd_dma_ext_controller(int external); |
408 | extern void omap_set_lcd_dma_single_transfer(int single); | 409 | extern void omap_set_lcd_dma_single_transfer(int single); |
409 | extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres, | 410 | extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres, |
diff --git a/include/asm-arm/arch-omap/dmtimer.h b/include/asm-arm/arch-omap/dmtimer.h index 11772c792f..e6522e6a38 100644 --- a/include/asm-arm/arch-omap/dmtimer.h +++ b/include/asm-arm/arch-omap/dmtimer.h | |||
@@ -88,5 +88,6 @@ unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer); | |||
88 | void omap_dm_timer_reset_counter(struct omap_dm_timer *timer); | 88 | void omap_dm_timer_reset_counter(struct omap_dm_timer *timer); |
89 | 89 | ||
90 | int omap_dm_timers_active(void); | 90 | int omap_dm_timers_active(void); |
91 | u32 omap_dm_timer_modify_idlect_mask(u32 inputmask); | ||
91 | 92 | ||
92 | #endif /* __ASM_ARCH_TIMER_H */ | 93 | #endif /* __ASM_ARCH_TIMER_H */ |
diff --git a/include/asm-arm/arch-omap/dsp.h b/include/asm-arm/arch-omap/dsp.h index 57bf4f39ca..06dad83dd4 100644 --- a/include/asm-arm/arch-omap/dsp.h +++ b/include/asm-arm/arch-omap/dsp.h | |||
@@ -181,10 +181,16 @@ struct omap_dsp_varinfo { | |||
181 | #define OMAP_DSP_MBCMD_PM_ENABLE 0x01 | 181 | #define OMAP_DSP_MBCMD_PM_ENABLE 0x01 |
182 | 182 | ||
183 | #define OMAP_DSP_MBCMD_KFUNC_FBCTL 0x00 | 183 | #define OMAP_DSP_MBCMD_KFUNC_FBCTL 0x00 |
184 | #define OMAP_DSP_MBCMD_KFUNC_AUDIO_PWR 0x01 | ||
184 | 185 | ||
186 | #define OMAP_DSP_MBCMD_FBCTL_UPD 0x0000 | ||
185 | #define OMAP_DSP_MBCMD_FBCTL_ENABLE 0x0002 | 187 | #define OMAP_DSP_MBCMD_FBCTL_ENABLE 0x0002 |
186 | #define OMAP_DSP_MBCMD_FBCTL_DISABLE 0x0003 | 188 | #define OMAP_DSP_MBCMD_FBCTL_DISABLE 0x0003 |
187 | 189 | ||
190 | #define OMAP_DSP_MBCMD_AUDIO_PWR_UP 0x0000 | ||
191 | #define OMAP_DSP_MBCMD_AUDIO_PWR_DOWN1 0x0001 | ||
192 | #define OMAP_DSP_MBCMD_AUDIO_PWR_DOWN2 0x0002 | ||
193 | |||
188 | #define OMAP_DSP_MBCMD_TDEL_SAFE 0x0000 | 194 | #define OMAP_DSP_MBCMD_TDEL_SAFE 0x0000 |
189 | #define OMAP_DSP_MBCMD_TDEL_KILL 0x0001 | 195 | #define OMAP_DSP_MBCMD_TDEL_KILL 0x0001 |
190 | 196 | ||
diff --git a/include/asm-arm/arch-omap/dsp_common.h b/include/asm-arm/arch-omap/dsp_common.h index 4fcce69440..16a459dfa7 100644 --- a/include/asm-arm/arch-omap/dsp_common.h +++ b/include/asm-arm/arch-omap/dsp_common.h | |||
@@ -27,11 +27,12 @@ | |||
27 | #ifndef ASM_ARCH_DSP_COMMON_H | 27 | #ifndef ASM_ARCH_DSP_COMMON_H |
28 | #define ASM_ARCH_DSP_COMMON_H | 28 | #define ASM_ARCH_DSP_COMMON_H |
29 | 29 | ||
30 | void omap_dsp_pm_suspend(void); | 30 | extern void omap_dsp_request_mpui(void); |
31 | void omap_dsp_pm_resume(void); | 31 | extern void omap_dsp_release_mpui(void); |
32 | void omap_dsp_request_mpui(void); | 32 | extern int omap_dsp_request_mem(void); |
33 | void omap_dsp_release_mpui(void); | 33 | extern int omap_dsp_release_mem(void); |
34 | int omap_dsp_request_mem(void); | 34 | |
35 | int omap_dsp_release_mem(void); | 35 | extern void (*omap_dsp_audio_pwr_up_request)(int stage); |
36 | extern void (*omap_dsp_audio_pwr_down_request)(int stage); | ||
36 | 37 | ||
37 | #endif /* ASM_ARCH_DSP_COMMON_H */ | 38 | #endif /* ASM_ARCH_DSP_COMMON_H */ |
diff --git a/include/asm-arm/arch-omap/gpioexpander.h b/include/asm-arm/arch-omap/gpioexpander.h new file mode 100644 index 0000000000..7a43b0a912 --- /dev/null +++ b/include/asm-arm/arch-omap/gpioexpander.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/gpioexpander.h | ||
3 | * | ||
4 | * | ||
5 | * Copyright (C) 2004 Texas Instruments, Inc. | ||
6 | * | ||
7 | * This package is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | ||
12 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | ||
13 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_OMAP_GPIOEXPANDER_H | ||
17 | #define __ASM_ARCH_OMAP_GPIOEXPANDER_H | ||
18 | |||
19 | /* Function Prototypes for GPIO Expander functions */ | ||
20 | |||
21 | int read_gpio_expa(u8 *, int); | ||
22 | int write_gpio_expa(u8 , int); | ||
23 | |||
24 | #endif /* __ASM_ARCH_OMAP_GPIOEXPANDER_H */ | ||
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h index 5406b875c4..7909b72982 100644 --- a/include/asm-arm/arch-omap/hardware.h +++ b/include/asm-arm/arch-omap/hardware.h | |||
@@ -306,6 +306,10 @@ | |||
306 | #include "board-h4.h" | 306 | #include "board-h4.h" |
307 | #endif | 307 | #endif |
308 | 308 | ||
309 | #ifdef CONFIG_MACH_OMAP_APOLLON | ||
310 | #include "board-apollon.h" | ||
311 | #endif | ||
312 | |||
309 | #ifdef CONFIG_MACH_OMAP_OSK | 313 | #ifdef CONFIG_MACH_OMAP_OSK |
310 | #include "board-osk.h" | 314 | #include "board-osk.h" |
311 | #endif | 315 | #endif |
@@ -314,10 +318,6 @@ | |||
314 | #include "board-voiceblue.h" | 318 | #include "board-voiceblue.h" |
315 | #endif | 319 | #endif |
316 | 320 | ||
317 | #ifdef CONFIG_MACH_NETSTAR | ||
318 | #include "board-netstar.h" | ||
319 | #endif | ||
320 | |||
321 | #endif /* !__ASSEMBLER__ */ | 321 | #endif /* !__ASSEMBLER__ */ |
322 | 322 | ||
323 | #endif /* __ASM_ARCH_OMAP_HARDWARE_H */ | 323 | #endif /* __ASM_ARCH_OMAP_HARDWARE_H */ |
diff --git a/include/asm-arm/arch-omap/irda.h b/include/asm-arm/arch-omap/irda.h new file mode 100644 index 0000000000..805ae3575e --- /dev/null +++ b/include/asm-arm/arch-omap/irda.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/irda.h | ||
3 | * | ||
4 | * Copyright (C) 2005-2006 Komal Shah <komal_shah802003@yahoo.com> | ||
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_ARCH_IRDA_H | ||
11 | #define ASMARM_ARCH_IRDA_H | ||
12 | |||
13 | /* board specific transceiver capabilities */ | ||
14 | |||
15 | #define IR_SEL 1 /* Selects IrDA */ | ||
16 | #define IR_SIRMODE 2 | ||
17 | #define IR_FIRMODE 4 | ||
18 | #define IR_MIRMODE 8 | ||
19 | |||
20 | struct omap_irda_config { | ||
21 | int transceiver_cap; | ||
22 | int (*transceiver_mode)(struct device *dev, int mode); | ||
23 | int (*select_irda)(struct device *dev, int state); | ||
24 | /* Very specific to the needs of some platforms (h3,h4) | ||
25 | * having calls which can sleep in irda_set_speed. | ||
26 | */ | ||
27 | struct work_struct gpio_expa; | ||
28 | int rx_channel; | ||
29 | int tx_channel; | ||
30 | unsigned long dest_start; | ||
31 | unsigned long src_start; | ||
32 | int tx_trigger; | ||
33 | int rx_trigger; | ||
34 | }; | ||
35 | |||
36 | #endif | ||
diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h index 4ffce1d777..42098d99f3 100644 --- a/include/asm-arm/arch-omap/irqs.h +++ b/include/asm-arm/arch-omap/irqs.h | |||
@@ -242,6 +242,11 @@ | |||
242 | #define INT_24XX_GPIO_BANK2 30 | 242 | #define INT_24XX_GPIO_BANK2 30 |
243 | #define INT_24XX_GPIO_BANK3 31 | 243 | #define INT_24XX_GPIO_BANK3 31 |
244 | #define INT_24XX_GPIO_BANK4 32 | 244 | #define INT_24XX_GPIO_BANK4 32 |
245 | #define INT_24XX_MCBSP1_IRQ_TX 59 | ||
246 | #define INT_24XX_MCBSP1_IRQ_RX 60 | ||
247 | #define INT_24XX_MCBSP2_IRQ_TX 62 | ||
248 | #define INT_24XX_MCBSP2_IRQ_RX 63 | ||
249 | #define INT_24XX_UART3_IRQ 74 | ||
245 | 250 | ||
246 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and | 251 | /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and |
247 | * 16 MPUIO lines */ | 252 | * 16 MPUIO lines */ |
diff --git a/include/asm-arm/arch-omap/keypad.h b/include/asm-arm/arch-omap/keypad.h new file mode 100644 index 0000000000..8a023a984a --- /dev/null +++ b/include/asm-arm/arch-omap/keypad.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/keypad.h | ||
3 | * | ||
4 | * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> | ||
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_ARCH_KEYPAD_H | ||
11 | #define ASMARM_ARCH_KEYPAD_H | ||
12 | |||
13 | struct omap_kp_platform_data { | ||
14 | int rows; | ||
15 | int cols; | ||
16 | int *keymap; | ||
17 | unsigned int rep:1; | ||
18 | /* specific to OMAP242x*/ | ||
19 | unsigned int *row_gpios; | ||
20 | unsigned int *col_gpios; | ||
21 | }; | ||
22 | |||
23 | /* Group (0..3) -- when multiple keys are pressed, only the | ||
24 | * keys pressed in the same group are considered as pressed. This is | ||
25 | * in order to workaround certain crappy HW designs that produce ghost | ||
26 | * keypresses. */ | ||
27 | #define GROUP_0 (0 << 16) | ||
28 | #define GROUP_1 (1 << 16) | ||
29 | #define GROUP_2 (2 << 16) | ||
30 | #define GROUP_3 (3 << 16) | ||
31 | #define GROUP_MASK GROUP_3 | ||
32 | |||
33 | #define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val)) | ||
34 | |||
35 | #endif | ||
36 | |||
diff --git a/include/asm-arm/arch-omap/lcd_lph8923.h b/include/asm-arm/arch-omap/lcd_lph8923.h new file mode 100644 index 0000000000..004e67e22c --- /dev/null +++ b/include/asm-arm/arch-omap/lcd_lph8923.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef __LCD_LPH8923_H | ||
2 | #define __LCD_LPH8923_H | ||
3 | |||
4 | enum lcd_lph8923_test_num { | ||
5 | LCD_LPH8923_TEST_RGB_LINES, | ||
6 | }; | ||
7 | |||
8 | enum lcd_lph8923_test_result { | ||
9 | LCD_LPH8923_TEST_SUCCESS, | ||
10 | LCD_LPH8923_TEST_INVALID, | ||
11 | LCD_LPH8923_TEST_FAILED, | ||
12 | }; | ||
13 | |||
14 | #endif | ||
diff --git a/include/asm-arm/arch-omap/mcbsp.h b/include/asm-arm/arch-omap/mcbsp.h index e79d98ab2a..ed0dde4f72 100644 --- a/include/asm-arm/arch-omap/mcbsp.h +++ b/include/asm-arm/arch-omap/mcbsp.h | |||
@@ -37,6 +37,11 @@ | |||
37 | #define OMAP1610_MCBSP2_BASE 0xfffb1000 | 37 | #define OMAP1610_MCBSP2_BASE 0xfffb1000 |
38 | #define OMAP1610_MCBSP3_BASE 0xe1017000 | 38 | #define OMAP1610_MCBSP3_BASE 0xe1017000 |
39 | 39 | ||
40 | #define OMAP24XX_MCBSP1_BASE 0x48074000 | ||
41 | #define OMAP24XX_MCBSP2_BASE 0x48076000 | ||
42 | |||
43 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) | ||
44 | |||
40 | #define OMAP_MCBSP_REG_DRR2 0x00 | 45 | #define OMAP_MCBSP_REG_DRR2 0x00 |
41 | #define OMAP_MCBSP_REG_DRR1 0x02 | 46 | #define OMAP_MCBSP_REG_DRR1 0x02 |
42 | #define OMAP_MCBSP_REG_DXR2 0x04 | 47 | #define OMAP_MCBSP_REG_DXR2 0x04 |
@@ -71,9 +76,62 @@ | |||
71 | 76 | ||
72 | #define OMAP_MAX_MCBSP_COUNT 3 | 77 | #define OMAP_MAX_MCBSP_COUNT 3 |
73 | 78 | ||
79 | #define AUDIO_MCBSP_DATAWRITE (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1) | ||
80 | #define AUDIO_MCBSP_DATAREAD (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1) | ||
81 | |||
82 | #define AUDIO_MCBSP OMAP_MCBSP1 | ||
83 | #define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX | ||
84 | #define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX | ||
85 | |||
86 | #elif defined(CONFIG_ARCH_OMAP24XX) | ||
87 | |||
88 | #define OMAP_MCBSP_REG_DRR2 0x00 | ||
89 | #define OMAP_MCBSP_REG_DRR1 0x04 | ||
90 | #define OMAP_MCBSP_REG_DXR2 0x08 | ||
91 | #define OMAP_MCBSP_REG_DXR1 0x0C | ||
92 | #define OMAP_MCBSP_REG_SPCR2 0x10 | ||
93 | #define OMAP_MCBSP_REG_SPCR1 0x14 | ||
94 | #define OMAP_MCBSP_REG_RCR2 0x18 | ||
95 | #define OMAP_MCBSP_REG_RCR1 0x1C | ||
96 | #define OMAP_MCBSP_REG_XCR2 0x20 | ||
97 | #define OMAP_MCBSP_REG_XCR1 0x24 | ||
98 | #define OMAP_MCBSP_REG_SRGR2 0x28 | ||
99 | #define OMAP_MCBSP_REG_SRGR1 0x2C | ||
100 | #define OMAP_MCBSP_REG_MCR2 0x30 | ||
101 | #define OMAP_MCBSP_REG_MCR1 0x34 | ||
102 | #define OMAP_MCBSP_REG_RCERA 0x38 | ||
103 | #define OMAP_MCBSP_REG_RCERB 0x3C | ||
104 | #define OMAP_MCBSP_REG_XCERA 0x40 | ||
105 | #define OMAP_MCBSP_REG_XCERB 0x44 | ||
106 | #define OMAP_MCBSP_REG_PCR0 0x48 | ||
107 | #define OMAP_MCBSP_REG_RCERC 0x4C | ||
108 | #define OMAP_MCBSP_REG_RCERD 0x50 | ||
109 | #define OMAP_MCBSP_REG_XCERC 0x54 | ||
110 | #define OMAP_MCBSP_REG_XCERD 0x58 | ||
111 | #define OMAP_MCBSP_REG_RCERE 0x5C | ||
112 | #define OMAP_MCBSP_REG_RCERF 0x60 | ||
113 | #define OMAP_MCBSP_REG_XCERE 0x64 | ||
114 | #define OMAP_MCBSP_REG_XCERF 0x68 | ||
115 | #define OMAP_MCBSP_REG_RCERG 0x6C | ||
116 | #define OMAP_MCBSP_REG_RCERH 0x70 | ||
117 | #define OMAP_MCBSP_REG_XCERG 0x74 | ||
118 | #define OMAP_MCBSP_REG_XCERH 0x78 | ||
119 | |||
120 | #define OMAP_MAX_MCBSP_COUNT 2 | ||
121 | |||
122 | #define AUDIO_MCBSP_DATAWRITE (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1) | ||
123 | #define AUDIO_MCBSP_DATAREAD (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1) | ||
124 | |||
125 | #define AUDIO_MCBSP OMAP_MCBSP2 | ||
126 | #define AUDIO_DMA_TX OMAP24XX_DMA_MCBSP2_TX | ||
127 | #define AUDIO_DMA_RX OMAP24XX_DMA_MCBSP2_RX | ||
128 | |||
129 | #endif | ||
130 | |||
74 | #define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg) | 131 | #define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg) |
75 | #define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg) | 132 | #define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg) |
76 | 133 | ||
134 | |||
77 | /************************** McBSP SPCR1 bit definitions ***********************/ | 135 | /************************** McBSP SPCR1 bit definitions ***********************/ |
78 | #define RRST 0x0001 | 136 | #define RRST 0x0001 |
79 | #define RRDY 0x0002 | 137 | #define RRDY 0x0002 |
@@ -195,6 +253,10 @@ typedef enum { | |||
195 | OMAP_MCBSP3, | 253 | OMAP_MCBSP3, |
196 | } omap_mcbsp_id; | 254 | } omap_mcbsp_id; |
197 | 255 | ||
256 | typedef int __bitwise omap_mcbsp_io_type_t; | ||
257 | #define OMAP_MCBSP_IRQ_IO ((__force omap_mcbsp_io_type_t) 1) | ||
258 | #define OMAP_MCBSP_POLL_IO ((__force omap_mcbsp_io_type_t) 2) | ||
259 | |||
198 | typedef enum { | 260 | typedef enum { |
199 | OMAP_MCBSP_WORD_8 = 0, | 261 | OMAP_MCBSP_WORD_8 = 0, |
200 | OMAP_MCBSP_WORD_12, | 262 | OMAP_MCBSP_WORD_12, |
@@ -246,6 +308,9 @@ u32 omap_mcbsp_recv_word(unsigned int id); | |||
246 | 308 | ||
247 | int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); | 309 | int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); |
248 | int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); | 310 | int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int length); |
311 | int omap_mcbsp_spi_master_xmit_word_poll(unsigned int id, u32 word); | ||
312 | int omap_mcbsp_spi_master_recv_word_poll(unsigned int id, u32 * word); | ||
313 | |||
249 | 314 | ||
250 | /* SPI specific API */ | 315 | /* SPI specific API */ |
251 | void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg); | 316 | void omap_mcbsp_set_spi_mode(unsigned int id, const struct omap_mcbsp_spi_cfg * spi_cfg); |
diff --git a/include/asm-arm/arch-omap/mcspi.h b/include/asm-arm/arch-omap/mcspi.h new file mode 100644 index 0000000000..9e7f40a88e --- /dev/null +++ b/include/asm-arm/arch-omap/mcspi.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _OMAP2_MCSPI_H | ||
2 | #define _OMAP2_MCSPI_H | ||
3 | |||
4 | struct omap2_mcspi_platform_config { | ||
5 | unsigned long base; | ||
6 | unsigned short num_cs; | ||
7 | }; | ||
8 | |||
9 | struct omap2_mcspi_device_config { | ||
10 | unsigned turbo_mode:1; | ||
11 | |||
12 | /* Do we want one channel enabled at the same time? */ | ||
13 | unsigned single_channel:1; | ||
14 | }; | ||
15 | |||
16 | #endif | ||
diff --git a/include/asm-arm/arch-omap/menelaus.h b/include/asm-arm/arch-omap/menelaus.h index 46be8b8d63..88cd4c87f0 100644 --- a/include/asm-arm/arch-omap/menelaus.h +++ b/include/asm-arm/arch-omap/menelaus.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #ifndef __ASM_ARCH_MENELAUS_H | 7 | #ifndef __ASM_ARCH_MENELAUS_H |
8 | #define __ASM_ARCH_MENELAUS_H | 8 | #define __ASM_ARCH_MENELAUS_H |
9 | 9 | ||
10 | extern void menelaus_mmc_register(void (*callback)(u8 card_mask), | 10 | extern void menelaus_mmc_register(void (*callback)(unsigned long data, u8 card_mask), |
11 | unsigned long data); | 11 | unsigned long data); |
12 | extern void menelaus_mmc_remove(void); | 12 | extern void menelaus_mmc_remove(void); |
13 | extern void menelaus_mmc_opendrain(int enable); | 13 | extern void menelaus_mmc_opendrain(int enable); |
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h index 13415a9aab..0dc24d4ba5 100644 --- a/include/asm-arm/arch-omap/mux.h +++ b/include/asm-arm/arch-omap/mux.h | |||
@@ -112,14 +112,13 @@ | |||
112 | * as mux config | 112 | * as mux config |
113 | */ | 113 | */ |
114 | #define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \ | 114 | #define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \ |
115 | pull_reg, pull_bit, pull_status, \ | 115 | pull_bit, pull_status, debug_status)\ |
116 | pu_pd_reg, pu_pd_status, debug_status)\ | ||
117 | { \ | 116 | { \ |
118 | .name = desc, \ | 117 | .name = desc, \ |
119 | .debug = debug_status, \ | 118 | .debug = debug_status, \ |
120 | MUX_REG_730(mux_reg, mode_offset, mode) \ | 119 | MUX_REG_730(mux_reg, mode_offset, mode) \ |
121 | PULL_REG_730(mux_reg, pull_bit, pull_status) \ | 120 | PULL_REG_730(mux_reg, pull_bit, pull_status) \ |
122 | PU_PD_REG(pu_pd_reg, pu_pd_status) \ | 121 | PU_PD_REG(NA, 0) \ |
123 | }, | 122 | }, |
124 | 123 | ||
125 | #define MUX_CFG_24XX(desc, reg_offset, mode, \ | 124 | #define MUX_CFG_24XX(desc, reg_offset, mode, \ |
@@ -172,6 +171,11 @@ enum omap730_index { | |||
172 | E4_730_KBC2, | 171 | E4_730_KBC2, |
173 | F4_730_KBC3, | 172 | F4_730_KBC3, |
174 | E3_730_KBC4, | 173 | E3_730_KBC4, |
174 | |||
175 | /* USB */ | ||
176 | AA17_730_USB_DM, | ||
177 | W16_730_USB_PU_EN, | ||
178 | W17_730_USB_VBUSI, | ||
175 | }; | 179 | }; |
176 | 180 | ||
177 | enum omap1xxx_index { | 181 | enum omap1xxx_index { |
@@ -403,9 +407,53 @@ enum omap24xx_index { | |||
403 | /* 24xx Menelaus interrupt */ | 407 | /* 24xx Menelaus interrupt */ |
404 | W19_24XX_SYS_NIRQ, | 408 | W19_24XX_SYS_NIRQ, |
405 | 409 | ||
410 | /* 24xx clock */ | ||
411 | W14_24XX_SYS_CLKOUT, | ||
412 | |||
413 | /* 242X McBSP */ | ||
414 | Y15_24XX_MCBSP2_CLKX, | ||
415 | R14_24XX_MCBSP2_FSX, | ||
416 | W15_24XX_MCBSP2_DR, | ||
417 | V15_24XX_MCBSP2_DX, | ||
418 | |||
406 | /* 24xx GPIO */ | 419 | /* 24xx GPIO */ |
420 | M21_242X_GPIO11, | ||
421 | AA10_242X_GPIO13, | ||
422 | AA6_242X_GPIO14, | ||
423 | AA4_242X_GPIO15, | ||
424 | Y11_242X_GPIO16, | ||
425 | AA12_242X_GPIO17, | ||
426 | AA8_242X_GPIO58, | ||
407 | Y20_24XX_GPIO60, | 427 | Y20_24XX_GPIO60, |
428 | W4__24XX_GPIO74, | ||
408 | M15_24XX_GPIO92, | 429 | M15_24XX_GPIO92, |
430 | V14_24XX_GPIO117, | ||
431 | |||
432 | P20_24XX_TSC_IRQ, | ||
433 | |||
434 | /* UART3 */ | ||
435 | K15_24XX_UART3_TX, | ||
436 | K14_24XX_UART3_RX, | ||
437 | |||
438 | /* Keypad GPIO*/ | ||
439 | T19_24XX_KBR0, | ||
440 | R19_24XX_KBR1, | ||
441 | V18_24XX_KBR2, | ||
442 | M21_24XX_KBR3, | ||
443 | E5__24XX_KBR4, | ||
444 | M18_24XX_KBR5, | ||
445 | R20_24XX_KBC0, | ||
446 | M14_24XX_KBC1, | ||
447 | H19_24XX_KBC2, | ||
448 | V17_24XX_KBC3, | ||
449 | P21_24XX_KBC4, | ||
450 | L14_24XX_KBC5, | ||
451 | N19_24XX_KBC6, | ||
452 | |||
453 | /* 24xx Menelaus Keypad GPIO */ | ||
454 | B3__24XX_KBR5, | ||
455 | AA4_24XX_KBC2, | ||
456 | B13_24XX_KBC6, | ||
409 | }; | 457 | }; |
410 | 458 | ||
411 | #ifdef CONFIG_OMAP_MUX | 459 | #ifdef CONFIG_OMAP_MUX |
diff --git a/include/asm-arm/arch-omap/omap-alsa.h b/include/asm-arm/arch-omap/omap-alsa.h new file mode 100644 index 0000000000..df4695474e --- /dev/null +++ b/include/asm-arm/arch-omap/omap-alsa.h | |||
@@ -0,0 +1,124 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/omap-alsa.h | ||
3 | * | ||
4 | * Alsa Driver for AIC23 and TSC2101 codecs on OMAP platform boards. | ||
5 | * | ||
6 | * Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi> | ||
7 | * | ||
8 | * Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil | ||
9 | * Written by Daniel Petrini, David Cohen, Anderson Briglia | ||
10 | * {daniel.petrini, david.cohen, anderson.briglia}@indt.org.br | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify it | ||
13 | * under the terms of the GNU General Public License as published by the | ||
14 | * Free Software Foundation; either version 2 of the License, or (at your | ||
15 | * option) any later version. | ||
16 | * | ||
17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
20 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
23 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
24 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | * | ||
28 | * You should have received a copy of the GNU General Public License along | ||
29 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
30 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
31 | * | ||
32 | * History | ||
33 | * ------- | ||
34 | * | ||
35 | * 2005/07/25 INdT-10LE Kernel Team - Alsa driver for omap osk, | ||
36 | * original version based in sa1100 driver | ||
37 | * and omap oss driver. | ||
38 | */ | ||
39 | |||
40 | #ifndef __OMAP_ALSA_H | ||
41 | #define __OMAP_ALSA_H | ||
42 | |||
43 | #include <sound/driver.h> | ||
44 | #include <asm/arch/dma.h> | ||
45 | #include <sound/core.h> | ||
46 | #include <sound/pcm.h> | ||
47 | #include <asm/arch/mcbsp.h> | ||
48 | #include <linux/platform_device.h> | ||
49 | |||
50 | #define DMA_BUF_SIZE (1024 * 8) | ||
51 | |||
52 | /* | ||
53 | * Buffer management for alsa and dma | ||
54 | */ | ||
55 | struct audio_stream { | ||
56 | char *id; /* identification string */ | ||
57 | int stream_id; /* numeric identification */ | ||
58 | int dma_dev; /* dma number of that device */ | ||
59 | int *lch; /* Chain of channels this stream is linked to */ | ||
60 | char started; /* to store if the chain was started or not */ | ||
61 | int dma_q_head; /* DMA Channel Q Head */ | ||
62 | int dma_q_tail; /* DMA Channel Q Tail */ | ||
63 | char dma_q_count; /* DMA Channel Q Count */ | ||
64 | int active:1; /* we are using this stream for transfer now */ | ||
65 | int period; /* current transfer period */ | ||
66 | int periods; /* current count of periods registerd in the DMA engine */ | ||
67 | spinlock_t dma_lock; /* for locking in DMA operations */ | ||
68 | snd_pcm_substream_t *stream; /* the pcm stream */ | ||
69 | unsigned linked:1; /* dma channels linked */ | ||
70 | int offset; /* store start position of the last period in the alsa buffer */ | ||
71 | int (*hw_start)(void); /* interface to start HW interface, e.g. McBSP */ | ||
72 | int (*hw_stop)(void); /* interface to stop HW interface, e.g. McBSP */ | ||
73 | }; | ||
74 | |||
75 | /* | ||
76 | * Alsa card structure for aic23 | ||
77 | */ | ||
78 | struct snd_card_omap_codec { | ||
79 | snd_card_t *card; | ||
80 | snd_pcm_t *pcm; | ||
81 | long samplerate; | ||
82 | struct audio_stream s[2]; /* playback & capture */ | ||
83 | }; | ||
84 | |||
85 | /* Codec specific information and function pointers. | ||
86 | * Codec (omap-alsa-aic23.c and omap-alsa-tsc2101.c) | ||
87 | * are responsible for defining the function pointers. | ||
88 | */ | ||
89 | struct omap_alsa_codec_config { | ||
90 | char *name; | ||
91 | struct omap_mcbsp_reg_cfg *mcbsp_regs_alsa; | ||
92 | snd_pcm_hw_constraint_list_t *hw_constraints_rates; | ||
93 | snd_pcm_hardware_t *snd_omap_alsa_playback; | ||
94 | snd_pcm_hardware_t *snd_omap_alsa_capture; | ||
95 | void (*codec_configure_dev)(void); | ||
96 | void (*codec_set_samplerate)(long); | ||
97 | void (*codec_clock_setup)(void); | ||
98 | int (*codec_clock_on)(void); | ||
99 | int (*codec_clock_off)(void); | ||
100 | int (*get_default_samplerate)(void); | ||
101 | }; | ||
102 | |||
103 | /*********** Mixer function prototypes *************************/ | ||
104 | int snd_omap_mixer(struct snd_card_omap_codec *); | ||
105 | void snd_omap_init_mixer(void); | ||
106 | |||
107 | #ifdef CONFIG_PM | ||
108 | void snd_omap_suspend_mixer(void); | ||
109 | void snd_omap_resume_mixer(void); | ||
110 | #endif | ||
111 | |||
112 | int snd_omap_alsa_post_probe(struct platform_device *pdev, struct omap_alsa_codec_config *config); | ||
113 | int snd_omap_alsa_remove(struct platform_device *pdev); | ||
114 | #ifdef CONFIG_PM | ||
115 | int snd_omap_alsa_suspend(struct platform_device *pdev, pm_message_t state); | ||
116 | int snd_omap_alsa_resume(struct platform_device *pdev); | ||
117 | #else | ||
118 | #define snd_omap_alsa_suspend NULL | ||
119 | #define snd_omap_alsa_resume NULL | ||
120 | #endif | ||
121 | |||
122 | void callback_omap_alsa_sound_dma(void *); | ||
123 | |||
124 | #endif | ||
diff --git a/include/asm-arm/arch-omap/omapfb.h b/include/asm-arm/arch-omap/omapfb.h index 4ba2622cc1..fccdb3db02 100644 --- a/include/asm-arm/arch-omap/omapfb.h +++ b/include/asm-arm/arch-omap/omapfb.h | |||
@@ -34,9 +34,10 @@ | |||
34 | #define OMAPFB_MIRROR OMAP_IOW(31, int) | 34 | #define OMAPFB_MIRROR OMAP_IOW(31, int) |
35 | #define OMAPFB_SYNC_GFX OMAP_IO(37) | 35 | #define OMAPFB_SYNC_GFX OMAP_IO(37) |
36 | #define OMAPFB_VSYNC OMAP_IO(38) | 36 | #define OMAPFB_VSYNC OMAP_IO(38) |
37 | #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, enum omapfb_update_mode) | 37 | #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int) |
38 | #define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(41, struct omapfb_update_window_old) | ||
38 | #define OMAPFB_GET_CAPS OMAP_IOR(42, unsigned long) | 39 | #define OMAPFB_GET_CAPS OMAP_IOR(42, unsigned long) |
39 | #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, enum omapfb_update_mode) | 40 | #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int) |
40 | #define OMAPFB_LCD_TEST OMAP_IOW(45, int) | 41 | #define OMAPFB_LCD_TEST OMAP_IOW(45, int) |
41 | #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) | 42 | #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) |
42 | #define OMAPFB_UPDATE_WINDOW OMAP_IOW(47, struct omapfb_update_window) | 43 | #define OMAPFB_UPDATE_WINDOW OMAP_IOW(47, struct omapfb_update_window) |
@@ -66,9 +67,14 @@ enum omapfb_color_format { | |||
66 | }; | 67 | }; |
67 | 68 | ||
68 | struct omapfb_update_window { | 69 | struct omapfb_update_window { |
69 | u32 x, y; | 70 | __u32 x, y; |
70 | u32 width, height; | 71 | __u32 width, height; |
71 | u32 format; | 72 | __u32 format; |
73 | }; | ||
74 | |||
75 | struct omapfb_update_window_old { | ||
76 | __u32 x, y; | ||
77 | __u32 width, height; | ||
72 | }; | 78 | }; |
73 | 79 | ||
74 | enum omapfb_plane { | 80 | enum omapfb_plane { |
@@ -83,17 +89,17 @@ enum omapfb_channel_out { | |||
83 | }; | 89 | }; |
84 | 90 | ||
85 | struct omapfb_setup_plane { | 91 | struct omapfb_setup_plane { |
86 | u8 plane; | 92 | __u8 plane; |
87 | u8 channel_out; | 93 | __u8 channel_out; |
88 | u32 offset; | 94 | __u32 offset; |
89 | u32 pos_x, pos_y; | 95 | __u32 pos_x, pos_y; |
90 | u32 width, height; | 96 | __u32 width, height; |
91 | u32 color_mode; | 97 | __u32 color_mode; |
92 | }; | 98 | }; |
93 | 99 | ||
94 | struct omapfb_enable_plane { | 100 | struct omapfb_enable_plane { |
95 | u8 plane; | 101 | __u8 plane; |
96 | u8 enable; | 102 | __u8 enable; |
97 | }; | 103 | }; |
98 | 104 | ||
99 | enum omapfb_color_key_type { | 105 | enum omapfb_color_key_type { |
@@ -103,10 +109,10 @@ enum omapfb_color_key_type { | |||
103 | }; | 109 | }; |
104 | 110 | ||
105 | struct omapfb_color_key { | 111 | struct omapfb_color_key { |
106 | u8 channel_out; | 112 | __u8 channel_out; |
107 | u32 background; | 113 | __u32 background; |
108 | u32 trans_key; | 114 | __u32 trans_key; |
109 | u8 key_type; | 115 | __u8 key_type; |
110 | }; | 116 | }; |
111 | 117 | ||
112 | enum omapfb_update_mode { | 118 | enum omapfb_update_mode { |
@@ -120,6 +126,9 @@ enum omapfb_update_mode { | |||
120 | #include <linux/completion.h> | 126 | #include <linux/completion.h> |
121 | #include <linux/interrupt.h> | 127 | #include <linux/interrupt.h> |
122 | #include <linux/fb.h> | 128 | #include <linux/fb.h> |
129 | #include <linux/mutex.h> | ||
130 | |||
131 | #include <asm/arch/board.h> | ||
123 | 132 | ||
124 | #define OMAP_LCDC_INV_VSYNC 0x0001 | 133 | #define OMAP_LCDC_INV_VSYNC 0x0001 |
125 | #define OMAP_LCDC_INV_HSYNC 0x0002 | 134 | #define OMAP_LCDC_INV_HSYNC 0x0002 |
@@ -184,19 +193,38 @@ struct extif_timings { | |||
184 | int re_cycle_time; | 193 | int re_cycle_time; |
185 | int cs_pulse_width; | 194 | int cs_pulse_width; |
186 | int access_time; | 195 | int access_time; |
196 | |||
197 | int clk_div; | ||
198 | |||
199 | u32 tim[5]; /* set by extif->convert_timings */ | ||
200 | |||
201 | int converted; | ||
187 | }; | 202 | }; |
188 | 203 | ||
189 | struct lcd_ctrl_extif { | 204 | struct lcd_ctrl_extif { |
190 | int (*init) (void); | 205 | int (*init) (void); |
191 | void (*cleanup) (void); | 206 | void (*cleanup) (void); |
207 | void (*get_clk_info) (u32 *clk_period, u32 *max_clk_div); | ||
208 | int (*convert_timings) (struct extif_timings *timings); | ||
192 | void (*set_timings) (const struct extif_timings *timings); | 209 | void (*set_timings) (const struct extif_timings *timings); |
193 | void (*write_command) (u32 cmd); | 210 | void (*set_bits_per_cycle)(int bpc); |
194 | u32 (*read_data) (void); | 211 | void (*write_command) (const void *buf, unsigned int len); |
195 | void (*write_data) (u32 data); | 212 | void (*read_data) (void *buf, unsigned int len); |
213 | void (*write_data) (const void *buf, unsigned int len); | ||
196 | void (*transfer_area) (int width, int height, | 214 | void (*transfer_area) (int width, int height, |
197 | void (callback)(void * data), void *data); | 215 | void (callback)(void * data), void *data); |
216 | unsigned long max_transmit_size; | ||
198 | }; | 217 | }; |
199 | 218 | ||
219 | struct omapfb_notifier_block { | ||
220 | struct notifier_block nb; | ||
221 | void *data; | ||
222 | }; | ||
223 | |||
224 | typedef int (*omapfb_notifier_callback_t)(struct omapfb_notifier_block *, | ||
225 | unsigned long event, | ||
226 | struct omapfb_device *fbdev); | ||
227 | |||
200 | struct lcd_ctrl { | 228 | struct lcd_ctrl { |
201 | const char *name; | 229 | const char *name; |
202 | void *data; | 230 | void *data; |
@@ -204,9 +232,11 @@ struct lcd_ctrl { | |||
204 | int (*init) (struct omapfb_device *fbdev, | 232 | int (*init) (struct omapfb_device *fbdev, |
205 | int ext_mode, int req_vram_size); | 233 | int ext_mode, int req_vram_size); |
206 | void (*cleanup) (void); | 234 | void (*cleanup) (void); |
235 | void (*bind_client) (struct omapfb_notifier_block *nb); | ||
207 | void (*get_vram_layout)(unsigned long *size, | 236 | void (*get_vram_layout)(unsigned long *size, |
208 | void **virt_base, | 237 | void **virt_base, |
209 | dma_addr_t *phys_base); | 238 | dma_addr_t *phys_base); |
239 | int (*mmap) (struct vm_area_struct *vma); | ||
210 | unsigned long (*get_caps) (void); | 240 | unsigned long (*get_caps) (void); |
211 | int (*set_update_mode)(enum omapfb_update_mode mode); | 241 | int (*set_update_mode)(enum omapfb_update_mode mode); |
212 | enum omapfb_update_mode (*get_update_mode)(void); | 242 | enum omapfb_update_mode (*get_update_mode)(void); |
@@ -240,7 +270,7 @@ struct omapfb_device { | |||
240 | int state; | 270 | int state; |
241 | int ext_lcdc; /* Using external | 271 | int ext_lcdc; /* Using external |
242 | LCD controller */ | 272 | LCD controller */ |
243 | struct semaphore rqueue_sema; | 273 | struct mutex rqueue_mutex; |
244 | 274 | ||
245 | void *vram_virt_base; | 275 | void *vram_virt_base; |
246 | dma_addr_t vram_phys_base; | 276 | dma_addr_t vram_phys_base; |
@@ -261,12 +291,13 @@ struct omapfb_device { | |||
261 | struct device *dev; | 291 | struct device *dev; |
262 | }; | 292 | }; |
263 | 293 | ||
264 | extern struct lcd_panel h3_panel; | 294 | struct omapfb_platform_data { |
265 | extern struct lcd_panel h2_panel; | 295 | struct omap_lcd_config lcd; |
266 | extern struct lcd_panel p2_panel; | 296 | struct omap_fbmem_config fbmem; |
267 | extern struct lcd_panel osk_panel; | 297 | }; |
268 | extern struct lcd_panel innovator1610_panel; | 298 | |
269 | extern struct lcd_panel innovator1510_panel; | 299 | #define OMAPFB_EVENT_READY 1 |
300 | #define OMAPFB_EVENT_DISABLED 2 | ||
270 | 301 | ||
271 | #ifdef CONFIG_ARCH_OMAP1 | 302 | #ifdef CONFIG_ARCH_OMAP1 |
272 | extern struct lcd_ctrl omap1_lcd_ctrl; | 303 | extern struct lcd_ctrl omap1_lcd_ctrl; |
@@ -274,7 +305,20 @@ extern struct lcd_ctrl omap1_lcd_ctrl; | |||
274 | extern struct lcd_ctrl omap2_disp_ctrl; | 305 | extern struct lcd_ctrl omap2_disp_ctrl; |
275 | #endif | 306 | #endif |
276 | 307 | ||
308 | extern void omapfb_register_panel(struct lcd_panel *panel); | ||
277 | extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval); | 309 | extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval); |
310 | extern void omapfb_notify_clients(struct omapfb_device *fbdev, | ||
311 | unsigned long event); | ||
312 | extern int omapfb_register_client(struct omapfb_notifier_block *nb, | ||
313 | omapfb_notifier_callback_t callback, | ||
314 | void *callback_data); | ||
315 | extern int omapfb_unregister_client(struct omapfb_notifier_block *nb); | ||
316 | extern int omapfb_update_window_async(struct omapfb_update_window *win, | ||
317 | void (*callback)(void *), | ||
318 | void *callback_data); | ||
319 | |||
320 | /* in arch/arm/plat-omap/devices.c */ | ||
321 | extern void omapfb_reserve_mem(void); | ||
278 | 322 | ||
279 | #endif /* __KERNEL__ */ | 323 | #endif /* __KERNEL__ */ |
280 | 324 | ||
diff --git a/include/asm-arm/arch-omap/param.h b/include/asm-arm/arch-omap/param.h new file mode 100644 index 0000000000..face9ad41e --- /dev/null +++ b/include/asm-arm/arch-omap/param.h | |||
@@ -0,0 +1,8 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/param.h | ||
3 | * | ||
4 | */ | ||
5 | |||
6 | #ifdef CONFIG_OMAP_32K_TIMER_HZ | ||
7 | #define HZ CONFIG_OMAP_32K_TIMER_HZ | ||
8 | #endif | ||
diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h index 7c790425e3..05b003f3a9 100644 --- a/include/asm-arm/arch-omap/pm.h +++ b/include/asm-arm/arch-omap/pm.h | |||
@@ -49,7 +49,7 @@ | |||
49 | 49 | ||
50 | /* | 50 | /* |
51 | * ---------------------------------------------------------------------------- | 51 | * ---------------------------------------------------------------------------- |
52 | * Powermanagement bitmasks | 52 | * Power management bitmasks |
53 | * ---------------------------------------------------------------------------- | 53 | * ---------------------------------------------------------------------------- |
54 | */ | 54 | */ |
55 | #define IDLE_WAIT_CYCLES 0x00000fff | 55 | #define IDLE_WAIT_CYCLES 0x00000fff |
@@ -112,32 +112,59 @@ | |||
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | #ifndef __ASSEMBLER__ | 114 | #ifndef __ASSEMBLER__ |
115 | |||
116 | #include <linux/clk.h> | ||
117 | |||
118 | extern void prevent_idle_sleep(void); | ||
119 | extern void allow_idle_sleep(void); | ||
120 | |||
121 | /** | ||
122 | * clk_deny_idle - Prevents the clock from being idled during MPU idle | ||
123 | * @clk: clock signal handle | ||
124 | */ | ||
125 | void clk_deny_idle(struct clk *clk); | ||
126 | |||
127 | /** | ||
128 | * clk_allow_idle - Counters previous clk_deny_idle | ||
129 | * @clk: clock signal handle | ||
130 | */ | ||
131 | void clk_deny_idle(struct clk *clk); | ||
132 | |||
115 | extern void omap_pm_idle(void); | 133 | extern void omap_pm_idle(void); |
116 | extern void omap_pm_suspend(void); | 134 | extern void omap_pm_suspend(void); |
117 | extern void omap730_cpu_suspend(unsigned short, unsigned short); | 135 | extern void omap730_cpu_suspend(unsigned short, unsigned short); |
118 | extern void omap1510_cpu_suspend(unsigned short, unsigned short); | 136 | extern void omap1510_cpu_suspend(unsigned short, unsigned short); |
119 | extern void omap1610_cpu_suspend(unsigned short, unsigned short); | 137 | extern void omap1610_cpu_suspend(unsigned short, unsigned short); |
138 | extern void omap24xx_cpu_suspend(u32 dll_ctrl, u32 cpu_revision); | ||
120 | extern void omap730_idle_loop_suspend(void); | 139 | extern void omap730_idle_loop_suspend(void); |
121 | extern void omap1510_idle_loop_suspend(void); | 140 | extern void omap1510_idle_loop_suspend(void); |
122 | extern void omap1610_idle_loop_suspend(void); | 141 | extern void omap1610_idle_loop_suspend(void); |
142 | extern void omap24xx_idle_loop_suspend(void); | ||
143 | |||
144 | extern unsigned int omap730_cpu_suspend_sz; | ||
145 | extern unsigned int omap1510_cpu_suspend_sz; | ||
146 | extern unsigned int omap1610_cpu_suspend_sz; | ||
147 | extern unsigned int omap24xx_cpu_suspend_sz; | ||
148 | extern unsigned int omap730_idle_loop_suspend_sz; | ||
149 | extern unsigned int omap1510_idle_loop_suspend_sz; | ||
150 | extern unsigned int omap1610_idle_loop_suspend_sz; | ||
151 | extern unsigned int omap24xx_idle_loop_suspend_sz; | ||
123 | 152 | ||
124 | #ifdef CONFIG_OMAP_SERIAL_WAKE | 153 | #ifdef CONFIG_OMAP_SERIAL_WAKE |
125 | extern void omap_serial_wake_trigger(int enable); | 154 | extern void omap_serial_wake_trigger(int enable); |
126 | #else | 155 | #else |
156 | #define omap_serial_wakeup_init() {} | ||
127 | #define omap_serial_wake_trigger(x) {} | 157 | #define omap_serial_wake_trigger(x) {} |
128 | #endif /* CONFIG_OMAP_SERIAL_WAKE */ | 158 | #endif /* CONFIG_OMAP_SERIAL_WAKE */ |
129 | 159 | ||
130 | extern unsigned int omap730_cpu_suspend_sz; | ||
131 | extern unsigned int omap730_idle_loop_suspend_sz; | ||
132 | extern unsigned int omap1510_cpu_suspend_sz; | ||
133 | extern unsigned int omap1510_idle_loop_suspend_sz; | ||
134 | extern unsigned int omap1610_cpu_suspend_sz; | ||
135 | extern unsigned int omap1610_idle_loop_suspend_sz; | ||
136 | |||
137 | #define ARM_SAVE(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] = omap_readl(x) | 160 | #define ARM_SAVE(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] = omap_readl(x) |
138 | #define ARM_RESTORE(x) omap_writel((arm_sleep_save[ARM_SLEEP_SAVE_##x]), (x)) | 161 | #define ARM_RESTORE(x) omap_writel((arm_sleep_save[ARM_SLEEP_SAVE_##x]), (x)) |
139 | #define ARM_SHOW(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] | 162 | #define ARM_SHOW(x) arm_sleep_save[ARM_SLEEP_SAVE_##x] |
140 | 163 | ||
164 | #define DSP_SAVE(x) dsp_sleep_save[DSP_SLEEP_SAVE_##x] = __raw_readw(x) | ||
165 | #define DSP_RESTORE(x) __raw_writew((dsp_sleep_save[DSP_SLEEP_SAVE_##x]), (x)) | ||
166 | #define DSP_SHOW(x) dsp_sleep_save[DSP_SLEEP_SAVE_##x] | ||
167 | |||
141 | #define ULPD_SAVE(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] = omap_readw(x) | 168 | #define ULPD_SAVE(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] = omap_readw(x) |
142 | #define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) | 169 | #define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) |
143 | #define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] | 170 | #define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] |
@@ -154,6 +181,10 @@ extern unsigned int omap1610_idle_loop_suspend_sz; | |||
154 | #define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x)) | 181 | #define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x)) |
155 | #define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] | 182 | #define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] |
156 | 183 | ||
184 | #define OMAP24XX_SAVE(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] = x | ||
185 | #define OMAP24XX_RESTORE(x) x = omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] | ||
186 | #define OMAP24XX_SHOW(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] | ||
187 | |||
157 | /* | 188 | /* |
158 | * List of global OMAP registers to preserve. | 189 | * List of global OMAP registers to preserve. |
159 | * More ones like CP and general purpose register values are preserved | 190 | * More ones like CP and general purpose register values are preserved |
@@ -176,6 +207,15 @@ enum arm_save_state { | |||
176 | ARM_SLEEP_SAVE_SIZE | 207 | ARM_SLEEP_SAVE_SIZE |
177 | }; | 208 | }; |
178 | 209 | ||
210 | enum dsp_save_state { | ||
211 | DSP_SLEEP_SAVE_START = 0, | ||
212 | /* | ||
213 | * DSP registers 16 bits | ||
214 | */ | ||
215 | DSP_SLEEP_SAVE_DSP_IDLECT2, | ||
216 | DSP_SLEEP_SAVE_SIZE | ||
217 | }; | ||
218 | |||
179 | enum ulpd_save_state { | 219 | enum ulpd_save_state { |
180 | ULPD_SLEEP_SAVE_START = 0, | 220 | ULPD_SLEEP_SAVE_START = 0, |
181 | /* | 221 | /* |
@@ -254,5 +294,30 @@ enum mpui1610_save_state { | |||
254 | #endif | 294 | #endif |
255 | }; | 295 | }; |
256 | 296 | ||
297 | enum omap24xx_save_state { | ||
298 | OMAP24XX_SLEEP_SAVE_START = 0, | ||
299 | OMAP24XX_SLEEP_SAVE_INTC_MIR0, | ||
300 | OMAP24XX_SLEEP_SAVE_INTC_MIR1, | ||
301 | OMAP24XX_SLEEP_SAVE_INTC_MIR2, | ||
302 | OMAP24XX_SLEEP_SAVE_CM_FCLKEN1_CORE, | ||
303 | OMAP24XX_SLEEP_SAVE_CM_FCLKEN2_CORE, | ||
304 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN1_CORE, | ||
305 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN2_CORE, | ||
306 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN4_CORE, | ||
307 | OMAP24XX_SLEEP_SAVE_GPIO1_IRQENABLE1, | ||
308 | OMAP24XX_SLEEP_SAVE_GPIO2_IRQENABLE1, | ||
309 | OMAP24XX_SLEEP_SAVE_GPIO3_IRQENABLE1, | ||
310 | OMAP24XX_SLEEP_SAVE_GPIO4_IRQENABLE1, | ||
311 | OMAP24XX_SLEEP_SAVE_GPIO3_OE, | ||
312 | OMAP24XX_SLEEP_SAVE_GPIO4_OE, | ||
313 | OMAP24XX_SLEEP_SAVE_GPIO3_RISINGDETECT, | ||
314 | OMAP24XX_SLEEP_SAVE_GPIO3_FALLINGDETECT, | ||
315 | OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SPI1_NCS2, | ||
316 | OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_MCBSP1_DX, | ||
317 | OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SSI1_FLAG_TX, | ||
318 | OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SYS_NIRQW0, | ||
319 | OMAP24XX_SLEEP_SAVE_SIZE | ||
320 | }; | ||
321 | |||
257 | #endif /* ASSEMBLER */ | 322 | #endif /* ASSEMBLER */ |
258 | #endif /* __ASM_ARCH_OMAP_PM_H */ | 323 | #endif /* __ASM_ARCH_OMAP_PM_H */ |
diff --git a/include/asm-arm/arch-omap/prcm.h b/include/asm-arm/arch-omap/prcm.h index 7b48a5cbb1..7bcaf94bde 100644 --- a/include/asm-arm/arch-omap/prcm.h +++ b/include/asm-arm/arch-omap/prcm.h | |||
@@ -1,5 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * prcm.h - Access definations for use in OMAP24XX clock and power management | 2 | * linux/include/asm-arm/arch-omap/prcm.h |
3 | * | ||
4 | * Access definations for use in OMAP24XX clock and power management | ||
3 | * | 5 | * |
4 | * Copyright (C) 2005 Texas Instruments, Inc. | 6 | * Copyright (C) 2005 Texas Instruments, Inc. |
5 | * | 7 | * |
@@ -21,405 +23,7 @@ | |||
21 | #ifndef __ASM_ARM_ARCH_DPM_PRCM_H | 23 | #ifndef __ASM_ARM_ARCH_DPM_PRCM_H |
22 | #define __ASM_ARM_ARCH_DPM_PRCM_H | 24 | #define __ASM_ARM_ARCH_DPM_PRCM_H |
23 | 25 | ||
24 | /* SET_PERFORMANCE_LEVEL PARAMETERS */ | 26 | u32 omap_prcm_get_reset_sources(void); |
25 | #define PRCM_HALF_SPEED 1 | ||
26 | #define PRCM_FULL_SPEED 2 | ||
27 | |||
28 | #ifndef __ASSEMBLER__ | ||
29 | |||
30 | #define PRCM_REG32(offset) __REG32(OMAP24XX_PRCM_BASE + (offset)) | ||
31 | |||
32 | #define PRCM_REVISION PRCM_REG32(0x000) | ||
33 | #define PRCM_SYSCONFIG PRCM_REG32(0x010) | ||
34 | #define PRCM_IRQSTATUS_MPU PRCM_REG32(0x018) | ||
35 | #define PRCM_IRQENABLE_MPU PRCM_REG32(0x01C) | ||
36 | #define PRCM_VOLTCTRL PRCM_REG32(0x050) | ||
37 | #define PRCM_VOLTST PRCM_REG32(0x054) | ||
38 | #define PRCM_CLKSRC_CTRL PRCM_REG32(0x060) | ||
39 | #define PRCM_CLKOUT_CTRL PRCM_REG32(0x070) | ||
40 | #define PRCM_CLKEMUL_CTRL PRCM_REG32(0x078) | ||
41 | #define PRCM_CLKCFG_CTRL PRCM_REG32(0x080) | ||
42 | #define PRCM_CLKCFG_STATUS PRCM_REG32(0x084) | ||
43 | #define PRCM_VOLTSETUP PRCM_REG32(0x090) | ||
44 | #define PRCM_CLKSSETUP PRCM_REG32(0x094) | ||
45 | #define PRCM_POLCTRL PRCM_REG32(0x098) | ||
46 | |||
47 | /* GENERAL PURPOSE */ | ||
48 | #define GENERAL_PURPOSE1 PRCM_REG32(0x0B0) | ||
49 | #define GENERAL_PURPOSE2 PRCM_REG32(0x0B4) | ||
50 | #define GENERAL_PURPOSE3 PRCM_REG32(0x0B8) | ||
51 | #define GENERAL_PURPOSE4 PRCM_REG32(0x0BC) | ||
52 | #define GENERAL_PURPOSE5 PRCM_REG32(0x0C0) | ||
53 | #define GENERAL_PURPOSE6 PRCM_REG32(0x0C4) | ||
54 | #define GENERAL_PURPOSE7 PRCM_REG32(0x0C8) | ||
55 | #define GENERAL_PURPOSE8 PRCM_REG32(0x0CC) | ||
56 | #define GENERAL_PURPOSE9 PRCM_REG32(0x0D0) | ||
57 | #define GENERAL_PURPOSE10 PRCM_REG32(0x0D4) | ||
58 | #define GENERAL_PURPOSE11 PRCM_REG32(0x0D8) | ||
59 | #define GENERAL_PURPOSE12 PRCM_REG32(0x0DC) | ||
60 | #define GENERAL_PURPOSE13 PRCM_REG32(0x0E0) | ||
61 | #define GENERAL_PURPOSE14 PRCM_REG32(0x0E4) | ||
62 | #define GENERAL_PURPOSE15 PRCM_REG32(0x0E8) | ||
63 | #define GENERAL_PURPOSE16 PRCM_REG32(0x0EC) | ||
64 | #define GENERAL_PURPOSE17 PRCM_REG32(0x0F0) | ||
65 | #define GENERAL_PURPOSE18 PRCM_REG32(0x0F4) | ||
66 | #define GENERAL_PURPOSE19 PRCM_REG32(0x0F8) | ||
67 | #define GENERAL_PURPOSE20 PRCM_REG32(0x0FC) | ||
68 | |||
69 | /* MPU */ | ||
70 | #define CM_CLKSEL_MPU PRCM_REG32(0x140) | ||
71 | #define CM_CLKSTCTRL_MPU PRCM_REG32(0x148) | ||
72 | #define RM_RSTST_MPU PRCM_REG32(0x158) | ||
73 | #define PM_WKDEP_MPU PRCM_REG32(0x1C8) | ||
74 | #define PM_EVGENCTRL_MPU PRCM_REG32(0x1D4) | ||
75 | #define PM_EVEGENONTIM_MPU PRCM_REG32(0x1D8) | ||
76 | #define PM_EVEGENOFFTIM_MPU PRCM_REG32(0x1DC) | ||
77 | #define PM_PWSTCTRL_MPU PRCM_REG32(0x1E0) | ||
78 | #define PM_PWSTST_MPU PRCM_REG32(0x1E4) | ||
79 | |||
80 | /* CORE */ | ||
81 | #define CM_FCLKEN1_CORE PRCM_REG32(0x200) | ||
82 | #define CM_FCLKEN2_CORE PRCM_REG32(0x204) | ||
83 | #define CM_FCLKEN3_CORE PRCM_REG32(0x208) | ||
84 | #define CM_ICLKEN1_CORE PRCM_REG32(0x210) | ||
85 | #define CM_ICLKEN2_CORE PRCM_REG32(0x214) | ||
86 | #define CM_ICLKEN3_CORE PRCM_REG32(0x218) | ||
87 | #define CM_ICLKEN4_CORE PRCM_REG32(0x21C) | ||
88 | #define CM_IDLEST1_CORE PRCM_REG32(0x220) | ||
89 | #define CM_IDLEST2_CORE PRCM_REG32(0x224) | ||
90 | #define CM_IDLEST3_CORE PRCM_REG32(0x228) | ||
91 | #define CM_IDLEST4_CORE PRCM_REG32(0x22C) | ||
92 | #define CM_AUTOIDLE1_CORE PRCM_REG32(0x230) | ||
93 | #define CM_AUTOIDLE2_CORE PRCM_REG32(0x234) | ||
94 | #define CM_AUTOIDLE3_CORE PRCM_REG32(0x238) | ||
95 | #define CM_AUTOIDLE4_CORE PRCM_REG32(0x23C) | ||
96 | #define CM_CLKSEL1_CORE PRCM_REG32(0x240) | ||
97 | #define CM_CLKSEL2_CORE PRCM_REG32(0x244) | ||
98 | #define CM_CLKSTCTRL_CORE PRCM_REG32(0x248) | ||
99 | #define PM_WKEN1_CORE PRCM_REG32(0x2A0) | ||
100 | #define PM_WKEN2_CORE PRCM_REG32(0x2A4) | ||
101 | #define PM_WKST1_CORE PRCM_REG32(0x2B0) | ||
102 | #define PM_WKST2_CORE PRCM_REG32(0x2B4) | ||
103 | #define PM_WKDEP_CORE PRCM_REG32(0x2C8) | ||
104 | #define PM_PWSTCTRL_CORE PRCM_REG32(0x2E0) | ||
105 | #define PM_PWSTST_CORE PRCM_REG32(0x2E4) | ||
106 | |||
107 | /* GFX */ | ||
108 | #define CM_FCLKEN_GFX PRCM_REG32(0x300) | ||
109 | #define CM_ICLKEN_GFX PRCM_REG32(0x310) | ||
110 | #define CM_IDLEST_GFX PRCM_REG32(0x320) | ||
111 | #define CM_CLKSEL_GFX PRCM_REG32(0x340) | ||
112 | #define CM_CLKSTCTRL_GFX PRCM_REG32(0x348) | ||
113 | #define RM_RSTCTRL_GFX PRCM_REG32(0x350) | ||
114 | #define RM_RSTST_GFX PRCM_REG32(0x358) | ||
115 | #define PM_WKDEP_GFX PRCM_REG32(0x3C8) | ||
116 | #define PM_PWSTCTRL_GFX PRCM_REG32(0x3E0) | ||
117 | #define PM_PWSTST_GFX PRCM_REG32(0x3E4) | ||
118 | |||
119 | /* WAKE-UP */ | ||
120 | #define CM_FCLKEN_WKUP PRCM_REG32(0x400) | ||
121 | #define CM_ICLKEN_WKUP PRCM_REG32(0x410) | ||
122 | #define CM_IDLEST_WKUP PRCM_REG32(0x420) | ||
123 | #define CM_AUTOIDLE_WKUP PRCM_REG32(0x430) | ||
124 | #define CM_CLKSEL_WKUP PRCM_REG32(0x440) | ||
125 | #define RM_RSTCTRL_WKUP PRCM_REG32(0x450) | ||
126 | #define RM_RSTTIME_WKUP PRCM_REG32(0x454) | ||
127 | #define RM_RSTST_WKUP PRCM_REG32(0x458) | ||
128 | #define PM_WKEN_WKUP PRCM_REG32(0x4A0) | ||
129 | #define PM_WKST_WKUP PRCM_REG32(0x4B0) | ||
130 | |||
131 | /* CLOCKS */ | ||
132 | #define CM_CLKEN_PLL PRCM_REG32(0x500) | ||
133 | #define CM_IDLEST_CKGEN PRCM_REG32(0x520) | ||
134 | #define CM_AUTOIDLE_PLL PRCM_REG32(0x530) | ||
135 | #define CM_CLKSEL1_PLL PRCM_REG32(0x540) | ||
136 | #define CM_CLKSEL2_PLL PRCM_REG32(0x544) | ||
137 | |||
138 | /* DSP */ | ||
139 | #define CM_FCLKEN_DSP PRCM_REG32(0x800) | ||
140 | #define CM_ICLKEN_DSP PRCM_REG32(0x810) | ||
141 | #define CM_IDLEST_DSP PRCM_REG32(0x820) | ||
142 | #define CM_AUTOIDLE_DSP PRCM_REG32(0x830) | ||
143 | #define CM_CLKSEL_DSP PRCM_REG32(0x840) | ||
144 | #define CM_CLKSTCTRL_DSP PRCM_REG32(0x848) | ||
145 | #define RM_RSTCTRL_DSP PRCM_REG32(0x850) | ||
146 | #define RM_RSTST_DSP PRCM_REG32(0x858) | ||
147 | #define PM_WKEN_DSP PRCM_REG32(0x8A0) | ||
148 | #define PM_WKDEP_DSP PRCM_REG32(0x8C8) | ||
149 | #define PM_PWSTCTRL_DSP PRCM_REG32(0x8E0) | ||
150 | #define PM_PWSTST_DSP PRCM_REG32(0x8E4) | ||
151 | #define PRCM_IRQSTATUS_DSP PRCM_REG32(0x8F0) | ||
152 | #define PRCM_IRQENABLE_DSP PRCM_REG32(0x8F4) | ||
153 | |||
154 | /* IVA */ | ||
155 | #define PRCM_IRQSTATUS_IVA PRCM_REG32(0x8F8) | ||
156 | #define PRCM_IRQENABLE_IVA PRCM_REG32(0x8FC) | ||
157 | |||
158 | /* Modem on 2430 */ | ||
159 | #define CM_FCLKEN_MDM PRCM_REG32(0xC00) | ||
160 | #define CM_ICLKEN_MDM PRCM_REG32(0xC10) | ||
161 | #define CM_IDLEST_MDM PRCM_REG32(0xC20) | ||
162 | #define CM_CLKSEL_MDM PRCM_REG32(0xC40) | ||
163 | |||
164 | /* FIXME: Move to header for 2430 */ | ||
165 | #define DISP_BASE (OMAP24XX_L4_IO_BASE+0x50000) | ||
166 | #define DISP_REG32(offset) __REG32(DISP_BASE + (offset)) | ||
167 | |||
168 | #define OMAP24XX_GPMC_BASE (L3_24XX_BASE + 0xa000) | ||
169 | #define GPMC_BASE (OMAP24XX_GPMC_BASE) | ||
170 | #define GPMC_REG32(offset) __REG32(GPMC_BASE + (offset)) | ||
171 | |||
172 | #define GPT1_BASE (OMAP24XX_GPT1) | ||
173 | #define GPT1_REG32(offset) __REG32(GPT1_BASE + (offset)) | ||
174 | |||
175 | /* Misc sysconfig */ | ||
176 | #define DISPC_SYSCONFIG DISP_REG32(0x410) | ||
177 | #define SPI_BASE (OMAP24XX_L4_IO_BASE+0x98000) | ||
178 | #define MCSPI1_SYSCONFIG __REG32(SPI_BASE + 0x10) | ||
179 | #define MCSPI2_SYSCONFIG __REG32(SPI_BASE+0x2000 + 0x10) | ||
180 | |||
181 | //#define DSP_MMU_SYSCONFIG 0x5A000010 | ||
182 | #define CAMERA_MMU_SYSCONFIG __REG32(DISP_BASE+0x2C10) | ||
183 | //#define IVA_MMU_SYSCONFIG 0x5D000010 | ||
184 | //#define DSP_DMA_SYSCONFIG 0x00FCC02C | ||
185 | #define CAMERA_DMA_SYSCONFIG __REG32(DISP_BASE+0x282C) | ||
186 | #define SYSTEM_DMA_SYSCONFIG __REG32(DISP_BASE+0x602C) | ||
187 | #define GPMC_SYSCONFIG GPMC_REG32(0x010) | ||
188 | #define MAILBOXES_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x94010) | ||
189 | #define UART1_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6A054) | ||
190 | #define UART2_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6C054) | ||
191 | #define UART3_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6E054) | ||
192 | //#define IVA_SYSCONFIG 0x5C060010 | ||
193 | #define SDRC_SYSCONFIG __REG32(OMAP24XX_SDRC_BASE+0x10) | ||
194 | #define SMS_SYSCONFIG __REG32(OMAP24XX_SMS_BASE+0x10) | ||
195 | #define SSI_SYSCONFIG __REG32(DISP_BASE+0x8010) | ||
196 | //#define VLYNQ_SYSCONFIG 0x67FFFE10 | ||
197 | |||
198 | /* rkw - good cannidates for PM_ to start what nm was trying */ | ||
199 | #define OMAP24XX_GPT2 (OMAP24XX_L4_IO_BASE+0x2A000) | ||
200 | #define OMAP24XX_GPT3 (OMAP24XX_L4_IO_BASE+0x78000) | ||
201 | #define OMAP24XX_GPT4 (OMAP24XX_L4_IO_BASE+0x7A000) | ||
202 | #define OMAP24XX_GPT5 (OMAP24XX_L4_IO_BASE+0x7C000) | ||
203 | #define OMAP24XX_GPT6 (OMAP24XX_L4_IO_BASE+0x7E000) | ||
204 | #define OMAP24XX_GPT7 (OMAP24XX_L4_IO_BASE+0x80000) | ||
205 | #define OMAP24XX_GPT8 (OMAP24XX_L4_IO_BASE+0x82000) | ||
206 | #define OMAP24XX_GPT9 (OMAP24XX_L4_IO_BASE+0x84000) | ||
207 | #define OMAP24XX_GPT10 (OMAP24XX_L4_IO_BASE+0x86000) | ||
208 | #define OMAP24XX_GPT11 (OMAP24XX_L4_IO_BASE+0x88000) | ||
209 | #define OMAP24XX_GPT12 (OMAP24XX_L4_IO_BASE+0x8A000) | ||
210 | |||
211 | #define GPTIMER1_SYSCONFIG GPT1_REG32(0x010) | ||
212 | #define GPTIMER2_SYSCONFIG __REG32(OMAP24XX_GPT2 + 0x10) | ||
213 | #define GPTIMER3_SYSCONFIG __REG32(OMAP24XX_GPT3 + 0x10) | ||
214 | #define GPTIMER4_SYSCONFIG __REG32(OMAP24XX_GPT4 + 0x10) | ||
215 | #define GPTIMER5_SYSCONFIG __REG32(OMAP24XX_GPT5 + 0x10) | ||
216 | #define GPTIMER6_SYSCONFIG __REG32(OMAP24XX_GPT6 + 0x10) | ||
217 | #define GPTIMER7_SYSCONFIG __REG32(OMAP24XX_GPT7 + 0x10) | ||
218 | #define GPTIMER8_SYSCONFIG __REG32(OMAP24XX_GPT8 + 0x10) | ||
219 | #define GPTIMER9_SYSCONFIG __REG32(OMAP24XX_GPT9 + 0x10) | ||
220 | #define GPTIMER10_SYSCONFIG __REG32(OMAP24XX_GPT10 + 0x10) | ||
221 | #define GPTIMER11_SYSCONFIG __REG32(OMAP24XX_GPT11 + 0x10) | ||
222 | #define GPTIMER12_SYSCONFIG __REG32(OMAP24XX_GPT12 + 0x10) | ||
223 | |||
224 | #define GPIOX_BASE(X) (OMAP24XX_GPIO_BASE+(0x2000*((X)-1))) | ||
225 | |||
226 | #define GPIO1_SYSCONFIG __REG32((GPIOX_BASE(1)+0x10)) | ||
227 | #define GPIO2_SYSCONFIG __REG32((GPIOX_BASE(2)+0x10)) | ||
228 | #define GPIO3_SYSCONFIG __REG32((GPIOX_BASE(3)+0x10)) | ||
229 | #define GPIO4_SYSCONFIG __REG32((GPIOX_BASE(4)+0x10)) | ||
230 | |||
231 | /* GP TIMER 1 */ | ||
232 | #define GPTIMER1_TISTAT GPT1_REG32(0x014) | ||
233 | #define GPTIMER1_TISR GPT1_REG32(0x018) | ||
234 | #define GPTIMER1_TIER GPT1_REG32(0x01C) | ||
235 | #define GPTIMER1_TWER GPT1_REG32(0x020) | ||
236 | #define GPTIMER1_TCLR GPT1_REG32(0x024) | ||
237 | #define GPTIMER1_TCRR GPT1_REG32(0x028) | ||
238 | #define GPTIMER1_TLDR GPT1_REG32(0x02C) | ||
239 | #define GPTIMER1_TTGR GPT1_REG32(0x030) | ||
240 | #define GPTIMER1_TWPS GPT1_REG32(0x034) | ||
241 | #define GPTIMER1_TMAR GPT1_REG32(0x038) | ||
242 | #define GPTIMER1_TCAR1 GPT1_REG32(0x03C) | ||
243 | #define GPTIMER1_TSICR GPT1_REG32(0x040) | ||
244 | #define GPTIMER1_TCAR2 GPT1_REG32(0x044) | ||
245 | |||
246 | /* rkw -- base fix up please... */ | ||
247 | #define GPTIMER3_TISR __REG32(OMAP24XX_L4_IO_BASE+0x78018) | ||
248 | |||
249 | /* SDRC */ | ||
250 | #define SDRC_DLLA_CTRL __REG32(OMAP24XX_SDRC_BASE+0x060) | ||
251 | #define SDRC_DLLA_STATUS __REG32(OMAP24XX_SDRC_BASE+0x064) | ||
252 | #define SDRC_DLLB_CTRL __REG32(OMAP24XX_SDRC_BASE+0x068) | ||
253 | #define SDRC_DLLB_STATUS __REG32(OMAP24XX_SDRC_BASE+0x06C) | ||
254 | #define SDRC_POWER __REG32(OMAP24XX_SDRC_BASE+0x070) | ||
255 | #define SDRC_MR_0 __REG32(OMAP24XX_SDRC_BASE+0x084) | ||
256 | |||
257 | /* GPIO 1 */ | ||
258 | #define GPIO1_BASE GPIOX_BASE(1) | ||
259 | #define GPIO1_REG32(offset) __REG32(GPIO1_BASE + (offset)) | ||
260 | #define GPIO1_IRQENABLE1 GPIO1_REG32(0x01C) | ||
261 | #define GPIO1_IRQSTATUS1 GPIO1_REG32(0x018) | ||
262 | #define GPIO1_IRQENABLE2 GPIO1_REG32(0x02C) | ||
263 | #define GPIO1_IRQSTATUS2 GPIO1_REG32(0x028) | ||
264 | #define GPIO1_WAKEUPENABLE GPIO1_REG32(0x020) | ||
265 | #define GPIO1_RISINGDETECT GPIO1_REG32(0x048) | ||
266 | #define GPIO1_DATAIN GPIO1_REG32(0x038) | ||
267 | #define GPIO1_OE GPIO1_REG32(0x034) | ||
268 | #define GPIO1_DATAOUT GPIO1_REG32(0x03C) | ||
269 | |||
270 | /* GPIO2 */ | ||
271 | #define GPIO2_BASE GPIOX_BASE(2) | ||
272 | #define GPIO2_REG32(offset) __REG32(GPIO2_BASE + (offset)) | ||
273 | #define GPIO2_IRQENABLE1 GPIO2_REG32(0x01C) | ||
274 | #define GPIO2_IRQSTATUS1 GPIO2_REG32(0x018) | ||
275 | #define GPIO2_IRQENABLE2 GPIO2_REG32(0x02C) | ||
276 | #define GPIO2_IRQSTATUS2 GPIO2_REG32(0x028) | ||
277 | #define GPIO2_WAKEUPENABLE GPIO2_REG32(0x020) | ||
278 | #define GPIO2_RISINGDETECT GPIO2_REG32(0x048) | ||
279 | #define GPIO2_DATAIN GPIO2_REG32(0x038) | ||
280 | #define GPIO2_OE GPIO2_REG32(0x034) | ||
281 | #define GPIO2_DATAOUT GPIO2_REG32(0x03C) | ||
282 | |||
283 | /* GPIO 3 */ | ||
284 | #define GPIO3_BASE GPIOX_BASE(3) | ||
285 | #define GPIO3_REG32(offset) __REG32(GPIO3_BASE + (offset)) | ||
286 | #define GPIO3_IRQENABLE1 GPIO3_REG32(0x01C) | ||
287 | #define GPIO3_IRQSTATUS1 GPIO3_REG32(0x018) | ||
288 | #define GPIO3_IRQENABLE2 GPIO3_REG32(0x02C) | ||
289 | #define GPIO3_IRQSTATUS2 GPIO3_REG32(0x028) | ||
290 | #define GPIO3_WAKEUPENABLE GPIO3_REG32(0x020) | ||
291 | #define GPIO3_RISINGDETECT GPIO3_REG32(0x048) | ||
292 | #define GPIO3_FALLINGDETECT GPIO3_REG32(0x04C) | ||
293 | #define GPIO3_DATAIN GPIO3_REG32(0x038) | ||
294 | #define GPIO3_OE GPIO3_REG32(0x034) | ||
295 | #define GPIO3_DATAOUT GPIO3_REG32(0x03C) | ||
296 | #define GPIO3_DEBOUNCENABLE GPIO3_REG32(0x050) | ||
297 | #define GPIO3_DEBOUNCINGTIME GPIO3_REG32(0x054) | ||
298 | |||
299 | /* GPIO 4 */ | ||
300 | #define GPIO4_BASE GPIOX_BASE(4) | ||
301 | #define GPIO4_REG32(offset) __REG32(GPIO4_BASE + (offset)) | ||
302 | #define GPIO4_IRQENABLE1 GPIO4_REG32(0x01C) | ||
303 | #define GPIO4_IRQSTATUS1 GPIO4_REG32(0x018) | ||
304 | #define GPIO4_IRQENABLE2 GPIO4_REG32(0x02C) | ||
305 | #define GPIO4_IRQSTATUS2 GPIO4_REG32(0x028) | ||
306 | #define GPIO4_WAKEUPENABLE GPIO4_REG32(0x020) | ||
307 | #define GPIO4_RISINGDETECT GPIO4_REG32(0x048) | ||
308 | #define GPIO4_FALLINGDETECT GPIO4_REG32(0x04C) | ||
309 | #define GPIO4_DATAIN GPIO4_REG32(0x038) | ||
310 | #define GPIO4_OE GPIO4_REG32(0x034) | ||
311 | #define GPIO4_DATAOUT GPIO4_REG32(0x03C) | ||
312 | #define GPIO4_DEBOUNCENABLE GPIO4_REG32(0x050) | ||
313 | #define GPIO4_DEBOUNCINGTIME GPIO4_REG32(0x054) | ||
314 | |||
315 | |||
316 | /* IO CONFIG */ | ||
317 | #define CONTROL_BASE (OMAP24XX_CTRL_BASE) | ||
318 | #define CONTROL_REG32(offset) __REG32(CONTROL_BASE + (offset)) | ||
319 | |||
320 | #define CONTROL_PADCONF_SPI1_NCS2 CONTROL_REG32(0x104) | ||
321 | #define CONTROL_PADCONF_SYS_XTALOUT CONTROL_REG32(0x134) | ||
322 | #define CONTROL_PADCONF_UART1_RX CONTROL_REG32(0x0C8) | ||
323 | #define CONTROL_PADCONF_MCBSP1_DX CONTROL_REG32(0x10C) | ||
324 | #define CONTROL_PADCONF_GPMC_NCS4 CONTROL_REG32(0x090) | ||
325 | #define CONTROL_PADCONF_DSS_D5 CONTROL_REG32(0x0B8) | ||
326 | #define CONTROL_PADCONF_DSS_D9 CONTROL_REG32(0x0BC) | ||
327 | #define CONTROL_PADCONF_DSS_D13 CONTROL_REG32(0x0C0) | ||
328 | #define CONTROL_PADCONF_DSS_VSYNC CONTROL_REG32(0x0CC) | ||
329 | |||
330 | /* CONTROL */ | ||
331 | #define CONTROL_DEVCONF CONTROL_REG32(0x274) | ||
332 | |||
333 | /* INTERRUPT CONTROLLER */ | ||
334 | #define INTC_BASE (OMAP24XX_L4_IO_BASE+0xfe000) | ||
335 | #define INTC_REG32(offset) __REG32(INTC_BASE + (offset)) | ||
336 | |||
337 | #define INTC1_U_BASE INTC_REG32(0x000) | ||
338 | #define INTC_MIR0 INTC_REG32(0x084) | ||
339 | #define INTC_MIR_SET0 INTC_REG32(0x08C) | ||
340 | #define INTC_MIR_CLEAR0 INTC_REG32(0x088) | ||
341 | #define INTC_ISR_CLEAR0 INTC_REG32(0x094) | ||
342 | #define INTC_MIR1 INTC_REG32(0x0A4) | ||
343 | #define INTC_MIR_SET1 INTC_REG32(0x0AC) | ||
344 | #define INTC_MIR_CLEAR1 INTC_REG32(0x0A8) | ||
345 | #define INTC_ISR_CLEAR1 INTC_REG32(0x0B4) | ||
346 | #define INTC_MIR2 INTC_REG32(0x0C4) | ||
347 | #define INTC_MIR_SET2 INTC_REG32(0x0CC) | ||
348 | #define INTC_MIR_CLEAR2 INTC_REG32(0x0C8) | ||
349 | #define INTC_ISR_CLEAR2 INTC_REG32(0x0D4) | ||
350 | #define INTC_SIR_IRQ INTC_REG32(0x040) | ||
351 | #define INTC_CONTROL INTC_REG32(0x048) | ||
352 | #define INTC_ILR11 INTC_REG32(0x12C) | ||
353 | #define INTC_ILR32 INTC_REG32(0x180) | ||
354 | #define INTC_ILR37 INTC_REG32(0x194) | ||
355 | #define INTC_SYSCONFIG INTC_REG32(0x010) | ||
356 | |||
357 | /* RAM FIREWALL */ | ||
358 | #define RAMFW_BASE (0x68005000) | ||
359 | #define RAMFW_REG32(offset) __REG32(RAMFW_BASE + (offset)) | ||
360 | |||
361 | #define RAMFW_REQINFOPERM0 RAMFW_REG32(0x048) | ||
362 | #define RAMFW_READPERM0 RAMFW_REG32(0x050) | ||
363 | #define RAMFW_WRITEPERM0 RAMFW_REG32(0x058) | ||
364 | |||
365 | /* GPMC CS1 FPGA ON USER INTERFACE MODULE */ | ||
366 | //#define DEBUG_BOARD_LED_REGISTER 0x04000014 | ||
367 | |||
368 | /* GPMC CS0 */ | ||
369 | #define GPMC_CONFIG1_0 GPMC_REG32(0x060) | ||
370 | #define GPMC_CONFIG2_0 GPMC_REG32(0x064) | ||
371 | #define GPMC_CONFIG3_0 GPMC_REG32(0x068) | ||
372 | #define GPMC_CONFIG4_0 GPMC_REG32(0x06C) | ||
373 | #define GPMC_CONFIG5_0 GPMC_REG32(0x070) | ||
374 | #define GPMC_CONFIG6_0 GPMC_REG32(0x074) | ||
375 | #define GPMC_CONFIG7_0 GPMC_REG32(0x078) | ||
376 | |||
377 | /* GPMC CS1 */ | ||
378 | #define GPMC_CONFIG1_1 GPMC_REG32(0x090) | ||
379 | #define GPMC_CONFIG2_1 GPMC_REG32(0x094) | ||
380 | #define GPMC_CONFIG3_1 GPMC_REG32(0x098) | ||
381 | #define GPMC_CONFIG4_1 GPMC_REG32(0x09C) | ||
382 | #define GPMC_CONFIG5_1 GPMC_REG32(0x0a0) | ||
383 | #define GPMC_CONFIG6_1 GPMC_REG32(0x0a4) | ||
384 | #define GPMC_CONFIG7_1 GPMC_REG32(0x0a8) | ||
385 | |||
386 | /* DSS */ | ||
387 | #define DSS_CONTROL DISP_REG32(0x040) | ||
388 | #define DISPC_CONTROL DISP_REG32(0x440) | ||
389 | #define DISPC_SYSSTATUS DISP_REG32(0x414) | ||
390 | #define DISPC_IRQSTATUS DISP_REG32(0x418) | ||
391 | #define DISPC_IRQENABLE DISP_REG32(0x41C) | ||
392 | #define DISPC_CONFIG DISP_REG32(0x444) | ||
393 | #define DISPC_DEFAULT_COLOR0 DISP_REG32(0x44C) | ||
394 | #define DISPC_DEFAULT_COLOR1 DISP_REG32(0x450) | ||
395 | #define DISPC_TRANS_COLOR0 DISP_REG32(0x454) | ||
396 | #define DISPC_TRANS_COLOR1 DISP_REG32(0x458) | ||
397 | #define DISPC_LINE_NUMBER DISP_REG32(0x460) | ||
398 | #define DISPC_TIMING_H DISP_REG32(0x464) | ||
399 | #define DISPC_TIMING_V DISP_REG32(0x468) | ||
400 | #define DISPC_POL_FREQ DISP_REG32(0x46C) | ||
401 | #define DISPC_DIVISOR DISP_REG32(0x470) | ||
402 | #define DISPC_SIZE_DIG DISP_REG32(0x478) | ||
403 | #define DISPC_SIZE_LCD DISP_REG32(0x47C) | ||
404 | #define DISPC_GFX_BA0 DISP_REG32(0x480) | ||
405 | #define DISPC_GFX_BA1 DISP_REG32(0x484) | ||
406 | #define DISPC_GFX_POSITION DISP_REG32(0x488) | ||
407 | #define DISPC_GFX_SIZE DISP_REG32(0x48C) | ||
408 | #define DISPC_GFX_ATTRIBUTES DISP_REG32(0x4A0) | ||
409 | #define DISPC_GFX_FIFO_THRESHOLD DISP_REG32(0x4A4) | ||
410 | #define DISPC_GFX_ROW_INC DISP_REG32(0x4AC) | ||
411 | #define DISPC_GFX_PIXEL_INC DISP_REG32(0x4B0) | ||
412 | #define DISPC_GFX_WINDOW_SKIP DISP_REG32(0x4B4) | ||
413 | #define DISPC_GFX_TABLE_BA DISP_REG32(0x4B8) | ||
414 | #define DISPC_DATA_CYCLE1 DISP_REG32(0x5D4) | ||
415 | #define DISPC_DATA_CYCLE2 DISP_REG32(0x5D8) | ||
416 | #define DISPC_DATA_CYCLE3 DISP_REG32(0x5DC) | ||
417 | |||
418 | /* Wake up define for board */ | ||
419 | #define GPIO97 (1 << 1) | ||
420 | #define GPIO88 (1 << 24) | ||
421 | |||
422 | #endif /* __ASSEMBLER__ */ | ||
423 | 27 | ||
424 | #endif | 28 | #endif |
425 | 29 | ||
diff --git a/include/asm-arm/arch-omap/sram.h b/include/asm-arm/arch-omap/sram.h index e72ccbf0fe..6fc0dd57b7 100644 --- a/include/asm-arm/arch-omap/sram.h +++ b/include/asm-arm/arch-omap/sram.h | |||
@@ -20,6 +20,8 @@ extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, | |||
20 | u32 mem_type); | 20 | u32 mem_type); |
21 | extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); | 21 | extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); |
22 | 22 | ||
23 | extern unsigned long omap_fb_sram_start; | ||
24 | extern unsigned long omap_fb_sram_size; | ||
23 | 25 | ||
24 | /* Do not use these */ | 26 | /* Do not use these */ |
25 | extern void sram_reprogram_clock(u32 ckctl, u32 dpllctl); | 27 | extern void sram_reprogram_clock(u32 ckctl, u32 dpllctl); |
diff --git a/include/asm-arm/arch-omap/system.h b/include/asm-arm/arch-omap/system.h index 6724a81bd1..67970d1a20 100644 --- a/include/asm-arm/arch-omap/system.h +++ b/include/asm-arm/arch-omap/system.h | |||
@@ -9,12 +9,13 @@ | |||
9 | 9 | ||
10 | #include <asm/mach-types.h> | 10 | #include <asm/mach-types.h> |
11 | #include <asm/hardware.h> | 11 | #include <asm/hardware.h> |
12 | #include <asm/arch/prcm.h> | ||
13 | 12 | ||
14 | #ifndef CONFIG_MACH_VOICEBLUE | 13 | #ifndef CONFIG_MACH_VOICEBLUE |
15 | #define voiceblue_reset() do {} while (0) | 14 | #define voiceblue_reset() do {} while (0) |
16 | #endif | 15 | #endif |
17 | 16 | ||
17 | extern void omap_prcm_arch_reset(char mode); | ||
18 | |||
18 | static inline void arch_idle(void) | 19 | static inline void arch_idle(void) |
19 | { | 20 | { |
20 | cpu_do_idle(); | 21 | cpu_do_idle(); |
@@ -38,24 +39,12 @@ static inline void omap1_arch_reset(char mode) | |||
38 | omap_writew(1, ARM_RSTCT1); | 39 | omap_writew(1, ARM_RSTCT1); |
39 | } | 40 | } |
40 | 41 | ||
41 | static inline void omap2_arch_reset(char mode) | ||
42 | { | ||
43 | u32 rate; | ||
44 | struct clk *vclk, *sclk; | ||
45 | |||
46 | vclk = clk_get(NULL, "virt_prcm_set"); | ||
47 | sclk = clk_get(NULL, "sys_ck"); | ||
48 | rate = clk_get_rate(sclk); | ||
49 | clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */ | ||
50 | RM_RSTCTRL_WKUP |= 2; | ||
51 | } | ||
52 | |||
53 | static inline void arch_reset(char mode) | 42 | static inline void arch_reset(char mode) |
54 | { | 43 | { |
55 | if (!cpu_is_omap24xx()) | 44 | if (!cpu_is_omap24xx()) |
56 | omap1_arch_reset(mode); | 45 | omap1_arch_reset(mode); |
57 | else | 46 | else |
58 | omap2_arch_reset(mode); | 47 | omap_prcm_arch_reset(mode); |
59 | } | 48 | } |
60 | 49 | ||
61 | #endif | 50 | #endif |
diff --git a/include/asm-arm/arch-pxa/dma.h b/include/asm-arm/arch-pxa/dma.h index 3e88a2a02a..a008150abc 100644 --- a/include/asm-arm/arch-pxa/dma.h +++ b/include/asm-arm/arch-pxa/dma.h | |||
@@ -24,27 +24,29 @@ typedef struct pxa_dma_desc { | |||
24 | volatile u32 dcmd; /* DCMD value for the current transfer */ | 24 | volatile u32 dcmd; /* DCMD value for the current transfer */ |
25 | } pxa_dma_desc; | 25 | } pxa_dma_desc; |
26 | 26 | ||
27 | typedef enum { | ||
28 | DMA_PRIO_HIGH = 0, | ||
29 | DMA_PRIO_MEDIUM = 1, | ||
30 | DMA_PRIO_LOW = 2 | ||
31 | } pxa_dma_prio; | ||
32 | |||
27 | #if defined(CONFIG_PXA27x) | 33 | #if defined(CONFIG_PXA27x) |
28 | 34 | ||
29 | #define PXA_DMA_CHANNELS 32 | 35 | #define PXA_DMA_CHANNELS 32 |
30 | #define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 16 : 8) | ||
31 | 36 | ||
32 | typedef enum { | 37 | #define pxa_for_each_dma_prio(ch, prio) \ |
33 | DMA_PRIO_HIGH = 0, | 38 | for ( \ |
34 | DMA_PRIO_MEDIUM = 8, | 39 | ch = prio * 4; \ |
35 | DMA_PRIO_LOW = 16 | 40 | ch != (4 << prio) + 16; \ |
36 | } pxa_dma_prio; | 41 | ch = (ch + 1 == (4 << prio)) ? (prio * 4 + 16) : (ch + 1) \ |
42 | ) | ||
37 | 43 | ||
38 | #elif defined(CONFIG_PXA25x) | 44 | #elif defined(CONFIG_PXA25x) |
39 | 45 | ||
40 | #define PXA_DMA_CHANNELS 16 | 46 | #define PXA_DMA_CHANNELS 16 |
41 | #define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 8 : 4) | ||
42 | 47 | ||
43 | typedef enum { | 48 | #define pxa_for_each_dma_prio(ch, prio) \ |
44 | DMA_PRIO_HIGH = 0, | 49 | for (ch = prio * 4; ch != (4 << prio); ch++) |
45 | DMA_PRIO_MEDIUM = 4, | ||
46 | DMA_PRIO_LOW = 8 | ||
47 | } pxa_dma_prio; | ||
48 | 50 | ||
49 | #endif | 51 | #endif |
50 | 52 | ||
diff --git a/include/asm-arm/arch-pxa/ohci.h b/include/asm-arm/arch-pxa/ohci.h index 7da8956906..e848a47128 100644 --- a/include/asm-arm/arch-pxa/ohci.h +++ b/include/asm-arm/arch-pxa/ohci.h | |||
@@ -11,6 +11,8 @@ struct pxaohci_platform_data { | |||
11 | #define PMM_NPS_MODE 1 | 11 | #define PMM_NPS_MODE 1 |
12 | #define PMM_GLOBAL_MODE 2 | 12 | #define PMM_GLOBAL_MODE 2 |
13 | #define PMM_PERPORT_MODE 3 | 13 | #define PMM_PERPORT_MODE 3 |
14 | |||
15 | int power_budget; | ||
14 | }; | 16 | }; |
15 | 17 | ||
16 | extern void pxa_set_ohci_info(struct pxaohci_platform_data *info); | 18 | extern void pxa_set_ohci_info(struct pxaohci_platform_data *info); |
diff --git a/include/asm-arm/arch-pxa/pxa2xx_spi.h b/include/asm-arm/arch-pxa/pxa2xx_spi.h new file mode 100644 index 0000000000..915590c391 --- /dev/null +++ b/include/asm-arm/arch-pxa/pxa2xx_spi.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef PXA2XX_SPI_H_ | ||
20 | #define PXA2XX_SPI_H_ | ||
21 | |||
22 | #define PXA2XX_CS_ASSERT (0x01) | ||
23 | #define PXA2XX_CS_DEASSERT (0x02) | ||
24 | |||
25 | #if defined(CONFIG_PXA25x) | ||
26 | #define CLOCK_SPEED_HZ 3686400 | ||
27 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/2/(x+1))<<8)&0x0000ff00) | ||
28 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
29 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
30 | #define SSP_TIMEOUT_SCALE (2712) | ||
31 | #elif defined(CONFIG_PXA27x) | ||
32 | #define CLOCK_SPEED_HZ 13000000 | ||
33 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
34 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
35 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
36 | #define SSP_TIMEOUT_SCALE (769) | ||
37 | #endif | ||
38 | |||
39 | #define SSP_TIMEOUT(x) ((x*10000)/SSP_TIMEOUT_SCALE) | ||
40 | #define SSP1_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(1))))) | ||
41 | #define SSP2_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(2))))) | ||
42 | #define SSP3_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(3))))) | ||
43 | |||
44 | enum pxa_ssp_type { | ||
45 | SSP_UNDEFINED = 0, | ||
46 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | ||
47 | PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */ | ||
48 | PXA27x_SSP, | ||
49 | }; | ||
50 | |||
51 | /* device.platform_data for SSP controller devices */ | ||
52 | struct pxa2xx_spi_master { | ||
53 | enum pxa_ssp_type ssp_type; | ||
54 | u32 clock_enable; | ||
55 | u16 num_chipselect; | ||
56 | u8 enable_dma; | ||
57 | }; | ||
58 | |||
59 | /* spi_board_info.controller_data for SPI slave devices, | ||
60 | * copied to spi_device.platform_data ... mostly for dma tuning | ||
61 | */ | ||
62 | struct pxa2xx_spi_chip { | ||
63 | u8 tx_threshold; | ||
64 | u8 rx_threshold; | ||
65 | u8 dma_burst_size; | ||
66 | u32 timeout_microsecs; | ||
67 | u8 enable_loopback; | ||
68 | void (*cs_control)(u32 command); | ||
69 | }; | ||
70 | |||
71 | #endif /*PXA2XX_SPI_H_*/ | ||
diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h index 9d7f87375a..7480f4e8d9 100644 --- a/include/asm-arm/arch-rpc/hardware.h +++ b/include/asm-arm/arch-rpc/hardware.h | |||
@@ -46,7 +46,6 @@ | |||
46 | #define SCREEN_END 0xdfc00000 | 46 | #define SCREEN_END 0xdfc00000 |
47 | #define SCREEN_BASE 0xdf800000 | 47 | #define SCREEN_BASE 0xdf800000 |
48 | 48 | ||
49 | #define FLUSH_BASE 0xdf000000 | ||
50 | #define UNCACHEABLE_ADDR 0xdf010000 | 49 | #define UNCACHEABLE_ADDR 0xdf010000 |
51 | 50 | ||
52 | /* | 51 | /* |
@@ -59,8 +58,6 @@ | |||
59 | #define PCIO_BASE IOMEM(0xe0010000) | 58 | #define PCIO_BASE IOMEM(0xe0010000) |
60 | #define FLOPPYDMA_BASE IOMEM(0xe002a000) | 59 | #define FLOPPYDMA_BASE IOMEM(0xe002a000) |
61 | 60 | ||
62 | #define FLUSH_BASE_PHYS 0x00000000 /* ROM */ | ||
63 | |||
64 | #define vidc_writel(val) __raw_writel(val, VIDC_BASE) | 61 | #define vidc_writel(val) __raw_writel(val, VIDC_BASE) |
65 | 62 | ||
66 | #define IO_EC_EASI_BASE 0x81400000 | 63 | #define IO_EC_EASI_BASE 0x81400000 |
diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h index 0592cb3f0c..303c424ce6 100644 --- a/include/asm-arm/arch-rpc/memory.h +++ b/include/asm-arm/arch-rpc/memory.h | |||
@@ -30,4 +30,10 @@ | |||
30 | #define __virt_to_bus(x) __virt_to_phys(x) | 30 | #define __virt_to_bus(x) __virt_to_phys(x) |
31 | #define __bus_to_virt(x) __phys_to_virt(x) | 31 | #define __bus_to_virt(x) __phys_to_virt(x) |
32 | 32 | ||
33 | /* | ||
34 | * Cache flushing area - ROM | ||
35 | */ | ||
36 | #define FLUSH_BASE_PHYS 0x00000000 | ||
37 | #define FLUSH_BASE 0xdf000000 | ||
38 | |||
33 | #endif | 39 | #endif |
diff --git a/include/asm-arm/arch-s3c2410/entry-macro.S b/include/asm-arm/arch-s3c2410/entry-macro.S index cc06b1bd37..894c35cf3b 100644 --- a/include/asm-arm/arch-s3c2410/entry-macro.S +++ b/include/asm-arm/arch-s3c2410/entry-macro.S | |||
@@ -6,116 +6,83 @@ | |||
6 | * This file is licensed under the terms of the GNU General Public | 6 | * This file is licensed under the terms of the GNU General Public |
7 | * License version 2. This program is licensed "as is" without any | 7 | * License version 2. This program is licensed "as is" without any |
8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
9 | */ | ||
10 | |||
11 | /* We have a problem that the INTOFFSET register does not always | ||
12 | * show one interrupt. Occasionally we get two interrupts through | ||
13 | * the prioritiser, and this causes the INTOFFSET register to show | ||
14 | * what looks like the logical-or of the two interrupt numbers. | ||
15 | * | ||
16 | * Thanks to Klaus, Shannon, et al for helping to debug this problem | ||
17 | */ | ||
18 | |||
19 | #define INTPND (0x10) | ||
20 | #define INTOFFSET (0x14) | ||
21 | #define EXTINTPEND (0xa8) | ||
22 | #define EXTINTMASK (0xa4) | ||
9 | 23 | ||
10 | * Modifications: | ||
11 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA | ||
12 | */ | ||
13 | #include <asm/hardware.h> | 24 | #include <asm/hardware.h> |
14 | #include <asm/arch/irqs.h> | 25 | #include <asm/arch/irqs.h> |
15 | 26 | ||
16 | |||
17 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 27 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
18 | 28 | ||
19 | mov \tmp, #S3C24XX_VA_IRQ | 29 | mov \base, #S3C24XX_VA_IRQ |
20 | ldr \irqnr, [ \tmp, #0x14 ] @ get irq no | 30 | |
21 | 30000: | 31 | ldr \irqstat, [ \base, #INTPND] |
22 | teq \irqnr, #4 | 32 | bics \irqnr, \irqstat, #3<<4 @@ only an GPIO IRQ |
23 | teqne \irqnr, #5 | 33 | beq 2000f |
24 | beq 1002f @ external irq reg | 34 | |
25 | 35 | @@ try the interrupt offset register, since it is there | |
26 | @ debug check to see if interrupt reported is the same | 36 | |
27 | @ as the offset.... | 37 | ldr \irqnr, [ \base, #INTOFFSET ] |
28 | 38 | mov \tmp, #1 | |
29 | teq \irqnr, #0 | 39 | tst \irqstat, \tmp, lsl \irqnr |
30 | beq 20002f | 40 | addne \irqnr, \irqnr, #IRQ_EINT0 |
31 | ldr \irqstat, [ \tmp, #0x10 ] @ INTPND | 41 | bne 1001f |
32 | mov \irqstat, \irqstat, lsr \irqnr | 42 | |
33 | tst \irqstat, #1 | 43 | @@ the number specified is not a valid irq, so try |
34 | bne 20002f | 44 | @@ and work it out for ourselves |
35 | 45 | ||
36 | /* debug/warning if we get an invalud response from the | 46 | mov \irqnr, #IRQ_EINT0 @@ start here |
37 | * INTOFFSET register */ | 47 | b 3000f |
38 | #if 1 | 48 | |
39 | stmfd r13!, { r0 - r4 , r8-r12, r14 } | 49 | 2000: |
40 | ldr r1, [ \tmp, #0x14 ] @ INTOFFSET | 50 | @@ load the GPIO interrupt register, and check it |
41 | ldr r2, [ \tmp, #0x10 ] @ INTPND | 51 | |
42 | ldr r3, [ \tmp, #0x00 ] @ SRCPND | 52 | add \tmp, \base, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ |
43 | adr r0, 20003f | 53 | ldr \irqstat, [ \tmp, # EXTINTPEND ] |
44 | bl printk | 54 | ldr \irqnr, [ \tmp, # EXTINTMASK ] |
45 | b 20004f | 55 | bics \irqstat, \irqstat, \irqnr |
46 | 56 | beq 1001f | |
47 | 20003: | 57 | |
48 | .ascii "<7>irq: err - bad offset %d, intpnd=%08x, srcpnd=%08x\n" | 58 | mov \irqnr, #(IRQ_EINT4 - 4) |
49 | .byte 0 | 59 | |
50 | .align 4 | 60 | @@ work out which irq (if any) we got |
51 | 20004: | 61 | 3000: |
52 | mov r1, #1 | 62 | movs \tmp, \irqstat, lsl#16 |
53 | mov \tmp, #S3C24XX_VA_IRQ | 63 | addeq \irqnr, \irqnr, #16 |
54 | ldmfd r13!, { r0 - r4 , r8-r12, r14 } | 64 | moveq \irqstat, \irqstat, lsr#16 |
55 | #endif | 65 | tst \irqstat, #0xff |
56 | 66 | addeq \irqnr, \irqnr, #8 | |
57 | @ try working out interrupt number for ourselves | 67 | moveq \irqstat, \irqstat, lsr#8 |
58 | mov \irqnr, #0 | 68 | tst \irqstat, #0xf |
59 | ldr \irqstat, [ \tmp, #0x10 ] @ INTPND | 69 | addeq \irqnr, \irqnr, #4 |
60 | 10021: | 70 | moveq \irqstat, \irqstat, lsr#4 |
61 | movs \irqstat, \irqstat, lsr#1 | 71 | tst \irqstat, #0x3 |
62 | bcs 30000b @ try and re-start the proccess | 72 | addeq \irqnr, \irqnr, #2 |
63 | add \irqnr, \irqnr, #1 | 73 | moveq \irqstat, \irqstat, lsr#2 |
64 | cmp \irqnr, #32 | 74 | tst \irqstat, #0x1 |
65 | ble 10021b | 75 | addeq \irqnr, \irqnr, #1 |
66 | 76 | ||
67 | @ found no interrupt, set Z flag and leave | 77 | @@ we have the value |
68 | movs \irqnr, #0 | 78 | movs \irqnr, \irqnr |
69 | b 1001f | 79 | |
70 | |||
71 | 20005: | ||
72 | 20002: @ exit | ||
73 | @ we base the s3c2410x interrupts at 16 and above to allow | ||
74 | @ isa peripherals to have their standard interrupts, also | ||
75 | @ ensure that Z flag is un-set on exit | ||
76 | |||
77 | @ note, we cannot be sure if we get IRQ_EINT0 (0) that | ||
78 | @ there is simply no interrupt pending, so in all other | ||
79 | @ cases we jump to say we have found something, otherwise | ||
80 | @ we check to see if the interrupt really is assrted | ||
81 | adds \irqnr, \irqnr, #IRQ_EINT0 | ||
82 | teq \irqnr, #IRQ_EINT0 | ||
83 | bne 1001f @ exit | ||
84 | ldr \irqstat, [ \tmp, #0x10 ] @ INTPND | ||
85 | teq \irqstat, #0 | ||
86 | moveq \irqnr, #0 | ||
87 | b 1001f | ||
88 | |||
89 | @ we get here from no main or external interrupts pending | ||
90 | 1002: | ||
91 | add \tmp, \tmp, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ | ||
92 | ldr \irqstat, [ \tmp, # 0xa8 ] @ EXTINTPEND | ||
93 | ldr \irqnr, [ \tmp, # 0xa4 ] @ EXTINTMASK | ||
94 | |||
95 | bic \irqstat, \irqstat, \irqnr @ clear masked irqs | ||
96 | |||
97 | mov \irqnr, #IRQ_EINT4 @ start extint nos | ||
98 | mov \irqstat, \irqstat, lsr#4 @ ignore bottom 4 bits | ||
99 | 10021: | ||
100 | movs \irqstat, \irqstat, lsr#1 | ||
101 | bcs 1004f | ||
102 | add \irqnr, \irqnr, #1 | ||
103 | cmp \irqnr, #IRQ_EINT23 | ||
104 | ble 10021b | ||
105 | |||
106 | @ found no interrupt, set Z flag and leave | ||
107 | movs \irqnr, #0 | ||
108 | |||
109 | 1004: @ ensure Z flag clear in case our MOVS shifted out the last bit | ||
110 | teq \irqnr, #0 | ||
111 | 1001: | 80 | 1001: |
112 | @ exit irq routine | 81 | @@ exit here, Z flag unset if IRQ |
113 | .endm | ||
114 | 82 | ||
83 | .endm | ||
115 | 84 | ||
116 | /* currently don't need an disable_fiq macro */ | 85 | /* currently don't need an disable_fiq macro */ |
117 | 86 | ||
118 | .macro disable_fiq | 87 | .macro disable_fiq |
119 | .endm | 88 | .endm |
120 | |||
121 | |||
diff --git a/include/asm-arm/arch-s3c2410/leds-gpio.h b/include/asm-arm/arch-s3c2410/leds-gpio.h new file mode 100644 index 0000000000..f07ed04062 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/leds-gpio.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/leds-gpio.h | ||
2 | * | ||
3 | * (c) 2006 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * S3C24XX - LEDs GPIO connector | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_LEDSGPIO_H | ||
15 | #define __ASM_ARCH_LEDSGPIO_H "leds-gpio.h" | ||
16 | |||
17 | #define S3C24XX_LEDF_ACTLOW (1<<0) /* LED is on when GPIO low */ | ||
18 | #define S3C24XX_LEDF_TRISTATE (1<<1) /* tristate to turn off */ | ||
19 | |||
20 | struct s3c24xx_led_platdata { | ||
21 | unsigned int gpio; | ||
22 | unsigned int flags; | ||
23 | |||
24 | char *name; | ||
25 | char *def_trigger; | ||
26 | }; | ||
27 | |||
28 | #endif /* __ASM_ARCH_LEDSGPIO_H */ | ||
diff --git a/include/asm-arm/arch-s3c2410/spi-gpio.h b/include/asm-arm/arch-s3c2410/spi-gpio.h new file mode 100644 index 0000000000..258c00bca2 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/spi-gpio.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/spi.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C2410 - SPI Controller platfrom_device info | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_SPIGPIO_H | ||
14 | #define __ASM_ARCH_SPIGPIO_H __FILE__ | ||
15 | |||
16 | struct s3c2410_spigpio_info; | ||
17 | struct spi_board_info; | ||
18 | |||
19 | struct s3c2410_spigpio_info { | ||
20 | unsigned long pin_clk; | ||
21 | unsigned long pin_mosi; | ||
22 | unsigned long pin_miso; | ||
23 | |||
24 | unsigned long board_size; | ||
25 | struct spi_board_info *board_info; | ||
26 | |||
27 | void (*chip_select)(struct s3c2410_spigpio_info *spi, int cs); | ||
28 | }; | ||
29 | |||
30 | |||
31 | #endif /* __ASM_ARCH_SPIGPIO_H */ | ||
diff --git a/include/asm-arm/arch-s3c2410/spi.h b/include/asm-arm/arch-s3c2410/spi.h new file mode 100644 index 0000000000..4029a1a1ab --- /dev/null +++ b/include/asm-arm/arch-s3c2410/spi.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/spi.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C2410 - SPI Controller platform_device info | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_SPI_H | ||
14 | #define __ASM_ARCH_SPI_H __FILE__ | ||
15 | |||
16 | struct s3c2410_spi_info; | ||
17 | struct spi_board_info; | ||
18 | |||
19 | struct s3c2410_spi_info { | ||
20 | unsigned long pin_cs; /* simple gpio cs */ | ||
21 | |||
22 | unsigned long board_size; | ||
23 | struct spi_board_info *board_info; | ||
24 | |||
25 | void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); | ||
26 | }; | ||
27 | |||
28 | |||
29 | #endif /* __ASM_ARCH_SPI_H */ | ||
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index 28711aaa49..ee008a5484 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h | |||
@@ -14,10 +14,6 @@ | |||
14 | 14 | ||
15 | #include <linux/config.h> | 15 | #include <linux/config.h> |
16 | 16 | ||
17 | /* Flushing areas */ | ||
18 | #define FLUSH_BASE_PHYS 0xe0000000 /* SA1100 zero bank */ | ||
19 | #define FLUSH_BASE 0xf5000000 | ||
20 | #define FLUSH_BASE_MINICACHE 0xf5800000 | ||
21 | #define UNCACHEABLE_ADDR 0xfa050000 | 17 | #define UNCACHEABLE_ADDR 0xfa050000 |
22 | 18 | ||
23 | 19 | ||
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h index 018a9f0e39..a29fac1387 100644 --- a/include/asm-arm/arch-sa1100/memory.h +++ b/include/asm-arm/arch-sa1100/memory.h | |||
@@ -91,4 +91,11 @@ void sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes); | |||
91 | 91 | ||
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | /* | ||
95 | * Cache flushing area - SA1100 zero bank | ||
96 | */ | ||
97 | #define FLUSH_BASE_PHYS 0xe0000000 | ||
98 | #define FLUSH_BASE 0xf5000000 | ||
99 | #define FLUSH_BASE_MINICACHE 0xf5100000 | ||
100 | |||
94 | #endif | 101 | #endif |
diff --git a/include/asm-arm/arch-shark/hardware.h b/include/asm-arm/arch-shark/hardware.h index 4d35f8c154..ecba452608 100644 --- a/include/asm-arm/arch-shark/hardware.h +++ b/include/asm-arm/arch-shark/hardware.h | |||
@@ -17,11 +17,6 @@ | |||
17 | */ | 17 | */ |
18 | #define IO_BASE 0xe0000000 | 18 | #define IO_BASE 0xe0000000 |
19 | 19 | ||
20 | /* | ||
21 | * RAM definitions | ||
22 | */ | ||
23 | #define FLUSH_BASE_PHYS 0x80000000 | ||
24 | |||
25 | #else | 20 | #else |
26 | 21 | ||
27 | #define IO_BASE 0 | 22 | #define IO_BASE 0 |
@@ -33,7 +28,6 @@ | |||
33 | #define ROMCARD_SIZE 0x08000000 | 28 | #define ROMCARD_SIZE 0x08000000 |
34 | #define ROMCARD_START 0x10000000 | 29 | #define ROMCARD_START 0x10000000 |
35 | 30 | ||
36 | #define FLUSH_BASE 0xdf000000 | ||
37 | #define PCIO_BASE 0xe0000000 | 31 | #define PCIO_BASE 0xe0000000 |
38 | 32 | ||
39 | 33 | ||
diff --git a/include/asm-arm/arch-shark/memory.h b/include/asm-arm/arch-shark/memory.h index 95a29b4bc5..6968d6103e 100644 --- a/include/asm-arm/arch-shark/memory.h +++ b/include/asm-arm/arch-shark/memory.h | |||
@@ -39,4 +39,10 @@ static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsig | |||
39 | #define __virt_to_bus(x) __virt_to_phys(x) | 39 | #define __virt_to_bus(x) __virt_to_phys(x) |
40 | #define __bus_to_virt(x) __phys_to_virt(x) | 40 | #define __bus_to_virt(x) __phys_to_virt(x) |
41 | 41 | ||
42 | /* | ||
43 | * Cache flushing area | ||
44 | */ | ||
45 | #define FLUSH_BASE_PHYS 0x80000000 | ||
46 | #define FLUSH_BASE 0xdf000000 | ||
47 | |||
42 | #endif | 48 | #endif |
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h index 7fb02138f5..5ab8216f52 100644 --- a/include/asm-arm/bug.h +++ b/include/asm-arm/bug.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _ASMARM_BUG_H | 2 | #define _ASMARM_BUG_H |
3 | 3 | ||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <linux/stddef.h> | ||
5 | 6 | ||
6 | #ifdef CONFIG_BUG | 7 | #ifdef CONFIG_BUG |
7 | #ifdef CONFIG_DEBUG_BUGVERBOSE | 8 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h index e3e8541ee6..63ca7412a4 100644 --- a/include/asm-arm/dma-mapping.h +++ b/include/asm-arm/dma-mapping.h | |||
@@ -47,7 +47,7 @@ static inline int dma_get_cache_alignment(void) | |||
47 | 47 | ||
48 | static inline int dma_is_consistent(dma_addr_t handle) | 48 | static inline int dma_is_consistent(dma_addr_t handle) |
49 | { | 49 | { |
50 | return 0; | 50 | return !!arch_is_coherent(); |
51 | } | 51 | } |
52 | 52 | ||
53 | /* | 53 | /* |
@@ -145,7 +145,9 @@ static inline dma_addr_t | |||
145 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, | 145 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, |
146 | enum dma_data_direction dir) | 146 | enum dma_data_direction dir) |
147 | { | 147 | { |
148 | consistent_sync(cpu_addr, size, dir); | 148 | if (!arch_is_coherent()) |
149 | consistent_sync(cpu_addr, size, dir); | ||
150 | |||
149 | return virt_to_dma(dev, (unsigned long)cpu_addr); | 151 | return virt_to_dma(dev, (unsigned long)cpu_addr); |
150 | } | 152 | } |
151 | #else | 153 | #else |
@@ -255,7 +257,9 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
255 | 257 | ||
256 | sg->dma_address = page_to_dma(dev, sg->page) + sg->offset; | 258 | sg->dma_address = page_to_dma(dev, sg->page) + sg->offset; |
257 | virt = page_address(sg->page) + sg->offset; | 259 | virt = page_address(sg->page) + sg->offset; |
258 | consistent_sync(virt, sg->length, dir); | 260 | |
261 | if (!arch_is_coherent()) | ||
262 | consistent_sync(virt, sg->length, dir); | ||
259 | } | 263 | } |
260 | 264 | ||
261 | return nents; | 265 | return nents; |
@@ -310,14 +314,16 @@ static inline void | |||
310 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, | 314 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, |
311 | enum dma_data_direction dir) | 315 | enum dma_data_direction dir) |
312 | { | 316 | { |
313 | consistent_sync((void *)dma_to_virt(dev, handle), size, dir); | 317 | if (!arch_is_coherent()) |
318 | consistent_sync((void *)dma_to_virt(dev, handle), size, dir); | ||
314 | } | 319 | } |
315 | 320 | ||
316 | static inline void | 321 | static inline void |
317 | dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, | 322 | dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size, |
318 | enum dma_data_direction dir) | 323 | enum dma_data_direction dir) |
319 | { | 324 | { |
320 | consistent_sync((void *)dma_to_virt(dev, handle), size, dir); | 325 | if (!arch_is_coherent()) |
326 | consistent_sync((void *)dma_to_virt(dev, handle), size, dir); | ||
321 | } | 327 | } |
322 | #else | 328 | #else |
323 | extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction); | 329 | extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction); |
@@ -347,7 +353,8 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, | |||
347 | 353 | ||
348 | for (i = 0; i < nents; i++, sg++) { | 354 | for (i = 0; i < nents; i++, sg++) { |
349 | char *virt = page_address(sg->page) + sg->offset; | 355 | char *virt = page_address(sg->page) + sg->offset; |
350 | consistent_sync(virt, sg->length, dir); | 356 | if (!arch_is_coherent()) |
357 | consistent_sync(virt, sg->length, dir); | ||
351 | } | 358 | } |
352 | } | 359 | } |
353 | 360 | ||
@@ -359,7 +366,8 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, | |||
359 | 366 | ||
360 | for (i = 0; i < nents; i++, sg++) { | 367 | for (i = 0; i < nents; i++, sg++) { |
361 | char *virt = page_address(sg->page) + sg->offset; | 368 | char *virt = page_address(sg->page) + sg->offset; |
362 | consistent_sync(virt, sg->length, dir); | 369 | if (!arch_is_coherent()) |
370 | consistent_sync(virt, sg->length, dir); | ||
363 | } | 371 | } |
364 | } | 372 | } |
365 | #else | 373 | #else |
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h index 6246bf8362..52bae088a1 100644 --- a/include/asm-arm/fpstate.h +++ b/include/asm-arm/fpstate.h | |||
@@ -26,7 +26,9 @@ | |||
26 | 26 | ||
27 | struct vfp_hard_struct { | 27 | struct vfp_hard_struct { |
28 | __u64 fpregs[16]; | 28 | __u64 fpregs[16]; |
29 | #if __LINUX_ARM_ARCH__ < 6 | ||
29 | __u32 fpmx_state; | 30 | __u32 fpmx_state; |
31 | #endif | ||
30 | __u32 fpexc; | 32 | __u32 fpexc; |
31 | __u32 fpscr; | 33 | __u32 fpscr; |
32 | /* | 34 | /* |
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index afa5c3ea07..2092894075 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h | |||
@@ -172,10 +172,10 @@ static inline __deprecated void *bus_to_virt(unsigned long x) | |||
172 | * virt_addr_valid(k) indicates whether a virtual address is valid | 172 | * virt_addr_valid(k) indicates whether a virtual address is valid |
173 | */ | 173 | */ |
174 | #ifndef CONFIG_DISCONTIGMEM | 174 | #ifndef CONFIG_DISCONTIGMEM |
175 | #define ARCH_PFN_OFFSET (PHYS_PFN_OFFSET) | 175 | #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET |
176 | #define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) | 176 | #define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr)) |
177 | 177 | ||
178 | #define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)) | 178 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) |
179 | #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) | 179 | #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) |
180 | 180 | ||
181 | #define PHYS_TO_NID(addr) (0) | 181 | #define PHYS_TO_NID(addr) (0) |
@@ -187,8 +187,8 @@ static inline __deprecated void *bus_to_virt(unsigned long x) | |||
187 | * around in memory. | 187 | * around in memory. |
188 | */ | 188 | */ |
189 | #include <linux/numa.h> | 189 | #include <linux/numa.h> |
190 | #define arch_pfn_to_nid(pfn) (PFN_TO_NID(pfn)) | 190 | #define arch_pfn_to_nid(pfn) PFN_TO_NID(pfn) |
191 | #define arch_local_page_offset(pfn, nid) (LOCAL_MAP_NR((pfn) << PAGE_OFFSET)) | 191 | #define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT) |
192 | 192 | ||
193 | #define pfn_valid(pfn) \ | 193 | #define pfn_valid(pfn) \ |
194 | ({ \ | 194 | ({ \ |
@@ -234,6 +234,14 @@ static inline __deprecated void *bus_to_virt(unsigned long x) | |||
234 | #define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr)) | 234 | #define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr)) |
235 | #endif | 235 | #endif |
236 | 236 | ||
237 | /* | ||
238 | * Optional coherency support. Currently used only by selected | ||
239 | * Intel XSC3-based systems. | ||
240 | */ | ||
241 | #ifndef arch_is_coherent | ||
242 | #define arch_is_coherent() 0 | ||
243 | #endif | ||
244 | |||
237 | #endif | 245 | #endif |
238 | 246 | ||
239 | #include <asm-generic/memory_model.h> | 247 | #include <asm-generic/memory_model.h> |
diff --git a/include/asm-arm/numnodes.h b/include/asm-arm/numnodes.h deleted file mode 100644 index 8df36818eb..0000000000 --- a/include/asm-arm/numnodes.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/numnodes.h | ||
3 | * | ||
4 | * Copyright (C) 2002 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 | |||
11 | /* This declaration for the size of the NUMA (CONFIG_DISCONTIGMEM) | ||
12 | * memory node table is the default. | ||
13 | * | ||
14 | * A good place to override this value is include/asm/arch/memory.h. | ||
15 | */ | ||
16 | |||
17 | #ifndef __ASM_ARM_NUMNODES_H | ||
18 | #define __ASM_ARM_NUMNODES_H | ||
19 | |||
20 | #include <asm/memory.h> | ||
21 | |||
22 | #ifndef NODES_SHIFT | ||
23 | # define NODES_SHIFT 2 /* Normally, Max 4 Nodes */ | ||
24 | #endif | ||
25 | |||
26 | #endif | ||
diff --git a/include/asm-arm/pgtable-hwdef.h b/include/asm-arm/pgtable-hwdef.h index 1d033495cc..1bc1f997bd 100644 --- a/include/asm-arm/pgtable-hwdef.h +++ b/include/asm-arm/pgtable-hwdef.h | |||
@@ -73,6 +73,7 @@ | |||
73 | #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) | 73 | #define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0) |
74 | #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ | 74 | #define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ |
75 | #define PTE_EXT_APX (1 << 9) /* v6 */ | 75 | #define PTE_EXT_APX (1 << 9) /* v6 */ |
76 | #define PTE_EXT_COHERENT (1 << 9) /* XScale3 */ | ||
76 | #define PTE_EXT_SHARED (1 << 10) /* v6 */ | 77 | #define PTE_EXT_SHARED (1 << 10) /* v6 */ |
77 | #define PTE_EXT_NG (1 << 11) /* v6 */ | 78 | #define PTE_EXT_NG (1 << 11) /* v6 */ |
78 | 79 | ||
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index e595ae24ef..e85c08d78d 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
@@ -156,6 +156,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
156 | #define L_PTE_WRITE (1 << 5) | 156 | #define L_PTE_WRITE (1 << 5) |
157 | #define L_PTE_EXEC (1 << 6) | 157 | #define L_PTE_EXEC (1 << 6) |
158 | #define L_PTE_DIRTY (1 << 7) | 158 | #define L_PTE_DIRTY (1 << 7) |
159 | #define L_PTE_COHERENT (1 << 9) /* I/O coherent (xsc3) */ | ||
159 | #define L_PTE_SHARED (1 << 10) /* shared between CPUs (v6) */ | 160 | #define L_PTE_SHARED (1 << 10) /* shared between CPUs (v6) */ |
160 | #define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */ | 161 | #define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */ |
161 | 162 | ||
diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h index a9c75b2c31..8425260552 100644 --- a/include/asm-arm/procinfo.h +++ b/include/asm-arm/procinfo.h | |||
@@ -45,8 +45,6 @@ extern unsigned int elf_hwcap; | |||
45 | 45 | ||
46 | #endif /* __ASSEMBLY__ */ | 46 | #endif /* __ASSEMBLY__ */ |
47 | 47 | ||
48 | #define PROC_INFO_SZ 48 | ||
49 | |||
50 | #define HWCAP_SWP 1 | 48 | #define HWCAP_SWP 1 |
51 | #define HWCAP_HALF 2 | 49 | #define HWCAP_HALF 2 |
52 | #define HWCAP_THUMB 4 | 50 | #define HWCAP_THUMB 4 |
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h index 43ad4e5587..406ca97a8a 100644 --- a/include/asm-arm/spinlock.h +++ b/include/asm-arm/spinlock.h | |||
@@ -142,6 +142,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) | |||
142 | : "cc"); | 142 | : "cc"); |
143 | } | 143 | } |
144 | 144 | ||
145 | /* write_can_lock - would write_trylock() succeed? */ | ||
146 | #define __raw_write_can_lock(x) ((x)->lock == 0x80000000) | ||
147 | |||
145 | /* | 148 | /* |
146 | * Read locks are a bit more hairy: | 149 | * Read locks are a bit more hairy: |
147 | * - Exclusively load the lock value. | 150 | * - Exclusively load the lock value. |
@@ -198,4 +201,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw) | |||
198 | 201 | ||
199 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) | 202 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) |
200 | 203 | ||
204 | /* read_can_lock - would read_trylock() succeed? */ | ||
205 | #define __raw_read_can_lock(x) ((x)->lock < 0x80000000) | ||
206 | |||
201 | #endif /* __ASM_SPINLOCK_H */ | 207 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 95b3abf485..7c9568d303 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -127,6 +127,12 @@ static inline int cpu_is_xsc3(void) | |||
127 | } | 127 | } |
128 | #endif | 128 | #endif |
129 | 129 | ||
130 | #if !defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_CPU_XSC3) | ||
131 | #define cpu_is_xscale() 0 | ||
132 | #else | ||
133 | #define cpu_is_xscale() 1 | ||
134 | #endif | ||
135 | |||
130 | #define set_cr(x) \ | 136 | #define set_cr(x) \ |
131 | __asm__ __volatile__( \ | 137 | __asm__ __volatile__( \ |
132 | "mcr p15, 0, %0, c1, c0, 0 @ set CR" \ | 138 | "mcr p15, 0, %0, c1, c0, 0 @ set CR" \ |
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index 65ac305c2d..cbf39a56db 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h | |||
@@ -360,6 +360,24 @@ | |||
360 | #define __ARM_NR_usr32 (__ARM_NR_BASE+4) | 360 | #define __ARM_NR_usr32 (__ARM_NR_BASE+4) |
361 | #define __ARM_NR_set_tls (__ARM_NR_BASE+5) | 361 | #define __ARM_NR_set_tls (__ARM_NR_BASE+5) |
362 | 362 | ||
363 | /* | ||
364 | * The following syscalls are obsolete and no longer available for EABI. | ||
365 | */ | ||
366 | #if defined(__ARM_EABI__) && !defined(__KERNEL__) | ||
367 | #undef __NR_time | ||
368 | #undef __NR_umount | ||
369 | #undef __NR_stime | ||
370 | #undef __NR_alarm | ||
371 | #undef __NR_utime | ||
372 | #undef __NR_getrlimit | ||
373 | #undef __NR_select | ||
374 | #undef __NR_readdir | ||
375 | #undef __NR_mmap | ||
376 | #undef __NR_socketcall | ||
377 | #undef __NR_syscall | ||
378 | #undef __NR_ipc | ||
379 | #endif | ||
380 | |||
363 | #define __sys2(x) #x | 381 | #define __sys2(x) #x |
364 | #define __sys1(x) __sys2(x) | 382 | #define __sys1(x) __sys2(x) |
365 | 383 | ||
@@ -392,7 +410,8 @@ type name(void) { \ | |||
392 | __asm__ __volatile__ ( \ | 410 | __asm__ __volatile__ ( \ |
393 | __syscall(name) \ | 411 | __syscall(name) \ |
394 | : "=r" (__res_r0) \ | 412 | : "=r" (__res_r0) \ |
395 | : __SYS_REG_LIST() ); \ | 413 | : __SYS_REG_LIST() \ |
414 | : "memory" ); \ | ||
396 | __res = __res_r0; \ | 415 | __res = __res_r0; \ |
397 | __syscall_return(type,__res); \ | 416 | __syscall_return(type,__res); \ |
398 | } | 417 | } |
@@ -406,7 +425,8 @@ type name(type1 arg1) { \ | |||
406 | __asm__ __volatile__ ( \ | 425 | __asm__ __volatile__ ( \ |
407 | __syscall(name) \ | 426 | __syscall(name) \ |
408 | : "=r" (__res_r0) \ | 427 | : "=r" (__res_r0) \ |
409 | : __SYS_REG_LIST( "0" (__r0) ) ); \ | 428 | : __SYS_REG_LIST( "0" (__r0) ) \ |
429 | : "memory" ); \ | ||
410 | __res = __res_r0; \ | 430 | __res = __res_r0; \ |
411 | __syscall_return(type,__res); \ | 431 | __syscall_return(type,__res); \ |
412 | } | 432 | } |
@@ -421,7 +441,8 @@ type name(type1 arg1,type2 arg2) { \ | |||
421 | __asm__ __volatile__ ( \ | 441 | __asm__ __volatile__ ( \ |
422 | __syscall(name) \ | 442 | __syscall(name) \ |
423 | : "=r" (__res_r0) \ | 443 | : "=r" (__res_r0) \ |
424 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) ); \ | 444 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) \ |
445 | : "memory" ); \ | ||
425 | __res = __res_r0; \ | 446 | __res = __res_r0; \ |
426 | __syscall_return(type,__res); \ | 447 | __syscall_return(type,__res); \ |
427 | } | 448 | } |
@@ -438,7 +459,8 @@ type name(type1 arg1,type2 arg2,type3 arg3) { \ | |||
438 | __asm__ __volatile__ ( \ | 459 | __asm__ __volatile__ ( \ |
439 | __syscall(name) \ | 460 | __syscall(name) \ |
440 | : "=r" (__res_r0) \ | 461 | : "=r" (__res_r0) \ |
441 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) ); \ | 462 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) \ |
463 | : "memory" ); \ | ||
442 | __res = __res_r0; \ | 464 | __res = __res_r0; \ |
443 | __syscall_return(type,__res); \ | 465 | __syscall_return(type,__res); \ |
444 | } | 466 | } |
@@ -456,7 +478,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ | |||
456 | __asm__ __volatile__ ( \ | 478 | __asm__ __volatile__ ( \ |
457 | __syscall(name) \ | 479 | __syscall(name) \ |
458 | : "=r" (__res_r0) \ | 480 | : "=r" (__res_r0) \ |
459 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) ); \ | 481 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \ |
482 | : "memory" ); \ | ||
460 | __res = __res_r0; \ | 483 | __res = __res_r0; \ |
461 | __syscall_return(type,__res); \ | 484 | __syscall_return(type,__res); \ |
462 | } | 485 | } |
@@ -476,7 +499,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \ | |||
476 | __syscall(name) \ | 499 | __syscall(name) \ |
477 | : "=r" (__res_r0) \ | 500 | : "=r" (__res_r0) \ |
478 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ | 501 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ |
479 | "r" (__r3), "r" (__r4) ) ); \ | 502 | "r" (__r3), "r" (__r4) ) \ |
503 | : "memory" ); \ | ||
480 | __res = __res_r0; \ | 504 | __res = __res_r0; \ |
481 | __syscall_return(type,__res); \ | 505 | __syscall_return(type,__res); \ |
482 | } | 506 | } |
@@ -496,7 +520,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
496 | __syscall(name) \ | 520 | __syscall(name) \ |
497 | : "=r" (__res_r0) \ | 521 | : "=r" (__res_r0) \ |
498 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ | 522 | : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ |
499 | "r" (__r3), "r" (__r4), "r" (__r5) ) ); \ | 523 | "r" (__r3), "r" (__r4), "r" (__r5) ) \ |
524 | : "memory" ); \ | ||
500 | __res = __res_r0; \ | 525 | __res = __res_r0; \ |
501 | __syscall_return(type,__res); \ | 526 | __syscall_return(type,__res); \ |
502 | } | 527 | } |
diff --git a/include/asm-arm/vfpmacros.h b/include/asm-arm/vfpmacros.h index 15bd6e74c9..27fe028b4e 100644 --- a/include/asm-arm/vfpmacros.h +++ b/include/asm-arm/vfpmacros.h | |||
@@ -16,10 +16,18 @@ | |||
16 | 16 | ||
17 | @ read all the working registers back into the VFP | 17 | @ read all the working registers back into the VFP |
18 | .macro VFPFLDMIA, base | 18 | .macro VFPFLDMIA, base |
19 | #if __LINUX_ARM_ARCH__ < 6 | ||
19 | LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15} | 20 | LDC p11, cr0, [\base],#33*4 @ FLDMIAX \base!, {d0-d15} |
21 | #else | ||
22 | LDC p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d0-d15} | ||
23 | #endif | ||
20 | .endm | 24 | .endm |
21 | 25 | ||
22 | @ write all the working registers out of the VFP | 26 | @ write all the working registers out of the VFP |
23 | .macro VFPFSTMIA, base | 27 | .macro VFPFSTMIA, base |
28 | #if __LINUX_ARM_ARCH__ < 6 | ||
24 | STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15} | 29 | STC p11, cr0, [\base],#33*4 @ FSTMIAX \base!, {d0-d15} |
30 | #else | ||
31 | STC p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d0-d15} | ||
32 | #endif | ||
25 | .endm | 33 | .endm |
diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h index 1d63c2aa8e..b1c593b6db 100644 --- a/include/asm-cris/system.h +++ b/include/asm-cris/system.h | |||
@@ -8,7 +8,6 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | extern struct task_struct *resume(struct task_struct *prev, struct task_struct *next, int); | 10 | extern struct task_struct *resume(struct task_struct *prev, struct task_struct *next, int); |
11 | #define prepare_to_switch() do { } while(0) | ||
12 | #define switch_to(prev,next,last) last = resume(prev,next, \ | 11 | #define switch_to(prev,next,last) last = resume(prev,next, \ |
13 | (int)&((struct task_struct *)0)->thread) | 12 | (int)&((struct task_struct *)0)->thread) |
14 | 13 | ||
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h index 2627bbdf8a..bb2dfe4802 100644 --- a/include/asm-cris/unistd.h +++ b/include/asm-cris/unistd.h | |||
@@ -288,7 +288,7 @@ | |||
288 | #define __NR_mq_timedreceive (__NR_mq_open+3) | 288 | #define __NR_mq_timedreceive (__NR_mq_open+3) |
289 | #define __NR_mq_notify (__NR_mq_open+4) | 289 | #define __NR_mq_notify (__NR_mq_open+4) |
290 | #define __NR_mq_getsetattr (__NR_mq_open+5) | 290 | #define __NR_mq_getsetattr (__NR_mq_open+5) |
291 | #define __NR_sys_kexec_load 283 | 291 | #define __NR_kexec_load 283 |
292 | #define __NR_waitid 284 | 292 | #define __NR_waitid 284 |
293 | /* #define __NR_sys_setaltroot 285 */ | 293 | /* #define __NR_sys_setaltroot 285 */ |
294 | #define __NR_add_key 286 | 294 | #define __NR_add_key 286 |
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index f72ff0c4dc..1734ed91bc 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h | |||
@@ -18,8 +18,6 @@ | |||
18 | 18 | ||
19 | struct thread_struct; | 19 | struct thread_struct; |
20 | 20 | ||
21 | #define prepare_to_switch() do { } while(0) | ||
22 | |||
23 | /* | 21 | /* |
24 | * switch_to(prev, next) should switch from task `prev' to `next' | 22 | * switch_to(prev, next) should switch from task `prev' to `next' |
25 | * `prev' will never be the same as `next'. | 23 | * `prev' will never be the same as `next'. |
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h index 322531caa4..2662a3e12d 100644 --- a/include/asm-frv/unistd.h +++ b/include/asm-frv/unistd.h | |||
@@ -289,7 +289,7 @@ | |||
289 | #define __NR_mq_timedreceive (__NR_mq_open+3) | 289 | #define __NR_mq_timedreceive (__NR_mq_open+3) |
290 | #define __NR_mq_notify (__NR_mq_open+4) | 290 | #define __NR_mq_notify (__NR_mq_open+4) |
291 | #define __NR_mq_getsetattr (__NR_mq_open+5) | 291 | #define __NR_mq_getsetattr (__NR_mq_open+5) |
292 | #define __NR_sys_kexec_load 283 | 292 | #define __NR_kexec_load 283 |
293 | #define __NR_waitid 284 | 293 | #define __NR_waitid 284 |
294 | /* #define __NR_sys_setaltroot 285 */ | 294 | /* #define __NR_sys_setaltroot 285 */ |
295 | #define __NR_add_key 286 | 295 | #define __NR_add_key 286 |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 358e4d309c..c2059a3a06 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -159,17 +159,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
159 | #define lazy_mmu_prot_update(pte) do { } while (0) | 159 | #define lazy_mmu_prot_update(pte) do { } while (0) |
160 | #endif | 160 | #endif |
161 | 161 | ||
162 | #ifndef __HAVE_ARCH_MULTIPLE_ZERO_PAGE | 162 | #ifndef __HAVE_ARCH_MOVE_PTE |
163 | #define move_pte(pte, prot, old_addr, new_addr) (pte) | 163 | #define move_pte(pte, prot, old_addr, new_addr) (pte) |
164 | #else | ||
165 | #define move_pte(pte, prot, old_addr, new_addr) \ | ||
166 | ({ \ | ||
167 | pte_t newpte = (pte); \ | ||
168 | if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \ | ||
169 | pte_page(pte) == ZERO_PAGE(old_addr)) \ | ||
170 | newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \ | ||
171 | newpte; \ | ||
172 | }) | ||
173 | #endif | 164 | #endif |
174 | 165 | ||
175 | /* | 166 | /* |
diff --git a/include/asm-h8300/system.h b/include/asm-h8300/system.h index dfe96c7121..8e81cf665e 100644 --- a/include/asm-h8300/system.h +++ b/include/asm-h8300/system.h | |||
@@ -4,8 +4,6 @@ | |||
4 | #include <linux/config.h> /* get configuration macros */ | 4 | #include <linux/config.h> /* get configuration macros */ |
5 | #include <linux/linkage.h> | 5 | #include <linux/linkage.h> |
6 | 6 | ||
7 | #define prepare_to_switch() do { } while(0) | ||
8 | |||
9 | /* | 7 | /* |
10 | * switch_to(n) should switch tasks to task ptr, first checking that | 8 | * switch_to(n) should switch tasks to task ptr, first checking that |
11 | * ptr isn't the current task, in which case it does nothing. This | 9 | * ptr isn't the current task, in which case it does nothing. This |
diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h index 56a4a5686c..adb0515937 100644 --- a/include/asm-h8300/unistd.h +++ b/include/asm-h8300/unistd.h | |||
@@ -285,7 +285,7 @@ | |||
285 | #define __NR_mq_timedreceive (__NR_mq_open+3) | 285 | #define __NR_mq_timedreceive (__NR_mq_open+3) |
286 | #define __NR_mq_notify (__NR_mq_open+4) | 286 | #define __NR_mq_notify (__NR_mq_open+4) |
287 | #define __NR_mq_getsetattr (__NR_mq_open+5) | 287 | #define __NR_mq_getsetattr (__NR_mq_open+5) |
288 | #define __NR_sys_kexec_load 283 | 288 | #define __NR_kexec_load 283 |
289 | #define __NR_waitid 284 | 289 | #define __NR_waitid 284 |
290 | /* #define __NR_sys_setaltroot 285 */ | 290 | /* #define __NR_sys_setaltroot 285 */ |
291 | #define __NR_add_key 286 | 291 | #define __NR_add_key 286 |
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index ff9ac8d19e..288233fd77 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
@@ -139,6 +139,8 @@ void switch_ipi_to_APIC_timer(void *cpumask); | |||
139 | 139 | ||
140 | extern int timer_over_8254; | 140 | extern int timer_over_8254; |
141 | 141 | ||
142 | extern int modern_apic(void); | ||
143 | |||
142 | #else /* !CONFIG_X86_LOCAL_APIC */ | 144 | #else /* !CONFIG_X86_LOCAL_APIC */ |
143 | static inline void lapic_shutdown(void) { } | 145 | static inline void lapic_shutdown(void) { } |
144 | 146 | ||
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h index 22d80ece95..4ddce5296a 100644 --- a/include/asm-i386/atomic.h +++ b/include/asm-i386/atomic.h | |||
@@ -183,6 +183,7 @@ static __inline__ int atomic_add_return(int i, atomic_t *v) | |||
183 | { | 183 | { |
184 | int __i; | 184 | int __i; |
185 | #ifdef CONFIG_M386 | 185 | #ifdef CONFIG_M386 |
186 | unsigned long flags; | ||
186 | if(unlikely(boot_cpu_data.x86==3)) | 187 | if(unlikely(boot_cpu_data.x86==3)) |
187 | goto no_xadd; | 188 | goto no_xadd; |
188 | #endif | 189 | #endif |
@@ -196,10 +197,10 @@ static __inline__ int atomic_add_return(int i, atomic_t *v) | |||
196 | 197 | ||
197 | #ifdef CONFIG_M386 | 198 | #ifdef CONFIG_M386 |
198 | no_xadd: /* Legacy 386 processor */ | 199 | no_xadd: /* Legacy 386 processor */ |
199 | local_irq_disable(); | 200 | local_irq_save(flags); |
200 | __i = atomic_read(v); | 201 | __i = atomic_read(v); |
201 | atomic_set(v, i + __i); | 202 | atomic_set(v, i + __i); |
202 | local_irq_enable(); | 203 | local_irq_restore(flags); |
203 | return i + __i; | 204 | return i + __i; |
204 | #endif | 205 | #endif |
205 | } | 206 | } |
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h index 5c0b5876b9..b44bfc6239 100644 --- a/include/asm-i386/cpufeature.h +++ b/include/asm-i386/cpufeature.h | |||
@@ -71,6 +71,7 @@ | |||
71 | #define X86_FEATURE_P4 (3*32+ 7) /* P4 */ | 71 | #define X86_FEATURE_P4 (3*32+ 7) /* P4 */ |
72 | #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ | 72 | #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ |
73 | #define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ | 73 | #define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ |
74 | #define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ | ||
74 | 75 | ||
75 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 76 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
76 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 77 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
diff --git a/include/asm-i386/e820.h b/include/asm-i386/e820.h index edf65be21a..ca82acb8cb 100644 --- a/include/asm-i386/e820.h +++ b/include/asm-i386/e820.h | |||
@@ -35,6 +35,10 @@ struct e820map { | |||
35 | }; | 35 | }; |
36 | 36 | ||
37 | extern struct e820map e820; | 37 | extern struct e820map e820; |
38 | |||
39 | extern int e820_all_mapped(unsigned long start, unsigned long end, | ||
40 | unsigned type); | ||
41 | |||
38 | #endif/*!__ASSEMBLY__*/ | 42 | #endif/*!__ASSEMBLY__*/ |
39 | 43 | ||
40 | #endif/*__E820_HEADER*/ | 44 | #endif/*__E820_HEADER*/ |
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h index 16ef9f996e..7f1a8a6ee3 100644 --- a/include/asm-i386/hpet.h +++ b/include/asm-i386/hpet.h | |||
@@ -89,6 +89,7 @@ | |||
89 | * then 32 bit HPET counter wrapsaround in less than 0.5 sec. | 89 | * then 32 bit HPET counter wrapsaround in less than 0.5 sec. |
90 | */ | 90 | */ |
91 | #define HPET_MIN_PERIOD (100000UL) | 91 | #define HPET_MIN_PERIOD (100000UL) |
92 | #define HPET_TICK_RATE (HZ * 100000UL) | ||
92 | 93 | ||
93 | extern unsigned long hpet_tick; /* hpet clks count per tick */ | 94 | extern unsigned long hpet_tick; /* hpet clks count per tick */ |
94 | extern unsigned long hpet_address; /* hpet memory map physical address */ | 95 | extern unsigned long hpet_address; /* hpet memory map physical address */ |
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h index 152d0baa57..bc1d6edae1 100644 --- a/include/asm-i386/i387.h +++ b/include/asm-i386/i387.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/kernel_stat.h> | ||
16 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
17 | #include <asm/sigcontext.h> | 18 | #include <asm/sigcontext.h> |
18 | #include <asm/user.h> | 19 | #include <asm/user.h> |
@@ -38,17 +39,38 @@ extern void init_fpu(struct task_struct *); | |||
38 | extern void kernel_fpu_begin(void); | 39 | extern void kernel_fpu_begin(void); |
39 | #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) | 40 | #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) |
40 | 41 | ||
42 | /* We need a safe address that is cheap to find and that is already | ||
43 | in L1 during context switch. The best choices are unfortunately | ||
44 | different for UP and SMP */ | ||
45 | #ifdef CONFIG_SMP | ||
46 | #define safe_address (__per_cpu_offset[0]) | ||
47 | #else | ||
48 | #define safe_address (kstat_cpu(0).cpustat.user) | ||
49 | #endif | ||
50 | |||
41 | /* | 51 | /* |
42 | * These must be called with preempt disabled | 52 | * These must be called with preempt disabled |
43 | */ | 53 | */ |
44 | static inline void __save_init_fpu( struct task_struct *tsk ) | 54 | static inline void __save_init_fpu( struct task_struct *tsk ) |
45 | { | 55 | { |
56 | /* Use more nops than strictly needed in case the compiler | ||
57 | varies code */ | ||
46 | alternative_input( | 58 | alternative_input( |
47 | "fnsave %1 ; fwait ;" GENERIC_NOP2, | 59 | "fnsave %[fx] ;fwait;" GENERIC_NOP8 GENERIC_NOP4, |
48 | "fxsave %1 ; fnclex", | 60 | "fxsave %[fx]\n" |
61 | "bt $7,%[fsw] ; jnc 1f ; fnclex\n1:", | ||
49 | X86_FEATURE_FXSR, | 62 | X86_FEATURE_FXSR, |
50 | "m" (tsk->thread.i387.fxsave) | 63 | [fx] "m" (tsk->thread.i387.fxsave), |
51 | :"memory"); | 64 | [fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory"); |
65 | /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception | ||
66 | is pending. Clear the x87 state here by setting it to fixed | ||
67 | values. safe_address is a random variable that should be in L1 */ | ||
68 | alternative_input( | ||
69 | GENERIC_NOP8 GENERIC_NOP2, | ||
70 | "emms\n\t" /* clear stack tags */ | ||
71 | "fildl %[addr]", /* set F?P to defined value */ | ||
72 | X86_FEATURE_FXSAVE_LEAK, | ||
73 | [addr] "m" (safe_address)); | ||
52 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | 74 | task_thread_info(tsk)->status &= ~TS_USEDFPU; |
53 | } | 75 | } |
54 | 76 | ||
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h index 51c4e5fe60..d92e253f7f 100644 --- a/include/asm-i386/io_apic.h +++ b/include/asm-i386/io_apic.h | |||
@@ -200,6 +200,7 @@ extern int io_apic_get_unique_id (int ioapic, int apic_id); | |||
200 | extern int io_apic_get_version (int ioapic); | 200 | extern int io_apic_get_version (int ioapic); |
201 | extern int io_apic_get_redir_entries (int ioapic); | 201 | extern int io_apic_get_redir_entries (int ioapic); |
202 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low); | 202 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low); |
203 | extern int timer_uses_ioapic_pin_0; | ||
203 | #endif /* CONFIG_ACPI */ | 204 | #endif /* CONFIG_ACPI */ |
204 | 205 | ||
205 | extern int (*ioapic_renumber_irq)(int ioapic, int irq); | 206 | extern int (*ioapic_renumber_irq)(int ioapic, int irq); |
diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h index 62113d3bfd..770bf6da8c 100644 --- a/include/asm-i386/mpspec.h +++ b/include/asm-i386/mpspec.h | |||
@@ -18,7 +18,6 @@ extern void find_smp_config (void); | |||
18 | extern void get_smp_config (void); | 18 | extern void get_smp_config (void); |
19 | extern int nr_ioapics; | 19 | extern int nr_ioapics; |
20 | extern int apic_version [MAX_APICS]; | 20 | extern int apic_version [MAX_APICS]; |
21 | extern int mp_bus_id_to_type [MAX_MP_BUSSES]; | ||
22 | extern int mp_irq_entries; | 21 | extern int mp_irq_entries; |
23 | extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES]; | 22 | extern struct mpc_config_intsrc mp_irqs [MAX_IRQ_SOURCES]; |
24 | extern int mpc_default_type; | 23 | extern int mpc_default_type; |
diff --git a/include/asm-i386/numnodes.h b/include/asm-i386/numnodes.h deleted file mode 100644 index a61f38c817..0000000000 --- a/include/asm-i386/numnodes.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | #ifndef _ASM_MAX_NUMNODES_H | ||
2 | #define _ASM_MAX_NUMNODES_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifdef CONFIG_X86_NUMAQ | ||
7 | |||
8 | /* Max 16 Nodes */ | ||
9 | #define NODES_SHIFT 4 | ||
10 | |||
11 | #elif defined(CONFIG_ACPI_SRAT) | ||
12 | |||
13 | /* Max 8 Nodes */ | ||
14 | #define NODES_SHIFT 3 | ||
15 | |||
16 | #endif /* CONFIG_X86_NUMAQ */ | ||
17 | |||
18 | #endif /* _ASM_MAX_NUMNODES_H */ | ||
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h index 27bde973ab..2756d4b04c 100644 --- a/include/asm-i386/pgtable-2level.h +++ b/include/asm-i386/pgtable-2level.h | |||
@@ -18,6 +18,9 @@ | |||
18 | #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) | 18 | #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval) |
19 | #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) | 19 | #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) |
20 | 20 | ||
21 | #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) | ||
22 | #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) | ||
23 | |||
21 | #define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte_low, 0)) | 24 | #define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte_low, 0)) |
22 | #define pte_same(a, b) ((a).pte_low == (b).pte_low) | 25 | #define pte_same(a, b) ((a).pte_low == (b).pte_low) |
23 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | 26 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h index 36a5aa63cb..dccb1b3337 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-i386/pgtable-3level.h | |||
@@ -85,6 +85,26 @@ static inline void pud_clear (pud_t * pud) { } | |||
85 | #define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ | 85 | #define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ |
86 | pmd_index(address)) | 86 | pmd_index(address)) |
87 | 87 | ||
88 | /* | ||
89 | * For PTEs and PDEs, we must clear the P-bit first when clearing a page table | ||
90 | * entry, so clear the bottom half first and enforce ordering with a compiler | ||
91 | * barrier. | ||
92 | */ | ||
93 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | ||
94 | { | ||
95 | ptep->pte_low = 0; | ||
96 | smp_wmb(); | ||
97 | ptep->pte_high = 0; | ||
98 | } | ||
99 | |||
100 | static inline void pmd_clear(pmd_t *pmd) | ||
101 | { | ||
102 | u32 *tmp = (u32 *)pmd; | ||
103 | *tmp = 0; | ||
104 | smp_wmb(); | ||
105 | *(tmp + 1) = 0; | ||
106 | } | ||
107 | |||
88 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 108 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
89 | { | 109 | { |
90 | pte_t res; | 110 | pte_t res; |
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index ee056c41a9..672c3f76b9 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h | |||
@@ -204,12 +204,10 @@ extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC; | |||
204 | extern unsigned long pg0[]; | 204 | extern unsigned long pg0[]; |
205 | 205 | ||
206 | #define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE)) | 206 | #define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE)) |
207 | #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) | ||
208 | 207 | ||
209 | /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ | 208 | /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ |
210 | #define pmd_none(x) (!(unsigned long)pmd_val(x)) | 209 | #define pmd_none(x) (!(unsigned long)pmd_val(x)) |
211 | #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) | 210 | #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) |
212 | #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) | ||
213 | #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) | 211 | #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) |
214 | 212 | ||
215 | 213 | ||
@@ -268,7 +266,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long | |||
268 | pte_t pte; | 266 | pte_t pte; |
269 | if (full) { | 267 | if (full) { |
270 | pte = *ptep; | 268 | pte = *ptep; |
271 | *ptep = __pte(0); | 269 | pte_clear(mm, addr, ptep); |
272 | } else { | 270 | } else { |
273 | pte = ptep_get_and_clear(mm, addr, ptep); | 271 | pte = ptep_get_and_clear(mm, addr, ptep); |
274 | } | 272 | } |
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index 2e7f3e257f..eb4b152c82 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
@@ -288,7 +288,7 @@ | |||
288 | #define __NR_mq_timedreceive (__NR_mq_open+3) | 288 | #define __NR_mq_timedreceive (__NR_mq_open+3) |
289 | #define __NR_mq_notify (__NR_mq_open+4) | 289 | #define __NR_mq_notify (__NR_mq_open+4) |
290 | #define __NR_mq_getsetattr (__NR_mq_open+5) | 290 | #define __NR_mq_getsetattr (__NR_mq_open+5) |
291 | #define __NR_sys_kexec_load 283 | 291 | #define __NR_kexec_load 283 |
292 | #define __NR_waitid 284 | 292 | #define __NR_waitid 284 |
293 | /* #define __NR_sys_setaltroot 285 */ | 293 | /* #define __NR_sys_setaltroot 285 */ |
294 | #define __NR_add_key 286 | 294 | #define __NR_add_key 286 |
@@ -318,10 +318,12 @@ | |||
318 | #define __NR_unshare 310 | 318 | #define __NR_unshare 310 |
319 | #define __NR_set_robust_list 311 | 319 | #define __NR_set_robust_list 311 |
320 | #define __NR_get_robust_list 312 | 320 | #define __NR_get_robust_list 312 |
321 | #define __NR_sys_splice 313 | 321 | #define __NR_splice 313 |
322 | #define __NR_sys_sync_file_range 314 | 322 | #define __NR_sync_file_range 314 |
323 | #define __NR_tee 315 | ||
324 | #define __NR_vmsplice 316 | ||
323 | 325 | ||
324 | #define NR_syscalls 315 | 326 | #define NR_syscalls 317 |
325 | 327 | ||
326 | /* | 328 | /* |
327 | * user-visible error numbers are in the range -1 - -128: see | 329 | * user-visible error numbers are in the range -1 - -128: see |
diff --git a/include/asm-ia64/acpi-ext.h b/include/asm-ia64/acpi-ext.h index 56d2ddc97b..734d137dda 100644 --- a/include/asm-ia64/acpi-ext.h +++ b/include/asm-ia64/acpi-ext.h | |||
@@ -1,12 +1,15 @@ | |||
1 | /* | 1 | /* |
2 | * ia64/platform/hp/common/hp_acpi.h | 2 | * (c) Copyright 2003, 2006 Hewlett-Packard Development Company, L.P. |
3 | * Alex Williamson <alex.williamson@hp.com> | ||
4 | * Bjorn Helgaas <bjorn.helgaas@hp.com> | ||
3 | * | 5 | * |
4 | * Copyright (C) 2003 Hewlett-Packard | 6 | * This program is free software; you can redistribute it and/or modify |
5 | * Copyright (C) Alex Williamson | 7 | * it under the terms of the GNU General Public License version 2 as |
6 | * Copyright (C) Bjorn Helgaas | 8 | * published by the Free Software Foundation. |
7 | * | 9 | * |
8 | * Vendor specific extensions to ACPI. | 10 | * Vendor specific extensions to ACPI. |
9 | */ | 11 | */ |
12 | |||
10 | #ifndef _ASM_IA64_ACPI_EXT_H | 13 | #ifndef _ASM_IA64_ACPI_EXT_H |
11 | #define _ASM_IA64_ACPI_EXT_H | 14 | #define _ASM_IA64_ACPI_EXT_H |
12 | 15 | ||
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h index d734585a23..09a5dd0e44 100644 --- a/include/asm-ia64/acpi.h +++ b/include/asm-ia64/acpi.h | |||
@@ -110,9 +110,8 @@ extern void prefill_possible_map(void); | |||
110 | extern int additional_cpus; | 110 | extern int additional_cpus; |
111 | 111 | ||
112 | #ifdef CONFIG_ACPI_NUMA | 112 | #ifdef CONFIG_ACPI_NUMA |
113 | /* Proximity bitmap length; _PXM is at most 255 (8 bit)*/ | 113 | #if MAX_NUMNODES > 256 |
114 | #ifdef CONFIG_IA64_NR_NODES | 114 | #define MAX_PXM_DOMAINS MAX_NUMNODES |
115 | #define MAX_PXM_DOMAINS CONFIG_IA64_NR_NODES | ||
116 | #else | 115 | #else |
117 | #define MAX_PXM_DOMAINS (256) | 116 | #define MAX_PXM_DOMAINS (256) |
118 | #endif | 117 | #endif |
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h index 90921e1627..6cc517e212 100644 --- a/include/asm-ia64/bitops.h +++ b/include/asm-ia64/bitops.h | |||
@@ -11,7 +11,6 @@ | |||
11 | 11 | ||
12 | #include <linux/compiler.h> | 12 | #include <linux/compiler.h> |
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <asm/bitops.h> | ||
15 | #include <asm/intrinsics.h> | 14 | #include <asm/intrinsics.h> |
16 | 15 | ||
17 | /** | 16 | /** |
diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h index 218c458ab6..c195a9ad12 100644 --- a/include/asm-ia64/kdebug.h +++ b/include/asm-ia64/kdebug.h | |||
@@ -58,6 +58,8 @@ enum die_val { | |||
58 | DIE_MCA_RENDZVOUS_ENTER, | 58 | DIE_MCA_RENDZVOUS_ENTER, |
59 | DIE_MCA_RENDZVOUS_PROCESS, | 59 | DIE_MCA_RENDZVOUS_PROCESS, |
60 | DIE_MCA_RENDZVOUS_LEAVE, | 60 | DIE_MCA_RENDZVOUS_LEAVE, |
61 | DIE_MCA_NEW_TIMEOUT, | ||
62 | DIE_INIT_ENTER, | ||
61 | DIE_INIT_MONARCH_ENTER, | 63 | DIE_INIT_MONARCH_ENTER, |
62 | DIE_INIT_MONARCH_PROCESS, | 64 | DIE_INIT_MONARCH_PROCESS, |
63 | DIE_INIT_MONARCH_LEAVE, | 65 | DIE_INIT_MONARCH_LEAVE, |
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index c3e4ed8a3e..a9c995a86c 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
@@ -347,9 +347,11 @@ extern ia64_mv_dma_supported swiotlb_dma_supported; | |||
347 | #endif | 347 | #endif |
348 | #ifndef platform_pci_legacy_read | 348 | #ifndef platform_pci_legacy_read |
349 | # define platform_pci_legacy_read ia64_pci_legacy_read | 349 | # define platform_pci_legacy_read ia64_pci_legacy_read |
350 | extern int ia64_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size); | ||
350 | #endif | 351 | #endif |
351 | #ifndef platform_pci_legacy_write | 352 | #ifndef platform_pci_legacy_write |
352 | # define platform_pci_legacy_write ia64_pci_legacy_write | 353 | # define platform_pci_legacy_write ia64_pci_legacy_write |
354 | extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size); | ||
353 | #endif | 355 | #endif |
354 | #ifndef platform_inb | 356 | #ifndef platform_inb |
355 | # define platform_inb __ia64_inb | 357 | # define platform_inb __ia64_inb |
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h index bfbbb8da79..9c5389b7e6 100644 --- a/include/asm-ia64/mca.h +++ b/include/asm-ia64/mca.h | |||
@@ -148,6 +148,11 @@ extern int ia64_reg_MCA_extension(int (*fn)(void *, struct ia64_sal_os_state *) | |||
148 | extern void ia64_unreg_MCA_extension(void); | 148 | extern void ia64_unreg_MCA_extension(void); |
149 | extern u64 ia64_get_rnat(u64 *); | 149 | extern u64 ia64_get_rnat(u64 *); |
150 | 150 | ||
151 | struct ia64_mca_notify_die { | ||
152 | struct ia64_sal_os_state *sos; | ||
153 | int *monarch_cpu; | ||
154 | }; | ||
155 | |||
151 | #else /* __ASSEMBLY__ */ | 156 | #else /* __ASSEMBLY__ */ |
152 | 157 | ||
153 | #define IA64_MCA_CORRECTED 0x0 /* Error has been corrected by OS_MCA */ | 158 | #define IA64_MCA_CORRECTED 0x0 /* Error has been corrected by OS_MCA */ |
diff --git a/include/asm-ia64/mutex.h b/include/asm-ia64/mutex.h index 5a3224f6af..bed73a643a 100644 --- a/include/asm-ia64/mutex.h +++ b/include/asm-ia64/mutex.h | |||
@@ -84,7 +84,7 @@ __mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *)) | |||
84 | static inline int | 84 | static inline int |
85 | __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *)) | 85 | __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *)) |
86 | { | 86 | { |
87 | if (likely(cmpxchg_acq(count, 1, 0)) == 1) | 87 | if (cmpxchg_acq(count, 1, 0) == 1) |
88 | return 1; | 88 | return 1; |
89 | return 0; | 89 | return 0; |
90 | } | 90 | } |
diff --git a/include/asm-ia64/numnodes.h b/include/asm-ia64/numnodes.h deleted file mode 100644 index e9d356f549..0000000000 --- a/include/asm-ia64/numnodes.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef _ASM_MAX_NUMNODES_H | ||
2 | #define _ASM_MAX_NUMNODES_H | ||
3 | |||
4 | #ifdef CONFIG_IA64_DIG | ||
5 | /* Max 8 Nodes */ | ||
6 | # define NODES_SHIFT 3 | ||
7 | #elif defined(CONFIG_IA64_HP_ZX1) || defined(CONFIG_IA64_HP_ZX1_SWIOTLB) | ||
8 | /* Max 32 Nodes */ | ||
9 | # define NODES_SHIFT 5 | ||
10 | #elif defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_GENERIC) | ||
11 | # if CONFIG_IA64_NR_NODES == 256 | ||
12 | # define NODES_SHIFT 8 | ||
13 | # elif CONFIG_IA64_NR_NODES <= 512 | ||
14 | # define NODES_SHIFT 9 | ||
15 | # elif CONFIG_IA64_NR_NODES <= 1024 | ||
16 | # define NODES_SHIFT 10 | ||
17 | # endif | ||
18 | #endif | ||
19 | |||
20 | #endif /* _ASM_MAX_NUMNODES_H */ | ||
diff --git a/include/asm-ia64/sn/sn2/sn_hwperf.h b/include/asm-ia64/sn/sn2/sn_hwperf.h index 291ef3d69d..e61ebac38c 100644 --- a/include/asm-ia64/sn/sn2/sn_hwperf.h +++ b/include/asm-ia64/sn/sn2/sn_hwperf.h | |||
@@ -45,8 +45,12 @@ struct sn_hwperf_object_info { | |||
45 | #define SN_HWPERF_IS_NODE(x) ((x) && strstr((x)->name, "SHub")) | 45 | #define SN_HWPERF_IS_NODE(x) ((x) && strstr((x)->name, "SHub")) |
46 | #define SN_HWPERF_IS_NODE_SHUB2(x) ((x) && strstr((x)->name, "SHub 2.")) | 46 | #define SN_HWPERF_IS_NODE_SHUB2(x) ((x) && strstr((x)->name, "SHub 2.")) |
47 | #define SN_HWPERF_IS_IONODE(x) ((x) && strstr((x)->name, "TIO")) | 47 | #define SN_HWPERF_IS_IONODE(x) ((x) && strstr((x)->name, "TIO")) |
48 | #define SN_HWPERF_IS_ROUTER(x) ((x) && strstr((x)->name, "Router")) | ||
49 | #define SN_HWPERF_IS_NL3ROUTER(x) ((x) && strstr((x)->name, "NL3Router")) | 48 | #define SN_HWPERF_IS_NL3ROUTER(x) ((x) && strstr((x)->name, "NL3Router")) |
49 | #define SN_HWPERF_IS_NL4ROUTER(x) ((x) && strstr((x)->name, "NL4Router")) | ||
50 | #define SN_HWPERF_IS_OLDROUTER(x) ((x) && strstr((x)->name, "Router")) | ||
51 | #define SN_HWPERF_IS_ROUTER(x) (SN_HWPERF_IS_NL3ROUTER(x) || \ | ||
52 | SN_HWPERF_IS_NL4ROUTER(x) || \ | ||
53 | SN_HWPERF_IS_OLDROUTER(x)) | ||
50 | #define SN_HWPERF_FOREIGN(x) ((x) && !(x)->sn_hwp_this_part && !(x)->sn_hwp_is_shared) | 54 | #define SN_HWPERF_FOREIGN(x) ((x) && !(x)->sn_hwp_this_part && !(x)->sn_hwp_is_shared) |
51 | #define SN_HWPERF_SAME_OBJTYPE(x,y) ((SN_HWPERF_IS_NODE(x) && SN_HWPERF_IS_NODE(y)) ||\ | 55 | #define SN_HWPERF_SAME_OBJTYPE(x,y) ((SN_HWPERF_IS_NODE(x) && SN_HWPERF_IS_NODE(y)) ||\ |
52 | (SN_HWPERF_IS_IONODE(x) && SN_HWPERF_IS_IONODE(y)) ||\ | 56 | (SN_HWPERF_IS_IONODE(x) && SN_HWPERF_IS_IONODE(y)) ||\ |
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h index bf4cc867a6..51aca022cf 100644 --- a/include/asm-ia64/sn/sn_sal.h +++ b/include/asm-ia64/sn/sn_sal.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
9 | * for more details. | 9 | * for more details. |
10 | * | 10 | * |
11 | * Copyright (c) 2000-2005 Silicon Graphics, Inc. All rights reserved. | 11 | * Copyright (c) 2000-2006 Silicon Graphics, Inc. All rights reserved. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | 14 | ||
@@ -85,6 +85,7 @@ | |||
85 | 85 | ||
86 | #define SN_SAL_GET_PROM_FEATURE_SET 0x02000065 | 86 | #define SN_SAL_GET_PROM_FEATURE_SET 0x02000065 |
87 | #define SN_SAL_SET_OS_FEATURE_SET 0x02000066 | 87 | #define SN_SAL_SET_OS_FEATURE_SET 0x02000066 |
88 | #define SN_SAL_INJECT_ERROR 0x02000067 | ||
88 | 89 | ||
89 | /* | 90 | /* |
90 | * Service-specific constants | 91 | * Service-specific constants |
@@ -705,10 +706,8 @@ static inline int | |||
705 | sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array) | 706 | sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array) |
706 | { | 707 | { |
707 | struct ia64_sal_retval ret_stuff; | 708 | struct ia64_sal_retval ret_stuff; |
708 | int cnodeid; | ||
709 | unsigned long irq_flags; | 709 | unsigned long irq_flags; |
710 | 710 | ||
711 | cnodeid = nasid_to_cnodeid(get_node_number(paddr)); | ||
712 | local_irq_save(irq_flags); | 711 | local_irq_save(irq_flags); |
713 | ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len, | 712 | ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len, |
714 | (u64)nasid_array, perms, 0, 0, 0); | 713 | (u64)nasid_array, perms, 0, 0, 0); |
@@ -1140,4 +1139,16 @@ ia64_sn_set_os_feature(int feature) | |||
1140 | return rv.status; | 1139 | return rv.status; |
1141 | } | 1140 | } |
1142 | 1141 | ||
1142 | static inline int | ||
1143 | sn_inject_error(u64 paddr, u64 *data, u64 *ecc) | ||
1144 | { | ||
1145 | struct ia64_sal_retval ret_stuff; | ||
1146 | unsigned long irq_flags; | ||
1147 | |||
1148 | local_irq_save(irq_flags); | ||
1149 | ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_INJECT_ERROR, paddr, (u64)data, | ||
1150 | (u64)ecc, 0, 0, 0, 0); | ||
1151 | local_irq_restore(irq_flags); | ||
1152 | return ret_stuff.status; | ||
1153 | } | ||
1143 | #endif /* _ASM_IA64_SN_SN_SAL_H */ | 1154 | #endif /* _ASM_IA64_SN_SN_SAL_H */ |
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index 56394a2c70..e5392c4d30 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
@@ -67,7 +67,7 @@ struct thread_info { | |||
67 | #define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET) | 67 | #define end_of_stack(p) (unsigned long *)((void *)(p) + IA64_RBS_OFFSET) |
68 | 68 | ||
69 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR | 69 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR |
70 | #define alloc_task_struct() ((task_t *)__get_free_pages(GFP_KERNEL, KERNEL_STACK_SIZE_ORDER)) | 70 | #define alloc_task_struct() ((task_t *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER)) |
71 | #define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER) | 71 | #define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER) |
72 | 72 | ||
73 | #endif /* !__ASSEMBLY */ | 73 | #endif /* !__ASSEMBLY */ |
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index 3ee19dfa46..616b5ed2aa 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h | |||
@@ -23,6 +23,11 @@ | |||
23 | #define PENALTY_FOR_NODE_WITH_CPUS 255 | 23 | #define PENALTY_FOR_NODE_WITH_CPUS 255 |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * Distance above which we begin to use zone reclaim | ||
27 | */ | ||
28 | #define RECLAIM_DISTANCE 15 | ||
29 | |||
30 | /* | ||
26 | * Returns the number of the node containing CPU 'cpu' | 31 | * Returns the number of the node containing CPU 'cpu' |
27 | */ | 32 | */ |
28 | #define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu]) | 33 | #define cpu_to_node(cpu) (int)(cpu_to_node_map[cpu]) |
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index 36070c1014..7107763168 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h | |||
@@ -286,12 +286,17 @@ | |||
286 | /* 1294, 1295 reserved for pselect/ppoll */ | 286 | /* 1294, 1295 reserved for pselect/ppoll */ |
287 | #define __NR_unshare 1296 | 287 | #define __NR_unshare 1296 |
288 | #define __NR_splice 1297 | 288 | #define __NR_splice 1297 |
289 | #define __NR_set_robust_list 1298 | ||
290 | #define __NR_get_robust_list 1299 | ||
291 | #define __NR_sync_file_range 1300 | ||
292 | #define __NR_tee 1301 | ||
293 | #define __NR_vmsplice 1302 | ||
289 | 294 | ||
290 | #ifdef __KERNEL__ | 295 | #ifdef __KERNEL__ |
291 | 296 | ||
292 | #include <linux/config.h> | 297 | #include <linux/config.h> |
293 | 298 | ||
294 | #define NR_syscalls 274 /* length of syscall table */ | 299 | #define NR_syscalls 279 /* length of syscall table */ |
295 | 300 | ||
296 | #define __ARCH_WANT_SYS_RT_SIGACTION | 301 | #define __ARCH_WANT_SYS_RT_SIGACTION |
297 | 302 | ||
diff --git a/include/asm-ia64/vga.h b/include/asm-ia64/vga.h index bc3349ffc5..091177cda2 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(vga_console_membase + (x), 0)) | 20 | #define VGA_MAP_MEM(x) ((unsigned long) ioremap_nocache(vga_console_membase + (x), 0)) |
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/assembler.h b/include/asm-m32r/assembler.h index b7f4d8aaeb..1a1aa17edd 100644 --- a/include/asm-m32r/assembler.h +++ b/include/asm-m32r/assembler.h | |||
@@ -109,6 +109,9 @@ | |||
109 | push r13 | 109 | push r13 |
110 | mvfachi r13 | 110 | mvfachi r13 |
111 | push r13 | 111 | push r13 |
112 | ldi r13, #0 | ||
113 | push r13 ; dummy push acc1h | ||
114 | push r13 ; dummy push acc1l | ||
112 | #else | 115 | #else |
113 | #error unknown isa configuration | 116 | #error unknown isa configuration |
114 | #endif | 117 | #endif |
@@ -156,6 +159,8 @@ | |||
156 | pop r13 | 159 | pop r13 |
157 | mvtaclo r13, a1 | 160 | mvtaclo r13, a1 |
158 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | 161 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) |
162 | pop r13 ; dummy pop acc1h | ||
163 | pop r13 ; dummy pop acc1l | ||
159 | pop r13 | 164 | pop r13 |
160 | mvtachi r13 | 165 | mvtachi r13 |
161 | pop r13 | 166 | pop r13 |
diff --git a/include/asm-m32r/mappi3/mappi3_pld.h b/include/asm-m32r/mappi3/mappi3_pld.h index 1d3c25d61b..031369a7af 100644 --- a/include/asm-m32r/mappi3/mappi3_pld.h +++ b/include/asm-m32r/mappi3/mappi3_pld.h | |||
@@ -53,16 +53,14 @@ | |||
53 | /* Power Control of MMC and CF */ | 53 | /* Power Control of MMC and CF */ |
54 | #define PLD_CPCR __reg16(PLD_BASE + 0x14000) | 54 | #define PLD_CPCR __reg16(PLD_BASE + 0x14000) |
55 | 55 | ||
56 | 56 | /* ICU */ | |
57 | /*==== ICU ====*/ | 57 | #define M32R_IRQ_PC104 (5) /* INT4(PC/104) */ |
58 | #define M32R_IRQ_PC104 (5) /* INT4(PC/104) */ | 58 | #define M32R_IRQ_I2C (28) /* I2C-BUS */ |
59 | #define M32R_IRQ_I2C (28) /* I2C-BUS */ | 59 | #define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */ |
60 | #define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */ | 60 | #define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert & Eject */ |
61 | #define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert */ | 61 | #define PLD_IRQ_IDEIREQ (8) /* INT7 IDE Interrupt */ |
62 | #define PLD_IRQ_IDEIREQ (8) /* INT7 IDE Interrupt */ | 62 | #define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */ |
63 | #define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */ | 63 | #define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */ |
64 | #define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */ | ||
65 | |||
66 | 64 | ||
67 | #if 0 | 65 | #if 0 |
68 | /* LED Control | 66 | /* LED Control |
@@ -97,7 +95,6 @@ | |||
97 | #define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) | 95 | #define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) |
98 | #define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) | 96 | #define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) |
99 | 97 | ||
100 | |||
101 | #if 0 | 98 | #if 0 |
102 | /* RTC */ | 99 | /* RTC */ |
103 | #define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) | 100 | #define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) |
@@ -140,4 +137,7 @@ | |||
140 | 137 | ||
141 | #endif | 138 | #endif |
142 | 139 | ||
140 | /* Reset Control */ | ||
141 | #define PLD_REBOOT __reg16(PLD_BASE + 0x38000) | ||
142 | |||
143 | #endif /* _MAPPI3_PLD.H */ | 143 | #endif /* _MAPPI3_PLD.H */ |
diff --git a/include/asm-m32r/numnodes.h b/include/asm-m32r/numnodes.h deleted file mode 100644 index 479a39d49f..0000000000 --- a/include/asm-m32r/numnodes.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #ifndef _ASM_NUMNODES_H_ | ||
2 | #define _ASM_NUMNODES_H_ | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifdef CONFIG_DISCONTIGMEM | ||
7 | |||
8 | #if defined(CONFIG_CHIP_M32700) | ||
9 | #define NODES_SHIFT 1 /* Max 2 Nodes */ | ||
10 | #endif /* CONFIG_CHIP_M32700 */ | ||
11 | |||
12 | #endif /* CONFIG_DISCONTIGMEM */ | ||
13 | |||
14 | #endif /* _ASM_NUMNODES_H_ */ | ||
15 | |||
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h index 0d058b2d84..53c792452d 100644 --- a/include/asm-m32r/ptrace.h +++ b/include/asm-m32r/ptrace.h | |||
@@ -43,6 +43,14 @@ | |||
43 | #define PT_ACC1L 18 | 43 | #define PT_ACC1L 18 |
44 | #define PT_ACCH PT_ACC0H | 44 | #define PT_ACCH PT_ACC0H |
45 | #define PT_ACCL PT_ACC0L | 45 | #define PT_ACCL PT_ACC0L |
46 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
47 | #define PT_ACCH 15 | ||
48 | #define PT_ACCL 16 | ||
49 | #define PT_DUMMY_ACC1H 17 | ||
50 | #define PT_DUMMY_ACC1L 18 | ||
51 | #else | ||
52 | #error unknown isa conifiguration | ||
53 | #endif | ||
46 | #define PT_PSW 19 | 54 | #define PT_PSW 19 |
47 | #define PT_BPC 20 | 55 | #define PT_BPC 20 |
48 | #define PT_BBPSW 21 | 56 | #define PT_BBPSW 21 |
@@ -52,21 +60,6 @@ | |||
52 | #define PT_LR 25 | 60 | #define PT_LR 25 |
53 | #define PT_SPI 26 | 61 | #define PT_SPI 26 |
54 | #define PT_ORIGR0 27 | 62 | #define PT_ORIGR0 27 |
55 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
56 | #define PT_ACCH 15 | ||
57 | #define PT_ACCL 16 | ||
58 | #define PT_PSW 17 | ||
59 | #define PT_BPC 18 | ||
60 | #define PT_BBPSW 19 | ||
61 | #define PT_BBPC 20 | ||
62 | #define PT_SPU 21 | ||
63 | #define PT_FP 22 | ||
64 | #define PT_LR 23 | ||
65 | #define PT_SPI 24 | ||
66 | #define PT_ORIGR0 25 | ||
67 | #else | ||
68 | #error unknown isa conifiguration | ||
69 | #endif | ||
70 | 63 | ||
71 | /* virtual pt_reg entry for gdb */ | 64 | /* virtual pt_reg entry for gdb */ |
72 | #define PT_PC 30 | 65 | #define PT_PC 30 |
@@ -121,6 +114,8 @@ struct pt_regs { | |||
121 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | 114 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) |
122 | unsigned long acch; | 115 | unsigned long acch; |
123 | unsigned long accl; | 116 | unsigned long accl; |
117 | unsigned long dummy_acc1h; | ||
118 | unsigned long dummy_acc1l; | ||
124 | #else | 119 | #else |
125 | #error unknown isa configuration | 120 | #error unknown isa configuration |
126 | #endif | 121 | #endif |
diff --git a/include/asm-m32r/semaphore.h b/include/asm-m32r/semaphore.h index bf447c52a0..81750edc89 100644 --- a/include/asm-m32r/semaphore.h +++ b/include/asm-m32r/semaphore.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * SMP- and interrupt-safe semaphores.. | 9 | * SMP- and interrupt-safe semaphores.. |
10 | * | 10 | * |
11 | * Copyright (C) 1996 Linus Torvalds | 11 | * Copyright (C) 1996 Linus Torvalds |
12 | * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> | 12 | * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/config.h> | 15 | #include <linux/config.h> |
@@ -77,27 +77,8 @@ asmlinkage void __up(struct semaphore * sem); | |||
77 | */ | 77 | */ |
78 | static inline void down(struct semaphore * sem) | 78 | static inline void down(struct semaphore * sem) |
79 | { | 79 | { |
80 | unsigned long flags; | ||
81 | long count; | ||
82 | |||
83 | might_sleep(); | 80 | might_sleep(); |
84 | local_irq_save(flags); | 81 | if (unlikely(atomic_dec_return(&sem->count) < 0)) |
85 | __asm__ __volatile__ ( | ||
86 | "# down \n\t" | ||
87 | DCACHE_CLEAR("%0", "r4", "%1") | ||
88 | M32R_LOCK" %0, @%1; \n\t" | ||
89 | "addi %0, #-1; \n\t" | ||
90 | M32R_UNLOCK" %0, @%1; \n\t" | ||
91 | : "=&r" (count) | ||
92 | : "r" (&sem->count) | ||
93 | : "memory" | ||
94 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
95 | , "r4" | ||
96 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
97 | ); | ||
98 | local_irq_restore(flags); | ||
99 | |||
100 | if (unlikely(count < 0)) | ||
101 | __down(sem); | 82 | __down(sem); |
102 | } | 83 | } |
103 | 84 | ||
@@ -107,28 +88,10 @@ static inline void down(struct semaphore * sem) | |||
107 | */ | 88 | */ |
108 | static inline int down_interruptible(struct semaphore * sem) | 89 | static inline int down_interruptible(struct semaphore * sem) |
109 | { | 90 | { |
110 | unsigned long flags; | ||
111 | long count; | ||
112 | int result = 0; | 91 | int result = 0; |
113 | 92 | ||
114 | might_sleep(); | 93 | might_sleep(); |
115 | local_irq_save(flags); | 94 | if (unlikely(atomic_dec_return(&sem->count) < 0)) |
116 | __asm__ __volatile__ ( | ||
117 | "# down_interruptible \n\t" | ||
118 | DCACHE_CLEAR("%0", "r4", "%1") | ||
119 | M32R_LOCK" %0, @%1; \n\t" | ||
120 | "addi %0, #-1; \n\t" | ||
121 | M32R_UNLOCK" %0, @%1; \n\t" | ||
122 | : "=&r" (count) | ||
123 | : "r" (&sem->count) | ||
124 | : "memory" | ||
125 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
126 | , "r4" | ||
127 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
128 | ); | ||
129 | local_irq_restore(flags); | ||
130 | |||
131 | if (unlikely(count < 0)) | ||
132 | result = __down_interruptible(sem); | 95 | result = __down_interruptible(sem); |
133 | 96 | ||
134 | return result; | 97 | return result; |
@@ -174,26 +137,7 @@ static inline int down_trylock(struct semaphore * sem) | |||
174 | */ | 137 | */ |
175 | static inline void up(struct semaphore * sem) | 138 | static inline void up(struct semaphore * sem) |
176 | { | 139 | { |
177 | unsigned long flags; | 140 | if (unlikely(atomic_inc_return(&sem->count) <= 0)) |
178 | long count; | ||
179 | |||
180 | local_irq_save(flags); | ||
181 | __asm__ __volatile__ ( | ||
182 | "# up \n\t" | ||
183 | DCACHE_CLEAR("%0", "r4", "%1") | ||
184 | M32R_LOCK" %0, @%1; \n\t" | ||
185 | "addi %0, #1; \n\t" | ||
186 | M32R_UNLOCK" %0, @%1; \n\t" | ||
187 | : "=&r" (count) | ||
188 | : "r" (&sem->count) | ||
189 | : "memory" | ||
190 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
191 | , "r4" | ||
192 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
193 | ); | ||
194 | local_irq_restore(flags); | ||
195 | |||
196 | if (unlikely(count <= 0)) | ||
197 | __up(sem); | 141 | __up(sem); |
198 | } | 142 | } |
199 | 143 | ||
diff --git a/include/asm-m32r/sigcontext.h b/include/asm-m32r/sigcontext.h index c233e2def2..942b8a3093 100644 --- a/include/asm-m32r/sigcontext.h +++ b/include/asm-m32r/sigcontext.h | |||
@@ -32,6 +32,8 @@ struct sigcontext { | |||
32 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | 32 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) |
33 | unsigned long sc_acch; | 33 | unsigned long sc_acch; |
34 | unsigned long sc_accl; | 34 | unsigned long sc_accl; |
35 | unsigned long sc_dummy_acc1h; | ||
36 | unsigned long sc_dummy_acc1l; | ||
35 | #else | 37 | #else |
36 | #error unknown isa configuration | 38 | #error unknown isa configuration |
37 | #endif | 39 | #endif |
diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h index 7885b7df84..1184293e57 100644 --- a/include/asm-m32r/smp.h +++ b/include/asm-m32r/smp.h | |||
@@ -67,7 +67,8 @@ extern volatile int cpu_2_physid[NR_CPUS]; | |||
67 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 67 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
68 | 68 | ||
69 | extern cpumask_t cpu_callout_map; | 69 | extern cpumask_t cpu_callout_map; |
70 | #define cpu_possible_map cpu_callout_map | 70 | extern cpumask_t cpu_possible_map; |
71 | extern cpumask_t cpu_present_map; | ||
71 | 72 | ||
72 | static __inline__ int hard_smp_processor_id(void) | 73 | static __inline__ int hard_smp_processor_id(void) |
73 | { | 74 | { |
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index d6a2c613be..e55013f378 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h | |||
@@ -6,8 +6,8 @@ | |||
6 | * License. See the file "COPYING" in the main directory of this archive | 6 | * License. See the file "COPYING" in the main directory of this archive |
7 | * for more details. | 7 | * for more details. |
8 | * | 8 | * |
9 | * Copyright (C) 2001 by Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto | 9 | * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto |
10 | * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> | 10 | * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/config.h> | 13 | #include <linux/config.h> |
@@ -19,53 +19,28 @@ | |||
19 | * switch_to(prev, next) should switch from task `prev' to `next' | 19 | * switch_to(prev, next) should switch from task `prev' to `next' |
20 | * `prev' will never be the same as `next'. | 20 | * `prev' will never be the same as `next'. |
21 | * | 21 | * |
22 | * `next' and `prev' should be struct task_struct, but it isn't always defined | 22 | * `next' and `prev' should be task_t, but it isn't always defined |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #ifndef CONFIG_SMP | ||
26 | #define prepare_to_switch() do { } while(0) | ||
27 | #endif /* not CONFIG_SMP */ | ||
28 | |||
29 | #define switch_to(prev, next, last) do { \ | 25 | #define switch_to(prev, next, last) do { \ |
30 | register unsigned long arg0 __asm__ ("r0") = (unsigned long)prev; \ | ||
31 | register unsigned long arg1 __asm__ ("r1") = (unsigned long)next; \ | ||
32 | register unsigned long *oldsp __asm__ ("r2") = &(prev->thread.sp); \ | ||
33 | register unsigned long *newsp __asm__ ("r3") = &(next->thread.sp); \ | ||
34 | register unsigned long *oldlr __asm__ ("r4") = &(prev->thread.lr); \ | ||
35 | register unsigned long *newlr __asm__ ("r5") = &(next->thread.lr); \ | ||
36 | register struct task_struct *__last __asm__ ("r6"); \ | ||
37 | __asm__ __volatile__ ( \ | 26 | __asm__ __volatile__ ( \ |
38 | "st r8, @-r15 \n\t" \ | 27 | " seth lr, #high(1f) \n" \ |
39 | "st r9, @-r15 \n\t" \ | 28 | " or3 lr, lr, #low(1f) \n" \ |
40 | "st r10, @-r15 \n\t" \ | 29 | " st lr, @%4 ; store old LR \n" \ |
41 | "st r11, @-r15 \n\t" \ | 30 | " ld lr, @%5 ; load new LR \n" \ |
42 | "st r12, @-r15 \n\t" \ | 31 | " st sp, @%2 ; store old SP \n" \ |
43 | "st r13, @-r15 \n\t" \ | 32 | " ld sp, @%3 ; load new SP \n" \ |
44 | "st r14, @-r15 \n\t" \ | 33 | " push %1 ; store `prev' on new stack \n" \ |
45 | "seth r14, #high(1f) \n\t" \ | 34 | " jmp lr \n" \ |
46 | "or3 r14, r14, #low(1f) \n\t" \ | 35 | " .fillinsn \n" \ |
47 | "st r14, @r4 ; store old LR \n\t" \ | 36 | "1: \n" \ |
48 | "st r15, @r2 ; store old SP \n\t" \ | 37 | " pop %0 ; restore `__last' from new stack \n" \ |
49 | "ld r15, @r3 ; load new SP \n\t" \ | 38 | : "=r" (last) \ |
50 | "st r0, @-r15 ; store 'prev' onto new stack \n\t" \ | 39 | : "0" (prev), \ |
51 | "ld r14, @r5 ; load new LR \n\t" \ | 40 | "r" (&(prev->thread.sp)), "r" (&(next->thread.sp)), \ |
52 | "jmp r14 \n\t" \ | 41 | "r" (&(prev->thread.lr)), "r" (&(next->thread.lr)) \ |
53 | ".fillinsn \n " \ | 42 | : "memory", "lr" \ |
54 | "1: \n\t" \ | ||
55 | "ld r6, @r15+ ; load 'prev' from new stack \n\t" \ | ||
56 | "ld r14, @r15+ \n\t" \ | ||
57 | "ld r13, @r15+ \n\t" \ | ||
58 | "ld r12, @r15+ \n\t" \ | ||
59 | "ld r11, @r15+ \n\t" \ | ||
60 | "ld r10, @r15+ \n\t" \ | ||
61 | "ld r9, @r15+ \n\t" \ | ||
62 | "ld r8, @r15+ \n\t" \ | ||
63 | : "=&r" (__last) \ | ||
64 | : "r" (arg0), "r" (arg1), "r" (oldsp), "r" (newsp), \ | ||
65 | "r" (oldlr), "r" (newlr) \ | ||
66 | : "memory" \ | ||
67 | ); \ | 43 | ); \ |
68 | last = __last; \ | ||
69 | } while(0) | 44 | } while(0) |
70 | 45 | ||
71 | /* | 46 | /* |
@@ -171,8 +146,8 @@ extern void __xchg_called_with_bad_pointer(void); | |||
171 | #define DCACHE_CLEAR(reg0, reg1, addr) | 146 | #define DCACHE_CLEAR(reg0, reg1, addr) |
172 | #endif /* CONFIG_CHIP_M32700_TS1 */ | 147 | #endif /* CONFIG_CHIP_M32700_TS1 */ |
173 | 148 | ||
174 | static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr, | 149 | static inline unsigned long |
175 | int size) | 150 | __xchg(unsigned long x, volatile void * ptr, int size) |
176 | { | 151 | { |
177 | unsigned long flags; | 152 | unsigned long flags; |
178 | unsigned long tmp = 0; | 153 | unsigned long tmp = 0; |
@@ -224,7 +199,7 @@ static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr, | |||
224 | 199 | ||
225 | #define __HAVE_ARCH_CMPXCHG 1 | 200 | #define __HAVE_ARCH_CMPXCHG 1 |
226 | 201 | ||
227 | static __inline__ unsigned long | 202 | static inline unsigned long |
228 | __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) | 203 | __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) |
229 | { | 204 | { |
230 | unsigned long flags; | 205 | unsigned long flags; |
@@ -258,7 +233,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) | |||
258 | if something tries to do an invalid cmpxchg(). */ | 233 | if something tries to do an invalid cmpxchg(). */ |
259 | extern void __cmpxchg_called_with_bad_pointer(void); | 234 | extern void __cmpxchg_called_with_bad_pointer(void); |
260 | 235 | ||
261 | static __inline__ unsigned long | 236 | static inline unsigned long |
262 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | 237 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) |
263 | { | 238 | { |
264 | switch (size) { | 239 | switch (size) { |
diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h index e8ae61956a..819cc28a94 100644 --- a/include/asm-m32r/uaccess.h +++ b/include/asm-m32r/uaccess.h | |||
@@ -5,17 +5,9 @@ | |||
5 | * linux/include/asm-m32r/uaccess.h | 5 | * linux/include/asm-m32r/uaccess.h |
6 | * | 6 | * |
7 | * M32R version. | 7 | * M32R version. |
8 | * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> | 8 | * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #undef UACCESS_DEBUG | ||
12 | |||
13 | #ifdef UACCESS_DEBUG | ||
14 | #define UAPRINTK(args...) printk(args) | ||
15 | #else | ||
16 | #define UAPRINTK(args...) | ||
17 | #endif /* UACCESS_DEBUG */ | ||
18 | |||
19 | /* | 11 | /* |
20 | * User space memory access functions | 12 | * User space memory access functions |
21 | */ | 13 | */ |
@@ -38,27 +30,29 @@ | |||
38 | #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) | 30 | #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) |
39 | 31 | ||
40 | #ifdef CONFIG_MMU | 32 | #ifdef CONFIG_MMU |
33 | |||
41 | #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) | 34 | #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) |
42 | #define USER_DS MAKE_MM_SEG(PAGE_OFFSET) | 35 | #define USER_DS MAKE_MM_SEG(PAGE_OFFSET) |
43 | #else | ||
44 | #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
45 | #define USER_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
46 | #endif /* CONFIG_MMU */ | ||
47 | |||
48 | #define get_ds() (KERNEL_DS) | 36 | #define get_ds() (KERNEL_DS) |
49 | #ifdef CONFIG_MMU | ||
50 | #define get_fs() (current_thread_info()->addr_limit) | 37 | #define get_fs() (current_thread_info()->addr_limit) |
51 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) | 38 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) |
52 | #else | 39 | |
40 | #else /* not CONFIG_MMU */ | ||
41 | |||
42 | #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
43 | #define USER_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
44 | #define get_ds() (KERNEL_DS) | ||
45 | |||
53 | static inline mm_segment_t get_fs(void) | 46 | static inline mm_segment_t get_fs(void) |
54 | { | 47 | { |
55 | return USER_DS; | 48 | return USER_DS; |
56 | } | 49 | } |
57 | 50 | ||
58 | static inline void set_fs(mm_segment_t s) | 51 | static inline void set_fs(mm_segment_t s) |
59 | { | 52 | { |
60 | } | 53 | } |
61 | #endif /* CONFIG_MMU */ | 54 | |
55 | #endif /* not CONFIG_MMU */ | ||
62 | 56 | ||
63 | #define segment_eq(a,b) ((a).seg == (b).seg) | 57 | #define segment_eq(a,b) ((a).seg == (b).seg) |
64 | 58 | ||
@@ -83,9 +77,9 @@ static inline void set_fs(mm_segment_t s) | |||
83 | " subx %0, %0\n" \ | 77 | " subx %0, %0\n" \ |
84 | " cmpu %4, %1\n" \ | 78 | " cmpu %4, %1\n" \ |
85 | " subx %0, %5\n" \ | 79 | " subx %0, %5\n" \ |
86 | : "=&r"(flag), "=r"(sum) \ | 80 | : "=&r" (flag), "=r" (sum) \ |
87 | : "1"(addr), "r"((int)(size)), \ | 81 | : "1" (addr), "r" ((int)(size)), \ |
88 | "r"(current_thread_info()->addr_limit.seg), "r"(0) \ | 82 | "r" (current_thread_info()->addr_limit.seg), "r" (0) \ |
89 | : "cbit" ); \ | 83 | : "cbit" ); \ |
90 | flag; }) | 84 | flag; }) |
91 | 85 | ||
@@ -113,10 +107,10 @@ static inline void set_fs(mm_segment_t s) | |||
113 | #else | 107 | #else |
114 | static inline int access_ok(int type, const void *addr, unsigned long size) | 108 | static inline int access_ok(int type, const void *addr, unsigned long size) |
115 | { | 109 | { |
116 | extern unsigned long memory_start, memory_end; | 110 | extern unsigned long memory_start, memory_end; |
117 | unsigned long val = (unsigned long)addr; | 111 | unsigned long val = (unsigned long)addr; |
118 | 112 | ||
119 | return ((val >= memory_start) && ((val + size) < memory_end)); | 113 | return ((val >= memory_start) && ((val + size) < memory_end)); |
120 | } | 114 | } |
121 | #endif /* CONFIG_MMU */ | 115 | #endif /* CONFIG_MMU */ |
122 | 116 | ||
@@ -155,39 +149,6 @@ extern int fixup_exception(struct pt_regs *regs); | |||
155 | * accesses to the same area of user memory). | 149 | * accesses to the same area of user memory). |
156 | */ | 150 | */ |
157 | 151 | ||
158 | extern void __get_user_1(void); | ||
159 | extern void __get_user_2(void); | ||
160 | extern void __get_user_4(void); | ||
161 | |||
162 | #ifndef MODULE | ||
163 | #define __get_user_x(size,ret,x,ptr) \ | ||
164 | __asm__ __volatile__( \ | ||
165 | " mv r0, %0\n" \ | ||
166 | " mv r1, %1\n" \ | ||
167 | " bl __get_user_" #size "\n" \ | ||
168 | " mv %0, r0\n" \ | ||
169 | " mv %1, r1\n" \ | ||
170 | : "=r"(ret), "=r"(x) \ | ||
171 | : "0"(ptr) \ | ||
172 | : "r0", "r1", "r14" ) | ||
173 | #else /* MODULE */ | ||
174 | /* | ||
175 | * Use "jl" instead of "bl" for MODULE | ||
176 | */ | ||
177 | #define __get_user_x(size,ret,x,ptr) \ | ||
178 | __asm__ __volatile__( \ | ||
179 | " mv r0, %0\n" \ | ||
180 | " mv r1, %1\n" \ | ||
181 | " seth lr, #high(__get_user_" #size ")\n" \ | ||
182 | " or3 lr, lr, #low(__get_user_" #size ")\n" \ | ||
183 | " jl lr\n" \ | ||
184 | " mv %0, r0\n" \ | ||
185 | " mv %1, r1\n" \ | ||
186 | : "=r"(ret), "=r"(x) \ | ||
187 | : "0"(ptr) \ | ||
188 | : "r0", "r1", "r14" ) | ||
189 | #endif | ||
190 | |||
191 | /* Careful: we have to cast the result to the type of the pointer for sign | 152 | /* Careful: we have to cast the result to the type of the pointer for sign |
192 | reasons */ | 153 | reasons */ |
193 | /** | 154 | /** |
@@ -208,20 +169,7 @@ extern void __get_user_4(void); | |||
208 | * On error, the variable @x is set to zero. | 169 | * On error, the variable @x is set to zero. |
209 | */ | 170 | */ |
210 | #define get_user(x,ptr) \ | 171 | #define get_user(x,ptr) \ |
211 | ({ int __ret_gu; \ | 172 | __get_user_check((x),(ptr),sizeof(*(ptr))) |
212 | unsigned long __val_gu; \ | ||
213 | __chk_user_ptr(ptr); \ | ||
214 | switch(sizeof (*(ptr))) { \ | ||
215 | case 1: __get_user_x(1,__ret_gu,__val_gu,ptr); break; \ | ||
216 | case 2: __get_user_x(2,__ret_gu,__val_gu,ptr); break; \ | ||
217 | case 4: __get_user_x(4,__ret_gu,__val_gu,ptr); break; \ | ||
218 | default: __get_user_x(X,__ret_gu,__val_gu,ptr); break; \ | ||
219 | } \ | ||
220 | (x) = (__typeof__(*(ptr)))__val_gu; \ | ||
221 | __ret_gu; \ | ||
222 | }) | ||
223 | |||
224 | extern void __put_user_bad(void); | ||
225 | 173 | ||
226 | /** | 174 | /** |
227 | * put_user: - Write a simple value into user space. | 175 | * put_user: - Write a simple value into user space. |
@@ -240,8 +188,7 @@ extern void __put_user_bad(void); | |||
240 | * Returns zero on success, or -EFAULT on error. | 188 | * Returns zero on success, or -EFAULT on error. |
241 | */ | 189 | */ |
242 | #define put_user(x,ptr) \ | 190 | #define put_user(x,ptr) \ |
243 | __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) | 191 | __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) |
244 | |||
245 | 192 | ||
246 | /** | 193 | /** |
247 | * __get_user: - Get a simple variable from user space, with less checking. | 194 | * __get_user: - Get a simple variable from user space, with less checking. |
@@ -264,8 +211,64 @@ extern void __put_user_bad(void); | |||
264 | * On error, the variable @x is set to zero. | 211 | * On error, the variable @x is set to zero. |
265 | */ | 212 | */ |
266 | #define __get_user(x,ptr) \ | 213 | #define __get_user(x,ptr) \ |
267 | __get_user_nocheck((x),(ptr),sizeof(*(ptr))) | 214 | __get_user_nocheck((x),(ptr),sizeof(*(ptr))) |
268 | 215 | ||
216 | #define __get_user_nocheck(x,ptr,size) \ | ||
217 | ({ \ | ||
218 | long __gu_err = 0; \ | ||
219 | unsigned long __gu_val; \ | ||
220 | might_sleep(); \ | ||
221 | __get_user_size(__gu_val,(ptr),(size),__gu_err); \ | ||
222 | (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
223 | __gu_err; \ | ||
224 | }) | ||
225 | |||
226 | #define __get_user_check(x,ptr,size) \ | ||
227 | ({ \ | ||
228 | long __gu_err = -EFAULT; \ | ||
229 | unsigned long __gu_val = 0; \ | ||
230 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
231 | might_sleep(); \ | ||
232 | if (access_ok(VERIFY_READ,__gu_addr,size)) \ | ||
233 | __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \ | ||
234 | (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
235 | __gu_err; \ | ||
236 | }) | ||
237 | |||
238 | extern long __get_user_bad(void); | ||
239 | |||
240 | #define __get_user_size(x,ptr,size,retval) \ | ||
241 | do { \ | ||
242 | retval = 0; \ | ||
243 | __chk_user_ptr(ptr); \ | ||
244 | switch (size) { \ | ||
245 | case 1: __get_user_asm(x,ptr,retval,"ub"); break; \ | ||
246 | case 2: __get_user_asm(x,ptr,retval,"uh"); break; \ | ||
247 | case 4: __get_user_asm(x,ptr,retval,""); break; \ | ||
248 | default: (x) = __get_user_bad(); \ | ||
249 | } \ | ||
250 | } while (0) | ||
251 | |||
252 | #define __get_user_asm(x, addr, err, itype) \ | ||
253 | __asm__ __volatile__( \ | ||
254 | " .fillinsn\n" \ | ||
255 | "1: ld"itype" %1,@%2\n" \ | ||
256 | " .fillinsn\n" \ | ||
257 | "2:\n" \ | ||
258 | ".section .fixup,\"ax\"\n" \ | ||
259 | " .balign 4\n" \ | ||
260 | "3: ldi %0,%3\n" \ | ||
261 | " seth r14,#high(2b)\n" \ | ||
262 | " or3 r14,r14,#low(2b)\n" \ | ||
263 | " jmp r14\n" \ | ||
264 | ".previous\n" \ | ||
265 | ".section __ex_table,\"a\"\n" \ | ||
266 | " .balign 4\n" \ | ||
267 | " .long 1b,3b\n" \ | ||
268 | ".previous" \ | ||
269 | : "=&r" (err), "=&r" (x) \ | ||
270 | : "r" (addr), "i" (-EFAULT), "0" (err) \ | ||
271 | : "r14", "memory") | ||
269 | 272 | ||
270 | /** | 273 | /** |
271 | * __put_user: - Write a simple value into user space, with less checking. | 274 | * __put_user: - Write a simple value into user space, with less checking. |
@@ -287,11 +290,13 @@ extern void __put_user_bad(void); | |||
287 | * Returns zero on success, or -EFAULT on error. | 290 | * Returns zero on success, or -EFAULT on error. |
288 | */ | 291 | */ |
289 | #define __put_user(x,ptr) \ | 292 | #define __put_user(x,ptr) \ |
290 | __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) | 293 | __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) |
294 | |||
291 | 295 | ||
292 | #define __put_user_nocheck(x,ptr,size) \ | 296 | #define __put_user_nocheck(x,ptr,size) \ |
293 | ({ \ | 297 | ({ \ |
294 | long __pu_err; \ | 298 | long __pu_err; \ |
299 | might_sleep(); \ | ||
295 | __put_user_size((x),(ptr),(size),__pu_err); \ | 300 | __put_user_size((x),(ptr),(size),__pu_err); \ |
296 | __pu_err; \ | 301 | __pu_err; \ |
297 | }) | 302 | }) |
@@ -308,28 +313,28 @@ extern void __put_user_bad(void); | |||
308 | }) | 313 | }) |
309 | 314 | ||
310 | #if defined(__LITTLE_ENDIAN__) | 315 | #if defined(__LITTLE_ENDIAN__) |
311 | #define __put_user_u64(x, addr, err) \ | 316 | #define __put_user_u64(x, addr, err) \ |
312 | __asm__ __volatile__( \ | 317 | __asm__ __volatile__( \ |
313 | " .fillinsn\n" \ | 318 | " .fillinsn\n" \ |
314 | "1: st %L1,@%2\n" \ | 319 | "1: st %L1,@%2\n" \ |
315 | " .fillinsn\n" \ | 320 | " .fillinsn\n" \ |
316 | "2: st %H1,@(4,%2)\n" \ | 321 | "2: st %H1,@(4,%2)\n" \ |
317 | " .fillinsn\n" \ | 322 | " .fillinsn\n" \ |
318 | "3:\n" \ | 323 | "3:\n" \ |
319 | ".section .fixup,\"ax\"\n" \ | 324 | ".section .fixup,\"ax\"\n" \ |
320 | " .balign 4\n" \ | 325 | " .balign 4\n" \ |
321 | "4: ldi %0,%3\n" \ | 326 | "4: ldi %0,%3\n" \ |
322 | " seth r14,#high(3b)\n" \ | 327 | " seth r14,#high(3b)\n" \ |
323 | " or3 r14,r14,#low(3b)\n" \ | 328 | " or3 r14,r14,#low(3b)\n" \ |
324 | " jmp r14\n" \ | 329 | " jmp r14\n" \ |
325 | ".previous\n" \ | 330 | ".previous\n" \ |
326 | ".section __ex_table,\"a\"\n" \ | 331 | ".section __ex_table,\"a\"\n" \ |
327 | " .balign 4\n" \ | 332 | " .balign 4\n" \ |
328 | " .long 1b,4b\n" \ | 333 | " .long 1b,4b\n" \ |
329 | " .long 2b,4b\n" \ | 334 | " .long 2b,4b\n" \ |
330 | ".previous" \ | 335 | ".previous" \ |
331 | : "=&r"(err) \ | 336 | : "=&r" (err) \ |
332 | : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ | 337 | : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ |
333 | : "r14", "memory") | 338 | : "r14", "memory") |
334 | 339 | ||
335 | #elif defined(__BIG_ENDIAN__) | 340 | #elif defined(__BIG_ENDIAN__) |
@@ -353,13 +358,15 @@ extern void __put_user_bad(void); | |||
353 | " .long 1b,4b\n" \ | 358 | " .long 1b,4b\n" \ |
354 | " .long 2b,4b\n" \ | 359 | " .long 2b,4b\n" \ |
355 | ".previous" \ | 360 | ".previous" \ |
356 | : "=&r"(err) \ | 361 | : "=&r" (err) \ |
357 | : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ | 362 | : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ |
358 | : "r14", "memory") | 363 | : "r14", "memory") |
359 | #else | 364 | #else |
360 | #error no endian defined | 365 | #error no endian defined |
361 | #endif | 366 | #endif |
362 | 367 | ||
368 | extern void __put_user_bad(void); | ||
369 | |||
363 | #define __put_user_size(x,ptr,size,retval) \ | 370 | #define __put_user_size(x,ptr,size,retval) \ |
364 | do { \ | 371 | do { \ |
365 | retval = 0; \ | 372 | retval = 0; \ |
@@ -398,52 +405,8 @@ struct __large_struct { unsigned long buf[100]; }; | |||
398 | " .balign 4\n" \ | 405 | " .balign 4\n" \ |
399 | " .long 1b,3b\n" \ | 406 | " .long 1b,3b\n" \ |
400 | ".previous" \ | 407 | ".previous" \ |
401 | : "=&r"(err) \ | 408 | : "=&r" (err) \ |
402 | : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ | 409 | : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ |
403 | : "r14", "memory") | ||
404 | |||
405 | #define __get_user_nocheck(x,ptr,size) \ | ||
406 | ({ \ | ||
407 | long __gu_err; \ | ||
408 | unsigned long __gu_val; \ | ||
409 | __get_user_size(__gu_val,(ptr),(size),__gu_err); \ | ||
410 | (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
411 | __gu_err; \ | ||
412 | }) | ||
413 | |||
414 | extern long __get_user_bad(void); | ||
415 | |||
416 | #define __get_user_size(x,ptr,size,retval) \ | ||
417 | do { \ | ||
418 | retval = 0; \ | ||
419 | __chk_user_ptr(ptr); \ | ||
420 | switch (size) { \ | ||
421 | case 1: __get_user_asm(x,ptr,retval,"ub"); break; \ | ||
422 | case 2: __get_user_asm(x,ptr,retval,"uh"); break; \ | ||
423 | case 4: __get_user_asm(x,ptr,retval,""); break; \ | ||
424 | default: (x) = __get_user_bad(); \ | ||
425 | } \ | ||
426 | } while (0) | ||
427 | |||
428 | #define __get_user_asm(x, addr, err, itype) \ | ||
429 | __asm__ __volatile__( \ | ||
430 | " .fillinsn\n" \ | ||
431 | "1: ld"itype" %1,@%2\n" \ | ||
432 | " .fillinsn\n" \ | ||
433 | "2:\n" \ | ||
434 | ".section .fixup,\"ax\"\n" \ | ||
435 | " .balign 4\n" \ | ||
436 | "3: ldi %0,%3\n" \ | ||
437 | " seth r14,#high(2b)\n" \ | ||
438 | " or3 r14,r14,#low(2b)\n" \ | ||
439 | " jmp r14\n" \ | ||
440 | ".previous\n" \ | ||
441 | ".section __ex_table,\"a\"\n" \ | ||
442 | " .balign 4\n" \ | ||
443 | " .long 1b,3b\n" \ | ||
444 | ".previous" \ | ||
445 | : "=&r"(err), "=&r"(x) \ | ||
446 | : "r"(addr), "i"(-EFAULT), "0"(err) \ | ||
447 | : "r14", "memory") | 410 | : "r14", "memory") |
448 | 411 | ||
449 | /* | 412 | /* |
@@ -453,7 +416,6 @@ do { \ | |||
453 | * anything, so this is accurate. | 416 | * anything, so this is accurate. |
454 | */ | 417 | */ |
455 | 418 | ||
456 | |||
457 | /* | 419 | /* |
458 | * Copy To/From Userspace | 420 | * Copy To/From Userspace |
459 | */ | 421 | */ |
@@ -511,8 +473,9 @@ do { \ | |||
511 | " .long 2b,9b\n" \ | 473 | " .long 2b,9b\n" \ |
512 | " .long 3b,9b\n" \ | 474 | " .long 3b,9b\n" \ |
513 | ".previous\n" \ | 475 | ".previous\n" \ |
514 | : "=&r"(__dst), "=&r"(__src), "=&r"(size), "=&r"(__c) \ | 476 | : "=&r" (__dst), "=&r" (__src), "=&r" (size), \ |
515 | : "0"(to), "1"(from), "2"(size), "3"(size / 4) \ | 477 | "=&r" (__c) \ |
478 | : "0" (to), "1" (from), "2" (size), "3" (size / 4) \ | ||
516 | : "r14", "memory"); \ | 479 | : "r14", "memory"); \ |
517 | } while (0) | 480 | } while (0) |
518 | 481 | ||
@@ -573,8 +536,9 @@ do { \ | |||
573 | " .long 2b,7b\n" \ | 536 | " .long 2b,7b\n" \ |
574 | " .long 3b,7b\n" \ | 537 | " .long 3b,7b\n" \ |
575 | ".previous\n" \ | 538 | ".previous\n" \ |
576 | : "=&r"(__dst), "=&r"(__src), "=&r"(size), "=&r"(__c) \ | 539 | : "=&r" (__dst), "=&r" (__src), "=&r" (size), \ |
577 | : "0"(to), "1"(from), "2"(size), "3"(size / 4) \ | 540 | "=&r" (__c) \ |
541 | : "0" (to), "1" (from), "2" (size), "3" (size / 4) \ | ||
578 | : "r14", "memory"); \ | 542 | : "r14", "memory"); \ |
579 | } while (0) | 543 | } while (0) |
580 | 544 | ||
@@ -676,7 +640,7 @@ unsigned long __generic_copy_from_user(void *, const void __user *, unsigned lon | |||
676 | #define copy_from_user(to,from,n) \ | 640 | #define copy_from_user(to,from,n) \ |
677 | ({ \ | 641 | ({ \ |
678 | might_sleep(); \ | 642 | might_sleep(); \ |
679 | __generic_copy_from_user((to),(from),(n)); \ | 643 | __generic_copy_from_user((to),(from),(n)); \ |
680 | }) | 644 | }) |
681 | 645 | ||
682 | long __must_check strncpy_from_user(char *dst, const char __user *src, | 646 | long __must_check strncpy_from_user(char *dst, const char __user *src, |
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h index 39be87ca2a..be0eb014c3 100644 --- a/include/asm-m32r/unistd.h +++ b/include/asm-m32r/unistd.h | |||
@@ -292,7 +292,7 @@ | |||
292 | #define __NR_mq_timedreceive (__NR_mq_open+3) | 292 | #define __NR_mq_timedreceive (__NR_mq_open+3) |
293 | #define __NR_mq_notify (__NR_mq_open+4) | 293 | #define __NR_mq_notify (__NR_mq_open+4) |
294 | #define __NR_mq_getsetattr (__NR_mq_open+5) | 294 | #define __NR_mq_getsetattr (__NR_mq_open+5) |
295 | #define __NR_sys_kexec_load 283 | 295 | #define __NR_kexec_load 283 |
296 | #define __NR_waitid 284 | 296 | #define __NR_waitid 284 |
297 | 297 | ||
298 | #define NR_syscalls 285 | 298 | #define NR_syscalls 285 |
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index 42520cc84b..1386af1cb7 100644 --- a/include/asm-mips/addrspace.h +++ b/include/asm-mips/addrspace.h | |||
@@ -129,6 +129,7 @@ | |||
129 | #if defined (CONFIG_CPU_R4300) \ | 129 | #if defined (CONFIG_CPU_R4300) \ |
130 | || defined (CONFIG_CPU_R4X00) \ | 130 | || defined (CONFIG_CPU_R4X00) \ |
131 | || defined (CONFIG_CPU_R5000) \ | 131 | || defined (CONFIG_CPU_R5000) \ |
132 | || defined (CONFIG_CPU_RM7000) \ | ||
132 | || defined (CONFIG_CPU_NEVADA) \ | 133 | || defined (CONFIG_CPU_NEVADA) \ |
133 | || defined (CONFIG_CPU_TX49XX) \ | 134 | || defined (CONFIG_CPU_TX49XX) \ |
134 | || defined (CONFIG_CPU_MIPS64) | 135 | || defined (CONFIG_CPU_MIPS64) |
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h index 30b18ea6cb..f54aa147ec 100644 --- a/include/asm-mips/asmmacro.h +++ b/include/asm-mips/asmmacro.h | |||
@@ -17,7 +17,26 @@ | |||
17 | #ifdef CONFIG_64BIT | 17 | #ifdef CONFIG_64BIT |
18 | #include <asm/asmmacro-64.h> | 18 | #include <asm/asmmacro-64.h> |
19 | #endif | 19 | #endif |
20 | #ifdef CONFIG_MIPS_MT_SMTC | ||
21 | #include <asm/mipsmtregs.h> | ||
22 | #endif | ||
20 | 23 | ||
24 | #ifdef CONFIG_MIPS_MT_SMTC | ||
25 | .macro local_irq_enable reg=t0 | ||
26 | mfc0 \reg, CP0_TCSTATUS | ||
27 | ori \reg, \reg, TCSTATUS_IXMT | ||
28 | xori \reg, \reg, TCSTATUS_IXMT | ||
29 | mtc0 \reg, CP0_TCSTATUS | ||
30 | ehb | ||
31 | .endm | ||
32 | |||
33 | .macro local_irq_disable reg=t0 | ||
34 | mfc0 \reg, CP0_TCSTATUS | ||
35 | ori \reg, \reg, TCSTATUS_IXMT | ||
36 | mtc0 \reg, CP0_TCSTATUS | ||
37 | ehb | ||
38 | .endm | ||
39 | #else | ||
21 | .macro local_irq_enable reg=t0 | 40 | .macro local_irq_enable reg=t0 |
22 | mfc0 \reg, CP0_STATUS | 41 | mfc0 \reg, CP0_STATUS |
23 | ori \reg, \reg, 1 | 42 | ori \reg, \reg, 1 |
@@ -32,6 +51,7 @@ | |||
32 | mtc0 \reg, CP0_STATUS | 51 | mtc0 \reg, CP0_STATUS |
33 | irq_disable_hazard | 52 | irq_disable_hazard |
34 | .endm | 53 | .endm |
54 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
35 | 55 | ||
36 | #ifdef CONFIG_CPU_SB1 | 56 | #ifdef CONFIG_CPU_SB1 |
37 | .macro fpu_enable_hazard | 57 | .macro fpu_enable_hazard |
@@ -48,4 +68,31 @@ | |||
48 | .endm | 68 | .endm |
49 | #endif | 69 | #endif |
50 | 70 | ||
71 | /* | ||
72 | * Temporary until all gas have MT ASE support | ||
73 | */ | ||
74 | .macro DMT reg=0 | ||
75 | .word (0x41600bc1 | (\reg << 16)) | ||
76 | .endm | ||
77 | |||
78 | .macro EMT reg=0 | ||
79 | .word (0x41600be1 | (\reg << 16)) | ||
80 | .endm | ||
81 | |||
82 | .macro DVPE reg=0 | ||
83 | .word (0x41600001 | (\reg << 16)) | ||
84 | .endm | ||
85 | |||
86 | .macro EVPE reg=0 | ||
87 | .word (0x41600021 | (\reg << 16)) | ||
88 | .endm | ||
89 | |||
90 | .macro MFTR rt=0, rd=0, u=0, sel=0 | ||
91 | .word (0x41000000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)) | ||
92 | .endm | ||
93 | |||
94 | .macro MTTR rt=0, rd=0, u=0, sel=0 | ||
95 | .word (0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)) | ||
96 | .endm | ||
97 | |||
51 | #endif /* _ASM_ASMMACRO_H */ | 98 | #endif /* _ASM_ASMMACRO_H */ |
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index a1728f8c07..d2f444537e 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h | |||
@@ -467,64 +467,56 @@ static inline unsigned long __ffs(unsigned long word) | |||
467 | } | 467 | } |
468 | 468 | ||
469 | /* | 469 | /* |
470 | * ffs - find first bit set. | 470 | * fls - find last bit set. |
471 | * @word: The word to search | 471 | * @word: The word to search |
472 | * | 472 | * |
473 | * Returns 1..SZLONG | 473 | * This is defined the same way as ffs. |
474 | * Returns 0 if no bit exists | 474 | * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. |
475 | */ | 475 | */ |
476 | 476 | static inline int fls(int word) | |
477 | static inline unsigned long ffs(unsigned long word) | ||
478 | { | 477 | { |
479 | if (!word) | 478 | __asm__ ("clz %0, %1" : "=r" (word) : "r" (word)); |
480 | return 0; | ||
481 | 479 | ||
482 | return __ffs(word) + 1; | 480 | return 32 - word; |
483 | } | 481 | } |
484 | 482 | ||
485 | /* | 483 | #if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPS64) |
486 | * ffz - find first zero in word. | 484 | static inline int fls64(__u64 word) |
487 | * @word: The word to search | ||
488 | * | ||
489 | * Undefined if no zero exists, so code should check against ~0UL first. | ||
490 | */ | ||
491 | static inline unsigned long ffz(unsigned long word) | ||
492 | { | 485 | { |
493 | return __ffs (~word); | 486 | __asm__ ("dclz %0, %1" : "=r" (word) : "r" (word)); |
487 | |||
488 | return 64 - word; | ||
494 | } | 489 | } |
490 | #else | ||
491 | #include <asm-generic/bitops/fls64.h> | ||
492 | #endif | ||
495 | 493 | ||
496 | /* | 494 | /* |
497 | * fls - find last bit set. | 495 | * ffs - find first bit set. |
498 | * @word: The word to search | 496 | * @word: The word to search |
499 | * | 497 | * |
500 | * Returns 1..SZLONG | 498 | * This is defined the same way as |
501 | * Returns 0 if no bit exists | 499 | * the libc and compiler builtin ffs routines, therefore |
500 | * differs in spirit from the above ffz (man ffs). | ||
502 | */ | 501 | */ |
503 | static inline unsigned long fls(unsigned long word) | 502 | static inline int ffs(int word) |
504 | { | 503 | { |
505 | #ifdef CONFIG_CPU_MIPS32 | 504 | if (!word) |
506 | __asm__ ("clz %0, %1" : "=r" (word) : "r" (word)); | 505 | return 0; |
507 | |||
508 | return 32 - word; | ||
509 | #endif | ||
510 | |||
511 | #ifdef CONFIG_CPU_MIPS64 | ||
512 | __asm__ ("dclz %0, %1" : "=r" (word) : "r" (word)); | ||
513 | 506 | ||
514 | return 64 - word; | 507 | return fls(word & -word); |
515 | #endif | ||
516 | } | 508 | } |
517 | 509 | ||
518 | #else | 510 | #else |
519 | 511 | ||
520 | #include <asm-generic/bitops/__ffs.h> | 512 | #include <asm-generic/bitops/__ffs.h> |
521 | #include <asm-generic/bitops/ffs.h> | 513 | #include <asm-generic/bitops/ffs.h> |
522 | #include <asm-generic/bitops/ffz.h> | ||
523 | #include <asm-generic/bitops/fls.h> | 514 | #include <asm-generic/bitops/fls.h> |
515 | #include <asm-generic/bitops/fls64.h> | ||
524 | 516 | ||
525 | #endif /*defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) */ | 517 | #endif /*defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) */ |
526 | 518 | ||
527 | #include <asm-generic/bitops/fls64.h> | 519 | #include <asm-generic/bitops/ffz.h> |
528 | #include <asm-generic/bitops/find.h> | 520 | #include <asm-generic/bitops/find.h> |
529 | 521 | ||
530 | #ifdef __KERNEL__ | 522 | #ifdef __KERNEL__ |
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h index aeae9fabf4..47bc8f6c20 100644 --- a/include/asm-mips/cacheflush.h +++ b/include/asm-mips/cacheflush.h | |||
@@ -74,6 +74,7 @@ static inline void copy_from_user_page(struct vm_area_struct *vma, | |||
74 | 74 | ||
75 | extern void (*flush_cache_sigtramp)(unsigned long addr); | 75 | extern void (*flush_cache_sigtramp)(unsigned long addr); |
76 | extern void (*flush_icache_all)(void); | 76 | extern void (*flush_icache_all)(void); |
77 | extern void (*local_flush_data_cache_page)(void * addr); | ||
77 | extern void (*flush_data_cache_page)(unsigned long addr); | 78 | extern void (*flush_data_cache_page)(unsigned long addr); |
78 | 79 | ||
79 | /* | 80 | /* |
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 3f2b6d9ac4..254e11ed24 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #define cpu_has_sb1_cache (cpu_data[0].options & MIPS_CPU_SB1_CACHE) | 40 | #define cpu_has_sb1_cache (cpu_data[0].options & MIPS_CPU_SB1_CACHE) |
41 | #endif | 41 | #endif |
42 | #ifndef cpu_has_fpu | 42 | #ifndef cpu_has_fpu |
43 | #define cpu_has_fpu (cpu_data[0].options & MIPS_CPU_FPU) | 43 | #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) |
44 | #endif | 44 | #endif |
45 | #ifndef cpu_has_32fpr | 45 | #ifndef cpu_has_32fpr |
46 | #define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR) | 46 | #define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR) |
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h index 140be1c67d..6572ac7036 100644 --- a/include/asm-mips/cpu-info.h +++ b/include/asm-mips/cpu-info.h | |||
@@ -73,6 +73,16 @@ struct cpuinfo_mips { | |||
73 | struct cache_desc dcache; /* Primary D or combined I/D cache */ | 73 | struct cache_desc dcache; /* Primary D or combined I/D cache */ |
74 | struct cache_desc scache; /* Secondary cache */ | 74 | struct cache_desc scache; /* Secondary cache */ |
75 | struct cache_desc tcache; /* Tertiary/split secondary cache */ | 75 | struct cache_desc tcache; /* Tertiary/split secondary cache */ |
76 | #if defined(CONFIG_MIPS_MT_SMTC) | ||
77 | /* | ||
78 | * In the MIPS MT "SMTC" model, each TC is considered | ||
79 | * to be a "CPU" for the purposes of scheduling, but | ||
80 | * exception resources, ASID spaces, etc, are common | ||
81 | * to all TCs within the same VPE. | ||
82 | */ | ||
83 | int vpe_id; /* Virtual Processor number */ | ||
84 | int tc_id; /* Thread Context number */ | ||
85 | #endif /* CONFIG_MIPS_MT */ | ||
76 | void *data; /* Additional data */ | 86 | void *data; /* Additional data */ |
77 | } __attribute__((aligned(SMP_CACHE_BYTES))); | 87 | } __attribute__((aligned(SMP_CACHE_BYTES))); |
78 | 88 | ||
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h index 818b9a97e2..dff2a0a52f 100644 --- a/include/asm-mips/cpu.h +++ b/include/asm-mips/cpu.h | |||
@@ -51,6 +51,7 @@ | |||
51 | #define PRID_IMP_R4300 0x0b00 | 51 | #define PRID_IMP_R4300 0x0b00 |
52 | #define PRID_IMP_VR41XX 0x0c00 | 52 | #define PRID_IMP_VR41XX 0x0c00 |
53 | #define PRID_IMP_R12000 0x0e00 | 53 | #define PRID_IMP_R12000 0x0e00 |
54 | #define PRID_IMP_R14000 0x0f00 | ||
54 | #define PRID_IMP_R8000 0x1000 | 55 | #define PRID_IMP_R8000 0x1000 |
55 | #define PRID_IMP_PR4450 0x1200 | 56 | #define PRID_IMP_PR4450 0x1200 |
56 | #define PRID_IMP_R4600 0x2000 | 57 | #define PRID_IMP_R4600 0x2000 |
@@ -87,6 +88,7 @@ | |||
87 | #define PRID_IMP_24K 0x9300 | 88 | #define PRID_IMP_24K 0x9300 |
88 | #define PRID_IMP_34K 0x9500 | 89 | #define PRID_IMP_34K 0x9500 |
89 | #define PRID_IMP_24KE 0x9600 | 90 | #define PRID_IMP_24KE 0x9600 |
91 | #define PRID_IMP_74K 0x9700 | ||
90 | 92 | ||
91 | /* | 93 | /* |
92 | * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE | 94 | * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE |
@@ -196,7 +198,9 @@ | |||
196 | #define CPU_34K 60 | 198 | #define CPU_34K 60 |
197 | #define CPU_PR4450 61 | 199 | #define CPU_PR4450 61 |
198 | #define CPU_SB1A 62 | 200 | #define CPU_SB1A 62 |
199 | #define CPU_LAST 62 | 201 | #define CPU_74K 63 |
202 | #define CPU_R14000 64 | ||
203 | #define CPU_LAST 64 | ||
200 | 204 | ||
201 | /* | 205 | /* |
202 | * ISA Level encodings | 206 | * ISA Level encodings |
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h index 64dd45150f..928f30f8c4 100644 --- a/include/asm-mips/delay.h +++ b/include/asm-mips/delay.h | |||
@@ -19,20 +19,22 @@ static inline void __delay(unsigned long loops) | |||
19 | { | 19 | { |
20 | if (sizeof(long) == 4) | 20 | if (sizeof(long) == 4) |
21 | __asm__ __volatile__ ( | 21 | __asm__ __volatile__ ( |
22 | ".set\tnoreorder\n" | 22 | " .set noreorder \n" |
23 | "1:\tbnez\t%0,1b\n\t" | 23 | " .align 3 \n" |
24 | "subu\t%0,1\n\t" | 24 | "1: bnez %0, 1b \n" |
25 | ".set\treorder" | 25 | " subu %0, 1 \n" |
26 | " .set reorder \n" | ||
26 | : "=r" (loops) | 27 | : "=r" (loops) |
27 | : "0" (loops)); | 28 | : "0" (loops)); |
28 | else if (sizeof(long) == 8) | 29 | else if (sizeof(long) == 8) |
29 | __asm__ __volatile__ ( | 30 | __asm__ __volatile__ ( |
30 | ".set\tnoreorder\n" | 31 | " .set noreorder \n" |
31 | "1:\tbnez\t%0,1b\n\t" | 32 | " .align 3 \n" |
32 | "dsubu\t%0,1\n\t" | 33 | "1: bnez %0, 1b \n" |
33 | ".set\treorder" | 34 | " dsubu %0, 1 \n" |
34 | :"=r" (loops) | 35 | " .set reorder \n" |
35 | :"0" (loops)); | 36 | : "=r" (loops) |
37 | : "0" (loops)); | ||
36 | } | 38 | } |
37 | 39 | ||
38 | 40 | ||
diff --git a/include/asm-mips/ds1742.h b/include/asm-mips/ds1742.h new file mode 100644 index 0000000000..c2f2c32da6 --- /dev/null +++ b/include/asm-mips/ds1742.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2006 by Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef _ASM_DS1742_H | ||
9 | #define _ASM_DS1742_H | ||
10 | |||
11 | #include <ds1742.h> | ||
12 | |||
13 | #endif /* _ASM_DS1742_H */ | ||
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h index 851f013ada..bdc9de2df1 100644 --- a/include/asm-mips/elf.h +++ b/include/asm-mips/elf.h | |||
@@ -119,8 +119,49 @@ | |||
119 | #define SHT_MIPS_CONFLICT 0x70000002 | 119 | #define SHT_MIPS_CONFLICT 0x70000002 |
120 | #define SHT_MIPS_GPTAB 0x70000003 | 120 | #define SHT_MIPS_GPTAB 0x70000003 |
121 | #define SHT_MIPS_UCODE 0x70000004 | 121 | #define SHT_MIPS_UCODE 0x70000004 |
122 | 122 | #define SHT_MIPS_DEBUG 0x70000005 | |
123 | #define SHF_MIPS_GPREL 0x10000000 | 123 | #define SHT_MIPS_REGINFO 0x70000006 |
124 | #define SHT_MIPS_PACKAGE 0x70000007 | ||
125 | #define SHT_MIPS_PACKSYM 0x70000008 | ||
126 | #define SHT_MIPS_RELD 0x70000009 | ||
127 | #define SHT_MIPS_IFACE 0x7000000b | ||
128 | #define SHT_MIPS_CONTENT 0x7000000c | ||
129 | #define SHT_MIPS_OPTIONS 0x7000000d | ||
130 | #define SHT_MIPS_SHDR 0x70000010 | ||
131 | #define SHT_MIPS_FDESC 0x70000011 | ||
132 | #define SHT_MIPS_EXTSYM 0x70000012 | ||
133 | #define SHT_MIPS_DENSE 0x70000013 | ||
134 | #define SHT_MIPS_PDESC 0x70000014 | ||
135 | #define SHT_MIPS_LOCSYM 0x70000015 | ||
136 | #define SHT_MIPS_AUXSYM 0x70000016 | ||
137 | #define SHT_MIPS_OPTSYM 0x70000017 | ||
138 | #define SHT_MIPS_LOCSTR 0x70000018 | ||
139 | #define SHT_MIPS_LINE 0x70000019 | ||
140 | #define SHT_MIPS_RFDESC 0x7000001a | ||
141 | #define SHT_MIPS_DELTASYM 0x7000001b | ||
142 | #define SHT_MIPS_DELTAINST 0x7000001c | ||
143 | #define SHT_MIPS_DELTACLASS 0x7000001d | ||
144 | #define SHT_MIPS_DWARF 0x7000001e | ||
145 | #define SHT_MIPS_DELTADECL 0x7000001f | ||
146 | #define SHT_MIPS_SYMBOL_LIB 0x70000020 | ||
147 | #define SHT_MIPS_EVENTS 0x70000021 | ||
148 | #define SHT_MIPS_TRANSLATE 0x70000022 | ||
149 | #define SHT_MIPS_PIXIE 0x70000023 | ||
150 | #define SHT_MIPS_XLATE 0x70000024 | ||
151 | #define SHT_MIPS_XLATE_DEBUG 0x70000025 | ||
152 | #define SHT_MIPS_WHIRL 0x70000026 | ||
153 | #define SHT_MIPS_EH_REGION 0x70000027 | ||
154 | #define SHT_MIPS_XLATE_OLD 0x70000028 | ||
155 | #define SHT_MIPS_PDR_EXCEPTION 0x70000029 | ||
156 | |||
157 | #define SHF_MIPS_GPREL 0x10000000 | ||
158 | #define SHF_MIPS_MERGE 0x20000000 | ||
159 | #define SHF_MIPS_ADDR 0x40000000 | ||
160 | #define SHF_MIPS_STRING 0x80000000 | ||
161 | #define SHF_MIPS_NOSTRIP 0x08000000 | ||
162 | #define SHF_MIPS_LOCAL 0x04000000 | ||
163 | #define SHF_MIPS_NAMES 0x02000000 | ||
164 | #define SHF_MIPS_NODUPES 0x01000000 | ||
124 | 165 | ||
125 | #ifndef ELF_ARCH | 166 | #ifndef ELF_ARCH |
126 | /* ELF register definitions */ | 167 | /* ELF register definitions */ |
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h index 9c828b1f82..b0f50015e2 100644 --- a/include/asm-mips/fpu.h +++ b/include/asm-mips/fpu.h | |||
@@ -21,6 +21,10 @@ | |||
21 | #include <asm/processor.h> | 21 | #include <asm/processor.h> |
22 | #include <asm/current.h> | 22 | #include <asm/current.h> |
23 | 23 | ||
24 | #ifdef CONFIG_MIPS_MT_FPAFF | ||
25 | #include <asm/mips_mt.h> | ||
26 | #endif | ||
27 | |||
24 | struct sigcontext; | 28 | struct sigcontext; |
25 | struct sigcontext32; | 29 | struct sigcontext32; |
26 | 30 | ||
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h index a554089991..12d118f1bc 100644 --- a/include/asm-mips/futex.h +++ b/include/asm-mips/futex.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/futex.h> | 7 | #include <linux/futex.h> |
8 | #include <asm/errno.h> | 8 | #include <asm/errno.h> |
9 | #include <asm/uaccess.h> | 9 | #include <asm/uaccess.h> |
10 | #include <asm/war.h> | ||
10 | 11 | ||
11 | #ifdef CONFIG_SMP | 12 | #ifdef CONFIG_SMP |
12 | #define __FUTEX_SMP_SYNC " sync \n" | 13 | #define __FUTEX_SMP_SYNC " sync \n" |
@@ -16,30 +17,58 @@ | |||
16 | 17 | ||
17 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | 18 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ |
18 | { \ | 19 | { \ |
19 | __asm__ __volatile__( \ | 20 | if (cpu_has_llsc && R10000_LLSC_WAR) { \ |
20 | " .set push \n" \ | 21 | __asm__ __volatile__( \ |
21 | " .set noat \n" \ | 22 | " .set push \n" \ |
22 | " .set mips3 \n" \ | 23 | " .set noat \n" \ |
23 | "1: ll %1, (%3) # __futex_atomic_op1 \n" \ | 24 | " .set mips3 \n" \ |
24 | " .set mips0 \n" \ | 25 | "1: ll %1, (%3) # __futex_atomic_op \n" \ |
25 | " " insn " \n" \ | 26 | " .set mips0 \n" \ |
26 | " .set mips3 \n" \ | 27 | " " insn " \n" \ |
27 | "2: sc $1, (%3) \n" \ | 28 | " .set mips3 \n" \ |
28 | " beqzl $1, 1b \n" \ | 29 | "2: sc $1, (%3) \n" \ |
29 | __FUTEX_SMP_SYNC \ | 30 | " beqzl $1, 1b \n" \ |
30 | "3: \n" \ | 31 | __FUTEX_SMP_SYNC \ |
31 | " .set pop \n" \ | 32 | "3: \n" \ |
32 | " .set mips0 \n" \ | 33 | " .set pop \n" \ |
33 | " .section .fixup,\"ax\" \n" \ | 34 | " .set mips0 \n" \ |
34 | "4: li %0, %5 \n" \ | 35 | " .section .fixup,\"ax\" \n" \ |
35 | " j 2b \n" \ | 36 | "4: li %0, %5 \n" \ |
36 | " .previous \n" \ | 37 | " j 2b \n" \ |
37 | " .section __ex_table,\"a\" \n" \ | 38 | " .previous \n" \ |
38 | " "__UA_ADDR "\t1b, 4b \n" \ | 39 | " .section __ex_table,\"a\" \n" \ |
39 | " "__UA_ADDR "\t2b, 4b \n" \ | 40 | " "__UA_ADDR "\t1b, 4b \n" \ |
40 | " .previous \n" \ | 41 | " "__UA_ADDR "\t2b, 4b \n" \ |
41 | : "=r" (ret), "=r" (oldval) \ | 42 | " .previous \n" \ |
42 | : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ | 43 | : "=r" (ret), "=r" (oldval) \ |
44 | : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ | ||
45 | } else if (cpu_has_llsc) { \ | ||
46 | __asm__ __volatile__( \ | ||
47 | " .set push \n" \ | ||
48 | " .set noat \n" \ | ||
49 | " .set mips3 \n" \ | ||
50 | "1: ll %1, (%3) # __futex_atomic_op \n" \ | ||
51 | " .set mips0 \n" \ | ||
52 | " " insn " \n" \ | ||
53 | " .set mips3 \n" \ | ||
54 | "2: sc $1, (%3) \n" \ | ||
55 | " beqz $1, 1b \n" \ | ||
56 | __FUTEX_SMP_SYNC \ | ||
57 | "3: \n" \ | ||
58 | " .set pop \n" \ | ||
59 | " .set mips0 \n" \ | ||
60 | " .section .fixup,\"ax\" \n" \ | ||
61 | "4: li %0, %5 \n" \ | ||
62 | " j 2b \n" \ | ||
63 | " .previous \n" \ | ||
64 | " .section __ex_table,\"a\" \n" \ | ||
65 | " "__UA_ADDR "\t1b, 4b \n" \ | ||
66 | " "__UA_ADDR "\t2b, 4b \n" \ | ||
67 | " .previous \n" \ | ||
68 | : "=r" (ret), "=r" (oldval) \ | ||
69 | : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ | ||
70 | } else \ | ||
71 | ret = -ENOSYS; \ | ||
43 | } | 72 | } |
44 | 73 | ||
45 | static inline int | 74 | static inline int |
@@ -102,7 +131,69 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
102 | static inline int | 131 | static inline int |
103 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | 132 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) |
104 | { | 133 | { |
105 | return -ENOSYS; | 134 | int retval; |
135 | |||
136 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | ||
137 | return -EFAULT; | ||
138 | |||
139 | if (cpu_has_llsc && R10000_LLSC_WAR) { | ||
140 | __asm__ __volatile__( | ||
141 | "# futex_atomic_cmpxchg_inatomic \n" | ||
142 | " .set push \n" | ||
143 | " .set noat \n" | ||
144 | " .set mips3 \n" | ||
145 | "1: ll %0, %2 \n" | ||
146 | " bne %0, %z3, 3f \n" | ||
147 | " .set mips0 \n" | ||
148 | " move $1, %z4 \n" | ||
149 | " .set mips3 \n" | ||
150 | "2: sc $1, %1 \n" | ||
151 | " beqzl $1, 1b \n" | ||
152 | __FUTEX_SMP_SYNC | ||
153 | "3: \n" | ||
154 | " .set pop \n" | ||
155 | " .section .fixup,\"ax\" \n" | ||
156 | "4: li %0, %5 \n" | ||
157 | " j 3b \n" | ||
158 | " .previous \n" | ||
159 | " .section __ex_table,\"a\" \n" | ||
160 | " "__UA_ADDR "\t1b, 4b \n" | ||
161 | " "__UA_ADDR "\t2b, 4b \n" | ||
162 | " .previous \n" | ||
163 | : "=&r" (retval), "=R" (*uaddr) | ||
164 | : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT) | ||
165 | : "memory"); | ||
166 | } else if (cpu_has_llsc) { | ||
167 | __asm__ __volatile__( | ||
168 | "# futex_atomic_cmpxchg_inatomic \n" | ||
169 | " .set push \n" | ||
170 | " .set noat \n" | ||
171 | " .set mips3 \n" | ||
172 | "1: ll %0, %2 \n" | ||
173 | " bne %0, %z3, 3f \n" | ||
174 | " .set mips0 \n" | ||
175 | " move $1, %z4 \n" | ||
176 | " .set mips3 \n" | ||
177 | "2: sc $1, %1 \n" | ||
178 | " beqz $1, 1b \n" | ||
179 | __FUTEX_SMP_SYNC | ||
180 | "3: \n" | ||
181 | " .set pop \n" | ||
182 | " .section .fixup,\"ax\" \n" | ||
183 | "4: li %0, %5 \n" | ||
184 | " j 3b \n" | ||
185 | " .previous \n" | ||
186 | " .section __ex_table,\"a\" \n" | ||
187 | " "__UA_ADDR "\t1b, 4b \n" | ||
188 | " "__UA_ADDR "\t2b, 4b \n" | ||
189 | " .previous \n" | ||
190 | : "=&r" (retval), "=R" (*uaddr) | ||
191 | : "R" (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT) | ||
192 | : "memory"); | ||
193 | } else | ||
194 | return -ENOSYS; | ||
195 | |||
196 | return retval; | ||
106 | } | 197 | } |
107 | 198 | ||
108 | #endif | 199 | #endif |
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h index feb29a7938..dadc05188d 100644 --- a/include/asm-mips/hazards.h +++ b/include/asm-mips/hazards.h | |||
@@ -284,6 +284,8 @@ do { \ | |||
284 | #define instruction_hazard() do { } while (0) | 284 | #define instruction_hazard() do { } while (0) |
285 | #endif | 285 | #endif |
286 | 286 | ||
287 | extern void mips_ihb(void); | ||
288 | |||
287 | #endif /* __ASSEMBLY__ */ | 289 | #endif /* __ASSEMBLY__ */ |
288 | 290 | ||
289 | #endif /* _ASM_HAZARDS_H */ | 291 | #endif /* _ASM_HAZARDS_H */ |
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h index e0745f4ff6..1ed8d0f625 100644 --- a/include/asm-mips/inst.h +++ b/include/asm-mips/inst.h | |||
@@ -6,6 +6,7 @@ | |||
6 | * for more details. | 6 | * for more details. |
7 | * | 7 | * |
8 | * Copyright (C) 1996, 2000 by Ralf Baechle | 8 | * Copyright (C) 1996, 2000 by Ralf Baechle |
9 | * Copyright (C) 2006 by Thiemo Seufer | ||
9 | */ | 10 | */ |
10 | #ifndef _ASM_INST_H | 11 | #ifndef _ASM_INST_H |
11 | #define _ASM_INST_H | 12 | #define _ASM_INST_H |
@@ -21,14 +22,14 @@ enum major_op { | |||
21 | cop0_op, cop1_op, cop2_op, cop1x_op, | 22 | cop0_op, cop1_op, cop2_op, cop1x_op, |
22 | beql_op, bnel_op, blezl_op, bgtzl_op, | 23 | beql_op, bnel_op, blezl_op, bgtzl_op, |
23 | daddi_op, daddiu_op, ldl_op, ldr_op, | 24 | daddi_op, daddiu_op, ldl_op, ldr_op, |
24 | major_1c_op, jalx_op, major_1e_op, major_1f_op, | 25 | spec2_op, jalx_op, mdmx_op, spec3_op, |
25 | lb_op, lh_op, lwl_op, lw_op, | 26 | lb_op, lh_op, lwl_op, lw_op, |
26 | lbu_op, lhu_op, lwr_op, lwu_op, | 27 | lbu_op, lhu_op, lwr_op, lwu_op, |
27 | sb_op, sh_op, swl_op, sw_op, | 28 | sb_op, sh_op, swl_op, sw_op, |
28 | sdl_op, sdr_op, swr_op, cache_op, | 29 | sdl_op, sdr_op, swr_op, cache_op, |
29 | ll_op, lwc1_op, lwc2_op, pref_op, | 30 | ll_op, lwc1_op, lwc2_op, pref_op, |
30 | lld_op, ldc1_op, ldc2_op, ld_op, | 31 | lld_op, ldc1_op, ldc2_op, ld_op, |
31 | sc_op, swc1_op, swc2_op, rdhwr_op, | 32 | sc_op, swc1_op, swc2_op, major_3b_op, |
32 | scd_op, sdc1_op, sdc2_op, sd_op | 33 | scd_op, sdc1_op, sdc2_op, sd_op |
33 | }; | 34 | }; |
34 | 35 | ||
@@ -37,7 +38,7 @@ enum major_op { | |||
37 | */ | 38 | */ |
38 | enum spec_op { | 39 | enum spec_op { |
39 | sll_op, movc_op, srl_op, sra_op, | 40 | sll_op, movc_op, srl_op, sra_op, |
40 | sllv_op, srlv_op, srav_op, spec1_unused_op, /* Opcode 0x07 is unused */ | 41 | sllv_op, pmon_op, srlv_op, srav_op, |
41 | jr_op, jalr_op, movz_op, movn_op, | 42 | jr_op, jalr_op, movz_op, movn_op, |
42 | syscall_op, break_op, spim_op, sync_op, | 43 | syscall_op, break_op, spim_op, sync_op, |
43 | mfhi_op, mthi_op, mflo_op, mtlo_op, | 44 | mfhi_op, mthi_op, mflo_op, mtlo_op, |
@@ -55,6 +56,28 @@ enum spec_op { | |||
55 | }; | 56 | }; |
56 | 57 | ||
57 | /* | 58 | /* |
59 | * func field of spec2 opcode. | ||
60 | */ | ||
61 | enum spec2_op { | ||
62 | madd_op, maddu_op, mul_op, spec2_3_unused_op, | ||
63 | msub_op, msubu_op, /* more unused ops */ | ||
64 | clz_op = 0x20, clo_op, | ||
65 | dclz_op = 0x24, dclo_op, | ||
66 | sdbpp_op = 0x3f | ||
67 | }; | ||
68 | |||
69 | /* | ||
70 | * func field of spec3 opcode. | ||
71 | */ | ||
72 | enum spec3_op { | ||
73 | ext_op, dextm_op, dextu_op, dext_op, | ||
74 | ins_op, dinsm_op, dinsu_op, dins_op, | ||
75 | bshfl_op = 0x20, | ||
76 | dbshfl_op = 0x24, | ||
77 | rdhwr_op = 0x3f | ||
78 | }; | ||
79 | |||
80 | /* | ||
58 | * rt field of bcond opcodes. | 81 | * rt field of bcond opcodes. |
59 | */ | 82 | */ |
60 | enum rt_op { | 83 | enum rt_op { |
@@ -151,8 +174,8 @@ enum cop1x_func { | |||
151 | * func field for mad opcodes (MIPS IV). | 174 | * func field for mad opcodes (MIPS IV). |
152 | */ | 175 | */ |
153 | enum mad_func { | 176 | enum mad_func { |
154 | madd_op = 0x08, msub_op = 0x0a, | 177 | madd_fp_op = 0x08, msub_fp_op = 0x0a, |
155 | nmadd_op = 0x0c, nmsub_op = 0x0e | 178 | nmadd_fp_op = 0x0c, nmsub_fp_op = 0x0e |
156 | }; | 179 | }; |
157 | 180 | ||
158 | /* | 181 | /* |
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/interrupt.h index 774348734f..4bb9c06f44 100644 --- a/include/asm-mips/interrupt.h +++ b/include/asm-mips/interrupt.h | |||
@@ -19,7 +19,12 @@ __asm__ ( | |||
19 | " .set push \n" | 19 | " .set push \n" |
20 | " .set reorder \n" | 20 | " .set reorder \n" |
21 | " .set noat \n" | 21 | " .set noat \n" |
22 | #ifdef CONFIG_CPU_MIPSR2 | 22 | #ifdef CONFIG_MIPS_MT_SMTC |
23 | " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n" | ||
24 | " ori $1, 0x400 \n" | ||
25 | " xori $1, 0x400 \n" | ||
26 | " mtc0 $1, $2, 1 \n" | ||
27 | #elif defined(CONFIG_CPU_MIPSR2) | ||
23 | " ei \n" | 28 | " ei \n" |
24 | #else | 29 | #else |
25 | " mfc0 $1,$12 \n" | 30 | " mfc0 $1,$12 \n" |
@@ -62,7 +67,12 @@ __asm__ ( | |||
62 | " .macro local_irq_disable\n" | 67 | " .macro local_irq_disable\n" |
63 | " .set push \n" | 68 | " .set push \n" |
64 | " .set noat \n" | 69 | " .set noat \n" |
65 | #ifdef CONFIG_CPU_MIPSR2 | 70 | #ifdef CONFIG_MIPS_MT_SMTC |
71 | " mfc0 $1, $2, 1 \n" | ||
72 | " ori $1, 0x400 \n" | ||
73 | " .set noreorder \n" | ||
74 | " mtc0 $1, $2, 1 \n" | ||
75 | #elif defined(CONFIG_CPU_MIPSR2) | ||
66 | " di \n" | 76 | " di \n" |
67 | #else | 77 | #else |
68 | " mfc0 $1,$12 \n" | 78 | " mfc0 $1,$12 \n" |
@@ -88,7 +98,11 @@ __asm__ ( | |||
88 | " .macro local_save_flags flags \n" | 98 | " .macro local_save_flags flags \n" |
89 | " .set push \n" | 99 | " .set push \n" |
90 | " .set reorder \n" | 100 | " .set reorder \n" |
101 | #ifdef CONFIG_MIPS_MT_SMTC | ||
102 | " mfc0 \\flags, $2, 1 \n" | ||
103 | #else | ||
91 | " mfc0 \\flags, $12 \n" | 104 | " mfc0 \\flags, $12 \n" |
105 | #endif | ||
92 | " .set pop \n" | 106 | " .set pop \n" |
93 | " .endm \n"); | 107 | " .endm \n"); |
94 | 108 | ||
@@ -102,7 +116,13 @@ __asm__ ( | |||
102 | " .set push \n" | 116 | " .set push \n" |
103 | " .set reorder \n" | 117 | " .set reorder \n" |
104 | " .set noat \n" | 118 | " .set noat \n" |
105 | #ifdef CONFIG_CPU_MIPSR2 | 119 | #ifdef CONFIG_MIPS_MT_SMTC |
120 | " mfc0 \\result, $2, 1 \n" | ||
121 | " ori $1, \\result, 0x400 \n" | ||
122 | " .set noreorder \n" | ||
123 | " mtc0 $1, $2, 1 \n" | ||
124 | " andi \\result, \\result, 0x400 \n" | ||
125 | #elif defined(CONFIG_CPU_MIPSR2) | ||
106 | " di \\result \n" | 126 | " di \\result \n" |
107 | " andi \\result, 1 \n" | 127 | " andi \\result, 1 \n" |
108 | #else | 128 | #else |
@@ -128,7 +148,14 @@ __asm__ ( | |||
128 | " .set push \n" | 148 | " .set push \n" |
129 | " .set noreorder \n" | 149 | " .set noreorder \n" |
130 | " .set noat \n" | 150 | " .set noat \n" |
131 | #if defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) | 151 | #ifdef CONFIG_MIPS_MT_SMTC |
152 | "mfc0 $1, $2, 1 \n" | ||
153 | "andi \\flags, 0x400 \n" | ||
154 | "ori $1, 0x400 \n" | ||
155 | "xori $1, 0x400 \n" | ||
156 | "or \\flags, $1 \n" | ||
157 | "mtc0 \\flags, $2, 1 \n" | ||
158 | #elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) | ||
132 | /* | 159 | /* |
133 | * Slow, but doesn't suffer from a relativly unlikely race | 160 | * Slow, but doesn't suffer from a relativly unlikely race |
134 | * condition we're having since days 1. | 161 | * condition we're having since days 1. |
@@ -167,11 +194,29 @@ do { \ | |||
167 | : "memory"); \ | 194 | : "memory"); \ |
168 | } while(0) | 195 | } while(0) |
169 | 196 | ||
170 | #define irqs_disabled() \ | 197 | static inline int irqs_disabled(void) |
171 | ({ \ | 198 | { |
172 | unsigned long flags; \ | 199 | #ifdef CONFIG_MIPS_MT_SMTC |
173 | local_save_flags(flags); \ | 200 | /* |
174 | !(flags & 1); \ | 201 | * SMTC model uses TCStatus.IXMT to disable interrupts for a thread/CPU |
175 | }) | 202 | */ |
203 | unsigned long __result; | ||
204 | |||
205 | __asm__ __volatile__( | ||
206 | " .set noreorder \n" | ||
207 | " mfc0 %0, $2, 1 \n" | ||
208 | " andi %0, 0x400 \n" | ||
209 | " slt %0, $0, %0 \n" | ||
210 | " .set reorder \n" | ||
211 | : "=r" (__result)); | ||
212 | |||
213 | return __result; | ||
214 | #else | ||
215 | unsigned long flags; | ||
216 | local_save_flags(flags); | ||
217 | |||
218 | return !(flags & 1); | ||
219 | #endif | ||
220 | } | ||
176 | 221 | ||
177 | #endif /* _ASM_INTERRUPT_H */ | 222 | #endif /* _ASM_INTERRUPT_H */ |
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h index 8a342ccb34..dde677f02b 100644 --- a/include/asm-mips/irq.h +++ b/include/asm-mips/irq.h | |||
@@ -11,6 +11,9 @@ | |||
11 | 11 | ||
12 | #include <linux/config.h> | 12 | #include <linux/config.h> |
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | |||
15 | #include <asm/mipsmtregs.h> | ||
16 | |||
14 | #include <irq.h> | 17 | #include <irq.h> |
15 | 18 | ||
16 | #ifdef CONFIG_I8259 | 19 | #ifdef CONFIG_I8259 |
@@ -26,6 +29,23 @@ struct pt_regs; | |||
26 | 29 | ||
27 | extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs); | 30 | extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs); |
28 | 31 | ||
32 | #ifdef CONFIG_MIPS_MT_SMTC | ||
33 | /* | ||
34 | * Clear interrupt mask handling "backstop" if irq_hwmask | ||
35 | * entry so indicates. This implies that the ack() or end() | ||
36 | * functions will take over re-enabling the low-level mask. | ||
37 | * Otherwise it will be done on return from exception. | ||
38 | */ | ||
39 | #define __DO_IRQ_SMTC_HOOK() \ | ||
40 | do { \ | ||
41 | if (irq_hwmask[irq] & 0x0000ff00) \ | ||
42 | write_c0_tccontext(read_c0_tccontext() & \ | ||
43 | ~(irq_hwmask[irq] & 0x0000ff00)); \ | ||
44 | } while (0) | ||
45 | #else | ||
46 | #define __DO_IRQ_SMTC_HOOK() do { } while (0) | ||
47 | #endif | ||
48 | |||
29 | #ifdef CONFIG_PREEMPT | 49 | #ifdef CONFIG_PREEMPT |
30 | 50 | ||
31 | /* | 51 | /* |
@@ -39,6 +59,7 @@ extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs); | |||
39 | #define do_IRQ(irq, regs) \ | 59 | #define do_IRQ(irq, regs) \ |
40 | do { \ | 60 | do { \ |
41 | irq_enter(); \ | 61 | irq_enter(); \ |
62 | __DO_IRQ_SMTC_HOOK(); \ | ||
42 | __do_IRQ((irq), (regs)); \ | 63 | __do_IRQ((irq), (regs)); \ |
43 | irq_exit(); \ | 64 | irq_exit(); \ |
44 | } while (0) | 65 | } while (0) |
@@ -46,5 +67,14 @@ do { \ | |||
46 | #endif | 67 | #endif |
47 | 68 | ||
48 | extern void arch_init_irq(void); | 69 | extern void arch_init_irq(void); |
70 | extern void spurious_interrupt(struct pt_regs *regs); | ||
71 | |||
72 | #ifdef CONFIG_MIPS_MT_SMTC | ||
73 | struct irqaction; | ||
74 | |||
75 | extern unsigned long irq_hwmask[]; | ||
76 | extern int setup_irq_smtc(unsigned int irq, struct irqaction * new, | ||
77 | unsigned long hwmask); | ||
78 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
49 | 79 | ||
50 | #endif /* _ASM_IRQ_H */ | 80 | #endif /* _ASM_IRQ_H */ |
diff --git a/include/asm-mips/kspd.h b/include/asm-mips/kspd.h new file mode 100644 index 0000000000..4e9e724c89 --- /dev/null +++ b/include/asm-mips/kspd.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can distribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License (Version 2) as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
11 | * for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef _ASM_KSPD_H | ||
20 | #define _ASM_KSPD_H | ||
21 | |||
22 | struct kspd_notifications { | ||
23 | void (*kspd_sp_exit)(int sp_id); | ||
24 | |||
25 | struct list_head list; | ||
26 | }; | ||
27 | |||
28 | #ifdef CONFIG_MIPS_APSP_KSPD | ||
29 | extern void kspd_notify(struct kspd_notifications *notify); | ||
30 | #else | ||
31 | static inline void kspd_notify(struct kspd_notifications *notify) | ||
32 | { | ||
33 | } | ||
34 | #endif | ||
35 | |||
36 | #endif | ||
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index 550979a9ea..e331535950 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h | |||
@@ -104,65 +104,107 @@ static __inline__ unsigned long ide_default_io_base(int index) | |||
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | /* MIPS port and memory-mapped I/O string operations. */ | 106 | /* MIPS port and memory-mapped I/O string operations. */ |
107 | static inline void __ide_flush_prologue(void) | ||
108 | { | ||
109 | #ifdef CONFIG_SMP | ||
110 | if (cpu_has_dc_aliases) | ||
111 | preempt_disable(); | ||
112 | #endif | ||
113 | } | ||
114 | |||
115 | static inline void __ide_flush_epilogue(void) | ||
116 | { | ||
117 | #ifdef CONFIG_SMP | ||
118 | if (cpu_has_dc_aliases) | ||
119 | preempt_enable(); | ||
120 | #endif | ||
121 | } | ||
107 | 122 | ||
108 | static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size) | 123 | static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size) |
109 | { | 124 | { |
110 | if (cpu_has_dc_aliases) { | 125 | if (cpu_has_dc_aliases) { |
111 | unsigned long end = addr + size; | 126 | unsigned long end = addr + size; |
112 | for (; addr < end; addr += PAGE_SIZE) | 127 | |
113 | flush_dcache_page(virt_to_page(addr)); | 128 | while (addr < end) { |
129 | local_flush_data_cache_page((void *)addr); | ||
130 | addr += PAGE_SIZE; | ||
131 | } | ||
114 | } | 132 | } |
115 | } | 133 | } |
116 | 134 | ||
135 | /* | ||
136 | * insw() and gang might be called with interrupts disabled, so we can't | ||
137 | * send IPIs for flushing due to the potencial of deadlocks, see the comment | ||
138 | * above smp_call_function() in arch/mips/kernel/smp.c. We work around the | ||
139 | * problem by disabling preemption so we know we actually perform the flush | ||
140 | * on the processor that actually has the lines to be flushed which hopefully | ||
141 | * is even better for performance anyway. | ||
142 | */ | ||
117 | static inline void __ide_insw(unsigned long port, void *addr, | 143 | static inline void __ide_insw(unsigned long port, void *addr, |
118 | unsigned int count) | 144 | unsigned int count) |
119 | { | 145 | { |
146 | __ide_flush_prologue(); | ||
120 | insw(port, addr, count); | 147 | insw(port, addr, count); |
121 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | 148 | __ide_flush_dcache_range((unsigned long)addr, count * 2); |
149 | __ide_flush_epilogue(); | ||
122 | } | 150 | } |
123 | 151 | ||
124 | static inline void __ide_insl(unsigned long port, void *addr, unsigned int count) | 152 | static inline void __ide_insl(unsigned long port, void *addr, unsigned int count) |
125 | { | 153 | { |
154 | __ide_flush_prologue(); | ||
126 | insl(port, addr, count); | 155 | insl(port, addr, count); |
127 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | 156 | __ide_flush_dcache_range((unsigned long)addr, count * 4); |
157 | __ide_flush_epilogue(); | ||
128 | } | 158 | } |
129 | 159 | ||
130 | static inline void __ide_outsw(unsigned long port, const void *addr, | 160 | static inline void __ide_outsw(unsigned long port, const void *addr, |
131 | unsigned long count) | 161 | unsigned long count) |
132 | { | 162 | { |
163 | __ide_flush_prologue(); | ||
133 | outsw(port, addr, count); | 164 | outsw(port, addr, count); |
134 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | 165 | __ide_flush_dcache_range((unsigned long)addr, count * 2); |
166 | __ide_flush_epilogue(); | ||
135 | } | 167 | } |
136 | 168 | ||
137 | static inline void __ide_outsl(unsigned long port, const void *addr, | 169 | static inline void __ide_outsl(unsigned long port, const void *addr, |
138 | unsigned long count) | 170 | unsigned long count) |
139 | { | 171 | { |
172 | __ide_flush_prologue(); | ||
140 | outsl(port, addr, count); | 173 | outsl(port, addr, count); |
141 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | 174 | __ide_flush_dcache_range((unsigned long)addr, count * 4); |
175 | __ide_flush_epilogue(); | ||
142 | } | 176 | } |
143 | 177 | ||
144 | static inline void __ide_mm_insw(void __iomem *port, void *addr, u32 count) | 178 | static inline void __ide_mm_insw(void __iomem *port, void *addr, u32 count) |
145 | { | 179 | { |
180 | __ide_flush_prologue(); | ||
146 | readsw(port, addr, count); | 181 | readsw(port, addr, count); |
147 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | 182 | __ide_flush_dcache_range((unsigned long)addr, count * 2); |
183 | __ide_flush_epilogue(); | ||
148 | } | 184 | } |
149 | 185 | ||
150 | static inline void __ide_mm_insl(void __iomem *port, void *addr, u32 count) | 186 | static inline void __ide_mm_insl(void __iomem *port, void *addr, u32 count) |
151 | { | 187 | { |
188 | __ide_flush_prologue(); | ||
152 | readsl(port, addr, count); | 189 | readsl(port, addr, count); |
153 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | 190 | __ide_flush_dcache_range((unsigned long)addr, count * 4); |
191 | __ide_flush_epilogue(); | ||
154 | } | 192 | } |
155 | 193 | ||
156 | static inline void __ide_mm_outsw(void __iomem *port, void *addr, u32 count) | 194 | static inline void __ide_mm_outsw(void __iomem *port, void *addr, u32 count) |
157 | { | 195 | { |
196 | __ide_flush_prologue(); | ||
158 | writesw(port, addr, count); | 197 | writesw(port, addr, count); |
159 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | 198 | __ide_flush_dcache_range((unsigned long)addr, count * 2); |
199 | __ide_flush_epilogue(); | ||
160 | } | 200 | } |
161 | 201 | ||
162 | static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count) | 202 | static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count) |
163 | { | 203 | { |
204 | __ide_flush_prologue(); | ||
164 | writesl(port, addr, count); | 205 | writesl(port, addr, count); |
165 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | 206 | __ide_flush_dcache_range((unsigned long)addr, count * 4); |
207 | __ide_flush_epilogue(); | ||
166 | } | 208 | } |
167 | 209 | ||
168 | /* ide_insw calls insw, not __ide_insw. Why? */ | 210 | /* ide_insw calls insw, not __ide_insw. Why? */ |
diff --git a/include/asm-mips/mach-jmr3927/ds1742.h b/include/asm-mips/mach-jmr3927/ds1742.h index cff6192d4b..8a8fef6d07 100644 --- a/include/asm-mips/mach-jmr3927/ds1742.h +++ b/include/asm-mips/mach-jmr3927/ds1742.h | |||
@@ -3,14 +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 by Ralf Baechle | 6 | * Copyright (C) 2003, 06 by Ralf Baechle |
7 | */ | 7 | */ |
8 | #ifndef __ASM_MACH_JMR3927_DS1742_H | 8 | #ifndef __ASM_MACH_JMR3927_DS1742_H |
9 | #define __ASM_MACH_JMR3927_DS1742_H | 9 | #define __ASM_MACH_JMR3927_DS1742_H |
10 | 10 | ||
11 | #include <asm/jmr3927/jmr3927.h> | 11 | #include <asm/jmr3927/jmr3927.h> |
12 | 12 | ||
13 | #define rtc_read(reg) (jmr3927_nvram_in(addr)) | 13 | #define rtc_read(reg) (jmr3927_nvram_in(reg)) |
14 | #define rtc_write(data, reg) (jmr3927_nvram_out((data),(reg))) | 14 | #define rtc_write(data, reg) (jmr3927_nvram_out((data),(reg))) |
15 | 15 | ||
16 | #endif /* __ASM_MACH_JMR3927_DS1742_H */ | 16 | #endif /* __ASM_MACH_JMR3927_DS1742_H */ |
diff --git a/include/asm-mips/mach-mips/param.h b/include/asm-mips/mach-mips/param.h new file mode 100644 index 0000000000..805ef6d27d --- /dev/null +++ b/include/asm-mips/mach-mips/param.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2003 by Ralf Baechle | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_MIPS_PARAM_H | ||
9 | #define __ASM_MACH_MIPS_PARAM_H | ||
10 | |||
11 | #define HZ 100 /* Internal kernel timer frequency */ | ||
12 | |||
13 | #endif /* __ASM_MACH_MIPS_PARAM_H */ | ||
diff --git a/include/asm-mips/marvell.h b/include/asm-mips/marvell.h index 9225b3397a..6bb2125bb0 100644 --- a/include/asm-mips/marvell.h +++ b/include/asm-mips/marvell.h | |||
@@ -53,4 +53,6 @@ struct mv_pci_controller { | |||
53 | unsigned long config_vreg; | 53 | unsigned long config_vreg; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | extern void ll_mv64340_irq(struct pt_regs *regs); | ||
57 | |||
56 | #endif /* __ASM_MIPS_MARVELL_H */ | 58 | #endif /* __ASM_MIPS_MARVELL_H */ |
diff --git a/include/asm-mips/mips-boards/atlas.h b/include/asm-mips/mips-boards/atlas.h index 0998151fb3..a8ae12d120 100644 --- a/include/asm-mips/mips-boards/atlas.h +++ b/include/asm-mips/mips-boards/atlas.h | |||
@@ -33,13 +33,29 @@ | |||
33 | #define ATLAS_RTC_ADR_REG 0x1f000800 | 33 | #define ATLAS_RTC_ADR_REG 0x1f000800 |
34 | #define ATLAS_RTC_DAT_REG 0x1f000808 | 34 | #define ATLAS_RTC_DAT_REG 0x1f000808 |
35 | 35 | ||
36 | |||
37 | /* | 36 | /* |
38 | * Atlas interrupt controller register base. | 37 | * Atlas interrupt controller register base. |
39 | */ | 38 | */ |
40 | #define ATLAS_ICTRL_REGS_BASE 0x1f000000 | 39 | #define ATLAS_ICTRL_REGS_BASE 0x1f000000 |
41 | 40 | ||
42 | /* | 41 | /* |
42 | * Atlas registers are memory mapped on 64-bit aligned boundaries and | ||
43 | * only word access are allowed. | ||
44 | */ | ||
45 | struct atlas_ictrl_regs { | ||
46 | volatile unsigned int intraw; | ||
47 | int dummy1; | ||
48 | volatile unsigned int intseten; | ||
49 | int dummy2; | ||
50 | volatile unsigned int intrsten; | ||
51 | int dummy3; | ||
52 | volatile unsigned int intenable; | ||
53 | int dummy4; | ||
54 | volatile unsigned int intstatus; | ||
55 | int dummy5; | ||
56 | }; | ||
57 | |||
58 | /* | ||
43 | * Atlas UART register base. | 59 | * Atlas UART register base. |
44 | */ | 60 | */ |
45 | #define ATLAS_UART_REGS_BASE 0x1f000900 | 61 | #define ATLAS_UART_REGS_BASE 0x1f000900 |
diff --git a/include/asm-mips/mips-boards/atlasint.h b/include/asm-mips/mips-boards/atlasint.h index bba35c183d..fd7ebc54fa 100644 --- a/include/asm-mips/mips-boards/atlasint.h +++ b/include/asm-mips/mips-boards/atlasint.h | |||
@@ -62,23 +62,4 @@ | |||
62 | #define ATLASINT_RES31 (ATLASINT_BASE+31) | 62 | #define ATLASINT_RES31 (ATLASINT_BASE+31) |
63 | #define ATLASINT_END (ATLASINT_BASE+31) | 63 | #define ATLASINT_END (ATLASINT_BASE+31) |
64 | 64 | ||
65 | /* | ||
66 | * Atlas registers are memory mapped on 64-bit aligned boundaries and | ||
67 | * only word access are allowed. | ||
68 | */ | ||
69 | struct atlas_ictrl_regs { | ||
70 | volatile unsigned int intraw; | ||
71 | int dummy1; | ||
72 | volatile unsigned int intseten; | ||
73 | int dummy2; | ||
74 | volatile unsigned int intrsten; | ||
75 | int dummy3; | ||
76 | volatile unsigned int intenable; | ||
77 | int dummy4; | ||
78 | volatile unsigned int intstatus; | ||
79 | int dummy5; | ||
80 | }; | ||
81 | |||
82 | extern void atlasint_init(void); | ||
83 | |||
84 | #endif /* !(_MIPS_ATLASINT_H) */ | 65 | #endif /* !(_MIPS_ATLASINT_H) */ |
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h index 25b6ffc266..fa8b913cc3 100644 --- a/include/asm-mips/mips-boards/generic.h +++ b/include/asm-mips/mips-boards/generic.h | |||
@@ -67,6 +67,7 @@ | |||
67 | #define MIPS_REVISION_CORID_CORE_FPGA2 7 | 67 | #define MIPS_REVISION_CORID_CORE_FPGA2 7 |
68 | #define MIPS_REVISION_CORID_CORE_FPGAR2 8 | 68 | #define MIPS_REVISION_CORID_CORE_FPGAR2 8 |
69 | #define MIPS_REVISION_CORID_CORE_FPGA3 9 | 69 | #define MIPS_REVISION_CORID_CORE_FPGA3 9 |
70 | #define MIPS_REVISION_CORID_CORE_24K 10 | ||
70 | 71 | ||
71 | /**** Artificial corid defines ****/ | 72 | /**** Artificial corid defines ****/ |
72 | /* | 73 | /* |
diff --git a/include/asm-mips/mips_mt.h b/include/asm-mips/mips_mt.h new file mode 100644 index 0000000000..c31a312b97 --- /dev/null +++ b/include/asm-mips/mips_mt.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* | ||
2 | * Definitions and decalrations for MIPS MT support | ||
3 | * that are common between SMTC, VSMP, and/or AP/SP | ||
4 | * kernel models. | ||
5 | */ | ||
6 | #ifndef __ASM_MIPS_MT_H | ||
7 | #define __ASM_MIPS_MT_H | ||
8 | |||
9 | extern cpumask_t mt_fpu_cpumask; | ||
10 | extern unsigned long mt_fpemul_threshold; | ||
11 | |||
12 | extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value); | ||
13 | extern void mips_mt_set_cpuoptions(void); | ||
14 | |||
15 | #endif /* __ASM_MIPS_MT_H */ | ||
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h index a669c0702c..f637ce7075 100644 --- a/include/asm-mips/mipsmtregs.h +++ b/include/asm-mips/mipsmtregs.h | |||
@@ -165,7 +165,7 @@ | |||
165 | 165 | ||
166 | #ifndef __ASSEMBLY__ | 166 | #ifndef __ASSEMBLY__ |
167 | 167 | ||
168 | extern void mips_mt_regdump(void); | 168 | extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value); |
169 | 169 | ||
170 | static inline unsigned int dvpe(void) | 170 | static inline unsigned int dvpe(void) |
171 | { | 171 | { |
@@ -234,7 +234,7 @@ static inline void __raw_emt(void) | |||
234 | __asm__ __volatile__( | 234 | __asm__ __volatile__( |
235 | " .set noreorder \n" | 235 | " .set noreorder \n" |
236 | " .set mips32r2 \n" | 236 | " .set mips32r2 \n" |
237 | " emt \n" | 237 | " .word 0x41600be1 # emt \n" |
238 | " ehb \n" | 238 | " ehb \n" |
239 | " .set mips0 \n" | 239 | " .set mips0 \n" |
240 | " .set reorder"); | 240 | " .set reorder"); |
@@ -282,8 +282,11 @@ static inline void ehb(void) | |||
282 | \ | 282 | \ |
283 | __asm__ __volatile__( \ | 283 | __asm__ __volatile__( \ |
284 | " .set push \n" \ | 284 | " .set push \n" \ |
285 | " .set noat \n" \ | ||
285 | " .set mips32r2 \n" \ | 286 | " .set mips32r2 \n" \ |
286 | " mftgpr %0," #rt " \n" \ | 287 | " # mftgpr $1," #rt " \n" \ |
288 | " .word 0x41000820 | (" #rt " << 16) \n" \ | ||
289 | " move %0, $1 \n" \ | ||
287 | " .set pop \n" \ | 290 | " .set pop \n" \ |
288 | : "=r" (__res)); \ | 291 | : "=r" (__res)); \ |
289 | \ | 292 | \ |
@@ -295,9 +298,7 @@ static inline void ehb(void) | |||
295 | unsigned long __res; \ | 298 | unsigned long __res; \ |
296 | \ | 299 | \ |
297 | __asm__ __volatile__( \ | 300 | __asm__ __volatile__( \ |
298 | ".set noat\n\t" \ | 301 | " mftr %0, " #rt ", " #u ", " #sel " \n" \ |
299 | "mftr\t%0, " #rt ", " #u ", " #sel "\n\t" \ | ||
300 | ".set at\n\t" \ | ||
301 | : "=r" (__res)); \ | 302 | : "=r" (__res)); \ |
302 | \ | 303 | \ |
303 | __res; \ | 304 | __res; \ |
@@ -364,6 +365,9 @@ do { \ | |||
364 | #define read_vpe_c0_ebase() mftc0(15,1) | 365 | #define read_vpe_c0_ebase() mftc0(15,1) |
365 | #define write_vpe_c0_ebase(val) mttc0(15, 1, val) | 366 | #define write_vpe_c0_ebase(val) mttc0(15, 1, val) |
366 | #define write_vpe_c0_compare(val) mttc0(11, 0, val) | 367 | #define write_vpe_c0_compare(val) mttc0(11, 0, val) |
368 | #define read_vpe_c0_badvaddr() mftc0(8, 0) | ||
369 | #define read_vpe_c0_epc() mftc0(14, 0) | ||
370 | #define write_vpe_c0_epc(val) mttc0(14, 0, val) | ||
367 | 371 | ||
368 | 372 | ||
369 | /* TC */ | 373 | /* TC */ |
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index 035ba0a9b0..5af7517fce 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -291,7 +291,7 @@ | |||
291 | #define ST0_DL (_ULCAST_(1) << 24) | 291 | #define ST0_DL (_ULCAST_(1) << 24) |
292 | 292 | ||
293 | /* | 293 | /* |
294 | * Enable the MIPS DSP ASE | 294 | * Enable the MIPS MDMX and DSP ASEs |
295 | */ | 295 | */ |
296 | #define ST0_MX 0x01000000 | 296 | #define ST0_MX 0x01000000 |
297 | 297 | ||
@@ -836,6 +836,9 @@ do { \ | |||
836 | #define read_c0_cache() __read_32bit_c0_register($7, 0) /* TX39xx */ | 836 | #define read_c0_cache() __read_32bit_c0_register($7, 0) /* TX39xx */ |
837 | #define write_c0_cache(val) __write_32bit_c0_register($7, 0, val) | 837 | #define write_c0_cache(val) __write_32bit_c0_register($7, 0, val) |
838 | 838 | ||
839 | #define read_c0_badvaddr() __read_ulong_c0_register($8, 0) | ||
840 | #define write_c0_badvaddr(val) __write_ulong_c0_register($8, 0, val) | ||
841 | |||
839 | #define read_c0_count() __read_32bit_c0_register($9, 0) | 842 | #define read_c0_count() __read_32bit_c0_register($9, 0) |
840 | #define write_c0_count(val) __write_32bit_c0_register($9, 0, val) | 843 | #define write_c0_count(val) __write_32bit_c0_register($9, 0, val) |
841 | 844 | ||
@@ -858,7 +861,19 @@ do { \ | |||
858 | #define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val) | 861 | #define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val) |
859 | 862 | ||
860 | #define read_c0_status() __read_32bit_c0_register($12, 0) | 863 | #define read_c0_status() __read_32bit_c0_register($12, 0) |
864 | #ifdef CONFIG_MIPS_MT_SMTC | ||
865 | #define write_c0_status(val) \ | ||
866 | do { \ | ||
867 | __write_32bit_c0_register($12, 0, val); \ | ||
868 | __ehb(); \ | ||
869 | } while (0) | ||
870 | #else | ||
871 | /* | ||
872 | * Legacy non-SMTC code, which may be hazardous | ||
873 | * but which might not support EHB | ||
874 | */ | ||
861 | #define write_c0_status(val) __write_32bit_c0_register($12, 0, val) | 875 | #define write_c0_status(val) __write_32bit_c0_register($12, 0, val) |
876 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
862 | 877 | ||
863 | #define read_c0_cause() __read_32bit_c0_register($13, 0) | 878 | #define read_c0_cause() __read_32bit_c0_register($13, 0) |
864 | #define write_c0_cause(val) __write_32bit_c0_register($13, 0, val) | 879 | #define write_c0_cause(val) __write_32bit_c0_register($13, 0, val) |
@@ -1001,6 +1016,9 @@ do { \ | |||
1001 | #define read_c0_taglo() __read_32bit_c0_register($28, 0) | 1016 | #define read_c0_taglo() __read_32bit_c0_register($28, 0) |
1002 | #define write_c0_taglo(val) __write_32bit_c0_register($28, 0, val) | 1017 | #define write_c0_taglo(val) __write_32bit_c0_register($28, 0, val) |
1003 | 1018 | ||
1019 | #define read_c0_dtaglo() __read_32bit_c0_register($28, 2) | ||
1020 | #define write_c0_dtaglo(val) __write_32bit_c0_register($28, 2, val) | ||
1021 | |||
1004 | #define read_c0_taghi() __read_32bit_c0_register($29, 0) | 1022 | #define read_c0_taghi() __read_32bit_c0_register($29, 0) |
1005 | #define write_c0_taghi(val) __write_32bit_c0_register($29, 0, val) | 1023 | #define write_c0_taghi(val) __write_32bit_c0_register($29, 0, val) |
1006 | 1024 | ||
@@ -1354,15 +1372,119 @@ static inline void tlb_write_random(void) | |||
1354 | /* | 1372 | /* |
1355 | * Manipulate bits in a c0 register. | 1373 | * Manipulate bits in a c0 register. |
1356 | */ | 1374 | */ |
1375 | #ifndef CONFIG_MIPS_MT_SMTC | ||
1376 | /* | ||
1377 | * SMTC Linux requires shutting-down microthread scheduling | ||
1378 | * during CP0 register read-modify-write sequences. | ||
1379 | */ | ||
1380 | #define __BUILD_SET_C0(name) \ | ||
1381 | static inline unsigned int \ | ||
1382 | set_c0_##name(unsigned int set) \ | ||
1383 | { \ | ||
1384 | unsigned int res; \ | ||
1385 | \ | ||
1386 | res = read_c0_##name(); \ | ||
1387 | res |= set; \ | ||
1388 | write_c0_##name(res); \ | ||
1389 | \ | ||
1390 | return res; \ | ||
1391 | } \ | ||
1392 | \ | ||
1393 | static inline unsigned int \ | ||
1394 | clear_c0_##name(unsigned int clear) \ | ||
1395 | { \ | ||
1396 | unsigned int res; \ | ||
1397 | \ | ||
1398 | res = read_c0_##name(); \ | ||
1399 | res &= ~clear; \ | ||
1400 | write_c0_##name(res); \ | ||
1401 | \ | ||
1402 | return res; \ | ||
1403 | } \ | ||
1404 | \ | ||
1405 | static inline unsigned int \ | ||
1406 | change_c0_##name(unsigned int change, unsigned int new) \ | ||
1407 | { \ | ||
1408 | unsigned int res; \ | ||
1409 | \ | ||
1410 | res = read_c0_##name(); \ | ||
1411 | res &= ~change; \ | ||
1412 | res |= (new & change); \ | ||
1413 | write_c0_##name(res); \ | ||
1414 | \ | ||
1415 | return res; \ | ||
1416 | } | ||
1417 | |||
1418 | #else /* SMTC versions that manage MT scheduling */ | ||
1419 | |||
1420 | #include <asm/interrupt.h> | ||
1421 | |||
1422 | /* | ||
1423 | * This is a duplicate of dmt() in mipsmtregs.h to avoid problems with | ||
1424 | * header file recursion. | ||
1425 | */ | ||
1426 | static inline unsigned int __dmt(void) | ||
1427 | { | ||
1428 | int res; | ||
1429 | |||
1430 | __asm__ __volatile__( | ||
1431 | " .set push \n" | ||
1432 | " .set mips32r2 \n" | ||
1433 | " .set noat \n" | ||
1434 | " .word 0x41610BC1 # dmt $1 \n" | ||
1435 | " ehb \n" | ||
1436 | " move %0, $1 \n" | ||
1437 | " .set pop \n" | ||
1438 | : "=r" (res)); | ||
1439 | |||
1440 | instruction_hazard(); | ||
1441 | |||
1442 | return res; | ||
1443 | } | ||
1444 | |||
1445 | #define __VPECONTROL_TE_SHIFT 15 | ||
1446 | #define __VPECONTROL_TE (1UL << __VPECONTROL_TE_SHIFT) | ||
1447 | |||
1448 | #define __EMT_ENABLE __VPECONTROL_TE | ||
1449 | |||
1450 | static inline void __emt(unsigned int previous) | ||
1451 | { | ||
1452 | if ((previous & __EMT_ENABLE)) | ||
1453 | __asm__ __volatile__( | ||
1454 | " .set noreorder \n" | ||
1455 | " .set mips32r2 \n" | ||
1456 | " .word 0x41600be1 # emt \n" | ||
1457 | " ehb \n" | ||
1458 | " .set mips0 \n" | ||
1459 | " .set reorder \n"); | ||
1460 | } | ||
1461 | |||
1462 | static inline void __ehb(void) | ||
1463 | { | ||
1464 | __asm__ __volatile__( | ||
1465 | " ehb \n"); | ||
1466 | } | ||
1467 | |||
1468 | /* | ||
1469 | * Note that local_irq_save/restore affect TC-specific IXMT state, | ||
1470 | * not Status.IE as in non-SMTC kernel. | ||
1471 | */ | ||
1472 | |||
1357 | #define __BUILD_SET_C0(name) \ | 1473 | #define __BUILD_SET_C0(name) \ |
1358 | static inline unsigned int \ | 1474 | static inline unsigned int \ |
1359 | set_c0_##name(unsigned int set) \ | 1475 | set_c0_##name(unsigned int set) \ |
1360 | { \ | 1476 | { \ |
1361 | unsigned int res; \ | 1477 | unsigned int res; \ |
1478 | unsigned int omt; \ | ||
1479 | unsigned int flags; \ | ||
1362 | \ | 1480 | \ |
1481 | local_irq_save(flags); \ | ||
1482 | omt = __dmt(); \ | ||
1363 | res = read_c0_##name(); \ | 1483 | res = read_c0_##name(); \ |
1364 | res |= set; \ | 1484 | res |= set; \ |
1365 | write_c0_##name(res); \ | 1485 | write_c0_##name(res); \ |
1486 | __emt(omt); \ | ||
1487 | local_irq_restore(flags); \ | ||
1366 | \ | 1488 | \ |
1367 | return res; \ | 1489 | return res; \ |
1368 | } \ | 1490 | } \ |
@@ -1371,10 +1493,16 @@ static inline unsigned int \ | |||
1371 | clear_c0_##name(unsigned int clear) \ | 1493 | clear_c0_##name(unsigned int clear) \ |
1372 | { \ | 1494 | { \ |
1373 | unsigned int res; \ | 1495 | unsigned int res; \ |
1496 | unsigned int omt; \ | ||
1497 | unsigned int flags; \ | ||
1374 | \ | 1498 | \ |
1499 | local_irq_save(flags); \ | ||
1500 | omt = __dmt(); \ | ||
1375 | res = read_c0_##name(); \ | 1501 | res = read_c0_##name(); \ |
1376 | res &= ~clear; \ | 1502 | res &= ~clear; \ |
1377 | write_c0_##name(res); \ | 1503 | write_c0_##name(res); \ |
1504 | __emt(omt); \ | ||
1505 | local_irq_restore(flags); \ | ||
1378 | \ | 1506 | \ |
1379 | return res; \ | 1507 | return res; \ |
1380 | } \ | 1508 | } \ |
@@ -1383,14 +1511,22 @@ static inline unsigned int \ | |||
1383 | change_c0_##name(unsigned int change, unsigned int new) \ | 1511 | change_c0_##name(unsigned int change, unsigned int new) \ |
1384 | { \ | 1512 | { \ |
1385 | unsigned int res; \ | 1513 | unsigned int res; \ |
1514 | unsigned int omt; \ | ||
1515 | unsigned int flags; \ | ||
1386 | \ | 1516 | \ |
1517 | local_irq_save(flags); \ | ||
1518 | \ | ||
1519 | omt = __dmt(); \ | ||
1387 | res = read_c0_##name(); \ | 1520 | res = read_c0_##name(); \ |
1388 | res &= ~change; \ | 1521 | res &= ~change; \ |
1389 | res |= (new & change); \ | 1522 | res |= (new & change); \ |
1390 | write_c0_##name(res); \ | 1523 | write_c0_##name(res); \ |
1524 | __emt(omt); \ | ||
1525 | local_irq_restore(flags); \ | ||
1391 | \ | 1526 | \ |
1392 | return res; \ | 1527 | return res; \ |
1393 | } | 1528 | } |
1529 | #endif | ||
1394 | 1530 | ||
1395 | __BUILD_SET_C0(status) | 1531 | __BUILD_SET_C0(status) |
1396 | __BUILD_SET_C0(cause) | 1532 | __BUILD_SET_C0(cause) |
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h index 61cf225881..6e09f4c872 100644 --- a/include/asm-mips/mmu_context.h +++ b/include/asm-mips/mmu_context.h | |||
@@ -17,6 +17,10 @@ | |||
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
19 | #include <asm/tlbflush.h> | 19 | #include <asm/tlbflush.h> |
20 | #ifdef CONFIG_MIPS_MT_SMTC | ||
21 | #include <asm/mipsmtregs.h> | ||
22 | #include <asm/smtc.h> | ||
23 | #endif /* SMTC */ | ||
20 | 24 | ||
21 | /* | 25 | /* |
22 | * For the fast tlb miss handlers, we keep a per cpu array of pointers | 26 | * For the fast tlb miss handlers, we keep a per cpu array of pointers |
@@ -54,6 +58,14 @@ extern unsigned long pgd_current[]; | |||
54 | #define ASID_INC 0x1 | 58 | #define ASID_INC 0x1 |
55 | #define ASID_MASK 0xfff | 59 | #define ASID_MASK 0xfff |
56 | 60 | ||
61 | /* SMTC/34K debug hack - but maybe we'll keep it */ | ||
62 | #elif defined(CONFIG_MIPS_MT_SMTC) | ||
63 | |||
64 | #define ASID_INC 0x1 | ||
65 | extern unsigned long smtc_asid_mask; | ||
66 | #define ASID_MASK (smtc_asid_mask) | ||
67 | #define HW_ASID_MASK 0xff | ||
68 | /* End SMTC/34K debug hack */ | ||
57 | #else /* FIXME: not correct for R6000 */ | 69 | #else /* FIXME: not correct for R6000 */ |
58 | 70 | ||
59 | #define ASID_INC 0x1 | 71 | #define ASID_INC 0x1 |
@@ -76,6 +88,8 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
76 | #define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) | 88 | #define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1))) |
77 | #define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1) | 89 | #define ASID_FIRST_VERSION ((unsigned long)(~ASID_VERSION_MASK) + 1) |
78 | 90 | ||
91 | #ifndef CONFIG_MIPS_MT_SMTC | ||
92 | /* Normal, classic MIPS get_new_mmu_context */ | ||
79 | static inline void | 93 | static inline void |
80 | get_new_mmu_context(struct mm_struct *mm, unsigned long cpu) | 94 | get_new_mmu_context(struct mm_struct *mm, unsigned long cpu) |
81 | { | 95 | { |
@@ -91,6 +105,12 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long cpu) | |||
91 | cpu_context(cpu, mm) = asid_cache(cpu) = asid; | 105 | cpu_context(cpu, mm) = asid_cache(cpu) = asid; |
92 | } | 106 | } |
93 | 107 | ||
108 | #else /* CONFIG_MIPS_MT_SMTC */ | ||
109 | |||
110 | #define get_new_mmu_context(mm,cpu) smtc_get_new_mmu_context((mm),(cpu)) | ||
111 | |||
112 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
113 | |||
94 | /* | 114 | /* |
95 | * Initialize the context related info for a new mm_struct | 115 | * Initialize the context related info for a new mm_struct |
96 | * instance. | 116 | * instance. |
@@ -111,14 +131,46 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
111 | { | 131 | { |
112 | unsigned int cpu = smp_processor_id(); | 132 | unsigned int cpu = smp_processor_id(); |
113 | unsigned long flags; | 133 | unsigned long flags; |
114 | 134 | #ifdef CONFIG_MIPS_MT_SMTC | |
135 | unsigned long oldasid; | ||
136 | unsigned long mtflags; | ||
137 | int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id; | ||
115 | local_irq_save(flags); | 138 | local_irq_save(flags); |
139 | mtflags = dvpe(); | ||
140 | #else /* Not SMTC */ | ||
141 | local_irq_save(flags); | ||
142 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
116 | 143 | ||
117 | /* Check if our ASID is of an older version and thus invalid */ | 144 | /* Check if our ASID is of an older version and thus invalid */ |
118 | if ((cpu_context(cpu, next) ^ asid_cache(cpu)) & ASID_VERSION_MASK) | 145 | if ((cpu_context(cpu, next) ^ asid_cache(cpu)) & ASID_VERSION_MASK) |
119 | get_new_mmu_context(next, cpu); | 146 | get_new_mmu_context(next, cpu); |
120 | 147 | #ifdef CONFIG_MIPS_MT_SMTC | |
148 | /* | ||
149 | * If the EntryHi ASID being replaced happens to be | ||
150 | * the value flagged at ASID recycling time as having | ||
151 | * an extended life, clear the bit showing it being | ||
152 | * in use by this "CPU", and if that's the last bit, | ||
153 | * free up the ASID value for use and flush any old | ||
154 | * instances of it from the TLB. | ||
155 | */ | ||
156 | oldasid = (read_c0_entryhi() & ASID_MASK); | ||
157 | if(smtc_live_asid[mytlb][oldasid]) { | ||
158 | smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu); | ||
159 | if(smtc_live_asid[mytlb][oldasid] == 0) | ||
160 | smtc_flush_tlb_asid(oldasid); | ||
161 | } | ||
162 | /* | ||
163 | * Tread softly on EntryHi, and so long as we support | ||
164 | * having ASID_MASK smaller than the hardware maximum, | ||
165 | * make sure no "soft" bits become "hard"... | ||
166 | */ | ||
167 | write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) | ||
168 | | (cpu_context(cpu, next) & ASID_MASK)); | ||
169 | ehb(); /* Make sure it propagates to TCStatus */ | ||
170 | evpe(mtflags); | ||
171 | #else | ||
121 | write_c0_entryhi(cpu_context(cpu, next)); | 172 | write_c0_entryhi(cpu_context(cpu, next)); |
173 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
122 | TLBMISS_HANDLER_SETUP_PGD(next->pgd); | 174 | TLBMISS_HANDLER_SETUP_PGD(next->pgd); |
123 | 175 | ||
124 | /* | 176 | /* |
@@ -151,12 +203,34 @@ activate_mm(struct mm_struct *prev, struct mm_struct *next) | |||
151 | unsigned long flags; | 203 | unsigned long flags; |
152 | unsigned int cpu = smp_processor_id(); | 204 | unsigned int cpu = smp_processor_id(); |
153 | 205 | ||
206 | #ifdef CONFIG_MIPS_MT_SMTC | ||
207 | unsigned long oldasid; | ||
208 | unsigned long mtflags; | ||
209 | int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id; | ||
210 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
211 | |||
154 | local_irq_save(flags); | 212 | local_irq_save(flags); |
155 | 213 | ||
156 | /* Unconditionally get a new ASID. */ | 214 | /* Unconditionally get a new ASID. */ |
157 | get_new_mmu_context(next, cpu); | 215 | get_new_mmu_context(next, cpu); |
158 | 216 | ||
217 | #ifdef CONFIG_MIPS_MT_SMTC | ||
218 | /* See comments for similar code above */ | ||
219 | mtflags = dvpe(); | ||
220 | oldasid = read_c0_entryhi() & ASID_MASK; | ||
221 | if(smtc_live_asid[mytlb][oldasid]) { | ||
222 | smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu); | ||
223 | if(smtc_live_asid[mytlb][oldasid] == 0) | ||
224 | smtc_flush_tlb_asid(oldasid); | ||
225 | } | ||
226 | /* See comments for similar code above */ | ||
227 | write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) | | ||
228 | (cpu_context(cpu, next) & ASID_MASK)); | ||
229 | ehb(); /* Make sure it propagates to TCStatus */ | ||
230 | evpe(mtflags); | ||
231 | #else | ||
159 | write_c0_entryhi(cpu_context(cpu, next)); | 232 | write_c0_entryhi(cpu_context(cpu, next)); |
233 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
160 | TLBMISS_HANDLER_SETUP_PGD(next->pgd); | 234 | TLBMISS_HANDLER_SETUP_PGD(next->pgd); |
161 | 235 | ||
162 | /* mark mmu ownership change */ | 236 | /* mark mmu ownership change */ |
@@ -174,17 +248,49 @@ static inline void | |||
174 | drop_mmu_context(struct mm_struct *mm, unsigned cpu) | 248 | drop_mmu_context(struct mm_struct *mm, unsigned cpu) |
175 | { | 249 | { |
176 | unsigned long flags; | 250 | unsigned long flags; |
251 | #ifdef CONFIG_MIPS_MT_SMTC | ||
252 | unsigned long oldasid; | ||
253 | /* Can't use spinlock because called from TLB flush within DVPE */ | ||
254 | unsigned int prevvpe; | ||
255 | int mytlb = (smtc_status & SMTC_TLB_SHARED) ? 0 : cpu_data[cpu].vpe_id; | ||
256 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
177 | 257 | ||
178 | local_irq_save(flags); | 258 | local_irq_save(flags); |
179 | 259 | ||
180 | if (cpu_isset(cpu, mm->cpu_vm_mask)) { | 260 | if (cpu_isset(cpu, mm->cpu_vm_mask)) { |
181 | get_new_mmu_context(mm, cpu); | 261 | get_new_mmu_context(mm, cpu); |
262 | #ifdef CONFIG_MIPS_MT_SMTC | ||
263 | /* See comments for similar code above */ | ||
264 | prevvpe = dvpe(); | ||
265 | oldasid = (read_c0_entryhi() & ASID_MASK); | ||
266 | if(smtc_live_asid[mytlb][oldasid]) { | ||
267 | smtc_live_asid[mytlb][oldasid] &= ~(0x1 << cpu); | ||
268 | if(smtc_live_asid[mytlb][oldasid] == 0) | ||
269 | smtc_flush_tlb_asid(oldasid); | ||
270 | } | ||
271 | /* See comments for similar code above */ | ||
272 | write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) | ||
273 | | cpu_asid(cpu, mm)); | ||
274 | ehb(); /* Make sure it propagates to TCStatus */ | ||
275 | evpe(prevvpe); | ||
276 | #else /* not CONFIG_MIPS_MT_SMTC */ | ||
182 | write_c0_entryhi(cpu_asid(cpu, mm)); | 277 | write_c0_entryhi(cpu_asid(cpu, mm)); |
278 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
183 | } else { | 279 | } else { |
184 | /* will get a new context next time */ | 280 | /* will get a new context next time */ |
281 | #ifndef CONFIG_MIPS_MT_SMTC | ||
185 | cpu_context(cpu, mm) = 0; | 282 | cpu_context(cpu, mm) = 0; |
283 | #else /* SMTC */ | ||
284 | int i; | ||
285 | |||
286 | /* SMTC shares the TLB (and ASIDs) across VPEs */ | ||
287 | for (i = 0; i < num_online_cpus(); i++) { | ||
288 | if((smtc_status & SMTC_TLB_SHARED) | ||
289 | || (cpu_data[i].vpe_id == cpu_data[cpu].vpe_id)) | ||
290 | cpu_context(i, mm) = 0; | ||
291 | } | ||
292 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
186 | } | 293 | } |
187 | |||
188 | local_irq_restore(flags); | 294 | local_irq_restore(flags); |
189 | } | 295 | } |
190 | 296 | ||
diff --git a/include/asm-mips/numnodes.h b/include/asm-mips/numnodes.h deleted file mode 100644 index 4f00c16cee..0000000000 --- a/include/asm-mips/numnodes.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef _ASM_MAX_NUMNODES_H | ||
2 | #define _ASM_MAX_NUMNODES_H | ||
3 | |||
4 | /* Max 128 Nodes */ | ||
5 | #define NODES_SHIFT 6 | ||
6 | |||
7 | #endif /* _ASM_MAX_NUMNODES_H */ | ||
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index a1eab136ff..4035ec79ec 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -139,9 +139,11 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
139 | 139 | ||
140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
141 | 141 | ||
142 | #ifndef CONFIG_SPARSEMEM | ||
142 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 143 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
143 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | 144 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
144 | #endif | 145 | #endif |
146 | #endif | ||
145 | 147 | ||
146 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | 148 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) |
147 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) | 149 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) |
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h index 4d6bc45df5..087c207692 100644 --- a/include/asm-mips/pgtable-32.h +++ b/include/asm-mips/pgtable-32.h | |||
@@ -177,48 +177,67 @@ pfn_pte(unsigned long pfn, pgprot_t prot) | |||
177 | ((swp_entry_t) { ((type) << 10) | ((offset) << 15) }) | 177 | ((swp_entry_t) { ((type) << 10) | ((offset) << 15) }) |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * Bits 0, 1, 2, 9 and 10 are taken, split up the 27 bits of offset | 180 | * Bits 0, 4, 8, and 9 are taken, split up 28 bits of offset into this range: |
181 | * into this range: | ||
182 | */ | 181 | */ |
183 | #define PTE_FILE_MAX_BITS 27 | 182 | #define PTE_FILE_MAX_BITS 28 |
184 | 183 | ||
185 | #define pte_to_pgoff(_pte) \ | 184 | #define pte_to_pgoff(_pte) ((((_pte).pte >> 1 ) & 0x07) | \ |
186 | ((((_pte).pte >> 3) & 0x3f ) + (((_pte).pte >> 11) << 8 )) | 185 | (((_pte).pte >> 2 ) & 0x38) | \ |
186 | (((_pte).pte >> 10) << 6 )) | ||
187 | 187 | ||
188 | #define pgoff_to_pte(off) \ | 188 | #define pgoff_to_pte(off) ((pte_t) { (((off) & 0x07) << 1 ) | \ |
189 | ((pte_t) { (((off) & 0x3f) << 3) + (((off) >> 8) << 11) + _PAGE_FILE }) | 189 | (((off) & 0x38) << 2 ) | \ |
190 | (((off) >> 6 ) << 10) | \ | ||
191 | _PAGE_FILE }) | ||
190 | 192 | ||
191 | #else | 193 | #else |
192 | 194 | ||
193 | /* Swap entries must have VALID and GLOBAL bits cleared. */ | 195 | /* Swap entries must have VALID and GLOBAL bits cleared. */ |
196 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
197 | #define __swp_type(x) (((x).val >> 2) & 0x1f) | ||
198 | #define __swp_offset(x) ((x).val >> 7) | ||
199 | #define __swp_entry(type,offset) \ | ||
200 | ((swp_entry_t) { ((type) << 2) | ((offset) << 7) }) | ||
201 | #else | ||
194 | #define __swp_type(x) (((x).val >> 8) & 0x1f) | 202 | #define __swp_type(x) (((x).val >> 8) & 0x1f) |
195 | #define __swp_offset(x) ((x).val >> 13) | 203 | #define __swp_offset(x) ((x).val >> 13) |
196 | #define __swp_entry(type,offset) \ | 204 | #define __swp_entry(type,offset) \ |
197 | ((swp_entry_t) { ((type) << 8) | ((offset) << 13) }) | 205 | ((swp_entry_t) { ((type) << 8) | ((offset) << 13) }) |
206 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ | ||
198 | 207 | ||
208 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
199 | /* | 209 | /* |
200 | * Bits 0, 1, 2, 7 and 8 are taken, split up the 27 bits of offset | 210 | * Bits 0 and 1 of pte_high are taken, use the rest for the page offset... |
201 | * into this range: | ||
202 | */ | 211 | */ |
203 | #define PTE_FILE_MAX_BITS 27 | 212 | #define PTE_FILE_MAX_BITS 30 |
204 | 213 | ||
205 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 214 | #define pte_to_pgoff(_pte) ((_pte).pte_high >> 2) |
206 | /* fixme */ | 215 | #define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) << 2 }) |
207 | #define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f)) | ||
208 | #define pgoff_to_pte(off) \ | ||
209 | ((pte_t){(((off) & 0x3f) + ((off) << 6) + _PAGE_FILE)}) | ||
210 | 216 | ||
211 | #else | 217 | #else |
212 | #define pte_to_pgoff(_pte) \ | 218 | /* |
213 | ((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 )) | 219 | * Bits 0, 4, 6, and 7 are taken, split up 28 bits of offset into this range: |
220 | */ | ||
221 | #define PTE_FILE_MAX_BITS 28 | ||
222 | |||
223 | #define pte_to_pgoff(_pte) ((((_pte).pte >> 1) & 0x7) | \ | ||
224 | (((_pte).pte >> 2) & 0x8) | \ | ||
225 | (((_pte).pte >> 8) << 4)) | ||
214 | 226 | ||
215 | #define pgoff_to_pte(off) \ | 227 | #define pgoff_to_pte(off) ((pte_t) { (((off) & 0x7) << 1) | \ |
216 | ((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE }) | 228 | (((off) & 0x8) << 2) | \ |
229 | (((off) >> 4) << 8) | \ | ||
230 | _PAGE_FILE }) | ||
217 | #endif | 231 | #endif |
218 | 232 | ||
219 | #endif | 233 | #endif |
220 | 234 | ||
235 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
236 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high }) | ||
237 | #define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val }) | ||
238 | #else | ||
221 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | 239 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
222 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | 240 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) |
241 | #endif | ||
223 | 242 | ||
224 | #endif /* _ASM_PGTABLE_32_H */ | 243 | #endif /* _ASM_PGTABLE_32_H */ |
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h index 82166b254b..2faf5c9ff1 100644 --- a/include/asm-mips/pgtable-64.h +++ b/include/asm-mips/pgtable-64.h | |||
@@ -224,15 +224,12 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) | |||
224 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | 224 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) |
225 | 225 | ||
226 | /* | 226 | /* |
227 | * Bits 0, 1, 2, 7 and 8 are taken, split up the 32 bits of offset | 227 | * Bits 0, 4, 6, and 7 are taken. Let's leave bits 1, 2, 3, and 5 alone to |
228 | * into this range: | 228 | * make things easier, and only use the upper 56 bits for the page offset... |
229 | */ | 229 | */ |
230 | #define PTE_FILE_MAX_BITS 32 | 230 | #define PTE_FILE_MAX_BITS 56 |
231 | 231 | ||
232 | #define pte_to_pgoff(_pte) \ | 232 | #define pte_to_pgoff(_pte) ((_pte).pte >> 8) |
233 | ((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 )) | 233 | #define pgoff_to_pte(off) ((pte_t) { ((off) << 8) | _PAGE_FILE }) |
234 | |||
235 | #define pgoff_to_pte(off) \ | ||
236 | ((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE }) | ||
237 | 234 | ||
238 | #endif /* _ASM_PGTABLE_64_H */ | 235 | #endif /* _ASM_PGTABLE_64_H */ |
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index 702a28fa7a..d0af2a3b01 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h | |||
@@ -70,7 +70,15 @@ extern unsigned long zero_page_mask; | |||
70 | #define ZERO_PAGE(vaddr) \ | 70 | #define ZERO_PAGE(vaddr) \ |
71 | (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) | 71 | (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))) |
72 | 72 | ||
73 | #define __HAVE_ARCH_MULTIPLE_ZERO_PAGE | 73 | #define __HAVE_ARCH_MOVE_PTE |
74 | #define move_pte(pte, prot, old_addr, new_addr) \ | ||
75 | ({ \ | ||
76 | pte_t newpte = (pte); \ | ||
77 | if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \ | ||
78 | pte_page(pte) == ZERO_PAGE(old_addr)) \ | ||
79 | newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \ | ||
80 | newpte; \ | ||
81 | }) | ||
74 | 82 | ||
75 | extern void paging_init(void); | 83 | extern void paging_init(void); |
76 | 84 | ||
@@ -82,10 +90,11 @@ extern void paging_init(void); | |||
82 | #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) | 90 | #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) |
83 | #define pmd_page_kernel(pmd) pmd_val(pmd) | 91 | #define pmd_page_kernel(pmd) pmd_val(pmd) |
84 | 92 | ||
85 | #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) | ||
86 | #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) | ||
87 | |||
88 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 93 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
94 | |||
95 | #define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL)) | ||
96 | #define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT) | ||
97 | |||
89 | static inline void set_pte(pte_t *ptep, pte_t pte) | 98 | static inline void set_pte(pte_t *ptep, pte_t pte) |
90 | { | 99 | { |
91 | ptep->pte_high = pte.pte_high; | 100 | ptep->pte_high = pte.pte_high; |
@@ -93,27 +102,35 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
93 | ptep->pte_low = pte.pte_low; | 102 | ptep->pte_low = pte.pte_low; |
94 | //printk("pte_high %x pte_low %x\n", ptep->pte_high, ptep->pte_low); | 103 | //printk("pte_high %x pte_low %x\n", ptep->pte_high, ptep->pte_low); |
95 | 104 | ||
96 | if (pte_val(pte) & _PAGE_GLOBAL) { | 105 | if (pte.pte_low & _PAGE_GLOBAL) { |
97 | pte_t *buddy = ptep_buddy(ptep); | 106 | pte_t *buddy = ptep_buddy(ptep); |
98 | /* | 107 | /* |
99 | * Make sure the buddy is global too (if it's !none, | 108 | * Make sure the buddy is global too (if it's !none, |
100 | * it better already be global) | 109 | * it better already be global) |
101 | */ | 110 | */ |
102 | if (pte_none(*buddy)) | 111 | if (pte_none(*buddy)) { |
103 | buddy->pte_low |= _PAGE_GLOBAL; | 112 | buddy->pte_low |= _PAGE_GLOBAL; |
113 | buddy->pte_high |= _PAGE_GLOBAL; | ||
114 | } | ||
104 | } | 115 | } |
105 | } | 116 | } |
106 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | 117 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) |
107 | 118 | ||
108 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 119 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
109 | { | 120 | { |
121 | pte_t null = __pte(0); | ||
122 | |||
110 | /* Preserve global status for the pair */ | 123 | /* Preserve global status for the pair */ |
111 | if (pte_val(*ptep_buddy(ptep)) & _PAGE_GLOBAL) | 124 | if (ptep_buddy(ptep)->pte_low & _PAGE_GLOBAL) |
112 | set_pte_at(mm, addr, ptep, __pte(_PAGE_GLOBAL)); | 125 | null.pte_low = null.pte_high = _PAGE_GLOBAL; |
113 | else | 126 | |
114 | set_pte_at(mm, addr, ptep, __pte(0)); | 127 | set_pte_at(mm, addr, ptep, null); |
115 | } | 128 | } |
116 | #else | 129 | #else |
130 | |||
131 | #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) | ||
132 | #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) | ||
133 | |||
117 | /* | 134 | /* |
118 | * Certain architectures need to do special things when pte's | 135 | * Certain architectures need to do special things when pte's |
119 | * within a page table are directly modified. Thus, the following | 136 | * within a page table are directly modified. Thus, the following |
@@ -174,75 +191,76 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
174 | */ | 191 | */ |
175 | static inline int pte_user(pte_t pte) { BUG(); return 0; } | 192 | static inline int pte_user(pte_t pte) { BUG(); return 0; } |
176 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 193 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
177 | static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_READ; } | 194 | static inline int pte_read(pte_t pte) { return pte.pte_low & _PAGE_READ; } |
178 | static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_WRITE; } | 195 | static inline int pte_write(pte_t pte) { return pte.pte_low & _PAGE_WRITE; } |
179 | static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_MODIFIED; } | 196 | static inline int pte_dirty(pte_t pte) { return pte.pte_low & _PAGE_MODIFIED; } |
180 | static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } | 197 | static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } |
181 | static inline int pte_file(pte_t pte) { return (pte).pte_low & _PAGE_FILE; } | 198 | static inline int pte_file(pte_t pte) { return pte.pte_low & _PAGE_FILE; } |
199 | |||
182 | static inline pte_t pte_wrprotect(pte_t pte) | 200 | static inline pte_t pte_wrprotect(pte_t pte) |
183 | { | 201 | { |
184 | (pte).pte_low &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); | 202 | pte.pte_low &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); |
185 | (pte).pte_high &= ~_PAGE_SILENT_WRITE; | 203 | pte.pte_high &= ~_PAGE_SILENT_WRITE; |
186 | return pte; | 204 | return pte; |
187 | } | 205 | } |
188 | 206 | ||
189 | static inline pte_t pte_rdprotect(pte_t pte) | 207 | static inline pte_t pte_rdprotect(pte_t pte) |
190 | { | 208 | { |
191 | (pte).pte_low &= ~(_PAGE_READ | _PAGE_SILENT_READ); | 209 | pte.pte_low &= ~(_PAGE_READ | _PAGE_SILENT_READ); |
192 | (pte).pte_high &= ~_PAGE_SILENT_READ; | 210 | pte.pte_high &= ~_PAGE_SILENT_READ; |
193 | return pte; | 211 | return pte; |
194 | } | 212 | } |
195 | 213 | ||
196 | static inline pte_t pte_mkclean(pte_t pte) | 214 | static inline pte_t pte_mkclean(pte_t pte) |
197 | { | 215 | { |
198 | (pte).pte_low &= ~(_PAGE_MODIFIED|_PAGE_SILENT_WRITE); | 216 | pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); |
199 | (pte).pte_high &= ~_PAGE_SILENT_WRITE; | 217 | pte.pte_high &= ~_PAGE_SILENT_WRITE; |
200 | return pte; | 218 | return pte; |
201 | } | 219 | } |
202 | 220 | ||
203 | static inline pte_t pte_mkold(pte_t pte) | 221 | static inline pte_t pte_mkold(pte_t pte) |
204 | { | 222 | { |
205 | (pte).pte_low &= ~(_PAGE_ACCESSED|_PAGE_SILENT_READ); | 223 | pte.pte_low &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ); |
206 | (pte).pte_high &= ~_PAGE_SILENT_READ; | 224 | pte.pte_high &= ~_PAGE_SILENT_READ; |
207 | return pte; | 225 | return pte; |
208 | } | 226 | } |
209 | 227 | ||
210 | static inline pte_t pte_mkwrite(pte_t pte) | 228 | static inline pte_t pte_mkwrite(pte_t pte) |
211 | { | 229 | { |
212 | (pte).pte_low |= _PAGE_WRITE; | 230 | pte.pte_low |= _PAGE_WRITE; |
213 | if ((pte).pte_low & _PAGE_MODIFIED) { | 231 | if (pte.pte_low & _PAGE_MODIFIED) { |
214 | (pte).pte_low |= _PAGE_SILENT_WRITE; | 232 | pte.pte_low |= _PAGE_SILENT_WRITE; |
215 | (pte).pte_high |= _PAGE_SILENT_WRITE; | 233 | pte.pte_high |= _PAGE_SILENT_WRITE; |
216 | } | 234 | } |
217 | return pte; | 235 | return pte; |
218 | } | 236 | } |
219 | 237 | ||
220 | static inline pte_t pte_mkread(pte_t pte) | 238 | static inline pte_t pte_mkread(pte_t pte) |
221 | { | 239 | { |
222 | (pte).pte_low |= _PAGE_READ; | 240 | pte.pte_low |= _PAGE_READ; |
223 | if ((pte).pte_low & _PAGE_ACCESSED) { | 241 | if (pte.pte_low & _PAGE_ACCESSED) { |
224 | (pte).pte_low |= _PAGE_SILENT_READ; | 242 | pte.pte_low |= _PAGE_SILENT_READ; |
225 | (pte).pte_high |= _PAGE_SILENT_READ; | 243 | pte.pte_high |= _PAGE_SILENT_READ; |
226 | } | 244 | } |
227 | return pte; | 245 | return pte; |
228 | } | 246 | } |
229 | 247 | ||
230 | static inline pte_t pte_mkdirty(pte_t pte) | 248 | static inline pte_t pte_mkdirty(pte_t pte) |
231 | { | 249 | { |
232 | (pte).pte_low |= _PAGE_MODIFIED; | 250 | pte.pte_low |= _PAGE_MODIFIED; |
233 | if ((pte).pte_low & _PAGE_WRITE) { | 251 | if (pte.pte_low & _PAGE_WRITE) { |
234 | (pte).pte_low |= _PAGE_SILENT_WRITE; | 252 | pte.pte_low |= _PAGE_SILENT_WRITE; |
235 | (pte).pte_high |= _PAGE_SILENT_WRITE; | 253 | pte.pte_high |= _PAGE_SILENT_WRITE; |
236 | } | 254 | } |
237 | return pte; | 255 | return pte; |
238 | } | 256 | } |
239 | 257 | ||
240 | static inline pte_t pte_mkyoung(pte_t pte) | 258 | static inline pte_t pte_mkyoung(pte_t pte) |
241 | { | 259 | { |
242 | (pte).pte_low |= _PAGE_ACCESSED; | 260 | pte.pte_low |= _PAGE_ACCESSED; |
243 | if ((pte).pte_low & _PAGE_READ) | 261 | if (pte.pte_low & _PAGE_READ) |
244 | (pte).pte_low |= _PAGE_SILENT_READ; | 262 | pte.pte_low |= _PAGE_SILENT_READ; |
245 | (pte).pte_high |= _PAGE_SILENT_READ; | 263 | pte.pte_high |= _PAGE_SILENT_READ; |
246 | return pte; | 264 | return pte; |
247 | } | 265 | } |
248 | #else | 266 | #else |
@@ -335,8 +353,9 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot) | |||
335 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) | 353 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
336 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 354 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
337 | { | 355 | { |
338 | pte.pte_low &= _PAGE_CHG_MASK; | 356 | pte.pte_low &= _PAGE_CHG_MASK; |
339 | pte.pte_low |= pgprot_val(newprot); | 357 | pte.pte_high &= ~0x3f; |
358 | pte.pte_low |= pgprot_val(newprot); | ||
340 | pte.pte_high |= pgprot_val(newprot) & 0x3f; | 359 | pte.pte_high |= pgprot_val(newprot) & 0x3f; |
341 | return pte; | 360 | return pte; |
342 | } | 361 | } |
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 39d2bd50fe..0fb75f0762 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define _ASM_PROCESSOR_H | 12 | #define _ASM_PROCESSOR_H |
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | #include <linux/cpumask.h> | ||
15 | #include <linux/threads.h> | 16 | #include <linux/threads.h> |
16 | 17 | ||
17 | #include <asm/cachectl.h> | 18 | #include <asm/cachectl.h> |
@@ -107,6 +108,10 @@ struct mips_dsp_state { | |||
107 | 108 | ||
108 | #define INIT_DSP {{0,},} | 109 | #define INIT_DSP {{0,},} |
109 | 110 | ||
111 | #define INIT_CPUMASK { \ | ||
112 | {0,} \ | ||
113 | } | ||
114 | |||
110 | typedef struct { | 115 | typedef struct { |
111 | unsigned long seg; | 116 | unsigned long seg; |
112 | } mm_segment_t; | 117 | } mm_segment_t; |
@@ -129,6 +134,12 @@ struct thread_struct { | |||
129 | 134 | ||
130 | /* Saved fpu/fpu emulator stuff. */ | 135 | /* Saved fpu/fpu emulator stuff. */ |
131 | union mips_fpu_union fpu; | 136 | union mips_fpu_union fpu; |
137 | #ifdef CONFIG_MIPS_MT_FPAFF | ||
138 | /* Emulated instruction count */ | ||
139 | unsigned long emulated_fp; | ||
140 | /* Saved per-thread scheduler affinity mask */ | ||
141 | cpumask_t user_cpus_allowed; | ||
142 | #endif /* CONFIG_MIPS_MT_FPAFF */ | ||
132 | 143 | ||
133 | /* Saved state of the DSP ASE, if available. */ | 144 | /* Saved state of the DSP ASE, if available. */ |
134 | struct mips_dsp_state dsp; | 145 | struct mips_dsp_state dsp; |
@@ -142,6 +153,7 @@ struct thread_struct { | |||
142 | #define MF_LOGADE 2 /* Log address errors to syslog */ | 153 | #define MF_LOGADE 2 /* Log address errors to syslog */ |
143 | #define MF_32BIT_REGS 4 /* also implies 16/32 fprs */ | 154 | #define MF_32BIT_REGS 4 /* also implies 16/32 fprs */ |
144 | #define MF_32BIT_ADDR 8 /* 32-bit address space (o32/n32) */ | 155 | #define MF_32BIT_ADDR 8 /* 32-bit address space (o32/n32) */ |
156 | #define MF_FPUBOUND 0x10 /* thread bound to FPU-full CPU set */ | ||
145 | unsigned long mflags; | 157 | unsigned long mflags; |
146 | unsigned long irix_trampoline; /* Wheee... */ | 158 | unsigned long irix_trampoline; /* Wheee... */ |
147 | unsigned long irix_oldctx; | 159 | unsigned long irix_oldctx; |
@@ -153,6 +165,12 @@ struct thread_struct { | |||
153 | #define MF_N32 MF_32BIT_ADDR | 165 | #define MF_N32 MF_32BIT_ADDR |
154 | #define MF_N64 0 | 166 | #define MF_N64 0 |
155 | 167 | ||
168 | #ifdef CONFIG_MIPS_MT_FPAFF | ||
169 | #define FPAFF_INIT 0, INIT_CPUMASK, | ||
170 | #else | ||
171 | #define FPAFF_INIT | ||
172 | #endif /* CONFIG_MIPS_MT_FPAFF */ | ||
173 | |||
156 | #define INIT_THREAD { \ | 174 | #define INIT_THREAD { \ |
157 | /* \ | 175 | /* \ |
158 | * saved main processor registers \ | 176 | * saved main processor registers \ |
@@ -168,6 +186,10 @@ struct thread_struct { | |||
168 | */ \ | 186 | */ \ |
169 | INIT_FPU, \ | 187 | INIT_FPU, \ |
170 | /* \ | 188 | /* \ |
189 | * fpu affinity state (null if not FPAFF) \ | ||
190 | */ \ | ||
191 | FPAFF_INIT \ | ||
192 | /* \ | ||
171 | * saved dsp/dsp emulator stuff \ | 193 | * saved dsp/dsp emulator stuff \ |
172 | */ \ | 194 | */ \ |
173 | INIT_DSP, \ | 195 | INIT_DSP, \ |
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h index 95c5839ac4..fa9d8713c1 100644 --- a/include/asm-mips/ptrace.h +++ b/include/asm-mips/ptrace.h | |||
@@ -45,6 +45,10 @@ struct pt_regs { | |||
45 | unsigned long cp0_badvaddr; | 45 | unsigned long cp0_badvaddr; |
46 | unsigned long cp0_cause; | 46 | unsigned long cp0_cause; |
47 | unsigned long cp0_epc; | 47 | unsigned long cp0_epc; |
48 | #ifdef CONFIG_MIPS_MT_SMTC | ||
49 | unsigned long cp0_tcstatus; | ||
50 | unsigned long smtc_pad; | ||
51 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
48 | }; | 52 | }; |
49 | 53 | ||
50 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | 54 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ |
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h index 90c3747009..3c8e3c8d1a 100644 --- a/include/asm-mips/r4kcache.h +++ b/include/asm-mips/r4kcache.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/asm.h> | 15 | #include <asm/asm.h> |
16 | #include <asm/cacheops.h> | 16 | #include <asm/cacheops.h> |
17 | #include <asm/cpu-features.h> | 17 | #include <asm/cpu-features.h> |
18 | #include <asm/mipsmtregs.h> | ||
18 | 19 | ||
19 | /* | 20 | /* |
20 | * This macro return a properly sign-extended address suitable as base address | 21 | * This macro return a properly sign-extended address suitable as base address |
@@ -37,16 +38,120 @@ | |||
37 | " cache %0, %1 \n" \ | 38 | " cache %0, %1 \n" \ |
38 | " .set pop \n" \ | 39 | " .set pop \n" \ |
39 | : \ | 40 | : \ |
40 | : "i" (op), "m" (*(unsigned char *)(addr))) | 41 | : "i" (op), "R" (*(unsigned char *)(addr))) |
42 | |||
43 | #ifdef CONFIG_MIPS_MT | ||
44 | /* | ||
45 | * Temporary hacks for SMTC debug. Optionally force single-threaded | ||
46 | * execution during I-cache flushes. | ||
47 | */ | ||
48 | |||
49 | #define PROTECT_CACHE_FLUSHES 1 | ||
50 | |||
51 | #ifdef PROTECT_CACHE_FLUSHES | ||
52 | |||
53 | extern int mt_protiflush; | ||
54 | extern int mt_protdflush; | ||
55 | extern void mt_cflush_lockdown(void); | ||
56 | extern void mt_cflush_release(void); | ||
57 | |||
58 | #define BEGIN_MT_IPROT \ | ||
59 | unsigned long flags = 0; \ | ||
60 | unsigned long mtflags = 0; \ | ||
61 | if(mt_protiflush) { \ | ||
62 | local_irq_save(flags); \ | ||
63 | ehb(); \ | ||
64 | mtflags = dvpe(); \ | ||
65 | mt_cflush_lockdown(); \ | ||
66 | } | ||
67 | |||
68 | #define END_MT_IPROT \ | ||
69 | if(mt_protiflush) { \ | ||
70 | mt_cflush_release(); \ | ||
71 | evpe(mtflags); \ | ||
72 | local_irq_restore(flags); \ | ||
73 | } | ||
74 | |||
75 | #define BEGIN_MT_DPROT \ | ||
76 | unsigned long flags = 0; \ | ||
77 | unsigned long mtflags = 0; \ | ||
78 | if(mt_protdflush) { \ | ||
79 | local_irq_save(flags); \ | ||
80 | ehb(); \ | ||
81 | mtflags = dvpe(); \ | ||
82 | mt_cflush_lockdown(); \ | ||
83 | } | ||
84 | |||
85 | #define END_MT_DPROT \ | ||
86 | if(mt_protdflush) { \ | ||
87 | mt_cflush_release(); \ | ||
88 | evpe(mtflags); \ | ||
89 | local_irq_restore(flags); \ | ||
90 | } | ||
91 | |||
92 | #else | ||
93 | |||
94 | #define BEGIN_MT_IPROT | ||
95 | #define BEGIN_MT_DPROT | ||
96 | #define END_MT_IPROT | ||
97 | #define END_MT_DPROT | ||
98 | |||
99 | #endif /* PROTECT_CACHE_FLUSHES */ | ||
100 | |||
101 | #define __iflush_prologue \ | ||
102 | unsigned long redundance; \ | ||
103 | extern int mt_n_iflushes; \ | ||
104 | BEGIN_MT_IPROT \ | ||
105 | for (redundance = 0; redundance < mt_n_iflushes; redundance++) { | ||
106 | |||
107 | #define __iflush_epilogue \ | ||
108 | END_MT_IPROT \ | ||
109 | } | ||
110 | |||
111 | #define __dflush_prologue \ | ||
112 | unsigned long redundance; \ | ||
113 | extern int mt_n_dflushes; \ | ||
114 | BEGIN_MT_DPROT \ | ||
115 | for (redundance = 0; redundance < mt_n_dflushes; redundance++) { | ||
116 | |||
117 | #define __dflush_epilogue \ | ||
118 | END_MT_DPROT \ | ||
119 | } | ||
120 | |||
121 | #define __inv_dflush_prologue __dflush_prologue | ||
122 | #define __inv_dflush_epilogue __dflush_epilogue | ||
123 | #define __sflush_prologue { | ||
124 | #define __sflush_epilogue } | ||
125 | #define __inv_sflush_prologue __sflush_prologue | ||
126 | #define __inv_sflush_epilogue __sflush_epilogue | ||
127 | |||
128 | #else /* CONFIG_MIPS_MT */ | ||
129 | |||
130 | #define __iflush_prologue { | ||
131 | #define __iflush_epilogue } | ||
132 | #define __dflush_prologue { | ||
133 | #define __dflush_epilogue } | ||
134 | #define __inv_dflush_prologue { | ||
135 | #define __inv_dflush_epilogue } | ||
136 | #define __sflush_prologue { | ||
137 | #define __sflush_epilogue } | ||
138 | #define __inv_sflush_prologue { | ||
139 | #define __inv_sflush_epilogue } | ||
140 | |||
141 | #endif /* CONFIG_MIPS_MT */ | ||
41 | 142 | ||
42 | static inline void flush_icache_line_indexed(unsigned long addr) | 143 | static inline void flush_icache_line_indexed(unsigned long addr) |
43 | { | 144 | { |
145 | __iflush_prologue | ||
44 | cache_op(Index_Invalidate_I, addr); | 146 | cache_op(Index_Invalidate_I, addr); |
147 | __iflush_epilogue | ||
45 | } | 148 | } |
46 | 149 | ||
47 | static inline void flush_dcache_line_indexed(unsigned long addr) | 150 | static inline void flush_dcache_line_indexed(unsigned long addr) |
48 | { | 151 | { |
152 | __dflush_prologue | ||
49 | cache_op(Index_Writeback_Inv_D, addr); | 153 | cache_op(Index_Writeback_Inv_D, addr); |
154 | __dflush_epilogue | ||
50 | } | 155 | } |
51 | 156 | ||
52 | static inline void flush_scache_line_indexed(unsigned long addr) | 157 | static inline void flush_scache_line_indexed(unsigned long addr) |
@@ -56,17 +161,23 @@ static inline void flush_scache_line_indexed(unsigned long addr) | |||
56 | 161 | ||
57 | static inline void flush_icache_line(unsigned long addr) | 162 | static inline void flush_icache_line(unsigned long addr) |
58 | { | 163 | { |
164 | __iflush_prologue | ||
59 | cache_op(Hit_Invalidate_I, addr); | 165 | cache_op(Hit_Invalidate_I, addr); |
166 | __iflush_epilogue | ||
60 | } | 167 | } |
61 | 168 | ||
62 | static inline void flush_dcache_line(unsigned long addr) | 169 | static inline void flush_dcache_line(unsigned long addr) |
63 | { | 170 | { |
171 | __dflush_prologue | ||
64 | cache_op(Hit_Writeback_Inv_D, addr); | 172 | cache_op(Hit_Writeback_Inv_D, addr); |
173 | __dflush_epilogue | ||
65 | } | 174 | } |
66 | 175 | ||
67 | static inline void invalidate_dcache_line(unsigned long addr) | 176 | static inline void invalidate_dcache_line(unsigned long addr) |
68 | { | 177 | { |
178 | __dflush_prologue | ||
69 | cache_op(Hit_Invalidate_D, addr); | 179 | cache_op(Hit_Invalidate_D, addr); |
180 | __dflush_epilogue | ||
70 | } | 181 | } |
71 | 182 | ||
72 | static inline void invalidate_scache_line(unsigned long addr) | 183 | static inline void invalidate_scache_line(unsigned long addr) |
@@ -239,9 +350,13 @@ static inline void blast_##pfx##cache##lsize(void) \ | |||
239 | current_cpu_data.desc.waybit; \ | 350 | current_cpu_data.desc.waybit; \ |
240 | unsigned long ws, addr; \ | 351 | unsigned long ws, addr; \ |
241 | \ | 352 | \ |
353 | __##pfx##flush_prologue \ | ||
354 | \ | ||
242 | for (ws = 0; ws < ws_end; ws += ws_inc) \ | 355 | for (ws = 0; ws < ws_end; ws += ws_inc) \ |
243 | for (addr = start; addr < end; addr += lsize * 32) \ | 356 | for (addr = start; addr < end; addr += lsize * 32) \ |
244 | cache##lsize##_unroll32(addr|ws,indexop); \ | 357 | cache##lsize##_unroll32(addr|ws,indexop); \ |
358 | \ | ||
359 | __##pfx##flush_epilogue \ | ||
245 | } \ | 360 | } \ |
246 | \ | 361 | \ |
247 | static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \ | 362 | static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \ |
@@ -249,10 +364,14 @@ static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \ | |||
249 | unsigned long start = page; \ | 364 | unsigned long start = page; \ |
250 | unsigned long end = page + PAGE_SIZE; \ | 365 | unsigned long end = page + PAGE_SIZE; \ |
251 | \ | 366 | \ |
367 | __##pfx##flush_prologue \ | ||
368 | \ | ||
252 | do { \ | 369 | do { \ |
253 | cache##lsize##_unroll32(start,hitop); \ | 370 | cache##lsize##_unroll32(start,hitop); \ |
254 | start += lsize * 32; \ | 371 | start += lsize * 32; \ |
255 | } while (start < end); \ | 372 | } while (start < end); \ |
373 | \ | ||
374 | __##pfx##flush_epilogue \ | ||
256 | } \ | 375 | } \ |
257 | \ | 376 | \ |
258 | static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page) \ | 377 | static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page) \ |
@@ -265,9 +384,13 @@ static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page) | |||
265 | current_cpu_data.desc.waybit; \ | 384 | current_cpu_data.desc.waybit; \ |
266 | unsigned long ws, addr; \ | 385 | unsigned long ws, addr; \ |
267 | \ | 386 | \ |
387 | __##pfx##flush_prologue \ | ||
388 | \ | ||
268 | for (ws = 0; ws < ws_end; ws += ws_inc) \ | 389 | for (ws = 0; ws < ws_end; ws += ws_inc) \ |
269 | for (addr = start; addr < end; addr += lsize * 32) \ | 390 | for (addr = start; addr < end; addr += lsize * 32) \ |
270 | cache##lsize##_unroll32(addr|ws,indexop); \ | 391 | cache##lsize##_unroll32(addr|ws,indexop); \ |
392 | \ | ||
393 | __##pfx##flush_epilogue \ | ||
271 | } | 394 | } |
272 | 395 | ||
273 | __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16) | 396 | __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16) |
@@ -288,12 +411,17 @@ static inline void prot##blast_##pfx##cache##_range(unsigned long start, \ | |||
288 | unsigned long lsize = cpu_##desc##_line_size(); \ | 411 | unsigned long lsize = cpu_##desc##_line_size(); \ |
289 | unsigned long addr = start & ~(lsize - 1); \ | 412 | unsigned long addr = start & ~(lsize - 1); \ |
290 | unsigned long aend = (end - 1) & ~(lsize - 1); \ | 413 | unsigned long aend = (end - 1) & ~(lsize - 1); \ |
414 | \ | ||
415 | __##pfx##flush_prologue \ | ||
416 | \ | ||
291 | while (1) { \ | 417 | while (1) { \ |
292 | prot##cache_op(hitop, addr); \ | 418 | prot##cache_op(hitop, addr); \ |
293 | if (addr == aend) \ | 419 | if (addr == aend) \ |
294 | break; \ | 420 | break; \ |
295 | addr += lsize; \ | 421 | addr += lsize; \ |
296 | } \ | 422 | } \ |
423 | \ | ||
424 | __##pfx##flush_epilogue \ | ||
297 | } | 425 | } |
298 | 426 | ||
299 | __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_) | 427 | __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_) |
diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h index a2abc4572b..82ad401c7d 100644 --- a/include/asm-mips/rtc.h +++ b/include/asm-mips/rtc.h | |||
@@ -32,7 +32,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time) | |||
32 | { | 32 | { |
33 | unsigned long nowtime; | 33 | unsigned long nowtime; |
34 | 34 | ||
35 | nowtime = rtc_get_time(); | 35 | nowtime = rtc_mips_get_time(); |
36 | to_tm(nowtime, time); | 36 | to_tm(nowtime, time); |
37 | time->tm_year -= 1900; | 37 | time->tm_year -= 1900; |
38 | 38 | ||
@@ -47,7 +47,7 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
47 | nowtime = mktime(time->tm_year+1900, time->tm_mon+1, | 47 | nowtime = mktime(time->tm_year+1900, time->tm_mon+1, |
48 | time->tm_mday, time->tm_hour, time->tm_min, | 48 | time->tm_mday, time->tm_hour, time->tm_min, |
49 | time->tm_sec); | 49 | time->tm_sec); |
50 | ret = rtc_set_time(nowtime); | 50 | ret = rtc_mips_set_time(nowtime); |
51 | 51 | ||
52 | return ret; | 52 | return ret; |
53 | } | 53 | } |
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h index 1298c3fdf6..76cd51c6be 100644 --- a/include/asm-mips/rtlx.h +++ b/include/asm-mips/rtlx.h | |||
@@ -3,32 +3,46 @@ | |||
3 | * | 3 | * |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef _RTLX_H | 6 | #ifndef __ASM_RTLX_H |
7 | #define _RTLX_H_ | 7 | #define __ASM_RTLX_H_ |
8 | 8 | ||
9 | #define LX_NODE_BASE 10 | 9 | #define LX_NODE_BASE 10 |
10 | 10 | ||
11 | #define MIPSCPU_INT_BASE 16 | 11 | #define MIPSCPU_INT_BASE 16 |
12 | #define MIPS_CPU_RTLX_IRQ 0 | 12 | #define MIPS_CPU_RTLX_IRQ 0 |
13 | 13 | ||
14 | #define RTLX_VERSION 1 | 14 | #define RTLX_VERSION 2 |
15 | #define RTLX_xID 0x12345600 | 15 | #define RTLX_xID 0x12345600 |
16 | #define RTLX_ID (RTLX_xID | RTLX_VERSION) | 16 | #define RTLX_ID (RTLX_xID | RTLX_VERSION) |
17 | #define RTLX_CHANNELS 8 | 17 | #define RTLX_CHANNELS 8 |
18 | 18 | ||
19 | #define RTLX_BUFFER_SIZE 1024 | 19 | #define RTLX_CHANNEL_STDIO 0 |
20 | #define RTLX_CHANNEL_DBG 1 | ||
21 | #define RTLX_CHANNEL_SYSIO 2 | ||
20 | 22 | ||
21 | /* | 23 | extern int rtlx_open(int index, int can_sleep); |
22 | * lx_state bits | 24 | extern int rtlx_release(int index); |
23 | */ | 25 | extern ssize_t rtlx_read(int index, void *buff, size_t count, int user); |
24 | #define RTLX_STATE_OPENED 1UL | 26 | extern ssize_t rtlx_write(int index, void *buffer, size_t count, int user); |
27 | extern unsigned int rtlx_read_poll(int index, int can_sleep); | ||
28 | extern unsigned int rtlx_write_poll(int index); | ||
29 | |||
30 | enum rtlx_state { | ||
31 | RTLX_STATE_UNUSED, | ||
32 | RTLX_STATE_INITIALISED, | ||
33 | RTLX_STATE_REMOTE_READY, | ||
34 | RTLX_STATE_OPENED | ||
35 | }; | ||
36 | |||
37 | #define RTLX_BUFFER_SIZE 1024 | ||
25 | 38 | ||
26 | /* each channel supports read and write. | 39 | /* each channel supports read and write. |
27 | linux (vpe0) reads lx_buffer and writes rt_buffer | 40 | linux (vpe0) reads lx_buffer and writes rt_buffer |
28 | SP (vpe1) reads rt_buffer and writes lx_buffer | 41 | SP (vpe1) reads rt_buffer and writes lx_buffer |
29 | */ | 42 | */ |
30 | struct rtlx_channel { | 43 | struct rtlx_channel { |
31 | unsigned long lx_state; | 44 | enum rtlx_state rt_state; |
45 | enum rtlx_state lx_state; | ||
32 | 46 | ||
33 | int buffer_size; | 47 | int buffer_size; |
34 | 48 | ||
@@ -38,15 +52,13 @@ struct rtlx_channel { | |||
38 | 52 | ||
39 | int lx_write, lx_read; | 53 | int lx_write, lx_read; |
40 | char *lx_buffer; | 54 | char *lx_buffer; |
41 | |||
42 | void *queues; | ||
43 | |||
44 | }; | 55 | }; |
45 | 56 | ||
46 | struct rtlx_info { | 57 | struct rtlx_info { |
47 | unsigned long id; | 58 | unsigned long id; |
59 | enum rtlx_state state; | ||
48 | 60 | ||
49 | struct rtlx_channel channel[RTLX_CHANNELS]; | 61 | struct rtlx_channel channel[RTLX_CHANNELS]; |
50 | }; | 62 | }; |
51 | 63 | ||
52 | #endif /* _RTLX_H_ */ | 64 | #endif /* __ASM_RTLX_H_ */ |
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h index 7b23664122..7196ceb0e9 100644 --- a/include/asm-mips/serial.h +++ b/include/asm-mips/serial.h | |||
@@ -77,15 +77,15 @@ | |||
77 | #include <asm/it8712.h> | 77 | #include <asm/it8712.h> |
78 | #define ITE_SERIAL_PORT_DEFNS \ | 78 | #define ITE_SERIAL_PORT_DEFNS \ |
79 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \ | 79 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \ |
80 | .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, \ | 80 | .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \ |
81 | { .baud_base = (24000000/(16*13)), .port = (IT8172_PCI_IO_BASE + IT8712_UART1_PORT), \ | 81 | { .baud_base = (24000000/(16*13)), .port = (IT8172_PCI_IO_BASE + IT8712_UART1_PORT), \ |
82 | .irq = IT8172_SERIRQ_4, .flags = STD_COM_FLAGS, .type = 0x3 }, \ | 82 | .irq = IT8172_SERIRQ_4, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \ |
83 | /* Smart Card Reader 0 */ \ | 83 | /* Smart Card Reader 0 */ \ |
84 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR0_BASE), \ | 84 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR0_BASE), \ |
85 | .irq = IT8172_SCR0_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, \ | 85 | .irq = IT8172_SCR0_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \ |
86 | /* Smart Card Reader 1 */ \ | 86 | /* Smart Card Reader 1 */ \ |
87 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \ | 87 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \ |
88 | .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, | 88 | .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, |
89 | #else | 89 | #else |
90 | #define ITE_SERIAL_PORT_DEFNS | 90 | #define ITE_SERIAL_PORT_DEFNS |
91 | #endif | 91 | #endif |
@@ -95,10 +95,10 @@ | |||
95 | #include <asm/it8172/it8172_int.h> | 95 | #include <asm/it8172/it8172_int.h> |
96 | #define IVR_SERIAL_PORT_DEFNS \ | 96 | #define IVR_SERIAL_PORT_DEFNS \ |
97 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \ | 97 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_UART_BASE), \ |
98 | .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, \ | 98 | .irq = IT8172_UART_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, \ |
99 | /* Smart Card Reader 1 */ \ | 99 | /* Smart Card Reader 1 */ \ |
100 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \ | 100 | { .baud_base = BASE_BAUD, .port = (IT8172_PCI_IO_BASE + IT_SCR1_BASE), \ |
101 | .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .type = 0x3 }, | 101 | .irq = IT8172_SCR1_IRQ, .flags = STD_COM_FLAGS, .port = PORT_16550 }, |
102 | #else | 102 | #else |
103 | #define IVR_SERIAL_PORT_DEFNS | 103 | #define IVR_SERIAL_PORT_DEFNS |
104 | #endif | 104 | #endif |
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h index 8edabb0be2..cefa657dd0 100644 --- a/include/asm-mips/sigcontext.h +++ b/include/asm-mips/sigcontext.h | |||
@@ -55,8 +55,14 @@ struct sigcontext { | |||
55 | struct sigcontext { | 55 | struct sigcontext { |
56 | unsigned long sc_regs[32]; | 56 | unsigned long sc_regs[32]; |
57 | unsigned long sc_fpregs[32]; | 57 | unsigned long sc_fpregs[32]; |
58 | unsigned long sc_hi[4]; | 58 | unsigned long sc_mdhi; |
59 | unsigned long sc_lo[4]; | 59 | unsigned long sc_hi1; |
60 | unsigned long sc_hi2; | ||
61 | unsigned long sc_hi3; | ||
62 | unsigned long sc_mdlo; | ||
63 | unsigned long sc_lo1; | ||
64 | unsigned long sc_lo2; | ||
65 | unsigned long sc_lo3; | ||
60 | unsigned long sc_pc; | 66 | unsigned long sc_pc; |
61 | unsigned int sc_fpc_csr; | 67 | unsigned int sc_fpc_csr; |
62 | unsigned int sc_used_math; | 68 | unsigned int sc_used_math; |
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h index 75c6fe7c21..e14e4b69de 100644 --- a/include/asm-mips/smp.h +++ b/include/asm-mips/smp.h | |||
@@ -48,7 +48,6 @@ extern struct call_data_struct *call_data; | |||
48 | #define SMP_CALL_FUNCTION 0x2 | 48 | #define SMP_CALL_FUNCTION 0x2 |
49 | 49 | ||
50 | extern cpumask_t phys_cpu_present_map; | 50 | extern cpumask_t phys_cpu_present_map; |
51 | extern cpumask_t cpu_online_map; | ||
52 | #define cpu_possible_map phys_cpu_present_map | 51 | #define cpu_possible_map phys_cpu_present_map |
53 | 52 | ||
54 | extern cpumask_t cpu_callout_map; | 53 | extern cpumask_t cpu_callout_map; |
@@ -86,9 +85,9 @@ extern void prom_init_secondary(void); | |||
86 | extern void plat_smp_setup(void); | 85 | extern void plat_smp_setup(void); |
87 | 86 | ||
88 | /* | 87 | /* |
89 | * Called after init_IRQ but before __cpu_up. | 88 | * Called in smp_prepare_cpus. |
90 | */ | 89 | */ |
91 | extern void prom_prepare_cpus(unsigned int max_cpus); | 90 | extern void plat_prepare_cpus(unsigned int max_cpus); |
92 | 91 | ||
93 | /* | 92 | /* |
94 | * Last chance for the board code to finish SMP initialization before | 93 | * Last chance for the board code to finish SMP initialization before |
diff --git a/include/asm-mips/smtc.h b/include/asm-mips/smtc.h new file mode 100644 index 0000000000..e1941d1b87 --- /dev/null +++ b/include/asm-mips/smtc.h | |||
@@ -0,0 +1,55 @@ | |||
1 | #ifndef _ASM_SMTC_MT_H | ||
2 | #define _ASM_SMTC_MT_H | ||
3 | |||
4 | /* | ||
5 | * Definitions for SMTC multitasking on MIPS MT cores | ||
6 | */ | ||
7 | |||
8 | #include <asm/mips_mt.h> | ||
9 | |||
10 | /* | ||
11 | * System-wide SMTC status information | ||
12 | */ | ||
13 | |||
14 | extern unsigned int smtc_status; | ||
15 | |||
16 | #define SMTC_TLB_SHARED 0x00000001 | ||
17 | #define SMTC_MTC_ACTIVE 0x00000002 | ||
18 | |||
19 | /* | ||
20 | * TLB/ASID Management information | ||
21 | */ | ||
22 | |||
23 | #define MAX_SMTC_TLBS 2 | ||
24 | #define MAX_SMTC_ASIDS 256 | ||
25 | #if NR_CPUS <= 8 | ||
26 | typedef char asiduse; | ||
27 | #else | ||
28 | #if NR_CPUS <= 16 | ||
29 | typedef short asiduse; | ||
30 | #else | ||
31 | typedef long asiduse; | ||
32 | #endif | ||
33 | #endif | ||
34 | |||
35 | extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS]; | ||
36 | |||
37 | void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu); | ||
38 | |||
39 | void smtc_flush_tlb_asid(unsigned long asid); | ||
40 | extern int mipsmt_build_cpu_map(int startslot); | ||
41 | extern void mipsmt_prepare_cpus(void); | ||
42 | extern void smtc_smp_finish(void); | ||
43 | extern void smtc_boot_secondary(int cpu, struct task_struct *t); | ||
44 | |||
45 | /* | ||
46 | * Sharing the TLB between multiple VPEs means that the | ||
47 | * "random" index selection function is not allowed to | ||
48 | * select the current value of the Index register. To | ||
49 | * avoid additional TLB pressure, the Index registers | ||
50 | * are "parked" with an non-Valid value. | ||
51 | */ | ||
52 | |||
53 | #define PARKED_INDEX ((unsigned int)0x80000000) | ||
54 | |||
55 | #endif /* _ASM_SMTC_MT_H */ | ||
diff --git a/include/asm-mips/smtc_ipi.h b/include/asm-mips/smtc_ipi.h new file mode 100644 index 0000000000..f22c3e2f99 --- /dev/null +++ b/include/asm-mips/smtc_ipi.h | |||
@@ -0,0 +1,118 @@ | |||
1 | /* | ||
2 | * Definitions used in MIPS MT SMTC "Interprocessor Interrupt" code. | ||
3 | */ | ||
4 | #ifndef __ASM_SMTC_IPI_H | ||
5 | #define __ASM_SMTC_IPI_H | ||
6 | |||
7 | //#define SMTC_IPI_DEBUG | ||
8 | |||
9 | #ifdef SMTC_IPI_DEBUG | ||
10 | #include <asm/mipsregs.h> | ||
11 | #include <asm/mipsmtregs.h> | ||
12 | #endif /* SMTC_IPI_DEBUG */ | ||
13 | |||
14 | /* | ||
15 | * An IPI "message" | ||
16 | */ | ||
17 | |||
18 | struct smtc_ipi { | ||
19 | struct smtc_ipi *flink; | ||
20 | int type; | ||
21 | void *arg; | ||
22 | int dest; | ||
23 | #ifdef SMTC_IPI_DEBUG | ||
24 | int sender; | ||
25 | long stamp; | ||
26 | #endif /* SMTC_IPI_DEBUG */ | ||
27 | }; | ||
28 | |||
29 | /* | ||
30 | * Defined IPI Types | ||
31 | */ | ||
32 | |||
33 | #define LINUX_SMP_IPI 1 | ||
34 | #define SMTC_CLOCK_TICK 2 | ||
35 | |||
36 | /* | ||
37 | * A queue of IPI messages | ||
38 | */ | ||
39 | |||
40 | struct smtc_ipi_q { | ||
41 | struct smtc_ipi *head; | ||
42 | spinlock_t lock; | ||
43 | struct smtc_ipi *tail; | ||
44 | int depth; | ||
45 | }; | ||
46 | |||
47 | extern struct smtc_ipi_q IPIQ[NR_CPUS]; | ||
48 | extern struct smtc_ipi_q freeIPIq; | ||
49 | |||
50 | static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p) | ||
51 | { | ||
52 | long flags; | ||
53 | |||
54 | spin_lock_irqsave(&q->lock, flags); | ||
55 | if (q->head == NULL) | ||
56 | q->head = q->tail = p; | ||
57 | else | ||
58 | q->tail->flink = p; | ||
59 | p->flink = NULL; | ||
60 | q->tail = p; | ||
61 | q->depth++; | ||
62 | #ifdef SMTC_IPI_DEBUG | ||
63 | p->sender = read_c0_tcbind(); | ||
64 | p->stamp = read_c0_count(); | ||
65 | #endif /* SMTC_IPI_DEBUG */ | ||
66 | spin_unlock_irqrestore(&q->lock, flags); | ||
67 | } | ||
68 | |||
69 | static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q) | ||
70 | { | ||
71 | struct smtc_ipi *p; | ||
72 | long flags; | ||
73 | |||
74 | spin_lock_irqsave(&q->lock, flags); | ||
75 | if (q->head == NULL) | ||
76 | p = NULL; | ||
77 | else { | ||
78 | p = q->head; | ||
79 | q->head = q->head->flink; | ||
80 | q->depth--; | ||
81 | /* Arguably unnecessary, but leaves queue cleaner */ | ||
82 | if (q->head == NULL) | ||
83 | q->tail = NULL; | ||
84 | } | ||
85 | spin_unlock_irqrestore(&q->lock, flags); | ||
86 | return p; | ||
87 | } | ||
88 | |||
89 | static inline void smtc_ipi_req(struct smtc_ipi_q *q, struct smtc_ipi *p) | ||
90 | { | ||
91 | long flags; | ||
92 | |||
93 | spin_lock_irqsave(&q->lock, flags); | ||
94 | if (q->head == NULL) { | ||
95 | q->head = q->tail = p; | ||
96 | p->flink = NULL; | ||
97 | } else { | ||
98 | p->flink = q->head; | ||
99 | q->head = p; | ||
100 | } | ||
101 | q->depth++; | ||
102 | spin_unlock_irqrestore(&q->lock, flags); | ||
103 | } | ||
104 | |||
105 | static inline int smtc_ipi_qdepth(struct smtc_ipi_q *q) | ||
106 | { | ||
107 | long flags; | ||
108 | int retval; | ||
109 | |||
110 | spin_lock_irqsave(&q->lock, flags); | ||
111 | retval = q->depth; | ||
112 | spin_unlock_irqrestore(&q->lock, flags); | ||
113 | return retval; | ||
114 | } | ||
115 | |||
116 | extern void smtc_send_ipi(int cpu, int type, unsigned int action); | ||
117 | |||
118 | #endif /* __ASM_SMTC_IPI_H */ | ||
diff --git a/include/asm-mips/smtc_proc.h b/include/asm-mips/smtc_proc.h new file mode 100644 index 0000000000..25da651f1f --- /dev/null +++ b/include/asm-mips/smtc_proc.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Definitions for SMTC /proc entries | ||
3 | * Copyright(C) 2005 MIPS Technologies Inc. | ||
4 | */ | ||
5 | #ifndef __ASM_SMTC_PROC_H | ||
6 | #define __ASM_SMTC_PROC_H | ||
7 | |||
8 | /* | ||
9 | * per-"CPU" statistics | ||
10 | */ | ||
11 | |||
12 | struct smtc_cpu_proc { | ||
13 | unsigned long timerints; | ||
14 | unsigned long selfipis; | ||
15 | }; | ||
16 | |||
17 | extern struct smtc_cpu_proc smtc_cpu_stats[NR_CPUS]; | ||
18 | |||
19 | /* Count of number of recoveries of "stolen" FPU access rights on 34K */ | ||
20 | |||
21 | extern atomic_t smtc_fpu_recoveries; | ||
22 | |||
23 | #endif /* __ASM_SMTC_PROC_H */ | ||
diff --git a/include/asm-mips/sparsemem.h b/include/asm-mips/sparsemem.h new file mode 100644 index 0000000000..795ac6c232 --- /dev/null +++ b/include/asm-mips/sparsemem.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _MIPS_SPARSEMEM_H | ||
2 | #define _MIPS_SPARSEMEM_H | ||
3 | #ifdef CONFIG_SPARSEMEM | ||
4 | |||
5 | /* | ||
6 | * SECTION_SIZE_BITS 2^N: how big each section will be | ||
7 | * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space | ||
8 | */ | ||
9 | #define SECTION_SIZE_BITS 28 | ||
10 | #define MAX_PHYSMEM_BITS 35 | ||
11 | |||
12 | #endif /* CONFIG_SPARSEMEM */ | ||
13 | #endif /* _MIPS_SPARSEMEM_H */ | ||
14 | |||
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index 2acf3e844f..c4856a8749 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h | |||
@@ -14,9 +14,14 @@ | |||
14 | #include <linux/threads.h> | 14 | #include <linux/threads.h> |
15 | 15 | ||
16 | #include <asm/asm.h> | 16 | #include <asm/asm.h> |
17 | #include <asm/asmmacro.h> | ||
17 | #include <asm/mipsregs.h> | 18 | #include <asm/mipsregs.h> |
18 | #include <asm/asm-offsets.h> | 19 | #include <asm/asm-offsets.h> |
19 | 20 | ||
21 | #ifdef CONFIG_MIPS_MT_SMTC | ||
22 | #include <asm/mipsmtregs.h> | ||
23 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
24 | |||
20 | .macro SAVE_AT | 25 | .macro SAVE_AT |
21 | .set push | 26 | .set push |
22 | .set noat | 27 | .set noat |
@@ -57,13 +62,30 @@ | |||
57 | #ifdef CONFIG_SMP | 62 | #ifdef CONFIG_SMP |
58 | .macro get_saved_sp /* SMP variation */ | 63 | .macro get_saved_sp /* SMP variation */ |
59 | #ifdef CONFIG_32BIT | 64 | #ifdef CONFIG_32BIT |
65 | #ifdef CONFIG_MIPS_MT_SMTC | ||
66 | .set mips32 | ||
67 | mfc0 k0, CP0_TCBIND; | ||
68 | .set mips0 | ||
69 | lui k1, %hi(kernelsp) | ||
70 | srl k0, k0, 19 | ||
71 | /* No need to shift down and up to clear bits 0-1 */ | ||
72 | #else | ||
60 | mfc0 k0, CP0_CONTEXT | 73 | mfc0 k0, CP0_CONTEXT |
61 | lui k1, %hi(kernelsp) | 74 | lui k1, %hi(kernelsp) |
62 | srl k0, k0, 23 | 75 | srl k0, k0, 23 |
76 | #endif | ||
63 | addu k1, k0 | 77 | addu k1, k0 |
64 | LONG_L k1, %lo(kernelsp)(k1) | 78 | LONG_L k1, %lo(kernelsp)(k1) |
65 | #endif | 79 | #endif |
66 | #ifdef CONFIG_64BIT | 80 | #ifdef CONFIG_64BIT |
81 | #ifdef CONFIG_MIPS_MT_SMTC | ||
82 | .set mips64 | ||
83 | mfc0 k0, CP0_TCBIND; | ||
84 | .set mips0 | ||
85 | lui k0, %highest(kernelsp) | ||
86 | dsrl k1, 19 | ||
87 | /* No need to shift down and up to clear bits 0-2 */ | ||
88 | #else | ||
67 | MFC0 k1, CP0_CONTEXT | 89 | MFC0 k1, CP0_CONTEXT |
68 | lui k0, %highest(kernelsp) | 90 | lui k0, %highest(kernelsp) |
69 | dsrl k1, 23 | 91 | dsrl k1, 23 |
@@ -71,20 +93,31 @@ | |||
71 | dsll k0, k0, 16 | 93 | dsll k0, k0, 16 |
72 | daddiu k0, %hi(kernelsp) | 94 | daddiu k0, %hi(kernelsp) |
73 | dsll k0, k0, 16 | 95 | dsll k0, k0, 16 |
96 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
74 | daddu k1, k1, k0 | 97 | daddu k1, k1, k0 |
75 | LONG_L k1, %lo(kernelsp)(k1) | 98 | LONG_L k1, %lo(kernelsp)(k1) |
76 | #endif | 99 | #endif /* CONFIG_64BIT */ |
77 | .endm | 100 | .endm |
78 | 101 | ||
79 | .macro set_saved_sp stackp temp temp2 | 102 | .macro set_saved_sp stackp temp temp2 |
80 | #ifdef CONFIG_32BIT | 103 | #ifdef CONFIG_32BIT |
104 | #ifdef CONFIG_MIPS_MT_SMTC | ||
105 | mfc0 \temp, CP0_TCBIND | ||
106 | srl \temp, 19 | ||
107 | #else | ||
81 | mfc0 \temp, CP0_CONTEXT | 108 | mfc0 \temp, CP0_CONTEXT |
82 | srl \temp, 23 | 109 | srl \temp, 23 |
83 | #endif | 110 | #endif |
111 | #endif | ||
84 | #ifdef CONFIG_64BIT | 112 | #ifdef CONFIG_64BIT |
113 | #ifdef CONFIG_MIPS_MT_SMTC | ||
114 | mfc0 \temp, CP0_TCBIND | ||
115 | dsrl \temp, 19 | ||
116 | #else | ||
85 | MFC0 \temp, CP0_CONTEXT | 117 | MFC0 \temp, CP0_CONTEXT |
86 | dsrl \temp, 23 | 118 | dsrl \temp, 23 |
87 | #endif | 119 | #endif |
120 | #endif | ||
88 | LONG_S \stackp, kernelsp(\temp) | 121 | LONG_S \stackp, kernelsp(\temp) |
89 | .endm | 122 | .endm |
90 | #else | 123 | #else |
@@ -122,10 +155,25 @@ | |||
122 | PTR_SUBU sp, k1, PT_SIZE | 155 | PTR_SUBU sp, k1, PT_SIZE |
123 | LONG_S k0, PT_R29(sp) | 156 | LONG_S k0, PT_R29(sp) |
124 | LONG_S $3, PT_R3(sp) | 157 | LONG_S $3, PT_R3(sp) |
158 | /* | ||
159 | * You might think that you don't need to save $0, | ||
160 | * but the FPU emulator and gdb remote debug stub | ||
161 | * need it to operate correctly | ||
162 | */ | ||
125 | LONG_S $0, PT_R0(sp) | 163 | LONG_S $0, PT_R0(sp) |
126 | mfc0 v1, CP0_STATUS | 164 | mfc0 v1, CP0_STATUS |
127 | LONG_S $2, PT_R2(sp) | 165 | LONG_S $2, PT_R2(sp) |
128 | LONG_S v1, PT_STATUS(sp) | 166 | LONG_S v1, PT_STATUS(sp) |
167 | #ifdef CONFIG_MIPS_MT_SMTC | ||
168 | /* | ||
169 | * Ideally, these instructions would be shuffled in | ||
170 | * to cover the pipeline delay. | ||
171 | */ | ||
172 | .set mips32 | ||
173 | mfc0 v1, CP0_TCSTATUS | ||
174 | .set mips0 | ||
175 | LONG_S v1, PT_TCSTATUS(sp) | ||
176 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
129 | LONG_S $4, PT_R4(sp) | 177 | LONG_S $4, PT_R4(sp) |
130 | mfc0 v1, CP0_CAUSE | 178 | mfc0 v1, CP0_CAUSE |
131 | LONG_S $5, PT_R5(sp) | 179 | LONG_S $5, PT_R5(sp) |
@@ -234,14 +282,36 @@ | |||
234 | .endm | 282 | .endm |
235 | 283 | ||
236 | #else | 284 | #else |
285 | /* | ||
286 | * For SMTC kernel, global IE should be left set, and interrupts | ||
287 | * controlled exclusively via IXMT. | ||
288 | */ | ||
237 | 289 | ||
290 | #ifdef CONFIG_MIPS_MT_SMTC | ||
291 | #define STATMASK 0x1e | ||
292 | #else | ||
293 | #define STATMASK 0x1f | ||
294 | #endif | ||
238 | .macro RESTORE_SOME | 295 | .macro RESTORE_SOME |
239 | .set push | 296 | .set push |
240 | .set reorder | 297 | .set reorder |
241 | .set noat | 298 | .set noat |
299 | #ifdef CONFIG_MIPS_MT_SMTC | ||
300 | .set mips32r2 | ||
301 | /* | ||
302 | * This may not really be necessary if ints are already | ||
303 | * inhibited here. | ||
304 | */ | ||
305 | mfc0 v0, CP0_TCSTATUS | ||
306 | ori v0, TCSTATUS_IXMT | ||
307 | mtc0 v0, CP0_TCSTATUS | ||
308 | ehb | ||
309 | DMT 5 # dmt a1 | ||
310 | jal mips_ihb | ||
311 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
242 | mfc0 a0, CP0_STATUS | 312 | mfc0 a0, CP0_STATUS |
243 | ori a0, 0x1f | 313 | ori a0, STATMASK |
244 | xori a0, 0x1f | 314 | xori a0, STATMASK |
245 | mtc0 a0, CP0_STATUS | 315 | mtc0 a0, CP0_STATUS |
246 | li v1, 0xff00 | 316 | li v1, 0xff00 |
247 | and a0, v1 | 317 | and a0, v1 |
@@ -250,6 +320,26 @@ | |||
250 | and v0, v1 | 320 | and v0, v1 |
251 | or v0, a0 | 321 | or v0, a0 |
252 | mtc0 v0, CP0_STATUS | 322 | mtc0 v0, CP0_STATUS |
323 | #ifdef CONFIG_MIPS_MT_SMTC | ||
324 | /* | ||
325 | * Only after EXL/ERL have been restored to status can we | ||
326 | * restore TCStatus.IXMT. | ||
327 | */ | ||
328 | LONG_L v1, PT_TCSTATUS(sp) | ||
329 | ehb | ||
330 | mfc0 v0, CP0_TCSTATUS | ||
331 | andi v1, TCSTATUS_IXMT | ||
332 | /* We know that TCStatua.IXMT should be set from above */ | ||
333 | xori v0, v0, TCSTATUS_IXMT | ||
334 | or v0, v0, v1 | ||
335 | mtc0 v0, CP0_TCSTATUS | ||
336 | ehb | ||
337 | andi a1, a1, VPECONTROL_TE | ||
338 | beqz a1, 1f | ||
339 | emt | ||
340 | 1: | ||
341 | .set mips0 | ||
342 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
253 | LONG_L v1, PT_EPC(sp) | 343 | LONG_L v1, PT_EPC(sp) |
254 | MTC0 v1, CP0_EPC | 344 | MTC0 v1, CP0_EPC |
255 | LONG_L $31, PT_R31(sp) | 345 | LONG_L $31, PT_R31(sp) |
@@ -302,11 +392,33 @@ | |||
302 | * Set cp0 enable bit as sign that we're running on the kernel stack | 392 | * Set cp0 enable bit as sign that we're running on the kernel stack |
303 | */ | 393 | */ |
304 | .macro CLI | 394 | .macro CLI |
395 | #if !defined(CONFIG_MIPS_MT_SMTC) | ||
305 | mfc0 t0, CP0_STATUS | 396 | mfc0 t0, CP0_STATUS |
306 | li t1, ST0_CU0 | 0x1f | 397 | li t1, ST0_CU0 | 0x1f |
307 | or t0, t1 | 398 | or t0, t1 |
308 | xori t0, 0x1f | 399 | xori t0, 0x1f |
309 | mtc0 t0, CP0_STATUS | 400 | mtc0 t0, CP0_STATUS |
401 | #else /* CONFIG_MIPS_MT_SMTC */ | ||
402 | /* | ||
403 | * For SMTC, we need to set privilege | ||
404 | * and disable interrupts only for the | ||
405 | * current TC, using the TCStatus register. | ||
406 | */ | ||
407 | mfc0 t0,CP0_TCSTATUS | ||
408 | /* Fortunately CU 0 is in the same place in both registers */ | ||
409 | /* Set TCU0, TMX, TKSU (for later inversion) and IXMT */ | ||
410 | li t1, ST0_CU0 | 0x08001c00 | ||
411 | or t0,t1 | ||
412 | /* Clear TKSU, leave IXMT */ | ||
413 | xori t0, 0x00001800 | ||
414 | mtc0 t0, CP0_TCSTATUS | ||
415 | ehb | ||
416 | /* We need to leave the global IE bit set, but clear EXL...*/ | ||
417 | mfc0 t0, CP0_STATUS | ||
418 | ori t0, ST0_EXL | ST0_ERL | ||
419 | xori t0, ST0_EXL | ST0_ERL | ||
420 | mtc0 t0, CP0_STATUS | ||
421 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
310 | irq_disable_hazard | 422 | irq_disable_hazard |
311 | .endm | 423 | .endm |
312 | 424 | ||
@@ -315,11 +427,35 @@ | |||
315 | * Set cp0 enable bit as sign that we're running on the kernel stack | 427 | * Set cp0 enable bit as sign that we're running on the kernel stack |
316 | */ | 428 | */ |
317 | .macro STI | 429 | .macro STI |
430 | #if !defined(CONFIG_MIPS_MT_SMTC) | ||
318 | mfc0 t0, CP0_STATUS | 431 | mfc0 t0, CP0_STATUS |
319 | li t1, ST0_CU0 | 0x1f | 432 | li t1, ST0_CU0 | 0x1f |
320 | or t0, t1 | 433 | or t0, t1 |
321 | xori t0, 0x1e | 434 | xori t0, 0x1e |
322 | mtc0 t0, CP0_STATUS | 435 | mtc0 t0, CP0_STATUS |
436 | #else /* CONFIG_MIPS_MT_SMTC */ | ||
437 | /* | ||
438 | * For SMTC, we need to set privilege | ||
439 | * and enable interrupts only for the | ||
440 | * current TC, using the TCStatus register. | ||
441 | */ | ||
442 | ehb | ||
443 | mfc0 t0,CP0_TCSTATUS | ||
444 | /* Fortunately CU 0 is in the same place in both registers */ | ||
445 | /* Set TCU0, TKSU (for later inversion) and IXMT */ | ||
446 | li t1, ST0_CU0 | 0x08001c00 | ||
447 | or t0,t1 | ||
448 | /* Clear TKSU *and* IXMT */ | ||
449 | xori t0, 0x00001c00 | ||
450 | mtc0 t0, CP0_TCSTATUS | ||
451 | ehb | ||
452 | /* We need to leave the global IE bit set, but clear EXL...*/ | ||
453 | mfc0 t0, CP0_STATUS | ||
454 | ori t0, ST0_EXL | ||
455 | xori t0, ST0_EXL | ||
456 | mtc0 t0, CP0_STATUS | ||
457 | /* irq_enable_hazard below should expand to EHB for 24K/34K cpus */ | ||
458 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
323 | irq_enable_hazard | 459 | irq_enable_hazard |
324 | .endm | 460 | .endm |
325 | 461 | ||
@@ -328,11 +464,56 @@ | |||
328 | * Set cp0 enable bit as sign that we're running on the kernel stack | 464 | * Set cp0 enable bit as sign that we're running on the kernel stack |
329 | */ | 465 | */ |
330 | .macro KMODE | 466 | .macro KMODE |
467 | #ifdef CONFIG_MIPS_MT_SMTC | ||
468 | /* | ||
469 | * This gets baroque in SMTC. We want to | ||
470 | * protect the non-atomic clearing of EXL | ||
471 | * with DMT/EMT, but we don't want to take | ||
472 | * an interrupt while DMT is still in effect. | ||
473 | */ | ||
474 | |||
475 | /* KMODE gets invoked from both reorder and noreorder code */ | ||
476 | .set push | ||
477 | .set mips32r2 | ||
478 | .set noreorder | ||
479 | mfc0 v0, CP0_TCSTATUS | ||
480 | andi v1, v0, TCSTATUS_IXMT | ||
481 | ori v0, TCSTATUS_IXMT | ||
482 | mtc0 v0, CP0_TCSTATUS | ||
483 | ehb | ||
484 | DMT 2 # dmt v0 | ||
485 | /* | ||
486 | * We don't know a priori if ra is "live" | ||
487 | */ | ||
488 | move t0, ra | ||
489 | jal mips_ihb | ||
490 | nop /* delay slot */ | ||
491 | move ra, t0 | ||
492 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
331 | mfc0 t0, CP0_STATUS | 493 | mfc0 t0, CP0_STATUS |
332 | li t1, ST0_CU0 | 0x1e | 494 | li t1, ST0_CU0 | 0x1e |
333 | or t0, t1 | 495 | or t0, t1 |
334 | xori t0, 0x1e | 496 | xori t0, 0x1e |
335 | mtc0 t0, CP0_STATUS | 497 | mtc0 t0, CP0_STATUS |
498 | #ifdef CONFIG_MIPS_MT_SMTC | ||
499 | ehb | ||
500 | andi v0, v0, VPECONTROL_TE | ||
501 | beqz v0, 2f | ||
502 | nop /* delay slot */ | ||
503 | emt | ||
504 | 2: | ||
505 | mfc0 v0, CP0_TCSTATUS | ||
506 | /* Clear IXMT, then OR in previous value */ | ||
507 | ori v0, TCSTATUS_IXMT | ||
508 | xori v0, TCSTATUS_IXMT | ||
509 | or v0, v1, v0 | ||
510 | mtc0 v0, CP0_TCSTATUS | ||
511 | /* | ||
512 | * irq_disable_hazard below should expand to EHB | ||
513 | * on 24K/34K CPUS | ||
514 | */ | ||
515 | .set pop | ||
516 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
336 | irq_disable_hazard | 517 | irq_disable_hazard |
337 | .endm | 518 | .endm |
338 | 519 | ||
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 4097fac5ac..261f71d16a 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -155,6 +155,37 @@ extern asmlinkage void *resume(void *last, void *next, void *next_ti); | |||
155 | 155 | ||
156 | struct task_struct; | 156 | struct task_struct; |
157 | 157 | ||
158 | #ifdef CONFIG_MIPS_MT_FPAFF | ||
159 | |||
160 | /* | ||
161 | * Handle the scheduler resume end of FPU affinity management. We do this | ||
162 | * inline to try to keep the overhead down. If we have been forced to run on | ||
163 | * a "CPU" with an FPU because of a previous high level of FP computation, | ||
164 | * but did not actually use the FPU during the most recent time-slice (CU1 | ||
165 | * isn't set), we undo the restriction on cpus_allowed. | ||
166 | * | ||
167 | * We're not calling set_cpus_allowed() here, because we have no need to | ||
168 | * force prompt migration - we're already switching the current CPU to a | ||
169 | * different thread. | ||
170 | */ | ||
171 | |||
172 | #define switch_to(prev,next,last) \ | ||
173 | do { \ | ||
174 | if (cpu_has_fpu && \ | ||
175 | (prev->thread.mflags & MF_FPUBOUND) && \ | ||
176 | (!(KSTK_STATUS(prev) & ST0_CU1))) { \ | ||
177 | prev->thread.mflags &= ~MF_FPUBOUND; \ | ||
178 | prev->cpus_allowed = prev->thread.user_cpus_allowed; \ | ||
179 | } \ | ||
180 | if (cpu_has_dsp) \ | ||
181 | __save_dsp(prev); \ | ||
182 | next->thread.emulated_fp = 0; \ | ||
183 | (last) = resume(prev, next, next->thread_info); \ | ||
184 | if (cpu_has_dsp) \ | ||
185 | __restore_dsp(current); \ | ||
186 | } while(0) | ||
187 | |||
188 | #else | ||
158 | #define switch_to(prev,next,last) \ | 189 | #define switch_to(prev,next,last) \ |
159 | do { \ | 190 | do { \ |
160 | if (cpu_has_dsp) \ | 191 | if (cpu_has_dsp) \ |
@@ -163,6 +194,7 @@ do { \ | |||
163 | if (cpu_has_dsp) \ | 194 | if (cpu_has_dsp) \ |
164 | __restore_dsp(current); \ | 195 | __restore_dsp(current); \ |
165 | } while(0) | 196 | } while(0) |
197 | #endif | ||
166 | 198 | ||
167 | /* | 199 | /* |
168 | * On SMP systems, when the scheduler does migration-cost autodetection, | 200 | * On SMP systems, when the scheduler does migration-cost autodetection, |
@@ -440,8 +472,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old, | |||
440 | extern void set_handler (unsigned long offset, void *addr, unsigned long len); | 472 | extern void set_handler (unsigned long offset, void *addr, unsigned long len); |
441 | extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len); | 473 | extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len); |
442 | extern void *set_vi_handler (int n, void *addr); | 474 | extern void *set_vi_handler (int n, void *addr); |
443 | extern void *set_vi_srs_handler (int n, void *addr, int regset); | ||
444 | extern void *set_except_vector(int n, void *addr); | 475 | extern void *set_except_vector(int n, void *addr); |
476 | extern unsigned long ebase; | ||
445 | extern void per_cpu_trap_init(void); | 477 | extern void per_cpu_trap_init(void); |
446 | 478 | ||
447 | extern NORET_TYPE void die(const char *, struct pt_regs *); | 479 | extern NORET_TYPE void die(const char *, struct pt_regs *); |
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index b5c78a4a01..1068fe9a0a 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h | |||
@@ -324,16 +324,18 @@ | |||
324 | #define __NR_pselect6 (__NR_Linux + 301) | 324 | #define __NR_pselect6 (__NR_Linux + 301) |
325 | #define __NR_ppoll (__NR_Linux + 302) | 325 | #define __NR_ppoll (__NR_Linux + 302) |
326 | #define __NR_unshare (__NR_Linux + 303) | 326 | #define __NR_unshare (__NR_Linux + 303) |
327 | #define __NR_splice (__NR_Linux + 304) | ||
328 | #define __NR_sync_file_range (__NR_Linux + 305) | ||
327 | 329 | ||
328 | /* | 330 | /* |
329 | * Offset of the last Linux o32 flavoured syscall | 331 | * Offset of the last Linux o32 flavoured syscall |
330 | */ | 332 | */ |
331 | #define __NR_Linux_syscalls 303 | 333 | #define __NR_Linux_syscalls 305 |
332 | 334 | ||
333 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 335 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
334 | 336 | ||
335 | #define __NR_O32_Linux 4000 | 337 | #define __NR_O32_Linux 4000 |
336 | #define __NR_O32_Linux_syscalls 303 | 338 | #define __NR_O32_Linux_syscalls 305 |
337 | 339 | ||
338 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 340 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
339 | 341 | ||
@@ -604,16 +606,18 @@ | |||
604 | #define __NR_pselect6 (__NR_Linux + 260) | 606 | #define __NR_pselect6 (__NR_Linux + 260) |
605 | #define __NR_ppoll (__NR_Linux + 261) | 607 | #define __NR_ppoll (__NR_Linux + 261) |
606 | #define __NR_unshare (__NR_Linux + 262) | 608 | #define __NR_unshare (__NR_Linux + 262) |
609 | #define __NR_splice (__NR_Linux + 263) | ||
610 | #define __NR_sync_file_range (__NR_Linux + 264) | ||
607 | 611 | ||
608 | /* | 612 | /* |
609 | * Offset of the last Linux 64-bit flavoured syscall | 613 | * Offset of the last Linux 64-bit flavoured syscall |
610 | */ | 614 | */ |
611 | #define __NR_Linux_syscalls 262 | 615 | #define __NR_Linux_syscalls 264 |
612 | 616 | ||
613 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 617 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
614 | 618 | ||
615 | #define __NR_64_Linux 5000 | 619 | #define __NR_64_Linux 5000 |
616 | #define __NR_64_Linux_syscalls 262 | 620 | #define __NR_64_Linux_syscalls 264 |
617 | 621 | ||
618 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 622 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
619 | 623 | ||
@@ -888,16 +892,18 @@ | |||
888 | #define __NR_pselect6 (__NR_Linux + 264) | 892 | #define __NR_pselect6 (__NR_Linux + 264) |
889 | #define __NR_ppoll (__NR_Linux + 265) | 893 | #define __NR_ppoll (__NR_Linux + 265) |
890 | #define __NR_unshare (__NR_Linux + 266) | 894 | #define __NR_unshare (__NR_Linux + 266) |
895 | #define __NR_splice (__NR_Linux + 267) | ||
896 | #define __NR_sync_file_range (__NR_Linux + 268) | ||
891 | 897 | ||
892 | /* | 898 | /* |
893 | * Offset of the last N32 flavoured syscall | 899 | * Offset of the last N32 flavoured syscall |
894 | */ | 900 | */ |
895 | #define __NR_Linux_syscalls 266 | 901 | #define __NR_Linux_syscalls 268 |
896 | 902 | ||
897 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 903 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
898 | 904 | ||
899 | #define __NR_N32_Linux 6000 | 905 | #define __NR_N32_Linux 6000 |
900 | #define __NR_N32_Linux_syscalls 266 | 906 | #define __NR_N32_Linux_syscalls 268 |
901 | 907 | ||
902 | #ifndef __ASSEMBLY__ | 908 | #ifndef __ASSEMBLY__ |
903 | 909 | ||
diff --git a/include/asm-mips/vpe.h b/include/asm-mips/vpe.h new file mode 100644 index 0000000000..c6e1b96153 --- /dev/null +++ b/include/asm-mips/vpe.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can distribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License (Version 2) as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
11 | * for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef _ASM_VPE_H | ||
20 | #define _ASM_VPE_H | ||
21 | |||
22 | struct vpe_notifications { | ||
23 | void (*start)(int vpe); | ||
24 | void (*stop)(int vpe); | ||
25 | |||
26 | struct list_head list; | ||
27 | }; | ||
28 | |||
29 | |||
30 | extern int vpe_notify(int index, struct vpe_notifications *notify); | ||
31 | |||
32 | extern void *vpe_get_shared(int index); | ||
33 | extern int vpe_getuid(int index); | ||
34 | extern int vpe_getgid(int index); | ||
35 | extern char *vpe_getcwd(int index); | ||
36 | |||
37 | #endif /* _ASM_VPE_H */ | ||
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h index 29da31194b..244f6b8883 100644 --- a/include/asm-parisc/io.h +++ b/include/asm-parisc/io.h | |||
@@ -126,24 +126,17 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr) | |||
126 | 126 | ||
127 | extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); | 127 | extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); |
128 | 128 | ||
129 | extern inline void __iomem * ioremap(unsigned long offset, unsigned long size) | 129 | /* Most machines react poorly to I/O-space being cacheable... Instead let's |
130 | { | 130 | * define ioremap() in terms of ioremap_nocache(). |
131 | return __ioremap(offset, size, 0); | ||
132 | } | ||
133 | |||
134 | /* | ||
135 | * This one maps high address device memory and turns off caching for that area. | ||
136 | * it's useful if some control registers are in such an area and write combining | ||
137 | * or read caching is not desirable: | ||
138 | */ | 131 | */ |
139 | extern inline void * ioremap_nocache(unsigned long offset, unsigned long size) | 132 | extern inline void __iomem * ioremap(unsigned long offset, unsigned long size) |
140 | { | 133 | { |
141 | return __ioremap(offset, size, _PAGE_NO_CACHE /* _PAGE_PCD */); | 134 | return __ioremap(offset, size, _PAGE_NO_CACHE); |
142 | } | 135 | } |
136 | #define ioremap_nocache(off, sz) ioremap((off), (sz)) | ||
143 | 137 | ||
144 | extern void iounmap(void __iomem *addr); | 138 | extern void iounmap(void __iomem *addr); |
145 | 139 | ||
146 | |||
147 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) | 140 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) |
148 | { | 141 | { |
149 | return (*(volatile unsigned char __force *) (addr)); | 142 | return (*(volatile unsigned char __force *) (addr)); |
diff --git a/include/asm-parisc/numnodes.h b/include/asm-parisc/numnodes.h deleted file mode 100644 index 6c67651efd..0000000000 --- a/include/asm-parisc/numnodes.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef _ASM_MAX_NUMNODES_H | ||
2 | #define _ASM_MAX_NUMNODES_H | ||
3 | |||
4 | /* Max 8 Nodes */ | ||
5 | #define NODES_SHIFT 3 | ||
6 | |||
7 | #endif /* _ASM_MAX_NUMNODES_H */ | ||
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h index 45e02aa5bf..c0dd461fb8 100644 --- a/include/asm-parisc/page.h +++ b/include/asm-parisc/page.h | |||
@@ -1,13 +1,30 @@ | |||
1 | #ifndef _PARISC_PAGE_H | 1 | #ifndef _PARISC_PAGE_H |
2 | #define _PARISC_PAGE_H | 2 | #define _PARISC_PAGE_H |
3 | 3 | ||
4 | /* PAGE_SHIFT determines the page size */ | 4 | #if !defined(__KERNEL__) |
5 | #define PAGE_SHIFT 12 | 5 | /* this is for userspace applications (4k page size) */ |
6 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 6 | # define PAGE_SHIFT 12 /* 4k */ |
7 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 7 | # define PAGE_SIZE (1UL << PAGE_SHIFT) |
8 | # define PAGE_MASK (~(PAGE_SIZE-1)) | ||
9 | #endif | ||
10 | |||
8 | 11 | ||
9 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
10 | #include <linux/config.h> | 13 | #include <linux/config.h> |
14 | |||
15 | #if defined(CONFIG_PARISC_PAGE_SIZE_4KB) | ||
16 | # define PAGE_SHIFT 12 /* 4k */ | ||
17 | #elif defined(CONFIG_PARISC_PAGE_SIZE_16KB) | ||
18 | # define PAGE_SHIFT 14 /* 16k */ | ||
19 | #elif defined(CONFIG_PARISC_PAGE_SIZE_64KB) | ||
20 | # define PAGE_SHIFT 16 /* 64k */ | ||
21 | #else | ||
22 | # error "unknown default kernel page size" | ||
23 | #endif | ||
24 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | ||
25 | #define PAGE_MASK (~(PAGE_SIZE-1)) | ||
26 | |||
27 | |||
11 | #ifndef __ASSEMBLY__ | 28 | #ifndef __ASSEMBLY__ |
12 | 29 | ||
13 | #include <asm/types.h> | 30 | #include <asm/types.h> |
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index 4e34c6b440..aec089eb8b 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h | |||
@@ -59,16 +59,15 @@ | |||
59 | #define ISTACK_SIZE 32768 /* Interrupt Stack Size */ | 59 | #define ISTACK_SIZE 32768 /* Interrupt Stack Size */ |
60 | #define ISTACK_ORDER 3 | 60 | #define ISTACK_ORDER 3 |
61 | 61 | ||
62 | /* This is the size of the initially mapped kernel memory (i.e. currently | 62 | /* This is the size of the initially mapped kernel memory */ |
63 | * 0 to 1<<23 == 8MB */ | ||
64 | #ifdef CONFIG_64BIT | 63 | #ifdef CONFIG_64BIT |
65 | #define KERNEL_INITIAL_ORDER 24 | 64 | #define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */ |
66 | #else | 65 | #else |
67 | #define KERNEL_INITIAL_ORDER 23 | 66 | #define KERNEL_INITIAL_ORDER 23 /* 0 to 1<<23 = 8MB */ |
68 | #endif | 67 | #endif |
69 | #define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) | 68 | #define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) |
70 | 69 | ||
71 | #ifdef CONFIG_64BIT | 70 | #if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB) |
72 | #define PT_NLEVELS 3 | 71 | #define PT_NLEVELS 3 |
73 | #define PGD_ORDER 1 /* Number of pages per pgd */ | 72 | #define PGD_ORDER 1 /* Number of pages per pgd */ |
74 | #define PMD_ORDER 1 /* Number of pages per pmd */ | 73 | #define PMD_ORDER 1 /* Number of pages per pmd */ |
@@ -111,11 +110,15 @@ | |||
111 | #define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD) | 110 | #define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD) |
112 | #define MAX_ADDRESS (1UL << MAX_ADDRBITS) | 111 | #define MAX_ADDRESS (1UL << MAX_ADDRBITS) |
113 | 112 | ||
114 | #define SPACEID_SHIFT (MAX_ADDRBITS - 32) | 113 | #define SPACEID_SHIFT (MAX_ADDRBITS - 32) |
115 | 114 | ||
116 | /* This calculates the number of initial pages we need for the initial | 115 | /* This calculates the number of initial pages we need for the initial |
117 | * page tables */ | 116 | * page tables */ |
118 | #define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT)) | 117 | #if (KERNEL_INITIAL_ORDER) >= (PMD_SHIFT) |
118 | # define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT)) | ||
119 | #else | ||
120 | # define PT_INITIAL (1) /* all initial PTEs fit into one page */ | ||
121 | #endif | ||
119 | 122 | ||
120 | /* | 123 | /* |
121 | * pgd entries used up by user/kernel: | 124 | * pgd entries used up by user/kernel: |
@@ -160,6 +163,10 @@ extern void *vmalloc_start; | |||
160 | * to zero */ | 163 | * to zero */ |
161 | #define PTE_SHIFT xlate_pabit(_PAGE_USER_BIT) | 164 | #define PTE_SHIFT xlate_pabit(_PAGE_USER_BIT) |
162 | 165 | ||
166 | /* PFN_PTE_SHIFT defines the shift of a PTE value to access the PFN field */ | ||
167 | #define PFN_PTE_SHIFT 12 | ||
168 | |||
169 | |||
163 | /* this is how many bits may be used by the file functions */ | 170 | /* this is how many bits may be used by the file functions */ |
164 | #define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_SHIFT) | 171 | #define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_SHIFT) |
165 | 172 | ||
@@ -188,7 +195,8 @@ extern void *vmalloc_start; | |||
188 | /* The pgd/pmd contains a ptr (in phys addr space); since all pgds/pmds | 195 | /* The pgd/pmd contains a ptr (in phys addr space); since all pgds/pmds |
189 | * are page-aligned, we don't care about the PAGE_OFFSET bits, except | 196 | * are page-aligned, we don't care about the PAGE_OFFSET bits, except |
190 | * for a few meta-information bits, so we shift the address to be | 197 | * for a few meta-information bits, so we shift the address to be |
191 | * able to effectively address 40-bits of physical address space. */ | 198 | * able to effectively address 40/42/44-bits of physical address space |
199 | * depending on 4k/16k/64k PAGE_SIZE */ | ||
192 | #define _PxD_PRESENT_BIT 31 | 200 | #define _PxD_PRESENT_BIT 31 |
193 | #define _PxD_ATTACHED_BIT 30 | 201 | #define _PxD_ATTACHED_BIT 30 |
194 | #define _PxD_VALID_BIT 29 | 202 | #define _PxD_VALID_BIT 29 |
@@ -198,7 +206,7 @@ extern void *vmalloc_start; | |||
198 | #define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT)) | 206 | #define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT)) |
199 | #define PxD_FLAG_MASK (0xf) | 207 | #define PxD_FLAG_MASK (0xf) |
200 | #define PxD_FLAG_SHIFT (4) | 208 | #define PxD_FLAG_SHIFT (4) |
201 | #define PxD_VALUE_SHIFT (8) | 209 | #define PxD_VALUE_SHIFT (8) /* (PAGE_SHIFT-PxD_FLAG_SHIFT) */ |
202 | 210 | ||
203 | #ifndef __ASSEMBLY__ | 211 | #ifndef __ASSEMBLY__ |
204 | 212 | ||
@@ -246,6 +254,7 @@ extern void *vmalloc_start; | |||
246 | #define __S110 PAGE_RWX | 254 | #define __S110 PAGE_RWX |
247 | #define __S111 PAGE_RWX | 255 | #define __S111 PAGE_RWX |
248 | 256 | ||
257 | |||
249 | extern pgd_t swapper_pg_dir[]; /* declared in init_task.c */ | 258 | extern pgd_t swapper_pg_dir[]; /* declared in init_task.c */ |
250 | 259 | ||
251 | /* initial page tables for 0-8MB for kernel */ | 260 | /* initial page tables for 0-8MB for kernel */ |
@@ -272,7 +281,7 @@ extern unsigned long *empty_zero_page; | |||
272 | #define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK) | 281 | #define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK) |
273 | #define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT) | 282 | #define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT) |
274 | 283 | ||
275 | #ifdef CONFIG_64BIT | 284 | #if PT_NLEVELS == 3 |
276 | /* The first entry of the permanent pmd is not there if it contains | 285 | /* The first entry of the permanent pmd is not there if it contains |
277 | * the gateway marker */ | 286 | * the gateway marker */ |
278 | #define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED) | 287 | #define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED) |
@@ -282,7 +291,7 @@ extern unsigned long *empty_zero_page; | |||
282 | #define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID)) | 291 | #define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID)) |
283 | #define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT) | 292 | #define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT) |
284 | static inline void pmd_clear(pmd_t *pmd) { | 293 | static inline void pmd_clear(pmd_t *pmd) { |
285 | #ifdef CONFIG_64BIT | 294 | #if PT_NLEVELS == 3 |
286 | if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED) | 295 | if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED) |
287 | /* This is the entry pointing to the permanent pmd | 296 | /* This is the entry pointing to the permanent pmd |
288 | * attached to the pgd; cannot clear it */ | 297 | * attached to the pgd; cannot clear it */ |
@@ -303,7 +312,7 @@ static inline void pmd_clear(pmd_t *pmd) { | |||
303 | #define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID)) | 312 | #define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID)) |
304 | #define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT) | 313 | #define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT) |
305 | static inline void pgd_clear(pgd_t *pgd) { | 314 | static inline void pgd_clear(pgd_t *pgd) { |
306 | #ifdef CONFIG_64BIT | 315 | #if PT_NLEVELS == 3 |
307 | if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED) | 316 | if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED) |
308 | /* This is the permanent pmd attached to the pgd; cannot | 317 | /* This is the permanent pmd attached to the pgd; cannot |
309 | * free it */ | 318 | * free it */ |
@@ -351,7 +360,7 @@ extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return | |||
351 | ({ \ | 360 | ({ \ |
352 | pte_t __pte; \ | 361 | pte_t __pte; \ |
353 | \ | 362 | \ |
354 | pte_val(__pte) = ((addr)+pgprot_val(pgprot)); \ | 363 | pte_val(__pte) = ((((addr)>>PAGE_SHIFT)<<PFN_PTE_SHIFT) + pgprot_val(pgprot)); \ |
355 | \ | 364 | \ |
356 | __pte; \ | 365 | __pte; \ |
357 | }) | 366 | }) |
@@ -361,20 +370,16 @@ extern inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_WRITE; return | |||
361 | static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) | 370 | static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) |
362 | { | 371 | { |
363 | pte_t pte; | 372 | pte_t pte; |
364 | pte_val(pte) = (pfn << PAGE_SHIFT) | pgprot_val(pgprot); | 373 | pte_val(pte) = (pfn << PFN_PTE_SHIFT) | pgprot_val(pgprot); |
365 | return pte; | 374 | return pte; |
366 | } | 375 | } |
367 | 376 | ||
368 | /* This takes a physical page address that is used by the remapping functions */ | ||
369 | #define mk_pte_phys(physpage, pgprot) \ | ||
370 | ({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; }) | ||
371 | |||
372 | extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 377 | extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
373 | { pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; } | 378 | { pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; } |
374 | 379 | ||
375 | /* Permanent address of a page. On parisc we don't have highmem. */ | 380 | /* Permanent address of a page. On parisc we don't have highmem. */ |
376 | 381 | ||
377 | #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) | 382 | #define pte_pfn(x) (pte_val(x) >> PFN_PTE_SHIFT) |
378 | 383 | ||
379 | #define pte_page(pte) (pfn_to_page(pte_pfn(pte))) | 384 | #define pte_page(pte) (pfn_to_page(pte_pfn(pte))) |
380 | 385 | ||
@@ -499,6 +504,26 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
499 | 504 | ||
500 | #endif /* !__ASSEMBLY__ */ | 505 | #endif /* !__ASSEMBLY__ */ |
501 | 506 | ||
507 | |||
508 | /* TLB page size encoding - see table 3-1 in parisc20.pdf */ | ||
509 | #define _PAGE_SIZE_ENCODING_4K 0 | ||
510 | #define _PAGE_SIZE_ENCODING_16K 1 | ||
511 | #define _PAGE_SIZE_ENCODING_64K 2 | ||
512 | #define _PAGE_SIZE_ENCODING_256K 3 | ||
513 | #define _PAGE_SIZE_ENCODING_1M 4 | ||
514 | #define _PAGE_SIZE_ENCODING_4M 5 | ||
515 | #define _PAGE_SIZE_ENCODING_16M 6 | ||
516 | #define _PAGE_SIZE_ENCODING_64M 7 | ||
517 | |||
518 | #if defined(CONFIG_PARISC_PAGE_SIZE_4KB) | ||
519 | # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K | ||
520 | #elif defined(CONFIG_PARISC_PAGE_SIZE_16KB) | ||
521 | # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_16K | ||
522 | #elif defined(CONFIG_PARISC_PAGE_SIZE_64KB) | ||
523 | # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_64K | ||
524 | #endif | ||
525 | |||
526 | |||
502 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | 527 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ |
503 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 528 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
504 | 529 | ||
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h index c56fccbf34..0e1a30be2e 100644 --- a/include/asm-parisc/unistd.h +++ b/include/asm-parisc/unistd.h | |||
@@ -780,8 +780,14 @@ | |||
780 | #define __NR_readlinkat (__NR_Linux + 285) | 780 | #define __NR_readlinkat (__NR_Linux + 285) |
781 | #define __NR_fchmodat (__NR_Linux + 286) | 781 | #define __NR_fchmodat (__NR_Linux + 286) |
782 | #define __NR_faccessat (__NR_Linux + 287) | 782 | #define __NR_faccessat (__NR_Linux + 287) |
783 | #define __NR_unshare (__NR_Linux + 288) | ||
784 | #define __NR_set_robust_list (__NR_Linux + 289) | ||
785 | #define __NR_get_robust_list (__NR_Linux + 290) | ||
786 | #define __NR_splice (__NR_Linux + 291) | ||
787 | #define __NR_sync_file_range (__NR_Linux + 292) | ||
788 | #define __NR_tee (__NR_Linux + 293) | ||
783 | 789 | ||
784 | #define __NR_Linux_syscalls 288 | 790 | #define __NR_Linux_syscalls 294 |
785 | 791 | ||
786 | #define HPUX_GATEWAY_ADDR 0xC0000004 | 792 | #define HPUX_GATEWAY_ADDR 0xC0000004 |
787 | #define LINUX_GATEWAY_ADDR 0x100 | 793 | #define LINUX_GATEWAY_ADDR 0x100 |
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index 4321483cce..9fcf0162d8 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define PPC_FEATURE_BOOKE 0x00008000 | 22 | #define PPC_FEATURE_BOOKE 0x00008000 |
23 | #define PPC_FEATURE_SMT 0x00004000 | 23 | #define PPC_FEATURE_SMT 0x00004000 |
24 | #define PPC_FEATURE_ICACHE_SNOOP 0x00002000 | 24 | #define PPC_FEATURE_ICACHE_SNOOP 0x00002000 |
25 | #define PPC_FEATURE_ARCH_2_05 0x00001000 | ||
25 | 26 | ||
26 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
27 | #ifndef __ASSEMBLY__ | 28 | #ifndef __ASSEMBLY__ |
@@ -320,6 +321,11 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
320 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 321 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
321 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | 322 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ |
322 | CPU_FTR_MMCRA_SIHV | CPU_FTR_PURR) | 323 | CPU_FTR_MMCRA_SIHV | CPU_FTR_PURR) |
324 | #define CPU_FTRS_POWER6 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | ||
325 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ | ||
326 | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | ||
327 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ | ||
328 | CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE) | ||
323 | #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ | 329 | #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ |
324 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ | 330 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ |
325 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 331 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
@@ -331,8 +337,8 @@ extern void do_cpu_ftr_fixups(unsigned long offset); | |||
331 | #ifdef __powerpc64__ | 337 | #ifdef __powerpc64__ |
332 | #define CPU_FTRS_POSSIBLE \ | 338 | #define CPU_FTRS_POSSIBLE \ |
333 | (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ | 339 | (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ |
334 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_CELL | \ | 340 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ |
335 | CPU_FTR_CI_LARGE_PAGE) | 341 | CPU_FTRS_CELL | CPU_FTR_CI_LARGE_PAGE) |
336 | #else | 342 | #else |
337 | enum { | 343 | enum { |
338 | CPU_FTRS_POSSIBLE = | 344 | CPU_FTRS_POSSIBLE = |
@@ -376,8 +382,8 @@ enum { | |||
376 | #ifdef __powerpc64__ | 382 | #ifdef __powerpc64__ |
377 | #define CPU_FTRS_ALWAYS \ | 383 | #define CPU_FTRS_ALWAYS \ |
378 | (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \ | 384 | (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \ |
379 | CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_CELL & \ | 385 | CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 & \ |
380 | CPU_FTRS_POSSIBLE) | 386 | CPU_FTRS_CELL & CPU_FTRS_POSSIBLE) |
381 | #else | 387 | #else |
382 | enum { | 388 | enum { |
383 | CPU_FTRS_ALWAYS = | 389 | CPU_FTRS_ALWAYS = |
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h index 5207758a6d..868c7139db 100644 --- a/include/asm-powerpc/eeh.h +++ b/include/asm-powerpc/eeh.h | |||
@@ -60,24 +60,10 @@ void __init pci_addr_cache_build(void); | |||
60 | * device (including config space i/o). Call eeh_add_device_late | 60 | * device (including config space i/o). Call eeh_add_device_late |
61 | * to finish the eeh setup for this device. | 61 | * to finish the eeh setup for this device. |
62 | */ | 62 | */ |
63 | void eeh_add_device_early(struct device_node *); | ||
64 | void eeh_add_device_late(struct pci_dev *dev); | ||
65 | void eeh_add_device_tree_early(struct device_node *); | 63 | void eeh_add_device_tree_early(struct device_node *); |
66 | void eeh_add_device_tree_late(struct pci_bus *); | 64 | void eeh_add_device_tree_late(struct pci_bus *); |
67 | 65 | ||
68 | /** | 66 | /** |
69 | * eeh_remove_device - undo EEH setup for the indicated pci device | ||
70 | * @dev: pci device to be removed | ||
71 | * | ||
72 | * This routine should be called when a device is removed from | ||
73 | * a running system (e.g. by hotplug or dlpar). It unregisters | ||
74 | * the PCI device from the EEH subsystem. I/O errors affecting | ||
75 | * this device will no longer be detected after this call; thus, | ||
76 | * i/o errors affecting this slot may leave this device unusable. | ||
77 | */ | ||
78 | void eeh_remove_device(struct pci_dev *); | ||
79 | |||
80 | /** | ||
81 | * eeh_remove_device_recursive - undo EEH for device & children. | 67 | * eeh_remove_device_recursive - undo EEH for device & children. |
82 | * @dev: pci device to be removed | 68 | * @dev: pci device to be removed |
83 | * | 69 | * |
@@ -116,12 +102,6 @@ static inline int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *d | |||
116 | 102 | ||
117 | static inline void pci_addr_cache_build(void) { } | 103 | static inline void pci_addr_cache_build(void) { } |
118 | 104 | ||
119 | static inline void eeh_add_device_early(struct device_node *dn) { } | ||
120 | |||
121 | static inline void eeh_add_device_late(struct pci_dev *dev) { } | ||
122 | |||
123 | static inline void eeh_remove_device(struct pci_dev *dev) { } | ||
124 | |||
125 | static inline void eeh_add_device_tree_early(struct device_node *dn) { } | 105 | static inline void eeh_add_device_tree_early(struct device_node *dn) { } |
126 | 106 | ||
127 | static inline void eeh_add_device_tree_late(struct pci_bus *bus) { } | 107 | static inline void eeh_add_device_tree_late(struct pci_bus *bus) { } |
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index b72c04f3f5..6cc7e1fb7b 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h | |||
@@ -4,47 +4,88 @@ | |||
4 | 4 | ||
5 | #define HVSC .long 0x44000022 | 5 | #define HVSC .long 0x44000022 |
6 | 6 | ||
7 | #define H_Success 0 | 7 | #define H_SUCCESS 0 |
8 | #define H_Busy 1 /* Hardware busy -- retry later */ | 8 | #define H_BUSY 1 /* Hardware busy -- retry later */ |
9 | #define H_Closed 2 /* Resource closed */ | 9 | #define H_CLOSED 2 /* Resource closed */ |
10 | #define H_Constrained 4 /* Resource request constrained to max allowed */ | 10 | #define H_NOT_AVAILABLE 3 |
11 | #define H_InProgress 14 /* Kind of like busy */ | 11 | #define H_CONSTRAINED 4 /* Resource request constrained to max allowed */ |
12 | #define H_Pending 17 /* returned from H_POLL_PENDING */ | 12 | #define H_PARTIAL 5 |
13 | #define H_Continue 18 /* Returned from H_Join on success */ | 13 | #define H_IN_PROGRESS 14 /* Kind of like busy */ |
14 | #define H_LongBusyStartRange 9900 /* Start of long busy range */ | 14 | #define H_PAGE_REGISTERED 15 |
15 | #define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ | 15 | #define H_PARTIAL_STORE 16 |
16 | #define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ | 16 | #define H_PENDING 17 /* returned from H_POLL_PENDING */ |
17 | #define H_LongBusyOrder100msec 9902 /* Long busy, hint that 100msec is a good time to retry */ | 17 | #define H_CONTINUE 18 /* Returned from H_Join on success */ |
18 | #define H_LongBusyOrder1sec 9903 /* Long busy, hint that 1sec is a good time to retry */ | 18 | #define H_LONG_BUSY_START_RANGE 9900 /* Start of long busy range */ |
19 | #define H_LongBusyOrder10sec 9904 /* Long busy, hint that 10sec is a good time to retry */ | 19 | #define H_LONG_BUSY_ORDER_1_MSEC 9900 /* Long busy, hint that 1msec \ |
20 | #define H_LongBusyOrder100sec 9905 /* Long busy, hint that 100sec is a good time to retry */ | 20 | is a good time to retry */ |
21 | #define H_LongBusyEndRange 9905 /* End of long busy range */ | 21 | #define H_LONG_BUSY_ORDER_10_MSEC 9901 /* Long busy, hint that 10msec \ |
22 | #define H_Hardware -1 /* Hardware error */ | 22 | is a good time to retry */ |
23 | #define H_Function -2 /* Function not supported */ | 23 | #define H_LONG_BUSY_ORDER_100_MSEC 9902 /* Long busy, hint that 100msec \ |
24 | #define H_Privilege -3 /* Caller not privileged */ | 24 | is a good time to retry */ |
25 | #define H_Parameter -4 /* Parameter invalid, out-of-range or conflicting */ | 25 | #define H_LONG_BUSY_ORDER_1_SEC 9903 /* Long busy, hint that 1sec \ |
26 | #define H_Bad_Mode -5 /* Illegal msr value */ | 26 | is a good time to retry */ |
27 | #define H_PTEG_Full -6 /* PTEG is full */ | 27 | #define H_LONG_BUSY_ORDER_10_SEC 9904 /* Long busy, hint that 10sec \ |
28 | #define H_Not_Found -7 /* PTE was not found" */ | 28 | is a good time to retry */ |
29 | #define H_Reserved_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */ | 29 | #define H_LONG_BUSY_ORDER_100_SEC 9905 /* Long busy, hint that 100sec \ |
30 | #define H_NoMem -9 | 30 | is a good time to retry */ |
31 | #define H_Authority -10 | 31 | #define H_LONG_BUSY_END_RANGE 9905 /* End of long busy range */ |
32 | #define H_Permission -11 | 32 | #define H_HARDWARE -1 /* Hardware error */ |
33 | #define H_Dropped -12 | 33 | #define H_FUNCTION -2 /* Function not supported */ |
34 | #define H_SourceParm -13 | 34 | #define H_PRIVILEGE -3 /* Caller not privileged */ |
35 | #define H_DestParm -14 | 35 | #define H_PARAMETER -4 /* Parameter invalid, out-of-range or conflicting */ |
36 | #define H_RemoteParm -15 | 36 | #define H_BAD_MODE -5 /* Illegal msr value */ |
37 | #define H_Resource -16 | 37 | #define H_PTEG_FULL -6 /* PTEG is full */ |
38 | #define H_NOT_FOUND -7 /* PTE was not found" */ | ||
39 | #define H_RESERVED_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */ | ||
40 | #define H_NO_MEM -9 | ||
41 | #define H_AUTHORITY -10 | ||
42 | #define H_PERMISSION -11 | ||
43 | #define H_DROPPED -12 | ||
44 | #define H_SOURCE_PARM -13 | ||
45 | #define H_DEST_PARM -14 | ||
46 | #define H_REMOTE_PARM -15 | ||
47 | #define H_RESOURCE -16 | ||
48 | #define H_ADAPTER_PARM -17 | ||
49 | #define H_RH_PARM -18 | ||
50 | #define H_RCQ_PARM -19 | ||
51 | #define H_SCQ_PARM -20 | ||
52 | #define H_EQ_PARM -21 | ||
53 | #define H_RT_PARM -22 | ||
54 | #define H_ST_PARM -23 | ||
55 | #define H_SIGT_PARM -24 | ||
56 | #define H_TOKEN_PARM -25 | ||
57 | #define H_MLENGTH_PARM -27 | ||
58 | #define H_MEM_PARM -28 | ||
59 | #define H_MEM_ACCESS_PARM -29 | ||
60 | #define H_ATTR_PARM -30 | ||
61 | #define H_PORT_PARM -31 | ||
62 | #define H_MCG_PARM -32 | ||
63 | #define H_VL_PARM -33 | ||
64 | #define H_TSIZE_PARM -34 | ||
65 | #define H_TRACE_PARM -35 | ||
66 | |||
67 | #define H_MASK_PARM -37 | ||
68 | #define H_MCG_FULL -38 | ||
69 | #define H_ALIAS_EXIST -39 | ||
70 | #define H_P_COUNTER -40 | ||
71 | #define H_TABLE_FULL -41 | ||
72 | #define H_ALT_TABLE -42 | ||
73 | #define H_MR_CONDITION -43 | ||
74 | #define H_NOT_ENOUGH_RESOURCES -44 | ||
75 | #define H_R_STATE -45 | ||
76 | #define H_RESCINDEND -46 | ||
77 | |||
38 | 78 | ||
39 | /* Long Busy is a condition that can be returned by the firmware | 79 | /* Long Busy is a condition that can be returned by the firmware |
40 | * when a call cannot be completed now, but the identical call | 80 | * when a call cannot be completed now, but the identical call |
41 | * should be retried later. This prevents calls blocking in the | 81 | * should be retried later. This prevents calls blocking in the |
42 | * firmware for long periods of time. Annoyingly the firmware can return | 82 | * firmware for long periods of time. Annoyingly the firmware can return |
43 | * a range of return codes, hinting at how long we should wait before | 83 | * a range of return codes, hinting at how long we should wait before |
44 | * retrying. If you don't care for the hint, the macro below is a good | 84 | * retrying. If you don't care for the hint, the macro below is a good |
45 | * way to check for the long_busy return codes | 85 | * way to check for the long_busy return codes |
46 | */ | 86 | */ |
47 | #define H_isLongBusy(x) ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange)) | 87 | #define H_IS_LONG_BUSY(x) ((x >= H_LONG_BUSY_START_RANGE) \ |
88 | && (x <= H_LONG_BUSY_END_RANGE)) | ||
48 | 89 | ||
49 | /* Flags */ | 90 | /* Flags */ |
50 | #define H_LARGE_PAGE (1UL<<(63-16)) | 91 | #define H_LARGE_PAGE (1UL<<(63-16)) |
@@ -66,6 +107,9 @@ | |||
66 | #define H_DABRX_KERNEL (1UL<<(63-62)) | 107 | #define H_DABRX_KERNEL (1UL<<(63-62)) |
67 | #define H_DABRX_USER (1UL<<(63-63)) | 108 | #define H_DABRX_USER (1UL<<(63-63)) |
68 | 109 | ||
110 | /* Each control block has to be on a 4K bondary */ | ||
111 | #define H_CB_ALIGNMENT 4096 | ||
112 | |||
69 | /* pSeries hypervisor opcodes */ | 113 | /* pSeries hypervisor opcodes */ |
70 | #define H_REMOVE 0x04 | 114 | #define H_REMOVE 0x04 |
71 | #define H_ENTER 0x08 | 115 | #define H_ENTER 0x08 |
@@ -99,25 +143,52 @@ | |||
99 | #define H_PERFMON 0x7c | 143 | #define H_PERFMON 0x7c |
100 | #define H_MIGRATE_DMA 0x78 | 144 | #define H_MIGRATE_DMA 0x78 |
101 | #define H_REGISTER_VPA 0xDC | 145 | #define H_REGISTER_VPA 0xDC |
102 | #define H_CEDE 0xE0 | 146 | #define H_CEDE 0xE0 |
103 | #define H_CONFER 0xE4 | 147 | #define H_CONFER 0xE4 |
104 | #define H_PROD 0xE8 | 148 | #define H_PROD 0xE8 |
105 | #define H_GET_PPP 0xEC | 149 | #define H_GET_PPP 0xEC |
106 | #define H_SET_PPP 0xF0 | 150 | #define H_SET_PPP 0xF0 |
107 | #define H_PURR 0xF4 | 151 | #define H_PURR 0xF4 |
108 | #define H_PIC 0xF8 | 152 | #define H_PIC 0xF8 |
109 | #define H_REG_CRQ 0xFC | 153 | #define H_REG_CRQ 0xFC |
110 | #define H_FREE_CRQ 0x100 | 154 | #define H_FREE_CRQ 0x100 |
111 | #define H_VIO_SIGNAL 0x104 | 155 | #define H_VIO_SIGNAL 0x104 |
112 | #define H_SEND_CRQ 0x108 | 156 | #define H_SEND_CRQ 0x108 |
113 | #define H_COPY_RDMA 0x110 | 157 | #define H_COPY_RDMA 0x110 |
114 | #define H_SET_XDABR 0x134 | 158 | #define H_SET_XDABR 0x134 |
115 | #define H_STUFF_TCE 0x138 | 159 | #define H_STUFF_TCE 0x138 |
116 | #define H_PUT_TCE_INDIRECT 0x13C | 160 | #define H_PUT_TCE_INDIRECT 0x13C |
117 | #define H_VTERM_PARTNER_INFO 0x150 | 161 | #define H_VTERM_PARTNER_INFO 0x150 |
118 | #define H_REGISTER_VTERM 0x154 | 162 | #define H_REGISTER_VTERM 0x154 |
119 | #define H_FREE_VTERM 0x158 | 163 | #define H_FREE_VTERM 0x158 |
120 | #define H_POLL_PENDING 0x1D8 | 164 | #define H_RESET_EVENTS 0x15C |
165 | #define H_ALLOC_RESOURCE 0x160 | ||
166 | #define H_FREE_RESOURCE 0x164 | ||
167 | #define H_MODIFY_QP 0x168 | ||
168 | #define H_QUERY_QP 0x16C | ||
169 | #define H_REREGISTER_PMR 0x170 | ||
170 | #define H_REGISTER_SMR 0x174 | ||
171 | #define H_QUERY_MR 0x178 | ||
172 | #define H_QUERY_MW 0x17C | ||
173 | #define H_QUERY_HCA 0x180 | ||
174 | #define H_QUERY_PORT 0x184 | ||
175 | #define H_MODIFY_PORT 0x188 | ||
176 | #define H_DEFINE_AQP1 0x18C | ||
177 | #define H_GET_TRACE_BUFFER 0x190 | ||
178 | #define H_DEFINE_AQP0 0x194 | ||
179 | #define H_RESIZE_MR 0x198 | ||
180 | #define H_ATTACH_MCQP 0x19C | ||
181 | #define H_DETACH_MCQP 0x1A0 | ||
182 | #define H_CREATE_RPT 0x1A4 | ||
183 | #define H_REMOVE_RPT 0x1A8 | ||
184 | #define H_REGISTER_RPAGES 0x1AC | ||
185 | #define H_DISABLE_AND_GETC 0x1B0 | ||
186 | #define H_ERROR_DATA 0x1B4 | ||
187 | #define H_GET_HCA_INFO 0x1B8 | ||
188 | #define H_GET_PERF_COUNT 0x1BC | ||
189 | #define H_MANAGE_TRACE 0x1C0 | ||
190 | #define H_QUERY_INT_STATE 0x1E4 | ||
191 | #define H_POLL_PENDING 0x1D8 | ||
121 | #define H_JOIN 0x298 | 192 | #define H_JOIN 0x298 |
122 | #define H_ENABLE_CRQ 0x2B0 | 193 | #define H_ENABLE_CRQ 0x2B0 |
123 | 194 | ||
@@ -152,7 +223,7 @@ long plpar_hcall_norets(unsigned long opcode, ...); | |||
152 | */ | 223 | */ |
153 | long plpar_hcall_8arg_2ret(unsigned long opcode, | 224 | long plpar_hcall_8arg_2ret(unsigned long opcode, |
154 | unsigned long arg1, | 225 | unsigned long arg1, |
155 | unsigned long arg2, | 226 | unsigned long arg2, |
156 | unsigned long arg3, | 227 | unsigned long arg3, |
157 | unsigned long arg4, | 228 | unsigned long arg4, |
158 | unsigned long arg5, | 229 | unsigned long arg5, |
@@ -176,6 +247,42 @@ long plpar_hcall_4out(unsigned long opcode, | |||
176 | unsigned long *out3, | 247 | unsigned long *out3, |
177 | unsigned long *out4); | 248 | unsigned long *out4); |
178 | 249 | ||
250 | long plpar_hcall_7arg_7ret(unsigned long opcode, | ||
251 | unsigned long arg1, | ||
252 | unsigned long arg2, | ||
253 | unsigned long arg3, | ||
254 | unsigned long arg4, | ||
255 | unsigned long arg5, | ||
256 | unsigned long arg6, | ||
257 | unsigned long arg7, | ||
258 | unsigned long *out1, | ||
259 | unsigned long *out2, | ||
260 | unsigned long *out3, | ||
261 | unsigned long *out4, | ||
262 | unsigned long *out5, | ||
263 | unsigned long *out6, | ||
264 | unsigned long *out7); | ||
265 | |||
266 | long plpar_hcall_9arg_9ret(unsigned long opcode, | ||
267 | unsigned long arg1, | ||
268 | unsigned long arg2, | ||
269 | unsigned long arg3, | ||
270 | unsigned long arg4, | ||
271 | unsigned long arg5, | ||
272 | unsigned long arg6, | ||
273 | unsigned long arg7, | ||
274 | unsigned long arg8, | ||
275 | unsigned long arg9, | ||
276 | unsigned long *out1, | ||
277 | unsigned long *out2, | ||
278 | unsigned long *out3, | ||
279 | unsigned long *out4, | ||
280 | unsigned long *out5, | ||
281 | unsigned long *out6, | ||
282 | unsigned long *out7, | ||
283 | unsigned long *out8, | ||
284 | unsigned long *out9); | ||
285 | |||
179 | #endif /* __ASSEMBLY__ */ | 286 | #endif /* __ASSEMBLY__ */ |
180 | #endif /* __KERNEL__ */ | 287 | #endif /* __KERNEL__ */ |
181 | #endif /* _ASM_POWERPC_HVCALL_H */ | 288 | #endif /* _ASM_POWERPC_HVCALL_H */ |
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 68efbea379..f1c2469b88 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
@@ -9,6 +9,9 @@ | |||
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* Check of existence of legacy devices */ | ||
13 | extern int check_legacy_ioport(unsigned long base_port); | ||
14 | |||
12 | #ifndef CONFIG_PPC64 | 15 | #ifndef CONFIG_PPC64 |
13 | #include <asm-ppc/io.h> | 16 | #include <asm-ppc/io.h> |
14 | #else | 17 | #else |
@@ -437,9 +440,6 @@ out: | |||
437 | #define dma_cache_wback(_start,_size) do { } while (0) | 440 | #define dma_cache_wback(_start,_size) do { } while (0) |
438 | #define dma_cache_wback_inv(_start,_size) do { } while (0) | 441 | #define dma_cache_wback_inv(_start,_size) do { } while (0) |
439 | 442 | ||
440 | /* Check of existence of legacy devices */ | ||
441 | extern int check_legacy_ioport(unsigned long base_port); | ||
442 | |||
443 | 443 | ||
444 | /* | 444 | /* |
445 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 445 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h index d5677cbec2..18ca29e910 100644 --- a/include/asm-powerpc/iommu.h +++ b/include/asm-powerpc/iommu.h | |||
@@ -70,17 +70,18 @@ extern void iommu_free_table(struct device_node *dn); | |||
70 | extern struct iommu_table *iommu_init_table(struct iommu_table * tbl); | 70 | extern struct iommu_table *iommu_init_table(struct iommu_table * tbl); |
71 | 71 | ||
72 | 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, |
73 | struct scatterlist *sglist, int nelems, | 73 | struct scatterlist *sglist, int nelems, unsigned long mask, |
74 | enum dma_data_direction direction); | 74 | enum dma_data_direction direction); |
75 | extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, | 75 | extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, |
76 | int nelems, enum dma_data_direction direction); | 76 | int nelems, enum dma_data_direction direction); |
77 | 77 | ||
78 | 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, |
79 | dma_addr_t *dma_handle, gfp_t flag); | 79 | dma_addr_t *dma_handle, unsigned long mask, gfp_t flag); |
80 | extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, | 80 | extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, |
81 | void *vaddr, dma_addr_t dma_handle); | 81 | void *vaddr, dma_addr_t dma_handle); |
82 | extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, | 82 | extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, |
83 | size_t size, enum dma_data_direction direction); | 83 | size_t size, unsigned long mask, |
84 | enum dma_data_direction direction); | ||
84 | extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, | 85 | extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, |
85 | size_t size, enum dma_data_direction direction); | 86 | size_t size, enum dma_data_direction direction); |
86 | 87 | ||
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index 51f87d9993..7bc6d73b28 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h | |||
@@ -54,6 +54,13 @@ | |||
54 | */ | 54 | */ |
55 | extern unsigned int virt_irq_to_real_map[NR_IRQS]; | 55 | extern unsigned int virt_irq_to_real_map[NR_IRQS]; |
56 | 56 | ||
57 | /* The maximum virtual IRQ number that we support. This | ||
58 | * can be set by the platform and will be reduced by the | ||
59 | * value of __irq_offset_value. It defaults to and is | ||
60 | * capped by (NR_IRQS - 1). | ||
61 | */ | ||
62 | extern unsigned int virt_irq_max; | ||
63 | |||
57 | /* Create a mapping for a real_irq if it doesn't already exist. | 64 | /* Create a mapping for a real_irq if it doesn't already exist. |
58 | * Return the virtual irq as a convenience. | 65 | * Return the virtual irq as a convenience. |
59 | */ | 66 | */ |
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index 5ed8476807..0f9254c189 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h | |||
@@ -253,7 +253,11 @@ extern struct machdep_calls *machine_id; | |||
253 | 253 | ||
254 | #define __machine_desc __attribute__ ((__section__ (".machine.desc"))) | 254 | #define __machine_desc __attribute__ ((__section__ (".machine.desc"))) |
255 | 255 | ||
256 | #define define_machine(name) struct machdep_calls mach_##name __machine_desc = | 256 | #define define_machine(name) \ |
257 | extern struct machdep_calls mach_##name; \ | ||
258 | EXPORT_SYMBOL(mach_##name); \ | ||
259 | struct machdep_calls mach_##name __machine_desc = | ||
260 | |||
257 | #define machine_is(name) \ | 261 | #define machine_is(name) \ |
258 | ({ \ | 262 | ({ \ |
259 | extern struct machdep_calls mach_##name \ | 263 | extern struct machdep_calls mach_##name \ |
diff --git a/include/asm-powerpc/numnodes.h b/include/asm-powerpc/numnodes.h deleted file mode 100644 index e138edae09..0000000000 --- a/include/asm-powerpc/numnodes.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef _ASM_POWERPC_MAX_NUMNODES_H | ||
2 | #define _ASM_POWERPC_MAX_NUMNODES_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | /* Max 16 Nodes */ | ||
6 | #define NODES_SHIFT 4 | ||
7 | |||
8 | #endif /* __KERNEL__ */ | ||
9 | #endif /* _ASM_POWERPC_MAX_NUMNODES_H */ | ||
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h index 3fb061bab9..eab779c219 100644 --- a/include/asm-powerpc/page_64.h +++ b/include/asm-powerpc/page_64.h | |||
@@ -101,6 +101,7 @@ extern unsigned int HPAGE_SHIFT; | |||
101 | - (1U << GET_HTLB_AREA(addr))) & 0xffff) | 101 | - (1U << GET_HTLB_AREA(addr))) & 0xffff) |
102 | 102 | ||
103 | #define ARCH_HAS_HUGEPAGE_ONLY_RANGE | 103 | #define ARCH_HAS_HUGEPAGE_ONLY_RANGE |
104 | #define ARCH_HAS_HUGETLB_FREE_PGD_RANGE | ||
104 | #define ARCH_HAS_PREPARE_HUGEPAGE_RANGE | 105 | #define ARCH_HAS_PREPARE_HUGEPAGE_RANGE |
105 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | 106 | #define ARCH_HAS_SETCLEAR_HUGE_PTE |
106 | 107 | ||
diff --git a/include/asm-powerpc/pgalloc.h b/include/asm-powerpc/pgalloc.h index a00ee002cd..9f0917c686 100644 --- a/include/asm-powerpc/pgalloc.h +++ b/include/asm-powerpc/pgalloc.h | |||
@@ -17,11 +17,13 @@ extern kmem_cache_t *pgtable_cache[]; | |||
17 | #define PTE_CACHE_NUM 0 | 17 | #define PTE_CACHE_NUM 0 |
18 | #define PMD_CACHE_NUM 1 | 18 | #define PMD_CACHE_NUM 1 |
19 | #define PGD_CACHE_NUM 2 | 19 | #define PGD_CACHE_NUM 2 |
20 | #define HUGEPTE_CACHE_NUM 3 | ||
20 | #else | 21 | #else |
21 | #define PTE_CACHE_NUM 0 | 22 | #define PTE_CACHE_NUM 0 |
22 | #define PMD_CACHE_NUM 1 | 23 | #define PMD_CACHE_NUM 1 |
23 | #define PUD_CACHE_NUM 1 | 24 | #define PUD_CACHE_NUM 1 |
24 | #define PGD_CACHE_NUM 0 | 25 | #define PGD_CACHE_NUM 0 |
26 | #define HUGEPTE_CACHE_NUM 2 | ||
25 | #endif | 27 | #endif |
26 | 28 | ||
27 | /* | 29 | /* |
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index f431d8b0b6..7cfcff3ef0 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h | |||
@@ -117,6 +117,7 @@ struct spu { | |||
117 | struct list_head list; | 117 | struct list_head list; |
118 | struct list_head sched_list; | 118 | struct list_head sched_list; |
119 | int number; | 119 | int number; |
120 | int nid; | ||
120 | u32 isrc; | 121 | u32 isrc; |
121 | u32 node; | 122 | u32 node; |
122 | u64 flags; | 123 | u64 flags; |
diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h index ebf6055481..6d533b07aa 100644 --- a/include/asm-powerpc/termbits.h +++ b/include/asm-powerpc/termbits.h | |||
@@ -153,6 +153,7 @@ struct termios { | |||
153 | #define HUPCL 00040000 | 153 | #define HUPCL 00040000 |
154 | 154 | ||
155 | #define CLOCAL 00100000 | 155 | #define CLOCAL 00100000 |
156 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
156 | #define CRTSCTS 020000000000 /* flow control */ | 157 | #define CRTSCTS 020000000000 /* flow control */ |
157 | 158 | ||
158 | /* c_lflag bits */ | 159 | /* c_lflag bits */ |
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index ffc7462d77..88b553c6b2 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
@@ -37,6 +37,8 @@ struct thread_info { | |||
37 | int preempt_count; /* 0 => preemptable, | 37 | int preempt_count; /* 0 => preemptable, |
38 | <0 => BUG */ | 38 | <0 => BUG */ |
39 | struct restart_block restart_block; | 39 | struct restart_block restart_block; |
40 | unsigned long local_flags; /* private flags for thread */ | ||
41 | |||
40 | /* low level flags - has atomic operations done on it */ | 42 | /* low level flags - has atomic operations done on it */ |
41 | unsigned long flags ____cacheline_aligned_in_smp; | 43 | unsigned long flags ____cacheline_aligned_in_smp; |
42 | }; | 44 | }; |
@@ -143,6 +145,12 @@ static inline struct thread_info *current_thread_info(void) | |||
143 | _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) | 145 | _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) |
144 | #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) | 146 | #define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR) |
145 | 147 | ||
148 | /* Bits in local_flags */ | ||
149 | /* Don't move TLF_NAPPING without adjusting the code in entry_32.S */ | ||
150 | #define TLF_NAPPING 0 /* idle thread enabled NAP mode */ | ||
151 | |||
152 | #define _TLF_NAPPING (1 << TLF_NAPPING) | ||
153 | |||
146 | #endif /* __KERNEL__ */ | 154 | #endif /* __KERNEL__ */ |
147 | 155 | ||
148 | #endif /* _ASM_POWERPC_THREAD_INFO_H */ | 156 | #endif /* _ASM_POWERPC_THREAD_INFO_H */ |
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h index 1e19cd00af..87362a0554 100644 --- a/include/asm-powerpc/topology.h +++ b/include/asm-powerpc/topology.h | |||
@@ -4,6 +4,9 @@ | |||
4 | 4 | ||
5 | #include <linux/config.h> | 5 | #include <linux/config.h> |
6 | 6 | ||
7 | struct sys_device; | ||
8 | struct device_node; | ||
9 | |||
7 | #ifdef CONFIG_NUMA | 10 | #ifdef CONFIG_NUMA |
8 | 11 | ||
9 | #include <asm/mmzone.h> | 12 | #include <asm/mmzone.h> |
@@ -27,6 +30,8 @@ static inline int node_to_first_cpu(int node) | |||
27 | return first_cpu(tmp); | 30 | return first_cpu(tmp); |
28 | } | 31 | } |
29 | 32 | ||
33 | int of_node_to_nid(struct device_node *device); | ||
34 | |||
30 | #define pcibus_to_node(node) (-1) | 35 | #define pcibus_to_node(node) (-1) |
31 | #define pcibus_to_cpumask(bus) (cpu_online_map) | 36 | #define pcibus_to_cpumask(bus) (cpu_online_map) |
32 | 37 | ||
@@ -57,10 +62,29 @@ static inline int node_to_first_cpu(int node) | |||
57 | 62 | ||
58 | extern void __init dump_numa_cpu_topology(void); | 63 | extern void __init dump_numa_cpu_topology(void); |
59 | 64 | ||
65 | extern int sysfs_add_device_to_node(struct sys_device *dev, int nid); | ||
66 | extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid); | ||
67 | |||
60 | #else | 68 | #else |
61 | 69 | ||
70 | static inline int of_node_to_nid(struct device_node *device) | ||
71 | { | ||
72 | return 0; | ||
73 | } | ||
74 | |||
62 | static inline void dump_numa_cpu_topology(void) {} | 75 | static inline void dump_numa_cpu_topology(void) {} |
63 | 76 | ||
77 | static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid) | ||
78 | { | ||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | static inline void sysfs_remove_device_from_node(struct sys_device *dev, | ||
83 | int nid) | ||
84 | { | ||
85 | } | ||
86 | |||
87 | |||
64 | #include <asm-generic/topology.h> | 88 | #include <asm-generic/topology.h> |
65 | 89 | ||
66 | #endif /* CONFIG_NUMA */ | 90 | #endif /* CONFIG_NUMA */ |
diff --git a/include/asm-powerpc/uaccess.h b/include/asm-powerpc/uaccess.h index 3872e924cd..d83fc29c2b 100644 --- a/include/asm-powerpc/uaccess.h +++ b/include/asm-powerpc/uaccess.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
9 | #include <asm/processor.h> | 9 | #include <asm/processor.h> |
10 | #include <asm/page.h> | ||
10 | 11 | ||
11 | #define VERIFY_READ 0 | 12 | #define VERIFY_READ 0 |
12 | #define VERIFY_WRITE 1 | 13 | #define VERIFY_WRITE 1 |
@@ -179,9 +180,11 @@ do { \ | |||
179 | #define __put_user_nocheck(x, ptr, size) \ | 180 | #define __put_user_nocheck(x, ptr, size) \ |
180 | ({ \ | 181 | ({ \ |
181 | long __pu_err; \ | 182 | long __pu_err; \ |
182 | might_sleep(); \ | 183 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
184 | if (!is_kernel_addr((unsigned long)__pu_addr)) \ | ||
185 | might_sleep(); \ | ||
183 | __chk_user_ptr(ptr); \ | 186 | __chk_user_ptr(ptr); \ |
184 | __put_user_size((x), (ptr), (size), __pu_err); \ | 187 | __put_user_size((x), __pu_addr, (size), __pu_err); \ |
185 | __pu_err; \ | 188 | __pu_err; \ |
186 | }) | 189 | }) |
187 | 190 | ||
@@ -258,9 +261,11 @@ do { \ | |||
258 | ({ \ | 261 | ({ \ |
259 | long __gu_err; \ | 262 | long __gu_err; \ |
260 | unsigned long __gu_val; \ | 263 | unsigned long __gu_val; \ |
264 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
261 | __chk_user_ptr(ptr); \ | 265 | __chk_user_ptr(ptr); \ |
262 | might_sleep(); \ | 266 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
263 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | 267 | might_sleep(); \ |
268 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | ||
264 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 269 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
265 | __gu_err; \ | 270 | __gu_err; \ |
266 | }) | 271 | }) |
@@ -270,9 +275,11 @@ do { \ | |||
270 | ({ \ | 275 | ({ \ |
271 | long __gu_err; \ | 276 | long __gu_err; \ |
272 | long long __gu_val; \ | 277 | long long __gu_val; \ |
278 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
273 | __chk_user_ptr(ptr); \ | 279 | __chk_user_ptr(ptr); \ |
274 | might_sleep(); \ | 280 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
275 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | 281 | might_sleep(); \ |
282 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | ||
276 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 283 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
277 | __gu_err; \ | 284 | __gu_err; \ |
278 | }) | 285 | }) |
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index 536ba08730..edde2462bf 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -302,8 +302,29 @@ | |||
302 | #define __NR_ppoll 281 | 302 | #define __NR_ppoll 281 |
303 | #define __NR_unshare 282 | 303 | #define __NR_unshare 282 |
304 | #define __NR_splice 283 | 304 | #define __NR_splice 283 |
305 | #define __NR_tee 284 | ||
306 | #define __NR_vmsplice 285 | ||
307 | #define __NR_openat 286 | ||
308 | #define __NR_mkdirat 287 | ||
309 | #define __NR_mknodat 288 | ||
310 | #define __NR_fchownat 289 | ||
311 | #define __NR_futimesat 290 | ||
312 | #ifdef __powerpc64__ | ||
313 | #define __NR_newfstatat 291 | ||
314 | #else | ||
315 | #define __NR_fstatat64 291 | ||
316 | #endif | ||
317 | #define __NR_unlinkat 292 | ||
318 | #define __NR_renameat 293 | ||
319 | #define __NR_linkat 294 | ||
320 | #define __NR_symlinkat 295 | ||
321 | #define __NR_readlinkat 296 | ||
322 | #define __NR_fchmodat 297 | ||
323 | #define __NR_faccessat 298 | ||
324 | #define __NR_get_robust_list 299 | ||
325 | #define __NR_set_robust_list 300 | ||
305 | 326 | ||
306 | #define __NR_syscalls 284 | 327 | #define __NR_syscalls 301 |
307 | 328 | ||
308 | #ifdef __KERNEL__ | 329 | #ifdef __KERNEL__ |
309 | #define __NR__exit __NR_exit | 330 | #define __NR__exit __NR_exit |
@@ -456,6 +477,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
456 | #ifdef CONFIG_PPC64 | 477 | #ifdef CONFIG_PPC64 |
457 | #define __ARCH_WANT_COMPAT_SYS_TIME | 478 | #define __ARCH_WANT_COMPAT_SYS_TIME |
458 | #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND | 479 | #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND |
480 | #define __ARCH_WANT_SYS_NEWFSTATAT | ||
459 | #endif | 481 | #endif |
460 | 482 | ||
461 | /* | 483 | /* |
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h index 973e609082..31f362966a 100644 --- a/include/asm-ppc/commproc.h +++ b/include/asm-ppc/commproc.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #define CPM_CR_INIT_TX ((ushort)0x0002) | 35 | #define CPM_CR_INIT_TX ((ushort)0x0002) |
36 | #define CPM_CR_HUNT_MODE ((ushort)0x0003) | 36 | #define CPM_CR_HUNT_MODE ((ushort)0x0003) |
37 | #define CPM_CR_STOP_TX ((ushort)0x0004) | 37 | #define CPM_CR_STOP_TX ((ushort)0x0004) |
38 | #define CPM_CR_GRA_STOP_TX ((ushort)0x0005) | ||
38 | #define CPM_CR_RESTART_TX ((ushort)0x0006) | 39 | #define CPM_CR_RESTART_TX ((ushort)0x0006) |
39 | #define CPM_CR_CLOSE_RX_BD ((ushort)0x0007) | 40 | #define CPM_CR_CLOSE_RX_BD ((ushort)0x0007) |
40 | #define CPM_CR_SET_GADDR ((ushort)0x0008) | 41 | #define CPM_CR_SET_GADDR ((ushort)0x0008) |
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h index b638b87ceb..c70344b910 100644 --- a/include/asm-ppc/cpm2.h +++ b/include/asm-ppc/cpm2.h | |||
@@ -69,7 +69,7 @@ | |||
69 | #define CPM_CR_INIT_TX ((ushort)0x0002) | 69 | #define CPM_CR_INIT_TX ((ushort)0x0002) |
70 | #define CPM_CR_HUNT_MODE ((ushort)0x0003) | 70 | #define CPM_CR_HUNT_MODE ((ushort)0x0003) |
71 | #define CPM_CR_STOP_TX ((ushort)0x0004) | 71 | #define CPM_CR_STOP_TX ((ushort)0x0004) |
72 | #define CPM_CR_GRA_STOP_TX ((ushort)0x0005) | 72 | #define CPM_CR_GRA_STOP_TX ((ushort)0x0005) |
73 | #define CPM_CR_RESTART_TX ((ushort)0x0006) | 73 | #define CPM_CR_RESTART_TX ((ushort)0x0006) |
74 | #define CPM_CR_SET_GADDR ((ushort)0x0008) | 74 | #define CPM_CR_SET_GADDR ((ushort)0x0008) |
75 | #define CPM_CR_START_IDMA ((ushort)0x0009) | 75 | #define CPM_CR_START_IDMA ((ushort)0x0009) |
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h index a70ba2ee55..0fb68a0b01 100644 --- a/include/asm-ppc/page.h +++ b/include/asm-ppc/page.h | |||
@@ -20,6 +20,7 @@ | |||
20 | /* This must match what is in arch/ppc/Makefile */ | 20 | /* This must match what is in arch/ppc/Makefile */ |
21 | #define PAGE_OFFSET CONFIG_KERNEL_START | 21 | #define PAGE_OFFSET CONFIG_KERNEL_START |
22 | #define KERNELBASE PAGE_OFFSET | 22 | #define KERNELBASE PAGE_OFFSET |
23 | #define is_kernel_addr(x) ((x) >= PAGE_OFFSET) | ||
23 | 24 | ||
24 | #ifndef __ASSEMBLY__ | 25 | #ifndef __ASSEMBLY__ |
25 | 26 | ||
diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h index 4b94f7059e..40f197af65 100644 --- a/include/asm-ppc/ppc_sys.h +++ b/include/asm-ppc/ppc_sys.h | |||
@@ -39,6 +39,8 @@ | |||
39 | #error "need definition of ppc_sys_devices" | 39 | #error "need definition of ppc_sys_devices" |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #define PPC_SYS_IORESOURCE_FIXUPPED 0x00000001 | ||
43 | |||
42 | struct ppc_sys_spec { | 44 | struct ppc_sys_spec { |
43 | /* PPC sys is matched via (ID & mask) == value, id could be | 45 | /* PPC sys is matched via (ID & mask) == value, id could be |
44 | * PVR, SVR, IMMR, * etc. */ | 46 | * PVR, SVR, IMMR, * etc. */ |
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h index 00ad9c754c..4944c0fb8b 100644 --- a/include/asm-ppc/reg_booke.h +++ b/include/asm-ppc/reg_booke.h | |||
@@ -237,6 +237,7 @@ do { \ | |||
237 | #endif | 237 | #endif |
238 | 238 | ||
239 | /* Bit definitions for CCR1. */ | 239 | /* Bit definitions for CCR1. */ |
240 | #define CCR1_DPC 0x00000100 /* Disable L1 I-Cache/D-Cache parity checking */ | ||
240 | #define CCR1_TCS 0x00000080 /* Timer Clock Select */ | 241 | #define CCR1_TCS 0x00000080 /* Timer Clock Select */ |
241 | 242 | ||
242 | /* Bit definitions for the MCSR. */ | 243 | /* Bit definitions for the MCSR. */ |
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h index de1d9926aa..399bf02894 100644 --- a/include/asm-s390/atomic.h +++ b/include/asm-s390/atomic.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ARCH_S390_ATOMIC__ | 1 | #ifndef __ARCH_S390_ATOMIC__ |
2 | #define __ARCH_S390_ATOMIC__ | 2 | #define __ARCH_S390_ATOMIC__ |
3 | 3 | ||
4 | #include <linux/compiler.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * include/asm-s390/atomic.h | 7 | * include/asm-s390/atomic.h |
6 | * | 8 | * |
diff --git a/include/asm-s390/cache.h b/include/asm-s390/cache.h index e20cdd9074..cdf431b061 100644 --- a/include/asm-s390/cache.h +++ b/include/asm-s390/cache.h | |||
@@ -16,4 +16,6 @@ | |||
16 | 16 | ||
17 | #define ARCH_KMALLOC_MINALIGN 8 | 17 | #define ARCH_KMALLOC_MINALIGN 8 |
18 | 18 | ||
19 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
20 | |||
19 | #endif | 21 | #endif |
diff --git a/include/asm-s390/ebcdic.h b/include/asm-s390/ebcdic.h index 4cbc336e4d..15fd2eda6c 100644 --- a/include/asm-s390/ebcdic.h +++ b/include/asm-s390/ebcdic.h | |||
@@ -14,12 +14,12 @@ | |||
14 | #include <types.h> | 14 | #include <types.h> |
15 | #endif | 15 | #endif |
16 | 16 | ||
17 | extern __u8 _ascebc_500[]; /* ASCII -> EBCDIC 500 conversion table */ | 17 | extern __u8 _ascebc_500[256]; /* ASCII -> EBCDIC 500 conversion table */ |
18 | extern __u8 _ebcasc_500[]; /* EBCDIC 500 -> ASCII conversion table */ | 18 | extern __u8 _ebcasc_500[256]; /* EBCDIC 500 -> ASCII conversion table */ |
19 | extern __u8 _ascebc[]; /* ASCII -> EBCDIC conversion table */ | 19 | extern __u8 _ascebc[256]; /* ASCII -> EBCDIC conversion table */ |
20 | extern __u8 _ebcasc[]; /* EBCDIC -> ASCII conversion table */ | 20 | extern __u8 _ebcasc[256]; /* EBCDIC -> ASCII conversion table */ |
21 | extern __u8 _ebc_tolower[]; /* EBCDIC -> lowercase */ | 21 | extern __u8 _ebc_tolower[256]; /* EBCDIC -> lowercase */ |
22 | extern __u8 _ebc_toupper[]; /* EBCDIC -> uppercase */ | 22 | extern __u8 _ebc_toupper[256]; /* EBCDIC -> uppercase */ |
23 | 23 | ||
24 | static inline void | 24 | static inline void |
25 | codepage_convert(const __u8 *codepage, volatile __u8 * addr, unsigned long nr) | 25 | codepage_convert(const __u8 *codepage, volatile __u8 * addr, unsigned long nr) |
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h index 6a332a9f09..1802775568 100644 --- a/include/asm-s390/futex.h +++ b/include/asm-s390/futex.h | |||
@@ -1,6 +1,122 @@ | |||
1 | #ifndef _ASM_FUTEX_H | 1 | #ifndef _ASM_S390_FUTEX_H |
2 | #define _ASM_FUTEX_H | 2 | #define _ASM_S390_FUTEX_H |
3 | 3 | ||
4 | #include <asm-generic/futex.h> | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #endif | 6 | #include <linux/futex.h> |
7 | #include <asm/errno.h> | ||
8 | #include <asm/uaccess.h> | ||
9 | |||
10 | #ifndef __s390x__ | ||
11 | #define __futex_atomic_fixup \ | ||
12 | ".section __ex_table,\"a\"\n" \ | ||
13 | " .align 4\n" \ | ||
14 | " .long 0b,4b,2b,4b,3b,4b\n" \ | ||
15 | ".previous" | ||
16 | #else /* __s390x__ */ | ||
17 | #define __futex_atomic_fixup \ | ||
18 | ".section __ex_table,\"a\"\n" \ | ||
19 | " .align 8\n" \ | ||
20 | " .quad 0b,4b,2b,4b,3b,4b\n" \ | ||
21 | ".previous" | ||
22 | #endif /* __s390x__ */ | ||
23 | |||
24 | #define __futex_atomic_op(insn, ret, oldval, newval, uaddr, oparg) \ | ||
25 | asm volatile(" sacf 256\n" \ | ||
26 | "0: l %1,0(%6)\n" \ | ||
27 | "1: " insn \ | ||
28 | "2: cs %1,%2,0(%6)\n" \ | ||
29 | "3: jl 1b\n" \ | ||
30 | " lhi %0,0\n" \ | ||
31 | "4: sacf 0\n" \ | ||
32 | __futex_atomic_fixup \ | ||
33 | : "=d" (ret), "=&d" (oldval), "=&d" (newval), \ | ||
34 | "=m" (*uaddr) \ | ||
35 | : "0" (-EFAULT), "d" (oparg), "a" (uaddr), \ | ||
36 | "m" (*uaddr) : "cc" ); | ||
37 | |||
38 | static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | ||
39 | { | ||
40 | int op = (encoded_op >> 28) & 7; | ||
41 | int cmp = (encoded_op >> 24) & 15; | ||
42 | int oparg = (encoded_op << 8) >> 20; | ||
43 | int cmparg = (encoded_op << 20) >> 20; | ||
44 | int oldval = 0, newval, ret; | ||
45 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | ||
46 | oparg = 1 << oparg; | ||
47 | |||
48 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | ||
49 | return -EFAULT; | ||
50 | |||
51 | inc_preempt_count(); | ||
52 | |||
53 | switch (op) { | ||
54 | case FUTEX_OP_SET: | ||
55 | __futex_atomic_op("lr %2,%5\n", | ||
56 | ret, oldval, newval, uaddr, oparg); | ||
57 | break; | ||
58 | case FUTEX_OP_ADD: | ||
59 | __futex_atomic_op("lr %2,%1\nar %2,%5\n", | ||
60 | ret, oldval, newval, uaddr, oparg); | ||
61 | break; | ||
62 | case FUTEX_OP_OR: | ||
63 | __futex_atomic_op("lr %2,%1\nor %2,%5\n", | ||
64 | ret, oldval, newval, uaddr, oparg); | ||
65 | break; | ||
66 | case FUTEX_OP_ANDN: | ||
67 | __futex_atomic_op("lr %2,%1\nnr %2,%5\n", | ||
68 | ret, oldval, newval, uaddr, oparg); | ||
69 | break; | ||
70 | case FUTEX_OP_XOR: | ||
71 | __futex_atomic_op("lr %2,%1\nxr %2,%5\n", | ||
72 | ret, oldval, newval, uaddr, oparg); | ||
73 | break; | ||
74 | default: | ||
75 | ret = -ENOSYS; | ||
76 | } | ||
77 | |||
78 | dec_preempt_count(); | ||
79 | |||
80 | if (!ret) { | ||
81 | switch (cmp) { | ||
82 | case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; | ||
83 | case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; | ||
84 | case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; | ||
85 | case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; | ||
86 | case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; | ||
87 | case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; | ||
88 | default: ret = -ENOSYS; | ||
89 | } | ||
90 | } | ||
91 | return ret; | ||
92 | } | ||
93 | |||
94 | static inline int | ||
95 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | ||
96 | { | ||
97 | int ret; | ||
98 | |||
99 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | ||
100 | return -EFAULT; | ||
101 | asm volatile(" cs %1,%4,0(%5)\n" | ||
102 | "0: lr %0,%1\n" | ||
103 | "1:\n" | ||
104 | #ifndef __s390x__ | ||
105 | ".section __ex_table,\"a\"\n" | ||
106 | " .align 4\n" | ||
107 | " .long 0b,1b\n" | ||
108 | ".previous" | ||
109 | #else /* __s390x__ */ | ||
110 | ".section __ex_table,\"a\"\n" | ||
111 | " .align 8\n" | ||
112 | " .quad 0b,1b\n" | ||
113 | ".previous" | ||
114 | #endif /* __s390x__ */ | ||
115 | : "=d" (ret), "+d" (oldval), "=m" (*uaddr) | ||
116 | : "0" (-EFAULT), "d" (newval), "a" (uaddr), "m" (*uaddr) | ||
117 | : "cc", "memory" ); | ||
118 | return oldval; | ||
119 | } | ||
120 | |||
121 | #endif /* __KERNEL__ */ | ||
122 | #endif /* _ASM_S390_FUTEX_H */ | ||
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h index db0606c1ab..bea7279042 100644 --- a/include/asm-s390/lowcore.h +++ b/include/asm-s390/lowcore.h | |||
@@ -98,8 +98,8 @@ | |||
98 | #define __LC_KERNEL_ASCE 0xD58 | 98 | #define __LC_KERNEL_ASCE 0xD58 |
99 | #define __LC_USER_ASCE 0xD60 | 99 | #define __LC_USER_ASCE 0xD60 |
100 | #define __LC_PANIC_STACK 0xD68 | 100 | #define __LC_PANIC_STACK 0xD68 |
101 | #define __LC_CPUID 0xD90 | 101 | #define __LC_CPUID 0xD80 |
102 | #define __LC_CPUADDR 0xD98 | 102 | #define __LC_CPUADDR 0xD88 |
103 | #define __LC_IPLDEV 0xDB8 | 103 | #define __LC_IPLDEV 0xDB8 |
104 | #define __LC_JIFFY_TIMER 0xDC0 | 104 | #define __LC_JIFFY_TIMER 0xDC0 |
105 | #define __LC_CURRENT 0xDD8 | 105 | #define __LC_CURRENT 0xDD8 |
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index 657d582e81..41c2792ff6 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h | |||
@@ -296,8 +296,14 @@ | |||
296 | #define __NR_pselect6 301 | 296 | #define __NR_pselect6 301 |
297 | #define __NR_ppoll 302 | 297 | #define __NR_ppoll 302 |
298 | #define __NR_unshare 303 | 298 | #define __NR_unshare 303 |
299 | #define __NR_set_robust_list 304 | ||
300 | #define __NR_get_robust_list 305 | ||
301 | #define __NR_splice 306 | ||
302 | #define __NR_sync_file_range 307 | ||
303 | #define __NR_tee 308 | ||
304 | #define __NR_vmsplice 309 | ||
299 | 305 | ||
300 | #define NR_syscalls 304 | 306 | #define NR_syscalls 310 |
301 | 307 | ||
302 | /* | 308 | /* |
303 | * There are some system calls that are not present on 64 bit, some | 309 | * There are some system calls that are not present on 64 bit, some |
diff --git a/include/asm-sh/numnodes.h b/include/asm-sh/numnodes.h deleted file mode 100644 index f73e85b72e..0000000000 --- a/include/asm-sh/numnodes.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef _ASM_MAX_NUMNODES_H | ||
2 | #define _ASM_MAX_NUMNODES_H | ||
3 | |||
4 | /* Max 2 Nodes */ | ||
5 | #define NODES_SHIFT 1 | ||
6 | |||
7 | #endif /* _ASM_MAX_NUMNODES_H */ | ||
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index f2c8e14d1f..05520cebda 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -290,7 +290,7 @@ | |||
290 | #define __NR_mq_timedreceive (__NR_mq_open+3) | 290 | #define __NR_mq_timedreceive (__NR_mq_open+3) |
291 | #define __NR_mq_notify (__NR_mq_open+4) | 291 | #define __NR_mq_notify (__NR_mq_open+4) |
292 | #define __NR_mq_getsetattr (__NR_mq_open+5) | 292 | #define __NR_mq_getsetattr (__NR_mq_open+5) |
293 | #define __NR_sys_kexec_load 283 | 293 | #define __NR_kexec_load 283 |
294 | #define __NR_waitid 284 | 294 | #define __NR_waitid 284 |
295 | #define __NR_add_key 285 | 295 | #define __NR_add_key 285 |
296 | #define __NR_request_key 286 | 296 | #define __NR_request_key 286 |
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h index 2a1cfa404e..1f8f394ae3 100644 --- a/include/asm-sh64/unistd.h +++ b/include/asm-sh64/unistd.h | |||
@@ -333,7 +333,7 @@ | |||
333 | #define __NR_mq_timedreceive (__NR_mq_open+3) | 333 | #define __NR_mq_timedreceive (__NR_mq_open+3) |
334 | #define __NR_mq_notify (__NR_mq_open+4) | 334 | #define __NR_mq_notify (__NR_mq_open+4) |
335 | #define __NR_mq_getsetattr (__NR_mq_open+5) | 335 | #define __NR_mq_getsetattr (__NR_mq_open+5) |
336 | #define __NR_sys_kexec_load 311 | 336 | #define __NR_kexec_load 311 |
337 | #define __NR_waitid 312 | 337 | #define __NR_waitid 312 |
338 | #define __NR_add_key 313 | 338 | #define __NR_add_key 313 |
339 | #define __NR_request_key 314 | 339 | #define __NR_request_key 314 |
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 64ec640a40..45a5765077 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h | |||
@@ -41,7 +41,7 @@ | |||
41 | #define __NR_capset 22 /* Linux Specific */ | 41 | #define __NR_capset 22 /* Linux Specific */ |
42 | #define __NR_setuid 23 /* Implemented via setreuid in SunOS */ | 42 | #define __NR_setuid 23 /* Implemented via setreuid in SunOS */ |
43 | #define __NR_getuid 24 /* Common */ | 43 | #define __NR_getuid 24 /* Common */ |
44 | /* #define __NR_time alias 25 ENOSYS under SunOS */ | 44 | #define __NR_vmsplice 25 /* ENOSYS under SunOS */ |
45 | #define __NR_ptrace 26 /* Common */ | 45 | #define __NR_ptrace 26 /* Common */ |
46 | #define __NR_alarm 27 /* Implemented via setitimer in SunOS */ | 46 | #define __NR_alarm 27 /* Implemented via setitimer in SunOS */ |
47 | #define __NR_sigaltstack 28 /* Common */ | 47 | #define __NR_sigaltstack 28 /* Common */ |
@@ -180,7 +180,7 @@ | |||
180 | #define __NR_sched_get_affinity 161 /* Linux specific, getfh under SunOS */ | 180 | #define __NR_sched_get_affinity 161 /* Linux specific, getfh under SunOS */ |
181 | #define __NR_getdomainname 162 /* SunOS Specific */ | 181 | #define __NR_getdomainname 162 /* SunOS Specific */ |
182 | #define __NR_setdomainname 163 /* Common */ | 182 | #define __NR_setdomainname 163 /* Common */ |
183 | /* #define __NR_ni_syscall 164 ENOSYS under SunOS */ | 183 | /* #define __NR_utrap_install 164 Linux sparc64 specific */ |
184 | #define __NR_quotactl 165 /* Common */ | 184 | #define __NR_quotactl 165 /* Common */ |
185 | #define __NR_set_tid_address 166 /* Linux specific, exportfs under SunOS */ | 185 | #define __NR_set_tid_address 166 /* Linux specific, exportfs under SunOS */ |
186 | #define __NR_mount 167 /* Common */ | 186 | #define __NR_mount 167 /* Common */ |
@@ -248,7 +248,7 @@ | |||
248 | #define __NR_setfsgid 229 /* Linux Specific */ | 248 | #define __NR_setfsgid 229 /* Linux Specific */ |
249 | #define __NR__newselect 230 /* Linux Specific */ | 249 | #define __NR__newselect 230 /* Linux Specific */ |
250 | #define __NR_time 231 /* Linux Specific */ | 250 | #define __NR_time 231 /* Linux Specific */ |
251 | /* #define __NR_oldstat 232 Linux Specific */ | 251 | #define __NR_splice 232 /* Linux Specific */ |
252 | #define __NR_stime 233 /* Linux Specific */ | 252 | #define __NR_stime 233 /* Linux Specific */ |
253 | #define __NR_statfs64 234 /* Linux Specific */ | 253 | #define __NR_statfs64 234 /* Linux Specific */ |
254 | #define __NR_fstatfs64 235 /* Linux Specific */ | 254 | #define __NR_fstatfs64 235 /* Linux Specific */ |
@@ -271,7 +271,7 @@ | |||
271 | #define __NR_getsid 252 | 271 | #define __NR_getsid 252 |
272 | #define __NR_fdatasync 253 | 272 | #define __NR_fdatasync 253 |
273 | #define __NR_nfsservctl 254 | 273 | #define __NR_nfsservctl 254 |
274 | #define __NR_aplib 255 | 274 | #define __NR_sync_file_range 255 |
275 | #define __NR_clock_settime 256 | 275 | #define __NR_clock_settime 256 |
276 | #define __NR_clock_gettime 257 | 276 | #define __NR_clock_gettime 257 |
277 | #define __NR_clock_getres 258 | 277 | #define __NR_clock_getres 258 |
@@ -296,7 +296,7 @@ | |||
296 | #define __NR_mq_notify 277 | 296 | #define __NR_mq_notify 277 |
297 | #define __NR_mq_getsetattr 278 | 297 | #define __NR_mq_getsetattr 278 |
298 | #define __NR_waitid 279 | 298 | #define __NR_waitid 279 |
299 | #define __NR_sys_setaltroot 280 | 299 | #define __NR_tee 280 |
300 | #define __NR_add_key 281 | 300 | #define __NR_add_key 281 |
301 | #define __NR_request_key 282 | 301 | #define __NR_request_key 282 |
302 | #define __NR_keyctl 283 | 302 | #define __NR_keyctl 283 |
@@ -316,11 +316,13 @@ | |||
316 | #define __NR_pselect6 297 | 316 | #define __NR_pselect6 297 |
317 | #define __NR_ppoll 298 | 317 | #define __NR_ppoll 298 |
318 | #define __NR_unshare 299 | 318 | #define __NR_unshare 299 |
319 | #define __NR_set_robust_list 300 | ||
320 | #define __NR_get_robust_list 301 | ||
319 | 321 | ||
320 | /* WARNING: You MAY NOT add syscall numbers larger than 299, since | 322 | /* WARNING: You MAY NOT add syscall numbers larger than 301, since |
321 | * all of the syscall tables in the Sparc kernel are | 323 | * all of the syscall tables in the Sparc kernel are |
322 | * sized to have 299 entries (starting at zero). Therefore | 324 | * sized to have 301 entries (starting at zero). Therefore |
323 | * find a free slot in the 0-299 range. | 325 | * find a free slot in the 0-301 range. |
324 | */ | 326 | */ |
325 | 327 | ||
326 | #define _syscall0(type,name) \ | 328 | #define _syscall0(type,name) \ |
diff --git a/include/asm-sparc/vga.h b/include/asm-sparc/vga.h new file mode 100644 index 0000000000..c69d5b2ba1 --- /dev/null +++ b/include/asm-sparc/vga.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Access to VGA videoram | ||
3 | * | ||
4 | * (c) 1998 Martin Mares <mj@ucw.cz> | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_ASM_VGA_H_ | ||
8 | #define _LINUX_ASM_VGA_H_ | ||
9 | |||
10 | #include <asm/types.h> | ||
11 | |||
12 | #define VT_BUF_HAVE_RW | ||
13 | |||
14 | #undef scr_writew | ||
15 | #undef scr_readw | ||
16 | |||
17 | static inline void scr_writew(u16 val, u16 *addr) | ||
18 | { | ||
19 | BUG_ON((long) addr >= 0); | ||
20 | |||
21 | *addr = val; | ||
22 | } | ||
23 | |||
24 | static inline u16 scr_readw(const u16 *addr) | ||
25 | { | ||
26 | BUG_ON((long) addr >= 0); | ||
27 | |||
28 | return *addr; | ||
29 | } | ||
30 | |||
31 | #define VGA_MAP_MEM(x,s) (x) | ||
32 | |||
33 | #endif | ||
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index c7d5804ba7..a8d39f23d4 100644 --- a/include/asm-sparc64/dma-mapping.h +++ b/include/asm-sparc64/dma-mapping.h | |||
@@ -4,7 +4,146 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | 5 | ||
6 | #ifdef CONFIG_PCI | 6 | #ifdef CONFIG_PCI |
7 | #include <asm-generic/dma-mapping.h> | 7 | |
8 | /* we implement the API below in terms of the existing PCI one, | ||
9 | * so include it */ | ||
10 | #include <linux/pci.h> | ||
11 | /* need struct page definitions */ | ||
12 | #include <linux/mm.h> | ||
13 | |||
14 | static inline int | ||
15 | dma_supported(struct device *dev, u64 mask) | ||
16 | { | ||
17 | BUG_ON(dev->bus != &pci_bus_type); | ||
18 | |||
19 | return pci_dma_supported(to_pci_dev(dev), mask); | ||
20 | } | ||
21 | |||
22 | static inline int | ||
23 | dma_set_mask(struct device *dev, u64 dma_mask) | ||
24 | { | ||
25 | BUG_ON(dev->bus != &pci_bus_type); | ||
26 | |||
27 | return pci_set_dma_mask(to_pci_dev(dev), dma_mask); | ||
28 | } | ||
29 | |||
30 | static inline void * | ||
31 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | ||
32 | gfp_t flag) | ||
33 | { | ||
34 | BUG_ON(dev->bus != &pci_bus_type); | ||
35 | |||
36 | return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag); | ||
37 | } | ||
38 | |||
39 | static inline void | ||
40 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | ||
41 | dma_addr_t dma_handle) | ||
42 | { | ||
43 | BUG_ON(dev->bus != &pci_bus_type); | ||
44 | |||
45 | pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); | ||
46 | } | ||
47 | |||
48 | static inline dma_addr_t | ||
49 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, | ||
50 | enum dma_data_direction direction) | ||
51 | { | ||
52 | BUG_ON(dev->bus != &pci_bus_type); | ||
53 | |||
54 | return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); | ||
55 | } | ||
56 | |||
57 | static inline void | ||
58 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | ||
59 | enum dma_data_direction direction) | ||
60 | { | ||
61 | BUG_ON(dev->bus != &pci_bus_type); | ||
62 | |||
63 | pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); | ||
64 | } | ||
65 | |||
66 | static inline dma_addr_t | ||
67 | dma_map_page(struct device *dev, struct page *page, | ||
68 | unsigned long offset, size_t size, | ||
69 | enum dma_data_direction direction) | ||
70 | { | ||
71 | BUG_ON(dev->bus != &pci_bus_type); | ||
72 | |||
73 | return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); | ||
74 | } | ||
75 | |||
76 | static inline void | ||
77 | dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, | ||
78 | enum dma_data_direction direction) | ||
79 | { | ||
80 | BUG_ON(dev->bus != &pci_bus_type); | ||
81 | |||
82 | pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); | ||
83 | } | ||
84 | |||
85 | static inline int | ||
86 | dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | ||
87 | enum dma_data_direction direction) | ||
88 | { | ||
89 | BUG_ON(dev->bus != &pci_bus_type); | ||
90 | |||
91 | return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); | ||
92 | } | ||
93 | |||
94 | static inline void | ||
95 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, | ||
96 | enum dma_data_direction direction) | ||
97 | { | ||
98 | BUG_ON(dev->bus != &pci_bus_type); | ||
99 | |||
100 | pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); | ||
101 | } | ||
102 | |||
103 | static inline void | ||
104 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
105 | enum dma_data_direction direction) | ||
106 | { | ||
107 | BUG_ON(dev->bus != &pci_bus_type); | ||
108 | |||
109 | pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle, | ||
110 | size, (int)direction); | ||
111 | } | ||
112 | |||
113 | static inline void | ||
114 | dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
115 | enum dma_data_direction direction) | ||
116 | { | ||
117 | BUG_ON(dev->bus != &pci_bus_type); | ||
118 | |||
119 | pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle, | ||
120 | size, (int)direction); | ||
121 | } | ||
122 | |||
123 | static inline void | ||
124 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, | ||
125 | enum dma_data_direction direction) | ||
126 | { | ||
127 | BUG_ON(dev->bus != &pci_bus_type); | ||
128 | |||
129 | pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction); | ||
130 | } | ||
131 | |||
132 | static inline void | ||
133 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, | ||
134 | enum dma_data_direction direction) | ||
135 | { | ||
136 | BUG_ON(dev->bus != &pci_bus_type); | ||
137 | |||
138 | pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction); | ||
139 | } | ||
140 | |||
141 | static inline int | ||
142 | dma_mapping_error(dma_addr_t dma_addr) | ||
143 | { | ||
144 | return pci_dma_mapping_error(dma_addr); | ||
145 | } | ||
146 | |||
8 | #else | 147 | #else |
9 | 148 | ||
10 | struct device; | 149 | struct device; |
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 7c5a589ea4..e1ea67bc32 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h | |||
@@ -42,7 +42,7 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) | |||
42 | struct pci_dev; | 42 | struct pci_dev; |
43 | 43 | ||
44 | struct pci_iommu_ops { | 44 | struct pci_iommu_ops { |
45 | void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *); | 45 | void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *, gfp_t); |
46 | void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); | 46 | void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); |
47 | dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); | 47 | dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); |
48 | void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); | 48 | void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); |
@@ -59,7 +59,7 @@ extern struct pci_iommu_ops *pci_iommu_ops; | |||
59 | */ | 59 | */ |
60 | static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) | 60 | static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) |
61 | { | 61 | { |
62 | return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle); | 62 | return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle, GFP_ATOMIC); |
63 | } | 63 | } |
64 | 64 | ||
65 | /* Free and unmap a consistent DMA buffer. | 65 | /* Free and unmap a consistent DMA buffer. |
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h index 82032e159a..baef13b589 100644 --- a/include/asm-sparc64/percpu.h +++ b/include/asm-sparc64/percpu.h | |||
@@ -26,7 +26,7 @@ register unsigned long __local_per_cpu_offset asm("g5"); | |||
26 | #define percpu_modcopy(pcpudst, src, size) \ | 26 | #define percpu_modcopy(pcpudst, src, size) \ |
27 | do { \ | 27 | do { \ |
28 | unsigned int __i; \ | 28 | unsigned int __i; \ |
29 | for_each_cpu(__i) \ | 29 | for_each_possible_cpu(__i) \ |
30 | memcpy((pcpudst)+__per_cpu_offset(__i), \ | 30 | memcpy((pcpudst)+__per_cpu_offset(__i), \ |
31 | (src), (size)); \ | 31 | (src), (size)); \ |
32 | } while (0) | 32 | } while (0) |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index c44e746653..cd464f469a 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -689,6 +689,23 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *p | |||
689 | #define pte_clear(mm,addr,ptep) \ | 689 | #define pte_clear(mm,addr,ptep) \ |
690 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) | 690 | set_pte_at((mm), (addr), (ptep), __pte(0UL)) |
691 | 691 | ||
692 | #ifdef DCACHE_ALIASING_POSSIBLE | ||
693 | #define __HAVE_ARCH_MOVE_PTE | ||
694 | #define move_pte(pte, prot, old_addr, new_addr) \ | ||
695 | ({ \ | ||
696 | pte_t newpte = (pte); \ | ||
697 | if (tlb_type != hypervisor && pte_present(pte)) { \ | ||
698 | unsigned long this_pfn = pte_pfn(pte); \ | ||
699 | \ | ||
700 | if (pfn_valid(this_pfn) && \ | ||
701 | (((old_addr) ^ (new_addr)) & (1 << 13))) \ | ||
702 | flush_dcache_page_all(current->mm, \ | ||
703 | pfn_to_page(this_pfn)); \ | ||
704 | } \ | ||
705 | newpte; \ | ||
706 | }) | ||
707 | #endif | ||
708 | |||
692 | extern pgd_t swapper_pg_dir[2048]; | 709 | extern pgd_t swapper_pg_dir[2048]; |
693 | extern pmd_t swapper_low_pmd_dir[2048]; | 710 | extern pmd_t swapper_low_pmd_dir[2048]; |
694 | 711 | ||
diff --git a/include/asm-sparc64/tlbflush.h b/include/asm-sparc64/tlbflush.h index 9ad5d9c51d..e3a7c453b5 100644 --- a/include/asm-sparc64/tlbflush.h +++ b/include/asm-sparc64/tlbflush.h | |||
@@ -22,8 +22,6 @@ extern void flush_tlb_pending(void); | |||
22 | /* Local cpu only. */ | 22 | /* Local cpu only. */ |
23 | extern void __flush_tlb_all(void); | 23 | extern void __flush_tlb_all(void); |
24 | 24 | ||
25 | extern void __flush_tlb_page(unsigned long context, unsigned long page, unsigned long r); | ||
26 | |||
27 | extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end); | 25 | extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end); |
28 | 26 | ||
29 | #ifndef CONFIG_SMP | 27 | #ifndef CONFIG_SMP |
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index a284986b15..998ef4ab0e 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -41,7 +41,7 @@ | |||
41 | #define __NR_capset 22 /* Linux Specific */ | 41 | #define __NR_capset 22 /* Linux Specific */ |
42 | #define __NR_setuid 23 /* Implemented via setreuid in SunOS */ | 42 | #define __NR_setuid 23 /* Implemented via setreuid in SunOS */ |
43 | #define __NR_getuid 24 /* Common */ | 43 | #define __NR_getuid 24 /* Common */ |
44 | /* #define __NR_time alias 25 ENOSYS under SunOS */ | 44 | #define __NR_vmsplice 25 /* ENOSYS under SunOS */ |
45 | #define __NR_ptrace 26 /* Common */ | 45 | #define __NR_ptrace 26 /* Common */ |
46 | #define __NR_alarm 27 /* Implemented via setitimer in SunOS */ | 46 | #define __NR_alarm 27 /* Implemented via setitimer in SunOS */ |
47 | #define __NR_sigaltstack 28 /* Common */ | 47 | #define __NR_sigaltstack 28 /* Common */ |
@@ -250,7 +250,7 @@ | |||
250 | #ifdef __KERNEL__ | 250 | #ifdef __KERNEL__ |
251 | #define __NR_time 231 /* Linux sparc32 */ | 251 | #define __NR_time 231 /* Linux sparc32 */ |
252 | #endif | 252 | #endif |
253 | /* #define __NR_oldstat 232 Linux Specific */ | 253 | #define __NR_splice 232 /* Linux Specific */ |
254 | #define __NR_stime 233 /* Linux Specific */ | 254 | #define __NR_stime 233 /* Linux Specific */ |
255 | #define __NR_statfs64 234 /* Linux Specific */ | 255 | #define __NR_statfs64 234 /* Linux Specific */ |
256 | #define __NR_fstatfs64 235 /* Linux Specific */ | 256 | #define __NR_fstatfs64 235 /* Linux Specific */ |
@@ -273,7 +273,7 @@ | |||
273 | #define __NR_getsid 252 | 273 | #define __NR_getsid 252 |
274 | #define __NR_fdatasync 253 | 274 | #define __NR_fdatasync 253 |
275 | #define __NR_nfsservctl 254 | 275 | #define __NR_nfsservctl 254 |
276 | #define __NR_aplib 255 | 276 | #define __NR_sync_file_range 255 |
277 | #define __NR_clock_settime 256 | 277 | #define __NR_clock_settime 256 |
278 | #define __NR_clock_gettime 257 | 278 | #define __NR_clock_gettime 257 |
279 | #define __NR_clock_getres 258 | 279 | #define __NR_clock_getres 258 |
@@ -298,7 +298,7 @@ | |||
298 | #define __NR_mq_notify 277 | 298 | #define __NR_mq_notify 277 |
299 | #define __NR_mq_getsetattr 278 | 299 | #define __NR_mq_getsetattr 278 |
300 | #define __NR_waitid 279 | 300 | #define __NR_waitid 279 |
301 | /*#define __NR_sys_setaltroot 280 available (was setaltroot) */ | 301 | #define __NR_tee 280 |
302 | #define __NR_add_key 281 | 302 | #define __NR_add_key 281 |
303 | #define __NR_request_key 282 | 303 | #define __NR_request_key 282 |
304 | #define __NR_keyctl 283 | 304 | #define __NR_keyctl 283 |
@@ -318,11 +318,13 @@ | |||
318 | #define __NR_pselect6 297 | 318 | #define __NR_pselect6 297 |
319 | #define __NR_ppoll 298 | 319 | #define __NR_ppoll 298 |
320 | #define __NR_unshare 299 | 320 | #define __NR_unshare 299 |
321 | #define __NR_set_robust_list 300 | ||
322 | #define __NR_get_robust_list 301 | ||
321 | 323 | ||
322 | /* WARNING: You MAY NOT add syscall numbers larger than 299, since | 324 | /* WARNING: You MAY NOT add syscall numbers larger than 301, since |
323 | * all of the syscall tables in the Sparc kernel are | 325 | * all of the syscall tables in the Sparc kernel are |
324 | * sized to have 299 entries (starting at zero). Therefore | 326 | * sized to have 301 entries (starting at zero). Therefore |
325 | * find a free slot in the 0-299 range. | 327 | * find a free slot in the 0-301 range. |
326 | */ | 328 | */ |
327 | 329 | ||
328 | #define _syscall0(type,name) \ | 330 | #define _syscall0(type,name) \ |
diff --git a/include/asm-um/irqflags.h b/include/asm-um/irqflags.h new file mode 100644 index 0000000000..659b9abdfd --- /dev/null +++ b/include/asm-um/irqflags.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef __UM_IRQFLAGS_H | ||
2 | #define __UM_IRQFLAGS_H | ||
3 | |||
4 | /* Empty for now */ | ||
5 | |||
6 | #endif | ||
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h index 30656c962d..6e2528bb00 100644 --- a/include/asm-um/ptrace-i386.h +++ b/include/asm-um/ptrace-i386.h | |||
@@ -56,6 +56,9 @@ extern int do_get_thread_area_tt(struct user_desc *info); | |||
56 | extern int arch_switch_tls_skas(struct task_struct *from, struct task_struct *to); | 56 | extern int arch_switch_tls_skas(struct task_struct *from, struct task_struct *to); |
57 | extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to); | 57 | extern int arch_switch_tls_tt(struct task_struct *from, struct task_struct *to); |
58 | 58 | ||
59 | extern void arch_switch_to_tt(struct task_struct *from, struct task_struct *to); | ||
60 | extern void arch_switch_to_skas(struct task_struct *from, struct task_struct *to); | ||
61 | |||
59 | static inline int do_get_thread_area(struct user_desc *info) | 62 | static inline int do_get_thread_area(struct user_desc *info) |
60 | { | 63 | { |
61 | return CHOOSE_MODE_PROC(do_get_thread_area_tt, do_get_thread_area_skas, info); | 64 | return CHOOSE_MODE_PROC(do_get_thread_area_tt, do_get_thread_area_skas, info); |
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h index bea5a015f6..16c734af91 100644 --- a/include/asm-um/uaccess.h +++ b/include/asm-um/uaccess.h | |||
@@ -41,11 +41,11 @@ | |||
41 | 41 | ||
42 | #define __get_user(x, ptr) \ | 42 | #define __get_user(x, ptr) \ |
43 | ({ \ | 43 | ({ \ |
44 | const __typeof__(ptr) __private_ptr = ptr; \ | 44 | const __typeof__(*(ptr)) __user *__private_ptr = (ptr); \ |
45 | __typeof__(x) __private_val; \ | 45 | __typeof__(x) __private_val; \ |
46 | int __private_ret = -EFAULT; \ | 46 | int __private_ret = -EFAULT; \ |
47 | (x) = (__typeof__(*(__private_ptr)))0; \ | 47 | (x) = (__typeof__(*(__private_ptr)))0; \ |
48 | if (__copy_from_user((void *) &__private_val, (__private_ptr), \ | 48 | if (__copy_from_user((__force void *)&__private_val, (__private_ptr),\ |
49 | sizeof(*(__private_ptr))) == 0) { \ | 49 | sizeof(*(__private_ptr))) == 0) { \ |
50 | (x) = (__typeof__(*(__private_ptr))) __private_val; \ | 50 | (x) = (__typeof__(*(__private_ptr))) __private_val; \ |
51 | __private_ret = 0; \ | 51 | __private_ret = 0; \ |
@@ -62,7 +62,7 @@ | |||
62 | 62 | ||
63 | #define __put_user(x, ptr) \ | 63 | #define __put_user(x, ptr) \ |
64 | ({ \ | 64 | ({ \ |
65 | __typeof__(ptr) __private_ptr = ptr; \ | 65 | __typeof__(*(ptr)) __user *__private_ptr = ptr; \ |
66 | __typeof__(*(__private_ptr)) __private_val; \ | 66 | __typeof__(*(__private_ptr)) __private_val; \ |
67 | int __private_ret = -EFAULT; \ | 67 | int __private_ret = -EFAULT; \ |
68 | __private_val = (__typeof__(*(__private_ptr))) (x); \ | 68 | __private_val = (__typeof__(*(__private_ptr))) (x); \ |
diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h index 107decbd6e..7091af4b78 100644 --- a/include/asm-v850/system.h +++ b/include/asm-v850/system.h | |||
@@ -18,8 +18,6 @@ | |||
18 | #include <asm/ptrace.h> | 18 | #include <asm/ptrace.h> |
19 | 19 | ||
20 | 20 | ||
21 | #define prepare_to_switch() do { } while (0) | ||
22 | |||
23 | /* | 21 | /* |
24 | * switch_to(n) should switch tasks to task ptr, first checking that | 22 | * switch_to(n) should switch tasks to task ptr, first checking that |
25 | * ptr isn't the current task, in which case it does nothing. | 23 | * ptr isn't the current task, in which case it does nothing. |
diff --git a/include/asm-x86_64/cache.h b/include/asm-x86_64/cache.h index c8043a1615..f8dff1c675 100644 --- a/include/asm-x86_64/cache.h +++ b/include/asm-x86_64/cache.h | |||
@@ -20,8 +20,8 @@ | |||
20 | __attribute__((__section__(".data.page_aligned"))) | 20 | __attribute__((__section__(".data.page_aligned"))) |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
24 | |||
25 | #endif | 23 | #endif |
26 | 24 | ||
25 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
26 | |||
27 | #endif | 27 | #endif |
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h index 76bb6193ae..662964b74e 100644 --- a/include/asm-x86_64/cpufeature.h +++ b/include/asm-x86_64/cpufeature.h | |||
@@ -64,6 +64,7 @@ | |||
64 | #define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */ | 64 | #define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */ |
65 | #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ | 65 | #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ |
66 | #define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ | 66 | #define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ |
67 | #define X86_FEATURE_FXSAVE_LEAK (3*32+7) /* FIP/FOP/FDP leaks through FXSAVE */ | ||
67 | 68 | ||
68 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 69 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
69 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 70 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h index 8dcc326652..670a3388e7 100644 --- a/include/asm-x86_64/e820.h +++ b/include/asm-x86_64/e820.h | |||
@@ -47,7 +47,8 @@ extern void contig_e820_setup(void); | |||
47 | extern unsigned long e820_end_of_ram(void); | 47 | extern unsigned long e820_end_of_ram(void); |
48 | extern void e820_reserve_resources(void); | 48 | extern void e820_reserve_resources(void); |
49 | extern void e820_print_map(char *who); | 49 | extern void e820_print_map(char *who); |
50 | extern int e820_mapped(unsigned long start, unsigned long end, unsigned type); | 50 | extern int e820_any_mapped(unsigned long start, unsigned long end, unsigned type); |
51 | extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned type); | ||
51 | 52 | ||
52 | extern void e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end); | 53 | extern void e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end); |
53 | extern void e820_setup_gap(void); | 54 | extern void e820_setup_gap(void); |
@@ -58,6 +59,8 @@ extern void __init parse_memopt(char *p, char **end); | |||
58 | extern void __init parse_memmapopt(char *p, char **end); | 59 | extern void __init parse_memmapopt(char *p, char **end); |
59 | 60 | ||
60 | extern struct e820map e820; | 61 | extern struct e820map e820; |
62 | |||
63 | extern unsigned ebda_addr, ebda_size; | ||
61 | #endif/*!__ASSEMBLY__*/ | 64 | #endif/*!__ASSEMBLY__*/ |
62 | 65 | ||
63 | #endif/*__E820_HEADER*/ | 66 | #endif/*__E820_HEADER*/ |
diff --git a/include/asm-x86_64/elf.h b/include/asm-x86_64/elf.h index c98633af07..b4f8f4a41a 100644 --- a/include/asm-x86_64/elf.h +++ b/include/asm-x86_64/elf.h | |||
@@ -159,7 +159,7 @@ extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *); | |||
159 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) | 159 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) |
160 | 160 | ||
161 | /* 1GB for 64bit, 8MB for 32bit */ | 161 | /* 1GB for 64bit, 8MB for 32bit */ |
162 | #define STACK_RND_MASK (is_compat_task() ? 0x7ff : 0x3fffff) | 162 | #define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff) |
163 | 163 | ||
164 | #endif | 164 | #endif |
165 | 165 | ||
diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h index 08b75c1526..18ff7ee9e7 100644 --- a/include/asm-x86_64/hpet.h +++ b/include/asm-x86_64/hpet.h | |||
@@ -51,6 +51,8 @@ | |||
51 | 51 | ||
52 | #define HPET_TN_ROUTE_SHIFT 9 | 52 | #define HPET_TN_ROUTE_SHIFT 9 |
53 | 53 | ||
54 | #define HPET_TICK_RATE (HZ * 100000UL) | ||
55 | |||
54 | extern int is_hpet_enabled(void); | 56 | extern int is_hpet_enabled(void); |
55 | extern int hpet_rtc_timer_init(void); | 57 | extern int hpet_rtc_timer_init(void); |
56 | extern int oem_force_hpet_timer(void); | 58 | extern int oem_force_hpet_timer(void); |
diff --git a/include/asm-x86_64/i387.h b/include/asm-x86_64/i387.h index 876eb9a2fe..cba8a3b0cd 100644 --- a/include/asm-x86_64/i387.h +++ b/include/asm-x86_64/i387.h | |||
@@ -72,6 +72,23 @@ extern int set_fpregs(struct task_struct *tsk, | |||
72 | #define set_fpu_swd(t,val) ((t)->thread.i387.fxsave.swd = (val)) | 72 | #define set_fpu_swd(t,val) ((t)->thread.i387.fxsave.swd = (val)) |
73 | #define set_fpu_fxsr_twd(t,val) ((t)->thread.i387.fxsave.twd = (val)) | 73 | #define set_fpu_fxsr_twd(t,val) ((t)->thread.i387.fxsave.twd = (val)) |
74 | 74 | ||
75 | #define X87_FSW_ES (1 << 7) /* Exception Summary */ | ||
76 | |||
77 | /* AMD CPUs don't save/restore FDP/FIP/FOP unless an exception | ||
78 | is pending. Clear the x87 state here by setting it to fixed | ||
79 | values. The kernel data segment can be sometimes 0 and sometimes | ||
80 | new user value. Both should be ok. | ||
81 | Use the PDA as safe address because it should be already in L1. */ | ||
82 | static inline void clear_fpu_state(struct i387_fxsave_struct *fx) | ||
83 | { | ||
84 | if (unlikely(fx->swd & X87_FSW_ES)) | ||
85 | asm volatile("fnclex"); | ||
86 | alternative_input(ASM_NOP8 ASM_NOP2, | ||
87 | " emms\n" /* clear stack tags */ | ||
88 | " fildl %%gs:0", /* load to clear state */ | ||
89 | X86_FEATURE_FXSAVE_LEAK); | ||
90 | } | ||
91 | |||
75 | static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) | 92 | static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) |
76 | { | 93 | { |
77 | int err; | 94 | int err; |
@@ -119,6 +136,7 @@ static inline int save_i387_checking(struct i387_fxsave_struct __user *fx) | |||
119 | #endif | 136 | #endif |
120 | if (unlikely(err)) | 137 | if (unlikely(err)) |
121 | __clear_user(fx, sizeof(struct i387_fxsave_struct)); | 138 | __clear_user(fx, sizeof(struct i387_fxsave_struct)); |
139 | /* No need to clear here because the caller clears USED_MATH */ | ||
122 | return err; | 140 | return err; |
123 | } | 141 | } |
124 | 142 | ||
@@ -149,7 +167,7 @@ static inline void __fxsave_clear(struct task_struct *tsk) | |||
149 | "i" (offsetof(__typeof__(*tsk), | 167 | "i" (offsetof(__typeof__(*tsk), |
150 | thread.i387.fxsave))); | 168 | thread.i387.fxsave))); |
151 | #endif | 169 | #endif |
152 | __asm__ __volatile__("fnclex"); | 170 | clear_fpu_state(&tsk->thread.i387.fxsave); |
153 | } | 171 | } |
154 | 172 | ||
155 | static inline void kernel_fpu_begin(void) | 173 | static inline void kernel_fpu_begin(void) |
diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h index eeb2bcd635..b4f4b172b1 100644 --- a/include/asm-x86_64/ia32_unistd.h +++ b/include/asm-x86_64/ia32_unistd.h | |||
@@ -317,6 +317,4 @@ | |||
317 | #define __NR_ia32_ppoll 309 | 317 | #define __NR_ia32_ppoll 309 |
318 | #define __NR_ia32_unshare 310 | 318 | #define __NR_ia32_unshare 310 |
319 | 319 | ||
320 | #define IA32_NR_syscalls 315 /* must be > than biggest syscall! */ | ||
321 | |||
322 | #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ | 320 | #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ |
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index cafdfb37f0..a05da8a50b 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h | |||
@@ -177,7 +177,7 @@ static inline __u16 __readw(const volatile void __iomem *addr) | |||
177 | { | 177 | { |
178 | return *(__force volatile __u16 *)addr; | 178 | return *(__force volatile __u16 *)addr; |
179 | } | 179 | } |
180 | static inline __u32 __readl(const volatile void __iomem *addr) | 180 | static __always_inline __u32 __readl(const volatile void __iomem *addr) |
181 | { | 181 | { |
182 | return *(__force volatile __u32 *)addr; | 182 | return *(__force volatile __u32 *)addr; |
183 | } | 183 | } |
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h index ee1bc69aec..52484e82c6 100644 --- a/include/asm-x86_64/io_apic.h +++ b/include/asm-x86_64/io_apic.h | |||
@@ -205,6 +205,7 @@ extern int skip_ioapic_setup; | |||
205 | extern int io_apic_get_version (int ioapic); | 205 | extern int io_apic_get_version (int ioapic); |
206 | extern int io_apic_get_redir_entries (int ioapic); | 206 | extern int io_apic_get_redir_entries (int ioapic); |
207 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); | 207 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); |
208 | extern int timer_uses_ioapic_pin_0; | ||
208 | #endif | 209 | #endif |
209 | 210 | ||
210 | extern int sis_apic_bug; /* dummy */ | 211 | extern int sis_apic_bug; /* dummy */ |
diff --git a/include/asm-x86_64/mce.h b/include/asm-x86_64/mce.h index 5d298b799a..7229785094 100644 --- a/include/asm-x86_64/mce.h +++ b/include/asm-x86_64/mce.h | |||
@@ -70,6 +70,9 @@ struct mce_log { | |||
70 | #define MCE_THRESHOLD_BASE MCE_EXTENDED_BANK + 1 /* MCE_AMD */ | 70 | #define MCE_THRESHOLD_BASE MCE_EXTENDED_BANK + 1 /* MCE_AMD */ |
71 | #define MCE_THRESHOLD_DRAM_ECC MCE_THRESHOLD_BASE + 4 | 71 | #define MCE_THRESHOLD_DRAM_ECC MCE_THRESHOLD_BASE + 4 |
72 | 72 | ||
73 | #ifdef __KERNEL__ | ||
74 | #include <asm/atomic.h> | ||
75 | |||
73 | void mce_log(struct mce *m); | 76 | void mce_log(struct mce *m); |
74 | #ifdef CONFIG_X86_MCE_INTEL | 77 | #ifdef CONFIG_X86_MCE_INTEL |
75 | void mce_intel_feature_init(struct cpuinfo_x86 *c); | 78 | void mce_intel_feature_init(struct cpuinfo_x86 *c); |
@@ -87,4 +90,8 @@ static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) | |||
87 | } | 90 | } |
88 | #endif | 91 | #endif |
89 | 92 | ||
93 | extern atomic_t mce_entry; | ||
94 | |||
95 | #endif | ||
96 | |||
90 | #endif | 97 | #endif |
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index 6b18cd8f29..6944e7122d 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h | |||
@@ -12,7 +12,8 @@ | |||
12 | 12 | ||
13 | #include <asm/smp.h> | 13 | #include <asm/smp.h> |
14 | 14 | ||
15 | #define NODEMAPSIZE 0xfff | 15 | /* Should really switch to dynamic allocation at some point */ |
16 | #define NODEMAPSIZE 0x4fff | ||
16 | 17 | ||
17 | /* Simple perfect hash to map physical addresses to node numbers */ | 18 | /* Simple perfect hash to map physical addresses to node numbers */ |
18 | struct memnode { | 19 | struct memnode { |
diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h index f6cbb4cbb5..1cc92fe025 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86_64/numa.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _ASM_X8664_NUMA_H 1 | 2 | #define _ASM_X8664_NUMA_H 1 |
3 | 3 | ||
4 | #include <linux/nodemask.h> | 4 | #include <linux/nodemask.h> |
5 | #include <asm/numnodes.h> | ||
6 | 5 | ||
7 | struct bootnode { | 6 | struct bootnode { |
8 | u64 start,end; | 7 | u64 start,end; |
@@ -18,6 +17,8 @@ extern void numa_init_array(void); | |||
18 | extern int numa_off; | 17 | extern int numa_off; |
19 | 18 | ||
20 | extern void numa_set_node(int cpu, int node); | 19 | extern void numa_set_node(int cpu, int node); |
20 | extern void srat_reserve_add_area(int nodeid); | ||
21 | extern int hotadd_percent; | ||
21 | 22 | ||
22 | extern unsigned char apicid_to_node[256]; | 23 | extern unsigned char apicid_to_node[256]; |
23 | #ifdef CONFIG_NUMA | 24 | #ifdef CONFIG_NUMA |
diff --git a/include/asm-x86_64/numnodes.h b/include/asm-x86_64/numnodes.h deleted file mode 100644 index 32be16b8ae..0000000000 --- a/include/asm-x86_64/numnodes.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef _ASM_X8664_NUMNODES_H | ||
2 | #define _ASM_X8664_NUMNODES_H 1 | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifdef CONFIG_NUMA | ||
7 | #define NODES_SHIFT 6 | ||
8 | #else | ||
9 | #define NODES_SHIFT 0 | ||
10 | #endif | ||
11 | |||
12 | #endif | ||
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h index 4405b4adea..7f33aaf9f7 100644 --- a/include/asm-x86_64/percpu.h +++ b/include/asm-x86_64/percpu.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #define percpu_modcopy(pcpudst, src, size) \ | 26 | #define percpu_modcopy(pcpudst, src, size) \ |
27 | do { \ | 27 | do { \ |
28 | unsigned int __i; \ | 28 | unsigned int __i; \ |
29 | for_each_cpu(__i) \ | 29 | for_each_possible_cpu(__i) \ |
30 | memcpy((pcpudst)+__per_cpu_offset(__i), \ | 30 | memcpy((pcpudst)+__per_cpu_offset(__i), \ |
31 | (src), (size)); \ | 31 | (src), (size)); \ |
32 | } while (0) | 32 | } while (0) |
diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h index f18443fcdf..b9e5320b76 100644 --- a/include/asm-x86_64/timex.h +++ b/include/asm-x86_64/timex.h | |||
@@ -33,7 +33,7 @@ static __always_inline cycles_t get_cycles_sync(void) | |||
33 | unsigned eax; | 33 | unsigned eax; |
34 | /* Don't do an additional sync on CPUs where we know | 34 | /* Don't do an additional sync on CPUs where we know |
35 | RDTSC is already synchronous. */ | 35 | RDTSC is already synchronous. */ |
36 | alternative_io(ASM_NOP2, "cpuid", X86_FEATURE_SYNC_RDTSC, | 36 | alternative_io("cpuid", ASM_NOP2, X86_FEATURE_SYNC_RDTSC, |
37 | "=a" (eax), "0" (1) : "ebx","ecx","edx","memory"); | 37 | "=a" (eax), "0" (1) : "ebx","ecx","edx","memory"); |
38 | rdtscll(ret); | 38 | rdtscll(ret); |
39 | return ret; | 39 | return ret; |
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index f21ff2c1e9..feb77cb8c0 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h | |||
@@ -611,8 +611,14 @@ __SYSCALL(__NR_set_robust_list, sys_set_robust_list) | |||
611 | __SYSCALL(__NR_get_robust_list, sys_get_robust_list) | 611 | __SYSCALL(__NR_get_robust_list, sys_get_robust_list) |
612 | #define __NR_splice 275 | 612 | #define __NR_splice 275 |
613 | __SYSCALL(__NR_splice, sys_splice) | 613 | __SYSCALL(__NR_splice, sys_splice) |
614 | 614 | #define __NR_tee 276 | |
615 | #define __NR_syscall_max __NR_splice | 615 | __SYSCALL(__NR_tee, sys_tee) |
616 | #define __NR_sync_file_range 277 | ||
617 | __SYSCALL(__NR_sync_file_range, sys_sync_file_range) | ||
618 | #define __NR_vmsplice 278 | ||
619 | __SYSCALL(__NR_vmsplice, sys_vmsplice) | ||
620 | |||
621 | #define __NR_syscall_max __NR_vmsplice | ||
616 | 622 | ||
617 | #ifndef __NO_STUBS | 623 | #ifndef __NO_STUBS |
618 | 624 | ||
diff --git a/include/asm-xtensa/ioctls.h b/include/asm-xtensa/ioctls.h index 10c443435c..3b89a772d0 100644 --- a/include/asm-xtensa/ioctls.h +++ b/include/asm-xtensa/ioctls.h | |||
@@ -107,6 +107,6 @@ | |||
107 | #define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */ | 107 | #define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */ |
108 | 108 | ||
109 | #define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */ | 109 | #define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */ |
110 | #define TIOCGICOUNT _IOR('T', 93, struct async_icount) /* read serial port inline interrupt counts */ | 110 | #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ |
111 | 111 | ||
112 | #endif /* _XTENSA_IOCTLS_H */ | 112 | #endif /* _XTENSA_IOCTLS_H */ |
diff --git a/include/asm-xtensa/signal.h b/include/asm-xtensa/signal.h index 5d6fc9cdf5..a99c9aec64 100644 --- a/include/asm-xtensa/signal.h +++ b/include/asm-xtensa/signal.h | |||
@@ -118,9 +118,9 @@ typedef struct { | |||
118 | * SA_INTERRUPT is also used by the irq handling routines. | 118 | * SA_INTERRUPT is also used by the irq handling routines. |
119 | * SA_SHIRQ is for shared interrupt support on PCI and EISA. | 119 | * SA_SHIRQ is for shared interrupt support on PCI and EISA. |
120 | */ | 120 | */ |
121 | #define SA_PROBE SA_ONESHOT | ||
122 | #define SA_SAMPLE_RANDOM SA_RESTART | 121 | #define SA_SAMPLE_RANDOM SA_RESTART |
123 | #define SA_SHIRQ 0x04000000 | 122 | #define SA_SHIRQ 0x04000000 |
123 | #define SA_PROBEIRQ 0x08000000 | ||
124 | #endif | 124 | #endif |
125 | 125 | ||
126 | #define SIG_BLOCK 0 /* for blocking signals */ | 126 | #define SIG_BLOCK 0 /* for blocking signals */ |
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h index 9284867f1c..b29f7ae6a0 100644 --- a/include/asm-xtensa/system.h +++ b/include/asm-xtensa/system.h | |||
@@ -111,8 +111,6 @@ extern void *_switch_to(void *last, void *next); | |||
111 | 111 | ||
112 | #endif /* __ASSEMBLY__ */ | 112 | #endif /* __ASSEMBLY__ */ |
113 | 113 | ||
114 | #define prepare_to_switch() do { } while(0) | ||
115 | |||
116 | #define switch_to(prev,next,last) \ | 114 | #define switch_to(prev,next,last) \ |
117 | do { \ | 115 | do { \ |
118 | clear_cpenable(); \ | 116 | clear_cpenable(); \ |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 1c47c59058..b74c148f14 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -83,6 +83,7 @@ | |||
83 | #define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ | 83 | #define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ |
84 | #define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ | 84 | #define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ |
85 | #define AUDIT_CWD 1307 /* Current working directory */ | 85 | #define AUDIT_CWD 1307 /* Current working directory */ |
86 | #define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */ | ||
86 | 87 | ||
87 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 88 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
88 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 89 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
@@ -145,6 +146,11 @@ | |||
145 | #define AUDIT_PERS 10 | 146 | #define AUDIT_PERS 10 |
146 | #define AUDIT_ARCH 11 | 147 | #define AUDIT_ARCH 11 |
147 | #define AUDIT_MSGTYPE 12 | 148 | #define AUDIT_MSGTYPE 12 |
149 | #define AUDIT_SE_USER 13 /* security label user */ | ||
150 | #define AUDIT_SE_ROLE 14 /* security label role */ | ||
151 | #define AUDIT_SE_TYPE 15 /* security label type */ | ||
152 | #define AUDIT_SE_SEN 16 /* security label sensitivity label */ | ||
153 | #define AUDIT_SE_CLR 17 /* security label clearance label */ | ||
148 | 154 | ||
149 | /* These are ONLY useful when checking | 155 | /* These are ONLY useful when checking |
150 | * at syscall exit time (AUDIT_AT_EXIT). */ | 156 | * at syscall exit time (AUDIT_AT_EXIT). */ |
@@ -287,10 +293,10 @@ struct netlink_skb_parms; | |||
287 | /* Public API */ | 293 | /* Public API */ |
288 | extern int audit_alloc(struct task_struct *task); | 294 | extern int audit_alloc(struct task_struct *task); |
289 | extern void audit_free(struct task_struct *task); | 295 | extern void audit_free(struct task_struct *task); |
290 | extern void audit_syscall_entry(struct task_struct *task, int arch, | 296 | extern void audit_syscall_entry(int arch, |
291 | int major, unsigned long a0, unsigned long a1, | 297 | int major, unsigned long a0, unsigned long a1, |
292 | unsigned long a2, unsigned long a3); | 298 | unsigned long a2, unsigned long a3); |
293 | extern void audit_syscall_exit(struct task_struct *task, int failed, long return_code); | 299 | extern void audit_syscall_exit(int failed, long return_code); |
294 | extern void audit_getname(const char *name); | 300 | extern void audit_getname(const char *name); |
295 | extern void audit_putname(const char *name); | 301 | extern void audit_putname(const char *name); |
296 | extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); | 302 | extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); |
@@ -314,7 +320,8 @@ extern void auditsc_get_stamp(struct audit_context *ctx, | |||
314 | struct timespec *t, unsigned int *serial); | 320 | struct timespec *t, unsigned int *serial); |
315 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 321 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); |
316 | extern uid_t audit_get_loginuid(struct audit_context *ctx); | 322 | extern uid_t audit_get_loginuid(struct audit_context *ctx); |
317 | extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp); | 323 | extern int audit_ipc_obj(struct kern_ipc_perm *ipcp); |
324 | extern int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp); | ||
318 | extern int audit_socketcall(int nargs, unsigned long *args); | 325 | extern int audit_socketcall(int nargs, unsigned long *args); |
319 | extern int audit_sockaddr(int len, void *addr); | 326 | extern int audit_sockaddr(int len, void *addr); |
320 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | 327 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); |
@@ -323,8 +330,8 @@ extern int audit_set_macxattr(const char *name); | |||
323 | #else | 330 | #else |
324 | #define audit_alloc(t) ({ 0; }) | 331 | #define audit_alloc(t) ({ 0; }) |
325 | #define audit_free(t) do { ; } while (0) | 332 | #define audit_free(t) do { ; } while (0) |
326 | #define audit_syscall_entry(t,ta,a,b,c,d,e) do { ; } while (0) | 333 | #define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) |
327 | #define audit_syscall_exit(t,f,r) do { ; } while (0) | 334 | #define audit_syscall_exit(f,r) do { ; } while (0) |
328 | #define audit_getname(n) do { ; } while (0) | 335 | #define audit_getname(n) do { ; } while (0) |
329 | #define audit_putname(n) do { ; } while (0) | 336 | #define audit_putname(n) do { ; } while (0) |
330 | #define __audit_inode(n,i,f) do { ; } while (0) | 337 | #define __audit_inode(n,i,f) do { ; } while (0) |
@@ -333,7 +340,8 @@ extern int audit_set_macxattr(const char *name); | |||
333 | #define audit_inode_child(d,i,p) do { ; } while (0) | 340 | #define audit_inode_child(d,i,p) do { ; } while (0) |
334 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) | 341 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) |
335 | #define audit_get_loginuid(c) ({ -1; }) | 342 | #define audit_get_loginuid(c) ({ -1; }) |
336 | #define audit_ipc_perms(q,u,g,m,i) ({ 0; }) | 343 | #define audit_ipc_obj(i) ({ 0; }) |
344 | #define audit_ipc_set_perm(q,u,g,m,i) ({ 0; }) | ||
337 | #define audit_socketcall(n,a) ({ 0; }) | 345 | #define audit_socketcall(n,a) ({ 0; }) |
338 | #define audit_sockaddr(len, addr) ({ 0; }) | 346 | #define audit_sockaddr(len, addr) ({ 0; }) |
339 | #define audit_avc_path(dentry, mnt) ({ 0; }) | 347 | #define audit_avc_path(dentry, mnt) ({ 0; }) |
@@ -366,7 +374,7 @@ extern void audit_log_d_path(struct audit_buffer *ab, | |||
366 | extern int audit_filter_user(struct netlink_skb_parms *cb, int type); | 374 | extern int audit_filter_user(struct netlink_skb_parms *cb, int type); |
367 | extern int audit_filter_type(int type); | 375 | extern int audit_filter_type(int type); |
368 | extern int audit_receive_filter(int type, int pid, int uid, int seq, | 376 | extern int audit_receive_filter(int type, int pid, int uid, int seq, |
369 | void *data, size_t datasz, uid_t loginuid); | 377 | void *data, size_t datasz, uid_t loginuid, u32 sid); |
370 | #else | 378 | #else |
371 | #define audit_log(c,g,t,f,...) do { ; } while (0) | 379 | #define audit_log(c,g,t,f,...) do { ; } while (0) |
372 | #define audit_log_start(c,g,t) ({ NULL; }) | 380 | #define audit_log_start(c,g,t) ({ NULL; }) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d0cac8b58d..59e1259b1c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -17,6 +17,8 @@ | |||
17 | 17 | ||
18 | #include <asm/scatterlist.h> | 18 | #include <asm/scatterlist.h> |
19 | 19 | ||
20 | struct scsi_ioctl_command; | ||
21 | |||
20 | struct request_queue; | 22 | struct request_queue; |
21 | typedef struct request_queue request_queue_t; | 23 | typedef struct request_queue request_queue_t; |
22 | struct elevator_queue; | 24 | struct elevator_queue; |
@@ -611,6 +613,8 @@ extern void blk_plug_device(request_queue_t *); | |||
611 | extern int blk_remove_plug(request_queue_t *); | 613 | extern int blk_remove_plug(request_queue_t *); |
612 | extern void blk_recount_segments(request_queue_t *, struct bio *); | 614 | extern void blk_recount_segments(request_queue_t *, struct bio *); |
613 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); | 615 | extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); |
616 | extern int sg_scsi_ioctl(struct file *, struct request_queue *, | ||
617 | struct gendisk *, struct scsi_ioctl_command __user *); | ||
614 | extern void blk_start_queue(request_queue_t *q); | 618 | extern void blk_start_queue(request_queue_t *q); |
615 | extern void blk_stop_queue(request_queue_t *q); | 619 | extern void blk_stop_queue(request_queue_t *q); |
616 | extern void blk_sync_queue(struct request_queue *q); | 620 | extern void blk_sync_queue(struct request_queue *q); |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index de3eb8d8ae..da2d107fe2 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -45,6 +45,7 @@ extern unsigned long __init bootmem_bootmap_pages (unsigned long); | |||
45 | extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); | 45 | extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); |
46 | extern void __init free_bootmem (unsigned long addr, unsigned long size); | 46 | extern void __init free_bootmem (unsigned long addr, unsigned long size); |
47 | extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); | 47 | extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); |
48 | extern void * __init __alloc_bootmem_nopanic (unsigned long size, unsigned long align, unsigned long goal); | ||
48 | extern void * __init __alloc_bootmem_low(unsigned long size, | 49 | extern void * __init __alloc_bootmem_low(unsigned long size, |
49 | unsigned long align, | 50 | unsigned long align, |
50 | unsigned long goal); | 51 | unsigned long goal); |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 176e2d3715..047567d34c 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -58,9 +58,8 @@ struct dentry *debugfs_create_blob(const char *name, mode_t mode, | |||
58 | */ | 58 | */ |
59 | 59 | ||
60 | static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, | 60 | static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, |
61 | struct dentry *parent, | 61 | struct dentry *parent, void *data, |
62 | void *data, | 62 | const struct file_operations *fops) |
63 | struct file_operations *fops) | ||
64 | { | 63 | { |
65 | return ERR_PTR(-ENODEV); | 64 | return ERR_PTR(-ENODEV); |
66 | } | 65 | } |
diff --git a/include/linux/device.h b/include/linux/device.h index f6e72a65a3..e8e53b9acc 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -200,6 +200,7 @@ extern int class_device_create_file(struct class_device *, | |||
200 | * @node: for internal use by the driver core only. | 200 | * @node: for internal use by the driver core only. |
201 | * @kobj: for internal use by the driver core only. | 201 | * @kobj: for internal use by the driver core only. |
202 | * @devt_attr: for internal use by the driver core only. | 202 | * @devt_attr: for internal use by the driver core only. |
203 | * @groups: optional additional groups to be created | ||
203 | * @dev: if set, a symlink to the struct device is created in the sysfs | 204 | * @dev: if set, a symlink to the struct device is created in the sysfs |
204 | * directory for this struct class device. | 205 | * directory for this struct class device. |
205 | * @class_data: pointer to whatever you want to store here for this struct | 206 | * @class_data: pointer to whatever you want to store here for this struct |
@@ -228,6 +229,7 @@ struct class_device { | |||
228 | struct device * dev; /* not necessary, but nice to have */ | 229 | struct device * dev; /* not necessary, but nice to have */ |
229 | void * class_data; /* class-specific data */ | 230 | void * class_data; /* class-specific data */ |
230 | struct class_device *parent; /* parent of this child device, if there is one */ | 231 | struct class_device *parent; /* parent of this child device, if there is one */ |
232 | struct attribute_group ** groups; /* optional groups */ | ||
231 | 233 | ||
232 | void (*release)(struct class_device *dev); | 234 | void (*release)(struct class_device *dev); |
233 | int (*uevent)(struct class_device *dev, char **envp, | 235 | int (*uevent)(struct class_device *dev, char **envp, |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 9b4751aecc..635690cf3e 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -14,6 +14,7 @@ enum dma_data_direction { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | #define DMA_64BIT_MASK 0xffffffffffffffffULL | 16 | #define DMA_64BIT_MASK 0xffffffffffffffffULL |
17 | #define DMA_48BIT_MASK 0x0000ffffffffffffULL | ||
17 | #define DMA_40BIT_MASK 0x000000ffffffffffULL | 18 | #define DMA_40BIT_MASK 0x000000ffffffffffULL |
18 | #define DMA_39BIT_MASK 0x0000007fffffffffULL | 19 | #define DMA_39BIT_MASK 0x0000007fffffffffULL |
19 | #define DMA_32BIT_MASK 0x00000000ffffffffULL | 20 | #define DMA_32BIT_MASK 0x00000000ffffffffULL |
@@ -21,7 +22,7 @@ enum dma_data_direction { | |||
21 | #define DMA_30BIT_MASK 0x000000003fffffffULL | 22 | #define DMA_30BIT_MASK 0x000000003fffffffULL |
22 | #define DMA_29BIT_MASK 0x000000001fffffffULL | 23 | #define DMA_29BIT_MASK 0x000000001fffffffULL |
23 | #define DMA_28BIT_MASK 0x000000000fffffffULL | 24 | #define DMA_28BIT_MASK 0x000000000fffffffULL |
24 | #define DMA_24BIT_MASK 0x0000000000ffffffULL | 25 | #define DMA_24BIT_MASK 0x0000000000ffffffULL |
25 | 26 | ||
26 | #include <asm/dma-mapping.h> | 27 | #include <asm/dma-mapping.h> |
27 | 28 | ||
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index ad133fcfb2..1713ace808 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -21,7 +21,7 @@ typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); | |||
21 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); | 21 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); |
22 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); | 22 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); |
23 | 23 | ||
24 | typedef int (elevator_init_fn) (request_queue_t *, elevator_t *); | 24 | typedef void *(elevator_init_fn) (request_queue_t *, elevator_t *); |
25 | typedef void (elevator_exit_fn) (elevator_t *); | 25 | typedef void (elevator_exit_fn) (elevator_t *); |
26 | 26 | ||
27 | struct elevator_ops | 27 | struct elevator_ops |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 2d716080be..33d8f2087b 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -19,5 +19,4 @@ int request_firmware_nowait( | |||
19 | void (*cont)(const struct firmware *fw, void *context)); | 19 | void (*cont)(const struct firmware *fw, void *context)); |
20 | 20 | ||
21 | void release_firmware(const struct firmware *fw); | 21 | void release_firmware(const struct firmware *fw); |
22 | void register_firmware(const char *name, const u8 *data, size_t size); | ||
23 | #endif | 22 | #endif |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4ed7e602d7..f813bc8266 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -213,6 +213,10 @@ extern int dir_notify_enable; | |||
213 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 213 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
214 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ | 214 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ |
215 | 215 | ||
216 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | ||
217 | #define SYNC_FILE_RANGE_WRITE 2 | ||
218 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 | ||
219 | |||
216 | #ifdef __KERNEL__ | 220 | #ifdef __KERNEL__ |
217 | 221 | ||
218 | #include <linux/linkage.h> | 222 | #include <linux/linkage.h> |
@@ -758,11 +762,8 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | |||
758 | extern int fcntl_getlease(struct file *filp); | 762 | extern int fcntl_getlease(struct file *filp); |
759 | 763 | ||
760 | /* fs/sync.c */ | 764 | /* fs/sync.c */ |
761 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | ||
762 | #define SYNC_FILE_RANGE_WRITE 2 | ||
763 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 | ||
764 | extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, | 765 | extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, |
765 | int flags); | 766 | unsigned int flags); |
766 | 767 | ||
767 | /* fs/locks.c */ | 768 | /* fs/locks.c */ |
768 | extern void locks_init_lock(struct file_lock *); | 769 | extern void locks_init_lock(struct file_lock *); |
@@ -864,7 +865,7 @@ struct super_block { | |||
864 | */ | 865 | */ |
865 | struct mutex s_vfs_rename_mutex; /* Kludge */ | 866 | struct mutex s_vfs_rename_mutex; /* Kludge */ |
866 | 867 | ||
867 | /* Granuality of c/m/atime in ns. | 868 | /* Granularity of c/m/atime in ns. |
868 | Cannot be worse than a second */ | 869 | Cannot be worse than a second */ |
869 | u32 s_time_gran; | 870 | u32 s_time_gran; |
870 | }; | 871 | }; |
@@ -1039,8 +1040,8 @@ struct file_operations { | |||
1039 | int (*check_flags)(int); | 1040 | int (*check_flags)(int); |
1040 | int (*dir_notify)(struct file *filp, unsigned long arg); | 1041 | int (*dir_notify)(struct file *filp, unsigned long arg); |
1041 | int (*flock) (struct file *, int, struct file_lock *); | 1042 | int (*flock) (struct file *, int, struct file_lock *); |
1042 | ssize_t (*splice_write)(struct inode *, struct file *, size_t, unsigned int); | 1043 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); |
1043 | ssize_t (*splice_read)(struct file *, struct inode *, size_t, unsigned int); | 1044 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); |
1044 | }; | 1045 | }; |
1045 | 1046 | ||
1046 | struct inode_operations { | 1047 | struct inode_operations { |
@@ -1611,8 +1612,17 @@ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor | |||
1611 | extern void do_generic_mapping_read(struct address_space *mapping, | 1612 | extern void do_generic_mapping_read(struct address_space *mapping, |
1612 | struct file_ra_state *, struct file *, | 1613 | struct file_ra_state *, struct file *, |
1613 | loff_t *, read_descriptor_t *, read_actor_t); | 1614 | loff_t *, read_descriptor_t *, read_actor_t); |
1614 | extern ssize_t generic_file_splice_read(struct file *, struct inode *, size_t, unsigned int); | 1615 | |
1615 | extern ssize_t generic_file_splice_write(struct inode *, struct file *, size_t, unsigned int); | 1616 | /* fs/splice.c */ |
1617 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | ||
1618 | struct pipe_inode_info *, size_t, unsigned int); | ||
1619 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, | ||
1620 | struct file *, loff_t *, size_t, unsigned int); | ||
1621 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | ||
1622 | struct file *out, loff_t *, size_t len, unsigned int flags); | ||
1623 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | ||
1624 | size_t len, unsigned int flags); | ||
1625 | |||
1616 | extern void | 1626 | extern void |
1617 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 1627 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
1618 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, | 1628 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, |
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h new file mode 100644 index 0000000000..f5975126b7 --- /dev/null +++ b/include/linux/fs_uart_pd.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Platform information definitions for the CPM Uart driver. | ||
3 | * | ||
4 | * 2006 (c) MontaVista Software, Inc. | ||
5 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public License | ||
8 | * version 2. This program is licensed "as is" without any warranty of any | ||
9 | * kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #ifndef FS_UART_PD_H | ||
13 | #define FS_UART_PD_H | ||
14 | |||
15 | #include <linux/version.h> | ||
16 | #include <asm/types.h> | ||
17 | |||
18 | enum fs_uart_id { | ||
19 | fsid_smc1_uart, | ||
20 | fsid_smc2_uart, | ||
21 | fsid_scc1_uart, | ||
22 | fsid_scc2_uart, | ||
23 | fsid_scc3_uart, | ||
24 | fsid_scc4_uart, | ||
25 | fs_uart_nr, | ||
26 | }; | ||
27 | |||
28 | static inline int fs_uart_id_scc2fsid(int id) | ||
29 | { | ||
30 | return fsid_scc1_uart + id - 1; | ||
31 | } | ||
32 | |||
33 | static inline int fs_uart_id_fsid2scc(int id) | ||
34 | { | ||
35 | return id - fsid_scc1_uart + 1; | ||
36 | } | ||
37 | |||
38 | static inline int fs_uart_id_smc2fsid(int id) | ||
39 | { | ||
40 | return fsid_smc1_uart + id - 1; | ||
41 | } | ||
42 | |||
43 | static inline int fs_uart_id_fsid2smc(int id) | ||
44 | { | ||
45 | return id - fsid_smc1_uart + 1; | ||
46 | } | ||
47 | |||
48 | struct fs_uart_platform_info { | ||
49 | void(*init_ioports)(void); | ||
50 | /* device specific information */ | ||
51 | int fs_no; /* controller index */ | ||
52 | u32 uart_clk; | ||
53 | u8 tx_num_fifo; | ||
54 | u8 tx_buf_size; | ||
55 | u8 rx_num_fifo; | ||
56 | u8 rx_buf_size; | ||
57 | u8 brg; | ||
58 | }; | ||
59 | |||
60 | #endif | ||
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index a3a0e078f7..16fbe59ede 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -110,5 +110,16 @@ struct fsl_usb2_platform_data { | |||
110 | #define FSL_USB2_PORT0_ENABLED 0x00000001 | 110 | #define FSL_USB2_PORT0_ENABLED 0x00000001 |
111 | #define FSL_USB2_PORT1_ENABLED 0x00000002 | 111 | #define FSL_USB2_PORT1_ENABLED 0x00000002 |
112 | 112 | ||
113 | struct fsl_spi_platform_data { | ||
114 | u32 initial_spmode; /* initial SPMODE value */ | ||
115 | u16 bus_num; | ||
116 | |||
117 | /* board specific information */ | ||
118 | u16 max_chipselect; | ||
119 | void (*activate_cs)(u8 cs, u8 polarity); | ||
120 | void (*deactivate_cs)(u8 cs, u8 polarity); | ||
121 | u32 sysclk; | ||
122 | }; | ||
123 | |||
113 | #endif /* _FSL_DEVICE_H_ */ | 124 | #endif /* _FSL_DEVICE_H_ */ |
114 | #endif /* __KERNEL__ */ | 125 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 9c8e6da239..71e7b2847c 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <asm/io.h> | 12 | #include <asm/io.h> |
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/mutex.h> | ||
14 | #include <linux/device.h> | 15 | #include <linux/device.h> |
15 | #include <linux/timer.h> | 16 | #include <linux/timer.h> |
16 | 17 | ||
@@ -40,7 +41,7 @@ struct gameport { | |||
40 | struct gameport *parent, *child; | 41 | struct gameport *parent, *child; |
41 | 42 | ||
42 | struct gameport_driver *drv; | 43 | struct gameport_driver *drv; |
43 | struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ | 44 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ |
44 | 45 | ||
45 | struct device dev; | 46 | struct device dev; |
46 | unsigned int registered; /* port has been fully registered with driver core */ | 47 | unsigned int registered; /* port has been fully registered with driver core */ |
@@ -137,12 +138,12 @@ static inline void gameport_set_drvdata(struct gameport *gameport, void *data) | |||
137 | */ | 138 | */ |
138 | static inline int gameport_pin_driver(struct gameport *gameport) | 139 | static inline int gameport_pin_driver(struct gameport *gameport) |
139 | { | 140 | { |
140 | return down_interruptible(&gameport->drv_sem); | 141 | return mutex_lock_interruptible(&gameport->drv_mutex); |
141 | } | 142 | } |
142 | 143 | ||
143 | static inline void gameport_unpin_driver(struct gameport *gameport) | 144 | static inline void gameport_unpin_driver(struct gameport *gameport) |
144 | { | 145 | { |
145 | up(&gameport->drv_sem); | 146 | mutex_unlock(&gameport->drv_mutex); |
146 | } | 147 | } |
147 | 148 | ||
148 | void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); | 149 | void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 10a27f29d6..2ef845b351 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -105,6 +105,7 @@ struct gendisk { | |||
105 | * disks that can't be partitioned. */ | 105 | * disks that can't be partitioned. */ |
106 | char disk_name[32]; /* name of major driver */ | 106 | char disk_name[32]; /* name of major driver */ |
107 | struct hd_struct **part; /* [indexed by minor] */ | 107 | struct hd_struct **part; /* [indexed by minor] */ |
108 | int part_uevent_suppress; | ||
108 | struct block_device_operations *fops; | 109 | struct block_device_operations *fops; |
109 | struct request_queue *queue; | 110 | struct request_queue *queue; |
110 | void *private_data; | 111 | void *private_data; |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 7851e6b520..3ac452945a 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -57,6 +57,8 @@ struct vm_area_struct; | |||
57 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ | 57 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ |
58 | __GFP_NOMEMALLOC|__GFP_HARDWALL) | 58 | __GFP_NOMEMALLOC|__GFP_HARDWALL) |
59 | 59 | ||
60 | /* This equals 0, but use constants in case they ever change */ | ||
61 | #define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) | ||
60 | /* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ | 62 | /* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ |
61 | #define GFP_ATOMIC (__GFP_HIGH) | 63 | #define GFP_ATOMIC (__GFP_HIGH) |
62 | #define GFP_NOIO (__GFP_WAIT) | 64 | #define GFP_NOIO (__GFP_WAIT) |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index b209392876..306acf1dc6 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -80,7 +80,7 @@ struct hrtimer_sleeper { | |||
80 | * @first: pointer to the timer node which expires first | 80 | * @first: pointer to the timer node which expires first |
81 | * @resolution: the resolution of the clock, in nanoseconds | 81 | * @resolution: the resolution of the clock, in nanoseconds |
82 | * @get_time: function to retrieve the current time of the clock | 82 | * @get_time: function to retrieve the current time of the clock |
83 | * @get_sofirq_time: function to retrieve the current time from the softirq | 83 | * @get_softirq_time: function to retrieve the current time from the softirq |
84 | * @curr_timer: the timer which is executing a callback right now | 84 | * @curr_timer: the timer which is executing a callback right now |
85 | * @softirq_time: the time when running the hrtimer queue in the softirq | 85 | * @softirq_time: the time when running the hrtimer queue in the softirq |
86 | */ | 86 | */ |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index dd7d627bf6..c115e9e840 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
@@ -1114,8 +1114,11 @@ static inline struct i2o_message *i2o_msg_get(struct i2o_controller *c) | |||
1114 | 1114 | ||
1115 | mmsg->mfa = readl(c->in_port); | 1115 | mmsg->mfa = readl(c->in_port); |
1116 | if (unlikely(mmsg->mfa >= c->in_queue.len)) { | 1116 | if (unlikely(mmsg->mfa >= c->in_queue.len)) { |
1117 | u32 mfa = mmsg->mfa; | ||
1118 | |||
1117 | mempool_free(mmsg, c->in_msg.mempool); | 1119 | mempool_free(mmsg, c->in_msg.mempool); |
1118 | if(mmsg->mfa == I2O_QUEUE_EMPTY) | 1120 | |
1121 | if (mfa == I2O_QUEUE_EMPTY) | ||
1119 | return ERR_PTR(-EBUSY); | 1122 | return ERR_PTR(-EBUSY); |
1120 | return ERR_PTR(-EFAULT); | 1123 | return ERR_PTR(-EFAULT); |
1121 | } | 1124 | } |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 8d2db412ba..a8bef1d137 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1220,7 +1220,6 @@ typedef struct ide_pci_enablebit_s { | |||
1220 | enum { | 1220 | enum { |
1221 | /* Uses ISA control ports not PCI ones. */ | 1221 | /* Uses ISA control ports not PCI ones. */ |
1222 | IDEPCI_FLAG_ISA_PORTS = (1 << 0), | 1222 | IDEPCI_FLAG_ISA_PORTS = (1 << 0), |
1223 | IDEPCI_FLAG_FORCE_PDC = (1 << 1), | ||
1224 | }; | 1223 | }; |
1225 | 1224 | ||
1226 | typedef struct ide_pci_device_s { | 1225 | typedef struct ide_pci_device_s { |
diff --git a/include/linux/init.h b/include/linux/init.h index ed0ac7c39f..93dcbe1abb 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -245,7 +245,8 @@ void __init parse_early_param(void); | |||
245 | #define __cpuexitdata __exitdata | 245 | #define __cpuexitdata __exitdata |
246 | #endif | 246 | #endif |
247 | 247 | ||
248 | #ifdef CONFIG_MEMORY_HOTPLUG | 248 | #if defined(CONFIG_MEMORY_HOTPLUG) || defined(CONFIG_ACPI_HOTPLUG_MEMORY) \ |
249 | || defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE) | ||
249 | #define __meminit | 250 | #define __meminit |
250 | #define __meminitdata | 251 | #define __meminitdata |
251 | #define __memexit | 252 | #define __memexit |
diff --git a/include/linux/input.h b/include/linux/input.h index 1d4e341b72..ce1a756c4c 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -12,8 +12,6 @@ | |||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | #include <linux/time.h> | 13 | #include <linux/time.h> |
14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
15 | #include <linux/device.h> | ||
16 | #include <linux/mod_devicetable.h> | ||
17 | #else | 15 | #else |
18 | #include <sys/time.h> | 16 | #include <sys/time.h> |
19 | #include <sys/ioctl.h> | 17 | #include <sys/ioctl.h> |
@@ -58,6 +56,8 @@ struct input_absinfo { | |||
58 | 56 | ||
59 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ | 57 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ |
60 | #define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ | 58 | #define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ |
59 | #define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */ | ||
60 | #define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */ | ||
61 | #define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ | 61 | #define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ |
62 | #define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ | 62 | #define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ |
63 | 63 | ||
@@ -345,6 +345,8 @@ struct input_absinfo { | |||
345 | #define KEY_SAVE 234 | 345 | #define KEY_SAVE 234 |
346 | #define KEY_DOCUMENTS 235 | 346 | #define KEY_DOCUMENTS 235 |
347 | 347 | ||
348 | #define KEY_BATTERY 236 | ||
349 | |||
348 | #define KEY_UNKNOWN 240 | 350 | #define KEY_UNKNOWN 240 |
349 | 351 | ||
350 | #define BTN_MISC 0x100 | 352 | #define BTN_MISC 0x100 |
@@ -421,7 +423,7 @@ struct input_absinfo { | |||
421 | #define BTN_GEAR_UP 0x151 | 423 | #define BTN_GEAR_UP 0x151 |
422 | 424 | ||
423 | #define KEY_OK 0x160 | 425 | #define KEY_OK 0x160 |
424 | #define KEY_SELECT 0x161 | 426 | #define KEY_SELECT 0x161 |
425 | #define KEY_GOTO 0x162 | 427 | #define KEY_GOTO 0x162 |
426 | #define KEY_CLEAR 0x163 | 428 | #define KEY_CLEAR 0x163 |
427 | #define KEY_POWER2 0x164 | 429 | #define KEY_POWER2 0x164 |
@@ -512,6 +514,15 @@ struct input_absinfo { | |||
512 | #define KEY_FN_S 0x1e3 | 514 | #define KEY_FN_S 0x1e3 |
513 | #define KEY_FN_B 0x1e4 | 515 | #define KEY_FN_B 0x1e4 |
514 | 516 | ||
517 | #define KEY_BRL_DOT1 0x1f1 | ||
518 | #define KEY_BRL_DOT2 0x1f2 | ||
519 | #define KEY_BRL_DOT3 0x1f3 | ||
520 | #define KEY_BRL_DOT4 0x1f4 | ||
521 | #define KEY_BRL_DOT5 0x1f5 | ||
522 | #define KEY_BRL_DOT6 0x1f6 | ||
523 | #define KEY_BRL_DOT7 0x1f7 | ||
524 | #define KEY_BRL_DOT8 0x1f8 | ||
525 | |||
515 | /* We avoid low common keys in module aliases so they don't get huge. */ | 526 | /* We avoid low common keys in module aliases so they don't get huge. */ |
516 | #define KEY_MIN_INTERESTING KEY_MUTE | 527 | #define KEY_MIN_INTERESTING KEY_MUTE |
517 | #define KEY_MAX 0x1ff | 528 | #define KEY_MAX 0x1ff |
@@ -568,15 +579,10 @@ struct input_absinfo { | |||
568 | * Switch events | 579 | * Switch events |
569 | */ | 580 | */ |
570 | 581 | ||
571 | #define SW_0 0x00 | 582 | #define SW_LID 0x00 /* set = lid shut */ |
572 | #define SW_1 0x01 | 583 | #define SW_TABLET_MODE 0x01 /* set = tablet mode */ |
573 | #define SW_2 0x02 | 584 | #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ |
574 | #define SW_3 0x03 | 585 | #define SW_MAX 0x0f |
575 | #define SW_4 0x04 | ||
576 | #define SW_5 0x05 | ||
577 | #define SW_6 0x06 | ||
578 | #define SW_7 0x07 | ||
579 | #define SW_MAX 0x0f | ||
580 | 586 | ||
581 | /* | 587 | /* |
582 | * Misc events | 588 | * Misc events |
@@ -796,52 +802,16 @@ struct ff_effect { | |||
796 | 802 | ||
797 | #define FF_MAX 0x7f | 803 | #define FF_MAX 0x7f |
798 | 804 | ||
799 | struct input_device_id { | ||
800 | |||
801 | kernel_ulong_t flags; | ||
802 | |||
803 | struct input_id id; | ||
804 | |||
805 | kernel_ulong_t evbit[EV_MAX/BITS_PER_LONG+1]; | ||
806 | kernel_ulong_t keybit[KEY_MAX/BITS_PER_LONG+1]; | ||
807 | kernel_ulong_t relbit[REL_MAX/BITS_PER_LONG+1]; | ||
808 | kernel_ulong_t absbit[ABS_MAX/BITS_PER_LONG+1]; | ||
809 | kernel_ulong_t mscbit[MSC_MAX/BITS_PER_LONG+1]; | ||
810 | kernel_ulong_t ledbit[LED_MAX/BITS_PER_LONG+1]; | ||
811 | kernel_ulong_t sndbit[SND_MAX/BITS_PER_LONG+1]; | ||
812 | kernel_ulong_t ffbit[FF_MAX/BITS_PER_LONG+1]; | ||
813 | kernel_ulong_t swbit[SW_MAX/BITS_PER_LONG+1]; | ||
814 | |||
815 | kernel_ulong_t driver_info; | ||
816 | }; | ||
817 | |||
818 | /* | ||
819 | * Structure for hotplug & device<->driver matching. | ||
820 | */ | ||
821 | |||
822 | #define INPUT_DEVICE_ID_MATCH_BUS 1 | ||
823 | #define INPUT_DEVICE_ID_MATCH_VENDOR 2 | ||
824 | #define INPUT_DEVICE_ID_MATCH_PRODUCT 4 | ||
825 | #define INPUT_DEVICE_ID_MATCH_VERSION 8 | ||
826 | |||
827 | #define INPUT_DEVICE_ID_MATCH_EVBIT 0x010 | ||
828 | #define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020 | ||
829 | #define INPUT_DEVICE_ID_MATCH_RELBIT 0x040 | ||
830 | #define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080 | ||
831 | #define INPUT_DEVICE_ID_MATCH_MSCIT 0x100 | ||
832 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 | ||
833 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 | ||
834 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 | ||
835 | #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000 | ||
836 | |||
837 | #ifdef __KERNEL__ | 805 | #ifdef __KERNEL__ |
838 | 806 | ||
839 | /* | 807 | /* |
840 | * In-kernel definitions. | 808 | * In-kernel definitions. |
841 | */ | 809 | */ |
842 | 810 | ||
811 | #include <linux/device.h> | ||
843 | #include <linux/fs.h> | 812 | #include <linux/fs.h> |
844 | #include <linux/timer.h> | 813 | #include <linux/timer.h> |
814 | #include <linux/mod_devicetable.h> | ||
845 | 815 | ||
846 | #define NBITS(x) (((x)/BITS_PER_LONG)+1) | 816 | #define NBITS(x) (((x)/BITS_PER_LONG)+1) |
847 | #define BIT(x) (1UL<<((x)%BITS_PER_LONG)) | 817 | #define BIT(x) (1UL<<((x)%BITS_PER_LONG)) |
@@ -929,7 +899,7 @@ struct input_dev { | |||
929 | 899 | ||
930 | struct input_handle *grab; | 900 | struct input_handle *grab; |
931 | 901 | ||
932 | struct semaphore sem; /* serializes open and close operations */ | 902 | struct mutex mutex; /* serializes open and close operations */ |
933 | unsigned int users; | 903 | unsigned int users; |
934 | 904 | ||
935 | struct class_device cdev; | 905 | struct class_device cdev; |
@@ -942,9 +912,49 @@ struct input_dev { | |||
942 | }; | 912 | }; |
943 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) | 913 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) |
944 | 914 | ||
945 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ | 915 | /* |
916 | * Verify that we are in sync with input_device_id mod_devicetable.h #defines | ||
917 | */ | ||
918 | |||
919 | #if EV_MAX != INPUT_DEVICE_ID_EV_MAX | ||
920 | #error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match" | ||
921 | #endif | ||
922 | |||
923 | #if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX | ||
924 | #error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match" | ||
925 | #endif | ||
926 | |||
927 | #if REL_MAX != INPUT_DEVICE_ID_REL_MAX | ||
928 | #error "REL_MAX and INPUT_DEVICE_ID_REL_MAX do not match" | ||
929 | #endif | ||
930 | |||
931 | #if ABS_MAX != INPUT_DEVICE_ID_ABS_MAX | ||
932 | #error "ABS_MAX and INPUT_DEVICE_ID_ABS_MAX do not match" | ||
933 | #endif | ||
934 | |||
935 | #if MSC_MAX != INPUT_DEVICE_ID_MSC_MAX | ||
936 | #error "MSC_MAX and INPUT_DEVICE_ID_MSC_MAX do not match" | ||
937 | #endif | ||
938 | |||
939 | #if LED_MAX != INPUT_DEVICE_ID_LED_MAX | ||
940 | #error "LED_MAX and INPUT_DEVICE_ID_LED_MAX do not match" | ||
941 | #endif | ||
942 | |||
943 | #if SND_MAX != INPUT_DEVICE_ID_SND_MAX | ||
944 | #error "SND_MAX and INPUT_DEVICE_ID_SND_MAX do not match" | ||
945 | #endif | ||
946 | |||
947 | #if FF_MAX != INPUT_DEVICE_ID_FF_MAX | ||
948 | #error "FF_MAX and INPUT_DEVICE_ID_FF_MAX do not match" | ||
949 | #endif | ||
950 | |||
951 | #if SW_MAX != INPUT_DEVICE_ID_SW_MAX | ||
952 | #error "SW_MAX and INPUT_DEVICE_ID_SW_MAX do not match" | ||
953 | #endif | ||
954 | |||
955 | #define INPUT_DEVICE_ID_MATCH_DEVICE \ | ||
946 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) | 956 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) |
947 | #define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ | 957 | #define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION \ |
948 | (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) | 958 | (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) |
949 | 959 | ||
950 | struct input_handle; | 960 | struct input_handle; |
@@ -995,11 +1005,6 @@ static inline void init_input_dev(struct input_dev *dev) | |||
995 | 1005 | ||
996 | struct input_dev *input_allocate_device(void); | 1006 | struct input_dev *input_allocate_device(void); |
997 | 1007 | ||
998 | static inline void input_free_device(struct input_dev *dev) | ||
999 | { | ||
1000 | kfree(dev); | ||
1001 | } | ||
1002 | |||
1003 | static inline struct input_dev *input_get_device(struct input_dev *dev) | 1008 | static inline struct input_dev *input_get_device(struct input_dev *dev) |
1004 | { | 1009 | { |
1005 | return to_input_dev(class_device_get(&dev->cdev)); | 1010 | return to_input_dev(class_device_get(&dev->cdev)); |
@@ -1010,6 +1015,12 @@ static inline void input_put_device(struct input_dev *dev) | |||
1010 | class_device_put(&dev->cdev); | 1015 | class_device_put(&dev->cdev); |
1011 | } | 1016 | } |
1012 | 1017 | ||
1018 | static inline void input_free_device(struct input_dev *dev) | ||
1019 | { | ||
1020 | if (dev) | ||
1021 | input_put_device(dev); | ||
1022 | } | ||
1023 | |||
1013 | int input_register_device(struct input_dev *); | 1024 | int input_register_device(struct input_dev *); |
1014 | void input_unregister_device(struct input_dev *); | 1025 | void input_unregister_device(struct input_dev *); |
1015 | 1026 | ||
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 99905e1805..043376920f 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -36,6 +36,8 @@ | |||
36 | /* LATCH is used in the interval timer and ftape setup. */ | 36 | /* LATCH is used in the interval timer and ftape setup. */ |
37 | #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ | 37 | #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ |
38 | 38 | ||
39 | #define LATCH_HPET ((HPET_TICK_RATE + HZ/2) / HZ) | ||
40 | |||
39 | /* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can | 41 | /* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can |
40 | * improve accuracy by shifting LSH bits, hence calculating: | 42 | * improve accuracy by shifting LSH bits, hence calculating: |
41 | * (NOM << LSH) / DEN | 43 | * (NOM << LSH) / DEN |
@@ -51,9 +53,13 @@ | |||
51 | /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ | 53 | /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */ |
52 | #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) | 54 | #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8)) |
53 | 55 | ||
56 | #define ACTHZ_HPET (SH_DIV (HPET_TICK_RATE, LATCH_HPET, 8)) | ||
57 | |||
54 | /* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ */ | 58 | /* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ */ |
55 | #define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8)) | 59 | #define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8)) |
56 | 60 | ||
61 | #define TICK_NSEC_HPET (SH_DIV(1000000UL * 1000, ACTHZ_HPET, 8)) | ||
62 | |||
57 | /* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ | 63 | /* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ |
58 | #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) | 64 | #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) |
59 | 65 | ||
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index e87c32a5c8..4eb851ece0 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
@@ -135,6 +135,8 @@ static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag) | |||
135 | 135 | ||
136 | #define U(x) ((x) ^ 0xf000) | 136 | #define U(x) ((x) ^ 0xf000) |
137 | 137 | ||
138 | #define BRL_UC_ROW 0x2800 | ||
139 | |||
138 | /* keyboard.c */ | 140 | /* keyboard.c */ |
139 | 141 | ||
140 | struct console; | 142 | struct console; |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index a3720f973e..f4fc576ed4 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -124,6 +124,7 @@ extern int get_option(char **str, int *pint); | |||
124 | extern char *get_options(const char *str, int nints, int *ints); | 124 | extern char *get_options(const char *str, int nints, int *ints); |
125 | extern unsigned long long memparse(char *ptr, char **retptr); | 125 | extern unsigned long long memparse(char *ptr, char **retptr); |
126 | 126 | ||
127 | extern int core_kernel_text(unsigned long addr); | ||
127 | extern int __kernel_text_address(unsigned long addr); | 128 | extern int __kernel_text_address(unsigned long addr); |
128 | extern int kernel_text_address(unsigned long addr); | 129 | extern int kernel_text_address(unsigned long addr); |
129 | extern int session_of_pgrp(int pgrp); | 130 | extern int session_of_pgrp(int pgrp); |
@@ -176,7 +177,7 @@ static inline void console_verbose(void) | |||
176 | 177 | ||
177 | extern void bust_spinlocks(int yes); | 178 | extern void bust_spinlocks(int yes); |
178 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 179 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
179 | extern __deprecated_for_modules int panic_timeout; | 180 | extern int panic_timeout; |
180 | extern int panic_on_oops; | 181 | extern int panic_on_oops; |
181 | extern int tainted; | 182 | extern int tainted; |
182 | extern const char *print_tainted(void); | 183 | extern const char *print_tainted(void); |
diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h index 08488042d7..de76843bbe 100644 --- a/include/linux/keyboard.h +++ b/include/linux/keyboard.h | |||
@@ -44,6 +44,7 @@ extern unsigned short plain_map[NR_KEYS]; | |||
44 | #define KT_ASCII 9 | 44 | #define KT_ASCII 9 |
45 | #define KT_LOCK 10 | 45 | #define KT_LOCK 10 |
46 | #define KT_SLOCK 12 | 46 | #define KT_SLOCK 12 |
47 | #define KT_BRL 14 | ||
47 | 48 | ||
48 | #define K(t,v) (((t)<<8)|(v)) | 49 | #define K(t,v) (((t)<<8)|(v)) |
49 | #define KTYP(x) ((x) >> 8) | 50 | #define KTYP(x) ((x) >> 8) |
@@ -427,5 +428,17 @@ extern unsigned short plain_map[NR_KEYS]; | |||
427 | 428 | ||
428 | #define NR_LOCK 8 | 429 | #define NR_LOCK 8 |
429 | 430 | ||
431 | #define K_BRL_BLANK K(KT_BRL, 0) | ||
432 | #define K_BRL_DOT1 K(KT_BRL, 1) | ||
433 | #define K_BRL_DOT2 K(KT_BRL, 2) | ||
434 | #define K_BRL_DOT3 K(KT_BRL, 3) | ||
435 | #define K_BRL_DOT4 K(KT_BRL, 4) | ||
436 | #define K_BRL_DOT5 K(KT_BRL, 5) | ||
437 | #define K_BRL_DOT6 K(KT_BRL, 6) | ||
438 | #define K_BRL_DOT7 K(KT_BRL, 7) | ||
439 | #define K_BRL_DOT8 K(KT_BRL, 8) | ||
440 | |||
441 | #define NR_BRL 9 | ||
442 | |||
430 | #define MAX_DIACR 256 | 443 | #define MAX_DIACR 256 |
431 | #endif | 444 | #endif |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 4cb1214ec2..c187c53cec 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/rwsem.h> | 24 | #include <linux/rwsem.h> |
25 | #include <linux/kref.h> | 25 | #include <linux/kref.h> |
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/wait.h> | ||
27 | #include <asm/atomic.h> | 28 | #include <asm/atomic.h> |
28 | 29 | ||
29 | #define KOBJ_NAME_LEN 20 | 30 | #define KOBJ_NAME_LEN 20 |
@@ -56,6 +57,7 @@ struct kobject { | |||
56 | struct kset * kset; | 57 | struct kset * kset; |
57 | struct kobj_type * ktype; | 58 | struct kobj_type * ktype; |
58 | struct dentry * dentry; | 59 | struct dentry * dentry; |
60 | wait_queue_head_t poll; | ||
59 | }; | 61 | }; |
60 | 62 | ||
61 | extern int kobject_set_name(struct kobject *, const char *, ...) | 63 | extern int kobject_set_name(struct kobject *, const char *, ...) |
@@ -255,9 +257,8 @@ struct subsys_attribute { | |||
255 | }; | 257 | }; |
256 | 258 | ||
257 | extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); | 259 | extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); |
258 | extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *); | ||
259 | 260 | ||
260 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) | 261 | #if defined(CONFIG_HOTPLUG) |
261 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); | 262 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); |
262 | 263 | ||
263 | int add_uevent_var(char **envp, int num_envp, int *cur_index, | 264 | int add_uevent_var(char **envp, int num_envp, int *cur_index, |
diff --git a/include/linux/leds.h b/include/linux/leds.h index 4617e75903..dc23c7c639 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -19,39 +19,38 @@ struct class_device; | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | enum led_brightness { | 21 | enum led_brightness { |
22 | LED_OFF = 0, | 22 | LED_OFF = 0, |
23 | LED_HALF = 127, | 23 | LED_HALF = 127, |
24 | LED_FULL = 255, | 24 | LED_FULL = 255, |
25 | }; | 25 | }; |
26 | 26 | ||
27 | struct led_classdev { | 27 | struct led_classdev { |
28 | const char *name; | 28 | const char *name; |
29 | int brightness; | 29 | int brightness; |
30 | int flags; | 30 | int flags; |
31 | #define LED_SUSPENDED (1 << 0) | ||
32 | 31 | ||
33 | /* A function to set the brightness of the led */ | 32 | #define LED_SUSPENDED (1 << 0) |
34 | void (*brightness_set)(struct led_classdev *led_cdev, | ||
35 | enum led_brightness brightness); | ||
36 | 33 | ||
37 | struct class_device *class_dev; | 34 | /* Set LED brightness level */ |
38 | /* LED Device linked list */ | 35 | void (*brightness_set)(struct led_classdev *led_cdev, |
39 | struct list_head node; | 36 | enum led_brightness brightness); |
37 | |||
38 | struct class_device *class_dev; | ||
39 | struct list_head node; /* LED Device list */ | ||
40 | char *default_trigger; /* Trigger to use */ | ||
40 | 41 | ||
41 | /* Trigger data */ | ||
42 | char *default_trigger; | ||
43 | #ifdef CONFIG_LEDS_TRIGGERS | 42 | #ifdef CONFIG_LEDS_TRIGGERS |
44 | rwlock_t trigger_lock; | ||
45 | /* Protects the trigger data below */ | 43 | /* Protects the trigger data below */ |
44 | rwlock_t trigger_lock; | ||
46 | 45 | ||
47 | struct led_trigger *trigger; | 46 | struct led_trigger *trigger; |
48 | struct list_head trig_list; | 47 | struct list_head trig_list; |
49 | void *trigger_data; | 48 | void *trigger_data; |
50 | #endif | 49 | #endif |
51 | }; | 50 | }; |
52 | 51 | ||
53 | extern int led_classdev_register(struct device *parent, | 52 | extern int led_classdev_register(struct device *parent, |
54 | struct led_classdev *led_cdev); | 53 | struct led_classdev *led_cdev); |
55 | extern void led_classdev_unregister(struct led_classdev *led_cdev); | 54 | extern void led_classdev_unregister(struct led_classdev *led_cdev); |
56 | extern void led_classdev_suspend(struct led_classdev *led_cdev); | 55 | extern void led_classdev_suspend(struct led_classdev *led_cdev); |
57 | extern void led_classdev_resume(struct led_classdev *led_cdev); | 56 | extern void led_classdev_resume(struct led_classdev *led_cdev); |
@@ -65,16 +64,16 @@ extern void led_classdev_resume(struct led_classdev *led_cdev); | |||
65 | 64 | ||
66 | struct led_trigger { | 65 | struct led_trigger { |
67 | /* Trigger Properties */ | 66 | /* Trigger Properties */ |
68 | const char *name; | 67 | const char *name; |
69 | void (*activate)(struct led_classdev *led_cdev); | 68 | void (*activate)(struct led_classdev *led_cdev); |
70 | void (*deactivate)(struct led_classdev *led_cdev); | 69 | void (*deactivate)(struct led_classdev *led_cdev); |
71 | 70 | ||
72 | /* LEDs under control by this trigger (for simple triggers) */ | 71 | /* LEDs under control by this trigger (for simple triggers) */ |
73 | rwlock_t leddev_list_lock; | 72 | rwlock_t leddev_list_lock; |
74 | struct list_head led_cdevs; | 73 | struct list_head led_cdevs; |
75 | 74 | ||
76 | /* Link to next registered trigger */ | 75 | /* Link to next registered trigger */ |
77 | struct list_head next_trig; | 76 | struct list_head next_trig; |
78 | }; | 77 | }; |
79 | 78 | ||
80 | /* Registration functions for complex triggers */ | 79 | /* Registration functions for complex triggers */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 0d61357604..b80d2e7fa6 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -523,7 +523,6 @@ extern void ata_host_set_remove(struct ata_host_set *host_set); | |||
523 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 523 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
524 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 524 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
525 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 525 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
526 | extern int ata_scsi_error(struct Scsi_Host *host); | ||
527 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | 526 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); |
528 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | 527 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); |
529 | extern int ata_scsi_release(struct Scsi_Host *host); | 528 | extern int ata_scsi_release(struct Scsi_Host *host); |
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index a710bddda4..08a450a9db 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
@@ -28,7 +28,7 @@ struct ps2dev { | |||
28 | struct serio *serio; | 28 | struct serio *serio; |
29 | 29 | ||
30 | /* Ensures that only one command is executing at a time */ | 30 | /* Ensures that only one command is executing at a time */ |
31 | struct semaphore cmd_sem; | 31 | struct mutex cmd_mutex; |
32 | 32 | ||
33 | /* Used to signal completion from interrupt handler */ | 33 | /* Used to signal completion from interrupt handler */ |
34 | wait_queue_head_t wait; | 34 | wait_queue_head_t wait; |
diff --git a/include/linux/list.h b/include/linux/list.h index 67258b47e9..76f0571834 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -619,7 +619,7 @@ static inline void hlist_del_rcu(struct hlist_node *n) | |||
619 | 619 | ||
620 | static inline void hlist_del_init(struct hlist_node *n) | 620 | static inline void hlist_del_init(struct hlist_node *n) |
621 | { | 621 | { |
622 | if (n->pprev) { | 622 | if (!hlist_unhashed(n)) { |
623 | __hlist_del(n); | 623 | __hlist_del(n); |
624 | INIT_HLIST_NODE(n); | 624 | INIT_HLIST_NODE(n); |
625 | } | 625 | } |
diff --git a/include/linux/m48t86.h b/include/linux/m48t86.h index 9065199319..915d6b4f0f 100644 --- a/include/linux/m48t86.h +++ b/include/linux/m48t86.h | |||
@@ -11,6 +11,6 @@ | |||
11 | 11 | ||
12 | struct m48t86_ops | 12 | struct m48t86_ops |
13 | { | 13 | { |
14 | void (*writeb)(unsigned char value, unsigned long addr); | 14 | void (*writebyte)(unsigned char value, unsigned long addr); |
15 | unsigned char (*readb)(unsigned long addr); | 15 | unsigned char (*readbyte)(unsigned long addr); |
16 | }; | 16 | }; |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 968b1aa373..9112063861 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -58,8 +58,6 @@ extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); | |||
58 | /* need some defines for these for archs that don't support it */ | 58 | /* need some defines for these for archs that don't support it */ |
59 | extern void online_page(struct page *page); | 59 | extern void online_page(struct page *page); |
60 | /* VM interface that may be used by firmware interface */ | 60 | /* VM interface that may be used by firmware interface */ |
61 | extern int add_memory(u64 start, u64 size); | ||
62 | extern int remove_memory(u64 start, u64 size); | ||
63 | extern int online_pages(unsigned long, unsigned long); | 61 | extern int online_pages(unsigned long, unsigned long); |
64 | 62 | ||
65 | /* reasonably generic interface to expand the physical pages in a zone */ | 63 | /* reasonably generic interface to expand the physical pages in a zone */ |
@@ -92,11 +90,6 @@ static inline int mhp_notimplemented(const char *func) | |||
92 | return -ENOSYS; | 90 | return -ENOSYS; |
93 | } | 91 | } |
94 | 92 | ||
95 | static inline int __add_pages(struct zone *zone, unsigned long start_pfn, | ||
96 | unsigned long nr_pages) | ||
97 | { | ||
98 | return mhp_notimplemented(__FUNCTION__); | ||
99 | } | ||
100 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ | 93 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ |
101 | static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | 94 | static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, |
102 | unsigned long nr_pages) | 95 | unsigned long nr_pages) |
@@ -105,4 +98,8 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | |||
105 | dump_stack(); | 98 | dump_stack(); |
106 | return -ENOSYS; | 99 | return -ENOSYS; |
107 | } | 100 | } |
101 | |||
102 | extern int add_memory(u64 start, u64 size); | ||
103 | extern int remove_memory(u64 start, u64 size); | ||
104 | |||
108 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ | 105 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 6a7621b2b1..f5fdca1d67 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/nodemask.h> | 36 | #include <linux/nodemask.h> |
37 | 37 | ||
38 | struct vm_area_struct; | 38 | struct vm_area_struct; |
39 | struct mm_struct; | ||
39 | 40 | ||
40 | #ifdef CONFIG_NUMA | 41 | #ifdef CONFIG_NUMA |
41 | 42 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6aa016f1d3..1154684209 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -229,10 +229,9 @@ struct page { | |||
229 | unsigned long private; /* Mapping-private opaque data: | 229 | unsigned long private; /* Mapping-private opaque data: |
230 | * usually used for buffer_heads | 230 | * usually used for buffer_heads |
231 | * if PagePrivate set; used for | 231 | * if PagePrivate set; used for |
232 | * swp_entry_t if PageSwapCache. | 232 | * swp_entry_t if PageSwapCache; |
233 | * When page is free, this | ||
234 | * indicates order in the buddy | 233 | * indicates order in the buddy |
235 | * system. | 234 | * system if PG_buddy is set. |
236 | */ | 235 | */ |
237 | struct address_space *mapping; /* If low bit clear, points to | 236 | struct address_space *mapping; /* If low bit clear, points to |
238 | * inode address_space, or NULL. | 237 | * inode address_space, or NULL. |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 30dd978c1e..991a37382a 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -28,6 +28,7 @@ struct mmc_csd { | |||
28 | unsigned short cmdclass; | 28 | unsigned short cmdclass; |
29 | unsigned short tacc_clks; | 29 | unsigned short tacc_clks; |
30 | unsigned int tacc_ns; | 30 | unsigned int tacc_ns; |
31 | unsigned int r2w_factor; | ||
31 | unsigned int max_dtr; | 32 | unsigned int max_dtr; |
32 | unsigned int read_blkbits; | 33 | unsigned int read_blkbits; |
33 | unsigned int write_blkbits; | 34 | unsigned int write_blkbits; |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index bdc556d884..03a14a30c4 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -69,6 +69,7 @@ struct mmc_data { | |||
69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ | 69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ |
70 | unsigned int timeout_clks; /* data timeout (in clocks) */ | 70 | unsigned int timeout_clks; /* data timeout (in clocks) */ |
71 | unsigned int blksz_bits; /* data block size */ | 71 | unsigned int blksz_bits; /* data block size */ |
72 | unsigned int blksz; /* data block size */ | ||
72 | unsigned int blocks; /* number of blocks */ | 73 | unsigned int blocks; /* number of blocks */ |
73 | unsigned int error; /* data error */ | 74 | unsigned int error; /* data error */ |
74 | unsigned int flags; | 75 | unsigned int flags; |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index b5c21122c2..2d83371504 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/seqlock.h> | 15 | #include <linux/seqlock.h> |
16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
17 | #include <asm/atomic.h> | 17 | #include <asm/atomic.h> |
18 | #include <asm/page.h> | ||
18 | 19 | ||
19 | /* Free memory management - zoned buddy allocator. */ | 20 | /* Free memory management - zoned buddy allocator. */ |
20 | #ifndef CONFIG_FORCE_MAX_ZONEORDER | 21 | #ifndef CONFIG_FORCE_MAX_ZONEORDER |
@@ -22,6 +23,7 @@ | |||
22 | #else | 23 | #else |
23 | #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER | 24 | #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER |
24 | #endif | 25 | #endif |
26 | #define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) | ||
25 | 27 | ||
26 | struct free_area { | 28 | struct free_area { |
27 | struct list_head free_list; | 29 | struct list_head free_list; |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 7b08c11ec4..f697770858 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -249,4 +249,52 @@ struct i2c_device_id { | |||
249 | __u16 id; | 249 | __u16 id; |
250 | }; | 250 | }; |
251 | 251 | ||
252 | /* Input */ | ||
253 | #define INPUT_DEVICE_ID_EV_MAX 0x1f | ||
254 | #define INPUT_DEVICE_ID_KEY_MAX 0x1ff | ||
255 | #define INPUT_DEVICE_ID_REL_MAX 0x0f | ||
256 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f | ||
257 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 | ||
258 | #define INPUT_DEVICE_ID_LED_MAX 0x0f | ||
259 | #define INPUT_DEVICE_ID_SND_MAX 0x07 | ||
260 | #define INPUT_DEVICE_ID_FF_MAX 0x7f | ||
261 | #define INPUT_DEVICE_ID_SW_MAX 0x0f | ||
262 | |||
263 | #define INPUT_DEVICE_ID_MATCH_BUS 1 | ||
264 | #define INPUT_DEVICE_ID_MATCH_VENDOR 2 | ||
265 | #define INPUT_DEVICE_ID_MATCH_PRODUCT 4 | ||
266 | #define INPUT_DEVICE_ID_MATCH_VERSION 8 | ||
267 | |||
268 | #define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010 | ||
269 | #define INPUT_DEVICE_ID_MATCH_KEYBIT 0x0020 | ||
270 | #define INPUT_DEVICE_ID_MATCH_RELBIT 0x0040 | ||
271 | #define INPUT_DEVICE_ID_MATCH_ABSBIT 0x0080 | ||
272 | #define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100 | ||
273 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x0200 | ||
274 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x0400 | ||
275 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800 | ||
276 | #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000 | ||
277 | |||
278 | struct input_device_id { | ||
279 | |||
280 | kernel_ulong_t flags; | ||
281 | |||
282 | __u16 bustype; | ||
283 | __u16 vendor; | ||
284 | __u16 product; | ||
285 | __u16 version; | ||
286 | |||
287 | kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1]; | ||
288 | kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1]; | ||
289 | kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1]; | ||
290 | kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1]; | ||
291 | kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1]; | ||
292 | kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1]; | ||
293 | kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1]; | ||
294 | kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1]; | ||
295 | kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1]; | ||
296 | |||
297 | kernel_ulong_t driver_info; | ||
298 | }; | ||
299 | |||
252 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 300 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h index 955d3069d7..edfa012fad 100644 --- a/include/linux/mv643xx.h +++ b/include/linux/mv643xx.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #ifndef __ASM_MV643XX_H | 13 | #ifndef __ASM_MV643XX_H |
14 | #define __ASM_MV643XX_H | 14 | #define __ASM_MV643XX_H |
15 | 15 | ||
16 | #ifdef __MIPS__ | 16 | #ifdef __mips__ |
17 | #include <asm/addrspace.h> | 17 | #include <asm/addrspace.h> |
18 | #include <asm/marvell.h> | 18 | #include <asm/marvell.h> |
19 | #endif | 19 | #endif |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 40ccf8cc42..f4169bbb60 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -433,8 +433,7 @@ struct net_device | |||
433 | 433 | ||
434 | /* register/unregister state machine */ | 434 | /* register/unregister state machine */ |
435 | enum { NETREG_UNINITIALIZED=0, | 435 | enum { NETREG_UNINITIALIZED=0, |
436 | NETREG_REGISTERING, /* called register_netdevice */ | 436 | NETREG_REGISTERED, /* completed register_netdevice */ |
437 | NETREG_REGISTERED, /* completed register todo */ | ||
438 | NETREG_UNREGISTERING, /* called unregister_netdevice */ | 437 | NETREG_UNREGISTERING, /* called unregister_netdevice */ |
439 | NETREG_UNREGISTERED, /* completed unregister todo */ | 438 | NETREG_UNREGISTERED, /* completed unregister todo */ |
440 | NETREG_RELEASED, /* called free_netdev */ | 439 | NETREG_RELEASED, /* called free_netdev */ |
@@ -506,6 +505,8 @@ struct net_device | |||
506 | 505 | ||
507 | /* class/net/name entry */ | 506 | /* class/net/name entry */ |
508 | struct class_device class_dev; | 507 | struct class_device class_dev; |
508 | /* space for optional statistics and wireless sysfs groups */ | ||
509 | struct attribute_group *sysfs_groups[3]; | ||
509 | }; | 510 | }; |
510 | 511 | ||
511 | #define NETDEV_ALIGN 32 | 512 | #define NETDEV_ALIGN 32 |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 412e52ca97..b31a9bca93 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -110,6 +110,8 @@ struct nf_info | |||
110 | /* Function to register/unregister hook points. */ | 110 | /* Function to register/unregister hook points. */ |
111 | int nf_register_hook(struct nf_hook_ops *reg); | 111 | int nf_register_hook(struct nf_hook_ops *reg); |
112 | void nf_unregister_hook(struct nf_hook_ops *reg); | 112 | void nf_unregister_hook(struct nf_hook_ops *reg); |
113 | int nf_register_hooks(struct nf_hook_ops *reg, unsigned int n); | ||
114 | void nf_unregister_hooks(struct nf_hook_ops *reg, unsigned int n); | ||
113 | 115 | ||
114 | /* Functions to register get/setsockopt ranges (non-inclusive). You | 116 | /* Functions to register get/setsockopt ranges (non-inclusive). You |
115 | need to check permissions yourself! */ | 117 | need to check permissions yourself! */ |
@@ -281,16 +283,42 @@ extern void nf_invalidate_cache(int pf); | |||
281 | Returns true or false. */ | 283 | Returns true or false. */ |
282 | extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); | 284 | extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); |
283 | 285 | ||
284 | struct nf_queue_rerouter { | 286 | struct nf_afinfo { |
285 | void (*save)(const struct sk_buff *skb, struct nf_info *info); | 287 | unsigned short family; |
286 | int (*reroute)(struct sk_buff **skb, const struct nf_info *info); | 288 | unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook, |
287 | int rer_size; | 289 | unsigned int dataoff, u_int8_t protocol); |
290 | void (*saveroute)(const struct sk_buff *skb, | ||
291 | struct nf_info *info); | ||
292 | int (*reroute)(struct sk_buff **skb, | ||
293 | const struct nf_info *info); | ||
294 | int route_key_size; | ||
288 | }; | 295 | }; |
289 | 296 | ||
290 | #define nf_info_reroute(x) ((void *)x + sizeof(struct nf_info)) | 297 | extern struct nf_afinfo *nf_afinfo[]; |
298 | static inline struct nf_afinfo *nf_get_afinfo(unsigned short family) | ||
299 | { | ||
300 | return rcu_dereference(nf_afinfo[family]); | ||
301 | } | ||
302 | |||
303 | static inline unsigned int | ||
304 | nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, | ||
305 | u_int8_t protocol, unsigned short family) | ||
306 | { | ||
307 | struct nf_afinfo *afinfo; | ||
308 | unsigned int csum = 0; | ||
309 | |||
310 | rcu_read_lock(); | ||
311 | afinfo = nf_get_afinfo(family); | ||
312 | if (afinfo) | ||
313 | csum = afinfo->checksum(skb, hook, dataoff, protocol); | ||
314 | rcu_read_unlock(); | ||
315 | return csum; | ||
316 | } | ||
291 | 317 | ||
292 | extern int nf_register_queue_rerouter(int pf, struct nf_queue_rerouter *rer); | 318 | extern int nf_register_afinfo(struct nf_afinfo *afinfo); |
293 | extern int nf_unregister_queue_rerouter(int pf); | 319 | extern void nf_unregister_afinfo(struct nf_afinfo *afinfo); |
320 | |||
321 | #define nf_info_reroute(x) ((void *)x + sizeof(struct nf_info)) | ||
294 | 322 | ||
295 | #include <net/flow.h> | 323 | #include <net/flow.h> |
296 | extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); | 324 | extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 1350e47b02..48cc32d83f 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -142,6 +142,12 @@ struct xt_counters_info | |||
142 | #define ASSERT_WRITE_LOCK(x) | 142 | #define ASSERT_WRITE_LOCK(x) |
143 | #include <linux/netfilter_ipv4/listhelp.h> | 143 | #include <linux/netfilter_ipv4/listhelp.h> |
144 | 144 | ||
145 | #ifdef CONFIG_COMPAT | ||
146 | #define COMPAT_TO_USER 1 | ||
147 | #define COMPAT_FROM_USER -1 | ||
148 | #define COMPAT_CALC_SIZE 0 | ||
149 | #endif | ||
150 | |||
145 | struct xt_match | 151 | struct xt_match |
146 | { | 152 | { |
147 | struct list_head list; | 153 | struct list_head list; |
@@ -175,6 +181,9 @@ struct xt_match | |||
175 | void (*destroy)(const struct xt_match *match, void *matchinfo, | 181 | void (*destroy)(const struct xt_match *match, void *matchinfo, |
176 | unsigned int matchinfosize); | 182 | unsigned int matchinfosize); |
177 | 183 | ||
184 | /* Called when userspace align differs from kernel space one */ | ||
185 | int (*compat)(void *match, void **dstptr, int *size, int convert); | ||
186 | |||
178 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 187 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
179 | struct module *me; | 188 | struct module *me; |
180 | 189 | ||
@@ -220,6 +229,9 @@ struct xt_target | |||
220 | void (*destroy)(const struct xt_target *target, void *targinfo, | 229 | void (*destroy)(const struct xt_target *target, void *targinfo, |
221 | unsigned int targinfosize); | 230 | unsigned int targinfosize); |
222 | 231 | ||
232 | /* Called when userspace align differs from kernel space one */ | ||
233 | int (*compat)(void *target, void **dstptr, int *size, int convert); | ||
234 | |||
223 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 235 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
224 | struct module *me; | 236 | struct module *me; |
225 | 237 | ||
@@ -314,6 +326,73 @@ extern void xt_proto_fini(int af); | |||
314 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); | 326 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); |
315 | extern void xt_free_table_info(struct xt_table_info *info); | 327 | extern void xt_free_table_info(struct xt_table_info *info); |
316 | 328 | ||
329 | #ifdef CONFIG_COMPAT | ||
330 | #include <net/compat.h> | ||
331 | |||
332 | struct compat_xt_entry_match | ||
333 | { | ||
334 | union { | ||
335 | struct { | ||
336 | u_int16_t match_size; | ||
337 | char name[XT_FUNCTION_MAXNAMELEN - 1]; | ||
338 | u_int8_t revision; | ||
339 | } user; | ||
340 | struct { | ||
341 | u_int16_t match_size; | ||
342 | compat_uptr_t match; | ||
343 | } kernel; | ||
344 | u_int16_t match_size; | ||
345 | } u; | ||
346 | unsigned char data[0]; | ||
347 | }; | ||
348 | |||
349 | struct compat_xt_entry_target | ||
350 | { | ||
351 | union { | ||
352 | struct { | ||
353 | u_int16_t target_size; | ||
354 | char name[XT_FUNCTION_MAXNAMELEN - 1]; | ||
355 | u_int8_t revision; | ||
356 | } user; | ||
357 | struct { | ||
358 | u_int16_t target_size; | ||
359 | compat_uptr_t target; | ||
360 | } kernel; | ||
361 | u_int16_t target_size; | ||
362 | } u; | ||
363 | unsigned char data[0]; | ||
364 | }; | ||
365 | |||
366 | /* FIXME: this works only on 32 bit tasks | ||
367 | * need to change whole approach in order to calculate align as function of | ||
368 | * current task alignment */ | ||
369 | |||
370 | struct compat_xt_counters | ||
371 | { | ||
372 | #if defined(CONFIG_X86_64) || defined(CONFIG_IA64) | ||
373 | u_int32_t cnt[4]; | ||
374 | #else | ||
375 | u_int64_t cnt[2]; | ||
376 | #endif | ||
377 | }; | ||
378 | |||
379 | struct compat_xt_counters_info | ||
380 | { | ||
381 | char name[XT_TABLE_MAXNAMELEN]; | ||
382 | compat_uint_t num_counters; | ||
383 | struct compat_xt_counters counters[0]; | ||
384 | }; | ||
385 | |||
386 | #define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ | ||
387 | & ~(__alignof__(struct compat_xt_counters)-1)) | ||
388 | |||
389 | extern void xt_compat_lock(int af); | ||
390 | extern void xt_compat_unlock(int af); | ||
391 | extern int xt_compat_match(void *match, void **dstptr, int *size, int convert); | ||
392 | extern int xt_compat_target(void *target, void **dstptr, int *size, | ||
393 | int convert); | ||
394 | |||
395 | #endif /* CONFIG_COMPAT */ | ||
317 | #endif /* __KERNEL__ */ | 396 | #endif /* __KERNEL__ */ |
318 | 397 | ||
319 | #endif /* _X_TABLES_H */ | 398 | #endif /* _X_TABLES_H */ |
diff --git a/include/linux/netfilter/xt_esp.h b/include/linux/netfilter/xt_esp.h new file mode 100644 index 0000000000..9380fb1c27 --- /dev/null +++ b/include/linux/netfilter/xt_esp.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _XT_ESP_H | ||
2 | #define _XT_ESP_H | ||
3 | |||
4 | struct xt_esp | ||
5 | { | ||
6 | u_int32_t spis[2]; /* Security Parameter Index */ | ||
7 | u_int8_t invflags; /* Inverse flags */ | ||
8 | }; | ||
9 | |||
10 | /* Values for "invflags" field in struct xt_esp. */ | ||
11 | #define XT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */ | ||
12 | #define XT_ESP_INV_MASK 0x01 /* All possible flags. */ | ||
13 | |||
14 | #endif /*_XT_ESP_H*/ | ||
diff --git a/include/linux/netfilter/xt_multiport.h b/include/linux/netfilter/xt_multiport.h new file mode 100644 index 0000000000..d49ee41837 --- /dev/null +++ b/include/linux/netfilter/xt_multiport.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef _XT_MULTIPORT_H | ||
2 | #define _XT_MULTIPORT_H | ||
3 | |||
4 | enum xt_multiport_flags | ||
5 | { | ||
6 | XT_MULTIPORT_SOURCE, | ||
7 | XT_MULTIPORT_DESTINATION, | ||
8 | XT_MULTIPORT_EITHER | ||
9 | }; | ||
10 | |||
11 | #define XT_MULTI_PORTS 15 | ||
12 | |||
13 | /* Must fit inside union xt_matchinfo: 16 bytes */ | ||
14 | struct xt_multiport | ||
15 | { | ||
16 | u_int8_t flags; /* Type of comparison */ | ||
17 | u_int8_t count; /* Number of ports */ | ||
18 | u_int16_t ports[XT_MULTI_PORTS]; /* Ports */ | ||
19 | }; | ||
20 | |||
21 | struct xt_multiport_v1 | ||
22 | { | ||
23 | u_int8_t flags; /* Type of comparison */ | ||
24 | u_int8_t count; /* Number of ports */ | ||
25 | u_int16_t ports[XT_MULTI_PORTS]; /* Ports */ | ||
26 | u_int8_t pflags[XT_MULTI_PORTS]; /* Port flags */ | ||
27 | u_int8_t invert; /* Invert flag */ | ||
28 | }; | ||
29 | |||
30 | #endif /*_XT_MULTIPORT_H*/ | ||
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 43c09d790b..85301c5e8d 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -80,6 +80,8 @@ enum nf_ip_hook_priorities { | |||
80 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
81 | extern int ip_route_me_harder(struct sk_buff **pskb); | 81 | extern int ip_route_me_harder(struct sk_buff **pskb); |
82 | extern int ip_xfrm_me_harder(struct sk_buff **pskb); | 82 | extern int ip_xfrm_me_harder(struct sk_buff **pskb); |
83 | extern unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, | ||
84 | unsigned int dataoff, u_int8_t protocol); | ||
83 | #endif /*__KERNEL__*/ | 85 | #endif /*__KERNEL__*/ |
84 | 86 | ||
85 | #endif /*__LINUX_IP_NETFILTER_H*/ | 87 | #endif /*__LINUX_IP_NETFILTER_H*/ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h index 0987cea538..eace86bd2a 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h> | ||
7 | |||
6 | #define RAS_PORT 1719 | 8 | #define RAS_PORT 1719 |
7 | #define Q931_PORT 1720 | 9 | #define Q931_PORT 1720 |
8 | #define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */ | 10 | #define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */ |
@@ -25,6 +27,56 @@ struct ip_ct_h323_master { | |||
25 | }; | 27 | }; |
26 | }; | 28 | }; |
27 | 29 | ||
30 | struct ip_conntrack_expect; | ||
31 | |||
32 | extern int get_h225_addr(unsigned char *data, TransportAddress * addr, | ||
33 | u_int32_t * ip, u_int16_t * port); | ||
34 | extern void ip_conntrack_h245_expect(struct ip_conntrack *new, | ||
35 | struct ip_conntrack_expect *this); | ||
36 | extern void ip_conntrack_q931_expect(struct ip_conntrack *new, | ||
37 | struct ip_conntrack_expect *this); | ||
38 | extern int (*set_h245_addr_hook) (struct sk_buff ** pskb, | ||
39 | unsigned char **data, int dataoff, | ||
40 | H245_TransportAddress * addr, | ||
41 | u_int32_t ip, u_int16_t port); | ||
42 | extern int (*set_h225_addr_hook) (struct sk_buff ** pskb, | ||
43 | unsigned char **data, int dataoff, | ||
44 | TransportAddress * addr, | ||
45 | u_int32_t ip, u_int16_t port); | ||
46 | extern int (*set_sig_addr_hook) (struct sk_buff ** pskb, | ||
47 | struct ip_conntrack * ct, | ||
48 | enum ip_conntrack_info ctinfo, | ||
49 | unsigned char **data, | ||
50 | TransportAddress * addr, int count); | ||
51 | extern int (*set_ras_addr_hook) (struct sk_buff ** pskb, | ||
52 | struct ip_conntrack * ct, | ||
53 | enum ip_conntrack_info ctinfo, | ||
54 | unsigned char **data, | ||
55 | TransportAddress * addr, int count); | ||
56 | extern int (*nat_rtp_rtcp_hook) (struct sk_buff ** pskb, | ||
57 | struct ip_conntrack * ct, | ||
58 | enum ip_conntrack_info ctinfo, | ||
59 | unsigned char **data, int dataoff, | ||
60 | H245_TransportAddress * addr, | ||
61 | u_int16_t port, u_int16_t rtp_port, | ||
62 | struct ip_conntrack_expect * rtp_exp, | ||
63 | struct ip_conntrack_expect * rtcp_exp); | ||
64 | extern int (*nat_t120_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, | ||
65 | enum ip_conntrack_info ctinfo, | ||
66 | unsigned char **data, int dataoff, | ||
67 | H245_TransportAddress * addr, u_int16_t port, | ||
68 | struct ip_conntrack_expect * exp); | ||
69 | extern int (*nat_h245_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, | ||
70 | enum ip_conntrack_info ctinfo, | ||
71 | unsigned char **data, int dataoff, | ||
72 | TransportAddress * addr, u_int16_t port, | ||
73 | struct ip_conntrack_expect * exp); | ||
74 | extern int (*nat_q931_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, | ||
75 | enum ip_conntrack_info ctinfo, | ||
76 | unsigned char **data, TransportAddress * addr, | ||
77 | int idx, u_int16_t port, | ||
78 | struct ip_conntrack_expect * exp); | ||
79 | |||
28 | #endif | 80 | #endif |
29 | 81 | ||
30 | #endif | 82 | #endif |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h new file mode 100644 index 0000000000..c6e9a0b6d3 --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h | |||
@@ -0,0 +1,98 @@ | |||
1 | /**************************************************************************** | ||
2 | * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 | ||
3 | * conntrack/NAT module. | ||
4 | * | ||
5 | * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net> | ||
6 | * | ||
7 | * This source code is licensed under General Public License version 2. | ||
8 | * | ||
9 | * | ||
10 | * This library is based on H.225 version 4, H.235 version 2 and H.245 | ||
11 | * version 7. It is extremely optimized to decode only the absolutely | ||
12 | * necessary objects in a signal for Linux kernel NAT module use, so don't | ||
13 | * expect it to be a full ASN.1 library. | ||
14 | * | ||
15 | * Features: | ||
16 | * | ||
17 | * 1. Small. The total size of code plus data is less than 20 KB (IA32). | ||
18 | * 2. Fast. Decoding Netmeeting's Setup signal 1 million times on a PIII 866 | ||
19 | * takes only 3.9 seconds. | ||
20 | * 3. No memory allocation. It uses a static object. No need to initialize or | ||
21 | * cleanup. | ||
22 | * 4. Thread safe. | ||
23 | * 5. Support embedded architectures that has no misaligned memory access | ||
24 | * support. | ||
25 | * | ||
26 | * Limitations: | ||
27 | * | ||
28 | * 1. At most 30 faststart entries. Actually this is limited by ethernet's MTU. | ||
29 | * If a Setup signal contains more than 30 faststart, the packet size will | ||
30 | * very likely exceed the MTU size, then the TPKT will be fragmented. I | ||
31 | * don't know how to handle this in a Netfilter module. Anybody can help? | ||
32 | * Although I think 30 is enough for most of the cases. | ||
33 | * 2. IPv4 addresses only. | ||
34 | * | ||
35 | ****************************************************************************/ | ||
36 | |||
37 | #ifndef _IP_CONNTRACK_HELPER_H323_ASN1_H_ | ||
38 | #define _IP_CONNTRACK_HELPER_H323_ASN1_H_ | ||
39 | |||
40 | /***************************************************************************** | ||
41 | * H.323 Types | ||
42 | ****************************************************************************/ | ||
43 | #include "ip_conntrack_helper_h323_types.h" | ||
44 | |||
45 | typedef struct { | ||
46 | enum { | ||
47 | Q931_NationalEscape = 0x00, | ||
48 | Q931_Alerting = 0x01, | ||
49 | Q931_CallProceeding = 0x02, | ||
50 | Q931_Connect = 0x07, | ||
51 | Q931_ConnectAck = 0x0F, | ||
52 | Q931_Progress = 0x03, | ||
53 | Q931_Setup = 0x05, | ||
54 | Q931_SetupAck = 0x0D, | ||
55 | Q931_Resume = 0x26, | ||
56 | Q931_ResumeAck = 0x2E, | ||
57 | Q931_ResumeReject = 0x22, | ||
58 | Q931_Suspend = 0x25, | ||
59 | Q931_SuspendAck = 0x2D, | ||
60 | Q931_SuspendReject = 0x21, | ||
61 | Q931_UserInformation = 0x20, | ||
62 | Q931_Disconnect = 0x45, | ||
63 | Q931_Release = 0x4D, | ||
64 | Q931_ReleaseComplete = 0x5A, | ||
65 | Q931_Restart = 0x46, | ||
66 | Q931_RestartAck = 0x4E, | ||
67 | Q931_Segment = 0x60, | ||
68 | Q931_CongestionCtrl = 0x79, | ||
69 | Q931_Information = 0x7B, | ||
70 | Q931_Notify = 0x6E, | ||
71 | Q931_Status = 0x7D, | ||
72 | Q931_StatusEnquiry = 0x75, | ||
73 | Q931_Facility = 0x62 | ||
74 | } MessageType; | ||
75 | H323_UserInformation UUIE; | ||
76 | } Q931; | ||
77 | |||
78 | /***************************************************************************** | ||
79 | * Decode Functions Return Codes | ||
80 | ****************************************************************************/ | ||
81 | |||
82 | #define H323_ERROR_NONE 0 /* Decoded successfully */ | ||
83 | #define H323_ERROR_STOP 1 /* Decoding stopped, not really an error */ | ||
84 | #define H323_ERROR_BOUND -1 | ||
85 | #define H323_ERROR_RANGE -2 | ||
86 | |||
87 | |||
88 | /***************************************************************************** | ||
89 | * Decode Functions | ||
90 | ****************************************************************************/ | ||
91 | |||
92 | int DecodeRasMessage(unsigned char *buf, size_t sz, RasMessage * ras); | ||
93 | int DecodeQ931(unsigned char *buf, size_t sz, Q931 * q931); | ||
94 | int DecodeMultimediaSystemControlMessage(unsigned char *buf, size_t sz, | ||
95 | MultimediaSystemControlMessage * | ||
96 | mscm); | ||
97 | |||
98 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h new file mode 100644 index 0000000000..cc98f7aa5a --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h | |||
@@ -0,0 +1,938 @@ | |||
1 | /* Generated by Jing Min Zhao's ASN.1 parser, Mar 15 2006 | ||
2 | * | ||
3 | * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net> | ||
4 | * | ||
5 | * This source code is licensed under General Public License version 2. | ||
6 | */ | ||
7 | |||
8 | typedef struct TransportAddress_ipAddress { /* SEQUENCE */ | ||
9 | int options; /* No use */ | ||
10 | unsigned ip; | ||
11 | } TransportAddress_ipAddress; | ||
12 | |||
13 | typedef struct TransportAddress { /* CHOICE */ | ||
14 | enum { | ||
15 | eTransportAddress_ipAddress, | ||
16 | eTransportAddress_ipSourceRoute, | ||
17 | eTransportAddress_ipxAddress, | ||
18 | eTransportAddress_ip6Address, | ||
19 | eTransportAddress_netBios, | ||
20 | eTransportAddress_nsap, | ||
21 | eTransportAddress_nonStandardAddress, | ||
22 | } choice; | ||
23 | union { | ||
24 | TransportAddress_ipAddress ipAddress; | ||
25 | }; | ||
26 | } TransportAddress; | ||
27 | |||
28 | typedef struct DataProtocolCapability { /* CHOICE */ | ||
29 | enum { | ||
30 | eDataProtocolCapability_nonStandard, | ||
31 | eDataProtocolCapability_v14buffered, | ||
32 | eDataProtocolCapability_v42lapm, | ||
33 | eDataProtocolCapability_hdlcFrameTunnelling, | ||
34 | eDataProtocolCapability_h310SeparateVCStack, | ||
35 | eDataProtocolCapability_h310SingleVCStack, | ||
36 | eDataProtocolCapability_transparent, | ||
37 | eDataProtocolCapability_segmentationAndReassembly, | ||
38 | eDataProtocolCapability_hdlcFrameTunnelingwSAR, | ||
39 | eDataProtocolCapability_v120, | ||
40 | eDataProtocolCapability_separateLANStack, | ||
41 | eDataProtocolCapability_v76wCompression, | ||
42 | eDataProtocolCapability_tcp, | ||
43 | eDataProtocolCapability_udp, | ||
44 | } choice; | ||
45 | } DataProtocolCapability; | ||
46 | |||
47 | typedef struct DataApplicationCapability_application { /* CHOICE */ | ||
48 | enum { | ||
49 | eDataApplicationCapability_application_nonStandard, | ||
50 | eDataApplicationCapability_application_t120, | ||
51 | eDataApplicationCapability_application_dsm_cc, | ||
52 | eDataApplicationCapability_application_userData, | ||
53 | eDataApplicationCapability_application_t84, | ||
54 | eDataApplicationCapability_application_t434, | ||
55 | eDataApplicationCapability_application_h224, | ||
56 | eDataApplicationCapability_application_nlpid, | ||
57 | eDataApplicationCapability_application_dsvdControl, | ||
58 | eDataApplicationCapability_application_h222DataPartitioning, | ||
59 | eDataApplicationCapability_application_t30fax, | ||
60 | eDataApplicationCapability_application_t140, | ||
61 | eDataApplicationCapability_application_t38fax, | ||
62 | eDataApplicationCapability_application_genericDataCapability, | ||
63 | } choice; | ||
64 | union { | ||
65 | DataProtocolCapability t120; | ||
66 | }; | ||
67 | } DataApplicationCapability_application; | ||
68 | |||
69 | typedef struct DataApplicationCapability { /* SEQUENCE */ | ||
70 | int options; /* No use */ | ||
71 | DataApplicationCapability_application application; | ||
72 | } DataApplicationCapability; | ||
73 | |||
74 | typedef struct DataType { /* CHOICE */ | ||
75 | enum { | ||
76 | eDataType_nonStandard, | ||
77 | eDataType_nullData, | ||
78 | eDataType_videoData, | ||
79 | eDataType_audioData, | ||
80 | eDataType_data, | ||
81 | eDataType_encryptionData, | ||
82 | eDataType_h235Control, | ||
83 | eDataType_h235Media, | ||
84 | eDataType_multiplexedStream, | ||
85 | } choice; | ||
86 | union { | ||
87 | DataApplicationCapability data; | ||
88 | }; | ||
89 | } DataType; | ||
90 | |||
91 | typedef struct UnicastAddress_iPAddress { /* SEQUENCE */ | ||
92 | int options; /* No use */ | ||
93 | unsigned network; | ||
94 | } UnicastAddress_iPAddress; | ||
95 | |||
96 | typedef struct UnicastAddress { /* CHOICE */ | ||
97 | enum { | ||
98 | eUnicastAddress_iPAddress, | ||
99 | eUnicastAddress_iPXAddress, | ||
100 | eUnicastAddress_iP6Address, | ||
101 | eUnicastAddress_netBios, | ||
102 | eUnicastAddress_iPSourceRouteAddress, | ||
103 | eUnicastAddress_nsap, | ||
104 | eUnicastAddress_nonStandardAddress, | ||
105 | } choice; | ||
106 | union { | ||
107 | UnicastAddress_iPAddress iPAddress; | ||
108 | }; | ||
109 | } UnicastAddress; | ||
110 | |||
111 | typedef struct H245_TransportAddress { /* CHOICE */ | ||
112 | enum { | ||
113 | eH245_TransportAddress_unicastAddress, | ||
114 | eH245_TransportAddress_multicastAddress, | ||
115 | } choice; | ||
116 | union { | ||
117 | UnicastAddress unicastAddress; | ||
118 | }; | ||
119 | } H245_TransportAddress; | ||
120 | |||
121 | typedef struct H2250LogicalChannelParameters { /* SEQUENCE */ | ||
122 | enum { | ||
123 | eH2250LogicalChannelParameters_nonStandard = (1 << 31), | ||
124 | eH2250LogicalChannelParameters_associatedSessionID = | ||
125 | (1 << 30), | ||
126 | eH2250LogicalChannelParameters_mediaChannel = (1 << 29), | ||
127 | eH2250LogicalChannelParameters_mediaGuaranteedDelivery = | ||
128 | (1 << 28), | ||
129 | eH2250LogicalChannelParameters_mediaControlChannel = | ||
130 | (1 << 27), | ||
131 | eH2250LogicalChannelParameters_mediaControlGuaranteedDelivery | ||
132 | = (1 << 26), | ||
133 | eH2250LogicalChannelParameters_silenceSuppression = (1 << 25), | ||
134 | eH2250LogicalChannelParameters_destination = (1 << 24), | ||
135 | eH2250LogicalChannelParameters_dynamicRTPPayloadType = | ||
136 | (1 << 23), | ||
137 | eH2250LogicalChannelParameters_mediaPacketization = (1 << 22), | ||
138 | eH2250LogicalChannelParameters_transportCapability = | ||
139 | (1 << 21), | ||
140 | eH2250LogicalChannelParameters_redundancyEncoding = (1 << 20), | ||
141 | eH2250LogicalChannelParameters_source = (1 << 19), | ||
142 | } options; | ||
143 | H245_TransportAddress mediaChannel; | ||
144 | H245_TransportAddress mediaControlChannel; | ||
145 | } H2250LogicalChannelParameters; | ||
146 | |||
147 | typedef struct OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters { /* CHOICE */ | ||
148 | enum { | ||
149 | eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h222LogicalChannelParameters, | ||
150 | eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h223LogicalChannelParameters, | ||
151 | eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_v76LogicalChannelParameters, | ||
152 | eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters, | ||
153 | eOpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters_none, | ||
154 | } choice; | ||
155 | union { | ||
156 | H2250LogicalChannelParameters h2250LogicalChannelParameters; | ||
157 | }; | ||
158 | } OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters; | ||
159 | |||
160 | typedef struct OpenLogicalChannel_forwardLogicalChannelParameters { /* SEQUENCE */ | ||
161 | enum { | ||
162 | eOpenLogicalChannel_forwardLogicalChannelParameters_portNumber | ||
163 | = (1 << 31), | ||
164 | eOpenLogicalChannel_forwardLogicalChannelParameters_forwardLogicalChannelDependency | ||
165 | = (1 << 30), | ||
166 | eOpenLogicalChannel_forwardLogicalChannelParameters_replacementFor | ||
167 | = (1 << 29), | ||
168 | } options; | ||
169 | DataType dataType; | ||
170 | OpenLogicalChannel_forwardLogicalChannelParameters_multiplexParameters | ||
171 | multiplexParameters; | ||
172 | } OpenLogicalChannel_forwardLogicalChannelParameters; | ||
173 | |||
174 | typedef struct OpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters { /* CHOICE */ | ||
175 | enum { | ||
176 | eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters_h223LogicalChannelParameters, | ||
177 | eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters_v76LogicalChannelParameters, | ||
178 | eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters, | ||
179 | } choice; | ||
180 | union { | ||
181 | H2250LogicalChannelParameters h2250LogicalChannelParameters; | ||
182 | }; | ||
183 | } OpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters; | ||
184 | |||
185 | typedef struct OpenLogicalChannel_reverseLogicalChannelParameters { /* SEQUENCE */ | ||
186 | enum { | ||
187 | eOpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters | ||
188 | = (1 << 31), | ||
189 | eOpenLogicalChannel_reverseLogicalChannelParameters_reverseLogicalChannelDependency | ||
190 | = (1 << 30), | ||
191 | eOpenLogicalChannel_reverseLogicalChannelParameters_replacementFor | ||
192 | = (1 << 29), | ||
193 | } options; | ||
194 | OpenLogicalChannel_reverseLogicalChannelParameters_multiplexParameters | ||
195 | multiplexParameters; | ||
196 | } OpenLogicalChannel_reverseLogicalChannelParameters; | ||
197 | |||
198 | typedef struct NetworkAccessParameters_networkAddress { /* CHOICE */ | ||
199 | enum { | ||
200 | eNetworkAccessParameters_networkAddress_q2931Address, | ||
201 | eNetworkAccessParameters_networkAddress_e164Address, | ||
202 | eNetworkAccessParameters_networkAddress_localAreaAddress, | ||
203 | } choice; | ||
204 | union { | ||
205 | H245_TransportAddress localAreaAddress; | ||
206 | }; | ||
207 | } NetworkAccessParameters_networkAddress; | ||
208 | |||
209 | typedef struct NetworkAccessParameters { /* SEQUENCE */ | ||
210 | enum { | ||
211 | eNetworkAccessParameters_distribution = (1 << 31), | ||
212 | eNetworkAccessParameters_externalReference = (1 << 30), | ||
213 | eNetworkAccessParameters_t120SetupProcedure = (1 << 29), | ||
214 | } options; | ||
215 | NetworkAccessParameters_networkAddress networkAddress; | ||
216 | } NetworkAccessParameters; | ||
217 | |||
218 | typedef struct OpenLogicalChannel { /* SEQUENCE */ | ||
219 | enum { | ||
220 | eOpenLogicalChannel_reverseLogicalChannelParameters = | ||
221 | (1 << 31), | ||
222 | eOpenLogicalChannel_separateStack = (1 << 30), | ||
223 | eOpenLogicalChannel_encryptionSync = (1 << 29), | ||
224 | } options; | ||
225 | OpenLogicalChannel_forwardLogicalChannelParameters | ||
226 | forwardLogicalChannelParameters; | ||
227 | OpenLogicalChannel_reverseLogicalChannelParameters | ||
228 | reverseLogicalChannelParameters; | ||
229 | NetworkAccessParameters separateStack; | ||
230 | } OpenLogicalChannel; | ||
231 | |||
232 | typedef struct Setup_UUIE_fastStart { /* SEQUENCE OF */ | ||
233 | int count; | ||
234 | OpenLogicalChannel item[30]; | ||
235 | } Setup_UUIE_fastStart; | ||
236 | |||
237 | typedef struct Setup_UUIE { /* SEQUENCE */ | ||
238 | enum { | ||
239 | eSetup_UUIE_h245Address = (1 << 31), | ||
240 | eSetup_UUIE_sourceAddress = (1 << 30), | ||
241 | eSetup_UUIE_destinationAddress = (1 << 29), | ||
242 | eSetup_UUIE_destCallSignalAddress = (1 << 28), | ||
243 | eSetup_UUIE_destExtraCallInfo = (1 << 27), | ||
244 | eSetup_UUIE_destExtraCRV = (1 << 26), | ||
245 | eSetup_UUIE_callServices = (1 << 25), | ||
246 | eSetup_UUIE_sourceCallSignalAddress = (1 << 24), | ||
247 | eSetup_UUIE_remoteExtensionAddress = (1 << 23), | ||
248 | eSetup_UUIE_callIdentifier = (1 << 22), | ||
249 | eSetup_UUIE_h245SecurityCapability = (1 << 21), | ||
250 | eSetup_UUIE_tokens = (1 << 20), | ||
251 | eSetup_UUIE_cryptoTokens = (1 << 19), | ||
252 | eSetup_UUIE_fastStart = (1 << 18), | ||
253 | eSetup_UUIE_mediaWaitForConnect = (1 << 17), | ||
254 | eSetup_UUIE_canOverlapSend = (1 << 16), | ||
255 | eSetup_UUIE_endpointIdentifier = (1 << 15), | ||
256 | eSetup_UUIE_multipleCalls = (1 << 14), | ||
257 | eSetup_UUIE_maintainConnection = (1 << 13), | ||
258 | eSetup_UUIE_connectionParameters = (1 << 12), | ||
259 | eSetup_UUIE_language = (1 << 11), | ||
260 | eSetup_UUIE_presentationIndicator = (1 << 10), | ||
261 | eSetup_UUIE_screeningIndicator = (1 << 9), | ||
262 | eSetup_UUIE_serviceControl = (1 << 8), | ||
263 | eSetup_UUIE_symmetricOperationRequired = (1 << 7), | ||
264 | eSetup_UUIE_capacity = (1 << 6), | ||
265 | eSetup_UUIE_circuitInfo = (1 << 5), | ||
266 | eSetup_UUIE_desiredProtocols = (1 << 4), | ||
267 | eSetup_UUIE_neededFeatures = (1 << 3), | ||
268 | eSetup_UUIE_desiredFeatures = (1 << 2), | ||
269 | eSetup_UUIE_supportedFeatures = (1 << 1), | ||
270 | eSetup_UUIE_parallelH245Control = (1 << 0), | ||
271 | } options; | ||
272 | TransportAddress h245Address; | ||
273 | TransportAddress destCallSignalAddress; | ||
274 | TransportAddress sourceCallSignalAddress; | ||
275 | Setup_UUIE_fastStart fastStart; | ||
276 | } Setup_UUIE; | ||
277 | |||
278 | typedef struct CallProceeding_UUIE_fastStart { /* SEQUENCE OF */ | ||
279 | int count; | ||
280 | OpenLogicalChannel item[30]; | ||
281 | } CallProceeding_UUIE_fastStart; | ||
282 | |||
283 | typedef struct CallProceeding_UUIE { /* SEQUENCE */ | ||
284 | enum { | ||
285 | eCallProceeding_UUIE_h245Address = (1 << 31), | ||
286 | eCallProceeding_UUIE_callIdentifier = (1 << 30), | ||
287 | eCallProceeding_UUIE_h245SecurityMode = (1 << 29), | ||
288 | eCallProceeding_UUIE_tokens = (1 << 28), | ||
289 | eCallProceeding_UUIE_cryptoTokens = (1 << 27), | ||
290 | eCallProceeding_UUIE_fastStart = (1 << 26), | ||
291 | eCallProceeding_UUIE_multipleCalls = (1 << 25), | ||
292 | eCallProceeding_UUIE_maintainConnection = (1 << 24), | ||
293 | eCallProceeding_UUIE_fastConnectRefused = (1 << 23), | ||
294 | eCallProceeding_UUIE_featureSet = (1 << 22), | ||
295 | } options; | ||
296 | TransportAddress h245Address; | ||
297 | CallProceeding_UUIE_fastStart fastStart; | ||
298 | } CallProceeding_UUIE; | ||
299 | |||
300 | typedef struct Connect_UUIE_fastStart { /* SEQUENCE OF */ | ||
301 | int count; | ||
302 | OpenLogicalChannel item[30]; | ||
303 | } Connect_UUIE_fastStart; | ||
304 | |||
305 | typedef struct Connect_UUIE { /* SEQUENCE */ | ||
306 | enum { | ||
307 | eConnect_UUIE_h245Address = (1 << 31), | ||
308 | eConnect_UUIE_callIdentifier = (1 << 30), | ||
309 | eConnect_UUIE_h245SecurityMode = (1 << 29), | ||
310 | eConnect_UUIE_tokens = (1 << 28), | ||
311 | eConnect_UUIE_cryptoTokens = (1 << 27), | ||
312 | eConnect_UUIE_fastStart = (1 << 26), | ||
313 | eConnect_UUIE_multipleCalls = (1 << 25), | ||
314 | eConnect_UUIE_maintainConnection = (1 << 24), | ||
315 | eConnect_UUIE_language = (1 << 23), | ||
316 | eConnect_UUIE_connectedAddress = (1 << 22), | ||
317 | eConnect_UUIE_presentationIndicator = (1 << 21), | ||
318 | eConnect_UUIE_screeningIndicator = (1 << 20), | ||
319 | eConnect_UUIE_fastConnectRefused = (1 << 19), | ||
320 | eConnect_UUIE_serviceControl = (1 << 18), | ||
321 | eConnect_UUIE_capacity = (1 << 17), | ||
322 | eConnect_UUIE_featureSet = (1 << 16), | ||
323 | } options; | ||
324 | TransportAddress h245Address; | ||
325 | Connect_UUIE_fastStart fastStart; | ||
326 | } Connect_UUIE; | ||
327 | |||
328 | typedef struct Alerting_UUIE_fastStart { /* SEQUENCE OF */ | ||
329 | int count; | ||
330 | OpenLogicalChannel item[30]; | ||
331 | } Alerting_UUIE_fastStart; | ||
332 | |||
333 | typedef struct Alerting_UUIE { /* SEQUENCE */ | ||
334 | enum { | ||
335 | eAlerting_UUIE_h245Address = (1 << 31), | ||
336 | eAlerting_UUIE_callIdentifier = (1 << 30), | ||
337 | eAlerting_UUIE_h245SecurityMode = (1 << 29), | ||
338 | eAlerting_UUIE_tokens = (1 << 28), | ||
339 | eAlerting_UUIE_cryptoTokens = (1 << 27), | ||
340 | eAlerting_UUIE_fastStart = (1 << 26), | ||
341 | eAlerting_UUIE_multipleCalls = (1 << 25), | ||
342 | eAlerting_UUIE_maintainConnection = (1 << 24), | ||
343 | eAlerting_UUIE_alertingAddress = (1 << 23), | ||
344 | eAlerting_UUIE_presentationIndicator = (1 << 22), | ||
345 | eAlerting_UUIE_screeningIndicator = (1 << 21), | ||
346 | eAlerting_UUIE_fastConnectRefused = (1 << 20), | ||
347 | eAlerting_UUIE_serviceControl = (1 << 19), | ||
348 | eAlerting_UUIE_capacity = (1 << 18), | ||
349 | eAlerting_UUIE_featureSet = (1 << 17), | ||
350 | } options; | ||
351 | TransportAddress h245Address; | ||
352 | Alerting_UUIE_fastStart fastStart; | ||
353 | } Alerting_UUIE; | ||
354 | |||
355 | typedef struct Information_UUIE_fastStart { /* SEQUENCE OF */ | ||
356 | int count; | ||
357 | OpenLogicalChannel item[30]; | ||
358 | } Information_UUIE_fastStart; | ||
359 | |||
360 | typedef struct Information_UUIE { /* SEQUENCE */ | ||
361 | enum { | ||
362 | eInformation_UUIE_callIdentifier = (1 << 31), | ||
363 | eInformation_UUIE_tokens = (1 << 30), | ||
364 | eInformation_UUIE_cryptoTokens = (1 << 29), | ||
365 | eInformation_UUIE_fastStart = (1 << 28), | ||
366 | eInformation_UUIE_fastConnectRefused = (1 << 27), | ||
367 | eInformation_UUIE_circuitInfo = (1 << 26), | ||
368 | } options; | ||
369 | Information_UUIE_fastStart fastStart; | ||
370 | } Information_UUIE; | ||
371 | |||
372 | typedef struct FacilityReason { /* CHOICE */ | ||
373 | enum { | ||
374 | eFacilityReason_routeCallToGatekeeper, | ||
375 | eFacilityReason_callForwarded, | ||
376 | eFacilityReason_routeCallToMC, | ||
377 | eFacilityReason_undefinedReason, | ||
378 | eFacilityReason_conferenceListChoice, | ||
379 | eFacilityReason_startH245, | ||
380 | eFacilityReason_noH245, | ||
381 | eFacilityReason_newTokens, | ||
382 | eFacilityReason_featureSetUpdate, | ||
383 | eFacilityReason_forwardedElements, | ||
384 | eFacilityReason_transportedInformation, | ||
385 | } choice; | ||
386 | } FacilityReason; | ||
387 | |||
388 | typedef struct Facility_UUIE_fastStart { /* SEQUENCE OF */ | ||
389 | int count; | ||
390 | OpenLogicalChannel item[30]; | ||
391 | } Facility_UUIE_fastStart; | ||
392 | |||
393 | typedef struct Facility_UUIE { /* SEQUENCE */ | ||
394 | enum { | ||
395 | eFacility_UUIE_alternativeAddress = (1 << 31), | ||
396 | eFacility_UUIE_alternativeAliasAddress = (1 << 30), | ||
397 | eFacility_UUIE_conferenceID = (1 << 29), | ||
398 | eFacility_UUIE_callIdentifier = (1 << 28), | ||
399 | eFacility_UUIE_destExtraCallInfo = (1 << 27), | ||
400 | eFacility_UUIE_remoteExtensionAddress = (1 << 26), | ||
401 | eFacility_UUIE_tokens = (1 << 25), | ||
402 | eFacility_UUIE_cryptoTokens = (1 << 24), | ||
403 | eFacility_UUIE_conferences = (1 << 23), | ||
404 | eFacility_UUIE_h245Address = (1 << 22), | ||
405 | eFacility_UUIE_fastStart = (1 << 21), | ||
406 | eFacility_UUIE_multipleCalls = (1 << 20), | ||
407 | eFacility_UUIE_maintainConnection = (1 << 19), | ||
408 | eFacility_UUIE_fastConnectRefused = (1 << 18), | ||
409 | eFacility_UUIE_serviceControl = (1 << 17), | ||
410 | eFacility_UUIE_circuitInfo = (1 << 16), | ||
411 | eFacility_UUIE_featureSet = (1 << 15), | ||
412 | eFacility_UUIE_destinationInfo = (1 << 14), | ||
413 | eFacility_UUIE_h245SecurityMode = (1 << 13), | ||
414 | } options; | ||
415 | FacilityReason reason; | ||
416 | TransportAddress h245Address; | ||
417 | Facility_UUIE_fastStart fastStart; | ||
418 | } Facility_UUIE; | ||
419 | |||
420 | typedef struct Progress_UUIE_fastStart { /* SEQUENCE OF */ | ||
421 | int count; | ||
422 | OpenLogicalChannel item[30]; | ||
423 | } Progress_UUIE_fastStart; | ||
424 | |||
425 | typedef struct Progress_UUIE { /* SEQUENCE */ | ||
426 | enum { | ||
427 | eProgress_UUIE_h245Address = (1 << 31), | ||
428 | eProgress_UUIE_h245SecurityMode = (1 << 30), | ||
429 | eProgress_UUIE_tokens = (1 << 29), | ||
430 | eProgress_UUIE_cryptoTokens = (1 << 28), | ||
431 | eProgress_UUIE_fastStart = (1 << 27), | ||
432 | eProgress_UUIE_multipleCalls = (1 << 26), | ||
433 | eProgress_UUIE_maintainConnection = (1 << 25), | ||
434 | eProgress_UUIE_fastConnectRefused = (1 << 24), | ||
435 | } options; | ||
436 | TransportAddress h245Address; | ||
437 | Progress_UUIE_fastStart fastStart; | ||
438 | } Progress_UUIE; | ||
439 | |||
440 | typedef struct H323_UU_PDU_h323_message_body { /* CHOICE */ | ||
441 | enum { | ||
442 | eH323_UU_PDU_h323_message_body_setup, | ||
443 | eH323_UU_PDU_h323_message_body_callProceeding, | ||
444 | eH323_UU_PDU_h323_message_body_connect, | ||
445 | eH323_UU_PDU_h323_message_body_alerting, | ||
446 | eH323_UU_PDU_h323_message_body_information, | ||
447 | eH323_UU_PDU_h323_message_body_releaseComplete, | ||
448 | eH323_UU_PDU_h323_message_body_facility, | ||
449 | eH323_UU_PDU_h323_message_body_progress, | ||
450 | eH323_UU_PDU_h323_message_body_empty, | ||
451 | eH323_UU_PDU_h323_message_body_status, | ||
452 | eH323_UU_PDU_h323_message_body_statusInquiry, | ||
453 | eH323_UU_PDU_h323_message_body_setupAcknowledge, | ||
454 | eH323_UU_PDU_h323_message_body_notify, | ||
455 | } choice; | ||
456 | union { | ||
457 | Setup_UUIE setup; | ||
458 | CallProceeding_UUIE callProceeding; | ||
459 | Connect_UUIE connect; | ||
460 | Alerting_UUIE alerting; | ||
461 | Information_UUIE information; | ||
462 | Facility_UUIE facility; | ||
463 | Progress_UUIE progress; | ||
464 | }; | ||
465 | } H323_UU_PDU_h323_message_body; | ||
466 | |||
467 | typedef struct RequestMessage { /* CHOICE */ | ||
468 | enum { | ||
469 | eRequestMessage_nonStandard, | ||
470 | eRequestMessage_masterSlaveDetermination, | ||
471 | eRequestMessage_terminalCapabilitySet, | ||
472 | eRequestMessage_openLogicalChannel, | ||
473 | eRequestMessage_closeLogicalChannel, | ||
474 | eRequestMessage_requestChannelClose, | ||
475 | eRequestMessage_multiplexEntrySend, | ||
476 | eRequestMessage_requestMultiplexEntry, | ||
477 | eRequestMessage_requestMode, | ||
478 | eRequestMessage_roundTripDelayRequest, | ||
479 | eRequestMessage_maintenanceLoopRequest, | ||
480 | eRequestMessage_communicationModeRequest, | ||
481 | eRequestMessage_conferenceRequest, | ||
482 | eRequestMessage_multilinkRequest, | ||
483 | eRequestMessage_logicalChannelRateRequest, | ||
484 | } choice; | ||
485 | union { | ||
486 | OpenLogicalChannel openLogicalChannel; | ||
487 | }; | ||
488 | } RequestMessage; | ||
489 | |||
490 | typedef struct OpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters { /* CHOICE */ | ||
491 | enum { | ||
492 | eOpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters_h222LogicalChannelParameters, | ||
493 | eOpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters_h2250LogicalChannelParameters, | ||
494 | } choice; | ||
495 | union { | ||
496 | H2250LogicalChannelParameters h2250LogicalChannelParameters; | ||
497 | }; | ||
498 | } OpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters; | ||
499 | |||
500 | typedef struct OpenLogicalChannelAck_reverseLogicalChannelParameters { /* SEQUENCE */ | ||
501 | enum { | ||
502 | eOpenLogicalChannelAck_reverseLogicalChannelParameters_portNumber | ||
503 | = (1 << 31), | ||
504 | eOpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters | ||
505 | = (1 << 30), | ||
506 | eOpenLogicalChannelAck_reverseLogicalChannelParameters_replacementFor | ||
507 | = (1 << 29), | ||
508 | } options; | ||
509 | OpenLogicalChannelAck_reverseLogicalChannelParameters_multiplexParameters | ||
510 | multiplexParameters; | ||
511 | } OpenLogicalChannelAck_reverseLogicalChannelParameters; | ||
512 | |||
513 | typedef struct H2250LogicalChannelAckParameters { /* SEQUENCE */ | ||
514 | enum { | ||
515 | eH2250LogicalChannelAckParameters_nonStandard = (1 << 31), | ||
516 | eH2250LogicalChannelAckParameters_sessionID = (1 << 30), | ||
517 | eH2250LogicalChannelAckParameters_mediaChannel = (1 << 29), | ||
518 | eH2250LogicalChannelAckParameters_mediaControlChannel = | ||
519 | (1 << 28), | ||
520 | eH2250LogicalChannelAckParameters_dynamicRTPPayloadType = | ||
521 | (1 << 27), | ||
522 | eH2250LogicalChannelAckParameters_flowControlToZero = | ||
523 | (1 << 26), | ||
524 | eH2250LogicalChannelAckParameters_portNumber = (1 << 25), | ||
525 | } options; | ||
526 | H245_TransportAddress mediaChannel; | ||
527 | H245_TransportAddress mediaControlChannel; | ||
528 | } H2250LogicalChannelAckParameters; | ||
529 | |||
530 | typedef struct OpenLogicalChannelAck_forwardMultiplexAckParameters { /* CHOICE */ | ||
531 | enum { | ||
532 | eOpenLogicalChannelAck_forwardMultiplexAckParameters_h2250LogicalChannelAckParameters, | ||
533 | } choice; | ||
534 | union { | ||
535 | H2250LogicalChannelAckParameters | ||
536 | h2250LogicalChannelAckParameters; | ||
537 | }; | ||
538 | } OpenLogicalChannelAck_forwardMultiplexAckParameters; | ||
539 | |||
540 | typedef struct OpenLogicalChannelAck { /* SEQUENCE */ | ||
541 | enum { | ||
542 | eOpenLogicalChannelAck_reverseLogicalChannelParameters = | ||
543 | (1 << 31), | ||
544 | eOpenLogicalChannelAck_separateStack = (1 << 30), | ||
545 | eOpenLogicalChannelAck_forwardMultiplexAckParameters = | ||
546 | (1 << 29), | ||
547 | eOpenLogicalChannelAck_encryptionSync = (1 << 28), | ||
548 | } options; | ||
549 | OpenLogicalChannelAck_reverseLogicalChannelParameters | ||
550 | reverseLogicalChannelParameters; | ||
551 | OpenLogicalChannelAck_forwardMultiplexAckParameters | ||
552 | forwardMultiplexAckParameters; | ||
553 | } OpenLogicalChannelAck; | ||
554 | |||
555 | typedef struct ResponseMessage { /* CHOICE */ | ||
556 | enum { | ||
557 | eResponseMessage_nonStandard, | ||
558 | eResponseMessage_masterSlaveDeterminationAck, | ||
559 | eResponseMessage_masterSlaveDeterminationReject, | ||
560 | eResponseMessage_terminalCapabilitySetAck, | ||
561 | eResponseMessage_terminalCapabilitySetReject, | ||
562 | eResponseMessage_openLogicalChannelAck, | ||
563 | eResponseMessage_openLogicalChannelReject, | ||
564 | eResponseMessage_closeLogicalChannelAck, | ||
565 | eResponseMessage_requestChannelCloseAck, | ||
566 | eResponseMessage_requestChannelCloseReject, | ||
567 | eResponseMessage_multiplexEntrySendAck, | ||
568 | eResponseMessage_multiplexEntrySendReject, | ||
569 | eResponseMessage_requestMultiplexEntryAck, | ||
570 | eResponseMessage_requestMultiplexEntryReject, | ||
571 | eResponseMessage_requestModeAck, | ||
572 | eResponseMessage_requestModeReject, | ||
573 | eResponseMessage_roundTripDelayResponse, | ||
574 | eResponseMessage_maintenanceLoopAck, | ||
575 | eResponseMessage_maintenanceLoopReject, | ||
576 | eResponseMessage_communicationModeResponse, | ||
577 | eResponseMessage_conferenceResponse, | ||
578 | eResponseMessage_multilinkResponse, | ||
579 | eResponseMessage_logicalChannelRateAcknowledge, | ||
580 | eResponseMessage_logicalChannelRateReject, | ||
581 | } choice; | ||
582 | union { | ||
583 | OpenLogicalChannelAck openLogicalChannelAck; | ||
584 | }; | ||
585 | } ResponseMessage; | ||
586 | |||
587 | typedef struct MultimediaSystemControlMessage { /* CHOICE */ | ||
588 | enum { | ||
589 | eMultimediaSystemControlMessage_request, | ||
590 | eMultimediaSystemControlMessage_response, | ||
591 | eMultimediaSystemControlMessage_command, | ||
592 | eMultimediaSystemControlMessage_indication, | ||
593 | } choice; | ||
594 | union { | ||
595 | RequestMessage request; | ||
596 | ResponseMessage response; | ||
597 | }; | ||
598 | } MultimediaSystemControlMessage; | ||
599 | |||
600 | typedef struct H323_UU_PDU_h245Control { /* SEQUENCE OF */ | ||
601 | int count; | ||
602 | MultimediaSystemControlMessage item[4]; | ||
603 | } H323_UU_PDU_h245Control; | ||
604 | |||
605 | typedef struct H323_UU_PDU { /* SEQUENCE */ | ||
606 | enum { | ||
607 | eH323_UU_PDU_nonStandardData = (1 << 31), | ||
608 | eH323_UU_PDU_h4501SupplementaryService = (1 << 30), | ||
609 | eH323_UU_PDU_h245Tunneling = (1 << 29), | ||
610 | eH323_UU_PDU_h245Control = (1 << 28), | ||
611 | eH323_UU_PDU_nonStandardControl = (1 << 27), | ||
612 | eH323_UU_PDU_callLinkage = (1 << 26), | ||
613 | eH323_UU_PDU_tunnelledSignallingMessage = (1 << 25), | ||
614 | eH323_UU_PDU_provisionalRespToH245Tunneling = (1 << 24), | ||
615 | eH323_UU_PDU_stimulusControl = (1 << 23), | ||
616 | eH323_UU_PDU_genericData = (1 << 22), | ||
617 | } options; | ||
618 | H323_UU_PDU_h323_message_body h323_message_body; | ||
619 | H323_UU_PDU_h245Control h245Control; | ||
620 | } H323_UU_PDU; | ||
621 | |||
622 | typedef struct H323_UserInformation { /* SEQUENCE */ | ||
623 | enum { | ||
624 | eH323_UserInformation_user_data = (1 << 31), | ||
625 | } options; | ||
626 | H323_UU_PDU h323_uu_pdu; | ||
627 | } H323_UserInformation; | ||
628 | |||
629 | typedef struct GatekeeperRequest { /* SEQUENCE */ | ||
630 | enum { | ||
631 | eGatekeeperRequest_nonStandardData = (1 << 31), | ||
632 | eGatekeeperRequest_gatekeeperIdentifier = (1 << 30), | ||
633 | eGatekeeperRequest_callServices = (1 << 29), | ||
634 | eGatekeeperRequest_endpointAlias = (1 << 28), | ||
635 | eGatekeeperRequest_alternateEndpoints = (1 << 27), | ||
636 | eGatekeeperRequest_tokens = (1 << 26), | ||
637 | eGatekeeperRequest_cryptoTokens = (1 << 25), | ||
638 | eGatekeeperRequest_authenticationCapability = (1 << 24), | ||
639 | eGatekeeperRequest_algorithmOIDs = (1 << 23), | ||
640 | eGatekeeperRequest_integrity = (1 << 22), | ||
641 | eGatekeeperRequest_integrityCheckValue = (1 << 21), | ||
642 | eGatekeeperRequest_supportsAltGK = (1 << 20), | ||
643 | eGatekeeperRequest_featureSet = (1 << 19), | ||
644 | eGatekeeperRequest_genericData = (1 << 18), | ||
645 | } options; | ||
646 | TransportAddress rasAddress; | ||
647 | } GatekeeperRequest; | ||
648 | |||
649 | typedef struct GatekeeperConfirm { /* SEQUENCE */ | ||
650 | enum { | ||
651 | eGatekeeperConfirm_nonStandardData = (1 << 31), | ||
652 | eGatekeeperConfirm_gatekeeperIdentifier = (1 << 30), | ||
653 | eGatekeeperConfirm_alternateGatekeeper = (1 << 29), | ||
654 | eGatekeeperConfirm_authenticationMode = (1 << 28), | ||
655 | eGatekeeperConfirm_tokens = (1 << 27), | ||
656 | eGatekeeperConfirm_cryptoTokens = (1 << 26), | ||
657 | eGatekeeperConfirm_algorithmOID = (1 << 25), | ||
658 | eGatekeeperConfirm_integrity = (1 << 24), | ||
659 | eGatekeeperConfirm_integrityCheckValue = (1 << 23), | ||
660 | eGatekeeperConfirm_featureSet = (1 << 22), | ||
661 | eGatekeeperConfirm_genericData = (1 << 21), | ||
662 | } options; | ||
663 | TransportAddress rasAddress; | ||
664 | } GatekeeperConfirm; | ||
665 | |||
666 | typedef struct RegistrationRequest_callSignalAddress { /* SEQUENCE OF */ | ||
667 | int count; | ||
668 | TransportAddress item[10]; | ||
669 | } RegistrationRequest_callSignalAddress; | ||
670 | |||
671 | typedef struct RegistrationRequest_rasAddress { /* SEQUENCE OF */ | ||
672 | int count; | ||
673 | TransportAddress item[10]; | ||
674 | } RegistrationRequest_rasAddress; | ||
675 | |||
676 | typedef struct RegistrationRequest { /* SEQUENCE */ | ||
677 | enum { | ||
678 | eRegistrationRequest_nonStandardData = (1 << 31), | ||
679 | eRegistrationRequest_terminalAlias = (1 << 30), | ||
680 | eRegistrationRequest_gatekeeperIdentifier = (1 << 29), | ||
681 | eRegistrationRequest_alternateEndpoints = (1 << 28), | ||
682 | eRegistrationRequest_timeToLive = (1 << 27), | ||
683 | eRegistrationRequest_tokens = (1 << 26), | ||
684 | eRegistrationRequest_cryptoTokens = (1 << 25), | ||
685 | eRegistrationRequest_integrityCheckValue = (1 << 24), | ||
686 | eRegistrationRequest_keepAlive = (1 << 23), | ||
687 | eRegistrationRequest_endpointIdentifier = (1 << 22), | ||
688 | eRegistrationRequest_willSupplyUUIEs = (1 << 21), | ||
689 | eRegistrationRequest_maintainConnection = (1 << 20), | ||
690 | eRegistrationRequest_alternateTransportAddresses = (1 << 19), | ||
691 | eRegistrationRequest_additiveRegistration = (1 << 18), | ||
692 | eRegistrationRequest_terminalAliasPattern = (1 << 17), | ||
693 | eRegistrationRequest_supportsAltGK = (1 << 16), | ||
694 | eRegistrationRequest_usageReportingCapability = (1 << 15), | ||
695 | eRegistrationRequest_multipleCalls = (1 << 14), | ||
696 | eRegistrationRequest_supportedH248Packages = (1 << 13), | ||
697 | eRegistrationRequest_callCreditCapability = (1 << 12), | ||
698 | eRegistrationRequest_capacityReportingCapability = (1 << 11), | ||
699 | eRegistrationRequest_capacity = (1 << 10), | ||
700 | eRegistrationRequest_featureSet = (1 << 9), | ||
701 | eRegistrationRequest_genericData = (1 << 8), | ||
702 | } options; | ||
703 | RegistrationRequest_callSignalAddress callSignalAddress; | ||
704 | RegistrationRequest_rasAddress rasAddress; | ||
705 | unsigned timeToLive; | ||
706 | } RegistrationRequest; | ||
707 | |||
708 | typedef struct RegistrationConfirm_callSignalAddress { /* SEQUENCE OF */ | ||
709 | int count; | ||
710 | TransportAddress item[10]; | ||
711 | } RegistrationConfirm_callSignalAddress; | ||
712 | |||
713 | typedef struct RegistrationConfirm { /* SEQUENCE */ | ||
714 | enum { | ||
715 | eRegistrationConfirm_nonStandardData = (1 << 31), | ||
716 | eRegistrationConfirm_terminalAlias = (1 << 30), | ||
717 | eRegistrationConfirm_gatekeeperIdentifier = (1 << 29), | ||
718 | eRegistrationConfirm_alternateGatekeeper = (1 << 28), | ||
719 | eRegistrationConfirm_timeToLive = (1 << 27), | ||
720 | eRegistrationConfirm_tokens = (1 << 26), | ||
721 | eRegistrationConfirm_cryptoTokens = (1 << 25), | ||
722 | eRegistrationConfirm_integrityCheckValue = (1 << 24), | ||
723 | eRegistrationConfirm_willRespondToIRR = (1 << 23), | ||
724 | eRegistrationConfirm_preGrantedARQ = (1 << 22), | ||
725 | eRegistrationConfirm_maintainConnection = (1 << 21), | ||
726 | eRegistrationConfirm_serviceControl = (1 << 20), | ||
727 | eRegistrationConfirm_supportsAdditiveRegistration = (1 << 19), | ||
728 | eRegistrationConfirm_terminalAliasPattern = (1 << 18), | ||
729 | eRegistrationConfirm_supportedPrefixes = (1 << 17), | ||
730 | eRegistrationConfirm_usageSpec = (1 << 16), | ||
731 | eRegistrationConfirm_featureServerAlias = (1 << 15), | ||
732 | eRegistrationConfirm_capacityReportingSpec = (1 << 14), | ||
733 | eRegistrationConfirm_featureSet = (1 << 13), | ||
734 | eRegistrationConfirm_genericData = (1 << 12), | ||
735 | } options; | ||
736 | RegistrationConfirm_callSignalAddress callSignalAddress; | ||
737 | unsigned timeToLive; | ||
738 | } RegistrationConfirm; | ||
739 | |||
740 | typedef struct UnregistrationRequest_callSignalAddress { /* SEQUENCE OF */ | ||
741 | int count; | ||
742 | TransportAddress item[10]; | ||
743 | } UnregistrationRequest_callSignalAddress; | ||
744 | |||
745 | typedef struct UnregistrationRequest { /* SEQUENCE */ | ||
746 | enum { | ||
747 | eUnregistrationRequest_endpointAlias = (1 << 31), | ||
748 | eUnregistrationRequest_nonStandardData = (1 << 30), | ||
749 | eUnregistrationRequest_endpointIdentifier = (1 << 29), | ||
750 | eUnregistrationRequest_alternateEndpoints = (1 << 28), | ||
751 | eUnregistrationRequest_gatekeeperIdentifier = (1 << 27), | ||
752 | eUnregistrationRequest_tokens = (1 << 26), | ||
753 | eUnregistrationRequest_cryptoTokens = (1 << 25), | ||
754 | eUnregistrationRequest_integrityCheckValue = (1 << 24), | ||
755 | eUnregistrationRequest_reason = (1 << 23), | ||
756 | eUnregistrationRequest_endpointAliasPattern = (1 << 22), | ||
757 | eUnregistrationRequest_supportedPrefixes = (1 << 21), | ||
758 | eUnregistrationRequest_alternateGatekeeper = (1 << 20), | ||
759 | eUnregistrationRequest_genericData = (1 << 19), | ||
760 | } options; | ||
761 | UnregistrationRequest_callSignalAddress callSignalAddress; | ||
762 | } UnregistrationRequest; | ||
763 | |||
764 | typedef struct AdmissionRequest { /* SEQUENCE */ | ||
765 | enum { | ||
766 | eAdmissionRequest_callModel = (1 << 31), | ||
767 | eAdmissionRequest_destinationInfo = (1 << 30), | ||
768 | eAdmissionRequest_destCallSignalAddress = (1 << 29), | ||
769 | eAdmissionRequest_destExtraCallInfo = (1 << 28), | ||
770 | eAdmissionRequest_srcCallSignalAddress = (1 << 27), | ||
771 | eAdmissionRequest_nonStandardData = (1 << 26), | ||
772 | eAdmissionRequest_callServices = (1 << 25), | ||
773 | eAdmissionRequest_canMapAlias = (1 << 24), | ||
774 | eAdmissionRequest_callIdentifier = (1 << 23), | ||
775 | eAdmissionRequest_srcAlternatives = (1 << 22), | ||
776 | eAdmissionRequest_destAlternatives = (1 << 21), | ||
777 | eAdmissionRequest_gatekeeperIdentifier = (1 << 20), | ||
778 | eAdmissionRequest_tokens = (1 << 19), | ||
779 | eAdmissionRequest_cryptoTokens = (1 << 18), | ||
780 | eAdmissionRequest_integrityCheckValue = (1 << 17), | ||
781 | eAdmissionRequest_transportQOS = (1 << 16), | ||
782 | eAdmissionRequest_willSupplyUUIEs = (1 << 15), | ||
783 | eAdmissionRequest_callLinkage = (1 << 14), | ||
784 | eAdmissionRequest_gatewayDataRate = (1 << 13), | ||
785 | eAdmissionRequest_capacity = (1 << 12), | ||
786 | eAdmissionRequest_circuitInfo = (1 << 11), | ||
787 | eAdmissionRequest_desiredProtocols = (1 << 10), | ||
788 | eAdmissionRequest_desiredTunnelledProtocol = (1 << 9), | ||
789 | eAdmissionRequest_featureSet = (1 << 8), | ||
790 | eAdmissionRequest_genericData = (1 << 7), | ||
791 | } options; | ||
792 | TransportAddress destCallSignalAddress; | ||
793 | TransportAddress srcCallSignalAddress; | ||
794 | } AdmissionRequest; | ||
795 | |||
796 | typedef struct AdmissionConfirm { /* SEQUENCE */ | ||
797 | enum { | ||
798 | eAdmissionConfirm_irrFrequency = (1 << 31), | ||
799 | eAdmissionConfirm_nonStandardData = (1 << 30), | ||
800 | eAdmissionConfirm_destinationInfo = (1 << 29), | ||
801 | eAdmissionConfirm_destExtraCallInfo = (1 << 28), | ||
802 | eAdmissionConfirm_destinationType = (1 << 27), | ||
803 | eAdmissionConfirm_remoteExtensionAddress = (1 << 26), | ||
804 | eAdmissionConfirm_alternateEndpoints = (1 << 25), | ||
805 | eAdmissionConfirm_tokens = (1 << 24), | ||
806 | eAdmissionConfirm_cryptoTokens = (1 << 23), | ||
807 | eAdmissionConfirm_integrityCheckValue = (1 << 22), | ||
808 | eAdmissionConfirm_transportQOS = (1 << 21), | ||
809 | eAdmissionConfirm_willRespondToIRR = (1 << 20), | ||
810 | eAdmissionConfirm_uuiesRequested = (1 << 19), | ||
811 | eAdmissionConfirm_language = (1 << 18), | ||
812 | eAdmissionConfirm_alternateTransportAddresses = (1 << 17), | ||
813 | eAdmissionConfirm_useSpecifiedTransport = (1 << 16), | ||
814 | eAdmissionConfirm_circuitInfo = (1 << 15), | ||
815 | eAdmissionConfirm_usageSpec = (1 << 14), | ||
816 | eAdmissionConfirm_supportedProtocols = (1 << 13), | ||
817 | eAdmissionConfirm_serviceControl = (1 << 12), | ||
818 | eAdmissionConfirm_multipleCalls = (1 << 11), | ||
819 | eAdmissionConfirm_featureSet = (1 << 10), | ||
820 | eAdmissionConfirm_genericData = (1 << 9), | ||
821 | } options; | ||
822 | TransportAddress destCallSignalAddress; | ||
823 | } AdmissionConfirm; | ||
824 | |||
825 | typedef struct LocationRequest { /* SEQUENCE */ | ||
826 | enum { | ||
827 | eLocationRequest_endpointIdentifier = (1 << 31), | ||
828 | eLocationRequest_nonStandardData = (1 << 30), | ||
829 | eLocationRequest_sourceInfo = (1 << 29), | ||
830 | eLocationRequest_canMapAlias = (1 << 28), | ||
831 | eLocationRequest_gatekeeperIdentifier = (1 << 27), | ||
832 | eLocationRequest_tokens = (1 << 26), | ||
833 | eLocationRequest_cryptoTokens = (1 << 25), | ||
834 | eLocationRequest_integrityCheckValue = (1 << 24), | ||
835 | eLocationRequest_desiredProtocols = (1 << 23), | ||
836 | eLocationRequest_desiredTunnelledProtocol = (1 << 22), | ||
837 | eLocationRequest_featureSet = (1 << 21), | ||
838 | eLocationRequest_genericData = (1 << 20), | ||
839 | eLocationRequest_hopCount = (1 << 19), | ||
840 | eLocationRequest_circuitInfo = (1 << 18), | ||
841 | } options; | ||
842 | TransportAddress replyAddress; | ||
843 | } LocationRequest; | ||
844 | |||
845 | typedef struct LocationConfirm { /* SEQUENCE */ | ||
846 | enum { | ||
847 | eLocationConfirm_nonStandardData = (1 << 31), | ||
848 | eLocationConfirm_destinationInfo = (1 << 30), | ||
849 | eLocationConfirm_destExtraCallInfo = (1 << 29), | ||
850 | eLocationConfirm_destinationType = (1 << 28), | ||
851 | eLocationConfirm_remoteExtensionAddress = (1 << 27), | ||
852 | eLocationConfirm_alternateEndpoints = (1 << 26), | ||
853 | eLocationConfirm_tokens = (1 << 25), | ||
854 | eLocationConfirm_cryptoTokens = (1 << 24), | ||
855 | eLocationConfirm_integrityCheckValue = (1 << 23), | ||
856 | eLocationConfirm_alternateTransportAddresses = (1 << 22), | ||
857 | eLocationConfirm_supportedProtocols = (1 << 21), | ||
858 | eLocationConfirm_multipleCalls = (1 << 20), | ||
859 | eLocationConfirm_featureSet = (1 << 19), | ||
860 | eLocationConfirm_genericData = (1 << 18), | ||
861 | eLocationConfirm_circuitInfo = (1 << 17), | ||
862 | eLocationConfirm_serviceControl = (1 << 16), | ||
863 | } options; | ||
864 | TransportAddress callSignalAddress; | ||
865 | TransportAddress rasAddress; | ||
866 | } LocationConfirm; | ||
867 | |||
868 | typedef struct InfoRequestResponse_callSignalAddress { /* SEQUENCE OF */ | ||
869 | int count; | ||
870 | TransportAddress item[10]; | ||
871 | } InfoRequestResponse_callSignalAddress; | ||
872 | |||
873 | typedef struct InfoRequestResponse { /* SEQUENCE */ | ||
874 | enum { | ||
875 | eInfoRequestResponse_nonStandardData = (1 << 31), | ||
876 | eInfoRequestResponse_endpointAlias = (1 << 30), | ||
877 | eInfoRequestResponse_perCallInfo = (1 << 29), | ||
878 | eInfoRequestResponse_tokens = (1 << 28), | ||
879 | eInfoRequestResponse_cryptoTokens = (1 << 27), | ||
880 | eInfoRequestResponse_integrityCheckValue = (1 << 26), | ||
881 | eInfoRequestResponse_needResponse = (1 << 25), | ||
882 | eInfoRequestResponse_capacity = (1 << 24), | ||
883 | eInfoRequestResponse_irrStatus = (1 << 23), | ||
884 | eInfoRequestResponse_unsolicited = (1 << 22), | ||
885 | eInfoRequestResponse_genericData = (1 << 21), | ||
886 | } options; | ||
887 | TransportAddress rasAddress; | ||
888 | InfoRequestResponse_callSignalAddress callSignalAddress; | ||
889 | } InfoRequestResponse; | ||
890 | |||
891 | typedef struct RasMessage { /* CHOICE */ | ||
892 | enum { | ||
893 | eRasMessage_gatekeeperRequest, | ||
894 | eRasMessage_gatekeeperConfirm, | ||
895 | eRasMessage_gatekeeperReject, | ||
896 | eRasMessage_registrationRequest, | ||
897 | eRasMessage_registrationConfirm, | ||
898 | eRasMessage_registrationReject, | ||
899 | eRasMessage_unregistrationRequest, | ||
900 | eRasMessage_unregistrationConfirm, | ||
901 | eRasMessage_unregistrationReject, | ||
902 | eRasMessage_admissionRequest, | ||
903 | eRasMessage_admissionConfirm, | ||
904 | eRasMessage_admissionReject, | ||
905 | eRasMessage_bandwidthRequest, | ||
906 | eRasMessage_bandwidthConfirm, | ||
907 | eRasMessage_bandwidthReject, | ||
908 | eRasMessage_disengageRequest, | ||
909 | eRasMessage_disengageConfirm, | ||
910 | eRasMessage_disengageReject, | ||
911 | eRasMessage_locationRequest, | ||
912 | eRasMessage_locationConfirm, | ||
913 | eRasMessage_locationReject, | ||
914 | eRasMessage_infoRequest, | ||
915 | eRasMessage_infoRequestResponse, | ||
916 | eRasMessage_nonStandardMessage, | ||
917 | eRasMessage_unknownMessageResponse, | ||
918 | eRasMessage_requestInProgress, | ||
919 | eRasMessage_resourcesAvailableIndicate, | ||
920 | eRasMessage_resourcesAvailableConfirm, | ||
921 | eRasMessage_infoRequestAck, | ||
922 | eRasMessage_infoRequestNak, | ||
923 | eRasMessage_serviceControlIndication, | ||
924 | eRasMessage_serviceControlResponse, | ||
925 | } choice; | ||
926 | union { | ||
927 | GatekeeperRequest gatekeeperRequest; | ||
928 | GatekeeperConfirm gatekeeperConfirm; | ||
929 | RegistrationRequest registrationRequest; | ||
930 | RegistrationConfirm registrationConfirm; | ||
931 | UnregistrationRequest unregistrationRequest; | ||
932 | AdmissionRequest admissionRequest; | ||
933 | AdmissionConfirm admissionConfirm; | ||
934 | LocationRequest locationRequest; | ||
935 | LocationConfirm locationConfirm; | ||
936 | InfoRequestResponse infoRequestResponse; | ||
937 | }; | ||
938 | } RasMessage; | ||
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index d5b8c0d6a1..c0dac16e19 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -316,5 +316,23 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb, | |||
316 | void *userdata); | 316 | void *userdata); |
317 | 317 | ||
318 | #define IPT_ALIGN(s) XT_ALIGN(s) | 318 | #define IPT_ALIGN(s) XT_ALIGN(s) |
319 | |||
320 | #ifdef CONFIG_COMPAT | ||
321 | #include <net/compat.h> | ||
322 | |||
323 | struct compat_ipt_entry | ||
324 | { | ||
325 | struct ipt_ip ip; | ||
326 | compat_uint_t nfcache; | ||
327 | u_int16_t target_offset; | ||
328 | u_int16_t next_offset; | ||
329 | compat_uint_t comefrom; | ||
330 | struct compat_xt_counters counters; | ||
331 | unsigned char elems[0]; | ||
332 | }; | ||
333 | |||
334 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) | ||
335 | |||
336 | #endif /* CONFIG_COMPAT */ | ||
319 | #endif /*__KERNEL__*/ | 337 | #endif /*__KERNEL__*/ |
320 | #endif /* _IPTABLES_H */ | 338 | #endif /* _IPTABLES_H */ |
diff --git a/include/linux/netfilter_ipv4/ipt_esp.h b/include/linux/netfilter_ipv4/ipt_esp.h index c782a83e53..78296e7eef 100644 --- a/include/linux/netfilter_ipv4/ipt_esp.h +++ b/include/linux/netfilter_ipv4/ipt_esp.h | |||
@@ -1,16 +1,10 @@ | |||
1 | #ifndef _IPT_ESP_H | 1 | #ifndef _IPT_ESP_H |
2 | #define _IPT_ESP_H | 2 | #define _IPT_ESP_H |
3 | 3 | ||
4 | struct ipt_esp | 4 | #include <linux/netfilter/xt_esp.h> |
5 | { | ||
6 | u_int32_t spis[2]; /* Security Parameter Index */ | ||
7 | u_int8_t invflags; /* Inverse flags */ | ||
8 | }; | ||
9 | 5 | ||
10 | 6 | #define ipt_esp xt_esp | |
11 | 7 | #define IPT_ESP_INV_SPI XT_ESP_INV_SPI | |
12 | /* Values for "invflags" field in struct ipt_esp. */ | 8 | #define IPT_ESP_INV_MASK XT_ESP_INV_MASK |
13 | #define IPT_ESP_INV_SPI 0x01 /* Invert the sense of spi. */ | ||
14 | #define IPT_ESP_INV_MASK 0x01 /* All possible flags. */ | ||
15 | 9 | ||
16 | #endif /*_IPT_ESP_H*/ | 10 | #endif /*_IPT_ESP_H*/ |
diff --git a/include/linux/netfilter_ipv4/ipt_multiport.h b/include/linux/netfilter_ipv4/ipt_multiport.h index e6b6fff811..55fe85eca8 100644 --- a/include/linux/netfilter_ipv4/ipt_multiport.h +++ b/include/linux/netfilter_ipv4/ipt_multiport.h | |||
@@ -1,30 +1,15 @@ | |||
1 | #ifndef _IPT_MULTIPORT_H | 1 | #ifndef _IPT_MULTIPORT_H |
2 | #define _IPT_MULTIPORT_H | 2 | #define _IPT_MULTIPORT_H |
3 | #include <linux/netfilter_ipv4/ip_tables.h> | ||
4 | 3 | ||
5 | enum ipt_multiport_flags | 4 | #include <linux/netfilter/xt_multiport.h> |
6 | { | ||
7 | IPT_MULTIPORT_SOURCE, | ||
8 | IPT_MULTIPORT_DESTINATION, | ||
9 | IPT_MULTIPORT_EITHER | ||
10 | }; | ||
11 | 5 | ||
12 | #define IPT_MULTI_PORTS 15 | 6 | #define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE |
7 | #define IPT_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION | ||
8 | #define IPT_MULTIPORT_EITHER XT_MULTIPORT_EITHER | ||
13 | 9 | ||
14 | /* Must fit inside union ipt_matchinfo: 16 bytes */ | 10 | #define IPT_MULTI_PORTS XT_MULTI_PORTS |
15 | struct ipt_multiport | 11 | |
16 | { | 12 | #define ipt_multiport xt_multiport |
17 | u_int8_t flags; /* Type of comparison */ | 13 | #define ipt_multiport_v1 xt_multiport_v1 |
18 | u_int8_t count; /* Number of ports */ | ||
19 | u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */ | ||
20 | }; | ||
21 | 14 | ||
22 | struct ipt_multiport_v1 | ||
23 | { | ||
24 | u_int8_t flags; /* Type of comparison */ | ||
25 | u_int8_t count; /* Number of ports */ | ||
26 | u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */ | ||
27 | u_int8_t pflags[IPT_MULTI_PORTS]; /* Port flags */ | ||
28 | u_int8_t invert; /* Invert flag */ | ||
29 | }; | ||
30 | #endif /*_IPT_MULTIPORT_H*/ | 15 | #endif /*_IPT_MULTIPORT_H*/ |
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 14f2bd0108..52a7b9e764 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
@@ -73,6 +73,9 @@ enum nf_ip6_hook_priorities { | |||
73 | }; | 73 | }; |
74 | 74 | ||
75 | #ifdef CONFIG_NETFILTER | 75 | #ifdef CONFIG_NETFILTER |
76 | extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, | ||
77 | unsigned int dataoff, u_int8_t protocol); | ||
78 | |||
76 | extern int ipv6_netfilter_init(void); | 79 | extern int ipv6_netfilter_init(void); |
77 | extern void ipv6_netfilter_fini(void); | 80 | extern void ipv6_netfilter_fini(void); |
78 | #else /* CONFIG_NETFILTER */ | 81 | #else /* CONFIG_NETFILTER */ |
diff --git a/include/linux/netfilter_ipv6/ip6t_esp.h b/include/linux/netfilter_ipv6/ip6t_esp.h index a91b6abc80..f62eaf53c1 100644 --- a/include/linux/netfilter_ipv6/ip6t_esp.h +++ b/include/linux/netfilter_ipv6/ip6t_esp.h | |||
@@ -1,14 +1,10 @@ | |||
1 | #ifndef _IP6T_ESP_H | 1 | #ifndef _IP6T_ESP_H |
2 | #define _IP6T_ESP_H | 2 | #define _IP6T_ESP_H |
3 | 3 | ||
4 | struct ip6t_esp | 4 | #include <linux/netfilter/xt_esp.h> |
5 | { | ||
6 | u_int32_t spis[2]; /* Security Parameter Index */ | ||
7 | u_int8_t invflags; /* Inverse flags */ | ||
8 | }; | ||
9 | 5 | ||
10 | /* Values for "invflags" field in struct ip6t_esp. */ | 6 | #define ip6t_esp xt_esp |
11 | #define IP6T_ESP_INV_SPI 0x01 /* Invert the sense of spi. */ | 7 | #define IP6T_ESP_INV_SPI XT_ESP_INV_SPI |
12 | #define IP6T_ESP_INV_MASK 0x01 /* All possible flags. */ | 8 | #define IP6T_ESP_INV_MASK XT_ESP_INV_MASK |
13 | 9 | ||
14 | #endif /*_IP6T_ESP_H*/ | 10 | #endif /*_IP6T_ESP_H*/ |
diff --git a/include/linux/netfilter_ipv6/ip6t_multiport.h b/include/linux/netfilter_ipv6/ip6t_multiport.h index efe4954a86..042c92661c 100644 --- a/include/linux/netfilter_ipv6/ip6t_multiport.h +++ b/include/linux/netfilter_ipv6/ip6t_multiport.h | |||
@@ -1,21 +1,14 @@ | |||
1 | #ifndef _IP6T_MULTIPORT_H | 1 | #ifndef _IP6T_MULTIPORT_H |
2 | #define _IP6T_MULTIPORT_H | 2 | #define _IP6T_MULTIPORT_H |
3 | #include <linux/netfilter_ipv6/ip6_tables.h> | ||
4 | 3 | ||
5 | enum ip6t_multiport_flags | 4 | #include <linux/netfilter/xt_multiport.h> |
6 | { | ||
7 | IP6T_MULTIPORT_SOURCE, | ||
8 | IP6T_MULTIPORT_DESTINATION, | ||
9 | IP6T_MULTIPORT_EITHER | ||
10 | }; | ||
11 | 5 | ||
12 | #define IP6T_MULTI_PORTS 15 | 6 | #define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE |
7 | #define IP6T_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION | ||
8 | #define IP6T_MULTIPORT_EITHER XT_MULTIPORT_EITHER | ||
13 | 9 | ||
14 | /* Must fit inside union ip6t_matchinfo: 16 bytes */ | 10 | #define IP6T_MULTI_PORTS XT_MULTI_PORTS |
15 | struct ip6t_multiport | 11 | |
16 | { | 12 | #define ip6t_multiport xt_multiport |
17 | u_int8_t flags; /* Type of comparison */ | 13 | |
18 | u_int8_t count; /* Number of ports */ | 14 | #endif /*_IP6T_MULTIPORT_H*/ |
19 | u_int16_t ports[IP6T_MULTI_PORTS]; /* Ports */ | ||
20 | }; | ||
21 | #endif /*_IPT_MULTIPORT_H*/ | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index f8f3d1c927..87b8a5703e 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -143,6 +143,7 @@ struct netlink_skb_parms | |||
143 | __u32 dst_group; | 143 | __u32 dst_group; |
144 | kernel_cap_t eff_cap; | 144 | kernel_cap_t eff_cap; |
145 | __u32 loginuid; /* Login (audit) uid */ | 145 | __u32 loginuid; /* Login (audit) uid */ |
146 | __u32 sid; /* SELinux security id */ | ||
146 | }; | 147 | }; |
147 | 148 | ||
148 | #define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) | 149 | #define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) |
diff --git a/include/linux/numa.h b/include/linux/numa.h index f0c539bd3c..e481feb1bf 100644 --- a/include/linux/numa.h +++ b/include/linux/numa.h | |||
@@ -3,11 +3,9 @@ | |||
3 | 3 | ||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | 5 | ||
6 | #ifndef CONFIG_FLATMEM | 6 | #ifdef CONFIG_NODES_SHIFT |
7 | #include <asm/numnodes.h> | 7 | #define NODES_SHIFT CONFIG_NODES_SHIFT |
8 | #endif | 8 | #else |
9 | |||
10 | #ifndef NODES_SHIFT | ||
11 | #define NODES_SHIFT 0 | 9 | #define NODES_SHIFT 0 |
12 | #endif | 10 | #endif |
13 | 11 | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 9ea629c02a..d276a4e2f8 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -48,8 +48,20 @@ | |||
48 | 48 | ||
49 | /* | 49 | /* |
50 | * Don't use the *_dontuse flags. Use the macros. Otherwise you'll break | 50 | * Don't use the *_dontuse flags. Use the macros. Otherwise you'll break |
51 | * locked- and dirty-page accounting. The top eight bits of page->flags are | 51 | * locked- and dirty-page accounting. |
52 | * used for page->zone, so putting flag bits there doesn't work. | 52 | * |
53 | * The page flags field is split into two parts, the main flags area | ||
54 | * which extends from the low bits upwards, and the fields area which | ||
55 | * extends from the high bits downwards. | ||
56 | * | ||
57 | * | FIELD | ... | FLAGS | | ||
58 | * N-1 ^ 0 | ||
59 | * (N-FLAGS_RESERVED) | ||
60 | * | ||
61 | * The fields area is reserved for fields mapping zone, node and SPARSEMEM | ||
62 | * section. The boundry between these two areas is defined by | ||
63 | * FLAGS_RESERVED which defines the width of the fields section | ||
64 | * (see linux/mmzone.h). New flags must _not_ overlap with this area. | ||
53 | */ | 65 | */ |
54 | #define PG_locked 0 /* Page is locked. Don't touch. */ | 66 | #define PG_locked 0 /* Page is locked. Don't touch. */ |
55 | #define PG_error 1 | 67 | #define PG_error 1 |
@@ -74,7 +86,9 @@ | |||
74 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ | 86 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ |
75 | #define PG_reclaim 17 /* To be reclaimed asap */ | 87 | #define PG_reclaim 17 /* To be reclaimed asap */ |
76 | #define PG_nosave_free 18 /* Free, should not be written */ | 88 | #define PG_nosave_free 18 /* Free, should not be written */ |
77 | #define PG_uncached 19 /* Page has been mapped as uncached */ | 89 | #define PG_buddy 19 /* Page is free, on buddy lists */ |
90 | |||
91 | #define PG_uncached 20 /* Page has been mapped as uncached */ | ||
78 | 92 | ||
79 | /* | 93 | /* |
80 | * Global page accounting. One instance per CPU. Only unsigned longs are | 94 | * Global page accounting. One instance per CPU. Only unsigned longs are |
@@ -317,6 +331,10 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
317 | #define SetPageNosaveFree(page) set_bit(PG_nosave_free, &(page)->flags) | 331 | #define SetPageNosaveFree(page) set_bit(PG_nosave_free, &(page)->flags) |
318 | #define ClearPageNosaveFree(page) clear_bit(PG_nosave_free, &(page)->flags) | 332 | #define ClearPageNosaveFree(page) clear_bit(PG_nosave_free, &(page)->flags) |
319 | 333 | ||
334 | #define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) | ||
335 | #define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) | ||
336 | #define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags) | ||
337 | |||
320 | #define PageMappedToDisk(page) test_bit(PG_mappedtodisk, &(page)->flags) | 338 | #define PageMappedToDisk(page) test_bit(PG_mappedtodisk, &(page)->flags) |
321 | #define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags) | 339 | #define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags) |
322 | #define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags) | 340 | #define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags) |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 9539efd4f7..7a1af574de 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -78,6 +78,8 @@ extern struct page * find_or_create_page(struct address_space *mapping, | |||
78 | unsigned long index, gfp_t gfp_mask); | 78 | unsigned long index, gfp_t gfp_mask); |
79 | unsigned find_get_pages(struct address_space *mapping, pgoff_t start, | 79 | unsigned find_get_pages(struct address_space *mapping, pgoff_t start, |
80 | unsigned int nr_pages, struct page **pages); | 80 | unsigned int nr_pages, struct page **pages); |
81 | unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, | ||
82 | unsigned int nr_pages, struct page **pages); | ||
81 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, | 83 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, |
82 | int tag, unsigned int nr_pages, struct page **pages); | 84 | int tag, unsigned int nr_pages, struct page **pages); |
83 | 85 | ||
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 4877e35ae2..936ef82ed7 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -50,7 +50,7 @@ | |||
50 | extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags); | 50 | extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags); |
51 | extern acpi_status pci_osc_support_set(u32 flags); | 51 | extern acpi_status pci_osc_support_set(u32 flags); |
52 | #else | 52 | #else |
53 | #if !defined(acpi_status) | 53 | #if !defined(AE_ERROR) |
54 | typedef u32 acpi_status; | 54 | typedef u32 acpi_status; |
55 | #define AE_ERROR (acpi_status) (0x0001) | 55 | #define AE_ERROR (acpi_status) (0x0001) |
56 | #endif | 56 | #endif |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 0aad5a378e..3a6a4e37a4 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -97,7 +97,13 @@ enum pci_channel_state { | |||
97 | 97 | ||
98 | typedef unsigned short __bitwise pci_bus_flags_t; | 98 | typedef unsigned short __bitwise pci_bus_flags_t; |
99 | enum pci_bus_flags { | 99 | enum pci_bus_flags { |
100 | PCI_BUS_FLAGS_NO_MSI = (pci_bus_flags_t) 1, | 100 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, |
101 | }; | ||
102 | |||
103 | struct pci_cap_saved_state { | ||
104 | struct hlist_node next; | ||
105 | char cap_nr; | ||
106 | u32 data[0]; | ||
101 | }; | 107 | }; |
102 | 108 | ||
103 | /* | 109 | /* |
@@ -159,6 +165,7 @@ struct pci_dev { | |||
159 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | 165 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ |
160 | 166 | ||
161 | u32 saved_config_space[16]; /* config space saved at suspend time */ | 167 | u32 saved_config_space[16]; /* config space saved at suspend time */ |
168 | struct hlist_head saved_cap_space; | ||
162 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ | 169 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ |
163 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ | 170 | int rom_attr_enabled; /* has display of the rom attribute been enabled? */ |
164 | struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ | 171 | struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ |
@@ -169,6 +176,30 @@ struct pci_dev { | |||
169 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 176 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
170 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 177 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
171 | 178 | ||
179 | static inline struct pci_cap_saved_state *pci_find_saved_cap( | ||
180 | struct pci_dev *pci_dev,char cap) | ||
181 | { | ||
182 | struct pci_cap_saved_state *tmp; | ||
183 | struct hlist_node *pos; | ||
184 | |||
185 | hlist_for_each_entry(tmp, pos, &pci_dev->saved_cap_space, next) { | ||
186 | if (tmp->cap_nr == cap) | ||
187 | return tmp; | ||
188 | } | ||
189 | return NULL; | ||
190 | } | ||
191 | |||
192 | static inline void pci_add_saved_cap(struct pci_dev *pci_dev, | ||
193 | struct pci_cap_saved_state *new_cap) | ||
194 | { | ||
195 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); | ||
196 | } | ||
197 | |||
198 | static inline void pci_remove_saved_cap(struct pci_cap_saved_state *cap) | ||
199 | { | ||
200 | hlist_del(&cap->next); | ||
201 | } | ||
202 | |||
172 | /* | 203 | /* |
173 | * For PCI devices, the region numbers are assigned this way: | 204 | * For PCI devices, the region numbers are assigned this way: |
174 | * | 205 | * |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 870fe38378..590dc6dca3 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -356,6 +356,10 @@ | |||
356 | #define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e | 356 | #define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e |
357 | #define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 | 357 | #define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 |
358 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 | 358 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 |
359 | #define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a | ||
360 | #define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380 | ||
361 | #define PCI_DEVICE_ID_ATI_IXP600_SRAID 0x4381 | ||
362 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c | ||
359 | 363 | ||
360 | #define PCI_VENDOR_ID_VLSI 0x1004 | 364 | #define PCI_VENDOR_ID_VLSI 0x1004 |
361 | #define PCI_DEVICE_ID_VLSI_82C592 0x0005 | 365 | #define PCI_DEVICE_ID_VLSI_82C592 0x0005 |
@@ -497,7 +501,8 @@ | |||
497 | #define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b | 501 | #define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b |
498 | #define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d | 502 | #define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d |
499 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 | 503 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 |
500 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 | 504 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
505 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | ||
501 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 506 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
502 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 507 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
503 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 | 508 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 |
@@ -1226,6 +1231,7 @@ | |||
1226 | #define PCI_DEVICE_ID_VIA_8380_0 0x0204 | 1231 | #define PCI_DEVICE_ID_VIA_8380_0 0x0204 |
1227 | #define PCI_DEVICE_ID_VIA_3238_0 0x0238 | 1232 | #define PCI_DEVICE_ID_VIA_3238_0 0x0238 |
1228 | #define PCI_DEVICE_ID_VIA_PT880 0x0258 | 1233 | #define PCI_DEVICE_ID_VIA_PT880 0x0258 |
1234 | #define PCI_DEVICE_ID_VIA_PT880ULTRA 0x0308 | ||
1229 | #define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 | 1235 | #define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259 |
1230 | #define PCI_DEVICE_ID_VIA_3269_0 0x0269 | 1236 | #define PCI_DEVICE_ID_VIA_3269_0 0x0269 |
1231 | #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 | 1237 | #define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 |
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 75c7f55023..ea4f7cd7bf 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -5,19 +5,37 @@ | |||
5 | 5 | ||
6 | #define PIPE_BUFFERS (16) | 6 | #define PIPE_BUFFERS (16) |
7 | 7 | ||
8 | #define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */ | ||
9 | #define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ | ||
10 | #define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */ | ||
11 | |||
8 | struct pipe_buffer { | 12 | struct pipe_buffer { |
9 | struct page *page; | 13 | struct page *page; |
10 | unsigned int offset, len; | 14 | unsigned int offset, len; |
11 | struct pipe_buf_operations *ops; | 15 | struct pipe_buf_operations *ops; |
12 | unsigned int stolen; | 16 | unsigned int flags; |
13 | }; | 17 | }; |
14 | 18 | ||
19 | /* | ||
20 | * Note on the nesting of these functions: | ||
21 | * | ||
22 | * ->pin() | ||
23 | * ->steal() | ||
24 | * ... | ||
25 | * ->map() | ||
26 | * ... | ||
27 | * ->unmap() | ||
28 | * | ||
29 | * That is, ->map() must be called on a pinned buffer, same goes for ->steal(). | ||
30 | */ | ||
15 | struct pipe_buf_operations { | 31 | struct pipe_buf_operations { |
16 | int can_merge; | 32 | int can_merge; |
17 | void * (*map)(struct file *, struct pipe_inode_info *, struct pipe_buffer *); | 33 | void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); |
18 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); | 34 | void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *); |
35 | int (*pin)(struct pipe_inode_info *, struct pipe_buffer *); | ||
19 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); | 36 | void (*release)(struct pipe_inode_info *, struct pipe_buffer *); |
20 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); | 37 | int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); |
38 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); | ||
21 | }; | 39 | }; |
22 | 40 | ||
23 | struct pipe_inode_info { | 41 | struct pipe_inode_info { |
@@ -33,32 +51,53 @@ struct pipe_inode_info { | |||
33 | unsigned int w_counter; | 51 | unsigned int w_counter; |
34 | struct fasync_struct *fasync_readers; | 52 | struct fasync_struct *fasync_readers; |
35 | struct fasync_struct *fasync_writers; | 53 | struct fasync_struct *fasync_writers; |
54 | struct inode *inode; | ||
36 | }; | 55 | }; |
37 | 56 | ||
38 | /* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual | 57 | /* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual |
39 | memory allocation, whereas PIPE_BUF makes atomicity guarantees. */ | 58 | memory allocation, whereas PIPE_BUF makes atomicity guarantees. */ |
40 | #define PIPE_SIZE PAGE_SIZE | 59 | #define PIPE_SIZE PAGE_SIZE |
41 | 60 | ||
42 | #define PIPE_MUTEX(inode) (&(inode).i_mutex) | ||
43 | #define PIPE_WAIT(inode) (&(inode).i_pipe->wait) | ||
44 | #define PIPE_READERS(inode) ((inode).i_pipe->readers) | ||
45 | #define PIPE_WRITERS(inode) ((inode).i_pipe->writers) | ||
46 | #define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers) | ||
47 | #define PIPE_RCOUNTER(inode) ((inode).i_pipe->r_counter) | ||
48 | #define PIPE_WCOUNTER(inode) ((inode).i_pipe->w_counter) | ||
49 | #define PIPE_FASYNC_READERS(inode) (&((inode).i_pipe->fasync_readers)) | ||
50 | #define PIPE_FASYNC_WRITERS(inode) (&((inode).i_pipe->fasync_writers)) | ||
51 | |||
52 | /* Drop the inode semaphore and wait for a pipe event, atomically */ | 61 | /* Drop the inode semaphore and wait for a pipe event, atomically */ |
53 | void pipe_wait(struct inode * inode); | 62 | void pipe_wait(struct pipe_inode_info *pipe); |
63 | |||
64 | struct pipe_inode_info * alloc_pipe_info(struct inode * inode); | ||
65 | void free_pipe_info(struct inode * inode); | ||
66 | void __free_pipe_info(struct pipe_inode_info *); | ||
54 | 67 | ||
55 | struct inode* pipe_new(struct inode* inode); | 68 | /* Generic pipe buffer ops functions */ |
56 | void free_pipe_info(struct inode* inode); | 69 | void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int); |
70 | void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *); | ||
71 | void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); | ||
72 | int generic_pipe_buf_pin(struct pipe_inode_info *, struct pipe_buffer *); | ||
73 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); | ||
57 | 74 | ||
58 | /* | 75 | /* |
59 | * splice is tied to pipes as a transport (at least for now), so we'll just | 76 | * splice is tied to pipes as a transport (at least for now), so we'll just |
60 | * add the splice flags here. | 77 | * add the splice flags here. |
61 | */ | 78 | */ |
62 | #define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ | 79 | #define SPLICE_F_MOVE (0x01) /* move pages instead of copying */ |
80 | #define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ | ||
81 | /* we may still block on the fd we splice */ | ||
82 | /* from/to, of course */ | ||
83 | #define SPLICE_F_MORE (0x04) /* expect more data */ | ||
84 | #define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */ | ||
85 | |||
86 | /* | ||
87 | * Passed to the actors | ||
88 | */ | ||
89 | struct splice_desc { | ||
90 | unsigned int len, total_len; /* current and remaining length */ | ||
91 | unsigned int flags; /* splice flags */ | ||
92 | struct file *file; /* file to read/write */ | ||
93 | loff_t pos; /* file position */ | ||
94 | }; | ||
95 | |||
96 | typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, | ||
97 | struct splice_desc *); | ||
98 | |||
99 | extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *, | ||
100 | loff_t *, size_t, unsigned int, | ||
101 | splice_actor *); | ||
63 | 102 | ||
64 | #endif | 103 | #endif |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 6df2585c01..66be58902b 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -199,6 +199,12 @@ extern int device_suspend(pm_message_t state); | |||
199 | 199 | ||
200 | extern int dpm_runtime_suspend(struct device *, pm_message_t); | 200 | extern int dpm_runtime_suspend(struct device *, pm_message_t); |
201 | extern void dpm_runtime_resume(struct device *); | 201 | extern void dpm_runtime_resume(struct device *); |
202 | extern void __suspend_report_result(const char *function, void *fn, int ret); | ||
203 | |||
204 | #define suspend_report_result(fn, ret) \ | ||
205 | do { \ | ||
206 | __suspend_report_result(__FUNCTION__, fn, ret); \ | ||
207 | } while (0) | ||
202 | 208 | ||
203 | #else /* !CONFIG_PM */ | 209 | #else /* !CONFIG_PM */ |
204 | 210 | ||
@@ -219,6 +225,8 @@ static inline void dpm_runtime_resume(struct device * dev) | |||
219 | { | 225 | { |
220 | } | 226 | } |
221 | 227 | ||
228 | #define suspend_report_result(fn, ret) do { } while (0) | ||
229 | |||
222 | #endif | 230 | #endif |
223 | 231 | ||
224 | /* changes to device_may_wakeup take effect on the next pm state change. | 232 | /* changes to device_may_wakeup take effect on the next pm state change. |
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h index 1252b45fac..008932d73c 100644 --- a/include/linux/pm_legacy.h +++ b/include/linux/pm_legacy.h | |||
@@ -16,11 +16,6 @@ struct pm_dev __deprecated * | |||
16 | pm_register(pm_dev_t type, unsigned long id, pm_callback callback); | 16 | pm_register(pm_dev_t type, unsigned long id, pm_callback callback); |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Unregister a device with power management | ||
20 | */ | ||
21 | void __deprecated pm_unregister(struct pm_dev *dev); | ||
22 | |||
23 | /* | ||
24 | * Unregister all devices with matching callback | 19 | * Unregister all devices with matching callback |
25 | */ | 20 | */ |
26 | void __deprecated pm_unregister_all(pm_callback callback); | 21 | void __deprecated pm_unregister_all(pm_callback callback); |
@@ -41,8 +36,6 @@ static inline struct pm_dev *pm_register(pm_dev_t type, | |||
41 | return NULL; | 36 | return NULL; |
42 | } | 37 | } |
43 | 38 | ||
44 | static inline void pm_unregister(struct pm_dev *dev) {} | ||
45 | |||
46 | static inline void pm_unregister_all(pm_callback callback) {} | 39 | static inline void pm_unregister_all(pm_callback callback) {} |
47 | 40 | ||
48 | static inline int pm_send_all(pm_request_t rqst, void *data) | 41 | static inline int pm_send_all(pm_request_t rqst, void *data) |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 135871df99..4b47a02534 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -79,7 +79,7 @@ struct kcore_list { | |||
79 | struct vmcore { | 79 | struct vmcore { |
80 | struct list_head list; | 80 | struct list_head list; |
81 | unsigned long long paddr; | 81 | unsigned long long paddr; |
82 | unsigned long size; | 82 | unsigned long long size; |
83 | loff_t offset; | 83 | loff_t offset; |
84 | }; | 84 | }; |
85 | 85 | ||
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 774e1acfb8..f1fbae7e39 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -227,8 +227,8 @@ struct mdp_superblock_1 { | |||
227 | */ | 227 | */ |
228 | 228 | ||
229 | /* These are only valid with feature bit '4' */ | 229 | /* These are only valid with feature bit '4' */ |
230 | __u64 reshape_position; /* next address in array-space for reshape */ | ||
231 | __u32 new_level; /* new level we are reshaping to */ | 230 | __u32 new_level; /* new level we are reshaping to */ |
231 | __u64 reshape_position; /* next address in array-space for reshape */ | ||
232 | __u32 delta_disks; /* change in number of raid_disks */ | 232 | __u32 delta_disks; /* change in number of raid_disks */ |
233 | __u32 new_layout; /* new layout */ | 233 | __u32 new_layout; /* new layout */ |
234 | __u32 new_chunk; /* new chunk size (bytes) */ | 234 | __u32 new_chunk; /* new chunk size (bytes) */ |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 5673008b61..970284f571 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -132,6 +132,7 @@ static inline void rcu_bh_qsctr_inc(int cpu) | |||
132 | } | 132 | } |
133 | 133 | ||
134 | extern int rcu_pending(int cpu); | 134 | extern int rcu_pending(int cpu); |
135 | extern int rcu_needs_cpu(int cpu); | ||
135 | 136 | ||
136 | /** | 137 | /** |
137 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. | 138 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 541f4828f5..29b7d4f87d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -684,6 +684,7 @@ static inline void prefetch_stack(struct task_struct *t) { } | |||
684 | 684 | ||
685 | struct audit_context; /* See audit.c */ | 685 | struct audit_context; /* See audit.c */ |
686 | struct mempolicy; | 686 | struct mempolicy; |
687 | struct pipe_inode_info; | ||
687 | 688 | ||
688 | enum sleep_type { | 689 | enum sleep_type { |
689 | SLEEP_NORMAL, | 690 | SLEEP_NORMAL, |
@@ -882,6 +883,11 @@ struct task_struct { | |||
882 | 883 | ||
883 | atomic_t fs_excl; /* holding fs exclusive resources */ | 884 | atomic_t fs_excl; /* holding fs exclusive resources */ |
884 | struct rcu_head rcu; | 885 | struct rcu_head rcu; |
886 | |||
887 | /* | ||
888 | * cache last used pipe for splice | ||
889 | */ | ||
890 | struct pipe_inode_info *splice_pipe; | ||
885 | }; | 891 | }; |
886 | 892 | ||
887 | static inline pid_t process_group(struct task_struct *tsk) | 893 | static inline pid_t process_group(struct task_struct *tsk) |
@@ -905,7 +911,6 @@ static inline int pid_alive(struct task_struct *p) | |||
905 | extern void free_task(struct task_struct *tsk); | 911 | extern void free_task(struct task_struct *tsk); |
906 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 912 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
907 | 913 | ||
908 | extern void __put_task_struct_cb(struct rcu_head *rhp); | ||
909 | extern void __put_task_struct(struct task_struct *t); | 914 | extern void __put_task_struct(struct task_struct *t); |
910 | 915 | ||
911 | static inline void put_task_struct(struct task_struct *t) | 916 | static inline void put_task_struct(struct task_struct *t) |
@@ -1187,8 +1192,7 @@ extern void wait_task_inactive(task_t * p); | |||
1187 | #define remove_parent(p) list_del_init(&(p)->sibling) | 1192 | #define remove_parent(p) list_del_init(&(p)->sibling) |
1188 | #define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children) | 1193 | #define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children) |
1189 | 1194 | ||
1190 | #define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks) | 1195 | #define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) |
1191 | #define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks) | ||
1192 | 1196 | ||
1193 | #define for_each_process(p) \ | 1197 | #define for_each_process(p) \ |
1194 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) | 1198 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) |
@@ -1203,9 +1207,10 @@ extern void wait_task_inactive(task_t * p); | |||
1203 | #define while_each_thread(g, t) \ | 1207 | #define while_each_thread(g, t) \ |
1204 | while ((t = next_thread(t)) != g) | 1208 | while ((t = next_thread(t)) != g) |
1205 | 1209 | ||
1206 | #define thread_group_leader(p) (p->pid == p->tgid) | 1210 | /* de_thread depends on thread_group_leader not being a pid based check */ |
1211 | #define thread_group_leader(p) (p == p->group_leader) | ||
1207 | 1212 | ||
1208 | static inline task_t *next_thread(task_t *p) | 1213 | static inline task_t *next_thread(const task_t *p) |
1209 | { | 1214 | { |
1210 | return list_entry(rcu_dereference(p->thread_group.next), | 1215 | return list_entry(rcu_dereference(p->thread_group.next), |
1211 | task_t, thread_group); | 1216 | task_t, thread_group); |
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index 6336987dae..2925e66a67 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h | |||
@@ -41,7 +41,8 @@ struct screen_info { | |||
41 | u16 vesapm_off; /* 0x30 */ | 41 | u16 vesapm_off; /* 0x30 */ |
42 | u16 pages; /* 0x32 */ | 42 | u16 pages; /* 0x32 */ |
43 | u16 vesa_attributes; /* 0x34 */ | 43 | u16 vesa_attributes; /* 0x34 */ |
44 | /* 0x36 -- 0x3f reserved for future expansion */ | 44 | u32 capabilities; /* 0x36 */ |
45 | /* 0x3a -- 0x3f reserved for future expansion */ | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | extern struct screen_info screen_info; | 48 | extern struct screen_info screen_info; |
diff --git a/include/linux/sdla_asy.h b/include/linux/sdla_asy.h deleted file mode 100644 index f62242537c..0000000000 --- a/include/linux/sdla_asy.h +++ /dev/null | |||
@@ -1,226 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdla_asy.h Header file for the Sangoma S508/S514 asynchronous code API | ||
3 | * | ||
4 | * Author: Gideon Hack | ||
5 | * | ||
6 | * Copyright: (c) 2000 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * | ||
14 | * Jan 28, 2000 Gideon Hack Initial Version | ||
15 | * | ||
16 | *****************************************************************************/ | ||
17 | |||
18 | |||
19 | #ifndef _WANPIPE_ASYNC_H | ||
20 | #define _WANPIPE_ASYNC_H | ||
21 | |||
22 | /* ---------------------------------------------------------------------------- | ||
23 | * Interface commands | ||
24 | * --------------------------------------------------------------------------*/ | ||
25 | |||
26 | #define SET_ASY_CONFIGURATION 0xE2 /* set the asychronous operational configuration */ | ||
27 | #define READ_ASY_CONFIGURATION 0xE3 /* read the current asychronous operational configuration */ | ||
28 | #define ENABLE_ASY_COMMUNICATIONS 0xE4 /* enable asychronous communications */ | ||
29 | #define DISABLE_ASY_COMMUNICATIONS 0xE5 /* disable asychronous communications */ | ||
30 | #define READ_ASY_OPERATIONAL_STATS 0xE7 /* retrieve the asychronous operational statistics */ | ||
31 | #define FLUSH_ASY_OPERATIONAL_STATS 0xE8 /* flush the asychronous operational statistics */ | ||
32 | #define TRANSMIT_ASY_BREAK_SIGNAL 0xEC /* transmit an asychronous break signal */ | ||
33 | |||
34 | |||
35 | |||
36 | /* ---------------------------------------------------------------------------- | ||
37 | * Return codes from interface commands | ||
38 | * --------------------------------------------------------------------------*/ | ||
39 | |||
40 | #define COMMAND_INVALID_FOR_PORT 0x50 /* the command is invalid for the selected port */ | ||
41 | #define DISABLE_ASY_COMMS_BEFORE_CFG 0xE1 /* communications must be disabled before setting the configuration */ | ||
42 | #define ASY_COMMS_ENABLED 0xE1 /* communications are currently enabled */ | ||
43 | #define ASY_COMMS_DISABLED 0xE1 /* communications are currently disabled */ | ||
44 | #define ASY_CFG_BEFORE_COMMS_ENABLED 0xE2 /* perform a SET_ASY_CONFIGURATION before enabling comms */ | ||
45 | #define LGTH_ASY_CFG_DATA_INVALID 0xE2 /* the length of the passed configuration data is invalid */ | ||
46 | #define INVALID_ASY_CFG_DATA 0xE3 /* the passed configuration data is invalid */ | ||
47 | #define ASY_BREAK_SIGNAL_BUSY 0xEC /* a break signal is being transmitted */ | ||
48 | |||
49 | |||
50 | |||
51 | /* ---------------------------------------------------------------------------- | ||
52 | * Constants for the SET_ASY_CONFIGURATION/READ_ASY_CONFIGURATION command | ||
53 | * --------------------------------------------------------------------------*/ | ||
54 | |||
55 | /* the asynchronous configuration structure */ | ||
56 | typedef struct { | ||
57 | unsigned long baud_rate PACKED; /* the baud rate */ | ||
58 | unsigned short line_config_options PACKED; /* line configuration options */ | ||
59 | unsigned short modem_config_options PACKED; /* modem configuration options */ | ||
60 | unsigned short asy_API_options PACKED; /* asynchronous API options */ | ||
61 | unsigned short asy_protocol_options PACKED; /* asynchronous protocol options */ | ||
62 | unsigned short Tx_bits_per_char PACKED; /* number of bits per tx character */ | ||
63 | unsigned short Rx_bits_per_char PACKED; /* number of bits per received character */ | ||
64 | unsigned short stop_bits PACKED; /* number of stop bits per character */ | ||
65 | unsigned short parity PACKED; /* parity definition */ | ||
66 | unsigned short break_timer PACKED; /* the break signal timer */ | ||
67 | unsigned short asy_Rx_inter_char_timer PACKED; /* the receive inter-character timer */ | ||
68 | unsigned short asy_Rx_complete_length PACKED; /* the receive 'buffer complete' length */ | ||
69 | unsigned short XON_char PACKED; /* the XON character */ | ||
70 | unsigned short XOFF_char PACKED; /* the XOFF character */ | ||
71 | unsigned short asy_statistics_options PACKED; /* async operational stat options */ | ||
72 | unsigned long ptr_shared_mem_info_struct PACKED;/* ptr to the shared memory area information structure */ | ||
73 | unsigned long ptr_asy_Tx_stat_el_cfg_struct PACKED;/* ptr to the transmit status element configuration structure */ | ||
74 | unsigned long ptr_asy_Rx_stat_el_cfg_struct PACKED;/* ptr to the receive status element configuration structure */ | ||
75 | } ASY_CONFIGURATION_STRUCT; | ||
76 | |||
77 | /* permitted minimum and maximum values for setting the asynchronous configuration */ | ||
78 | #define MIN_ASY_BAUD_RATE 50 /* maximum baud rate */ | ||
79 | #define MAX_ASY_BAUD_RATE 250000 /* minimum baud rate */ | ||
80 | #define MIN_ASY_BITS_PER_CHAR 5 /* minimum number of bits per character */ | ||
81 | #define MAX_ASY_BITS_PER_CHAR 8 /* maximum number of bits per character */ | ||
82 | #define MIN_BREAK_TMR_VAL 0 /* minimum break signal timer */ | ||
83 | #define MAX_BREAK_TMR_VAL 5000 /* maximum break signal timer */ | ||
84 | #define MIN_ASY_RX_INTER_CHAR_TMR 0 /* minimum receive inter-character timer */ | ||
85 | #define MAX_ASY_RX_INTER_CHAR_TMR 30000 /* maximum receive inter-character timer */ | ||
86 | #define MIN_ASY_RX_CPLT_LENGTH 0 /* minimum receive 'length complete' value */ | ||
87 | #define MAX_ASY_RX_CPLT_LENGTH 2000 /* maximum receive 'length complete' value */ | ||
88 | |||
89 | /* bit settings for the 'asy_API_options' */ | ||
90 | #define ASY_RX_DATA_TRANSPARENT 0x0001 /* do not strip parity and unused bits from received characters */ | ||
91 | |||
92 | /* bit settings for the 'asy_protocol_options' */ | ||
93 | #define ASY_RTS_HS_FOR_RX 0x0001 /* RTS handshaking is used for reception control */ | ||
94 | #define ASY_XON_XOFF_HS_FOR_RX 0x0002 /* XON/XOFF handshaking is used for reception control */ | ||
95 | #define ASY_XON_XOFF_HS_FOR_TX 0x0004 /* XON/XOFF handshaking is used for transmission control */ | ||
96 | #define ASY_DCD_HS_FOR_TX 0x0008 /* DCD handshaking is used for transmission control */ | ||
97 | #define ASY_CTS_HS_FOR_TX 0x0020 /* CTS handshaking is used for transmission control */ | ||
98 | |||
99 | /* bit settings for the 'stop_bits' definition */ | ||
100 | #define ONE_STOP_BIT 1 /* representation for 1 stop bit */ | ||
101 | #define TWO_STOP_BITS 2 /* representation for 2 stop bits */ | ||
102 | #define ONE_AND_A_HALF_STOP_BITS 3 /* representation for 1.5 stop bits */ | ||
103 | |||
104 | /* bit settings for the 'parity' definition */ | ||
105 | #define NO_PARITY 0 /* representation for no parity */ | ||
106 | #define ODD_PARITY 1 /* representation for odd parity */ | ||
107 | #define EVEN_PARITY 2 /* representation for even parity */ | ||
108 | |||
109 | |||
110 | |||
111 | /* ---------------------------------------------------------------------------- | ||
112 | * Constants for the READ_COMMS_ERROR_STATS command (asynchronous mode) | ||
113 | * --------------------------------------------------------------------------*/ | ||
114 | |||
115 | /* the communications error statistics structure */ | ||
116 | typedef struct { | ||
117 | unsigned short Rx_overrun_err_count PACKED; /* receiver overrun error count */ | ||
118 | unsigned short Rx_parity_err_count PACKED; /* parity errors received count */ | ||
119 | unsigned short Rx_framing_err_count PACKED; /* framing errors received count */ | ||
120 | unsigned short comms_err_stat_reserved_1 PACKED;/* reserved for later use */ | ||
121 | unsigned short comms_err_stat_reserved_2 PACKED;/* reserved for later use */ | ||
122 | unsigned short comms_err_stat_reserved_3 PACKED;/* reserved for later use */ | ||
123 | unsigned short comms_err_stat_reserved_4 PACKED;/* reserved for later use */ | ||
124 | unsigned short comms_err_stat_reserved_5 PACKED;/* reserved for later use */ | ||
125 | unsigned short DCD_state_change_count PACKED; /* DCD state change count */ | ||
126 | unsigned short CTS_state_change_count PACKED; /* CTS state change count */ | ||
127 | } ASY_COMMS_ERROR_STATS_STRUCT; | ||
128 | |||
129 | |||
130 | |||
131 | /* ---------------------------------------------------------------------------- | ||
132 | * Constants for the READ_ASY_OPERATIONAL_STATS command | ||
133 | * --------------------------------------------------------------------------*/ | ||
134 | |||
135 | /* the asynchronous operational statistics structure */ | ||
136 | typedef struct { | ||
137 | |||
138 | /* Data transmission statistics */ | ||
139 | unsigned long Data_blocks_Tx_count PACKED;/* number of blocks transmitted */ | ||
140 | unsigned long Data_bytes_Tx_count PACKED;/* number of bytes transmitted */ | ||
141 | unsigned long Data_Tx_throughput PACKED;/* transmit throughput */ | ||
142 | unsigned long no_ms_for_Data_Tx_thruput_comp PACKED;/* millisecond time used for the Tx throughput computation */ | ||
143 | unsigned long Tx_Data_discard_lgth_err_count PACKED;/* number of Data blocks discarded (length error) */ | ||
144 | unsigned long reserved_Data_frm_Tx_stat1 PACKED;/* reserved for later use */ | ||
145 | unsigned long reserved_Data_frm_Tx_stat2 PACKED;/* reserved for later use */ | ||
146 | unsigned long reserved_Data_frm_Tx_stat3 PACKED;/* reserved for later use */ | ||
147 | |||
148 | /* Data reception statistics */ | ||
149 | unsigned long Data_blocks_Rx_count PACKED;/* number of blocks received */ | ||
150 | unsigned long Data_bytes_Rx_count PACKED;/* number of bytes received */ | ||
151 | unsigned long Data_Rx_throughput PACKED;/* receive throughput */ | ||
152 | unsigned long no_ms_for_Data_Rx_thruput_comp PACKED;/* millisecond time used for the Rx throughput computation */ | ||
153 | unsigned long Rx_Data_bytes_discard_count PACKED;/* received Data bytes discarded */ | ||
154 | unsigned long reserved_Data_frm_Rx_stat1 PACKED;/* reserved for later use */ | ||
155 | |||
156 | /* handshaking protocol statistics */ | ||
157 | unsigned short XON_chars_Tx_count PACKED; /* number of XON characters transmitted */ | ||
158 | unsigned short XOFF_chars_Tx_count PACKED; /* number of XOFF characters transmitted */ | ||
159 | unsigned short XON_chars_Rx_count PACKED; /* number of XON characters received */ | ||
160 | unsigned short XOFF_chars_Rx_count PACKED; /* number of XOFF characters received */ | ||
161 | unsigned short Tx_halt_modem_low_count PACKED; /* number of times Tx halted (modem line low) */ | ||
162 | unsigned short Rx_halt_RTS_low_count PACKED; /* number of times Rx halted by setting RTS low */ | ||
163 | unsigned long reserved_handshaking_stat1 PACKED;/* reserved for later use */ | ||
164 | |||
165 | /* break statistics */ | ||
166 | unsigned short break_Tx_count PACKED; /* number of break sequences transmitted */ | ||
167 | unsigned short break_Rx_count PACKED; /* number of break sequences received */ | ||
168 | unsigned long reserved_break_stat1 PACKED;/* reserved for later use */ | ||
169 | |||
170 | /* miscellaneous statistics */ | ||
171 | unsigned long reserved_misc_stat1 PACKED; /* reserved for later use */ | ||
172 | unsigned long reserved_misc_stat2 PACKED; /* reserved for later use */ | ||
173 | |||
174 | } ASY_OPERATIONAL_STATS_STRUCT; | ||
175 | |||
176 | |||
177 | |||
178 | /* ---------------------------------------------------------------------------- | ||
179 | * Constants for Data transmission | ||
180 | * --------------------------------------------------------------------------*/ | ||
181 | |||
182 | /* the Data block transmit status element configuration structure */ | ||
183 | typedef struct { | ||
184 | unsigned short number_Tx_status_elements PACKED; /* number of transmit status elements */ | ||
185 | unsigned long base_addr_Tx_status_elements PACKED; /* base address of the transmit element list */ | ||
186 | unsigned long next_Tx_status_element_to_use PACKED; /* pointer to the next transmit element to be used */ | ||
187 | } ASY_TX_STATUS_EL_CFG_STRUCT; | ||
188 | |||
189 | |||
190 | /* the Data block transmit status element structure */ | ||
191 | typedef struct { | ||
192 | unsigned char opp_flag PACKED; /* opp flag */ | ||
193 | unsigned short data_length PACKED; /* length of the block to be transmitted */ | ||
194 | unsigned char reserved_1 PACKED; /* reserved for internal use */ | ||
195 | unsigned long reserved_2 PACKED; /* reserved for internal use */ | ||
196 | unsigned long reserved_3 PACKED; /* reserved for internal use */ | ||
197 | unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ | ||
198 | } ASY_DATA_TX_STATUS_EL_STRUCT; | ||
199 | |||
200 | |||
201 | |||
202 | /* ---------------------------------------------------------------------------- | ||
203 | * Constants for Data reception | ||
204 | * --------------------------------------------------------------------------*/ | ||
205 | |||
206 | /* the Data block receive status element configuration structure */ | ||
207 | typedef struct { | ||
208 | unsigned short number_Rx_status_elements PACKED;/* number of receive status elements */ | ||
209 | unsigned long base_addr_Rx_status_elements PACKED;/* base address of the receive element list */ | ||
210 | unsigned long next_Rx_status_element_to_use PACKED;/* pointer to the next receive element to be used */ | ||
211 | unsigned long base_addr_Rx_buffer PACKED;/* base address of the receive data buffer */ | ||
212 | unsigned long end_addr_Rx_buffer PACKED;/* end address of the receive data buffer */ | ||
213 | } ASY_RX_STATUS_EL_CFG_STRUCT; | ||
214 | |||
215 | /* the Data block receive status element structure */ | ||
216 | typedef struct { | ||
217 | unsigned char opp_flag PACKED; /* opp flag */ | ||
218 | unsigned short data_length PACKED; /* length of the received data block */ | ||
219 | unsigned char reserved_1 PACKED; /* reserved for internal use */ | ||
220 | unsigned short time_stamp PACKED; /* receive time stamp (HDLC_STREAMING_MODE) */ | ||
221 | unsigned short data_buffered PACKED; /* the number of data bytes still buffered */ | ||
222 | unsigned long reserved_2 PACKED; /* reserved for internal use */ | ||
223 | unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ | ||
224 | } ASY_DATA_RX_STATUS_EL_STRUCT; | ||
225 | |||
226 | #endif | ||
diff --git a/include/linux/sdla_chdlc.h b/include/linux/sdla_chdlc.h deleted file mode 100644 index d2e35a2990..0000000000 --- a/include/linux/sdla_chdlc.h +++ /dev/null | |||
@@ -1,813 +0,0 @@ | |||
1 | /************************************************************************* | ||
2 | sdla_chdlc.h Sangoma Cisco HDLC firmware API definitions | ||
3 | |||
4 | Author: Gideon Hack | ||
5 | Nenad Corbic <ncorbic@sangoma.com> | ||
6 | |||
7 | Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
8 | |||
9 | This program is free software; you can redistribute it and/or | ||
10 | modify it under the term of the GNU General Public License | ||
11 | as published by the Free Software Foundation; either version | ||
12 | 2 of the License, or (at your option) any later version. | ||
13 | |||
14 | =========================================================================== | ||
15 | Oct 04, 1999 Nenad Corbic Updated API support | ||
16 | Jun 02, 1999 Gideon Hack Changes for S514 usage. | ||
17 | Oct 28, 1998 Jaspreet Singh Made changes for Dual Port CHDLC. | ||
18 | Jun 11, 1998 David Fong Initial version. | ||
19 | =========================================================================== | ||
20 | |||
21 | Organization | ||
22 | - Compatibility notes | ||
23 | - Constants defining the shared memory control block (mailbox) | ||
24 | - Interface commands | ||
25 | - Return code from interface commands | ||
26 | - Constants for the commands (structures for casting data) | ||
27 | - UDP Management constants and structures | ||
28 | |||
29 | *************************************************************************/ | ||
30 | |||
31 | #ifndef _SDLA_CHDLC_H | ||
32 | # define _SDLC_CHDLC_H | ||
33 | |||
34 | /*------------------------------------------------------------------------ | ||
35 | Notes: | ||
36 | |||
37 | All structres defined in this file are byte-aligned. | ||
38 | |||
39 | Compiler Platform | ||
40 | ------------------------ | ||
41 | GNU C Linux | ||
42 | |||
43 | ------------------------------------------------------------------------*/ | ||
44 | |||
45 | #ifndef PACKED | ||
46 | #define PACKED __attribute__((packed)) | ||
47 | #endif /* PACKED */ | ||
48 | |||
49 | |||
50 | /* ---------------------------------------------------------------------------- | ||
51 | * Constants defining the shared memory control block (mailbox) | ||
52 | * --------------------------------------------------------------------------*/ | ||
53 | |||
54 | #define PRI_BASE_ADDR_MB_STRUCT 0xE000 /* the base address of the mailbox structure on the adapter */ | ||
55 | #define SEC_BASE_ADDR_MB_STRUCT 0xE800 /* the base address of the mailbox structure on the adapter */ | ||
56 | #define SIZEOF_MB_DATA_BFR 2032 /* the size of the actual mailbox data area */ | ||
57 | #define NUMBER_MB_RESERVED_BYTES 0x0B /* the number of reserved bytes in the mailbox header area */ | ||
58 | |||
59 | |||
60 | #define MIN_LGTH_CHDLC_DATA_CFG 300 /* min length of the CHDLC data field (for configuration purposes) */ | ||
61 | #define PRI_MAX_NO_DATA_BYTES_IN_FRAME 15354 /* PRIMARY - max length of the CHDLC data field */ | ||
62 | |||
63 | typedef struct { | ||
64 | unsigned char opp_flag PACKED; /* the opp flag */ | ||
65 | unsigned char command PACKED; /* the user command */ | ||
66 | unsigned short buffer_length PACKED; /* the data length */ | ||
67 | unsigned char return_code PACKED; /* the return code */ | ||
68 | unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; /* reserved for later */ | ||
69 | unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; /* the data area */ | ||
70 | } CHDLC_MAILBOX_STRUCT; | ||
71 | |||
72 | typedef struct { | ||
73 | pid_t pid_num PACKED; | ||
74 | CHDLC_MAILBOX_STRUCT cmdarea PACKED; | ||
75 | |||
76 | } CMDBLOCK_STRUCT; | ||
77 | |||
78 | |||
79 | |||
80 | |||
81 | /* ---------------------------------------------------------------------------- | ||
82 | * Interface commands | ||
83 | * --------------------------------------------------------------------------*/ | ||
84 | |||
85 | /* global interface commands */ | ||
86 | #define READ_GLOBAL_EXCEPTION_CONDITION 0x01 | ||
87 | #define SET_GLOBAL_CONFIGURATION 0x02 | ||
88 | #define READ_GLOBAL_CONFIGURATION 0x03 | ||
89 | #define READ_GLOBAL_STATISTICS 0x04 | ||
90 | #define FLUSH_GLOBAL_STATISTICS 0x05 | ||
91 | #define SET_MODEM_STATUS 0x06 /* set status of DTR or RTS */ | ||
92 | #define READ_MODEM_STATUS 0x07 /* read status of CTS and DCD */ | ||
93 | #define READ_COMMS_ERROR_STATS 0x08 | ||
94 | #define FLUSH_COMMS_ERROR_STATS 0x09 | ||
95 | #define SET_TRACE_CONFIGURATION 0x0A /* set the line trace config */ | ||
96 | #define READ_TRACE_CONFIGURATION 0x0B /* read the line trace config */ | ||
97 | #define READ_TRACE_STATISTICS 0x0C /* read the trace statistics */ | ||
98 | #define FLUSH_TRACE_STATISTICS 0x0D /* flush the trace statistics */ | ||
99 | #define FT1_MONITOR_STATUS_CTRL 0x1C /* set the status of the S508/FT1 monitoring */ | ||
100 | #define SET_FT1_CONFIGURATION 0x18 /* set the FT1 configuration */ | ||
101 | #define READ_FT1_CONFIGURATION 0x19 /* read the FT1 configuration */ | ||
102 | #define TRANSMIT_ASYNC_DATA_TO_FT1 0x1A /* output asynchronous data to the FT1 */ | ||
103 | #define RECEIVE_ASYNC_DATA_FROM_FT1 0x1B /* receive asynchronous data from the FT1 */ | ||
104 | #define FT1_MONITOR_STATUS_CTRL 0x1C /* set the status of the FT1 monitoring */ | ||
105 | |||
106 | #define READ_FT1_OPERATIONAL_STATS 0x1D /* read the S508/FT1 operational statistics */ | ||
107 | #define SET_FT1_MODE 0x1E /* set the operational mode of the S508/FT1 module */ | ||
108 | |||
109 | /* CHDLC-level interface commands */ | ||
110 | #define READ_CHDLC_CODE_VERSION 0x20 | ||
111 | #define READ_CHDLC_EXCEPTION_CONDITION 0x21 /* read exception condition from the adapter */ | ||
112 | #define SET_CHDLC_CONFIGURATION 0x22 | ||
113 | #define READ_CHDLC_CONFIGURATION 0x23 | ||
114 | #define ENABLE_CHDLC_COMMUNICATIONS 0x24 | ||
115 | #define DISABLE_CHDLC_COMMUNICATIONS 0x25 | ||
116 | #define READ_CHDLC_LINK_STATUS 0x26 | ||
117 | #define READ_CHDLC_OPERATIONAL_STATS 0x27 | ||
118 | #define FLUSH_CHDLC_OPERATIONAL_STATS 0x28 | ||
119 | #define SET_CHDLC_INTERRUPT_TRIGGERS 0x30 /* set application interrupt triggers */ | ||
120 | #define READ_CHDLC_INTERRUPT_TRIGGERS 0x31 /* read application interrupt trigger configuration */ | ||
121 | |||
122 | /* Special UDP drivers management commands */ | ||
123 | #define CPIPE_ENABLE_TRACING 0x50 | ||
124 | #define CPIPE_DISABLE_TRACING 0x51 | ||
125 | #define CPIPE_GET_TRACE_INFO 0x52 | ||
126 | #define CPIPE_GET_IBA_DATA 0x53 | ||
127 | #define CPIPE_FT1_READ_STATUS 0x54 | ||
128 | #define CPIPE_DRIVER_STAT_IFSEND 0x55 | ||
129 | #define CPIPE_DRIVER_STAT_INTR 0x56 | ||
130 | #define CPIPE_DRIVER_STAT_GEN 0x57 | ||
131 | #define CPIPE_FLUSH_DRIVER_STATS 0x58 | ||
132 | #define CPIPE_ROUTER_UP_TIME 0x59 | ||
133 | |||
134 | /* Driver specific commands for API */ | ||
135 | #define CHDLC_READ_TRACE_DATA 0xE4 /* read trace data */ | ||
136 | #define TRACE_ALL 0x00 | ||
137 | #define TRACE_PROT 0x01 | ||
138 | #define TRACE_DATA 0x02 | ||
139 | |||
140 | #define DISCARD_RX_ERROR_FRAMES 0x0001 | ||
141 | |||
142 | /* ---------------------------------------------------------------------------- | ||
143 | * Return codes from interface commands | ||
144 | * --------------------------------------------------------------------------*/ | ||
145 | |||
146 | #define COMMAND_OK 0x00 | ||
147 | |||
148 | /* return codes from global interface commands */ | ||
149 | #define NO_GLOBAL_EXCEP_COND_TO_REPORT 0x01 /* there is no CHDLC exception condition to report */ | ||
150 | #define LGTH_GLOBAL_CFG_DATA_INVALID 0x01 /* the length of the passed global configuration data is invalid */ | ||
151 | #define LGTH_TRACE_CFG_DATA_INVALID 0x01 /* the length of the passed trace configuration data is invalid */ | ||
152 | #define IRQ_TIMEOUT_VALUE_INVALID 0x02 /* an invalid application IRQ timeout value was selected */ | ||
153 | #define TRACE_CONFIG_INVALID 0x02 /* the passed line trace configuration is invalid */ | ||
154 | #define ADAPTER_OPERATING_FREQ_INVALID 0x03 /* an invalid adapter operating frequency was selected */ | ||
155 | #define TRC_DEAC_TMR_INVALID 0x03 /* the trace deactivation timer is invalid */ | ||
156 | #define S508_FT1_ADPTR_NOT_PRESENT 0x0C /* the S508/FT1 adapter is not present */ | ||
157 | #define INVALID_FT1_STATUS_SELECTION 0x0D /* the S508/FT1 status selection is invalid */ | ||
158 | #define FT1_OP_STATS_NOT_ENABLED 0x0D /* the FT1 operational statistics have not been enabled */ | ||
159 | #define FT1_OP_STATS_NOT_AVAILABLE 0x0E /* the FT1 operational statistics are not currently available */ | ||
160 | #define S508_FT1_MODE_SELECTION_BUSY 0x0E /* the S508/FT1 adapter is busy selecting the operational mode */ | ||
161 | |||
162 | /* return codes from command READ_GLOBAL_EXCEPTION_CONDITION */ | ||
163 | #define EXCEP_MODEM_STATUS_CHANGE 0x10 /* a modem status change occurred */ | ||
164 | #define EXCEP_TRC_DISABLED 0x11 /* the trace has been disabled */ | ||
165 | #define EXCEP_IRQ_TIMEOUT 0x12 /* IRQ timeout */ | ||
166 | |||
167 | /* return codes from CHDLC-level interface commands */ | ||
168 | #define NO_CHDLC_EXCEP_COND_TO_REPORT 0x21 /* there is no CHDLC exception condition to report */ | ||
169 | #define CHDLC_COMMS_DISABLED 0x21 /* communications are not currently enabled */ | ||
170 | #define CHDLC_COMMS_ENABLED 0x21 /* communications are currently enabled */ | ||
171 | #define DISABLE_CHDLC_COMMS_BEFORE_CFG 0x21 /* CHDLC communications must be disabled before setting the configuration */ | ||
172 | #define ENABLE_CHDLC_COMMS_BEFORE_CONN 0x21 /* communications must be enabled before using the CHDLC_CONNECT conmmand */ | ||
173 | #define CHDLC_CFG_BEFORE_COMMS_ENABLED 0x22 /* perform a SET_CHDLC_CONFIGURATION before enabling comms */ | ||
174 | #define LGTH_CHDLC_CFG_DATA_INVALID 0x22 /* the length of the passed CHDLC configuration data is invalid */ | ||
175 | #define LGTH_INT_TRIGGERS_DATA_INVALID 0x22 /* the length of the passed interrupt trigger data is invalid */ | ||
176 | #define INVALID_IRQ_SELECTED 0x23 /* in invalid IRQ was selected in the SET_CHDLC_INTERRUPT_TRIGGERS */ | ||
177 | #define INVALID_CHDLC_CFG_DATA 0x23 /* the passed CHDLC configuration data is invalid */ | ||
178 | #define IRQ_TMR_VALUE_INVALID 0x24 /* an invalid application IRQ timer value was selected */ | ||
179 | #define LARGER_PERCENT_TX_BFR_REQUIRED 0x24 /* a larger Tx buffer percentage is required */ | ||
180 | #define LARGER_PERCENT_RX_BFR_REQUIRED 0x25 /* a larger Rx buffer percentage is required */ | ||
181 | #define S514_BOTH_PORTS_SAME_CLK_MODE 0x26 /* S514 - both ports must have same clock mode */ | ||
182 | #define INVALID_CMND_HDLC_STREAM_MODE 0x4E /* the CHDLC interface command is invalid for HDLC streaming mode */ | ||
183 | #define INVALID_CHDLC_COMMAND 0x4F /* the defined CHDLC interface command is invalid */ | ||
184 | |||
185 | /* return codes from command READ_CHDLC_EXCEPTION_CONDITION */ | ||
186 | #define EXCEP_LINK_ACTIVE 0x30 /* the CHDLC link has become active */ | ||
187 | #define EXCEP_LINK_INACTIVE_MODEM 0x31 /* the CHDLC link has become inactive (modem status) */ | ||
188 | #define EXCEP_LINK_INACTIVE_KPALV 0x32 /* the CHDLC link has become inactive (keepalive status) */ | ||
189 | #define EXCEP_IP_ADDRESS_DISCOVERED 0x33 /* the IP address has been discovered */ | ||
190 | #define EXCEP_LOOPBACK_CONDITION 0x34 /* a loopback condition has occurred */ | ||
191 | |||
192 | |||
193 | /* return code from command CHDLC_SEND_WAIT and CHDLC_SEND_NO_WAIT */ | ||
194 | #define LINK_DISCONNECTED 0x21 | ||
195 | #define NO_TX_BFRS_AVAIL 0x24 | ||
196 | |||
197 | |||
198 | /* ---------------------------------------------------------------------------- | ||
199 | * Constants for the SET_GLOBAL_CONFIGURATION/READ_GLOBAL_CONFIGURATION commands | ||
200 | * --------------------------------------------------------------------------*/ | ||
201 | |||
202 | /* the global configuration structure */ | ||
203 | typedef struct { | ||
204 | unsigned short adapter_config_options PACKED; /* adapter config options */ | ||
205 | unsigned short app_IRQ_timeout PACKED; /* application IRQ timeout */ | ||
206 | unsigned long adapter_operating_frequency PACKED; /* adapter operating frequency */ | ||
207 | } GLOBAL_CONFIGURATION_STRUCT; | ||
208 | |||
209 | /* settings for the 'app_IRQ_timeout' */ | ||
210 | #define MAX_APP_IRQ_TIMEOUT_VALUE 5000 /* the maximum permitted IRQ timeout */ | ||
211 | |||
212 | |||
213 | |||
214 | /* ---------------------------------------------------------------------------- | ||
215 | * Constants for the READ_GLOBAL_STATISTICS command | ||
216 | * --------------------------------------------------------------------------*/ | ||
217 | |||
218 | /* the global statistics structure */ | ||
219 | typedef struct { | ||
220 | unsigned short app_IRQ_timeout_count PACKED; | ||
221 | } GLOBAL_STATS_STRUCT; | ||
222 | |||
223 | |||
224 | |||
225 | /* ---------------------------------------------------------------------------- | ||
226 | * Constants for the READ_COMMS_ERROR_STATS command | ||
227 | * --------------------------------------------------------------------------*/ | ||
228 | |||
229 | /* the communications error statistics structure */ | ||
230 | typedef struct { | ||
231 | unsigned short Rx_overrun_err_count PACKED; | ||
232 | unsigned short CRC_err_count PACKED; /* receiver CRC error count */ | ||
233 | unsigned short Rx_abort_count PACKED; /* abort frames recvd count */ | ||
234 | unsigned short Rx_dis_pri_bfrs_full_count PACKED;/* receiver disabled */ | ||
235 | unsigned short comms_err_stat_reserved_1 PACKED;/* reserved for later */ | ||
236 | unsigned short sec_Tx_abort_msd_Tx_int_count PACKED; /* secondary - abort frames transmitted count (missed Tx interrupt) */ | ||
237 | unsigned short missed_Tx_und_int_count PACKED; /* missed tx underrun interrupt count */ | ||
238 | unsigned short sec_Tx_abort_count PACKED; /*secondary-abort frames tx count */ | ||
239 | unsigned short DCD_state_change_count PACKED; /* DCD state change */ | ||
240 | unsigned short CTS_state_change_count PACKED; /* CTS state change */ | ||
241 | } COMMS_ERROR_STATS_STRUCT; | ||
242 | |||
243 | |||
244 | |||
245 | /* ---------------------------------------------------------------------------- | ||
246 | * Constants used for line tracing | ||
247 | * --------------------------------------------------------------------------*/ | ||
248 | |||
249 | /* the trace configuration structure (SET_TRACE_CONFIGURATION/READ_TRACE_CONFIGURATION commands) */ | ||
250 | typedef struct { | ||
251 | unsigned char trace_config PACKED; /* trace configuration */ | ||
252 | unsigned short trace_deactivation_timer PACKED; /* trace deactivation timer */ | ||
253 | unsigned long ptr_trace_stat_el_cfg_struct PACKED; /* a pointer to the line trace element configuration structure */ | ||
254 | } LINE_TRACE_CONFIG_STRUCT; | ||
255 | |||
256 | /* 'trace_config' bit settings */ | ||
257 | #define TRACE_INACTIVE 0x00 /* trace is inactive */ | ||
258 | #define TRACE_ACTIVE 0x01 /* trace is active */ | ||
259 | #define TRACE_DELAY_MODE 0x04 /* operate the trace in delay mode */ | ||
260 | #define TRACE_DATA_FRAMES 0x08 /* trace Data frames */ | ||
261 | #define TRACE_SLARP_FRAMES 0x10 /* trace SLARP frames */ | ||
262 | #define TRACE_CDP_FRAMES 0x20 /* trace CDP frames */ | ||
263 | |||
264 | /* the line trace status element configuration structure */ | ||
265 | typedef struct { | ||
266 | unsigned short number_trace_status_elements PACKED; /* number of line trace elements */ | ||
267 | unsigned long base_addr_trace_status_elements PACKED; /* base address of the trace element list */ | ||
268 | unsigned long next_trace_element_to_use PACKED; /* pointer to the next trace element to be used */ | ||
269 | unsigned long base_addr_trace_buffer PACKED; /* base address of the trace data buffer */ | ||
270 | unsigned long end_addr_trace_buffer PACKED; /* end address of the trace data buffer */ | ||
271 | } TRACE_STATUS_EL_CFG_STRUCT; | ||
272 | |||
273 | /* the line trace status element structure */ | ||
274 | typedef struct { | ||
275 | unsigned char opp_flag PACKED; /* opp flag */ | ||
276 | unsigned short trace_length PACKED; /* trace length */ | ||
277 | unsigned char trace_type PACKED; /* trace type */ | ||
278 | unsigned short trace_time_stamp PACKED; /* time stamp */ | ||
279 | unsigned short trace_reserved_1 PACKED; /* reserved for later use */ | ||
280 | unsigned long trace_reserved_2 PACKED; /* reserved for later use */ | ||
281 | unsigned long ptr_data_bfr PACKED; /* ptr to the trace data buffer */ | ||
282 | } TRACE_STATUS_ELEMENT_STRUCT; | ||
283 | |||
284 | /* "trace_type" bit settings */ | ||
285 | #define TRACE_INCOMING 0x00 | ||
286 | #define TRACE_OUTGOINGING 0x01 | ||
287 | #define TRACE_INCOMING_ABORTED 0x10 | ||
288 | #define TRACE_INCOMING_CRC_ERROR 0x20 | ||
289 | #define TRACE_INCOMING_OVERRUN_ERROR 0x40 | ||
290 | |||
291 | |||
292 | |||
293 | /* the line trace statistics structure */ | ||
294 | typedef struct { | ||
295 | unsigned long frames_traced_count PACKED; /* number of frames traced */ | ||
296 | unsigned long trc_frms_not_recorded_count PACKED; /* number of trace frames discarded */ | ||
297 | } LINE_TRACE_STATS_STRUCT; | ||
298 | |||
299 | |||
300 | /* ---------------------------------------------------------------------------- | ||
301 | * Constants for the FT1_MONITOR_STATUS_CTRL command | ||
302 | * --------------------------------------------------------------------------*/ | ||
303 | |||
304 | #define DISABLE_FT1_STATUS_STATISTICS 0x00 /* disable the FT1 status and statistics monitoring */ | ||
305 | #define ENABLE_READ_FT1_STATUS 0x01 /* read the FT1 operational status */ | ||
306 | #define ENABLE_READ_FT1_OP_STATS 0x02 /* read the FT1 operational statistics */ | ||
307 | #define FLUSH_FT1_OP_STATS 0x04 /* flush the FT1 operational statistics */ | ||
308 | |||
309 | |||
310 | |||
311 | |||
312 | /* ---------------------------------------------------------------------------- | ||
313 | * Constants for the SET_CHDLC_CONFIGURATION command | ||
314 | * --------------------------------------------------------------------------*/ | ||
315 | |||
316 | /* the CHDLC configuration structure */ | ||
317 | typedef struct { | ||
318 | unsigned long baud_rate PACKED; /* the baud rate */ | ||
319 | unsigned short line_config_options PACKED; /* line configuration options */ | ||
320 | unsigned short modem_config_options PACKED; /* modem configration options */ | ||
321 | unsigned short modem_status_timer PACKED; /* timer for monitoring modem status changes */ | ||
322 | unsigned short CHDLC_API_options PACKED; /* CHDLC API options */ | ||
323 | unsigned short CHDLC_protocol_options PACKED; /* CHDLC protocol options */ | ||
324 | unsigned short percent_data_buffer_for_Tx PACKED; /* percentage data buffering used for Tx */ | ||
325 | unsigned short CHDLC_statistics_options PACKED; /* CHDLC operational statistics options */ | ||
326 | unsigned short max_CHDLC_data_field_length PACKED; /* the maximum length of the CHDLC Data field */ | ||
327 | unsigned short transmit_keepalive_timer PACKED; /* the transmit keepalive timer */ | ||
328 | unsigned short receive_keepalive_timer PACKED; /* the receive keepalive timer */ | ||
329 | unsigned short keepalive_error_tolerance PACKED; /* the receive keepalive error tolerance */ | ||
330 | unsigned short SLARP_request_timer PACKED; /* the SLARP request timer */ | ||
331 | unsigned long IP_address PACKED; /* the IP address */ | ||
332 | unsigned long IP_netmask PACKED; /* the IP netmask */ | ||
333 | unsigned long ptr_shared_mem_info_struct PACKED; /* a pointer to the shared memory area information structure */ | ||
334 | unsigned long ptr_CHDLC_Tx_stat_el_cfg_struct PACKED; /* a pointer to the transmit status element configuration structure */ | ||
335 | unsigned long ptr_CHDLC_Rx_stat_el_cfg_struct PACKED; /* a pointer to the receive status element configuration structure */ | ||
336 | } CHDLC_CONFIGURATION_STRUCT; | ||
337 | |||
338 | /* settings for the 'line_config_options' */ | ||
339 | #define INTERFACE_LEVEL_V35 0x0000 /* V.35 interface level */ | ||
340 | #define INTERFACE_LEVEL_RS232 0x0001 /* RS-232 interface level */ | ||
341 | |||
342 | /* settings for the 'modem_config_options' */ | ||
343 | |||
344 | #define DONT_RAISE_DTR_RTS_ON_EN_COMMS 0x0001 | ||
345 | /* don't automatically raise DTR and RTS when performing an | ||
346 | ENABLE_CHDLC_COMMUNICATIONS command */ | ||
347 | |||
348 | #define DONT_REPORT_CHG_IN_MODEM_STAT 0x0002 | ||
349 | /* don't report changes in modem status to the application */ | ||
350 | |||
351 | |||
352 | /* bit settings for the 'CHDLC_protocol_options' byte */ | ||
353 | |||
354 | #define IGNORE_DCD_FOR_LINK_STAT 0x0001 | ||
355 | /* ignore DCD in determining the CHDLC link status */ | ||
356 | |||
357 | #define IGNORE_CTS_FOR_LINK_STAT 0x0002 | ||
358 | /* ignore CTS in determining the CHDLC link status */ | ||
359 | |||
360 | #define IGNORE_KPALV_FOR_LINK_STAT 0x0004 | ||
361 | /* ignore keepalive frames in determining the CHDLC link status */ | ||
362 | |||
363 | #define SINGLE_TX_BUFFER 0x4000 | ||
364 | /* configure a single transmit buffer */ | ||
365 | |||
366 | #define HDLC_STREAMING_MODE 0x8000 | ||
367 | |||
368 | /* settings for the 'CHDLC_statistics_options' */ | ||
369 | |||
370 | #define CHDLC_TX_DATA_BYTE_COUNT_STAT 0x0001 | ||
371 | /* record the number of Data bytes transmitted */ | ||
372 | |||
373 | #define CHDLC_RX_DATA_BYTE_COUNT_STAT 0x0002 | ||
374 | /* record the number of Data bytes received */ | ||
375 | |||
376 | #define CHDLC_TX_THROUGHPUT_STAT 0x0004 | ||
377 | /* compute the Data frame transmit throughput */ | ||
378 | |||
379 | #define CHDLC_RX_THROUGHPUT_STAT 0x0008 | ||
380 | /* compute the Data frame receive throughput */ | ||
381 | |||
382 | |||
383 | /* permitted minimum and maximum values for setting the CHDLC configuration */ | ||
384 | #define PRI_MAX_BAUD_RATE_S508 2666666 /* PRIMARY - maximum baud rate (S508) */ | ||
385 | #define SEC_MAX_BAUD_RATE_S508 258064 /* SECONDARY - maximum baud rate (S508) */ | ||
386 | #define PRI_MAX_BAUD_RATE_S514 2750000 /* PRIMARY - maximum baud rate (S508) */ | ||
387 | #define SEC_MAX_BAUD_RATE_S514 515625 /* SECONDARY - maximum baud rate (S508) */ | ||
388 | |||
389 | #define MIN_MODEM_TIMER 0 /* minimum modem status timer */ | ||
390 | #define MAX_MODEM_TIMER 5000 /* maximum modem status timer */ | ||
391 | |||
392 | #define SEC_MAX_NO_DATA_BYTES_IN_FRAME 2048 /* SECONDARY - max length of the CHDLC data field */ | ||
393 | |||
394 | #define MIN_Tx_KPALV_TIMER 0 /* minimum transmit keepalive timer */ | ||
395 | #define MAX_Tx_KPALV_TIMER 60000 /* maximum transmit keepalive timer */ | ||
396 | #define DEFAULT_Tx_KPALV_TIMER 10000 /* default transmit keepalive timer */ | ||
397 | |||
398 | #define MIN_Rx_KPALV_TIMER 10 /* minimum receive keepalive timer */ | ||
399 | #define MAX_Rx_KPALV_TIMER 60000 /* maximum receive keepalive timer */ | ||
400 | #define DEFAULT_Rx_KPALV_TIMER 10000 /* default receive keepalive timer */ | ||
401 | |||
402 | #define MIN_KPALV_ERR_TOL 1 /* min kpalv error tolerance count */ | ||
403 | #define MAX_KPALV_ERR_TOL 20 /* max kpalv error tolerance count */ | ||
404 | #define DEFAULT_KPALV_ERR_TOL 3 /* default value */ | ||
405 | |||
406 | #define MIN_SLARP_REQ_TIMER 0 /* min transmit SLARP Request timer */ | ||
407 | #define MAX_SLARP_REQ_TIMER 60000 /* max transmit SLARP Request timer */ | ||
408 | #define DEFAULT_SLARP_REQ_TIMER 0 /* default value -- no SLARP */ | ||
409 | |||
410 | |||
411 | |||
412 | /* ---------------------------------------------------------------------------- | ||
413 | * Constants for the READ_CHDLC_LINK_STATUS command | ||
414 | * --------------------------------------------------------------------------*/ | ||
415 | |||
416 | /* the CHDLC status structure */ | ||
417 | typedef struct { | ||
418 | unsigned char CHDLC_link_status PACKED; /* CHDLC link status */ | ||
419 | unsigned char no_Data_frms_for_app PACKED; /* number of Data frames available for the application */ | ||
420 | unsigned char receiver_status PACKED; /* enabled/disabled */ | ||
421 | unsigned char SLARP_state PACKED; /* internal SLARP state */ | ||
422 | } CHDLC_LINK_STATUS_STRUCT; | ||
423 | |||
424 | /* settings for the 'CHDLC_link_status' variable */ | ||
425 | #define CHDLC_LINK_INACTIVE 0x00 /* the CHDLC link is inactive */ | ||
426 | #define CHDLC_LINK_ACTIVE 0x01 /* the CHDLC link is active */ | ||
427 | |||
428 | |||
429 | |||
430 | /* ---------------------------------------------------------------------------- | ||
431 | * Constants for the READ_CHDLC_OPERATIONAL_STATS command | ||
432 | * --------------------------------------------------------------------------*/ | ||
433 | |||
434 | /* the CHDLC operational statistics structure */ | ||
435 | typedef struct { | ||
436 | |||
437 | /* Data frame transmission statistics */ | ||
438 | unsigned long Data_frames_Tx_count PACKED; /* # of frames transmitted */ | ||
439 | unsigned long Data_bytes_Tx_count PACKED; /* # of bytes transmitted */ | ||
440 | unsigned long Data_Tx_throughput PACKED; /* transmit throughput */ | ||
441 | unsigned long no_ms_for_Data_Tx_thruput_comp PACKED; /* millisecond time used for the Tx throughput computation */ | ||
442 | unsigned long Tx_Data_discard_lgth_err_count PACKED; /* number of Data frames discarded (length error) */ | ||
443 | unsigned long reserved_Data_frm_Tx_stat1 PACKED; /* reserved for later */ | ||
444 | unsigned long reserved_Data_frm_Tx_stat2 PACKED; /* reserved for later */ | ||
445 | unsigned long reserved_Data_frm_Tx_stat3 PACKED; /* reserved for later */ | ||
446 | |||
447 | /* Data frame reception statistics */ | ||
448 | unsigned long Data_frames_Rx_count PACKED; /* number of frames received */ | ||
449 | unsigned long Data_bytes_Rx_count PACKED; /* number of bytes received */ | ||
450 | unsigned long Data_Rx_throughput PACKED; /* receive throughput */ | ||
451 | unsigned long no_ms_for_Data_Rx_thruput_comp PACKED; /* millisecond time used for the Rx throughput computation */ | ||
452 | unsigned long Rx_Data_discard_short_count PACKED; /* received Data frames discarded (too short) */ | ||
453 | unsigned long Rx_Data_discard_long_count PACKED; /* received Data frames discarded (too long) */ | ||
454 | unsigned long Rx_Data_discard_inactive_count PACKED; /* received Data frames discarded (link inactive) */ | ||
455 | unsigned long reserved_Data_frm_Rx_stat1 PACKED; /* reserved for later */ | ||
456 | |||
457 | /* SLARP frame transmission/reception statistics */ | ||
458 | unsigned long CHDLC_SLARP_REQ_Tx_count PACKED; /* number of SLARP Request frames transmitted */ | ||
459 | unsigned long CHDLC_SLARP_REQ_Rx_count PACKED; /* number of SLARP Request frames received */ | ||
460 | unsigned long CHDLC_SLARP_REPLY_Tx_count PACKED; /* number of SLARP Reply frames transmitted */ | ||
461 | unsigned long CHDLC_SLARP_REPLY_Rx_count PACKED; /* number of SLARP Reply frames received */ | ||
462 | unsigned long CHDLC_SLARP_KPALV_Tx_count PACKED; /* number of SLARP keepalive frames transmitted */ | ||
463 | unsigned long CHDLC_SLARP_KPALV_Rx_count PACKED; /* number of SLARP keepalive frames received */ | ||
464 | unsigned long reserved_SLARP_stat1 PACKED; /* reserved for later */ | ||
465 | unsigned long reserved_SLARP_stat2 PACKED; /* reserved for later */ | ||
466 | |||
467 | /* CDP frame transmission/reception statistics */ | ||
468 | unsigned long CHDLC_CDP_Tx_count PACKED; /* number of CDP frames transmitted */ | ||
469 | unsigned long CHDLC_CDP_Rx_count PACKED; /* number of CDP frames received */ | ||
470 | unsigned long reserved_CDP_stat1 PACKED; /* reserved for later */ | ||
471 | unsigned long reserved_CDP_stat2 PACKED; /* reserved for later */ | ||
472 | unsigned long reserved_CDP_stat3 PACKED; /* reserved for later */ | ||
473 | unsigned long reserved_CDP_stat4 PACKED; /* reserved for later */ | ||
474 | unsigned long reserved_CDP_stat5 PACKED; /* reserved for later */ | ||
475 | unsigned long reserved_CDP_stat6 PACKED; /* reserved for later */ | ||
476 | |||
477 | /* Incoming frames with a format error statistics */ | ||
478 | unsigned short Rx_frm_incomp_CHDLC_hdr_count PACKED; /* frames received of with incomplete Cisco HDLC header */ | ||
479 | unsigned short Rx_frms_too_long_count PACKED; /* frames received of excessive length count */ | ||
480 | unsigned short Rx_invalid_CHDLC_addr_count PACKED; /* frames received with an invalid CHDLC address count */ | ||
481 | unsigned short Rx_invalid_CHDLC_ctrl_count PACKED; /* frames received with an invalid CHDLC control field count */ | ||
482 | unsigned short Rx_invalid_CHDLC_type_count PACKED; /* frames received of an invalid CHDLC frame type count */ | ||
483 | unsigned short Rx_SLARP_invalid_code_count PACKED; /* SLARP frame received with an invalid packet code */ | ||
484 | unsigned short Rx_SLARP_Reply_bad_IP_addr PACKED; /* SLARP Reply received - bad IP address */ | ||
485 | unsigned short Rx_SLARP_Reply_bad_netmask PACKED; /* SLARP Reply received - bad netmask */ | ||
486 | unsigned long reserved_frm_format_err1 PACKED; /* reserved for later */ | ||
487 | unsigned long reserved_frm_format_err2 PACKED; /* reserved for later */ | ||
488 | unsigned long reserved_frm_format_err3 PACKED; /* reserved for later */ | ||
489 | unsigned long reserved_frm_format_err4 PACKED; /* reserved for later */ | ||
490 | |||
491 | /* CHDLC timeout/retry statistics */ | ||
492 | unsigned short SLARP_Rx_keepalive_TO_count PACKED; /* timeout count for incoming SLARP frames */ | ||
493 | unsigned short SLARP_Request_TO_count PACKED; /* timeout count for SLARP Request frames */ | ||
494 | unsigned long To_retry_reserved_stat1 PACKED; /* reserved for later */ | ||
495 | unsigned long To_retry_reserved_stat2 PACKED; /* reserved for later */ | ||
496 | unsigned long To_retry_reserved_stat3 PACKED; /* reserved for later */ | ||
497 | |||
498 | /* CHDLC link active/inactive and loopback statistics */ | ||
499 | unsigned short link_active_count PACKED; /* number of times that the link went active */ | ||
500 | unsigned short link_inactive_modem_count PACKED; /* number of times that the link went inactive (modem failure) */ | ||
501 | unsigned short link_inactive_keepalive_count PACKED; /* number of times that the link went inactive (keepalive failure) */ | ||
502 | unsigned short link_looped_count PACKED; /* link looped count */ | ||
503 | unsigned long link_status_reserved_stat1 PACKED; /* reserved for later use */ | ||
504 | unsigned long link_status_reserved_stat2 PACKED; /* reserved for later use */ | ||
505 | |||
506 | /* miscellaneous statistics */ | ||
507 | unsigned long reserved_misc_stat1 PACKED; /* reserved for later */ | ||
508 | unsigned long reserved_misc_stat2 PACKED; /* reserved for later */ | ||
509 | unsigned long reserved_misc_stat3 PACKED; /* reserved for later */ | ||
510 | unsigned long reserved_misc_stat4 PACKED; /* reserved for later */ | ||
511 | |||
512 | } CHDLC_OPERATIONAL_STATS_STRUCT; | ||
513 | |||
514 | |||
515 | |||
516 | /* ---------------------------------------------------------------------------- | ||
517 | * Constants for using application interrupts | ||
518 | * --------------------------------------------------------------------------*/ | ||
519 | |||
520 | /* the structure used for the SET_CHDLC_INTERRUPT_TRIGGERS/READ_CHDLC_INTERRUPT_TRIGGERS command */ | ||
521 | typedef struct { | ||
522 | unsigned char CHDLC_interrupt_triggers PACKED; /* CHDLC interrupt trigger configuration */ | ||
523 | unsigned char IRQ PACKED; /* IRQ to be used */ | ||
524 | unsigned short interrupt_timer PACKED; /* interrupt timer */ | ||
525 | unsigned short misc_interrupt_bits PACKED; /* miscellaneous bits */ | ||
526 | } CHDLC_INT_TRIGGERS_STRUCT; | ||
527 | |||
528 | /* 'CHDLC_interrupt_triggers' bit settings */ | ||
529 | #define APP_INT_ON_RX_FRAME 0x01 /* interrupt on Data frame reception */ | ||
530 | #define APP_INT_ON_TX_FRAME 0x02 /* interrupt when an Data frame may be transmitted */ | ||
531 | #define APP_INT_ON_COMMAND_COMPLETE 0x04 /* interrupt when an interface command is complete */ | ||
532 | #define APP_INT_ON_TIMER 0x08 /* interrupt on a defined millisecond timeout */ | ||
533 | #define APP_INT_ON_GLOBAL_EXCEP_COND 0x10 /* interrupt on a global exception condition */ | ||
534 | #define APP_INT_ON_CHDLC_EXCEP_COND 0x20 /* interrupt on an CHDLC exception condition */ | ||
535 | #define APP_INT_ON_TRACE_DATA_AVAIL 0x80 /* interrupt when trace data is available */ | ||
536 | |||
537 | /* interrupt types indicated at 'interrupt_type' byte of the INTERRUPT_INFORMATION_STRUCT */ | ||
538 | #define NO_APP_INTS_PEND 0x00 /* no interrups are pending */ | ||
539 | #define RX_APP_INT_PEND 0x01 /* a receive interrupt is pending */ | ||
540 | #define TX_APP_INT_PEND 0x02 /* a transmit interrupt is pending */ | ||
541 | #define COMMAND_COMPLETE_APP_INT_PEND 0x04 /* a 'command complete' interrupt is pending */ | ||
542 | #define TIMER_APP_INT_PEND 0x08 /* a timer interrupt is pending */ | ||
543 | #define GLOBAL_EXCEP_COND_APP_INT_PEND 0x10 /* a global exception condition interrupt is pending */ | ||
544 | #define CHDLC_EXCEP_COND_APP_INT_PEND 0x20 /* an CHDLC exception condition interrupt is pending */ | ||
545 | #define TRACE_DATA_AVAIL_APP_INT_PEND 0x80 /* a trace data available interrupt is pending */ | ||
546 | |||
547 | |||
548 | /* modem status changes */ | ||
549 | #define DCD_HIGH 0x08 | ||
550 | #define CTS_HIGH 0x20 | ||
551 | |||
552 | |||
553 | /* ---------------------------------------------------------------------------- | ||
554 | * Constants for Data frame transmission | ||
555 | * --------------------------------------------------------------------------*/ | ||
556 | |||
557 | /* the Data frame transmit status element configuration structure */ | ||
558 | typedef struct { | ||
559 | unsigned short number_Tx_status_elements PACKED; /* number of transmit status elements */ | ||
560 | unsigned long base_addr_Tx_status_elements PACKED; /* base address of the transmit element list */ | ||
561 | unsigned long next_Tx_status_element_to_use PACKED; /* pointer to the next transmit element to be used */ | ||
562 | } CHDLC_TX_STATUS_EL_CFG_STRUCT; | ||
563 | |||
564 | /* the Data frame transmit status element structure */ | ||
565 | typedef struct { | ||
566 | unsigned char opp_flag PACKED; /* opp flag */ | ||
567 | unsigned short frame_length PACKED; /* length of the frame to be transmitted */ | ||
568 | unsigned char reserved_1 PACKED; /* reserved for internal use */ | ||
569 | unsigned long reserved_2 PACKED; /* reserved for internal use */ | ||
570 | unsigned long reserved_3 PACKED; /* reserved for internal use */ | ||
571 | unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ | ||
572 | } CHDLC_DATA_TX_STATUS_EL_STRUCT; | ||
573 | |||
574 | |||
575 | |||
576 | /* ---------------------------------------------------------------------------- | ||
577 | * Constants for Data frame reception | ||
578 | * --------------------------------------------------------------------------*/ | ||
579 | |||
580 | /* the Data frame receive status element configuration structure */ | ||
581 | typedef struct { | ||
582 | unsigned short number_Rx_status_elements PACKED; /* number of receive status elements */ | ||
583 | unsigned long base_addr_Rx_status_elements PACKED; /* base address of the receive element list */ | ||
584 | unsigned long next_Rx_status_element_to_use PACKED; /* pointer to the next receive element to be used */ | ||
585 | unsigned long base_addr_Rx_buffer PACKED; /* base address of the receive data buffer */ | ||
586 | unsigned long end_addr_Rx_buffer PACKED; /* end address of the receive data buffer */ | ||
587 | } CHDLC_RX_STATUS_EL_CFG_STRUCT; | ||
588 | |||
589 | /* the Data frame receive status element structure */ | ||
590 | typedef struct { | ||
591 | unsigned char opp_flag PACKED; /* opp flag */ | ||
592 | unsigned short frame_length PACKED; /* length of the received frame */ | ||
593 | unsigned char error_flag PACKED; /* frame errors (HDLC_STREAMING_MODE)*/ | ||
594 | unsigned short time_stamp PACKED; /* receive time stamp (HDLC_STREAMING_MODE) */ | ||
595 | unsigned long reserved_1 PACKED; /* reserved for internal use */ | ||
596 | unsigned short reserved_2 PACKED; /* reserved for internal use */ | ||
597 | unsigned long ptr_data_bfr PACKED; /* pointer to the data area */ | ||
598 | } CHDLC_DATA_RX_STATUS_EL_STRUCT; | ||
599 | |||
600 | |||
601 | |||
602 | /* ---------------------------------------------------------------------------- | ||
603 | * Constants defining the shared memory information area | ||
604 | * --------------------------------------------------------------------------*/ | ||
605 | |||
606 | /* the global information structure */ | ||
607 | typedef struct { | ||
608 | unsigned char global_status PACKED; /* global status */ | ||
609 | unsigned char modem_status PACKED; /* current modem status */ | ||
610 | unsigned char global_excep_conditions PACKED; /* global exception conditions */ | ||
611 | unsigned char glob_info_reserved[5] PACKED; /* reserved */ | ||
612 | unsigned char codename[4] PACKED; /* Firmware name */ | ||
613 | unsigned char codeversion[4] PACKED; /* Firmware version */ | ||
614 | } GLOBAL_INFORMATION_STRUCT; | ||
615 | |||
616 | /* the CHDLC information structure */ | ||
617 | typedef struct { | ||
618 | unsigned char CHDLC_status PACKED; /* CHDLC status */ | ||
619 | unsigned char CHDLC_excep_conditions PACKED; /* CHDLC exception conditions */ | ||
620 | unsigned char CHDLC_info_reserved[14] PACKED; /* reserved */ | ||
621 | } CHDLC_INFORMATION_STRUCT; | ||
622 | |||
623 | /* the interrupt information structure */ | ||
624 | typedef struct { | ||
625 | unsigned char interrupt_type PACKED; /* type of interrupt triggered */ | ||
626 | unsigned char interrupt_permission PACKED; /* interrupt permission mask */ | ||
627 | unsigned char int_info_reserved[14] PACKED; /* reserved */ | ||
628 | } INTERRUPT_INFORMATION_STRUCT; | ||
629 | |||
630 | /* the S508/FT1 information structure */ | ||
631 | typedef struct { | ||
632 | unsigned char parallel_port_A_input PACKED; /* input - parallel port A */ | ||
633 | unsigned char parallel_port_B_input PACKED; /* input - parallel port B */ | ||
634 | unsigned char FT1_info_reserved[14] PACKED; /* reserved */ | ||
635 | } FT1_INFORMATION_STRUCT; | ||
636 | |||
637 | /* the shared memory area information structure */ | ||
638 | typedef struct { | ||
639 | GLOBAL_INFORMATION_STRUCT global_info_struct PACKED; /* the global information structure */ | ||
640 | CHDLC_INFORMATION_STRUCT CHDLC_info_struct PACKED; /* the CHDLC information structure */ | ||
641 | INTERRUPT_INFORMATION_STRUCT interrupt_info_struct PACKED; /* the interrupt information structure */ | ||
642 | FT1_INFORMATION_STRUCT FT1_info_struct PACKED; /* the S508/FT1 information structure */ | ||
643 | } SHARED_MEMORY_INFO_STRUCT; | ||
644 | |||
645 | /* ---------------------------------------------------------------------------- | ||
646 | * UDP Management constants and structures | ||
647 | * --------------------------------------------------------------------------*/ | ||
648 | |||
649 | /* The embedded control block for UDP mgmt | ||
650 | This is essentially a mailbox structure, without the large data field */ | ||
651 | |||
652 | typedef struct { | ||
653 | unsigned char opp_flag PACKED; /* the opp flag */ | ||
654 | unsigned char command PACKED; /* the user command */ | ||
655 | unsigned short buffer_length PACKED; /* the data length */ | ||
656 | unsigned char return_code PACKED; /* the return code */ | ||
657 | unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; /* reserved for later */ | ||
658 | } cblock_t; | ||
659 | |||
660 | |||
661 | /* UDP management packet layout (data area of ip packet) */ | ||
662 | /* | ||
663 | typedef struct { | ||
664 | unsigned char signature[8] PACKED; | ||
665 | unsigned char request_reply PACKED; | ||
666 | unsigned char id PACKED; | ||
667 | unsigned char reserved[6] PACKED; | ||
668 | cblock_t cblock PACKED; | ||
669 | unsigned char num_frames PACKED; | ||
670 | unsigned char ismoredata PACKED; | ||
671 | unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; | ||
672 | } udp_management_packet_t; | ||
673 | |||
674 | */ | ||
675 | |||
676 | typedef struct { | ||
677 | unsigned char num_frames PACKED; | ||
678 | unsigned char ismoredata PACKED; | ||
679 | } trace_info_t; | ||
680 | |||
681 | typedef struct { | ||
682 | ip_pkt_t ip_pkt PACKED; | ||
683 | udp_pkt_t udp_pkt PACKED; | ||
684 | wp_mgmt_t wp_mgmt PACKED; | ||
685 | cblock_t cblock PACKED; | ||
686 | trace_info_t trace_info PACKED; | ||
687 | unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; | ||
688 | } chdlc_udp_pkt_t; | ||
689 | |||
690 | typedef struct ft1_exec_cmd{ | ||
691 | unsigned char command PACKED; /* the user command */ | ||
692 | unsigned short buffer_length PACKED; /* the data length */ | ||
693 | unsigned char return_code PACKED; /* the return code */ | ||
694 | unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; | ||
695 | } ft1_exec_cmd_t; | ||
696 | |||
697 | typedef struct { | ||
698 | unsigned char opp_flag PACKED; | ||
699 | ft1_exec_cmd_t cmd PACKED; | ||
700 | unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; | ||
701 | } ft1_exec_t; | ||
702 | |||
703 | #define UDPMGMT_SIGNATURE "CTPIPEAB" | ||
704 | |||
705 | |||
706 | /* UDP/IP packet (for UDP management) layout */ | ||
707 | /* | ||
708 | typedef struct { | ||
709 | unsigned char reserved[2] PACKED; | ||
710 | unsigned short ip_length PACKED; | ||
711 | unsigned char reserved2[4] PACKED; | ||
712 | unsigned char ip_ttl PACKED; | ||
713 | unsigned char ip_protocol PACKED; | ||
714 | unsigned short ip_checksum PACKED; | ||
715 | unsigned long ip_src_address PACKED; | ||
716 | unsigned long ip_dst_address PACKED; | ||
717 | unsigned short udp_src_port PACKED; | ||
718 | unsigned short udp_dst_port PACKED; | ||
719 | unsigned short udp_length PACKED; | ||
720 | unsigned short udp_checksum PACKED; | ||
721 | udp_management_packet_t um_packet PACKED; | ||
722 | } ip_packet_t; | ||
723 | */ | ||
724 | |||
725 | /* valid ip_protocol for UDP management */ | ||
726 | #define UDPMGMT_UDP_PROTOCOL 0x11 | ||
727 | |||
728 | |||
729 | typedef struct { | ||
730 | unsigned char status PACKED; | ||
731 | unsigned char data_avail PACKED; | ||
732 | unsigned short real_length PACKED; | ||
733 | unsigned short time_stamp PACKED; | ||
734 | unsigned char data[1] PACKED; | ||
735 | } trace_pkt_t; | ||
736 | |||
737 | typedef struct { | ||
738 | unsigned char error_flag PACKED; | ||
739 | unsigned short time_stamp PACKED; | ||
740 | unsigned char reserved[13] PACKED; | ||
741 | } api_rx_hdr_t; | ||
742 | |||
743 | typedef struct { | ||
744 | api_rx_hdr_t api_rx_hdr PACKED; | ||
745 | void * data PACKED; | ||
746 | } api_rx_element_t; | ||
747 | |||
748 | typedef struct { | ||
749 | unsigned char attr PACKED; | ||
750 | unsigned char reserved[15] PACKED; | ||
751 | } api_tx_hdr_t; | ||
752 | |||
753 | typedef struct { | ||
754 | api_tx_hdr_t api_tx_hdr PACKED; | ||
755 | void * data PACKED; | ||
756 | } api_tx_element_t; | ||
757 | |||
758 | /* ---------------------------------------------------------------------------- | ||
759 | * Constants for the SET_FT1_CONFIGURATION/READ_FT1_CONFIGURATION command | ||
760 | * --------------------------------------------------------------------------*/ | ||
761 | |||
762 | /* the FT1 configuration structure */ | ||
763 | typedef struct { | ||
764 | unsigned short framing_mode; | ||
765 | unsigned short encoding_mode; | ||
766 | unsigned short line_build_out; | ||
767 | unsigned short channel_base; | ||
768 | unsigned short baud_rate_kbps; /* the baud rate (in kbps) */ | ||
769 | unsigned short clock_mode; | ||
770 | } ft1_config_t; | ||
771 | |||
772 | /* settings for the 'framing_mode' */ | ||
773 | #define ESF_FRAMING 0x00 /* ESF framing */ | ||
774 | #define D4_FRAMING 0x01 /* D4 framing */ | ||
775 | |||
776 | /* settings for the 'encoding_mode' */ | ||
777 | #define B8ZS_ENCODING 0x00 /* B8ZS encoding */ | ||
778 | #define AMI_ENCODING 0x01 /* AMI encoding */ | ||
779 | |||
780 | /* settings for the 'line_build_out' */ | ||
781 | #define LN_BLD_CSU_0dB_DSX1_0_to_133 0x00 /* set build out to CSU (0db) or DSX-1 (0-133ft) */ | ||
782 | #define LN_BLD_DSX1_133_to_266 0x01 /* set build out DSX-1 (133-266ft) */ | ||
783 | #define LN_BLD_DSX1_266_to_399 0x02 /* set build out DSX-1 (266-399ft) */ | ||
784 | #define LN_BLD_DSX1_399_to_533 0x03 /* set build out DSX-1 (399-533ft) */ | ||
785 | #define LN_BLD_DSX1_533_to_655 0x04 /* set build out DSX-1 (533-655ft) */ | ||
786 | #define LN_BLD_CSU_NEG_7dB 0x05 /* set build out to CSU (-7.5db) */ | ||
787 | #define LN_BLD_CSU_NEG_15dB 0x06 /* set build out to CSU (-15db) */ | ||
788 | #define LN_BLD_CSU_NEG_22dB 0x07 /* set build out to CSU (-22.5db) */ | ||
789 | |||
790 | /* settings for the 'channel_base' */ | ||
791 | #define MIN_CHANNEL_BASE_VALUE 1 /* the minimum permitted channel base value */ | ||
792 | #define MAX_CHANNEL_BASE_VALUE 24 /* the maximum permitted channel base value */ | ||
793 | |||
794 | /* settings for the 'baud_rate_kbps' */ | ||
795 | #define MIN_BAUD_RATE_KBPS 0 /* the minimum permitted baud rate (kbps) */ | ||
796 | #define MAX_BAUD_RATE_KBPS 1536 /* the maximum permitted baud rate (kbps) */ | ||
797 | #define BAUD_RATE_FT1_AUTO_CONFIG 0xFFFF /* the baud rate used to trigger an automatic FT1 configuration */ | ||
798 | |||
799 | /* settings for the 'clock_mode' */ | ||
800 | #define CLOCK_MODE_NORMAL 0x00 /* clock mode set to normal (slave) */ | ||
801 | #define CLOCK_MODE_MASTER 0x01 /* clock mode set to master */ | ||
802 | |||
803 | |||
804 | #define BAUD_RATE_FT1_AUTO_CONFIG 0xFFFF | ||
805 | #define AUTO_FT1_CONFIG_NOT_COMPLETE 0x08 | ||
806 | #define AUTO_FT1_CFG_FAIL_OP_MODE 0x0C | ||
807 | #define AUTO_FT1_CFG_FAIL_INVALID_LINE 0x0D | ||
808 | |||
809 | |||
810 | #ifdef _MSC_ | ||
811 | # pragma pack() | ||
812 | #endif | ||
813 | #endif /* _SDLA_CHDLC_H */ | ||
diff --git a/include/linux/sdla_ppp.h b/include/linux/sdla_ppp.h deleted file mode 100644 index 6f3923179c..0000000000 --- a/include/linux/sdla_ppp.h +++ /dev/null | |||
@@ -1,575 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdla_ppp.h Sangoma PPP firmware API definitions. | ||
3 | * | ||
4 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
5 | * | ||
6 | * Copyright: (c) 1995-1997 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * Feb 24, 2000 Nenad Corbic v2.1.2 | ||
14 | * Jan 06, 1997 Gene Kozin v2.0 | ||
15 | * Apr 11, 1996 Gene Kozin Initial version. | ||
16 | *****************************************************************************/ | ||
17 | #ifndef _SDLA_PPP_H | ||
18 | #define _SDLA_PPP_H | ||
19 | |||
20 | /*---------------------------------------------------------------------------- | ||
21 | * Notes: | ||
22 | * ------ | ||
23 | * 1. All structures defined in this file are byte-alined. | ||
24 | * | ||
25 | * Compiler Platform | ||
26 | * -------- -------- | ||
27 | * GNU C Linux | ||
28 | */ | ||
29 | |||
30 | #ifndef PACKED | ||
31 | # define PACKED __attribute__((packed)) | ||
32 | #endif /* PACKED */ | ||
33 | |||
34 | /* Adapter memory layout and important constants */ | ||
35 | #define PPP508_MB_VECT 0xE000 /* mailbox window vector */ | ||
36 | #define PPP508_MB_OFFS 0 /* mailbox offset */ | ||
37 | #define PPP508_FLG_OFFS 0x1000 /* status flags offset */ | ||
38 | #define PPP508_BUF_OFFS 0x1100 /* buffer info block offset */ | ||
39 | #define PPP514_MB_OFFS 0xE000 /* mailbox offset */ | ||
40 | #define PPP514_FLG_OFFS 0xF000 /* status flags offset */ | ||
41 | #define PPP514_BUF_OFFS 0xF100 /* buffer info block offset */ | ||
42 | |||
43 | #define PPP_MAX_DATA 1008 /* command block data buffer length */ | ||
44 | |||
45 | /****** Data Structures *****************************************************/ | ||
46 | |||
47 | /*---------------------------------------------------------------------------- | ||
48 | * PPP Command Block. | ||
49 | */ | ||
50 | typedef struct ppp_cmd{ | ||
51 | unsigned char command PACKED; /* command code */ | ||
52 | unsigned short length PACKED; /* length of data buffer */ | ||
53 | unsigned char result PACKED; /* return code */ | ||
54 | unsigned char rsrv[11] PACKED; /* reserved for future use */ | ||
55 | } ppp_cmd_t; | ||
56 | |||
57 | typedef struct cblock{ | ||
58 | unsigned char opp_flag PACKED; | ||
59 | unsigned char command PACKED; /* command code */ | ||
60 | unsigned short length PACKED; /* length of data buffer */ | ||
61 | unsigned char result PACKED; /* return code */ | ||
62 | unsigned char rsrv[11] PACKED; /* reserved for future use */ | ||
63 | } cblock_t; | ||
64 | |||
65 | typedef struct ppp_udp_pkt{ | ||
66 | ip_pkt_t ip_pkt PACKED; | ||
67 | udp_pkt_t udp_pkt PACKED; | ||
68 | wp_mgmt_t wp_mgmt PACKED; | ||
69 | cblock_t cblock PACKED; | ||
70 | unsigned char data[MAX_LGTH_UDP_MGNT_PKT] PACKED; | ||
71 | } ppp_udp_pkt_t; | ||
72 | |||
73 | typedef struct { | ||
74 | unsigned char status PACKED; | ||
75 | unsigned char data_avail PACKED; | ||
76 | unsigned short real_length PACKED; | ||
77 | unsigned short time_stamp PACKED; | ||
78 | unsigned char data[1] PACKED; | ||
79 | } trace_pkt_t; | ||
80 | |||
81 | |||
82 | typedef struct { | ||
83 | unsigned char opp_flag PACKED; | ||
84 | unsigned char trace_type PACKED; | ||
85 | unsigned short trace_length PACKED; | ||
86 | unsigned short trace_data_ptr PACKED; | ||
87 | unsigned short trace_time_stamp PACKED; | ||
88 | } trace_element_t; | ||
89 | |||
90 | /* 'command' field defines */ | ||
91 | #define PPP_READ_CODE_VERSION 0x10 /* configuration commands */ | ||
92 | #define PPP_SET_CONFIG 0x05 | ||
93 | #define PPP_READ_CONFIG 0x06 | ||
94 | #define PPP_SET_INTR_FLAGS 0x20 | ||
95 | #define PPP_READ_INTR_FLAGS 0x21 | ||
96 | #define PPP_SET_INBOUND_AUTH 0x30 | ||
97 | #define PPP_SET_OUTBOUND_AUTH 0x31 | ||
98 | #define PPP_GET_CONNECTION_INFO 0x32 | ||
99 | |||
100 | #define PPP_COMM_ENABLE 0x03 /* operational commands */ | ||
101 | #define PPP_COMM_DISABLE 0x04 | ||
102 | #define PPP_SEND_SIGN_FRAME 0x23 | ||
103 | #define PPP_READ_SIGN_RESPONSE 0x24 | ||
104 | #define PPP_DATALINE_MONITOR 0x33 | ||
105 | |||
106 | #define PPP_READ_STATISTICS 0x07 /* statistics commands */ | ||
107 | #define PPP_FLUSH_STATISTICS 0x08 | ||
108 | #define PPP_READ_ERROR_STATS 0x09 | ||
109 | #define PPP_FLUSH_ERROR_STATS 0x0A | ||
110 | #define PPP_READ_PACKET_STATS 0x12 | ||
111 | #define PPP_FLUSH_PACKET_STATS 0x13 | ||
112 | #define PPP_READ_LCP_STATS 0x14 | ||
113 | #define PPP_FLUSH_LCP_STATS 0x15 | ||
114 | #define PPP_READ_LPBK_STATS 0x16 | ||
115 | #define PPP_FLUSH_LPBK_STATS 0x17 | ||
116 | #define PPP_READ_IPCP_STATS 0x18 | ||
117 | #define PPP_FLUSH_IPCP_STATS 0x19 | ||
118 | #define PPP_READ_IPXCP_STATS 0x1A | ||
119 | #define PPP_FLUSH_IPXCP_STATS 0x1B | ||
120 | #define PPP_READ_PAP_STATS 0x1C | ||
121 | #define PPP_FLUSH_PAP_STATS 0x1D | ||
122 | #define PPP_READ_CHAP_STATS 0x1E | ||
123 | #define PPP_FLUSH_CHAP_STATS 0x1F | ||
124 | |||
125 | /* 'result' field defines */ | ||
126 | #define PPPRES_OK 0x00 /* command executed successfully */ | ||
127 | #define PPPRES_INVALID_STATE 0x09 /* invalid command in this context */ | ||
128 | |||
129 | /*---------------------------------------------------------------------------- | ||
130 | * PPP Mailbox. | ||
131 | * This structure is located at offset PPP???_MB_OFFS into PPP???_MB_VECT | ||
132 | */ | ||
133 | typedef struct ppp_mbox | ||
134 | { | ||
135 | unsigned char flag PACKED; /* 00h: command execution flag */ | ||
136 | ppp_cmd_t cmd PACKED; /* 01h: command block */ | ||
137 | unsigned char data[1] PACKED; /* 10h: variable length data buffer */ | ||
138 | } ppp_mbox_t; | ||
139 | |||
140 | /*---------------------------------------------------------------------------- | ||
141 | * PPP Status Flags. | ||
142 | * This structure is located at offset PPP???_FLG_OFFS into | ||
143 | * PPP???_MB_VECT. | ||
144 | */ | ||
145 | typedef struct ppp_flags | ||
146 | { | ||
147 | unsigned char iflag PACKED; /* 00: interrupt flag */ | ||
148 | unsigned char imask PACKED; /* 01: interrupt mask */ | ||
149 | unsigned char resrv PACKED; | ||
150 | unsigned char mstatus PACKED; /* 03: modem status */ | ||
151 | unsigned char lcp_state PACKED; /* 04: LCP state */ | ||
152 | unsigned char ppp_phase PACKED; /* 05: PPP phase */ | ||
153 | unsigned char ip_state PACKED; /* 06: IPCP state */ | ||
154 | unsigned char ipx_state PACKED; /* 07: IPXCP state */ | ||
155 | unsigned char pap_state PACKED; /* 08: PAP state */ | ||
156 | unsigned char chap_state PACKED; /* 09: CHAP state */ | ||
157 | unsigned short disc_cause PACKED; /* 0A: disconnection cause */ | ||
158 | } ppp_flags_t; | ||
159 | |||
160 | /* 'iflag' defines */ | ||
161 | #define PPP_INTR_RXRDY 0x01 /* Rx ready */ | ||
162 | #define PPP_INTR_TXRDY 0x02 /* Tx ready */ | ||
163 | #define PPP_INTR_MODEM 0x04 /* modem status change (DCD, CTS) */ | ||
164 | #define PPP_INTR_CMD 0x08 /* interface command completed */ | ||
165 | #define PPP_INTR_DISC 0x10 /* data link disconnected */ | ||
166 | #define PPP_INTR_OPEN 0x20 /* data link open */ | ||
167 | #define PPP_INTR_DROP_DTR 0x40 /* DTR drop timeout expired */ | ||
168 | #define PPP_INTR_TIMER 0x80 /* timer interrupt */ | ||
169 | |||
170 | |||
171 | /* 'mstatus' defines */ | ||
172 | #define PPP_MDM_DCD 0x08 /* mdm_status: DCD */ | ||
173 | #define PPP_MDM_CTS 0x20 /* mdm_status: CTS */ | ||
174 | |||
175 | /* 'disc_cause' defines */ | ||
176 | #define PPP_LOCAL_TERMINATION 0x0001 /* Local Request by PPP termination phase */ | ||
177 | #define PPP_DCD_CTS_DROP 0x0002 /* DCD and/or CTS dropped. Link down */ | ||
178 | #define PPP_REMOTE_TERMINATION 0x0800 /* Remote Request by PPP termination phase */ | ||
179 | |||
180 | /* 'misc_config_bits' defines */ | ||
181 | #define DONT_RE_TX_ABORTED_I_FRAMES 0x01 | ||
182 | #define TX_FRM_BYTE_COUNT_STATS 0x02 | ||
183 | #define RX_FRM_BYTE_COUNT_STATS 0x04 | ||
184 | #define TIME_STAMP_IN_RX_FRAMES 0x08 | ||
185 | #define NON_STD_ADPTR_FREQ 0x10 | ||
186 | #define INTERFACE_LEVEL_RS232 0x20 | ||
187 | #define AUTO_LINK_RECOVERY 0x100 | ||
188 | #define DONT_TERMINATE_LNK_MAX_CONFIG 0x200 | ||
189 | |||
190 | /* 'authentication options' defines */ | ||
191 | #define NO_AUTHENTICATION 0x00 | ||
192 | #define INBOUND_AUTH 0x80 | ||
193 | #define PAP_AUTH 0x01 | ||
194 | #define CHAP_AUTH 0x02 | ||
195 | |||
196 | /* 'ip options' defines */ | ||
197 | #define L_AND_R_IP_NO_ASSIG 0x00 | ||
198 | #define L_IP_LOCAL_ASSIG 0x01 | ||
199 | #define L_IP_REMOTE_ASSIG 0x02 | ||
200 | #define R_IP_LOCAL_ASSIG 0x04 | ||
201 | #define R_IP_REMOTE_ASSIG 0x08 | ||
202 | #define ENABLE_IP 0x80 | ||
203 | |||
204 | /* 'ipx options' defines */ | ||
205 | #define ROUTING_PROT_DEFAULT 0x20 | ||
206 | #define ENABLE_IPX 0x80 | ||
207 | #define DISABLE_IPX 0x00 | ||
208 | |||
209 | /*---------------------------------------------------------------------------- | ||
210 | * PPP Buffer Info. | ||
211 | * This structure is located at offset PPP508_BUF_OFFS into | ||
212 | * PPP508_MB_VECT. | ||
213 | */ | ||
214 | typedef struct ppp508_buf_info | ||
215 | { | ||
216 | unsigned short txb_num PACKED; /* 00: number of transmit buffers */ | ||
217 | unsigned long txb_ptr PACKED; /* 02: pointer to the buffer ctl. */ | ||
218 | unsigned long txb_nxt PACKED; | ||
219 | unsigned char rsrv1[22] PACKED; | ||
220 | unsigned short rxb_num PACKED; /* 20: number of receive buffers */ | ||
221 | unsigned long rxb_ptr PACKED; /* 22: pointer to the buffer ctl. */ | ||
222 | unsigned long rxb1_ptr PACKED; /* 26: pointer to the first buf.ctl. */ | ||
223 | unsigned long rxb_base PACKED; /* 2A: pointer to the buffer base */ | ||
224 | unsigned char rsrv2[2] PACKED; | ||
225 | unsigned long rxb_end PACKED; /* 30: pointer to the buffer end */ | ||
226 | } ppp508_buf_info_t; | ||
227 | |||
228 | /*---------------------------------------------------------------------------- | ||
229 | * Transmit/Receive Buffer Control Block. | ||
230 | */ | ||
231 | typedef struct ppp_buf_ctl | ||
232 | { | ||
233 | unsigned char flag PACKED; /* 00: 'buffer ready' flag */ | ||
234 | unsigned short length PACKED; /* 01: length of data */ | ||
235 | unsigned char reserved1[1] PACKED; /* 03: */ | ||
236 | unsigned char proto PACKED; /* 04: protocol */ | ||
237 | unsigned short timestamp PACKED; /* 05: time stamp (Rx only) */ | ||
238 | unsigned char reserved2[5] PACKED; /* 07: */ | ||
239 | union | ||
240 | { | ||
241 | unsigned short o_p[2]; /* 1C: buffer offset & page (S502) */ | ||
242 | unsigned long ptr; /* 1C: buffer pointer (S508) */ | ||
243 | } buf PACKED; | ||
244 | } ppp_buf_ctl_t; | ||
245 | |||
246 | /*---------------------------------------------------------------------------- | ||
247 | * S508 Adapter Configuration Block (passed to the PPP_SET_CONFIG command). | ||
248 | */ | ||
249 | typedef struct ppp508_conf | ||
250 | { | ||
251 | unsigned long line_speed PACKED; /* 00: baud rate, bps */ | ||
252 | unsigned short txbuf_percent PACKED; /* 04: % of Tx buffer */ | ||
253 | unsigned short conf_flags PACKED; /* 06: configuration bits */ | ||
254 | unsigned short mtu_local PACKED; /* 08: local MTU */ | ||
255 | unsigned short mtu_remote PACKED; /* 0A: remote MTU */ | ||
256 | unsigned short restart_tmr PACKED; /* 0C: restart timer */ | ||
257 | unsigned short auth_rsrt_tmr PACKED; /* 0E: authentication timer */ | ||
258 | unsigned short auth_wait_tmr PACKED; /* 10: authentication timer */ | ||
259 | unsigned short mdm_fail_tmr PACKED; /* 12: modem failure timer */ | ||
260 | unsigned short dtr_drop_tmr PACKED; /* 14: DTR drop timer */ | ||
261 | unsigned short connect_tmout PACKED; /* 16: connection timeout */ | ||
262 | unsigned short conf_retry PACKED; /* 18: max. retry */ | ||
263 | unsigned short term_retry PACKED; /* 1A: max. retry */ | ||
264 | unsigned short fail_retry PACKED; /* 1C: max. retry */ | ||
265 | unsigned short auth_retry PACKED; /* 1E: max. retry */ | ||
266 | unsigned char auth_options PACKED; /* 20: authentication opt. */ | ||
267 | unsigned char ip_options PACKED; /* 21: IP options */ | ||
268 | unsigned long ip_local PACKED; /* 22: local IP address */ | ||
269 | unsigned long ip_remote PACKED; /* 26: remote IP address */ | ||
270 | unsigned char ipx_options PACKED; /* 2A: IPX options */ | ||
271 | unsigned char ipx_netno[4] PACKED; /* 2B: IPX net number */ | ||
272 | unsigned char ipx_local[6] PACKED; /* 2F: local IPX node number*/ | ||
273 | unsigned char ipx_remote[6] PACKED; /* 35: remote IPX node num.*/ | ||
274 | unsigned char ipx_router[48] PACKED; /* 3B: IPX router name*/ | ||
275 | unsigned long alt_cpu_clock PACKED; /* 6B: */ | ||
276 | } ppp508_conf_t; | ||
277 | |||
278 | /*---------------------------------------------------------------------------- | ||
279 | * S508 Adapter Read Connection Information Block | ||
280 | * Returned by the PPP_GET_CONNECTION_INFO command | ||
281 | */ | ||
282 | typedef struct ppp508_connect_info | ||
283 | { | ||
284 | unsigned short mru PACKED; /* 00-01 Remote Max Rec' Unit */ | ||
285 | unsigned char ip_options PACKED; /* 02: Negotiated ip options */ | ||
286 | unsigned long ip_local PACKED; /* 03-06: local IP address */ | ||
287 | unsigned long ip_remote PACKED; /* 07-0A: remote IP address */ | ||
288 | unsigned char ipx_options PACKED; /* 0B: Negotiated ipx options */ | ||
289 | unsigned char ipx_netno[4] PACKED; /* 0C-0F: IPX net number */ | ||
290 | unsigned char ipx_local[6] PACKED; /* 10-1F: local IPX node # */ | ||
291 | unsigned char ipx_remote[6] PACKED; /* 16-1B: remote IPX node # */ | ||
292 | unsigned char ipx_router[48] PACKED; /* 1C-4B: IPX router name */ | ||
293 | unsigned char auth_status PACKED; /* 4C: Authentication Status */ | ||
294 | unsigned char inbd_auth_peerID[1] PACKED; /* 4D: variable length inbound authenticated peer ID */ | ||
295 | } ppp508_connect_info_t; | ||
296 | |||
297 | /* 'line_speed' field */ | ||
298 | #define PPP_BITRATE_1200 0x01 | ||
299 | #define PPP_BITRATE_2400 0x02 | ||
300 | #define PPP_BITRATE_4800 0x03 | ||
301 | #define PPP_BITRATE_9600 0x04 | ||
302 | #define PPP_BITRATE_19200 0x05 | ||
303 | #define PPP_BITRATE_38400 0x06 | ||
304 | #define PPP_BITRATE_45000 0x07 | ||
305 | #define PPP_BITRATE_56000 0x08 | ||
306 | #define PPP_BITRATE_64000 0x09 | ||
307 | #define PPP_BITRATE_74000 0x0A | ||
308 | #define PPP_BITRATE_112000 0x0B | ||
309 | #define PPP_BITRATE_128000 0x0C | ||
310 | #define PPP_BITRATE_156000 0x0D | ||
311 | |||
312 | /* Defines for the 'conf_flags' field */ | ||
313 | #define PPP_IGNORE_TX_ABORT 0x01 /* don't re-transmit aborted frames */ | ||
314 | #define PPP_ENABLE_TX_STATS 0x02 /* enable Tx statistics */ | ||
315 | #define PPP_ENABLE_RX_STATS 0x04 /* enable Rx statistics */ | ||
316 | #define PPP_ENABLE_TIMESTAMP 0x08 /* enable timestamp */ | ||
317 | |||
318 | /* 'ip_options' defines */ | ||
319 | #define PPP_LOCAL_IP_LOCAL 0x01 | ||
320 | #define PPP_LOCAL_IP_REMOTE 0x02 | ||
321 | #define PPP_REMOTE_IP_LOCAL 0x04 | ||
322 | #define PPP_REMOTE_IP_REMOTE 0x08 | ||
323 | |||
324 | /* 'ipx_options' defines */ | ||
325 | #define PPP_REMOTE_IPX_NETNO 0x01 | ||
326 | #define PPP_REMOTE_IPX_LOCAL 0x02 | ||
327 | #define PPP_REMOTE_IPX_REMOTE 0x04 | ||
328 | #define PPP_IPX_ROUTE_RIP_SAP 0x08 | ||
329 | #define PPP_IPX_ROUTE_NLSP 0x10 | ||
330 | #define PPP_IPX_ROUTE_DEFAULT 0x20 | ||
331 | #define PPP_IPX_CONF_COMPLETE 0x40 | ||
332 | #define PPP_IPX_ENABLE 0x80 | ||
333 | |||
334 | /*---------------------------------------------------------------------------- | ||
335 | * S508 Adapter Configuration Block (returned by the PPP_READ_CONFIG command). | ||
336 | */ | ||
337 | typedef struct ppp508_get_conf | ||
338 | { | ||
339 | unsigned long bps PACKED; /* 00: baud rate, bps */ | ||
340 | ppp508_conf_t conf PACKED; /* 04: requested config. */ | ||
341 | unsigned short txb_num PACKED; /* 6F: number of Tx buffers */ | ||
342 | unsigned short rxb_num PACKED; /* 71: number of Rx buffers */ | ||
343 | } ppp508_get_conf_t; | ||
344 | |||
345 | /*---------------------------------------------------------------------------- | ||
346 | * S508 Operational Statistics (returned by the PPP_READ_STATISTIC command). | ||
347 | */ | ||
348 | typedef struct ppp508_stats | ||
349 | { | ||
350 | unsigned short reserved1 PACKED; /* 00: */ | ||
351 | unsigned short rx_bad_len PACKED; /* 02: */ | ||
352 | unsigned short reserved2 PACKED; /* 04: */ | ||
353 | unsigned long tx_frames PACKED; /* 06: */ | ||
354 | unsigned long tx_bytes PACKED; /* 0A: */ | ||
355 | unsigned long rx_frames PACKED; /* 0E: */ | ||
356 | unsigned long rx_bytes PACKED; /* 12: */ | ||
357 | } ppp508_stats_t; | ||
358 | |||
359 | /*---------------------------------------------------------------------------- | ||
360 | * Adapter Error Statistics (returned by the PPP_READ_ERROR_STATS command). | ||
361 | */ | ||
362 | typedef struct ppp_err_stats | ||
363 | { | ||
364 | unsigned char rx_overrun PACKED; /* 00: Rx overrun errors */ | ||
365 | unsigned char rx_bad_crc PACKED; /* 01: Rx CRC errors */ | ||
366 | unsigned char rx_abort PACKED; /* 02: Rx aborted frames */ | ||
367 | unsigned char rx_lost PACKED; /* 03: Rx frames lost */ | ||
368 | unsigned char tx_abort PACKED; /* 04: Tx aborted frames */ | ||
369 | unsigned char tx_underrun PACKED; /* 05: Tx underrun errors */ | ||
370 | unsigned char tx_missed_intr PACKED; /* 06: Tx underruns missed */ | ||
371 | unsigned char reserved PACKED; /* 07: Tx underruns missed */ | ||
372 | unsigned char dcd_trans PACKED; /* 08: DCD transitions */ | ||
373 | unsigned char cts_trans PACKED; /* 09: CTS transitions */ | ||
374 | } ppp_err_stats_t; | ||
375 | |||
376 | /*---------------------------------------------------------------------------- | ||
377 | * Packet Statistics (returned by the PPP_READ_PACKET_STATS command). | ||
378 | */ | ||
379 | typedef struct ppp_pkt_stats | ||
380 | { | ||
381 | unsigned short rx_bad_header PACKED; /* 00: */ | ||
382 | unsigned short rx_prot_unknwn PACKED; /* 02: */ | ||
383 | unsigned short rx_too_large PACKED; /* 04: */ | ||
384 | unsigned short rx_lcp PACKED; /* 06: */ | ||
385 | unsigned short tx_lcp PACKED; /* 08: */ | ||
386 | unsigned short rx_ipcp PACKED; /* 0A: */ | ||
387 | unsigned short tx_ipcp PACKED; /* 0C: */ | ||
388 | unsigned short rx_ipxcp PACKED; /* 0E: */ | ||
389 | unsigned short tx_ipxcp PACKED; /* 10: */ | ||
390 | unsigned short rx_pap PACKED; /* 12: */ | ||
391 | unsigned short tx_pap PACKED; /* 14: */ | ||
392 | unsigned short rx_chap PACKED; /* 16: */ | ||
393 | unsigned short tx_chap PACKED; /* 18: */ | ||
394 | unsigned short rx_lqr PACKED; /* 1A: */ | ||
395 | unsigned short tx_lqr PACKED; /* 1C: */ | ||
396 | unsigned short rx_ip PACKED; /* 1E: */ | ||
397 | unsigned short tx_ip PACKED; /* 20: */ | ||
398 | unsigned short rx_ipx PACKED; /* 22: */ | ||
399 | unsigned short tx_ipx PACKED; /* 24: */ | ||
400 | } ppp_pkt_stats_t; | ||
401 | |||
402 | /*---------------------------------------------------------------------------- | ||
403 | * LCP Statistics (returned by the PPP_READ_LCP_STATS command). | ||
404 | */ | ||
405 | typedef struct ppp_lcp_stats | ||
406 | { | ||
407 | unsigned short rx_unknown PACKED; /* 00: unknown LCP type */ | ||
408 | unsigned short rx_conf_rqst PACKED; /* 02: Configure-Request */ | ||
409 | unsigned short rx_conf_ack PACKED; /* 04: Configure-Ack */ | ||
410 | unsigned short rx_conf_nak PACKED; /* 06: Configure-Nak */ | ||
411 | unsigned short rx_conf_rej PACKED; /* 08: Configure-Reject */ | ||
412 | unsigned short rx_term_rqst PACKED; /* 0A: Terminate-Request */ | ||
413 | unsigned short rx_term_ack PACKED; /* 0C: Terminate-Ack */ | ||
414 | unsigned short rx_code_rej PACKED; /* 0E: Code-Reject */ | ||
415 | unsigned short rx_proto_rej PACKED; /* 10: Protocol-Reject */ | ||
416 | unsigned short rx_echo_rqst PACKED; /* 12: Echo-Request */ | ||
417 | unsigned short rx_echo_reply PACKED; /* 14: Echo-Reply */ | ||
418 | unsigned short rx_disc_rqst PACKED; /* 16: Discard-Request */ | ||
419 | unsigned short tx_conf_rqst PACKED; /* 18: Configure-Request */ | ||
420 | unsigned short tx_conf_ack PACKED; /* 1A: Configure-Ack */ | ||
421 | unsigned short tx_conf_nak PACKED; /* 1C: Configure-Nak */ | ||
422 | unsigned short tx_conf_rej PACKED; /* 1E: Configure-Reject */ | ||
423 | unsigned short tx_term_rqst PACKED; /* 20: Terminate-Request */ | ||
424 | unsigned short tx_term_ack PACKED; /* 22: Terminate-Ack */ | ||
425 | unsigned short tx_code_rej PACKED; /* 24: Code-Reject */ | ||
426 | unsigned short tx_proto_rej PACKED; /* 26: Protocol-Reject */ | ||
427 | unsigned short tx_echo_rqst PACKED; /* 28: Echo-Request */ | ||
428 | unsigned short tx_echo_reply PACKED; /* 2A: Echo-Reply */ | ||
429 | unsigned short tx_disc_rqst PACKED; /* 2E: Discard-Request */ | ||
430 | unsigned short rx_too_large PACKED; /* 30: packets too large */ | ||
431 | unsigned short rx_ack_inval PACKED; /* 32: invalid Conf-Ack */ | ||
432 | unsigned short rx_rej_inval PACKED; /* 34: invalid Conf-Reject */ | ||
433 | unsigned short rx_rej_badid PACKED; /* 36: Conf-Reject w/bad ID */ | ||
434 | } ppp_lcp_stats_t; | ||
435 | |||
436 | /*---------------------------------------------------------------------------- | ||
437 | * Loopback Error Statistics (returned by the PPP_READ_LPBK_STATS command). | ||
438 | */ | ||
439 | typedef struct ppp_lpbk_stats | ||
440 | { | ||
441 | unsigned short conf_magic PACKED; /* 00: */ | ||
442 | unsigned short loc_echo_rqst PACKED; /* 02: */ | ||
443 | unsigned short rem_echo_rqst PACKED; /* 04: */ | ||
444 | unsigned short loc_echo_reply PACKED; /* 06: */ | ||
445 | unsigned short rem_echo_reply PACKED; /* 08: */ | ||
446 | unsigned short loc_disc_rqst PACKED; /* 0A: */ | ||
447 | unsigned short rem_disc_rqst PACKED; /* 0C: */ | ||
448 | unsigned short echo_tx_collsn PACKED; /* 0E: */ | ||
449 | unsigned short echo_rx_collsn PACKED; /* 10: */ | ||
450 | } ppp_lpbk_stats_t; | ||
451 | |||
452 | /*---------------------------------------------------------------------------- | ||
453 | * Protocol Statistics (returned by the PPP_READ_IPCP_STATS and | ||
454 | * PPP_READ_IPXCP_STATS commands). | ||
455 | */ | ||
456 | typedef struct ppp_prot_stats | ||
457 | { | ||
458 | unsigned short rx_unknown PACKED; /* 00: unknown type */ | ||
459 | unsigned short rx_conf_rqst PACKED; /* 02: Configure-Request */ | ||
460 | unsigned short rx_conf_ack PACKED; /* 04: Configure-Ack */ | ||
461 | unsigned short rx_conf_nak PACKED; /* 06: Configure-Nak */ | ||
462 | unsigned short rx_conf_rej PACKED; /* 08: Configure-Reject */ | ||
463 | unsigned short rx_term_rqst PACKED; /* 0A: Terminate-Request */ | ||
464 | unsigned short rx_term_ack PACKED; /* 0C: Terminate-Ack */ | ||
465 | unsigned short rx_code_rej PACKED; /* 0E: Code-Reject */ | ||
466 | unsigned short reserved PACKED; /* 10: */ | ||
467 | unsigned short tx_conf_rqst PACKED; /* 12: Configure-Request */ | ||
468 | unsigned short tx_conf_ack PACKED; /* 14: Configure-Ack */ | ||
469 | unsigned short tx_conf_nak PACKED; /* 16: Configure-Nak */ | ||
470 | unsigned short tx_conf_rej PACKED; /* 18: Configure-Reject */ | ||
471 | unsigned short tx_term_rqst PACKED; /* 1A: Terminate-Request */ | ||
472 | unsigned short tx_term_ack PACKED; /* 1C: Terminate-Ack */ | ||
473 | unsigned short tx_code_rej PACKED; /* 1E: Code-Reject */ | ||
474 | unsigned short rx_too_large PACKED; /* 20: packets too large */ | ||
475 | unsigned short rx_ack_inval PACKED; /* 22: invalid Conf-Ack */ | ||
476 | unsigned short rx_rej_inval PACKED; /* 24: invalid Conf-Reject */ | ||
477 | unsigned short rx_rej_badid PACKED; /* 26: Conf-Reject w/bad ID */ | ||
478 | } ppp_prot_stats_t; | ||
479 | |||
480 | /*---------------------------------------------------------------------------- | ||
481 | * PAP Statistics (returned by the PPP_READ_PAP_STATS command). | ||
482 | */ | ||
483 | typedef struct ppp_pap_stats | ||
484 | { | ||
485 | unsigned short rx_unknown PACKED; /* 00: unknown type */ | ||
486 | unsigned short rx_auth_rqst PACKED; /* 02: Authenticate-Request */ | ||
487 | unsigned short rx_auth_ack PACKED; /* 04: Authenticate-Ack */ | ||
488 | unsigned short rx_auth_nak PACKED; /* 06: Authenticate-Nak */ | ||
489 | unsigned short reserved PACKED; /* 08: */ | ||
490 | unsigned short tx_auth_rqst PACKED; /* 0A: Authenticate-Request */ | ||
491 | unsigned short tx_auth_ack PACKED; /* 0C: Authenticate-Ack */ | ||
492 | unsigned short tx_auth_nak PACKED; /* 0E: Authenticate-Nak */ | ||
493 | unsigned short rx_too_large PACKED; /* 10: packets too large */ | ||
494 | unsigned short rx_bad_peerid PACKED; /* 12: invalid peer ID */ | ||
495 | unsigned short rx_bad_passwd PACKED; /* 14: invalid password */ | ||
496 | } ppp_pap_stats_t; | ||
497 | |||
498 | /*---------------------------------------------------------------------------- | ||
499 | * CHAP Statistics (returned by the PPP_READ_CHAP_STATS command). | ||
500 | */ | ||
501 | typedef struct ppp_chap_stats | ||
502 | { | ||
503 | unsigned short rx_unknown PACKED; /* 00: unknown type */ | ||
504 | unsigned short rx_challenge PACKED; /* 02: Authenticate-Request */ | ||
505 | unsigned short rx_response PACKED; /* 04: Authenticate-Ack */ | ||
506 | unsigned short rx_success PACKED; /* 06: Authenticate-Nak */ | ||
507 | unsigned short rx_failure PACKED; /* 08: Authenticate-Nak */ | ||
508 | unsigned short reserved PACKED; /* 0A: */ | ||
509 | unsigned short tx_challenge PACKED; /* 0C: Authenticate-Request */ | ||
510 | unsigned short tx_response PACKED; /* 0E: Authenticate-Ack */ | ||
511 | unsigned short tx_success PACKED; /* 10: Authenticate-Nak */ | ||
512 | unsigned short tx_failure PACKED; /* 12: Authenticate-Nak */ | ||
513 | unsigned short rx_too_large PACKED; /* 14: packets too large */ | ||
514 | unsigned short rx_bad_peerid PACKED; /* 16: invalid peer ID */ | ||
515 | unsigned short rx_bad_passwd PACKED; /* 18: invalid password */ | ||
516 | unsigned short rx_bad_md5 PACKED; /* 1A: invalid MD5 format */ | ||
517 | unsigned short rx_bad_resp PACKED; /* 1C: invalid response */ | ||
518 | } ppp_chap_stats_t; | ||
519 | |||
520 | /*---------------------------------------------------------------------------- | ||
521 | * Connection Information (returned by the PPP_GET_CONNECTION_INFO command). | ||
522 | */ | ||
523 | typedef struct ppp_conn_info | ||
524 | { | ||
525 | unsigned short remote_mru PACKED; /* 00: */ | ||
526 | unsigned char ip_options PACKED; /* 02: */ | ||
527 | unsigned char ip_local[4] PACKED; /* 03: */ | ||
528 | unsigned char ip_remote[4] PACKED; /* 07: */ | ||
529 | unsigned char ipx_options PACKED; /* 0B: */ | ||
530 | unsigned char ipx_network[4] PACKED; /* 0C: */ | ||
531 | unsigned char ipx_local[6] PACKED; /* 10: */ | ||
532 | unsigned char ipx_remote[6] PACKED; /* 16: */ | ||
533 | unsigned char ipx_router[48] PACKED; /* 1C: */ | ||
534 | unsigned char auth_status PACKED; /* 4C: */ | ||
535 | unsigned char peer_id[0] PACKED; /* 4D: */ | ||
536 | } ppp_conn_info_t; | ||
537 | |||
538 | /* Data structure for SET_TRIGGER_INTR command | ||
539 | */ | ||
540 | |||
541 | typedef struct ppp_intr_info{ | ||
542 | unsigned char i_enable PACKED; /* 0 Interrupt enable bits */ | ||
543 | unsigned char irq PACKED; /* 1 Irq number */ | ||
544 | unsigned short timer_len PACKED; /* 2 Timer delay */ | ||
545 | } ppp_intr_info_t; | ||
546 | |||
547 | |||
548 | #define FT1_MONITOR_STATUS_CTRL 0x80 | ||
549 | #define SET_FT1_MODE 0x81 | ||
550 | |||
551 | |||
552 | |||
553 | /* Special UDP drivers management commands */ | ||
554 | #define PPIPE_ENABLE_TRACING 0x20 | ||
555 | #define PPIPE_DISABLE_TRACING 0x21 | ||
556 | #define PPIPE_GET_TRACE_INFO 0x22 | ||
557 | #define PPIPE_GET_IBA_DATA 0x23 | ||
558 | #define PPIPE_KILL_BOARD 0x24 | ||
559 | #define PPIPE_FT1_READ_STATUS 0x25 | ||
560 | #define PPIPE_DRIVER_STAT_IFSEND 0x26 | ||
561 | #define PPIPE_DRIVER_STAT_INTR 0x27 | ||
562 | #define PPIPE_DRIVER_STAT_GEN 0x28 | ||
563 | #define PPIPE_FLUSH_DRIVER_STATS 0x29 | ||
564 | #define PPIPE_ROUTER_UP_TIME 0x30 | ||
565 | |||
566 | #define DISABLE_TRACING 0x00 | ||
567 | #define TRACE_SIGNALLING_FRAMES 0x01 | ||
568 | #define TRACE_DATA_FRAMES 0x02 | ||
569 | |||
570 | |||
571 | |||
572 | #ifdef _MSC_ | ||
573 | # pragma pack() | ||
574 | #endif | ||
575 | #endif /* _SDLA_PPP_H */ | ||
diff --git a/include/linux/sdla_x25.h b/include/linux/sdla_x25.h deleted file mode 100644 index 57db980e27..0000000000 --- a/include/linux/sdla_x25.h +++ /dev/null | |||
@@ -1,772 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdla_x25.h Sangoma X.25 firmware API definitions. | ||
3 | * | ||
4 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
5 | * | ||
6 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * Feb 28, 2000 Nenad Corbic Updated for socket based x25api | ||
14 | * Dec 13, 1996 Gene Kozin Initial version | ||
15 | *****************************************************************************/ | ||
16 | #ifndef _SDLA_X25_H | ||
17 | #define _SDLA_X25_H | ||
18 | |||
19 | /*---------------------------------------------------------------------------- | ||
20 | * Notes: | ||
21 | * ------ | ||
22 | * 1. All structures defined in this file are byte-alined. | ||
23 | * Compiler Platform | ||
24 | * -------- -------- | ||
25 | * GNU C Linux | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | #ifndef PACKED | ||
30 | # define PACKED __attribute__((packed)) | ||
31 | #endif /* PACKED */ | ||
32 | |||
33 | /****** CONSTANTS DEFINITIONS ***********************************************/ | ||
34 | |||
35 | #define X25_MAX_CHAN 255 /* max number of open X.25 circuits */ | ||
36 | #define X25_MAX_DATA 1024 /* max length of X.25 data buffer */ | ||
37 | /* | ||
38 | * X.25 shared memory layout. | ||
39 | */ | ||
40 | #define X25_MBOX_OFFS 0x16B0 /* general mailbox block */ | ||
41 | #define X25_RXMBOX_OFFS 0x1AD0 /* receive mailbox */ | ||
42 | #define X25_STATUS_OFFS 0x1EF0 /* X.25 status structure */ | ||
43 | #define X25_MB_VECTOR 0xE000 /* S514 mailbox window vecotr */ | ||
44 | #define X25_MISC_HDLC_BITS 0x1F00 /*X.25 miscallaneous HDLC bits */ | ||
45 | |||
46 | /* code levels */ | ||
47 | #define HDLC_LEVEL 0x01 | ||
48 | #define X25_LEVEL 0x02 | ||
49 | #define X25_AND_HDLC_LEVEL 0x03 | ||
50 | #define DO_HDLC_LEVEL_ERROR_CHECKING 0x04 | ||
51 | |||
52 | /****** DATA STRUCTURES *****************************************************/ | ||
53 | |||
54 | /*---------------------------------------------------------------------------- | ||
55 | * X.25 Command Block. | ||
56 | */ | ||
57 | typedef struct X25Cmd | ||
58 | { | ||
59 | unsigned char command PACKED; /* command code */ | ||
60 | unsigned short length PACKED; /* transfer data length */ | ||
61 | unsigned char result PACKED; /* return code */ | ||
62 | unsigned char pf PACKED; /* P/F bit */ | ||
63 | unsigned short lcn PACKED; /* logical channel */ | ||
64 | unsigned char qdm PACKED; /* Q/D/M bits */ | ||
65 | unsigned char cause PACKED; /* cause field */ | ||
66 | unsigned char diagn PACKED; /* diagnostics */ | ||
67 | unsigned char pktType PACKED; /* packet type */ | ||
68 | unsigned char resrv[4] PACKED; /* reserved */ | ||
69 | } TX25Cmd; | ||
70 | |||
71 | /* | ||
72 | * Defines for the 'command' field. | ||
73 | */ | ||
74 | /*----- General commands --------------*/ | ||
75 | #define X25_SET_GLOBAL_VARS 0x0B /* set global variables */ | ||
76 | #define X25_READ_MODEM_STATUS 0x0C /* read modem status */ | ||
77 | #define X25_READ_CODE_VERSION 0x15 /* read firmware version number */ | ||
78 | #define X25_TRACE_CONFIGURE 0x14 /* configure trace facility */ | ||
79 | #define X25_READ_TRACE_DATA 0x16 /* read trace data */ | ||
80 | #define X25_SET_INTERRUPT_MODE 0x17 /* set interrupt generation mode */ | ||
81 | #define X25_READ_INTERRUPT_MODE 0x18 /* read interrupt generation mode */ | ||
82 | /*----- HDLC-level commands -----------*/ | ||
83 | #define X25_HDLC_LINK_CONFIGURE 0x01 /* configure HDLC link level */ | ||
84 | #define X25_HDLC_LINK_OPEN 0x02 /* open HDLC link */ | ||
85 | #define X25_HDLC_LINK_CLOSE 0x03 /* close HDLC link */ | ||
86 | #define X25_HDLC_LINK_SETUP 0x04 /* set up HDLC link */ | ||
87 | #define X25_HDLC_LINK_DISC 0x05 /* disconnect DHLC link */ | ||
88 | #define X25_HDLC_LINK_STATUS 0x06 /* read DHLC link status */ | ||
89 | #define X25_HDLC_READ_STATS 0x07 /* read operational statistics */ | ||
90 | #define X25_HDLC_FLUSH_STATS 0x08 /* flush operational statistics */ | ||
91 | #define X25_HDLC_READ_COMM_ERR 0x09 /* read error statistics */ | ||
92 | #define X25_HDLC_FLUSH_COMM_ERR 0x0A /* flush error statistics */ | ||
93 | #define X25_HDLC_FLUSH_BUFFERS 0x0D /* flush HDLC-level data buffers */ | ||
94 | #define X25_HDLC_SPRVS_CNT_STAT 0x0F /* read surervisory count status */ | ||
95 | #define X25_HDLC_SEND_UI_FRAME 0x10 /* send unnumbered information frame */ | ||
96 | #define X25_HDLC_WRITE 0x11 /* send HDLC information frame */ | ||
97 | #define X25_HDLC_READ 0x21 /* read HDLC information frame */ | ||
98 | #define X25_HDLC_READ_CONFIG 0x12 /* read HDLC configuration */ | ||
99 | #define X25_HDLC_SET_CONFIG 0x13 /* set HDLC configuration */ | ||
100 | #define SET_PROTOCOL_LEVEL 0x1F /* set protocol level */ | ||
101 | /*----- X.25-level commands -----------*/ | ||
102 | #define X25_READ 0x22 /* read X.25 packet */ | ||
103 | #define X25_WRITE 0x23 /* send X.25 packet */ | ||
104 | #define X25_PLACE_CALL 0x30 /* place a call on SVC */ | ||
105 | #define X25_ACCEPT_CALL 0x31 /* accept incomming call */ | ||
106 | #define X25_CLEAR_CALL 0x32 /* clear call */ | ||
107 | #define X25_CLEAR_CONFRM 0x33 /* send clear confirmation packet */ | ||
108 | #define X25_RESET 0x34 /* send reset request packet */ | ||
109 | #define X25_RESET_CONFRM 0x35 /* send reset confirmation packet */ | ||
110 | #define X25_RESTART 0x36 /* send restart request packet */ | ||
111 | #define X25_RESTART_CONFRM 0x37 /* send restart confirmation packet */ | ||
112 | #define X25_INTERRUPT 0x38 /* send interrupt request packet */ | ||
113 | #define X25_INTERRUPT_CONFRM 0x39 /* send interrupt confirmation pkt */ | ||
114 | #define X25_REGISTRATION_RQST 0x3A /* send registration request packet */ | ||
115 | #define X25_REGISTRATION_CONFRM 0x3B /* send registration confirmation */ | ||
116 | #define X25_IS_DATA_AVAILABLE 0x40 /* querry receive queue */ | ||
117 | #define X25_INCOMMING_CALL_CTL 0x41 /* select incomming call options */ | ||
118 | #define X25_CONFIGURE_PVC 0x42 /* configure PVC */ | ||
119 | #define X25_GET_ACTIVE_CHANNELS 0x43 /* get a list of active circuits */ | ||
120 | #define X25_READ_CHANNEL_CONFIG 0x44 /* read virt. circuit configuration */ | ||
121 | #define X25_FLUSH_DATA_BUFFERS 0x45 /* flush X.25-level data buffers */ | ||
122 | #define X25_READ_HISTORY_TABLE 0x46 /* read asynchronous event log */ | ||
123 | #define X25_HISTORY_TABLE_CTL 0x47 /* control asynchronous event log */ | ||
124 | #define X25_GET_TX_D_BIT_STATUS 0x48 /* is packet with D-bit acknowleged */ | ||
125 | #define X25_READ_STATISTICS 0x49 /* read X.25-level statistics */ | ||
126 | #define X25_FLUSH_STATISTICS 0x4A /* flush X.25-level statistics */ | ||
127 | #define X25_READ_CONFIGURATION 0x50 /* read HDLC & X.25 configuration */ | ||
128 | #define X25_SET_CONFIGURATION 0x51 /* set HDLC & X.25 configuration */ | ||
129 | |||
130 | /* | ||
131 | * Defines for the 'result' field. | ||
132 | */ | ||
133 | /*----- General results ---------------*/ | ||
134 | #define X25RES_OK 0x00 | ||
135 | #define X25RES_ERROR 0x01 | ||
136 | #define X25RES_LINK_NOT_IN_ABM 0x02 /* link is not in ABM mode */ | ||
137 | #define X25RES_LINK_CLOSED 0x03 | ||
138 | #define X25RES_INVAL_LENGTH 0x04 | ||
139 | #define X25RES_INVAL_CMD 0x05 | ||
140 | #define X25RES_UNNUMBERED_FRAME 0x06 /* unnunbered frame received */ | ||
141 | #define X25RES_FRM_REJECT_MODE 0x07 /* link is in Frame Reject mode */ | ||
142 | #define X25RES_MODEM_FAILURE 0x08 /* DCD and/or CTS dropped */ | ||
143 | #define X25RES_N2_RETRY_LIMIT 0x09 /* N2 retry limit has been exceeded */ | ||
144 | #define X25RES_INVAL_LCN 0x30 /* invalid logical channel number */ | ||
145 | #define X25RES_INVAL_STATE 0x31 /* channel is not in data xfer mode */ | ||
146 | #define X25RES_INVAL_DATA_LEN 0x32 /* invalid data length */ | ||
147 | #define X25RES_NOT_READY 0x33 /* no data available / buffers full */ | ||
148 | #define X25RES_NETWORK_DOWN 0x34 | ||
149 | #define X25RES_CHANNEL_IN_USE 0x35 /* there is data queued on this LCN */ | ||
150 | #define X25RES_REGST_NOT_SUPPRT 0x36 /* registration not supported */ | ||
151 | #define X25RES_INVAL_FORMAT 0x37 /* invalid packet format */ | ||
152 | #define X25RES_D_BIT_NOT_SUPPRT 0x38 /* D-bit pragmatics not supported */ | ||
153 | #define X25RES_FACIL_NOT_SUPPRT 0x39 /* Call facility not supported */ | ||
154 | #define X25RES_INVAL_CALL_ARG 0x3A /* errorneous call arguments */ | ||
155 | #define X25RES_INVAL_CALL_DATA 0x3B /* errorneous call user data */ | ||
156 | #define X25RES_ASYNC_PACKET 0x40 /* asynchronous packet received */ | ||
157 | #define X25RES_PROTO_VIOLATION 0x41 /* protocol violation occurred */ | ||
158 | #define X25RES_PKT_TIMEOUT 0x42 /* X.25 packet time out */ | ||
159 | #define X25RES_PKT_RETRY_LIMIT 0x43 /* X.25 packet retry limit exceeded */ | ||
160 | /*----- Command-dependent results -----*/ | ||
161 | #define X25RES_LINK_DISC 0x00 /* HDLC_LINK_STATUS */ | ||
162 | #define X25RES_LINK_IN_ABM 0x01 /* HDLC_LINK_STATUS */ | ||
163 | #define X25RES_NO_DATA 0x01 /* HDLC_READ/READ_TRACE_DATA*/ | ||
164 | #define X25RES_TRACE_INACTIVE 0x02 /* READ_TRACE_DATA */ | ||
165 | #define X25RES_LINK_IS_OPEN 0x01 /* HDLC_LINK_OPEN */ | ||
166 | #define X25RES_LINK_IS_DISC 0x02 /* HDLC_LINK_DISC */ | ||
167 | #define X25RES_LINK_IS_CLOSED 0x03 /* HDLC_LINK_CLOSE */ | ||
168 | #define X25RES_INVAL_PARAM 0x31 /* INCOMMING_CALL_CTL */ | ||
169 | #define X25RES_INVAL_CONFIG 0x35 /* REGISTR_RQST/CONFRM */ | ||
170 | |||
171 | /* | ||
172 | * Defines for the 'qdm_bits' field. | ||
173 | */ | ||
174 | #define X25CMD_Q_BIT_MASK 0x04 | ||
175 | #define X25CMD_D_BIT_MASK 0x02 | ||
176 | #define X25CMD_M_BIT_MASK 0x01 | ||
177 | |||
178 | /* | ||
179 | * Defines for the 'pkt_type' field. | ||
180 | */ | ||
181 | /*----- Asynchronous events ------*/ | ||
182 | #define ASE_CLEAR_RQST 0x02 | ||
183 | #define ASE_RESET_RQST 0x04 | ||
184 | #define ASE_RESTART_RQST 0x08 | ||
185 | #define ASE_INTERRUPT 0x10 | ||
186 | #define ASE_DTE_REGISTR_RQST 0x20 | ||
187 | #define ASE_CALL_RQST 0x30 | ||
188 | #define ASE_CALL_ACCEPTED 0x31 | ||
189 | #define ASE_CLEAR_CONFRM 0x32 | ||
190 | #define ASE_RESET_CONFRM 0x33 | ||
191 | #define ASE_RESTART_CONFRM 0x34 | ||
192 | #define ASE_INTERRUPT_CONFRM 0x35 | ||
193 | #define ASE_DCE_REGISTR_CONFRM 0x36 | ||
194 | #define ASE_DIAGNOSTIC 0x37 | ||
195 | #define ASE_CALL_AUTO_CLEAR 0x38 | ||
196 | #define AUTO_RESPONSE_FLAG 0x80 | ||
197 | /*----- Time-Out events ----------*/ | ||
198 | #define TOE_RESTART_RQST 0x03 | ||
199 | #define TOE_CALL_RQST 0x05 | ||
200 | #define TOE_CLEAR_RQST 0x08 | ||
201 | #define TOE_RESET_RQST 0x0A | ||
202 | /*----- Protocol Violation events */ | ||
203 | #define PVE_CLEAR_RQST 0x32 | ||
204 | #define PVE_RESET_RQST 0x33 | ||
205 | #define PVE_RESTART_RQST 0x34 | ||
206 | #define PVE_DIAGNOSTIC 0x37 | ||
207 | |||
208 | #define INTR_ON_RX_FRAME 0x01 | ||
209 | #define INTR_ON_TX_FRAME 0x02 | ||
210 | #define INTR_ON_MODEM_STATUS_CHANGE 0x04 | ||
211 | #define INTR_ON_COMMAND_COMPLETE 0x08 | ||
212 | #define INTR_ON_X25_ASY_TRANSACTION 0x10 | ||
213 | #define INTR_ON_TIMER 0x40 | ||
214 | #define DIRECT_RX_INTR_USAGE 0x80 | ||
215 | |||
216 | #define NO_INTR_PENDING 0x00 | ||
217 | #define RX_INTR_PENDING 0x01 | ||
218 | #define TX_INTR_PENDING 0x02 | ||
219 | #define MODEM_INTR_PENDING 0x04 | ||
220 | #define COMMAND_COMPLETE_INTR_PENDING 0x08 | ||
221 | #define X25_ASY_TRANS_INTR_PENDING 0x10 | ||
222 | #define TIMER_INTR_PENDING 0x40 | ||
223 | |||
224 | /*---------------------------------------------------------------------------- | ||
225 | * X.25 Mailbox. | ||
226 | * This structure is located at offsets X25_MBOX_OFFS and X25_RXMBOX_OFFS | ||
227 | * into shared memory window. | ||
228 | */ | ||
229 | typedef struct X25Mbox | ||
230 | { | ||
231 | unsigned char opflag PACKED; /* 00h: execution flag */ | ||
232 | TX25Cmd cmd PACKED; /* 01h: command block */ | ||
233 | unsigned char data[1] PACKED; /* 10h: data buffer */ | ||
234 | } TX25Mbox; | ||
235 | |||
236 | /*---------------------------------------------------------------------------- | ||
237 | * X.25 Time Stamp Structure. | ||
238 | */ | ||
239 | typedef struct X25TimeStamp | ||
240 | { | ||
241 | unsigned char month PACKED; | ||
242 | unsigned char date PACKED; | ||
243 | unsigned char sec PACKED; | ||
244 | unsigned char min PACKED; | ||
245 | unsigned char hour PACKED; | ||
246 | } TX25TimeStamp; | ||
247 | |||
248 | /*---------------------------------------------------------------------------- | ||
249 | * X.25 Status Block. | ||
250 | * This structure is located at offset X25_STATUS_OFF into shared memory | ||
251 | * window. | ||
252 | */ | ||
253 | typedef struct X25Status | ||
254 | { | ||
255 | unsigned short pvc_map PACKED; /* 00h: PVC map */ | ||
256 | unsigned short icc_map PACKED; /* 02h: Incomming Chan. map */ | ||
257 | unsigned short twc_map PACKED; /* 04h: Two-way Cnan. map */ | ||
258 | unsigned short ogc_map PACKED; /* 06h: Outgoing Chan. map */ | ||
259 | TX25TimeStamp tstamp PACKED; /* 08h: timestamp (BCD) */ | ||
260 | unsigned char iflags PACKED; /* 0Dh: interrupt flags */ | ||
261 | unsigned char imask PACKED; /* 0Eh: interrupt mask */ | ||
262 | unsigned char resrv PACKED; /* 0Eh: */ | ||
263 | unsigned char gflags PACKED; /* 10h: misc. HDLC/X25 flags */ | ||
264 | unsigned char cflags[X25_MAX_CHAN] PACKED; /* channel status bytes */ | ||
265 | } TX25Status; | ||
266 | |||
267 | /* | ||
268 | * Bitmasks for the 'iflags' field. | ||
269 | */ | ||
270 | #define X25_RX_INTR 0x01 /* receive interrupt */ | ||
271 | #define X25_TX_INTR 0x02 /* transmit interrupt */ | ||
272 | #define X25_MODEM_INTR 0x04 /* modem status interrupt (CTS/DCD) */ | ||
273 | #define X25_EVENT_INTR 0x10 /* asyncronous event encountered */ | ||
274 | #define X25_CMD_INTR 0x08 /* interface command complete */ | ||
275 | |||
276 | /* | ||
277 | * Bitmasks for the 'gflags' field. | ||
278 | */ | ||
279 | #define X25_HDLC_ABM 0x01 /* HDLC is in ABM mode */ | ||
280 | #define X25_RX_READY 0x02 /* X.25 data available */ | ||
281 | #define X25_TRACE_READY 0x08 /* trace data available */ | ||
282 | #define X25_EVENT_IND 0x20 /* asynchronous event indicator */ | ||
283 | #define X25_TX_READY 0x40 /* space is available in Tx buf.*/ | ||
284 | |||
285 | /* | ||
286 | * Bitmasks for the 'cflags' field. | ||
287 | */ | ||
288 | #define X25_XFER_MODE 0x80 /* channel is in data transfer mode */ | ||
289 | #define X25_TXWIN_OPEN 0x40 /* transmit window open */ | ||
290 | #define X25_RXBUF_MASK 0x3F /* number of data buffers available */ | ||
291 | |||
292 | /***************************************************************************** | ||
293 | * Following definitions structurize contents of the TX25Mbox.data field for | ||
294 | * different X.25 interface commands. | ||
295 | ****************************************************************************/ | ||
296 | |||
297 | /* --------------------------------------------------------------------------- | ||
298 | * X25_SET_GLOBAL_VARS Command. | ||
299 | */ | ||
300 | typedef struct X25GlobalVars | ||
301 | { | ||
302 | unsigned char resrv PACKED; /* 00h: reserved */ | ||
303 | unsigned char dtrCtl PACKED; /* 01h: DTR control code */ | ||
304 | unsigned char resErr PACKED; /* 01h: '1' - reset modem error */ | ||
305 | } TX25GlobalVars; | ||
306 | |||
307 | /* | ||
308 | * Defines for the 'dtrCtl' field. | ||
309 | */ | ||
310 | #define X25_RAISE_DTR 0x01 | ||
311 | #define X25_DROP_DTR 0x02 | ||
312 | |||
313 | /* --------------------------------------------------------------------------- | ||
314 | * X25_READ_MODEM_STATUS Command. | ||
315 | */ | ||
316 | typedef struct X25ModemStatus | ||
317 | { | ||
318 | unsigned char status PACKED; /* 00h: modem status */ | ||
319 | } TX25ModemStatus; | ||
320 | |||
321 | /* | ||
322 | * Defines for the 'status' field. | ||
323 | */ | ||
324 | #define X25_CTS_MASK 0x20 | ||
325 | #define X25_DCD_MASK 0x08 | ||
326 | |||
327 | /* --------------------------------------------------------------------------- | ||
328 | * X25_HDLC_LINK_STATUS Command. | ||
329 | */ | ||
330 | typedef struct X25LinkStatus | ||
331 | { | ||
332 | unsigned char txQueued PACKED; /* 00h: queued Tx I-frames*/ | ||
333 | unsigned char rxQueued PACKED; /* 01h: queued Rx I-frames*/ | ||
334 | unsigned char station PACKED; /* 02h: DTE/DCE config. */ | ||
335 | unsigned char reserved PACKED; /* 03h: reserved */ | ||
336 | unsigned char sfTally PACKED; /* 04h: supervisory frame tally */ | ||
337 | } TX25LinkStatus; | ||
338 | |||
339 | /* | ||
340 | * Defines for the 'station' field. | ||
341 | */ | ||
342 | #define X25_STATION_DTE 0x01 /* station configured as DTE */ | ||
343 | #define X25_STATION_DCE 0x02 /* station configured as DCE */ | ||
344 | |||
345 | /* --------------------------------------------------------------------------- | ||
346 | * X25_HDLC_READ_STATS Command. | ||
347 | */ | ||
348 | typedef struct HdlcStats | ||
349 | { /* a number of ... */ | ||
350 | unsigned short rxIFrames PACKED; /* 00h: ready Rx I-frames */ | ||
351 | unsigned short rxNoseq PACKED; /* 02h: frms out-of-sequence */ | ||
352 | unsigned short rxNodata PACKED; /* 04h: I-frms without data */ | ||
353 | unsigned short rxDiscarded PACKED; /* 06h: discarded frames */ | ||
354 | unsigned short rxTooLong PACKED; /* 08h: frames too long */ | ||
355 | unsigned short rxBadAddr PACKED; /* 0Ah: frms with inval.addr*/ | ||
356 | unsigned short txAcked PACKED; /* 0Ch: acknowledged I-frms */ | ||
357 | unsigned short txRetransm PACKED; /* 0Eh: re-transmit. I-frms */ | ||
358 | unsigned short t1Timeout PACKED; /* 10h: T1 timeouts */ | ||
359 | unsigned short rxSABM PACKED; /* 12h: received SABM frames */ | ||
360 | unsigned short rxDISC PACKED; /* 14h: received DISC frames */ | ||
361 | unsigned short rxDM PACKED; /* 16h: received DM frames */ | ||
362 | unsigned short rxFRMR PACKED; /* 18h: FRMR frames received */ | ||
363 | unsigned short txSABM PACKED; /* 1Ah: transm. SABM frames*/ | ||
364 | unsigned short txDISC PACKED; /* 1Ch: transm. DISC frames*/ | ||
365 | unsigned short txDM PACKED; /* 1Eh: transm. DM frames */ | ||
366 | unsigned short txFRMR PACKED; /* 20h: transm. FRMR frames*/ | ||
367 | } THdlcStats; | ||
368 | |||
369 | /* --------------------------------------------------------------------------- | ||
370 | * X25_HDLC_READ_COMM_ERR Command. | ||
371 | */ | ||
372 | typedef struct HdlcCommErr | ||
373 | { /* a number of ... */ | ||
374 | unsigned char rxOverrun PACKED; /* 00h: Rx overrun errors */ | ||
375 | unsigned char rxBadCrc PACKED; /* 01h: Rx CRC errors */ | ||
376 | unsigned char rxAborted PACKED; /* 02h: Rx aborted frames */ | ||
377 | unsigned char rxDropped PACKED; /* 03h: frames lost */ | ||
378 | unsigned char txAborted PACKED; /* 04h: Tx aborted frames */ | ||
379 | unsigned char txUnderrun PACKED; /* 05h: Tx underrun errors */ | ||
380 | unsigned char txMissIntr PACKED; /* 06h: missed underrun ints */ | ||
381 | unsigned char reserved PACKED; /* 07h: reserved */ | ||
382 | unsigned char droppedDCD PACKED; /* 08h: times DCD dropped */ | ||
383 | unsigned char droppedCTS PACKED; /* 09h: times CTS dropped */ | ||
384 | } THdlcCommErr; | ||
385 | |||
386 | /* --------------------------------------------------------------------------- | ||
387 | * X25_SET_CONFIGURATION & X25_READ_CONFIGURATION Commands. | ||
388 | */ | ||
389 | typedef struct X25Config | ||
390 | { | ||
391 | unsigned char baudRate PACKED; /* 00h: */ | ||
392 | unsigned char t1 PACKED; /* 01h: */ | ||
393 | unsigned char t2 PACKED; /* 02h: */ | ||
394 | unsigned char n2 PACKED; /* 03h: */ | ||
395 | unsigned short hdlcMTU PACKED; /* 04h: */ | ||
396 | unsigned char hdlcWindow PACKED; /* 06h: */ | ||
397 | unsigned char t4 PACKED; /* 07h: */ | ||
398 | unsigned char autoModem PACKED; /* 08h: */ | ||
399 | unsigned char autoHdlc PACKED; /* 09h: */ | ||
400 | unsigned char hdlcOptions PACKED; /* 0Ah: */ | ||
401 | unsigned char station PACKED; /* 0Bh: */ | ||
402 | unsigned char pktWindow PACKED; /* 0Ch: */ | ||
403 | unsigned short defPktSize PACKED; /* 0Dh: */ | ||
404 | unsigned short pktMTU PACKED; /* 0Fh: */ | ||
405 | unsigned short loPVC PACKED; /* 11h: */ | ||
406 | unsigned short hiPVC PACKED; /* 13h: */ | ||
407 | unsigned short loIncommingSVC PACKED; /* 15h: */ | ||
408 | unsigned short hiIncommingSVC PACKED; /* 17h: */ | ||
409 | unsigned short loTwoWaySVC PACKED; /* 19h: */ | ||
410 | unsigned short hiTwoWaySVC PACKED; /* 1Bh: */ | ||
411 | unsigned short loOutgoingSVC PACKED; /* 1Dh: */ | ||
412 | unsigned short hiOutgoingSVC PACKED; /* 1Fh: */ | ||
413 | unsigned short options PACKED; /* 21h: */ | ||
414 | unsigned char responseOpt PACKED; /* 23h: */ | ||
415 | unsigned short facil1 PACKED; /* 24h: */ | ||
416 | unsigned short facil2 PACKED; /* 26h: */ | ||
417 | unsigned short ccittFacil PACKED; /* 28h: */ | ||
418 | unsigned short otherFacil PACKED; /* 2Ah: */ | ||
419 | unsigned short ccittCompat PACKED; /* 2Ch: */ | ||
420 | unsigned char t10t20 PACKED; /* 2Eh: */ | ||
421 | unsigned char t11t21 PACKED; /* 2Fh: */ | ||
422 | unsigned char t12t22 PACKED; /* 30h: */ | ||
423 | unsigned char t13t23 PACKED; /* 31h: */ | ||
424 | unsigned char t16t26 PACKED; /* 32H: */ | ||
425 | unsigned char t28 PACKED; /* 33h: */ | ||
426 | unsigned char r10r20 PACKED; /* 34h: */ | ||
427 | unsigned char r12r22 PACKED; /* 35h: */ | ||
428 | unsigned char r13r23 PACKED; /* 36h: */ | ||
429 | } TX25Config; | ||
430 | |||
431 | /* --------------------------------------------------------------------------- | ||
432 | * X25_READ_CHANNEL_CONFIG Command. | ||
433 | */ | ||
434 | typedef struct X25ChanAlloc /*----- Channel allocation -*/ | ||
435 | { | ||
436 | unsigned short loPVC PACKED; /* 00h: lowest PVC number */ | ||
437 | unsigned short hiPVC PACKED; /* 02h: highest PVC number */ | ||
438 | unsigned short loIncommingSVC PACKED; /* 04h: lowest incoming SVC */ | ||
439 | unsigned short hiIncommingSVC PACKED; /* 06h: highest incoming SVC */ | ||
440 | unsigned short loTwoWaySVC PACKED; /* 08h: lowest two-way SVC */ | ||
441 | unsigned short hiTwoWaySVC PACKED; /* 0Ah: highest two-way SVC */ | ||
442 | unsigned short loOutgoingSVC PACKED; /* 0Ch: lowest outgoing SVC */ | ||
443 | unsigned short hiOutgoingSVC PACKED; /* 0Eh: highest outgoing SVC */ | ||
444 | } TX25ChanAlloc; | ||
445 | |||
446 | typedef struct X25ChanCfg /*------ Channel configuration -----*/ | ||
447 | { | ||
448 | unsigned char type PACKED; /* 00h: channel type */ | ||
449 | unsigned char txConf PACKED; /* 01h: Tx packet and window sizes */ | ||
450 | unsigned char rxConf PACKED; /* 01h: Rx packet and window sizes */ | ||
451 | } TX25ChanCfg; | ||
452 | |||
453 | /* | ||
454 | * Defines for the 'type' field. | ||
455 | */ | ||
456 | #define X25_PVC 0x01 /* PVC */ | ||
457 | #define X25_SVC_IN 0x03 /* Incoming SVC */ | ||
458 | #define X25_SVC_TWOWAY 0x07 /* Two-way SVC */ | ||
459 | #define X25_SVC_OUT 0x0B /* Outgoing SVC */ | ||
460 | |||
461 | /*---------------------------------------------------------------------------- | ||
462 | * X25_READ_STATISTICS Command. | ||
463 | */ | ||
464 | typedef struct X25Stats | ||
465 | { /* number of packets Tx/Rx'ed */ | ||
466 | unsigned short txRestartRqst PACKED; /* 00h: Restart Request */ | ||
467 | unsigned short rxRestartRqst PACKED; /* 02h: Restart Request */ | ||
468 | unsigned short txRestartConf PACKED; /* 04h: Restart Confirmation */ | ||
469 | unsigned short rxRestartConf PACKED; /* 06h: Restart Confirmation */ | ||
470 | unsigned short txResetRqst PACKED; /* 08h: Reset Request */ | ||
471 | unsigned short rxResetRqst PACKED; /* 0Ah: Reset Request */ | ||
472 | unsigned short txResetConf PACKED; /* 0Ch: Reset Confirmation */ | ||
473 | unsigned short rxResetConf PACKED; /* 0Eh: Reset Confirmation */ | ||
474 | unsigned short txCallRequest PACKED; /* 10h: Call Request */ | ||
475 | unsigned short rxCallRequest PACKED; /* 12h: Call Request */ | ||
476 | unsigned short txCallAccept PACKED; /* 14h: Call Accept */ | ||
477 | unsigned short rxCallAccept PACKED; /* 16h: Call Accept */ | ||
478 | unsigned short txClearRqst PACKED; /* 18h: Clear Request */ | ||
479 | unsigned short rxClearRqst PACKED; /* 1Ah: Clear Request */ | ||
480 | unsigned short txClearConf PACKED; /* 1Ch: Clear Confirmation */ | ||
481 | unsigned short rxClearConf PACKED; /* 1Eh: Clear Confirmation */ | ||
482 | unsigned short txDiagnostic PACKED; /* 20h: Diagnostic */ | ||
483 | unsigned short rxDiagnostic PACKED; /* 22h: Diagnostic */ | ||
484 | unsigned short txRegRqst PACKED; /* 24h: Registration Request */ | ||
485 | unsigned short rxRegRqst PACKED; /* 26h: Registration Request */ | ||
486 | unsigned short txRegConf PACKED; /* 28h: Registration Confirm.*/ | ||
487 | unsigned short rxRegConf PACKED; /* 2Ah: Registration Confirm.*/ | ||
488 | unsigned short txInterrupt PACKED; /* 2Ch: Interrupt */ | ||
489 | unsigned short rxInterrupt PACKED; /* 2Eh: Interrupt */ | ||
490 | unsigned short txIntrConf PACKED; /* 30h: Interrupt Confirm. */ | ||
491 | unsigned short rxIntrConf PACKED; /* 32h: Interrupt Confirm. */ | ||
492 | unsigned short txData PACKED; /* 34h: Data */ | ||
493 | unsigned short rxData PACKED; /* 36h: Data */ | ||
494 | unsigned short txRR PACKED; /* 38h: RR */ | ||
495 | unsigned short rxRR PACKED; /* 3Ah: RR */ | ||
496 | unsigned short txRNR PACKED; /* 3Ch: RNR */ | ||
497 | unsigned short rxRNR PACKED; /* 3Eh: RNR */ | ||
498 | } TX25Stats; | ||
499 | |||
500 | /*---------------------------------------------------------------------------- | ||
501 | * X25_READ_HISTORY_TABLE Command. | ||
502 | */ | ||
503 | typedef struct X25EventLog | ||
504 | { | ||
505 | unsigned char type PACKED; /* 00h: transaction type */ | ||
506 | unsigned short lcn PACKED; /* 01h: logical channel num */ | ||
507 | unsigned char packet PACKED; /* 03h: async packet type */ | ||
508 | unsigned char cause PACKED; /* 04h: X.25 cause field */ | ||
509 | unsigned char diag PACKED; /* 05h: X.25 diag field */ | ||
510 | TX25TimeStamp ts PACKED; /* 06h: time stamp */ | ||
511 | } TX25EventLog; | ||
512 | |||
513 | /* | ||
514 | * Defines for the 'type' field. | ||
515 | */ | ||
516 | #define X25LOG_INCOMMING 0x00 | ||
517 | #define X25LOG_APPLICATION 0x01 | ||
518 | #define X25LOG_AUTOMATIC 0x02 | ||
519 | #define X25LOG_ERROR 0x04 | ||
520 | #define X25LOG_TIMEOUT 0x08 | ||
521 | #define X25LOG_RECOVERY 0x10 | ||
522 | |||
523 | /* | ||
524 | * Defines for the 'packet' field. | ||
525 | */ | ||
526 | #define X25LOG_CALL_RQST 0x0B | ||
527 | #define X25LOG_CALL_ACCEPTED 0x0F | ||
528 | #define X25LOG_CLEAR_RQST 0x13 | ||
529 | #define X25LOG_CLEAR_CONFRM 0x17 | ||
530 | #define X25LOG_RESET_RQST 0x1B | ||
531 | #define X25LOG_RESET_CONFRM 0x1F | ||
532 | #define X25LOG_RESTART_RQST 0xFB | ||
533 | #define X25LOG_RESTART_COMFRM 0xFF | ||
534 | #define X25LOG_DIAGNOSTIC 0xF1 | ||
535 | #define X25LOG_DTE_REG_RQST 0xF3 | ||
536 | #define X25LOG_DTE_REG_COMFRM 0xF7 | ||
537 | |||
538 | /* --------------------------------------------------------------------------- | ||
539 | * X25_TRACE_CONFIGURE Command. | ||
540 | */ | ||
541 | typedef struct X25TraceCfg | ||
542 | { | ||
543 | unsigned char flags PACKED; /* 00h: trace configuration flags */ | ||
544 | unsigned char timeout PACKED; /* 01h: timeout for trace delay mode*/ | ||
545 | } TX25TraceCfg; | ||
546 | |||
547 | /* | ||
548 | * Defines for the 'flags' field. | ||
549 | */ | ||
550 | #define X25_TRC_ENABLE 0x01 /* bit0: '1' - trace enabled */ | ||
551 | #define X25_TRC_TIMESTAMP 0x02 /* bit1: '1' - time stamping enabled*/ | ||
552 | #define X25_TRC_DELAY 0x04 /* bit2: '1' - trace delay enabled */ | ||
553 | #define X25_TRC_DATA 0x08 /* bit3: '1' - trace data packets */ | ||
554 | #define X25_TRC_SUPERVISORY 0x10 /* bit4: '1' - trace suprvisory pkts*/ | ||
555 | #define X25_TRC_ASYNCHRONOUS 0x20 /* bit5: '1' - trace asynch. packets*/ | ||
556 | #define X25_TRC_HDLC 0x40 /* bit6: '1' - trace all packets */ | ||
557 | #define X25_TRC_READ 0x80 /* bit7: '1' - get current config. */ | ||
558 | |||
559 | /* --------------------------------------------------------------------------- | ||
560 | * X25_READ_TRACE_DATA Command. | ||
561 | */ | ||
562 | typedef struct X25Trace /*----- Trace data structure -------*/ | ||
563 | { | ||
564 | unsigned short length PACKED; /* 00h: trace data length */ | ||
565 | unsigned char type PACKED; /* 02h: trace type */ | ||
566 | unsigned char lost_cnt PACKED; /* 03h: N of traces lost */ | ||
567 | TX25TimeStamp tstamp PACKED; /* 04h: mon/date/sec/min/hour */ | ||
568 | unsigned short millisec PACKED; /* 09h: ms time stamp */ | ||
569 | unsigned char data[0] PACKED; /* 0Bh: traced frame */ | ||
570 | } TX25Trace; | ||
571 | |||
572 | /* | ||
573 | * Defines for the 'type' field. | ||
574 | */ | ||
575 | #define X25_TRC_TYPE_MASK 0x0F /* bits 0..3: trace type */ | ||
576 | #define X25_TRC_TYPE_RX_FRAME 0x00 /* received frame trace */ | ||
577 | #define X25_TRC_TYPE_TX_FRAME 0x01 /* transmitted frame */ | ||
578 | #define X25_TRC_TYPE_ERR_FRAME 0x02 /* error frame */ | ||
579 | |||
580 | #define X25_TRC_ERROR_MASK 0xF0 /* bits 4..7: error code */ | ||
581 | #define X25_TRCERR_RX_ABORT 0x10 /* receive abort error */ | ||
582 | #define X25_TRCERR_RX_BADCRC 0x20 /* receive CRC error */ | ||
583 | #define X25_TRCERR_RX_OVERRUN 0x30 /* receiver overrun error */ | ||
584 | #define X25_TRCERR_RX_TOO_LONG 0x40 /* excessive frame length error */ | ||
585 | #define X25_TRCERR_TX_ABORT 0x70 /* aborted frame transmittion error */ | ||
586 | #define X25_TRCERR_TX_UNDERRUN 0x80 /* transmit underrun error */ | ||
587 | |||
588 | /***************************************************************************** | ||
589 | * Following definitions describe HDLC frame and X.25 packet formats. | ||
590 | ****************************************************************************/ | ||
591 | |||
592 | typedef struct HDLCFrame /*----- DHLC Frame Format ----------*/ | ||
593 | { | ||
594 | unsigned char addr PACKED; /* address field */ | ||
595 | unsigned char cntl PACKED; /* control field */ | ||
596 | unsigned char data[0] PACKED; | ||
597 | } THDLCFrame; | ||
598 | |||
599 | typedef struct X25Pkt /*----- X.25 Paket Format ----------*/ | ||
600 | { | ||
601 | unsigned char lcn_hi PACKED; /* 4 MSB of Logical Channel Number */ | ||
602 | unsigned char lcn_lo PACKED; /* 8 LSB of Logical Channel Number */ | ||
603 | unsigned char type PACKED; | ||
604 | unsigned char data[0] PACKED; | ||
605 | } TX25Pkt; | ||
606 | |||
607 | /* | ||
608 | * Defines for the 'lcn_hi' field. | ||
609 | */ | ||
610 | #define X25_Q_BIT_MASK 0x80 /* Data Qualifier Bit mask */ | ||
611 | #define X25_D_BIT_MASK 0x40 /* Delivery Confirmation Bit mask */ | ||
612 | #define X25_M_BITS_MASK 0x30 /* Modulo Bits mask */ | ||
613 | #define X25_LCN_MSB_MASK 0x0F /* LCN most significant bits mask */ | ||
614 | |||
615 | /* | ||
616 | * Defines for the 'type' field. | ||
617 | */ | ||
618 | #define X25PKT_DATA 0x01 /* Data packet mask */ | ||
619 | #define X25PKT_SUPERVISORY 0x02 /* Supervisory packet mask */ | ||
620 | #define X25PKT_CALL_RQST 0x0B /* Call Request/Incoming */ | ||
621 | #define X25PKT_CALL_ACCEPTED 0x0F /* Call Accepted/Connected */ | ||
622 | #define X25PKT_CLEAR_RQST 0x13 /* Clear Request/Indication */ | ||
623 | #define X25PKT_CLEAR_CONFRM 0x17 /* Clear Confirmation */ | ||
624 | #define X25PKT_RESET_RQST 0x1B /* Reset Request/Indication */ | ||
625 | #define X25PKT_RESET_CONFRM 0x1F /* Reset Confirmation */ | ||
626 | #define X25PKT_RESTART_RQST 0xFB /* Restart Request/Indication */ | ||
627 | #define X25PKT_RESTART_CONFRM 0xFF /* Restart Confirmation */ | ||
628 | #define X25PKT_INTERRUPT 0x23 /* Interrupt */ | ||
629 | #define X25PKT_INTERRUPT_CONFRM 0x27 /* Interrupt Confirmation */ | ||
630 | #define X25PKT_DIAGNOSTIC 0xF1 /* Diagnostic */ | ||
631 | #define X25PKT_REGISTR_RQST 0xF3 /* Registration Request */ | ||
632 | #define X25PKT_REGISTR_CONFRM 0xF7 /* Registration Confirmation */ | ||
633 | #define X25PKT_RR_MASKED 0x01 /* Receive Ready packet after masking */ | ||
634 | #define X25PKT_RNR_MASKED 0x05 /* Receive Not Ready after masking */ | ||
635 | |||
636 | |||
637 | typedef struct { | ||
638 | TX25Cmd cmd PACKED; | ||
639 | char data[X25_MAX_DATA] PACKED; | ||
640 | } mbox_cmd_t; | ||
641 | |||
642 | |||
643 | typedef struct { | ||
644 | unsigned char qdm PACKED; /* Q/D/M bits */ | ||
645 | unsigned char cause PACKED; /* cause field */ | ||
646 | unsigned char diagn PACKED; /* diagnostics */ | ||
647 | unsigned char pktType PACKED; | ||
648 | unsigned short length PACKED; | ||
649 | unsigned char result PACKED; | ||
650 | unsigned short lcn PACKED; | ||
651 | char reserved[7] PACKED; | ||
652 | }x25api_hdr_t; | ||
653 | |||
654 | |||
655 | typedef struct { | ||
656 | x25api_hdr_t hdr PACKED; | ||
657 | char data[X25_MAX_DATA] PACKED; | ||
658 | }x25api_t; | ||
659 | |||
660 | |||
661 | /* | ||
662 | * XPIPEMON Definitions | ||
663 | */ | ||
664 | |||
665 | /* valid ip_protocol for UDP management */ | ||
666 | #define UDPMGMT_UDP_PROTOCOL 0x11 | ||
667 | #define UDPMGMT_XPIPE_SIGNATURE "XLINK8ND" | ||
668 | #define UDPMGMT_DRVRSTATS_SIGNATURE "DRVSTATS" | ||
669 | |||
670 | /* values for request/reply byte */ | ||
671 | #define UDPMGMT_REQUEST 0x01 | ||
672 | #define UDPMGMT_REPLY 0x02 | ||
673 | #define UDP_OFFSET 12 | ||
674 | |||
675 | |||
676 | typedef struct { | ||
677 | unsigned char opp_flag PACKED; /* the opp flag */ | ||
678 | unsigned char command PACKED; /* command code */ | ||
679 | unsigned short length PACKED; /* transfer data length */ | ||
680 | unsigned char result PACKED; /* return code */ | ||
681 | unsigned char pf PACKED; /* P/F bit */ | ||
682 | unsigned short lcn PACKED; /* logical channel */ | ||
683 | unsigned char qdm PACKED; /* Q/D/M bits */ | ||
684 | unsigned char cause PACKED; /* cause field */ | ||
685 | unsigned char diagn PACKED; /* diagnostics */ | ||
686 | unsigned char pktType PACKED; /* packet type */ | ||
687 | unsigned char resrv[4] PACKED; /* reserved */ | ||
688 | } cblock_t; | ||
689 | |||
690 | typedef struct { | ||
691 | ip_pkt_t ip_pkt PACKED; | ||
692 | udp_pkt_t udp_pkt PACKED; | ||
693 | wp_mgmt_t wp_mgmt PACKED; | ||
694 | cblock_t cblock PACKED; | ||
695 | unsigned char data[4080] PACKED; | ||
696 | } x25_udp_pkt_t; | ||
697 | |||
698 | |||
699 | typedef struct read_hdlc_stat { | ||
700 | unsigned short inf_frames_rx_ok PACKED; | ||
701 | unsigned short inf_frames_rx_out_of_seq PACKED; | ||
702 | unsigned short inf_frames_rx_no_data PACKED; | ||
703 | unsigned short inf_frames_rx_dropped PACKED; | ||
704 | unsigned short inf_frames_rx_data_too_long PACKED; | ||
705 | unsigned short inf_frames_rx_invalid_addr PACKED; | ||
706 | unsigned short inf_frames_tx_ok PACKED; | ||
707 | unsigned short inf_frames_tx_retransmit PACKED; | ||
708 | unsigned short T1_timeouts PACKED; | ||
709 | unsigned short SABM_frames_rx PACKED; | ||
710 | unsigned short DISC_frames_rx PACKED; | ||
711 | unsigned short DM_frames_rx PACKED; | ||
712 | unsigned short FRMR_frames_rx PACKED; | ||
713 | unsigned short SABM_frames_tx PACKED; | ||
714 | unsigned short DISC_frames_tx PACKED; | ||
715 | unsigned short DM_frames_tx PACKED; | ||
716 | unsigned short FRMR_frames_tx PACKED; | ||
717 | } read_hdlc_stat_t; | ||
718 | |||
719 | typedef struct read_comms_err_stats{ | ||
720 | unsigned char overrun_err_rx PACKED; | ||
721 | unsigned char CRC_err PACKED; | ||
722 | unsigned char abort_frames_rx PACKED; | ||
723 | unsigned char frames_dropped_buf_full PACKED; | ||
724 | unsigned char abort_frames_tx PACKED; | ||
725 | unsigned char transmit_underruns PACKED; | ||
726 | unsigned char missed_tx_underruns_intr PACKED; | ||
727 | unsigned char reserved PACKED; | ||
728 | unsigned char DCD_drop PACKED; | ||
729 | unsigned char CTS_drop PACKED; | ||
730 | } read_comms_err_stats_t; | ||
731 | |||
732 | typedef struct trace_data { | ||
733 | unsigned short length PACKED; | ||
734 | unsigned char type PACKED; | ||
735 | unsigned char trace_dropped PACKED; | ||
736 | unsigned char reserved[5] PACKED; | ||
737 | unsigned short timestamp PACKED; | ||
738 | unsigned char data PACKED; | ||
739 | } trace_data_t; | ||
740 | |||
741 | enum {UDP_XPIPE_TYPE}; | ||
742 | |||
743 | #define XPIPE_ENABLE_TRACING 0x14 | ||
744 | #define XPIPE_DISABLE_TRACING 0x14 | ||
745 | #define XPIPE_GET_TRACE_INFO 0x16 | ||
746 | #define XPIPE_FT1_READ_STATUS 0x74 | ||
747 | #define XPIPE_DRIVER_STAT_IFSEND 0x75 | ||
748 | #define XPIPE_DRIVER_STAT_INTR 0x76 | ||
749 | #define XPIPE_DRIVER_STAT_GEN 0x77 | ||
750 | #define XPIPE_FLUSH_DRIVER_STATS 0x78 | ||
751 | #define XPIPE_ROUTER_UP_TIME 0x79 | ||
752 | #define XPIPE_SET_FT1_MODE 0x81 | ||
753 | #define XPIPE_FT1_STATUS_CTRL 0x80 | ||
754 | |||
755 | |||
756 | /* error messages */ | ||
757 | #define NO_BUFFS_OR_CLOSED_WIN 0x33 | ||
758 | #define DATA_LENGTH_TOO_BIG 0x32 | ||
759 | #define NO_DATA_AVAILABLE 0x33 | ||
760 | #define Z80_TIMEOUT_ERROR 0x0a | ||
761 | #define NO_BUFFS 0x08 | ||
762 | |||
763 | |||
764 | /* Trace options */ | ||
765 | #define TRACE_DEFAULT 0x03 | ||
766 | #define TRACE_SUPERVISOR_FRMS 0x10 | ||
767 | #define TRACE_ASYNC_FRMS 0x20 | ||
768 | #define TRACE_ALL_HDLC_FRMS 0x40 | ||
769 | #define TRACE_DATA_FRMS 0x08 | ||
770 | |||
771 | |||
772 | #endif /* _SDLA_X25_H */ | ||
diff --git a/include/linux/sdladrv.h b/include/linux/sdladrv.h deleted file mode 100644 index c85e103d5e..0000000000 --- a/include/linux/sdladrv.h +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdladrv.h SDLA Support Module. Kernel API Definitions. | ||
3 | * | ||
4 | * Author: Gideon Hack | ||
5 | * | ||
6 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * Jun 02, 1999 Gideon Hack Added support for the S514 PCI adapter. | ||
14 | * Dec 11, 1996 Gene Kozin Complete overhaul. | ||
15 | * Oct 17, 1996 Gene Kozin Minor bug fixes. | ||
16 | * Jun 12, 1996 Gene Kozin Added support for S503 card. | ||
17 | * Dec 06, 1995 Gene Kozin Initial version. | ||
18 | *****************************************************************************/ | ||
19 | #ifndef _SDLADRV_H | ||
20 | #define _SDLADRV_H | ||
21 | |||
22 | |||
23 | #define SDLA_MAXIORANGE 4 /* maximum I/O port range */ | ||
24 | #define SDLA_WINDOWSIZE 0x2000 /* default dual-port memory window size */ | ||
25 | /****** Data Structures *****************************************************/ | ||
26 | |||
27 | /*---------------------------------------------------------------------------- | ||
28 | * Adapter hardware configuration. Pointer to this structure is passed to all | ||
29 | * APIs. | ||
30 | */ | ||
31 | typedef struct sdlahw | ||
32 | { | ||
33 | unsigned type; /* adapter type */ | ||
34 | unsigned fwid; /* firmware ID */ | ||
35 | unsigned port; /* adapter I/O port base */ | ||
36 | int irq; /* interrupt request level */ | ||
37 | char S514_cpu_no[1]; /* PCI CPU Number */ | ||
38 | unsigned char S514_slot_no; /* PCI Slot Number */ | ||
39 | char auto_pci_cfg; /* Autodetect PCI Slot */ | ||
40 | struct pci_dev *pci_dev; /* PCI device */ | ||
41 | void * dpmbase; /* dual-port memory base */ | ||
42 | unsigned dpmsize; /* dual-port memory size */ | ||
43 | unsigned pclk; /* CPU clock rate, kHz */ | ||
44 | unsigned long memory; /* memory size */ | ||
45 | unsigned long vector; /* local offset of the DPM window */ | ||
46 | unsigned io_range; /* I/O port range */ | ||
47 | unsigned char regs[SDLA_MAXIORANGE]; /* was written to registers */ | ||
48 | unsigned reserved[5]; | ||
49 | } sdlahw_t; | ||
50 | |||
51 | /****** Function Prototypes *************************************************/ | ||
52 | |||
53 | extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); | ||
54 | extern int sdla_down (sdlahw_t* hw); | ||
55 | extern void S514_intack (sdlahw_t* hw, u32 int_status); | ||
56 | extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); | ||
57 | extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); | ||
58 | extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, | ||
59 | unsigned len); | ||
60 | extern int sdla_poke (sdlahw_t* hw, unsigned long addr, void* buf, | ||
61 | unsigned len); | ||
62 | extern int sdla_exec (void* opflag); | ||
63 | |||
64 | extern unsigned wanpipe_hw_probe(void); | ||
65 | |||
66 | #endif /* _SDLADRV_H */ | ||
diff --git a/include/linux/sdlapci.h b/include/linux/sdlapci.h deleted file mode 100644 index 6f7c904f18..0000000000 --- a/include/linux/sdlapci.h +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdlapci.h WANPIPE(tm) Multiprotocol WAN Link Driver. | ||
3 | * Definitions for the SDLA PCI adapter. | ||
4 | * | ||
5 | * Author: Gideon Hack <ghack@sangoma.com> | ||
6 | * | ||
7 | * Copyright: (c) 1999-2000 Sangoma Technologies Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | * ============================================================================ | ||
14 | * Jun 02, 1999 Gideon Hack Initial version. | ||
15 | *****************************************************************************/ | ||
16 | #ifndef _SDLAPCI_H | ||
17 | #define _SDLAPCI_H | ||
18 | |||
19 | /****** Defines *************************************************************/ | ||
20 | |||
21 | /* Definitions for identifying and finding S514 PCI adapters */ | ||
22 | #define V3_VENDOR_ID 0x11B0 /* V3 vendor ID number */ | ||
23 | #define V3_DEVICE_ID 0x0002 /* V3 device ID number */ | ||
24 | #define SANGOMA_SUBSYS_VENDOR 0x4753 /* ID for Sangoma */ | ||
25 | #define PCI_DEV_SLOT_MASK 0x1F /* mask for slot numbering */ | ||
26 | #define PCI_IRQ_NOT_ALLOCATED 0xFF /* interrupt line for no IRQ */ | ||
27 | |||
28 | /* Local PCI register offsets */ | ||
29 | #define PCI_VENDOR_ID_WORD 0x00 /* vendor ID */ | ||
30 | #define PCI_IO_BASE_DWORD 0x10 /* IO base */ | ||
31 | #define PCI_MEM_BASE0_DWORD 0x14 /* memory base - apperture 0 */ | ||
32 | #define PCI_MEM_BASE1_DWORD 0x18 /* memory base - apperture 1 */ | ||
33 | #define PCI_SUBSYS_VENDOR_WORD 0x2C /* subsystem vendor ID */ | ||
34 | #define PCI_INT_LINE_BYTE 0x3C /* interrupt line */ | ||
35 | #define PCI_INT_PIN_BYTE 0x3D /* interrupt pin */ | ||
36 | #define PCI_MAP0_DWORD 0x40 /* PCI to local bus address 0 */ | ||
37 | #define PCI_MAP1_DWORD 0x44 /* PCI to local bus address 1 */ | ||
38 | #define PCI_INT_STATUS 0x48 /* interrupt status */ | ||
39 | #define PCI_INT_CONFIG 0x4C /* interrupt configuration */ | ||
40 | |||
41 | /* Local PCI register usage */ | ||
42 | #define PCI_MEMORY_ENABLE 0x00000003 /* enable PCI memory */ | ||
43 | #define PCI_CPU_A_MEM_DISABLE 0x00000002 /* disable CPU A memory */ | ||
44 | #define PCI_CPU_B_MEM_DISABLE 0x00100002 /* disable CPU B memory */ | ||
45 | #define PCI_ENABLE_IRQ_CPU_A 0x005A0004 /* enable IRQ for CPU A */ | ||
46 | #define PCI_ENABLE_IRQ_CPU_B 0x005A0008 /* enable IRQ for CPU B */ | ||
47 | #define PCI_DISABLE_IRQ_CPU_A 0x00000004 /* disable IRQ for CPU A */ | ||
48 | #define PCI_DISABLE_IRQ_CPU_B 0x00000008 /* disable IRQ for CPU B */ | ||
49 | |||
50 | /* Setting for the Interrupt Status register */ | ||
51 | #define IRQ_CPU_A 0x04 /* IRQ for CPU A */ | ||
52 | #define IRQ_CPU_B 0x08 /* IRQ for CPU B */ | ||
53 | |||
54 | /* The maximum size of the S514 memory */ | ||
55 | #define MAX_SIZEOF_S514_MEMORY (256 * 1024) | ||
56 | |||
57 | /* S514 control register offsets within the memory address space */ | ||
58 | #define S514_CTRL_REG_BYTE 0x80000 | ||
59 | |||
60 | /* S514 adapter control bytes */ | ||
61 | #define S514_CPU_HALT 0x00 | ||
62 | #define S514_CPU_START 0x01 | ||
63 | |||
64 | /* The maximum number of S514 adapters supported */ | ||
65 | #define MAX_S514_CARDS 20 | ||
66 | |||
67 | #define PCI_CARD_TYPE 0x2E | ||
68 | #define S514_DUAL_CPU 0x12 | ||
69 | #define S514_SINGLE_CPU 0x11 | ||
70 | |||
71 | #endif /* _SDLAPCI_H */ | ||
72 | |||
diff --git a/include/linux/sdlasfm.h b/include/linux/sdlasfm.h deleted file mode 100644 index 94aaa8ada6..0000000000 --- a/include/linux/sdlasfm.h +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdlasfm.h WANPIPE(tm) Multiprotocol WAN Link Driver. | ||
3 | * Definitions for the SDLA Firmware Module (SFM). | ||
4 | * | ||
5 | * Author: Gideon Hack | ||
6 | * | ||
7 | * Copyright: (c) 1995-1999 Sangoma Technologies Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | * ============================================================================ | ||
14 | * Jun 02, 1999 Gideon Hack Added support for the S514 adapter. | ||
15 | * Dec 11, 1996 Gene Kozin Cosmetic changes | ||
16 | * Apr 16, 1996 Gene Kozin Changed adapter & firmware IDs. Version 2 | ||
17 | * Dec 15, 1995 Gene Kozin Structures chaned | ||
18 | * Nov 09, 1995 Gene Kozin Initial version. | ||
19 | *****************************************************************************/ | ||
20 | #ifndef _SDLASFM_H | ||
21 | #define _SDLASFM_H | ||
22 | |||
23 | /****** Defines *************************************************************/ | ||
24 | |||
25 | #define SFM_VERSION 2 | ||
26 | #define SFM_SIGNATURE "SFM - Sangoma SDLA Firmware Module" | ||
27 | |||
28 | /* min/max */ | ||
29 | #define SFM_IMAGE_SIZE 0x8000 /* max size of SDLA code image file */ | ||
30 | #define SFM_DESCR_LEN 256 /* max length of description string */ | ||
31 | #define SFM_MAX_SDLA 16 /* max number of compatible adapters */ | ||
32 | |||
33 | /* Adapter types */ | ||
34 | #define SDLA_S502A 5020 | ||
35 | #define SDLA_S502E 5021 | ||
36 | #define SDLA_S503 5030 | ||
37 | #define SDLA_S508 5080 | ||
38 | #define SDLA_S507 5070 | ||
39 | #define SDLA_S509 5090 | ||
40 | #define SDLA_S514 5140 | ||
41 | |||
42 | /* S514 PCI adapter CPU numbers */ | ||
43 | #define S514_CPU_A 'A' | ||
44 | #define S514_CPU_B 'B' | ||
45 | |||
46 | |||
47 | /* Firmware identification numbers: | ||
48 | * 0 .. 999 Test & Diagnostics | ||
49 | * 1000 .. 1999 Streaming HDLC | ||
50 | * 2000 .. 2999 Bisync | ||
51 | * 3000 .. 3999 SDLC | ||
52 | * 4000 .. 4999 HDLC | ||
53 | * 5000 .. 5999 X.25 | ||
54 | * 6000 .. 6999 Frame Relay | ||
55 | * 7000 .. 7999 PPP | ||
56 | * 8000 .. 8999 Cisco HDLC | ||
57 | */ | ||
58 | #define SFID_CALIB502 200 | ||
59 | #define SFID_STRM502 1200 | ||
60 | #define SFID_STRM508 1800 | ||
61 | #define SFID_BSC502 2200 | ||
62 | #define SFID_SDLC502 3200 | ||
63 | #define SFID_HDLC502 4200 | ||
64 | #define SFID_HDLC508 4800 | ||
65 | #define SFID_X25_502 5200 | ||
66 | #define SFID_X25_508 5800 | ||
67 | #define SFID_FR502 6200 | ||
68 | #define SFID_FR508 6800 | ||
69 | #define SFID_PPP502 7200 | ||
70 | #define SFID_PPP508 7800 | ||
71 | #define SFID_PPP514 7140 | ||
72 | #define SFID_CHDLC508 8800 | ||
73 | #define SFID_CHDLC514 8140 | ||
74 | |||
75 | /****** Data Types **********************************************************/ | ||
76 | |||
77 | typedef struct sfm_info /* firmware module information */ | ||
78 | { | ||
79 | unsigned short codeid; /* firmware ID */ | ||
80 | unsigned short version; /* firmaware version number */ | ||
81 | unsigned short adapter[SFM_MAX_SDLA]; /* compatible adapter types */ | ||
82 | unsigned long memsize; /* minimum memory size */ | ||
83 | unsigned short reserved[2]; /* reserved */ | ||
84 | unsigned short startoffs; /* entry point offset */ | ||
85 | unsigned short winoffs; /* dual-port memory window offset */ | ||
86 | unsigned short codeoffs; /* code load offset */ | ||
87 | unsigned short codesize; /* code size */ | ||
88 | unsigned short dataoffs; /* configuration data load offset */ | ||
89 | unsigned short datasize; /* configuration data size */ | ||
90 | } sfm_info_t; | ||
91 | |||
92 | typedef struct sfm /* SDLA firmware file structire */ | ||
93 | { | ||
94 | char signature[80]; /* SFM file signature */ | ||
95 | unsigned short version; /* file format version */ | ||
96 | unsigned short checksum; /* info + image */ | ||
97 | unsigned short reserved[6]; /* reserved */ | ||
98 | char descr[SFM_DESCR_LEN]; /* description string */ | ||
99 | sfm_info_t info; /* firmware module info */ | ||
100 | unsigned char image[1]; /* code image (variable size) */ | ||
101 | } sfm_t; | ||
102 | |||
103 | #endif /* _SDLASFM_H */ | ||
104 | |||
diff --git a/include/linux/security.h b/include/linux/security.h index aaa0a5cdbf..1bab48f6ae 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -869,11 +869,6 @@ struct swap_info_struct; | |||
869 | * @ipcp contains the kernel IPC permission structure | 869 | * @ipcp contains the kernel IPC permission structure |
870 | * @flag contains the desired (requested) permission set | 870 | * @flag contains the desired (requested) permission set |
871 | * Return 0 if permission is granted. | 871 | * Return 0 if permission is granted. |
872 | * @ipc_getsecurity: | ||
873 | * Copy the security label associated with the ipc object into | ||
874 | * @buffer. @buffer may be NULL to request the size of the buffer | ||
875 | * required. @size indicates the size of @buffer in bytes. Return | ||
876 | * number of bytes used/required on success. | ||
877 | * | 872 | * |
878 | * Security hooks for individual messages held in System V IPC message queues | 873 | * Security hooks for individual messages held in System V IPC message queues |
879 | * @msg_msg_alloc_security: | 874 | * @msg_msg_alloc_security: |
@@ -1223,7 +1218,6 @@ struct security_operations { | |||
1223 | void (*task_to_inode)(struct task_struct *p, struct inode *inode); | 1218 | void (*task_to_inode)(struct task_struct *p, struct inode *inode); |
1224 | 1219 | ||
1225 | int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag); | 1220 | int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag); |
1226 | int (*ipc_getsecurity)(struct kern_ipc_perm *ipcp, void *buffer, size_t size); | ||
1227 | 1221 | ||
1228 | int (*msg_msg_alloc_security) (struct msg_msg * msg); | 1222 | int (*msg_msg_alloc_security) (struct msg_msg * msg); |
1229 | void (*msg_msg_free_security) (struct msg_msg * msg); | 1223 | void (*msg_msg_free_security) (struct msg_msg * msg); |
@@ -1887,11 +1881,6 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp, | |||
1887 | return security_ops->ipc_permission (ipcp, flag); | 1881 | return security_ops->ipc_permission (ipcp, flag); |
1888 | } | 1882 | } |
1889 | 1883 | ||
1890 | static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size) | ||
1891 | { | ||
1892 | return security_ops->ipc_getsecurity(ipcp, buffer, size); | ||
1893 | } | ||
1894 | |||
1895 | static inline int security_msg_msg_alloc (struct msg_msg * msg) | 1884 | static inline int security_msg_msg_alloc (struct msg_msg * msg) |
1896 | { | 1885 | { |
1897 | return security_ops->msg_msg_alloc_security (msg); | 1886 | return security_ops->msg_msg_alloc_security (msg); |
@@ -2532,11 +2521,6 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp, | |||
2532 | return 0; | 2521 | return 0; |
2533 | } | 2522 | } |
2534 | 2523 | ||
2535 | static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size) | ||
2536 | { | ||
2537 | return -EOPNOTSUPP; | ||
2538 | } | ||
2539 | |||
2540 | static inline int security_msg_msg_alloc (struct msg_msg * msg) | 2524 | static inline int security_msg_msg_alloc (struct msg_msg * msg) |
2541 | { | 2525 | { |
2542 | return 0; | 2526 | return 0; |
diff --git a/include/linux/selinux.h b/include/linux/selinux.h new file mode 100644 index 0000000000..4047bcde44 --- /dev/null +++ b/include/linux/selinux.h | |||
@@ -0,0 +1,177 @@ | |||
1 | /* | ||
2 | * SELinux services exported to the rest of the kernel. | ||
3 | * | ||
4 | * Author: James Morris <jmorris@redhat.com> | ||
5 | * | ||
6 | * Copyright (C) 2005 Red Hat, Inc., James Morris <jmorris@redhat.com> | ||
7 | * Copyright (C) 2006 Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com> | ||
8 | * Copyright (C) 2006 IBM Corporation, Timothy R. Chavez <tinytim@us.ibm.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2, | ||
12 | * as published by the Free Software Foundation. | ||
13 | */ | ||
14 | #ifndef _LINUX_SELINUX_H | ||
15 | #define _LINUX_SELINUX_H | ||
16 | |||
17 | struct selinux_audit_rule; | ||
18 | struct audit_context; | ||
19 | struct inode; | ||
20 | struct kern_ipc_perm; | ||
21 | |||
22 | #ifdef CONFIG_SECURITY_SELINUX | ||
23 | |||
24 | /** | ||
25 | * selinux_audit_rule_init - alloc/init an selinux audit rule structure. | ||
26 | * @field: the field this rule refers to | ||
27 | * @op: the operater the rule uses | ||
28 | * @rulestr: the text "target" of the rule | ||
29 | * @rule: pointer to the new rule structure returned via this | ||
30 | * | ||
31 | * Returns 0 if successful, -errno if not. On success, the rule structure | ||
32 | * will be allocated internally. The caller must free this structure with | ||
33 | * selinux_audit_rule_free() after use. | ||
34 | */ | ||
35 | int selinux_audit_rule_init(u32 field, u32 op, char *rulestr, | ||
36 | struct selinux_audit_rule **rule); | ||
37 | |||
38 | /** | ||
39 | * selinux_audit_rule_free - free an selinux audit rule structure. | ||
40 | * @rule: pointer to the audit rule to be freed | ||
41 | * | ||
42 | * This will free all memory associated with the given rule. | ||
43 | * If @rule is NULL, no operation is performed. | ||
44 | */ | ||
45 | void selinux_audit_rule_free(struct selinux_audit_rule *rule); | ||
46 | |||
47 | /** | ||
48 | * selinux_audit_rule_match - determine if a context ID matches a rule. | ||
49 | * @ctxid: the context ID to check | ||
50 | * @field: the field this rule refers to | ||
51 | * @op: the operater the rule uses | ||
52 | * @rule: pointer to the audit rule to check against | ||
53 | * @actx: the audit context (can be NULL) associated with the check | ||
54 | * | ||
55 | * Returns 1 if the context id matches the rule, 0 if it does not, and | ||
56 | * -errno on failure. | ||
57 | */ | ||
58 | int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op, | ||
59 | struct selinux_audit_rule *rule, | ||
60 | struct audit_context *actx); | ||
61 | |||
62 | /** | ||
63 | * selinux_audit_set_callback - set the callback for policy reloads. | ||
64 | * @callback: the function to call when the policy is reloaded | ||
65 | * | ||
66 | * This sets the function callback function that will update the rules | ||
67 | * upon policy reloads. This callback should rebuild all existing rules | ||
68 | * using selinux_audit_rule_init(). | ||
69 | */ | ||
70 | void selinux_audit_set_callback(int (*callback)(void)); | ||
71 | |||
72 | /** | ||
73 | * selinux_task_ctxid - determine a context ID for a process. | ||
74 | * @tsk: the task object | ||
75 | * @ctxid: ID value returned via this | ||
76 | * | ||
77 | * On return, ctxid will contain an ID for the context. This value | ||
78 | * should only be used opaquely. | ||
79 | */ | ||
80 | void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid); | ||
81 | |||
82 | /** | ||
83 | * selinux_ctxid_to_string - map a security context ID to a string | ||
84 | * @ctxid: security context ID to be converted. | ||
85 | * @ctx: address of context string to be returned | ||
86 | * @ctxlen: length of returned context string. | ||
87 | * | ||
88 | * Returns 0 if successful, -errno if not. On success, the context | ||
89 | * string will be allocated internally, and the caller must call | ||
90 | * kfree() on it after use. | ||
91 | */ | ||
92 | int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen); | ||
93 | |||
94 | /** | ||
95 | * selinux_get_inode_sid - get the inode's security context ID | ||
96 | * @inode: inode structure to get the sid from. | ||
97 | * @sid: pointer to security context ID to be filled in. | ||
98 | * | ||
99 | * Returns nothing | ||
100 | */ | ||
101 | void selinux_get_inode_sid(const struct inode *inode, u32 *sid); | ||
102 | |||
103 | /** | ||
104 | * selinux_get_ipc_sid - get the ipc security context ID | ||
105 | * @ipcp: ipc structure to get the sid from. | ||
106 | * @sid: pointer to security context ID to be filled in. | ||
107 | * | ||
108 | * Returns nothing | ||
109 | */ | ||
110 | void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid); | ||
111 | |||
112 | /** | ||
113 | * selinux_get_task_sid - return the SID of task | ||
114 | * @tsk: the task whose SID will be returned | ||
115 | * @sid: pointer to security context ID to be filled in. | ||
116 | * | ||
117 | * Returns nothing | ||
118 | */ | ||
119 | void selinux_get_task_sid(struct task_struct *tsk, u32 *sid); | ||
120 | |||
121 | |||
122 | #else | ||
123 | |||
124 | static inline int selinux_audit_rule_init(u32 field, u32 op, | ||
125 | char *rulestr, | ||
126 | struct selinux_audit_rule **rule) | ||
127 | { | ||
128 | return -ENOTSUPP; | ||
129 | } | ||
130 | |||
131 | static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule) | ||
132 | { | ||
133 | return; | ||
134 | } | ||
135 | |||
136 | static inline int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op, | ||
137 | struct selinux_audit_rule *rule, | ||
138 | struct audit_context *actx) | ||
139 | { | ||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | static inline void selinux_audit_set_callback(int (*callback)(void)) | ||
144 | { | ||
145 | return; | ||
146 | } | ||
147 | |||
148 | static inline void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid) | ||
149 | { | ||
150 | *ctxid = 0; | ||
151 | } | ||
152 | |||
153 | static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen) | ||
154 | { | ||
155 | *ctx = NULL; | ||
156 | *ctxlen = 0; | ||
157 | return 0; | ||
158 | } | ||
159 | |||
160 | static inline void selinux_get_inode_sid(const struct inode *inode, u32 *sid) | ||
161 | { | ||
162 | *sid = 0; | ||
163 | } | ||
164 | |||
165 | static inline void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid) | ||
166 | { | ||
167 | *sid = 0; | ||
168 | } | ||
169 | |||
170 | static inline void selinux_get_task_sid(struct task_struct *tsk, u32 *sid) | ||
171 | { | ||
172 | *sid = 0; | ||
173 | } | ||
174 | |||
175 | #endif /* CONFIG_SECURITY_SELINUX */ | ||
176 | |||
177 | #endif /* _LINUX_SELINUX_H */ | ||
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index fca9b0fb5b..5a09557288 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -73,7 +73,7 @@ static inline int write_tryseqlock(seqlock_t *sl) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /* Start of read calculation -- fetch last complete writer token */ | 75 | /* Start of read calculation -- fetch last complete writer token */ |
76 | static inline unsigned read_seqbegin(const seqlock_t *sl) | 76 | static __always_inline unsigned read_seqbegin(const seqlock_t *sl) |
77 | { | 77 | { |
78 | unsigned ret = sl->sequence; | 78 | unsigned ret = sl->sequence; |
79 | smp_rmb(); | 79 | smp_rmb(); |
@@ -88,7 +88,7 @@ static inline unsigned read_seqbegin(const seqlock_t *sl) | |||
88 | * | 88 | * |
89 | * Using xor saves one conditional branch. | 89 | * Using xor saves one conditional branch. |
90 | */ | 90 | */ |
91 | static inline int read_seqretry(const seqlock_t *sl, unsigned iv) | 91 | static __always_inline int read_seqretry(const seqlock_t *sl, unsigned iv) |
92 | { | 92 | { |
93 | smp_rmb(); | 93 | smp_rmb(); |
94 | return (iv & 1) | (sl->sequence ^ iv); | 94 | return (iv & 1) | (sl->sequence ^ iv); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index c32e60e79d..bd14858121 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -254,6 +254,7 @@ struct uart_port { | |||
254 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) | 254 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
255 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) | 255 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) |
256 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) | 256 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) |
257 | #define UPF_DEAD ((__force upf_t) (1 << 30)) | ||
257 | #define UPF_IOREMAP ((__force upf_t) (1 << 31)) | 258 | #define UPF_IOREMAP ((__force upf_t) (1 << 31)) |
258 | 259 | ||
259 | #define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) | 260 | #define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) |
diff --git a/include/linux/serio.h b/include/linux/serio.h index 690aabca8e..6348e83308 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/list.h> | 19 | #include <linux/list.h> |
20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
21 | #include <linux/mutex.h> | ||
21 | #include <linux/device.h> | 22 | #include <linux/device.h> |
22 | #include <linux/mod_devicetable.h> | 23 | #include <linux/mod_devicetable.h> |
23 | 24 | ||
@@ -42,7 +43,7 @@ struct serio { | |||
42 | struct serio *parent, *child; | 43 | struct serio *parent, *child; |
43 | 44 | ||
44 | struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ | 45 | struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ |
45 | struct semaphore drv_sem; /* protects serio->drv so attributes can pin driver */ | 46 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ |
46 | 47 | ||
47 | struct device dev; | 48 | struct device dev; |
48 | unsigned int registered; /* port has been fully registered with driver core */ | 49 | unsigned int registered; /* port has been fully registered with driver core */ |
@@ -151,17 +152,17 @@ static inline void serio_continue_rx(struct serio *serio) | |||
151 | */ | 152 | */ |
152 | static inline int serio_pin_driver(struct serio *serio) | 153 | static inline int serio_pin_driver(struct serio *serio) |
153 | { | 154 | { |
154 | return down_interruptible(&serio->drv_sem); | 155 | return mutex_lock_interruptible(&serio->drv_mutex); |
155 | } | 156 | } |
156 | 157 | ||
157 | static inline void serio_pin_driver_uninterruptible(struct serio *serio) | 158 | static inline void serio_pin_driver_uninterruptible(struct serio *serio) |
158 | { | 159 | { |
159 | down(&serio->drv_sem); | 160 | mutex_lock(&serio->drv_mutex); |
160 | } | 161 | } |
161 | 162 | ||
162 | static inline void serio_unpin_driver(struct serio *serio) | 163 | static inline void serio_unpin_driver(struct serio *serio) |
163 | { | 164 | { |
164 | up(&serio->drv_sem); | 165 | mutex_unlock(&serio->drv_mutex); |
165 | } | 166 | } |
166 | 167 | ||
167 | 168 | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index 162a8fd10b..70739f51a0 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -14,10 +14,12 @@ | |||
14 | * | 14 | * |
15 | * SA_INTERRUPT is also used by the irq handling routines. | 15 | * SA_INTERRUPT is also used by the irq handling routines. |
16 | * SA_SHIRQ is for shared interrupt support on PCI and EISA. | 16 | * SA_SHIRQ is for shared interrupt support on PCI and EISA. |
17 | * SA_PROBEIRQ is set by callers when they expect sharing mismatches to occur | ||
17 | */ | 18 | */ |
18 | #define SA_PROBE SA_ONESHOT | ||
19 | #define SA_SAMPLE_RANDOM SA_RESTART | 19 | #define SA_SAMPLE_RANDOM SA_RESTART |
20 | #define SA_SHIRQ 0x04000000 | 20 | #define SA_SHIRQ 0x04000000 |
21 | #define SA_PROBEIRQ 0x08000000 | ||
22 | |||
21 | /* | 23 | /* |
22 | * As above, these correspond to the IORESOURCE_IRQ_* defines in | 24 | * As above, these correspond to the IORESOURCE_IRQ_* defines in |
23 | * linux/ioport.h to select the interrupt line behaviour. When | 25 | * linux/ioport.h to select the interrupt line behaviour. When |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index c4619a428d..f8f234708b 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -344,6 +344,13 @@ extern void skb_over_panic(struct sk_buff *skb, int len, | |||
344 | void *here); | 344 | void *here); |
345 | extern void skb_under_panic(struct sk_buff *skb, int len, | 345 | extern void skb_under_panic(struct sk_buff *skb, int len, |
346 | void *here); | 346 | void *here); |
347 | extern void skb_truesize_bug(struct sk_buff *skb); | ||
348 | |||
349 | static inline void skb_truesize_check(struct sk_buff *skb) | ||
350 | { | ||
351 | if (unlikely((int)skb->truesize < sizeof(struct sk_buff) + skb->len)) | ||
352 | skb_truesize_bug(skb); | ||
353 | } | ||
347 | 354 | ||
348 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | 355 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, |
349 | int getfrag(void *from, char *to, int offset, | 356 | int getfrag(void *from, char *to, int offset, |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 3af03b19c9..2d985d59c7 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -150,6 +150,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
150 | 150 | ||
151 | extern void kfree(const void *); | 151 | extern void kfree(const void *); |
152 | extern unsigned int ksize(const void *); | 152 | extern unsigned int ksize(const void *); |
153 | extern int slab_is_available(void); | ||
153 | 154 | ||
154 | #ifdef CONFIG_NUMA | 155 | #ifdef CONFIG_NUMA |
155 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); | 156 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 72261e0f2a..adb3dafd33 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -14,5 +14,12 @@ struct ads7846_platform_data { | |||
14 | u16 x_min, x_max; | 14 | u16 x_min, x_max; |
15 | u16 y_min, y_max; | 15 | u16 y_min, y_max; |
16 | u16 pressure_min, pressure_max; | 16 | u16 pressure_min, pressure_max; |
17 | |||
18 | u16 debounce_max; /* max number of additional readings | ||
19 | * per sample */ | ||
20 | u16 debounce_tol; /* tolerance used for filtering */ | ||
21 | u16 debounce_rep; /* additional consecutive good readings | ||
22 | * required after the first two */ | ||
23 | int (*get_pendown_state)(void); | ||
17 | }; | 24 | }; |
18 | 25 | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index b05f1463a2..e928c0dcc2 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -31,18 +31,23 @@ extern struct bus_type spi_bus_type; | |||
31 | * @master: SPI controller used with the device. | 31 | * @master: SPI controller used with the device. |
32 | * @max_speed_hz: Maximum clock rate to be used with this chip | 32 | * @max_speed_hz: Maximum clock rate to be used with this chip |
33 | * (on this board); may be changed by the device's driver. | 33 | * (on this board); may be changed by the device's driver. |
34 | * The spi_transfer.speed_hz can override this for each transfer. | ||
34 | * @chip-select: Chipselect, distinguishing chips handled by "master". | 35 | * @chip-select: Chipselect, distinguishing chips handled by "master". |
35 | * @mode: The spi mode defines how data is clocked out and in. | 36 | * @mode: The spi mode defines how data is clocked out and in. |
36 | * This may be changed by the device's driver. | 37 | * This may be changed by the device's driver. |
38 | * The "active low" default for chipselect mode can be overridden, | ||
39 | * as can the "MSB first" default for each word in a transfer. | ||
37 | * @bits_per_word: Data transfers involve one or more words; word sizes | 40 | * @bits_per_word: Data transfers involve one or more words; word sizes |
38 | * like eight or 12 bits are common. In-memory wordsizes are | 41 | * like eight or 12 bits are common. In-memory wordsizes are |
39 | * powers of two bytes (e.g. 20 bit samples use 32 bits). | 42 | * powers of two bytes (e.g. 20 bit samples use 32 bits). |
40 | * This may be changed by the device's driver. | 43 | * This may be changed by the device's driver, or left at the |
44 | * default (0) indicating protocol words are eight bit bytes. | ||
45 | * The spi_transfer.bits_per_word can override this for each transfer. | ||
41 | * @irq: Negative, or the number passed to request_irq() to receive | 46 | * @irq: Negative, or the number passed to request_irq() to receive |
42 | * interrupts from this device. | 47 | * interrupts from this device. |
43 | * @controller_state: Controller's runtime state | 48 | * @controller_state: Controller's runtime state |
44 | * @controller_data: Board-specific definitions for controller, such as | 49 | * @controller_data: Board-specific definitions for controller, such as |
45 | * FIFO initialization parameters; from board_info.controller_data | 50 | * FIFO initialization parameters; from board_info.controller_data |
46 | * | 51 | * |
47 | * An spi_device is used to interchange data between an SPI slave | 52 | * An spi_device is used to interchange data between an SPI slave |
48 | * (usually a discrete chip) and CPU memory. | 53 | * (usually a discrete chip) and CPU memory. |
@@ -65,6 +70,7 @@ struct spi_device { | |||
65 | #define SPI_MODE_2 (SPI_CPOL|0) | 70 | #define SPI_MODE_2 (SPI_CPOL|0) |
66 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) | 71 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) |
67 | #define SPI_CS_HIGH 0x04 /* chipselect active high? */ | 72 | #define SPI_CS_HIGH 0x04 /* chipselect active high? */ |
73 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ | ||
68 | u8 bits_per_word; | 74 | u8 bits_per_word; |
69 | int irq; | 75 | int irq; |
70 | void *controller_state; | 76 | void *controller_state; |
@@ -73,7 +79,6 @@ struct spi_device { | |||
73 | 79 | ||
74 | // likely need more hooks for more protocol options affecting how | 80 | // likely need more hooks for more protocol options affecting how |
75 | // the controller talks to each chip, like: | 81 | // the controller talks to each chip, like: |
76 | // - bit order (default is wordwise msb-first) | ||
77 | // - memory packing (12 bit samples into low bits, others zeroed) | 82 | // - memory packing (12 bit samples into low bits, others zeroed) |
78 | // - priority | 83 | // - priority |
79 | // - drop chipselect after each word | 84 | // - drop chipselect after each word |
@@ -143,13 +148,13 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
143 | * struct spi_master - interface to SPI master controller | 148 | * struct spi_master - interface to SPI master controller |
144 | * @cdev: class interface to this driver | 149 | * @cdev: class interface to this driver |
145 | * @bus_num: board-specific (and often SOC-specific) identifier for a | 150 | * @bus_num: board-specific (and often SOC-specific) identifier for a |
146 | * given SPI controller. | 151 | * given SPI controller. |
147 | * @num_chipselect: chipselects are used to distinguish individual | 152 | * @num_chipselect: chipselects are used to distinguish individual |
148 | * SPI slaves, and are numbered from zero to num_chipselects. | 153 | * SPI slaves, and are numbered from zero to num_chipselects. |
149 | * each slave has a chipselect signal, but it's common that not | 154 | * each slave has a chipselect signal, but it's common that not |
150 | * every chipselect is connected to a slave. | 155 | * every chipselect is connected to a slave. |
151 | * @setup: updates the device mode and clocking records used by a | 156 | * @setup: updates the device mode and clocking records used by a |
152 | * device's SPI controller; protocol code may call this. | 157 | * device's SPI controller; protocol code may call this. |
153 | * @transfer: adds a message to the controller's transfer queue. | 158 | * @transfer: adds a message to the controller's transfer queue. |
154 | * @cleanup: frees controller-specific state | 159 | * @cleanup: frees controller-specific state |
155 | * | 160 | * |
@@ -167,13 +172,13 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
167 | struct spi_master { | 172 | struct spi_master { |
168 | struct class_device cdev; | 173 | struct class_device cdev; |
169 | 174 | ||
170 | /* other than zero (== assign one dynamically), bus_num is fully | 175 | /* other than negative (== assign one dynamically), bus_num is fully |
171 | * board-specific. usually that simplifies to being SOC-specific. | 176 | * board-specific. usually that simplifies to being SOC-specific. |
172 | * example: one SOC has three SPI controllers, numbered 1..3, | 177 | * example: one SOC has three SPI controllers, numbered 0..2, |
173 | * and one board's schematics might show it using SPI-2. software | 178 | * and one board's schematics might show it using SPI-2. software |
174 | * would normally use bus_num=2 for that controller. | 179 | * would normally use bus_num=2 for that controller. |
175 | */ | 180 | */ |
176 | u16 bus_num; | 181 | s16 bus_num; |
177 | 182 | ||
178 | /* chipselects will be integral to many controllers; some others | 183 | /* chipselects will be integral to many controllers; some others |
179 | * might use board-specific GPIOs. | 184 | * might use board-specific GPIOs. |
@@ -268,10 +273,14 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum); | |||
268 | * @tx_dma: DMA address of tx_buf, if spi_message.is_dma_mapped | 273 | * @tx_dma: DMA address of tx_buf, if spi_message.is_dma_mapped |
269 | * @rx_dma: DMA address of rx_buf, if spi_message.is_dma_mapped | 274 | * @rx_dma: DMA address of rx_buf, if spi_message.is_dma_mapped |
270 | * @len: size of rx and tx buffers (in bytes) | 275 | * @len: size of rx and tx buffers (in bytes) |
276 | * @speed_hz: Select a speed other then the device default for this | ||
277 | * transfer. If 0 the default (from spi_device) is used. | ||
278 | * @bits_per_word: select a bits_per_word other then the device default | ||
279 | * for this transfer. If 0 the default (from spi_device) is used. | ||
271 | * @cs_change: affects chipselect after this transfer completes | 280 | * @cs_change: affects chipselect after this transfer completes |
272 | * @delay_usecs: microseconds to delay after this transfer before | 281 | * @delay_usecs: microseconds to delay after this transfer before |
273 | * (optionally) changing the chipselect status, then starting | 282 | * (optionally) changing the chipselect status, then starting |
274 | * the next transfer or completing this spi_message. | 283 | * the next transfer or completing this spi_message. |
275 | * @transfer_list: transfers are sequenced through spi_message.transfers | 284 | * @transfer_list: transfers are sequenced through spi_message.transfers |
276 | * | 285 | * |
277 | * SPI transfers always write the same number of bytes as they read. | 286 | * SPI transfers always write the same number of bytes as they read. |
@@ -322,7 +331,9 @@ struct spi_transfer { | |||
322 | dma_addr_t rx_dma; | 331 | dma_addr_t rx_dma; |
323 | 332 | ||
324 | unsigned cs_change:1; | 333 | unsigned cs_change:1; |
334 | u8 bits_per_word; | ||
325 | u16 delay_usecs; | 335 | u16 delay_usecs; |
336 | u32 speed_hz; | ||
326 | 337 | ||
327 | struct list_head transfer_list; | 338 | struct list_head transfer_list; |
328 | }; | 339 | }; |
@@ -356,7 +367,7 @@ struct spi_transfer { | |||
356 | * and its transfers, ignore them until its completion callback. | 367 | * and its transfers, ignore them until its completion callback. |
357 | */ | 368 | */ |
358 | struct spi_message { | 369 | struct spi_message { |
359 | struct list_head transfers; | 370 | struct list_head transfers; |
360 | 371 | ||
361 | struct spi_device *spi; | 372 | struct spi_device *spi; |
362 | 373 | ||
@@ -374,7 +385,7 @@ struct spi_message { | |||
374 | */ | 385 | */ |
375 | 386 | ||
376 | /* completion is reported through a callback */ | 387 | /* completion is reported through a callback */ |
377 | void (*complete)(void *context); | 388 | void (*complete)(void *context); |
378 | void *context; | 389 | void *context; |
379 | unsigned actual_length; | 390 | unsigned actual_length; |
380 | int status; | 391 | int status; |
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index c961fe9bf3..16ce178f54 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
@@ -30,6 +30,12 @@ struct spi_bitbang { | |||
30 | 30 | ||
31 | struct spi_master *master; | 31 | struct spi_master *master; |
32 | 32 | ||
33 | /* setup_transfer() changes clock and/or wordsize to match settings | ||
34 | * for this transfer; zeroes restore defaults from spi_device. | ||
35 | */ | ||
36 | int (*setup_transfer)(struct spi_device *spi, | ||
37 | struct spi_transfer *t); | ||
38 | |||
33 | void (*chipselect)(struct spi_device *spi, int is_on); | 39 | void (*chipselect)(struct spi_device *spi, int is_on); |
34 | #define BITBANG_CS_ACTIVE 1 /* normally nCS, active low */ | 40 | #define BITBANG_CS_ACTIVE 1 /* normally nCS, active low */ |
35 | #define BITBANG_CS_INACTIVE 0 | 41 | #define BITBANG_CS_INACTIVE 0 |
@@ -51,6 +57,8 @@ struct spi_bitbang { | |||
51 | extern int spi_bitbang_setup(struct spi_device *spi); | 57 | extern int spi_bitbang_setup(struct spi_device *spi); |
52 | extern void spi_bitbang_cleanup(const struct spi_device *spi); | 58 | extern void spi_bitbang_cleanup(const struct spi_device *spi); |
53 | extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); | 59 | extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); |
60 | extern int spi_bitbang_setup_transfer(struct spi_device *spi, | ||
61 | struct spi_transfer *t); | ||
54 | 62 | ||
55 | /* start or stop queue processing */ | 63 | /* start or stop queue processing */ |
56 | extern int spi_bitbang_start(struct spi_bitbang *spi); | 64 | extern int spi_bitbang_start(struct spi_bitbang *spi); |
diff --git a/include/linux/string.h b/include/linux/string.h index dee221429a..c61306da8c 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -13,11 +13,6 @@ | |||
13 | extern "C" { | 13 | extern "C" { |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | extern char * strpbrk(const char *,const char *); | ||
17 | extern char * strsep(char **,const char *); | ||
18 | extern __kernel_size_t strspn(const char *,const char *); | ||
19 | extern __kernel_size_t strcspn(const char *,const char *); | ||
20 | |||
21 | extern char *strndup_user(const char __user *, long); | 16 | extern char *strndup_user(const char __user *, long); |
22 | 17 | ||
23 | /* | 18 | /* |
@@ -70,6 +65,18 @@ extern __kernel_size_t strlen(const char *); | |||
70 | #ifndef __HAVE_ARCH_STRNLEN | 65 | #ifndef __HAVE_ARCH_STRNLEN |
71 | extern __kernel_size_t strnlen(const char *,__kernel_size_t); | 66 | extern __kernel_size_t strnlen(const char *,__kernel_size_t); |
72 | #endif | 67 | #endif |
68 | #ifndef __HAVE_ARCH_STRPBRK | ||
69 | extern char * strpbrk(const char *,const char *); | ||
70 | #endif | ||
71 | #ifndef __HAVE_ARCH_STRSEP | ||
72 | extern char * strsep(char **,const char *); | ||
73 | #endif | ||
74 | #ifndef __HAVE_ARCH_STRSPN | ||
75 | extern __kernel_size_t strspn(const char *,const char *); | ||
76 | #endif | ||
77 | #ifndef __HAVE_ARCH_STRCSPN | ||
78 | extern __kernel_size_t strcspn(const char *,const char *); | ||
79 | #endif | ||
73 | 80 | ||
74 | #ifndef __HAVE_ARCH_MEMSET | 81 | #ifndef __HAVE_ARCH_MEMSET |
75 | extern void * memset(void *,int,__kernel_size_t); | 82 | extern void * memset(void *,int,__kernel_size_t); |
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h index 8f96e9dc36..77f78e56c4 100644 --- a/include/linux/sunrpc/metrics.h +++ b/include/linux/sunrpc/metrics.h | |||
@@ -69,9 +69,21 @@ struct rpc_clnt; | |||
69 | /* | 69 | /* |
70 | * EXPORTed functions for managing rpc_iostats structures | 70 | * EXPORTed functions for managing rpc_iostats structures |
71 | */ | 71 | */ |
72 | |||
73 | #ifdef CONFIG_PROC_FS | ||
74 | |||
72 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); | 75 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); |
73 | void rpc_count_iostats(struct rpc_task *); | 76 | void rpc_count_iostats(struct rpc_task *); |
74 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); | 77 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); |
75 | void rpc_free_iostats(struct rpc_iostats *); | 78 | void rpc_free_iostats(struct rpc_iostats *); |
76 | 79 | ||
80 | #else /* CONFIG_PROC_FS */ | ||
81 | |||
82 | static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; } | ||
83 | static inline void rpc_count_iostats(struct rpc_task *task) {} | ||
84 | static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {} | ||
85 | static inline void rpc_free_iostats(struct rpc_iostats *stats) {} | ||
86 | |||
87 | #endif /* CONFIG_PROC_FS */ | ||
88 | |||
77 | #endif /* _LINUX_SUNRPC_METRICS_H */ | 89 | #endif /* _LINUX_SUNRPC_METRICS_H */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 50cab2a09f..5035643845 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -197,15 +197,16 @@ svc_take_res_page(struct svc_rqst *rqstp) | |||
197 | return rqstp->rq_respages[rqstp->rq_resused++]; | 197 | return rqstp->rq_respages[rqstp->rq_resused++]; |
198 | } | 198 | } |
199 | 199 | ||
200 | static inline int svc_take_page(struct svc_rqst *rqstp) | 200 | static inline void svc_take_page(struct svc_rqst *rqstp) |
201 | { | 201 | { |
202 | if (rqstp->rq_arghi <= rqstp->rq_argused) | 202 | if (rqstp->rq_arghi <= rqstp->rq_argused) { |
203 | return -ENOMEM; | 203 | WARN_ON(1); |
204 | return; | ||
205 | } | ||
204 | rqstp->rq_arghi--; | 206 | rqstp->rq_arghi--; |
205 | rqstp->rq_respages[rqstp->rq_resused] = | 207 | rqstp->rq_respages[rqstp->rq_resused] = |
206 | rqstp->rq_argpages[rqstp->rq_arghi]; | 208 | rqstp->rq_argpages[rqstp->rq_arghi]; |
207 | rqstp->rq_resused++; | 209 | rqstp->rq_resused++; |
208 | return 0; | ||
209 | } | 210 | } |
210 | 211 | ||
211 | static inline void svc_pushback_allpages(struct svc_rqst *rqstp) | 212 | static inline void svc_pushback_allpages(struct svc_rqst *rqstp) |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 7eebbab716..e8bbe8118d 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -53,6 +53,7 @@ struct rpc_timeout { | |||
53 | 53 | ||
54 | struct rpc_task; | 54 | struct rpc_task; |
55 | struct rpc_xprt; | 55 | struct rpc_xprt; |
56 | struct seq_file; | ||
56 | 57 | ||
57 | /* | 58 | /* |
58 | * This describes a complete RPC request | 59 | * This describes a complete RPC request |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 54eac8a39a..f03c247193 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -155,6 +155,7 @@ extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct * | |||
155 | /* linux/mm/page_alloc.c */ | 155 | /* linux/mm/page_alloc.c */ |
156 | extern unsigned long totalram_pages; | 156 | extern unsigned long totalram_pages; |
157 | extern unsigned long totalhigh_pages; | 157 | extern unsigned long totalhigh_pages; |
158 | extern unsigned long totalreserve_pages; | ||
158 | extern long nr_swap_pages; | 159 | extern long nr_swap_pages; |
159 | extern unsigned int nr_free_pages(void); | 160 | extern unsigned int nr_free_pages(void); |
160 | extern unsigned int nr_free_pages_pgdat(pg_data_t *pgdat); | 161 | extern unsigned int nr_free_pages_pgdat(pg_data_t *pgdat); |
@@ -295,7 +296,7 @@ static inline void disable_swap_token(void) | |||
295 | #define read_swap_cache_async(swp,vma,addr) NULL | 296 | #define read_swap_cache_async(swp,vma,addr) NULL |
296 | #define lookup_swap_cache(swp) NULL | 297 | #define lookup_swap_cache(swp) NULL |
297 | #define valid_swaphandles(swp, off) 0 | 298 | #define valid_swaphandles(swp, off) 0 |
298 | #define can_share_swap_page(p) 0 | 299 | #define can_share_swap_page(p) (page_mapcount(p) == 1) |
299 | #define move_to_swap_cache(p, swp) 1 | 300 | #define move_to_swap_cache(p, swp) 1 |
300 | #define move_from_swap_cache(p, i, m) 1 | 301 | #define move_from_swap_cache(p, i, m) 1 |
301 | #define __delete_from_swap_cache(p) /*NOTHING*/ | 302 | #define __delete_from_swap_cache(p) /*NOTHING*/ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 5717147596..60d49e5456 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -52,6 +52,7 @@ struct utimbuf; | |||
52 | struct mq_attr; | 52 | struct mq_attr; |
53 | struct compat_stat; | 53 | struct compat_stat; |
54 | struct compat_timeval; | 54 | struct compat_timeval; |
55 | struct robust_list_head; | ||
55 | 56 | ||
56 | #include <linux/config.h> | 57 | #include <linux/config.h> |
57 | #include <linux/types.h> | 58 | #include <linux/types.h> |
@@ -569,9 +570,22 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | |||
569 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | 570 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, |
570 | int flags, int mode); | 571 | int flags, int mode); |
571 | asmlinkage long sys_unshare(unsigned long unshare_flags); | 572 | asmlinkage long sys_unshare(unsigned long unshare_flags); |
572 | asmlinkage long sys_splice(int fdin, int fdout, size_t len, | 573 | |
573 | unsigned int flags); | 574 | asmlinkage long sys_splice(int fd_in, loff_t __user *off_in, |
575 | int fd_out, loff_t __user *off_out, | ||
576 | size_t len, unsigned int flags); | ||
577 | |||
578 | asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov, | ||
579 | unsigned long nr_segs, unsigned int flags); | ||
580 | |||
581 | asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); | ||
582 | |||
574 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | 583 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, |
575 | int flags); | 584 | unsigned int flags); |
585 | asmlinkage long sys_get_robust_list(int pid, | ||
586 | struct robust_list_head __user **head_ptr, | ||
587 | size_t __user *len_ptr); | ||
588 | asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, | ||
589 | size_t len); | ||
576 | 590 | ||
577 | #endif | 591 | #endif |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 392da5a6da..1ea5d3cda6 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -74,6 +74,7 @@ struct sysfs_dirent { | |||
74 | umode_t s_mode; | 74 | umode_t s_mode; |
75 | struct dentry * s_dentry; | 75 | struct dentry * s_dentry; |
76 | struct iattr * s_iattr; | 76 | struct iattr * s_iattr; |
77 | atomic_t s_event; | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | #define SYSFS_ROOT 0x0001 | 80 | #define SYSFS_ROOT 0x0001 |
@@ -117,6 +118,7 @@ int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); | |||
117 | 118 | ||
118 | int sysfs_create_group(struct kobject *, const struct attribute_group *); | 119 | int sysfs_create_group(struct kobject *, const struct attribute_group *); |
119 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | 120 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); |
121 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | ||
120 | 122 | ||
121 | #else /* CONFIG_SYSFS */ | 123 | #else /* CONFIG_SYSFS */ |
122 | 124 | ||
@@ -185,6 +187,10 @@ static inline void sysfs_remove_group(struct kobject * k, const struct attribute | |||
185 | ; | 187 | ; |
186 | } | 188 | } |
187 | 189 | ||
190 | static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) | ||
191 | { | ||
192 | } | ||
193 | |||
188 | #endif /* CONFIG_SYSFS */ | 194 | #endif /* CONFIG_SYSFS */ |
189 | 195 | ||
190 | #endif /* _SYSFS_H_ */ | 196 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 0976a163b4..31548303ee 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -6,9 +6,10 @@ extern int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *c | |||
6 | extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); | 6 | extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); |
7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); | 7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); |
8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); | 8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); |
9 | void tty_schedule_flip(struct tty_struct *tty); | ||
9 | 10 | ||
10 | static inline int tty_insert_flip_char(struct tty_struct *tty, | 11 | static inline int tty_insert_flip_char(struct tty_struct *tty, |
11 | unsigned char ch, char flag) | 12 | unsigned char ch, char flag) |
12 | { | 13 | { |
13 | struct tty_buffer *tb = tty->buf.tail; | 14 | struct tty_buffer *tb = tty->buf.tail; |
14 | if (tb && tb->active && tb->used < tb->size) { | 15 | if (tb && tb->active && tb->used < tb->size) { |
@@ -19,26 +20,4 @@ static inline int tty_insert_flip_char(struct tty_struct *tty, | |||
19 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); | 20 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); |
20 | } | 21 | } |
21 | 22 | ||
22 | static inline void tty_schedule_flip(struct tty_struct *tty) | ||
23 | { | ||
24 | unsigned long flags; | ||
25 | spin_lock_irqsave(&tty->buf.lock, flags); | ||
26 | if (tty->buf.tail != NULL) { | ||
27 | tty->buf.tail->active = 0; | ||
28 | tty->buf.tail->commit = tty->buf.tail->used; | ||
29 | } | ||
30 | spin_unlock_irqrestore(&tty->buf.lock, flags); | ||
31 | schedule_delayed_work(&tty->buf.work, 1); | ||
32 | } | ||
33 | |||
34 | #undef _INLINE_ | ||
35 | |||
36 | |||
37 | #endif /* _LINUX_TTY_FLIP_H */ | 23 | #endif /* _LINUX_TTY_FLIP_H */ |
38 | |||
39 | |||
40 | |||
41 | |||
42 | |||
43 | |||
44 | |||
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index 0ff7ca68e5..7168302f98 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
@@ -20,7 +20,7 @@ | |||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | * | 21 | * |
22 | * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> | 22 | * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> |
23 | * | 23 | * |
24 | * Changes/Revisions: | 24 | * Changes/Revisions: |
25 | * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) | 25 | * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) |
26 | * - added force feedback support | 26 | * - added force feedback support |
@@ -51,7 +51,7 @@ struct uinput_request { | |||
51 | 51 | ||
52 | struct uinput_device { | 52 | struct uinput_device { |
53 | struct input_dev *dev; | 53 | struct input_dev *dev; |
54 | struct semaphore sem; | 54 | struct mutex mutex; |
55 | enum uinput_state state; | 55 | enum uinput_state state; |
56 | wait_queue_head_t waitq; | 56 | wait_queue_head_t waitq; |
57 | unsigned char ready; | 57 | unsigned char ready; |
diff --git a/include/linux/usb/net2280.h b/include/linux/usb/net2280.h new file mode 100644 index 0000000000..c602f884f1 --- /dev/null +++ b/include/linux/usb/net2280.h | |||
@@ -0,0 +1,444 @@ | |||
1 | /* | ||
2 | * NetChip 2280 high/full speed USB device controller. | ||
3 | * Unlike many such controllers, this one talks PCI. | ||
4 | */ | ||
5 | #ifndef __LINUX_USB_NET2280_H | ||
6 | #define __LINUX_USB_NET2280_H | ||
7 | |||
8 | /* | ||
9 | * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com) | ||
10 | * Copyright (C) 2003 David Brownell | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License as published by | ||
14 | * the Free Software Foundation; either version 2 of the License, or | ||
15 | * (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
25 | */ | ||
26 | |||
27 | /*-------------------------------------------------------------------------*/ | ||
28 | |||
29 | /* NET2280 MEMORY MAPPED REGISTERS | ||
30 | * | ||
31 | * The register layout came from the chip documentation, and the bit | ||
32 | * number definitions were extracted from chip specification. | ||
33 | * | ||
34 | * Use the shift operator ('<<') to build bit masks, with readl/writel | ||
35 | * to access the registers through PCI. | ||
36 | */ | ||
37 | |||
38 | /* main registers, BAR0 + 0x0000 */ | ||
39 | struct net2280_regs { | ||
40 | // offset 0x0000 | ||
41 | u32 devinit; | ||
42 | #define LOCAL_CLOCK_FREQUENCY 8 | ||
43 | #define FORCE_PCI_RESET 7 | ||
44 | #define PCI_ID 6 | ||
45 | #define PCI_ENABLE 5 | ||
46 | #define FIFO_SOFT_RESET 4 | ||
47 | #define CFG_SOFT_RESET 3 | ||
48 | #define PCI_SOFT_RESET 2 | ||
49 | #define USB_SOFT_RESET 1 | ||
50 | #define M8051_RESET 0 | ||
51 | u32 eectl; | ||
52 | #define EEPROM_ADDRESS_WIDTH 23 | ||
53 | #define EEPROM_CHIP_SELECT_ACTIVE 22 | ||
54 | #define EEPROM_PRESENT 21 | ||
55 | #define EEPROM_VALID 20 | ||
56 | #define EEPROM_BUSY 19 | ||
57 | #define EEPROM_CHIP_SELECT_ENABLE 18 | ||
58 | #define EEPROM_BYTE_READ_START 17 | ||
59 | #define EEPROM_BYTE_WRITE_START 16 | ||
60 | #define EEPROM_READ_DATA 8 | ||
61 | #define EEPROM_WRITE_DATA 0 | ||
62 | u32 eeclkfreq; | ||
63 | u32 _unused0; | ||
64 | // offset 0x0010 | ||
65 | |||
66 | u32 pciirqenb0; /* interrupt PCI master ... */ | ||
67 | #define SETUP_PACKET_INTERRUPT_ENABLE 7 | ||
68 | #define ENDPOINT_F_INTERRUPT_ENABLE 6 | ||
69 | #define ENDPOINT_E_INTERRUPT_ENABLE 5 | ||
70 | #define ENDPOINT_D_INTERRUPT_ENABLE 4 | ||
71 | #define ENDPOINT_C_INTERRUPT_ENABLE 3 | ||
72 | #define ENDPOINT_B_INTERRUPT_ENABLE 2 | ||
73 | #define ENDPOINT_A_INTERRUPT_ENABLE 1 | ||
74 | #define ENDPOINT_0_INTERRUPT_ENABLE 0 | ||
75 | u32 pciirqenb1; | ||
76 | #define PCI_INTERRUPT_ENABLE 31 | ||
77 | #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 | ||
78 | #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 | ||
79 | #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 | ||
80 | #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 | ||
81 | #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 | ||
82 | #define PCI_TARGET_ABORT_ASSERTED_INTERRUPT_ENABLE 18 | ||
83 | #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 | ||
84 | #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 | ||
85 | #define GPIO_INTERRUPT_ENABLE 13 | ||
86 | #define DMA_D_INTERRUPT_ENABLE 12 | ||
87 | #define DMA_C_INTERRUPT_ENABLE 11 | ||
88 | #define DMA_B_INTERRUPT_ENABLE 10 | ||
89 | #define DMA_A_INTERRUPT_ENABLE 9 | ||
90 | #define EEPROM_DONE_INTERRUPT_ENABLE 8 | ||
91 | #define VBUS_INTERRUPT_ENABLE 7 | ||
92 | #define CONTROL_STATUS_INTERRUPT_ENABLE 6 | ||
93 | #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 | ||
94 | #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 | ||
95 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 | ||
96 | #define RESUME_INTERRUPT_ENABLE 1 | ||
97 | #define SOF_INTERRUPT_ENABLE 0 | ||
98 | u32 cpu_irqenb0; /* ... or onboard 8051 */ | ||
99 | #define SETUP_PACKET_INTERRUPT_ENABLE 7 | ||
100 | #define ENDPOINT_F_INTERRUPT_ENABLE 6 | ||
101 | #define ENDPOINT_E_INTERRUPT_ENABLE 5 | ||
102 | #define ENDPOINT_D_INTERRUPT_ENABLE 4 | ||
103 | #define ENDPOINT_C_INTERRUPT_ENABLE 3 | ||
104 | #define ENDPOINT_B_INTERRUPT_ENABLE 2 | ||
105 | #define ENDPOINT_A_INTERRUPT_ENABLE 1 | ||
106 | #define ENDPOINT_0_INTERRUPT_ENABLE 0 | ||
107 | u32 cpu_irqenb1; | ||
108 | #define CPU_INTERRUPT_ENABLE 31 | ||
109 | #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 | ||
110 | #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 | ||
111 | #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 | ||
112 | #define PCI_INTA_INTERRUPT_ENABLE 24 | ||
113 | #define PCI_PME_INTERRUPT_ENABLE 23 | ||
114 | #define PCI_SERR_INTERRUPT_ENABLE 22 | ||
115 | #define PCI_PERR_INTERRUPT_ENABLE 21 | ||
116 | #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 | ||
117 | #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 | ||
118 | #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 | ||
119 | #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 | ||
120 | #define GPIO_INTERRUPT_ENABLE 13 | ||
121 | #define DMA_D_INTERRUPT_ENABLE 12 | ||
122 | #define DMA_C_INTERRUPT_ENABLE 11 | ||
123 | #define DMA_B_INTERRUPT_ENABLE 10 | ||
124 | #define DMA_A_INTERRUPT_ENABLE 9 | ||
125 | #define EEPROM_DONE_INTERRUPT_ENABLE 8 | ||
126 | #define VBUS_INTERRUPT_ENABLE 7 | ||
127 | #define CONTROL_STATUS_INTERRUPT_ENABLE 6 | ||
128 | #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 | ||
129 | #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 | ||
130 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 | ||
131 | #define RESUME_INTERRUPT_ENABLE 1 | ||
132 | #define SOF_INTERRUPT_ENABLE 0 | ||
133 | |||
134 | // offset 0x0020 | ||
135 | u32 _unused1; | ||
136 | u32 usbirqenb1; | ||
137 | #define USB_INTERRUPT_ENABLE 31 | ||
138 | #define POWER_STATE_CHANGE_INTERRUPT_ENABLE 27 | ||
139 | #define PCI_ARBITER_TIMEOUT_INTERRUPT_ENABLE 26 | ||
140 | #define PCI_PARITY_ERROR_INTERRUPT_ENABLE 25 | ||
141 | #define PCI_INTA_INTERRUPT_ENABLE 24 | ||
142 | #define PCI_PME_INTERRUPT_ENABLE 23 | ||
143 | #define PCI_SERR_INTERRUPT_ENABLE 22 | ||
144 | #define PCI_PERR_INTERRUPT_ENABLE 21 | ||
145 | #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT_ENABLE 20 | ||
146 | #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT_ENABLE 19 | ||
147 | #define PCI_RETRY_ABORT_INTERRUPT_ENABLE 17 | ||
148 | #define PCI_MASTER_CYCLE_DONE_INTERRUPT_ENABLE 16 | ||
149 | #define GPIO_INTERRUPT_ENABLE 13 | ||
150 | #define DMA_D_INTERRUPT_ENABLE 12 | ||
151 | #define DMA_C_INTERRUPT_ENABLE 11 | ||
152 | #define DMA_B_INTERRUPT_ENABLE 10 | ||
153 | #define DMA_A_INTERRUPT_ENABLE 9 | ||
154 | #define EEPROM_DONE_INTERRUPT_ENABLE 8 | ||
155 | #define VBUS_INTERRUPT_ENABLE 7 | ||
156 | #define CONTROL_STATUS_INTERRUPT_ENABLE 6 | ||
157 | #define ROOT_PORT_RESET_INTERRUPT_ENABLE 4 | ||
158 | #define SUSPEND_REQUEST_INTERRUPT_ENABLE 3 | ||
159 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE 2 | ||
160 | #define RESUME_INTERRUPT_ENABLE 1 | ||
161 | #define SOF_INTERRUPT_ENABLE 0 | ||
162 | u32 irqstat0; | ||
163 | #define INTA_ASSERTED 12 | ||
164 | #define SETUP_PACKET_INTERRUPT 7 | ||
165 | #define ENDPOINT_F_INTERRUPT 6 | ||
166 | #define ENDPOINT_E_INTERRUPT 5 | ||
167 | #define ENDPOINT_D_INTERRUPT 4 | ||
168 | #define ENDPOINT_C_INTERRUPT 3 | ||
169 | #define ENDPOINT_B_INTERRUPT 2 | ||
170 | #define ENDPOINT_A_INTERRUPT 1 | ||
171 | #define ENDPOINT_0_INTERRUPT 0 | ||
172 | u32 irqstat1; | ||
173 | #define POWER_STATE_CHANGE_INTERRUPT 27 | ||
174 | #define PCI_ARBITER_TIMEOUT_INTERRUPT 26 | ||
175 | #define PCI_PARITY_ERROR_INTERRUPT 25 | ||
176 | #define PCI_INTA_INTERRUPT 24 | ||
177 | #define PCI_PME_INTERRUPT 23 | ||
178 | #define PCI_SERR_INTERRUPT 22 | ||
179 | #define PCI_PERR_INTERRUPT 21 | ||
180 | #define PCI_MASTER_ABORT_RECEIVED_INTERRUPT 20 | ||
181 | #define PCI_TARGET_ABORT_RECEIVED_INTERRUPT 19 | ||
182 | #define PCI_RETRY_ABORT_INTERRUPT 17 | ||
183 | #define PCI_MASTER_CYCLE_DONE_INTERRUPT 16 | ||
184 | #define SOF_DOWN_INTERRUPT 14 | ||
185 | #define GPIO_INTERRUPT 13 | ||
186 | #define DMA_D_INTERRUPT 12 | ||
187 | #define DMA_C_INTERRUPT 11 | ||
188 | #define DMA_B_INTERRUPT 10 | ||
189 | #define DMA_A_INTERRUPT 9 | ||
190 | #define EEPROM_DONE_INTERRUPT 8 | ||
191 | #define VBUS_INTERRUPT 7 | ||
192 | #define CONTROL_STATUS_INTERRUPT 6 | ||
193 | #define ROOT_PORT_RESET_INTERRUPT 4 | ||
194 | #define SUSPEND_REQUEST_INTERRUPT 3 | ||
195 | #define SUSPEND_REQUEST_CHANGE_INTERRUPT 2 | ||
196 | #define RESUME_INTERRUPT 1 | ||
197 | #define SOF_INTERRUPT 0 | ||
198 | // offset 0x0030 | ||
199 | u32 idxaddr; | ||
200 | u32 idxdata; | ||
201 | u32 fifoctl; | ||
202 | #define PCI_BASE2_RANGE 16 | ||
203 | #define IGNORE_FIFO_AVAILABILITY 3 | ||
204 | #define PCI_BASE2_SELECT 2 | ||
205 | #define FIFO_CONFIGURATION_SELECT 0 | ||
206 | u32 _unused2; | ||
207 | // offset 0x0040 | ||
208 | u32 memaddr; | ||
209 | #define START 28 | ||
210 | #define DIRECTION 27 | ||
211 | #define FIFO_DIAGNOSTIC_SELECT 24 | ||
212 | #define MEMORY_ADDRESS 0 | ||
213 | u32 memdata0; | ||
214 | u32 memdata1; | ||
215 | u32 _unused3; | ||
216 | // offset 0x0050 | ||
217 | u32 gpioctl; | ||
218 | #define GPIO3_LED_SELECT 12 | ||
219 | #define GPIO3_INTERRUPT_ENABLE 11 | ||
220 | #define GPIO2_INTERRUPT_ENABLE 10 | ||
221 | #define GPIO1_INTERRUPT_ENABLE 9 | ||
222 | #define GPIO0_INTERRUPT_ENABLE 8 | ||
223 | #define GPIO3_OUTPUT_ENABLE 7 | ||
224 | #define GPIO2_OUTPUT_ENABLE 6 | ||
225 | #define GPIO1_OUTPUT_ENABLE 5 | ||
226 | #define GPIO0_OUTPUT_ENABLE 4 | ||
227 | #define GPIO3_DATA 3 | ||
228 | #define GPIO2_DATA 2 | ||
229 | #define GPIO1_DATA 1 | ||
230 | #define GPIO0_DATA 0 | ||
231 | u32 gpiostat; | ||
232 | #define GPIO3_INTERRUPT 3 | ||
233 | #define GPIO2_INTERRUPT 2 | ||
234 | #define GPIO1_INTERRUPT 1 | ||
235 | #define GPIO0_INTERRUPT 0 | ||
236 | } __attribute__ ((packed)); | ||
237 | |||
238 | /* usb control, BAR0 + 0x0080 */ | ||
239 | struct net2280_usb_regs { | ||
240 | // offset 0x0080 | ||
241 | u32 stdrsp; | ||
242 | #define STALL_UNSUPPORTED_REQUESTS 31 | ||
243 | #define SET_TEST_MODE 16 | ||
244 | #define GET_OTHER_SPEED_CONFIGURATION 15 | ||
245 | #define GET_DEVICE_QUALIFIER 14 | ||
246 | #define SET_ADDRESS 13 | ||
247 | #define ENDPOINT_SET_CLEAR_HALT 12 | ||
248 | #define DEVICE_SET_CLEAR_DEVICE_REMOTE_WAKEUP 11 | ||
249 | #define GET_STRING_DESCRIPTOR_2 10 | ||
250 | #define GET_STRING_DESCRIPTOR_1 9 | ||
251 | #define GET_STRING_DESCRIPTOR_0 8 | ||
252 | #define GET_SET_INTERFACE 6 | ||
253 | #define GET_SET_CONFIGURATION 5 | ||
254 | #define GET_CONFIGURATION_DESCRIPTOR 4 | ||
255 | #define GET_DEVICE_DESCRIPTOR 3 | ||
256 | #define GET_ENDPOINT_STATUS 2 | ||
257 | #define GET_INTERFACE_STATUS 1 | ||
258 | #define GET_DEVICE_STATUS 0 | ||
259 | u32 prodvendid; | ||
260 | #define PRODUCT_ID 16 | ||
261 | #define VENDOR_ID 0 | ||
262 | u32 relnum; | ||
263 | u32 usbctl; | ||
264 | #define SERIAL_NUMBER_INDEX 16 | ||
265 | #define PRODUCT_ID_STRING_ENABLE 13 | ||
266 | #define VENDOR_ID_STRING_ENABLE 12 | ||
267 | #define USB_ROOT_PORT_WAKEUP_ENABLE 11 | ||
268 | #define VBUS_PIN 10 | ||
269 | #define TIMED_DISCONNECT 9 | ||
270 | #define SUSPEND_IMMEDIATELY 7 | ||
271 | #define SELF_POWERED_USB_DEVICE 6 | ||
272 | #define REMOTE_WAKEUP_SUPPORT 5 | ||
273 | #define PME_POLARITY 4 | ||
274 | #define USB_DETECT_ENABLE 3 | ||
275 | #define PME_WAKEUP_ENABLE 2 | ||
276 | #define DEVICE_REMOTE_WAKEUP_ENABLE 1 | ||
277 | #define SELF_POWERED_STATUS 0 | ||
278 | // offset 0x0090 | ||
279 | u32 usbstat; | ||
280 | #define HIGH_SPEED 7 | ||
281 | #define FULL_SPEED 6 | ||
282 | #define GENERATE_RESUME 5 | ||
283 | #define GENERATE_DEVICE_REMOTE_WAKEUP 4 | ||
284 | u32 xcvrdiag; | ||
285 | #define FORCE_HIGH_SPEED_MODE 31 | ||
286 | #define FORCE_FULL_SPEED_MODE 30 | ||
287 | #define USB_TEST_MODE 24 | ||
288 | #define LINE_STATE 16 | ||
289 | #define TRANSCEIVER_OPERATION_MODE 2 | ||
290 | #define TRANSCEIVER_SELECT 1 | ||
291 | #define TERMINATION_SELECT 0 | ||
292 | u32 setup0123; | ||
293 | u32 setup4567; | ||
294 | // offset 0x0090 | ||
295 | u32 _unused0; | ||
296 | u32 ouraddr; | ||
297 | #define FORCE_IMMEDIATE 7 | ||
298 | #define OUR_USB_ADDRESS 0 | ||
299 | u32 ourconfig; | ||
300 | } __attribute__ ((packed)); | ||
301 | |||
302 | /* pci control, BAR0 + 0x0100 */ | ||
303 | struct net2280_pci_regs { | ||
304 | // offset 0x0100 | ||
305 | u32 pcimstctl; | ||
306 | #define PCI_ARBITER_PARK_SELECT 13 | ||
307 | #define PCI_MULTI LEVEL_ARBITER 12 | ||
308 | #define PCI_RETRY_ABORT_ENABLE 11 | ||
309 | #define DMA_MEMORY_WRITE_AND_INVALIDATE_ENABLE 10 | ||
310 | #define DMA_READ_MULTIPLE_ENABLE 9 | ||
311 | #define DMA_READ_LINE_ENABLE 8 | ||
312 | #define PCI_MASTER_COMMAND_SELECT 6 | ||
313 | #define MEM_READ_OR_WRITE 0 | ||
314 | #define IO_READ_OR_WRITE 1 | ||
315 | #define CFG_READ_OR_WRITE 2 | ||
316 | #define PCI_MASTER_START 5 | ||
317 | #define PCI_MASTER_READ_WRITE 4 | ||
318 | #define PCI_MASTER_WRITE 0 | ||
319 | #define PCI_MASTER_READ 1 | ||
320 | #define PCI_MASTER_BYTE_WRITE_ENABLES 0 | ||
321 | u32 pcimstaddr; | ||
322 | u32 pcimstdata; | ||
323 | u32 pcimststat; | ||
324 | #define PCI_ARBITER_CLEAR 2 | ||
325 | #define PCI_EXTERNAL_ARBITER 1 | ||
326 | #define PCI_HOST_MODE 0 | ||
327 | } __attribute__ ((packed)); | ||
328 | |||
329 | /* dma control, BAR0 + 0x0180 ... array of four structs like this, | ||
330 | * for channels 0..3. see also struct net2280_dma: descriptor | ||
331 | * that can be loaded into some of these registers. | ||
332 | */ | ||
333 | struct net2280_dma_regs { /* [11.7] */ | ||
334 | // offset 0x0180, 0x01a0, 0x01c0, 0x01e0, | ||
335 | u32 dmactl; | ||
336 | #define DMA_SCATTER_GATHER_DONE_INTERRUPT_ENABLE 25 | ||
337 | #define DMA_CLEAR_COUNT_ENABLE 21 | ||
338 | #define DESCRIPTOR_POLLING_RATE 19 | ||
339 | #define POLL_CONTINUOUS 0 | ||
340 | #define POLL_1_USEC 1 | ||
341 | #define POLL_100_USEC 2 | ||
342 | #define POLL_1_MSEC 3 | ||
343 | #define DMA_VALID_BIT_POLLING_ENABLE 18 | ||
344 | #define DMA_VALID_BIT_ENABLE 17 | ||
345 | #define DMA_SCATTER_GATHER_ENABLE 16 | ||
346 | #define DMA_OUT_AUTO_START_ENABLE 4 | ||
347 | #define DMA_PREEMPT_ENABLE 3 | ||
348 | #define DMA_FIFO_VALIDATE 2 | ||
349 | #define DMA_ENABLE 1 | ||
350 | #define DMA_ADDRESS_HOLD 0 | ||
351 | u32 dmastat; | ||
352 | #define DMA_ABORT_DONE_INTERRUPT 27 | ||
353 | #define DMA_SCATTER_GATHER_DONE_INTERRUPT 25 | ||
354 | #define DMA_TRANSACTION_DONE_INTERRUPT 24 | ||
355 | #define DMA_ABORT 1 | ||
356 | #define DMA_START 0 | ||
357 | u32 _unused0 [2]; | ||
358 | // offset 0x0190, 0x01b0, 0x01d0, 0x01f0, | ||
359 | u32 dmacount; | ||
360 | #define VALID_BIT 31 | ||
361 | #define DMA_DIRECTION 30 | ||
362 | #define DMA_DONE_INTERRUPT_ENABLE 29 | ||
363 | #define END_OF_CHAIN 28 | ||
364 | #define DMA_BYTE_COUNT_MASK ((1<<24)-1) | ||
365 | #define DMA_BYTE_COUNT 0 | ||
366 | u32 dmaaddr; | ||
367 | u32 dmadesc; | ||
368 | u32 _unused1; | ||
369 | } __attribute__ ((packed)); | ||
370 | |||
371 | /* dedicated endpoint registers, BAR0 + 0x0200 */ | ||
372 | |||
373 | struct net2280_dep_regs { /* [11.8] */ | ||
374 | // offset 0x0200, 0x0210, 0x220, 0x230, 0x240 | ||
375 | u32 dep_cfg; | ||
376 | // offset 0x0204, 0x0214, 0x224, 0x234, 0x244 | ||
377 | u32 dep_rsp; | ||
378 | u32 _unused [2]; | ||
379 | } __attribute__ ((packed)); | ||
380 | |||
381 | /* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs | ||
382 | * like this, for ep0 then the configurable endpoints A..F | ||
383 | * ep0 reserved for control; E and F have only 64 bytes of fifo | ||
384 | */ | ||
385 | struct net2280_ep_regs { /* [11.9] */ | ||
386 | // offset 0x0300, 0x0320, 0x0340, 0x0360, 0x0380, 0x03a0, 0x03c0 | ||
387 | u32 ep_cfg; | ||
388 | #define ENDPOINT_BYTE_COUNT 16 | ||
389 | #define ENDPOINT_ENABLE 10 | ||
390 | #define ENDPOINT_TYPE 8 | ||
391 | #define ENDPOINT_DIRECTION 7 | ||
392 | #define ENDPOINT_NUMBER 0 | ||
393 | u32 ep_rsp; | ||
394 | #define SET_NAK_OUT_PACKETS 15 | ||
395 | #define SET_EP_HIDE_STATUS_PHASE 14 | ||
396 | #define SET_EP_FORCE_CRC_ERROR 13 | ||
397 | #define SET_INTERRUPT_MODE 12 | ||
398 | #define SET_CONTROL_STATUS_PHASE_HANDSHAKE 11 | ||
399 | #define SET_NAK_OUT_PACKETS_MODE 10 | ||
400 | #define SET_ENDPOINT_TOGGLE 9 | ||
401 | #define SET_ENDPOINT_HALT 8 | ||
402 | #define CLEAR_NAK_OUT_PACKETS 7 | ||
403 | #define CLEAR_EP_HIDE_STATUS_PHASE 6 | ||
404 | #define CLEAR_EP_FORCE_CRC_ERROR 5 | ||
405 | #define CLEAR_INTERRUPT_MODE 4 | ||
406 | #define CLEAR_CONTROL_STATUS_PHASE_HANDSHAKE 3 | ||
407 | #define CLEAR_NAK_OUT_PACKETS_MODE 2 | ||
408 | #define CLEAR_ENDPOINT_TOGGLE 1 | ||
409 | #define CLEAR_ENDPOINT_HALT 0 | ||
410 | u32 ep_irqenb; | ||
411 | #define SHORT_PACKET_OUT_DONE_INTERRUPT_ENABLE 6 | ||
412 | #define SHORT_PACKET_TRANSFERRED_INTERRUPT_ENABLE 5 | ||
413 | #define DATA_PACKET_RECEIVED_INTERRUPT_ENABLE 3 | ||
414 | #define DATA_PACKET_TRANSMITTED_INTERRUPT_ENABLE 2 | ||
415 | #define DATA_OUT_PING_TOKEN_INTERRUPT_ENABLE 1 | ||
416 | #define DATA_IN_TOKEN_INTERRUPT_ENABLE 0 | ||
417 | u32 ep_stat; | ||
418 | #define FIFO_VALID_COUNT 24 | ||
419 | #define HIGH_BANDWIDTH_OUT_TRANSACTION_PID 22 | ||
420 | #define TIMEOUT 21 | ||
421 | #define USB_STALL_SENT 20 | ||
422 | #define USB_IN_NAK_SENT 19 | ||
423 | #define USB_IN_ACK_RCVD 18 | ||
424 | #define USB_OUT_PING_NAK_SENT 17 | ||
425 | #define USB_OUT_ACK_SENT 16 | ||
426 | #define FIFO_OVERFLOW 13 | ||
427 | #define FIFO_UNDERFLOW 12 | ||
428 | #define FIFO_FULL 11 | ||
429 | #define FIFO_EMPTY 10 | ||
430 | #define FIFO_FLUSH 9 | ||
431 | #define SHORT_PACKET_OUT_DONE_INTERRUPT 6 | ||
432 | #define SHORT_PACKET_TRANSFERRED_INTERRUPT 5 | ||
433 | #define NAK_OUT_PACKETS 4 | ||
434 | #define DATA_PACKET_RECEIVED_INTERRUPT 3 | ||
435 | #define DATA_PACKET_TRANSMITTED_INTERRUPT 2 | ||
436 | #define DATA_OUT_PING_TOKEN_INTERRUPT 1 | ||
437 | #define DATA_IN_TOKEN_INTERRUPT 0 | ||
438 | // offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 | ||
439 | u32 ep_avail; | ||
440 | u32 ep_data; | ||
441 | u32 _unused0 [2]; | ||
442 | } __attribute__ ((packed)); | ||
443 | |||
444 | #endif /* __LINUX_USB_NET2280_H */ | ||
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index fadc535e29..dc7c621e46 100644 --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h | |||
@@ -12,6 +12,11 @@ | |||
12 | #else | 12 | #else |
13 | #define MODULE_VERMAGIC_PREEMPT "" | 13 | #define MODULE_VERMAGIC_PREEMPT "" |
14 | #endif | 14 | #endif |
15 | #ifdef CONFIG_MODULE_UNLOAD | ||
16 | #define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload " | ||
17 | #else | ||
18 | #define MODULE_VERMAGIC_MODULE_UNLOAD "" | ||
19 | #endif | ||
15 | #ifndef MODULE_ARCH_VERMAGIC | 20 | #ifndef MODULE_ARCH_VERMAGIC |
16 | #define MODULE_ARCH_VERMAGIC "" | 21 | #define MODULE_ARCH_VERMAGIC "" |
17 | #endif | 22 | #endif |
@@ -19,5 +24,5 @@ | |||
19 | #define VERMAGIC_STRING \ | 24 | #define VERMAGIC_STRING \ |
20 | UTS_RELEASE " " \ | 25 | UTS_RELEASE " " \ |
21 | MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ | 26 | MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ |
22 | MODULE_ARCH_VERMAGIC \ | 27 | MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC \ |
23 | "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__) | 28 | "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__) |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index af2d6155d3..ad7fa9c86c 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -966,66 +966,17 @@ struct v4l2_sliced_vbi_format | |||
966 | 966 | ||
967 | /* Teletext World System Teletext | 967 | /* Teletext World System Teletext |
968 | (WST), defined on ITU-R BT.653-2 */ | 968 | (WST), defined on ITU-R BT.653-2 */ |
969 | #define V4L2_SLICED_TELETEXT_PAL_B (0x000001) | 969 | #define V4L2_SLICED_TELETEXT_B (0x0001) |
970 | #define V4L2_SLICED_TELETEXT_PAL_C (0x000002) | ||
971 | #define V4L2_SLICED_TELETEXT_NTSC_B (0x000010) | ||
972 | #define V4L2_SLICED_TELETEXT_SECAM (0x000020) | ||
973 | |||
974 | /* Teletext North American Broadcast Teletext Specification | ||
975 | (NABTS), defined on ITU-R BT.653-2 */ | ||
976 | #define V4L2_SLICED_TELETEXT_NTSC_C (0x000040) | ||
977 | #define V4L2_SLICED_TELETEXT_NTSC_D (0x000080) | ||
978 | |||
979 | /* Video Program System, defined on ETS 300 231*/ | 970 | /* Video Program System, defined on ETS 300 231*/ |
980 | #define V4L2_SLICED_VPS (0x000400) | 971 | #define V4L2_SLICED_VPS (0x0400) |
981 | |||
982 | /* Closed Caption, defined on EIA-608 */ | 972 | /* Closed Caption, defined on EIA-608 */ |
983 | #define V4L2_SLICED_CAPTION_525 (0x001000) | 973 | #define V4L2_SLICED_CAPTION_525 (0x1000) |
984 | #define V4L2_SLICED_CAPTION_625 (0x002000) | ||
985 | |||
986 | /* Wide Screen System, defined on ITU-R BT1119.1 */ | 974 | /* Wide Screen System, defined on ITU-R BT1119.1 */ |
987 | #define V4L2_SLICED_WSS_625 (0x004000) | 975 | #define V4L2_SLICED_WSS_625 (0x4000) |
988 | |||
989 | /* Wide Screen System, defined on IEC 61880 */ | ||
990 | #define V4L2_SLICED_WSS_525 (0x008000) | ||
991 | |||
992 | /* Vertical Interval Timecode (VITC), defined on SMPTE 12M */ | ||
993 | #define V4l2_SLICED_VITC_625 (0x010000) | ||
994 | #define V4l2_SLICED_VITC_525 (0x020000) | ||
995 | |||
996 | #define V4L2_SLICED_TELETEXT_B (V4L2_SLICED_TELETEXT_PAL_B |\ | ||
997 | V4L2_SLICED_TELETEXT_NTSC_B) | ||
998 | 976 | ||
999 | #define V4L2_SLICED_TELETEXT (V4L2_SLICED_TELETEXT_PAL_B |\ | 977 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) |
1000 | V4L2_SLICED_TELETEXT_PAL_C |\ | 978 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) |
1001 | V4L2_SLICED_TELETEXT_SECAM |\ | ||
1002 | V4L2_SLICED_TELETEXT_NTSC_B |\ | ||
1003 | V4L2_SLICED_TELETEXT_NTSC_C |\ | ||
1004 | V4L2_SLICED_TELETEXT_NTSC_D) | ||
1005 | 979 | ||
1006 | #define V4L2_SLICED_CAPTION (V4L2_SLICED_CAPTION_525 |\ | ||
1007 | V4L2_SLICED_CAPTION_625) | ||
1008 | |||
1009 | #define V4L2_SLICED_WSS (V4L2_SLICED_WSS_525 |\ | ||
1010 | V4L2_SLICED_WSS_625) | ||
1011 | |||
1012 | #define V4L2_SLICED_VITC (V4L2_SLICED_VITC_525 |\ | ||
1013 | V4L2_SLICED_VITC_625) | ||
1014 | |||
1015 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_TELETEXT_NTSC_B |\ | ||
1016 | V4L2_SLICED_TELETEXT_NTSC_C |\ | ||
1017 | V4L2_SLICED_TELETEXT_NTSC_D |\ | ||
1018 | V4L2_SLICED_CAPTION_525 |\ | ||
1019 | V4L2_SLICED_WSS_525 |\ | ||
1020 | V4l2_SLICED_VITC_525) | ||
1021 | |||
1022 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_PAL_B |\ | ||
1023 | V4L2_SLICED_TELETEXT_PAL_C |\ | ||
1024 | V4L2_SLICED_TELETEXT_SECAM |\ | ||
1025 | V4L2_SLICED_VPS |\ | ||
1026 | V4L2_SLICED_CAPTION_625 |\ | ||
1027 | V4L2_SLICED_WSS_625 |\ | ||
1028 | V4l2_SLICED_VITC_625) | ||
1029 | 980 | ||
1030 | struct v4l2_sliced_vbi_cap | 981 | struct v4l2_sliced_vbi_cap |
1031 | { | 982 | { |
@@ -1190,8 +1141,13 @@ extern char *v4l2_type_names[]; | |||
1190 | /* Compatibility layer interface -- v4l1-compat module */ | 1141 | /* Compatibility layer interface -- v4l1-compat module */ |
1191 | typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, | 1142 | typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, |
1192 | unsigned int cmd, void *arg); | 1143 | unsigned int cmd, void *arg); |
1144 | |||
1145 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
1193 | int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, | 1146 | int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, |
1194 | int cmd, void *arg, v4l2_kioctl driver_ioctl); | 1147 | int cmd, void *arg, v4l2_kioctl driver_ioctl); |
1148 | #else | ||
1149 | #define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL | ||
1150 | #endif | ||
1195 | 1151 | ||
1196 | /* 32 Bits compatibility layer for 64 bits processors */ | 1152 | /* 32 Bits compatibility layer for 64 bits processors */ |
1197 | extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, | 1153 | extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 530ae3f424..fab5aed8ca 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -73,11 +73,6 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
73 | int vt_waitactive(int vt); | 73 | int vt_waitactive(int vt); |
74 | void change_console(struct vc_data *new_vc); | 74 | void change_console(struct vc_data *new_vc); |
75 | void reset_vc(struct vc_data *vc); | 75 | void reset_vc(struct vc_data *vc); |
76 | #ifdef CONFIG_VT | ||
77 | int is_console_suspend_safe(void); | ||
78 | #else | ||
79 | static inline int is_console_suspend_safe(void) { return 1; } | ||
80 | #endif | ||
81 | 76 | ||
82 | /* | 77 | /* |
83 | * vc_screen.c shares this temporary buffer with the console write code so that | 78 | * vc_screen.c shares this temporary buffer with the console write code so that |
diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h deleted file mode 100644 index dae9860091..0000000000 --- a/include/linux/wanpipe.h +++ /dev/null | |||
@@ -1,483 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * wanpipe.h WANPIPE(tm) Multiprotocol WAN Link Driver. | ||
3 | * User-level API definitions. | ||
4 | * | ||
5 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
6 | * Gideon Hack | ||
7 | * | ||
8 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
14 | * ============================================================================ | ||
15 | * Nov 3, 2000 Nenad Corbic Added config_id to sdla_t structure. | ||
16 | * Used to determine the protocol running. | ||
17 | * Jul 13, 2000 Nenad Corbic Added SyncPPP Support | ||
18 | * Feb 24, 2000 Nenad Corbic Added support for x25api driver | ||
19 | * Oct 04, 1999 Nenad Corbic New CHDLC and FRAME RELAY code, SMP support | ||
20 | * Jun 02, 1999 Gideon Hack Added 'update_call_count' for Cisco HDLC | ||
21 | * support | ||
22 | * Jun 26, 1998 David Fong Added 'ip_mode' in sdla_t.u.p for dynamic IP | ||
23 | * routing mode configuration | ||
24 | * Jun 12, 1998 David Fong Added Cisco HDLC union member in sdla_t | ||
25 | * Dec 08, 1997 Jaspreet Singh Added 'authenticator' in union of 'sdla_t' | ||
26 | * Nov 26, 1997 Jaspreet Singh Added 'load_sharing' structure. Also added | ||
27 | * 'devs_struct','dev_to_devtint_next' to 'sdla_t' | ||
28 | * Nov 24, 1997 Jaspreet Singh Added 'irq_dis_if_send_count', | ||
29 | * 'irq_dis_poll_count' to 'sdla_t'. | ||
30 | * Nov 06, 1997 Jaspreet Singh Added a define called 'INTR_TEST_MODE' | ||
31 | * Oct 20, 1997 Jaspreet Singh Added 'buff_intr_mode_unbusy' and | ||
32 | * 'dlci_intr_mode_unbusy' to 'sdla_t' | ||
33 | * Oct 18, 1997 Jaspreet Singh Added structure to maintain global driver | ||
34 | * statistics. | ||
35 | * Jan 15, 1997 Gene Kozin Version 3.1.0 | ||
36 | * o added UDP management stuff | ||
37 | * Jan 02, 1997 Gene Kozin Version 3.0.0 | ||
38 | *****************************************************************************/ | ||
39 | #ifndef _WANPIPE_H | ||
40 | #define _WANPIPE_H | ||
41 | |||
42 | #include <linux/wanrouter.h> | ||
43 | |||
44 | /* Defines */ | ||
45 | |||
46 | #ifndef PACKED | ||
47 | #define PACKED __attribute__((packed)) | ||
48 | #endif | ||
49 | |||
50 | #define WANPIPE_MAGIC 0x414C4453L /* signature: 'SDLA' reversed */ | ||
51 | |||
52 | /* IOCTL numbers (up to 16) */ | ||
53 | #define WANPIPE_DUMP (ROUTER_USER+0) /* dump adapter's memory */ | ||
54 | #define WANPIPE_EXEC (ROUTER_USER+1) /* execute firmware command */ | ||
55 | |||
56 | #define TRACE_ALL 0x00 | ||
57 | #define TRACE_PROT 0x01 | ||
58 | #define TRACE_DATA 0x02 | ||
59 | |||
60 | /* values for request/reply byte */ | ||
61 | #define UDPMGMT_REQUEST 0x01 | ||
62 | #define UDPMGMT_REPLY 0x02 | ||
63 | #define UDP_OFFSET 12 | ||
64 | |||
65 | #define MAX_CMD_BUFF 10 | ||
66 | #define MAX_X25_LCN 255 /* Maximum number of x25 channels */ | ||
67 | #define MAX_LCN_NUM 4095 /* Maximum lcn number */ | ||
68 | #define MAX_FT1_RETRY 100 | ||
69 | |||
70 | #ifndef AF_WANPIPE | ||
71 | #define AF_WANPIPE 25 | ||
72 | #ifndef PF_WANPIPE | ||
73 | #define PF_WANPIPE AF_WANPIPE | ||
74 | #endif | ||
75 | #endif | ||
76 | |||
77 | |||
78 | #define TX_TIMEOUT 5*HZ | ||
79 | |||
80 | /* General Critical Flags */ | ||
81 | #define SEND_CRIT 0x00 | ||
82 | #define PERI_CRIT 0x01 | ||
83 | |||
84 | /* Chdlc and PPP polling critical flag */ | ||
85 | #define POLL_CRIT 0x03 | ||
86 | |||
87 | /* Frame Relay Tx IRQ send critical flag */ | ||
88 | #define SEND_TXIRQ_CRIT 0x02 | ||
89 | |||
90 | /* Frame Relay ARP critical flag */ | ||
91 | #define ARP_CRIT 0x03 | ||
92 | |||
93 | /* Bit maps for dynamic interface configuration | ||
94 | * DYN_OPT_ON : turns this option on/off | ||
95 | * DEV_DOWN : device was shutdown by the driver not | ||
96 | * by user | ||
97 | */ | ||
98 | #define DYN_OPT_ON 0x00 | ||
99 | #define DEV_DOWN 0x01 | ||
100 | |||
101 | /* | ||
102 | * Data structures for IOCTL calls. | ||
103 | */ | ||
104 | |||
105 | typedef struct sdla_dump /* WANPIPE_DUMP */ | ||
106 | { | ||
107 | unsigned long magic; /* for verification */ | ||
108 | unsigned long offset; /* absolute adapter memory address */ | ||
109 | unsigned long length; /* block length */ | ||
110 | void* ptr; /* -> buffer */ | ||
111 | } sdla_dump_t; | ||
112 | |||
113 | typedef struct sdla_exec /* WANPIPE_EXEC */ | ||
114 | { | ||
115 | unsigned long magic; /* for verification */ | ||
116 | void* cmd; /* -> command structure */ | ||
117 | void* data; /* -> data buffer */ | ||
118 | } sdla_exec_t; | ||
119 | |||
120 | /* UDP management stuff */ | ||
121 | |||
122 | typedef struct wum_header | ||
123 | { | ||
124 | unsigned char signature[8]; /* 00h: signature */ | ||
125 | unsigned char type; /* 08h: request/reply */ | ||
126 | unsigned char command; /* 09h: commnand */ | ||
127 | unsigned char reserved[6]; /* 0Ah: reserved */ | ||
128 | } wum_header_t; | ||
129 | |||
130 | /************************************************************************* | ||
131 | Data Structure for global statistics | ||
132 | *************************************************************************/ | ||
133 | |||
134 | typedef struct global_stats | ||
135 | { | ||
136 | unsigned long isr_entry; | ||
137 | unsigned long isr_already_critical; | ||
138 | unsigned long isr_rx; | ||
139 | unsigned long isr_tx; | ||
140 | unsigned long isr_intr_test; | ||
141 | unsigned long isr_spurious; | ||
142 | unsigned long isr_enable_tx_int; | ||
143 | unsigned long rx_intr_corrupt_rx_bfr; | ||
144 | unsigned long rx_intr_on_orphaned_DLCI; | ||
145 | unsigned long rx_intr_dev_not_started; | ||
146 | unsigned long tx_intr_dev_not_started; | ||
147 | unsigned long poll_entry; | ||
148 | unsigned long poll_already_critical; | ||
149 | unsigned long poll_processed; | ||
150 | unsigned long poll_tbusy_bad_status; | ||
151 | unsigned long poll_host_disable_irq; | ||
152 | unsigned long poll_host_enable_irq; | ||
153 | |||
154 | } global_stats_t; | ||
155 | |||
156 | |||
157 | typedef struct{ | ||
158 | unsigned short udp_src_port PACKED; | ||
159 | unsigned short udp_dst_port PACKED; | ||
160 | unsigned short udp_length PACKED; | ||
161 | unsigned short udp_checksum PACKED; | ||
162 | } udp_pkt_t; | ||
163 | |||
164 | |||
165 | typedef struct { | ||
166 | unsigned char ver_inet_hdr_length PACKED; | ||
167 | unsigned char service_type PACKED; | ||
168 | unsigned short total_length PACKED; | ||
169 | unsigned short identifier PACKED; | ||
170 | unsigned short flags_frag_offset PACKED; | ||
171 | unsigned char ttl PACKED; | ||
172 | unsigned char protocol PACKED; | ||
173 | unsigned short hdr_checksum PACKED; | ||
174 | unsigned long ip_src_address PACKED; | ||
175 | unsigned long ip_dst_address PACKED; | ||
176 | } ip_pkt_t; | ||
177 | |||
178 | |||
179 | typedef struct { | ||
180 | unsigned char signature[8] PACKED; | ||
181 | unsigned char request_reply PACKED; | ||
182 | unsigned char id PACKED; | ||
183 | unsigned char reserved[6] PACKED; | ||
184 | } wp_mgmt_t; | ||
185 | |||
186 | /************************************************************************* | ||
187 | Data Structure for if_send statistics | ||
188 | *************************************************************************/ | ||
189 | typedef struct if_send_stat{ | ||
190 | unsigned long if_send_entry; | ||
191 | unsigned long if_send_skb_null; | ||
192 | unsigned long if_send_broadcast; | ||
193 | unsigned long if_send_multicast; | ||
194 | unsigned long if_send_critical_ISR; | ||
195 | unsigned long if_send_critical_non_ISR; | ||
196 | unsigned long if_send_tbusy; | ||
197 | unsigned long if_send_tbusy_timeout; | ||
198 | unsigned long if_send_PIPE_request; | ||
199 | unsigned long if_send_wan_disconnected; | ||
200 | unsigned long if_send_dlci_disconnected; | ||
201 | unsigned long if_send_no_bfrs; | ||
202 | unsigned long if_send_adptr_bfrs_full; | ||
203 | unsigned long if_send_bfr_passed_to_adptr; | ||
204 | unsigned long if_send_protocol_error; | ||
205 | unsigned long if_send_bfr_not_passed_to_adptr; | ||
206 | unsigned long if_send_tx_int_enabled; | ||
207 | unsigned long if_send_consec_send_fail; | ||
208 | } if_send_stat_t; | ||
209 | |||
210 | typedef struct rx_intr_stat{ | ||
211 | unsigned long rx_intr_no_socket; | ||
212 | unsigned long rx_intr_dev_not_started; | ||
213 | unsigned long rx_intr_PIPE_request; | ||
214 | unsigned long rx_intr_bfr_not_passed_to_stack; | ||
215 | unsigned long rx_intr_bfr_passed_to_stack; | ||
216 | } rx_intr_stat_t; | ||
217 | |||
218 | typedef struct pipe_mgmt_stat{ | ||
219 | unsigned long UDP_PIPE_mgmt_kmalloc_err; | ||
220 | unsigned long UDP_PIPE_mgmt_direction_err; | ||
221 | unsigned long UDP_PIPE_mgmt_adptr_type_err; | ||
222 | unsigned long UDP_PIPE_mgmt_adptr_cmnd_OK; | ||
223 | unsigned long UDP_PIPE_mgmt_adptr_cmnd_timeout; | ||
224 | unsigned long UDP_PIPE_mgmt_adptr_send_passed; | ||
225 | unsigned long UDP_PIPE_mgmt_adptr_send_failed; | ||
226 | unsigned long UDP_PIPE_mgmt_not_passed_to_stack; | ||
227 | unsigned long UDP_PIPE_mgmt_passed_to_stack; | ||
228 | unsigned long UDP_PIPE_mgmt_no_socket; | ||
229 | unsigned long UDP_PIPE_mgmt_passed_to_adptr; | ||
230 | } pipe_mgmt_stat_t; | ||
231 | |||
232 | |||
233 | typedef struct { | ||
234 | struct sk_buff *skb; | ||
235 | } bh_data_t, cmd_data_t; | ||
236 | |||
237 | #define MAX_LGTH_UDP_MGNT_PKT 2000 | ||
238 | |||
239 | |||
240 | /* This is used for interrupt testing */ | ||
241 | #define INTR_TEST_MODE 0x02 | ||
242 | |||
243 | #define WUM_SIGNATURE_L 0x50495046 | ||
244 | #define WUM_SIGNATURE_H 0x444E3845 | ||
245 | |||
246 | #define WUM_KILL 0x50 | ||
247 | #define WUM_EXEC 0x51 | ||
248 | |||
249 | #define WANPIPE 0x00 | ||
250 | #define API 0x01 | ||
251 | #define BRIDGE 0x02 | ||
252 | #define BRIDGE_NODE 0x03 | ||
253 | |||
254 | #ifdef __KERNEL__ | ||
255 | /****** Kernel Interface ****************************************************/ | ||
256 | |||
257 | #include <linux/sdladrv.h> /* SDLA support module API definitions */ | ||
258 | #include <linux/sdlasfm.h> /* SDLA firmware module definitions */ | ||
259 | #include <linux/workqueue.h> | ||
260 | #include <linux/serial.h> | ||
261 | #include <linux/serialP.h> | ||
262 | #include <linux/serial_reg.h> | ||
263 | #include <asm/serial.h> | ||
264 | #include <linux/tty.h> | ||
265 | #include <linux/tty_driver.h> | ||
266 | #include <linux/tty_flip.h> | ||
267 | |||
268 | /****** Data Structures *****************************************************/ | ||
269 | |||
270 | /* Adapter Data Space. | ||
271 | * This structure is needed because we handle multiple cards, otherwise | ||
272 | * static data would do it. | ||
273 | */ | ||
274 | typedef struct sdla | ||
275 | { | ||
276 | char devname[WAN_DRVNAME_SZ+1]; /* card name */ | ||
277 | sdlahw_t hw; /* hardware configuration */ | ||
278 | struct wan_device wandev; /* WAN device data space */ | ||
279 | |||
280 | unsigned open_cnt; /* number of open interfaces */ | ||
281 | unsigned long state_tick; /* link state timestamp */ | ||
282 | unsigned intr_mode; /* Type of Interrupt Mode */ | ||
283 | char in_isr; /* interrupt-in-service flag */ | ||
284 | char buff_int_mode_unbusy; /* flag for carrying out dev_tint */ | ||
285 | char dlci_int_mode_unbusy; /* flag for carrying out dev_tint */ | ||
286 | long configured; /* flag for previous configurations */ | ||
287 | |||
288 | unsigned short irq_dis_if_send_count; /* Disabling irqs in if_send*/ | ||
289 | unsigned short irq_dis_poll_count; /* Disabling irqs in poll routine*/ | ||
290 | unsigned short force_enable_irq; | ||
291 | char TracingEnabled; /* flag for enabling trace */ | ||
292 | global_stats_t statistics; /* global statistics */ | ||
293 | void* mbox; /* -> mailbox */ | ||
294 | void* rxmb; /* -> receive mailbox */ | ||
295 | void* flags; /* -> adapter status flags */ | ||
296 | void (*isr)(struct sdla* card); /* interrupt service routine */ | ||
297 | void (*poll)(struct sdla* card); /* polling routine */ | ||
298 | int (*exec)(struct sdla* card, void* u_cmd, void* u_data); | ||
299 | /* Used by the listen() system call */ | ||
300 | /* Wanpipe Socket Interface */ | ||
301 | int (*func) (struct sk_buff *, struct sock *); | ||
302 | struct sock *sk; | ||
303 | |||
304 | /* Shutdown function */ | ||
305 | void (*disable_comm) (struct sdla *card); | ||
306 | |||
307 | /* Secondary Port Device: Piggibacking */ | ||
308 | struct sdla *next; | ||
309 | |||
310 | /* TTY driver variables */ | ||
311 | unsigned char tty_opt; | ||
312 | struct tty_struct *tty; | ||
313 | unsigned int tty_minor; | ||
314 | unsigned int tty_open; | ||
315 | unsigned char *tty_buf; | ||
316 | unsigned char *tty_rx; | ||
317 | struct work_struct tty_work; | ||
318 | |||
319 | union | ||
320 | { | ||
321 | struct | ||
322 | { /****** X.25 specific data **********/ | ||
323 | u32 lo_pvc; | ||
324 | u32 hi_pvc; | ||
325 | u32 lo_svc; | ||
326 | u32 hi_svc; | ||
327 | struct net_device *svc_to_dev_map[MAX_X25_LCN]; | ||
328 | struct net_device *pvc_to_dev_map[MAX_X25_LCN]; | ||
329 | struct net_device *tx_dev; | ||
330 | struct net_device *cmd_dev; | ||
331 | u32 no_dev; | ||
332 | volatile u8 *hdlc_buf_status; | ||
333 | u32 tx_interrupts_pending; | ||
334 | u16 timer_int_enabled; | ||
335 | struct net_device *poll_device; | ||
336 | atomic_t command_busy; | ||
337 | |||
338 | u16 udp_pkt_lgth; | ||
339 | u32 udp_type; | ||
340 | u8 udp_pkt_src; | ||
341 | u32 udp_lcn; | ||
342 | struct net_device *udp_dev; | ||
343 | s8 udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT]; | ||
344 | |||
345 | u8 LAPB_hdlc; /* Option to turn off X25 and run only LAPB */ | ||
346 | u8 logging; /* Option to log call messages */ | ||
347 | u8 oob_on_modem; /* Option to send modem status to the api */ | ||
348 | u16 num_of_ch; /* Number of channels configured by the user */ | ||
349 | |||
350 | struct work_struct x25_poll_work; | ||
351 | struct timer_list x25_timer; | ||
352 | } x; | ||
353 | struct | ||
354 | { /****** frame relay specific data ***/ | ||
355 | void* rxmb_base; /* -> first Rx buffer */ | ||
356 | void* rxmb_last; /* -> last Rx buffer */ | ||
357 | unsigned rx_base; /* S508 receive buffer base */ | ||
358 | unsigned rx_top; /* S508 receive buffer end */ | ||
359 | unsigned short node_dlci[100]; | ||
360 | unsigned short dlci_num; | ||
361 | struct net_device *dlci_to_dev_map[991 + 1]; | ||
362 | unsigned tx_interrupts_pending; | ||
363 | unsigned short timer_int_enabled; | ||
364 | unsigned short udp_pkt_lgth; | ||
365 | int udp_type; | ||
366 | char udp_pkt_src; | ||
367 | unsigned udp_dlci; | ||
368 | char udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT]; | ||
369 | void* trc_el_base; /* first trace element */ | ||
370 | void* trc_el_last; /* last trace element */ | ||
371 | void *curr_trc_el; /* current trace element */ | ||
372 | unsigned short trc_bfr_space; /* trace buffer space */ | ||
373 | unsigned char update_comms_stats; | ||
374 | struct net_device *arp_dev; | ||
375 | spinlock_t if_send_lock; | ||
376 | } f; | ||
377 | struct /****** PPP-specific data ***********/ | ||
378 | { | ||
379 | char if_name[WAN_IFNAME_SZ+1]; /* interface name */ | ||
380 | void* txbuf; /* -> current Tx buffer */ | ||
381 | void* txbuf_base; /* -> first Tx buffer */ | ||
382 | void* txbuf_last; /* -> last Tx buffer */ | ||
383 | void* rxbuf_base; /* -> first Rx buffer */ | ||
384 | void* rxbuf_last; /* -> last Rx buffer */ | ||
385 | unsigned rx_base; /* S508 receive buffer base */ | ||
386 | unsigned rx_top; /* S508 receive buffer end */ | ||
387 | char ip_mode; /* STATIC/HOST/PEER IP Mode */ | ||
388 | char authenticator; /* Authenticator for PAP/CHAP */ | ||
389 | unsigned char comm_enabled; /* Is comm enabled or not */ | ||
390 | unsigned char peer_route; /* Process Peer Route */ | ||
391 | unsigned long *txbuf_next; /* Next Tx buffer to use */ | ||
392 | unsigned long *rxbuf_next; /* Next Rx buffer to use */ | ||
393 | } p; | ||
394 | struct /* Cisco HDLC-specific data */ | ||
395 | { | ||
396 | char if_name[WAN_IFNAME_SZ+1]; /* interface name */ | ||
397 | unsigned char comm_port;/* Communication Port O or 1 */ | ||
398 | unsigned char usedby; /* Used by WANPIPE or API */ | ||
399 | void* rxmb; /* Receive mail box */ | ||
400 | void* flags; /* flags */ | ||
401 | void* tx_status; /* Tx status element */ | ||
402 | void* rx_status; /* Rx status element */ | ||
403 | void* txbuf; /* -> current Tx buffer */ | ||
404 | void* txbuf_base; /* -> first Tx buffer */ | ||
405 | void* txbuf_last; /* -> last Tx buffer */ | ||
406 | void* rxbuf_base; /* -> first Rx buffer */ | ||
407 | void* rxbuf_last; /* -> last Rx buffer */ | ||
408 | unsigned rx_base; /* S508 receive buffer base */ | ||
409 | unsigned rx_top; /* S508 receive buffer end */ | ||
410 | unsigned char receive_only; /* high speed receivers */ | ||
411 | unsigned short protocol_options; | ||
412 | unsigned short kpalv_tx; /* Tx kpalv timer */ | ||
413 | unsigned short kpalv_rx; /* Rx kpalv timer */ | ||
414 | unsigned short kpalv_err; /* Error tolerance */ | ||
415 | unsigned short slarp_timer; /* SLARP req timer */ | ||
416 | unsigned state; /* state of the link */ | ||
417 | unsigned char api_status; | ||
418 | unsigned char update_call_count; | ||
419 | unsigned short api_options; /* for async config */ | ||
420 | unsigned char async_mode; | ||
421 | unsigned short tx_bits_per_char; | ||
422 | unsigned short rx_bits_per_char; | ||
423 | unsigned short stop_bits; | ||
424 | unsigned short parity; | ||
425 | unsigned short break_timer; | ||
426 | unsigned short inter_char_timer; | ||
427 | unsigned short rx_complete_length; | ||
428 | unsigned short xon_char; | ||
429 | unsigned short xoff_char; | ||
430 | unsigned char comm_enabled; /* Is comm enabled or not */ | ||
431 | unsigned char backup; | ||
432 | } c; | ||
433 | struct | ||
434 | { | ||
435 | void* tx_status; /* Tx status element */ | ||
436 | void* rx_status; /* Rx status element */ | ||
437 | void* trace_status; /* Trace status element */ | ||
438 | void* txbuf; /* -> current Tx buffer */ | ||
439 | void* txbuf_base; /* -> first Tx buffer */ | ||
440 | void* txbuf_last; /* -> last Tx buffer */ | ||
441 | void* rxbuf_base; /* -> first Rx buffer */ | ||
442 | void* rxbuf_last; /* -> last Rx buffer */ | ||
443 | void* tracebuf; /* -> current Trace buffer */ | ||
444 | void* tracebuf_base; /* -> current Trace buffer */ | ||
445 | void* tracebuf_last; /* -> current Trace buffer */ | ||
446 | unsigned rx_base; /* receive buffer base */ | ||
447 | unsigned rx_end; /* receive buffer end */ | ||
448 | unsigned trace_base; /* trace buffer base */ | ||
449 | unsigned trace_end; /* trace buffer end */ | ||
450 | |||
451 | } h; | ||
452 | } u; | ||
453 | } sdla_t; | ||
454 | |||
455 | /****** Public Functions ****************************************************/ | ||
456 | |||
457 | void wanpipe_open (sdla_t* card); /* wpmain.c */ | ||
458 | void wanpipe_close (sdla_t* card); /* wpmain.c */ | ||
459 | void wanpipe_set_state (sdla_t* card, int state); /* wpmain.c */ | ||
460 | |||
461 | int wpx_init (sdla_t* card, wandev_conf_t* conf); /* wpx.c */ | ||
462 | int wpf_init (sdla_t* card, wandev_conf_t* conf); /* wpf.c */ | ||
463 | int wpp_init (sdla_t* card, wandev_conf_t* conf); /* wpp.c */ | ||
464 | int wpc_init (sdla_t* card, wandev_conf_t* conf); /* Cisco HDLC */ | ||
465 | int bsc_init (sdla_t* card, wandev_conf_t* conf); /* BSC streaming */ | ||
466 | int hdlc_init(sdla_t* card, wandev_conf_t* conf); /* HDLC support */ | ||
467 | int wpft1_init (sdla_t* card, wandev_conf_t* conf); /* FT1 Config support */ | ||
468 | int wsppp_init (sdla_t* card, wandev_conf_t* conf); /* Sync PPP on top of RAW CHDLC */ | ||
469 | |||
470 | extern sdla_t * wanpipe_find_card(char *); | ||
471 | extern sdla_t * wanpipe_find_card_num (int); | ||
472 | |||
473 | extern void wanpipe_queue_work (struct work_struct *); | ||
474 | extern void wanpipe_mark_bh (void); | ||
475 | extern void wakeup_sk_bh(struct net_device *dev); | ||
476 | extern int change_dev_flags(struct net_device *dev, unsigned flags); | ||
477 | extern unsigned long get_ip_address(struct net_device *dev, int option); | ||
478 | extern void add_gateway(sdla_t *card, struct net_device *dev); | ||
479 | |||
480 | |||
481 | #endif /* __KERNEL__ */ | ||
482 | #endif /* _WANPIPE_H */ | ||
483 | |||
diff --git a/include/media/cx25840.h b/include/media/cx25840.h new file mode 100644 index 0000000000..8e7e52d659 --- /dev/null +++ b/include/media/cx25840.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | cx25840.h - definition for cx25840/1/2/3 inputs | ||
3 | |||
4 | Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) | ||
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; either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program; if not, write to the Free Software | ||
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _CX25840_H_ | ||
22 | #define _CX25840_H_ | ||
23 | |||
24 | enum cx25840_video_input { | ||
25 | /* Composite video inputs In1-In8 */ | ||
26 | CX25840_COMPOSITE1 = 1, | ||
27 | CX25840_COMPOSITE2, | ||
28 | CX25840_COMPOSITE3, | ||
29 | CX25840_COMPOSITE4, | ||
30 | CX25840_COMPOSITE5, | ||
31 | CX25840_COMPOSITE6, | ||
32 | CX25840_COMPOSITE7, | ||
33 | CX25840_COMPOSITE8, | ||
34 | |||
35 | /* S-Video inputs consist of one luma input (In1-In4) ORed with one | ||
36 | chroma input (In5-In8) */ | ||
37 | CX25840_SVIDEO_LUMA1 = 0x10, | ||
38 | CX25840_SVIDEO_LUMA2 = 0x20, | ||
39 | CX25840_SVIDEO_LUMA3 = 0x30, | ||
40 | CX25840_SVIDEO_LUMA4 = 0x40, | ||
41 | CX25840_SVIDEO_CHROMA4 = 0x400, | ||
42 | CX25840_SVIDEO_CHROMA5 = 0x500, | ||
43 | CX25840_SVIDEO_CHROMA6 = 0x600, | ||
44 | CX25840_SVIDEO_CHROMA7 = 0x700, | ||
45 | CX25840_SVIDEO_CHROMA8 = 0x800, | ||
46 | |||
47 | /* S-Video aliases for common luma/chroma combinations */ | ||
48 | CX25840_SVIDEO1 = 0x510, | ||
49 | CX25840_SVIDEO2 = 0x620, | ||
50 | CX25840_SVIDEO3 = 0x730, | ||
51 | CX25840_SVIDEO4 = 0x840, | ||
52 | }; | ||
53 | |||
54 | enum cx25840_audio_input { | ||
55 | /* Audio inputs: serial or In4-In8 */ | ||
56 | CX25840_AUDIO_SERIAL, | ||
57 | CX25840_AUDIO4 = 4, | ||
58 | CX25840_AUDIO5, | ||
59 | CX25840_AUDIO6, | ||
60 | CX25840_AUDIO7, | ||
61 | CX25840_AUDIO8, | ||
62 | }; | ||
63 | |||
64 | #endif | ||
diff --git a/include/media/msp3400.h b/include/media/msp3400.h index 0be61a021d..6ab854931c 100644 --- a/include/media/msp3400.h +++ b/include/media/msp3400.h | |||
@@ -80,16 +80,16 @@ | |||
80 | */ | 80 | */ |
81 | 81 | ||
82 | /* SCART input to DSP selection */ | 82 | /* SCART input to DSP selection */ |
83 | #define MSP_IN_SCART_1 0 /* Pin SC1_IN */ | 83 | #define MSP_IN_SCART1 0 /* Pin SC1_IN */ |
84 | #define MSP_IN_SCART_2 1 /* Pin SC2_IN */ | 84 | #define MSP_IN_SCART2 1 /* Pin SC2_IN */ |
85 | #define MSP_IN_SCART_3 2 /* Pin SC3_IN */ | 85 | #define MSP_IN_SCART3 2 /* Pin SC3_IN */ |
86 | #define MSP_IN_SCART_4 3 /* Pin SC4_IN */ | 86 | #define MSP_IN_SCART4 3 /* Pin SC4_IN */ |
87 | #define MSP_IN_MONO 6 /* Pin MONO_IN */ | 87 | #define MSP_IN_MONO 6 /* Pin MONO_IN */ |
88 | #define MSP_IN_MUTE 7 /* Mute DSP input */ | 88 | #define MSP_IN_MUTE 7 /* Mute DSP input */ |
89 | #define MSP_SCART_TO_DSP(in) (in) | 89 | #define MSP_SCART_TO_DSP(in) (in) |
90 | /* Tuner input to demodulator and DSP selection */ | 90 | /* Tuner input to demodulator and DSP selection */ |
91 | #define MSP_IN_TUNER_1 0 /* Analog Sound IF input pin ANA_IN1 */ | 91 | #define MSP_IN_TUNER1 0 /* Analog Sound IF input pin ANA_IN1 */ |
92 | #define MSP_IN_TUNER_2 1 /* Analog Sound IF input pin ANA_IN2 */ | 92 | #define MSP_IN_TUNER2 1 /* Analog Sound IF input pin ANA_IN2 */ |
93 | #define MSP_TUNER_TO_DSP(in) ((in) << 3) | 93 | #define MSP_TUNER_TO_DSP(in) ((in) << 3) |
94 | 94 | ||
95 | /* The msp has up to 5 DSP outputs, each output can independently select | 95 | /* The msp has up to 5 DSP outputs, each output can independently select |
@@ -109,14 +109,14 @@ | |||
109 | DSP. This is currently not implemented. Also not implemented is the | 109 | DSP. This is currently not implemented. Also not implemented is the |
110 | multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate | 110 | multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate |
111 | a need for one of those features then additional support can be added. */ | 111 | a need for one of those features then additional support can be added. */ |
112 | #define MSP_DSP_OUT_TUNER 0 /* Tuner output */ | 112 | #define MSP_DSP_IN_TUNER 0 /* Tuner DSP input */ |
113 | #define MSP_DSP_OUT_SCART 2 /* SCART output */ | 113 | #define MSP_DSP_IN_SCART 2 /* SCART DSP input */ |
114 | #define MSP_DSP_OUT_I2S1 5 /* I2S1 output */ | 114 | #define MSP_DSP_IN_I2S1 5 /* I2S1 DSP input */ |
115 | #define MSP_DSP_OUT_I2S2 6 /* I2S2 output */ | 115 | #define MSP_DSP_IN_I2S2 6 /* I2S2 DSP input */ |
116 | #define MSP_DSP_OUT_I2S3 7 /* I2S3 output */ | 116 | #define MSP_DSP_IN_I2S3 7 /* I2S3 DSP input */ |
117 | #define MSP_DSP_OUT_MAIN_AVC 11 /* MAIN AVC processed output */ | 117 | #define MSP_DSP_IN_MAIN_AVC 11 /* MAIN AVC processed DSP input */ |
118 | #define MSP_DSP_OUT_MAIN 12 /* MAIN output */ | 118 | #define MSP_DSP_IN_MAIN 12 /* MAIN DSP input */ |
119 | #define MSP_DSP_OUT_AUX 13 /* AUX output */ | 119 | #define MSP_DSP_IN_AUX 13 /* AUX DSP input */ |
120 | #define MSP_DSP_TO_MAIN(in) ((in) << 4) | 120 | #define MSP_DSP_TO_MAIN(in) ((in) << 4) |
121 | #define MSP_DSP_TO_AUX(in) ((in) << 8) | 121 | #define MSP_DSP_TO_AUX(in) ((in) << 8) |
122 | #define MSP_DSP_TO_SCART1(in) ((in) << 12) | 122 | #define MSP_DSP_TO_SCART1(in) ((in) << 12) |
@@ -125,16 +125,16 @@ | |||
125 | 125 | ||
126 | /* Output SCART select: the SCART outputs can select which input | 126 | /* Output SCART select: the SCART outputs can select which input |
127 | to use. */ | 127 | to use. */ |
128 | #define MSP_OUT_SCART1 0 /* SCART1 input, bypassing the DSP */ | 128 | #define MSP_SC_IN_SCART1 0 /* SCART1 input, bypassing the DSP */ |
129 | #define MSP_OUT_SCART2 1 /* SCART2 input, bypassing the DSP */ | 129 | #define MSP_SC_IN_SCART2 1 /* SCART2 input, bypassing the DSP */ |
130 | #define MSP_OUT_SCART3 2 /* SCART3 input, bypassing the DSP */ | 130 | #define MSP_SC_IN_SCART3 2 /* SCART3 input, bypassing the DSP */ |
131 | #define MSP_OUT_SCART4 3 /* SCART4 input, bypassing the DSP */ | 131 | #define MSP_SC_IN_SCART4 3 /* SCART4 input, bypassing the DSP */ |
132 | #define MSP_OUT_SCART1_DA 4 /* DSP SCART1 output */ | 132 | #define MSP_SC_IN_DSP_SCART1 4 /* DSP SCART1 input */ |
133 | #define MSP_OUT_SCART2_DA 5 /* DSP SCART2 output */ | 133 | #define MSP_SC_IN_DSP_SCART2 5 /* DSP SCART2 input */ |
134 | #define MSP_OUT_MONO 6 /* MONO input, bypassing the DSP */ | 134 | #define MSP_SC_IN_MONO 6 /* MONO input, bypassing the DSP */ |
135 | #define MSP_OUT_MUTE 7 /* MUTE output */ | 135 | #define MSP_SC_IN_MUTE 7 /* MUTE output */ |
136 | #define MSP_OUT_TO_SCART1(in) (in) | 136 | #define MSP_SC_TO_SCART1(in) (in) |
137 | #define MSP_OUT_TO_SCART2(in) ((in) << 4) | 137 | #define MSP_SC_TO_SCART2(in) ((in) << 4) |
138 | 138 | ||
139 | /* Shortcut macros */ | 139 | /* Shortcut macros */ |
140 | #define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \ | 140 | #define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \ |
@@ -145,14 +145,14 @@ | |||
145 | MSP_DSP_TO_SCART1(sc_i2s_src) | \ | 145 | MSP_DSP_TO_SCART1(sc_i2s_src) | \ |
146 | MSP_DSP_TO_SCART2(sc_i2s_src) | \ | 146 | MSP_DSP_TO_SCART2(sc_i2s_src) | \ |
147 | MSP_DSP_TO_I2S(sc_i2s_src)) | 147 | MSP_DSP_TO_I2S(sc_i2s_src)) |
148 | #define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART_1, MSP_IN_TUNER_1, \ | 148 | #define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \ |
149 | MSP_DSP_OUT_TUNER, MSP_DSP_OUT_TUNER) | 149 | MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER) |
150 | #define MSP_OUTPUT(sc) \ | 150 | #define MSP_OUTPUT(sc) \ |
151 | (MSP_OUT_TO_SCART1(sc) | \ | 151 | (MSP_SC_TO_SCART1(sc) | \ |
152 | MSP_OUT_TO_SCART2(sc)) | 152 | MSP_SC_TO_SCART2(sc)) |
153 | /* This equals the RESET position of the msp3400 ACB register */ | 153 | /* This equals the RESET position of the msp3400 ACB register */ |
154 | #define MSP_OUTPUT_DEFAULT (MSP_OUT_TO_SCART1(MSP_OUT_SCART3) | \ | 154 | #define MSP_OUTPUT_DEFAULT (MSP_SC_TO_SCART1(MSP_SC_IN_SCART3) | \ |
155 | MSP_OUT_TO_SCART2(MSP_OUT_SCART1_DA)) | 155 | MSP_SC_TO_SCART2(MSP_SC_IN_DSP_SCART1)) |
156 | 156 | ||
157 | /* Tuner inputs vs. msp version */ | 157 | /* Tuner inputs vs. msp version */ |
158 | /* Chip TUNER_1 TUNER_2 | 158 | /* Chip TUNER_1 TUNER_2 |
diff --git a/include/media/saa7115.h b/include/media/saa7115.h new file mode 100644 index 0000000000..6b4836f3f0 --- /dev/null +++ b/include/media/saa7115.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | saa7115.h - definition for saa7113/4/5 inputs | ||
3 | |||
4 | Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) | ||
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; either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program; if not, write to the Free Software | ||
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _SAA7115_H_ | ||
22 | #define _SAA7115_H_ | ||
23 | |||
24 | /* SAA7113/4/5 HW inputs */ | ||
25 | #define SAA7115_COMPOSITE0 0 | ||
26 | #define SAA7115_COMPOSITE1 1 | ||
27 | #define SAA7115_COMPOSITE2 2 | ||
28 | #define SAA7115_COMPOSITE3 3 | ||
29 | #define SAA7115_COMPOSITE4 4 /* not available for the saa7113 */ | ||
30 | #define SAA7115_COMPOSITE5 5 /* not available for the saa7113 */ | ||
31 | #define SAA7115_SVIDEO0 6 | ||
32 | #define SAA7115_SVIDEO1 7 | ||
33 | #define SAA7115_SVIDEO2 8 | ||
34 | #define SAA7115_SVIDEO3 9 | ||
35 | |||
36 | #endif | ||
37 | |||
diff --git a/include/media/saa7127.h b/include/media/saa7127.h new file mode 100644 index 0000000000..bbcf862141 --- /dev/null +++ b/include/media/saa7127.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | saa7127.h - definition for saa7126/7/8/9 inputs/outputs | ||
3 | |||
4 | Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl) | ||
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; either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, | ||
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | GNU General Public License for more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License | ||
17 | along with this program; if not, write to the Free Software | ||
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _SAA7127_H_ | ||
22 | #define _SAA7127_H_ | ||
23 | |||
24 | /* Enumeration for the supported input types */ | ||
25 | enum saa7127_input_type { | ||
26 | SAA7127_INPUT_TYPE_NORMAL, | ||
27 | SAA7127_INPUT_TYPE_TEST_IMAGE | ||
28 | }; | ||
29 | |||
30 | /* Enumeration for the supported output signal types */ | ||
31 | enum saa7127_output_type { | ||
32 | SAA7127_OUTPUT_TYPE_BOTH, | ||
33 | SAA7127_OUTPUT_TYPE_COMPOSITE, | ||
34 | SAA7127_OUTPUT_TYPE_SVIDEO, | ||
35 | SAA7127_OUTPUT_TYPE_RGB, | ||
36 | SAA7127_OUTPUT_TYPE_YUV_C, | ||
37 | SAA7127_OUTPUT_TYPE_YUV_V | ||
38 | }; | ||
39 | |||
40 | #endif | ||
41 | |||
diff --git a/include/media/upd64031a.h b/include/media/upd64031a.h new file mode 100644 index 0000000000..3ad6a32e1b --- /dev/null +++ b/include/media/upd64031a.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * upd64031a - NEC Electronics Ghost Reduction input defines | ||
3 | * | ||
4 | * 2006 by Hans Verkuil (hverkuil@xs4all.nl) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version 2 | ||
9 | * of the License, or (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _UPD64031A_H_ | ||
22 | #define _UPD64031A_H_ | ||
23 | |||
24 | /* Ghost reduction modes */ | ||
25 | #define UPD64031A_GR_ON 0 | ||
26 | #define UPD64031A_GR_OFF 1 | ||
27 | #define UPD64031A_GR_THROUGH 3 | ||
28 | |||
29 | /* Direct 3D/YCS Connection */ | ||
30 | #define UPD64031A_3DYCS_DISABLE (0 << 2) | ||
31 | #define UPD64031A_3DYCS_COMPOSITE (2 << 2) | ||
32 | #define UPD64031A_3DYCS_SVIDEO (3 << 2) | ||
33 | |||
34 | /* Composite sync digital separation circuit */ | ||
35 | #define UPD64031A_COMPOSITE_EXTERNAL (1 << 4) | ||
36 | |||
37 | /* Vertical sync digital separation circuit */ | ||
38 | #define UPD64031A_VERTICAL_EXTERNAL (1 << 5) | ||
39 | |||
40 | #endif | ||
diff --git a/include/media/upd64083.h b/include/media/upd64083.h new file mode 100644 index 0000000000..59b6f32ba3 --- /dev/null +++ b/include/media/upd64083.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * upd6408x - NEC Electronics 3-Dimensional Y/C separation input defines | ||
3 | * | ||
4 | * 2006 by Hans Verkuil (hverkuil@xs4all.nl) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version 2 | ||
9 | * of the License, or (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _UPD64083_H_ | ||
22 | #define _UPD64083_H_ | ||
23 | |||
24 | /* There are two bits of information that the driver needs in order | ||
25 | to select the correct routing: the operating mode and the selection | ||
26 | of the Y input (external or internal). | ||
27 | |||
28 | The first two operating modes expect a composite signal on the Y input, | ||
29 | the second two operating modes use both the Y and C inputs. | ||
30 | |||
31 | Normally YCS_MODE is used for tuner and composite inputs, and the | ||
32 | YCNR mode is used for S-Video inputs. | ||
33 | |||
34 | The external Y-ADC is selected when the composite input comes from a | ||
35 | upd64031a ghost reduction device. If this device is not present, or | ||
36 | the input is a S-Video signal, then the internal Y-ADC input should | ||
37 | be used. */ | ||
38 | |||
39 | /* Operating modes: */ | ||
40 | |||
41 | /* YCS mode: Y/C separation (burst locked clocking) */ | ||
42 | #define UPD64083_YCS_MODE 0 | ||
43 | /* YCS+ mode: 2D Y/C separation and YCNR (burst locked clocking) */ | ||
44 | #define UPD64083_YCS_PLUS_MODE 1 | ||
45 | |||
46 | /* Note: the following two modes cannot be used in combination with the | ||
47 | external Y-ADC. */ | ||
48 | /* MNNR mode: frame comb type YNR+C delay (line locked clocking) */ | ||
49 | #define UPD64083_MNNR_MODE 2 | ||
50 | /* YCNR mode: frame recursive YCNR (burst locked clocking) */ | ||
51 | #define UPD64083_YCNR_MODE 3 | ||
52 | |||
53 | /* Select external Y-ADC: this should be set if this device is used in | ||
54 | combination with the upd64031a ghost reduction device. | ||
55 | Otherwise leave at 0 (use internal Y-ADC). */ | ||
56 | #define UPD64083_EXT_Y_ADC (1 << 2) | ||
57 | |||
58 | #endif | ||
diff --git a/include/net/arp.h b/include/net/arp.h index a13e30c35f..643bded9f5 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
@@ -10,8 +10,6 @@ | |||
10 | extern struct neigh_table arp_tbl; | 10 | extern struct neigh_table arp_tbl; |
11 | 11 | ||
12 | extern void arp_init(void); | 12 | extern void arp_init(void); |
13 | extern int arp_rcv(struct sk_buff *skb, struct net_device *dev, | ||
14 | struct packet_type *pt, struct net_device *orig_dev); | ||
15 | extern int arp_find(unsigned char *haddr, struct sk_buff *skb); | 13 | extern int arp_find(unsigned char *haddr, struct sk_buff *skb); |
16 | extern int arp_ioctl(unsigned int cmd, void __user *arg); | 14 | extern int arp_ioctl(unsigned int cmd, void __user *arg); |
17 | extern void arp_send(int type, int ptype, u32 dest_ip, | 15 | extern void arp_send(int type, int ptype, u32 dest_ip, |
diff --git a/include/net/ax25.h b/include/net/ax25.h index d052b221db..5bd9974870 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
@@ -145,14 +145,14 @@ enum { | |||
145 | #define AX25_DEF_CONMODE 2 /* Connected mode allowed */ | 145 | #define AX25_DEF_CONMODE 2 /* Connected mode allowed */ |
146 | #define AX25_DEF_WINDOW 2 /* Window=2 */ | 146 | #define AX25_DEF_WINDOW 2 /* Window=2 */ |
147 | #define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */ | 147 | #define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */ |
148 | #define AX25_DEF_T1 (10 * HZ) /* T1=10s */ | 148 | #define AX25_DEF_T1 10000 /* T1=10s */ |
149 | #define AX25_DEF_T2 (3 * HZ) /* T2=3s */ | 149 | #define AX25_DEF_T2 3000 /* T2=3s */ |
150 | #define AX25_DEF_T3 (300 * HZ) /* T3=300s */ | 150 | #define AX25_DEF_T3 300000 /* T3=300s */ |
151 | #define AX25_DEF_N2 10 /* N2=10 */ | 151 | #define AX25_DEF_N2 10 /* N2=10 */ |
152 | #define AX25_DEF_IDLE (0 * 60 * HZ) /* Idle=None */ | 152 | #define AX25_DEF_IDLE 0 /* Idle=None */ |
153 | #define AX25_DEF_PACLEN 256 /* Paclen=256 */ | 153 | #define AX25_DEF_PACLEN 256 /* Paclen=256 */ |
154 | #define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */ | 154 | #define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */ |
155 | #define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ | 155 | #define AX25_DEF_DS_TIMEOUT 180000 /* DAMA timeout 3 minutes */ |
156 | 156 | ||
157 | typedef struct ax25_uid_assoc { | 157 | typedef struct ax25_uid_assoc { |
158 | struct hlist_node uid_node; | 158 | struct hlist_node uid_node; |
diff --git a/include/net/compat.h b/include/net/compat.h index 8662b8f43d..e65cbedb6a 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | 5 | ||
6 | struct sock; | ||
7 | |||
6 | #if defined(CONFIG_COMPAT) | 8 | #if defined(CONFIG_COMPAT) |
7 | 9 | ||
8 | #include <linux/compat.h> | 10 | #include <linux/compat.h> |
@@ -23,7 +25,6 @@ struct compat_cmsghdr { | |||
23 | compat_int_t cmsg_type; | 25 | compat_int_t cmsg_type; |
24 | }; | 26 | }; |
25 | 27 | ||
26 | struct sock; | ||
27 | extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); | 28 | extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); |
28 | 29 | ||
29 | #else /* defined(CONFIG_COMPAT) */ | 30 | #else /* defined(CONFIG_COMPAT) */ |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index 4725ff861c..d5926bfb1f 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -955,11 +955,13 @@ enum ieee80211_state { | |||
955 | 955 | ||
956 | #define IEEE80211_24GHZ_MIN_CHANNEL 1 | 956 | #define IEEE80211_24GHZ_MIN_CHANNEL 1 |
957 | #define IEEE80211_24GHZ_MAX_CHANNEL 14 | 957 | #define IEEE80211_24GHZ_MAX_CHANNEL 14 |
958 | #define IEEE80211_24GHZ_CHANNELS 14 | 958 | #define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \ |
959 | IEEE80211_24GHZ_MIN_CHANNEL + 1) | ||
959 | 960 | ||
960 | #define IEEE80211_52GHZ_MIN_CHANNEL 34 | 961 | #define IEEE80211_52GHZ_MIN_CHANNEL 34 |
961 | #define IEEE80211_52GHZ_MAX_CHANNEL 165 | 962 | #define IEEE80211_52GHZ_MAX_CHANNEL 165 |
962 | #define IEEE80211_52GHZ_CHANNELS 131 | 963 | #define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ |
964 | IEEE80211_52GHZ_MIN_CHANNEL + 1) | ||
963 | 965 | ||
964 | enum { | 966 | enum { |
965 | IEEE80211_CH_PASSIVE_ONLY = (1 << 0), | 967 | IEEE80211_CH_PASSIVE_ONLY = (1 << 0), |
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h index b971d8c82b..052ed596a4 100644 --- a/include/net/ieee80211softmac.h +++ b/include/net/ieee80211softmac.h | |||
@@ -96,10 +96,13 @@ struct ieee80211softmac_assoc_info { | |||
96 | * | 96 | * |
97 | * bssvalid is true if we found a matching network | 97 | * bssvalid is true if we found a matching network |
98 | * and saved it's BSSID into the bssid above. | 98 | * and saved it's BSSID into the bssid above. |
99 | * | ||
100 | * bssfixed is used for SIOCSIWAP. | ||
99 | */ | 101 | */ |
100 | u8 static_essid:1, | 102 | u8 static_essid:1, |
101 | associating:1, | 103 | associating:1, |
102 | bssvalid:1; | 104 | bssvalid:1, |
105 | bssfixed:1; | ||
103 | 106 | ||
104 | /* Scan retries remaining */ | 107 | /* Scan retries remaining */ |
105 | int scan_retry; | 108 | int scan_retry; |
@@ -201,7 +204,8 @@ struct ieee80211softmac_device { | |||
201 | 204 | ||
202 | /* couple of flags */ | 205 | /* couple of flags */ |
203 | u8 scanning:1, /* protects scanning from being done multiple times at once */ | 206 | u8 scanning:1, /* protects scanning from being done multiple times at once */ |
204 | associated:1; | 207 | associated:1, |
208 | running:1; | ||
205 | 209 | ||
206 | struct ieee80211softmac_scaninfo *scaninfo; | 210 | struct ieee80211softmac_scaninfo *scaninfo; |
207 | struct ieee80211softmac_assoc_info associnfo; | 211 | struct ieee80211softmac_assoc_info associnfo; |
@@ -267,8 +271,9 @@ extern void ieee80211softmac_stop(struct net_device *dev); | |||
267 | #define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5 | 271 | #define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5 |
268 | #define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6 | 272 | #define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6 |
269 | #define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7 | 273 | #define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7 |
274 | #define IEEE80211SOFTMAC_EVENT_DISASSOCIATED 8 | ||
270 | /* keep this updated! */ | 275 | /* keep this updated! */ |
271 | #define IEEE80211SOFTMAC_EVENT_LAST 7 | 276 | #define IEEE80211SOFTMAC_EVENT_LAST 8 |
272 | /* | 277 | /* |
273 | * If you want to be notified of certain events, you can call | 278 | * If you want to be notified of certain events, you can call |
274 | * ieee80211softmac_notify[_atomic] with | 279 | * ieee80211softmac_notify[_atomic] with |
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 25f708ff02..59f0c83d55 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -48,31 +48,7 @@ static inline int inet6_sk_ehashfn(const struct sock *sk) | |||
48 | return inet6_ehashfn(laddr, lport, faddr, fport); | 48 | return inet6_ehashfn(laddr, lport, faddr, fport); |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline void __inet6_hash(struct inet_hashinfo *hashinfo, | 51 | extern void __inet6_hash(struct inet_hashinfo *hashinfo, struct sock *sk); |
52 | struct sock *sk) | ||
53 | { | ||
54 | struct hlist_head *list; | ||
55 | rwlock_t *lock; | ||
56 | |||
57 | BUG_TRAP(sk_unhashed(sk)); | ||
58 | |||
59 | if (sk->sk_state == TCP_LISTEN) { | ||
60 | list = &hashinfo->listening_hash[inet_sk_listen_hashfn(sk)]; | ||
61 | lock = &hashinfo->lhash_lock; | ||
62 | inet_listen_wlock(hashinfo); | ||
63 | } else { | ||
64 | unsigned int hash; | ||
65 | sk->sk_hash = hash = inet6_sk_ehashfn(sk); | ||
66 | hash &= (hashinfo->ehash_size - 1); | ||
67 | list = &hashinfo->ehash[hash].chain; | ||
68 | lock = &hashinfo->ehash[hash].lock; | ||
69 | write_lock(lock); | ||
70 | } | ||
71 | |||
72 | __sk_add_node(sk, list); | ||
73 | sock_prot_inc_use(sk->sk_prot); | ||
74 | write_unlock(lock); | ||
75 | } | ||
76 | 52 | ||
77 | /* | 53 | /* |
78 | * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so | 54 | * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so |
@@ -80,52 +56,12 @@ static inline void __inet6_hash(struct inet_hashinfo *hashinfo, | |||
80 | * | 56 | * |
81 | * The sockhash lock must be held as a reader here. | 57 | * The sockhash lock must be held as a reader here. |
82 | */ | 58 | */ |
83 | static inline struct sock * | 59 | extern struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo, |
84 | __inet6_lookup_established(struct inet_hashinfo *hashinfo, | ||
85 | const struct in6_addr *saddr, | 60 | const struct in6_addr *saddr, |
86 | const u16 sport, | 61 | const u16 sport, |
87 | const struct in6_addr *daddr, | 62 | const struct in6_addr *daddr, |
88 | const u16 hnum, | 63 | const u16 hnum, |
89 | const int dif) | 64 | const int dif); |
90 | { | ||
91 | struct sock *sk; | ||
92 | const struct hlist_node *node; | ||
93 | const __u32 ports = INET_COMBINED_PORTS(sport, hnum); | ||
94 | /* Optimize here for direct hit, only listening connections can | ||
95 | * have wildcards anyways. | ||
96 | */ | ||
97 | unsigned int hash = inet6_ehashfn(daddr, hnum, saddr, sport); | ||
98 | struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); | ||
99 | |||
100 | prefetch(head->chain.first); | ||
101 | read_lock(&head->lock); | ||
102 | sk_for_each(sk, node, &head->chain) { | ||
103 | /* For IPV6 do the cheaper port and family tests first. */ | ||
104 | if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif)) | ||
105 | goto hit; /* You sunk my battleship! */ | ||
106 | } | ||
107 | /* Must check for a TIME_WAIT'er before going to listener hash. */ | ||
108 | sk_for_each(sk, node, &(head + hashinfo->ehash_size)->chain) { | ||
109 | const struct inet_timewait_sock *tw = inet_twsk(sk); | ||
110 | |||
111 | if(*((__u32 *)&(tw->tw_dport)) == ports && | ||
112 | sk->sk_family == PF_INET6) { | ||
113 | const struct inet6_timewait_sock *tw6 = inet6_twsk(sk); | ||
114 | |||
115 | if (ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) && | ||
116 | ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) && | ||
117 | (!sk->sk_bound_dev_if || sk->sk_bound_dev_if == dif)) | ||
118 | goto hit; | ||
119 | } | ||
120 | } | ||
121 | read_unlock(&head->lock); | ||
122 | return NULL; | ||
123 | |||
124 | hit: | ||
125 | sock_hold(sk); | ||
126 | read_unlock(&head->lock); | ||
127 | return sk; | ||
128 | } | ||
129 | 65 | ||
130 | extern struct sock *inet6_lookup_listener(struct inet_hashinfo *hashinfo, | 66 | extern struct sock *inet6_lookup_listener(struct inet_hashinfo *hashinfo, |
131 | const struct in6_addr *daddr, | 67 | const struct in6_addr *daddr, |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 1da294c475..e837f98fdb 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -150,7 +150,7 @@ static inline void inet_twsk_add_bind_node(struct inet_timewait_sock *tw, | |||
150 | 150 | ||
151 | static inline int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw) | 151 | static inline int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw) |
152 | { | 152 | { |
153 | return tw->tw_death_node.pprev != NULL; | 153 | return !hlist_unhashed(&tw->tw_death_node); |
154 | } | 154 | } |
155 | 155 | ||
156 | static inline void inet_twsk_dead_node_init(struct inet_timewait_sock *tw) | 156 | static inline void inet_twsk_dead_node_init(struct inet_timewait_sock *tw) |
diff --git a/include/net/ip.h b/include/net/ip.h index 8fe6156ca9..3d2e5ca62a 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -95,6 +95,7 @@ extern int ip_local_deliver(struct sk_buff *skb); | |||
95 | extern int ip_mr_input(struct sk_buff *skb); | 95 | extern int ip_mr_input(struct sk_buff *skb); |
96 | extern int ip_output(struct sk_buff *skb); | 96 | extern int ip_output(struct sk_buff *skb); |
97 | extern int ip_mc_output(struct sk_buff *skb); | 97 | extern int ip_mc_output(struct sk_buff *skb); |
98 | extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | ||
98 | extern int ip_do_nat(struct sk_buff *skb); | 99 | extern int ip_do_nat(struct sk_buff *skb); |
99 | extern void ip_send_check(struct iphdr *ip); | 100 | extern void ip_send_check(struct iphdr *ip); |
100 | extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); | 101 | extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 6d6f0634ae..4abedb8eae 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -230,7 +230,7 @@ extern int ip6_ra_control(struct sock *sk, int sel, | |||
230 | void (*destructor)(struct sock *)); | 230 | void (*destructor)(struct sock *)); |
231 | 231 | ||
232 | 232 | ||
233 | extern int ipv6_parse_hopopts(struct sk_buff *skb, int); | 233 | extern int ipv6_parse_hopopts(struct sk_buff *skb); |
234 | 234 | ||
235 | extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); | 235 | extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); |
236 | extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, | 236 | extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, |
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h index 86aefb1fda..c0c895d379 100644 --- a/include/net/irda/irlmp.h +++ b/include/net/irda/irlmp.h | |||
@@ -112,7 +112,7 @@ struct lsap_cb { | |||
112 | 112 | ||
113 | struct timer_list watchdog_timer; | 113 | struct timer_list watchdog_timer; |
114 | 114 | ||
115 | IRLMP_STATE lsap_state; /* Connection state */ | 115 | LSAP_STATE lsap_state; /* Connection state */ |
116 | notify_t notify; /* Indication/Confirm entry points */ | 116 | notify_t notify; /* Indication/Confirm entry points */ |
117 | struct qos_info qos; /* QoS for this connection */ | 117 | struct qos_info qos; /* QoS for this connection */ |
118 | 118 | ||
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index b0666d6629..4901ee4468 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -211,6 +211,7 @@ struct neigh_table | |||
211 | #define NEIGH_UPDATE_F_ADMIN 0x80000000 | 211 | #define NEIGH_UPDATE_F_ADMIN 0x80000000 |
212 | 212 | ||
213 | extern void neigh_table_init(struct neigh_table *tbl); | 213 | extern void neigh_table_init(struct neigh_table *tbl); |
214 | extern void neigh_table_init_no_netlink(struct neigh_table *tbl); | ||
214 | extern int neigh_table_clear(struct neigh_table *tbl); | 215 | extern int neigh_table_clear(struct neigh_table *tbl); |
215 | extern struct neighbour * neigh_lookup(struct neigh_table *tbl, | 216 | extern struct neighbour * neigh_lookup(struct neigh_table *tbl, |
216 | const void *pkey, | 217 | const void *pkey, |
diff --git a/include/net/netrom.h b/include/net/netrom.h index a5ee53bce6..e0ca112024 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h | |||
@@ -42,11 +42,11 @@ enum { | |||
42 | #define NR_COND_PEER_RX_BUSY 0x04 | 42 | #define NR_COND_PEER_RX_BUSY 0x04 |
43 | #define NR_COND_OWN_RX_BUSY 0x08 | 43 | #define NR_COND_OWN_RX_BUSY 0x08 |
44 | 44 | ||
45 | #define NR_DEFAULT_T1 (120 * HZ) /* Outstanding frames - 120 seconds */ | 45 | #define NR_DEFAULT_T1 120000 /* Outstanding frames - 120 seconds */ |
46 | #define NR_DEFAULT_T2 (5 * HZ) /* Response delay - 5 seconds */ | 46 | #define NR_DEFAULT_T2 5000 /* Response delay - 5 seconds */ |
47 | #define NR_DEFAULT_N2 3 /* Number of Retries - 3 */ | 47 | #define NR_DEFAULT_N2 3 /* Number of Retries - 3 */ |
48 | #define NR_DEFAULT_T4 (180 * HZ) /* Busy Delay - 180 seconds */ | 48 | #define NR_DEFAULT_T4 180000 /* Busy Delay - 180 seconds */ |
49 | #define NR_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ | 49 | #define NR_DEFAULT_IDLE 0 /* No Activity Timeout - none */ |
50 | #define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */ | 50 | #define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */ |
51 | #define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */ | 51 | #define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */ |
52 | #define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */ | 52 | #define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */ |
diff --git a/include/net/rose.h b/include/net/rose.h index 3249b97960..012b09ed24 100644 --- a/include/net/rose.h +++ b/include/net/rose.h | |||
@@ -49,14 +49,14 @@ enum { | |||
49 | ROSE_STATE_5 /* Deferred Call Acceptance */ | 49 | ROSE_STATE_5 /* Deferred Call Acceptance */ |
50 | }; | 50 | }; |
51 | 51 | ||
52 | #define ROSE_DEFAULT_T0 (180 * HZ) /* Default T10 T20 value */ | 52 | #define ROSE_DEFAULT_T0 180000 /* Default T10 T20 value */ |
53 | #define ROSE_DEFAULT_T1 (200 * HZ) /* Default T11 T21 value */ | 53 | #define ROSE_DEFAULT_T1 200000 /* Default T11 T21 value */ |
54 | #define ROSE_DEFAULT_T2 (180 * HZ) /* Default T12 T22 value */ | 54 | #define ROSE_DEFAULT_T2 180000 /* Default T12 T22 value */ |
55 | #define ROSE_DEFAULT_T3 (180 * HZ) /* Default T13 T23 value */ | 55 | #define ROSE_DEFAULT_T3 180000 /* Default T13 T23 value */ |
56 | #define ROSE_DEFAULT_HB (5 * HZ) /* Default Holdback value */ | 56 | #define ROSE_DEFAULT_HB 5000 /* Default Holdback value */ |
57 | #define ROSE_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ | 57 | #define ROSE_DEFAULT_IDLE 0 /* No Activity Timeout - none */ |
58 | #define ROSE_DEFAULT_ROUTING 1 /* Default routing flag */ | 58 | #define ROSE_DEFAULT_ROUTING 1 /* Default routing flag */ |
59 | #define ROSE_DEFAULT_FAIL_TIMEOUT (120 * HZ) /* Time until link considered usable */ | 59 | #define ROSE_DEFAULT_FAIL_TIMEOUT 120000 /* Time until link considered usable */ |
60 | #define ROSE_DEFAULT_MAXVC 50 /* Maximum number of VCs per neighbour */ | 60 | #define ROSE_DEFAULT_MAXVC 50 /* Maximum number of VCs per neighbour */ |
61 | #define ROSE_DEFAULT_WINDOW_SIZE 7 /* Default window size */ | 61 | #define ROSE_DEFAULT_WINDOW_SIZE 7 /* Default window size */ |
62 | 62 | ||
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 34a1a09e5a..807d6f1ef4 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -99,6 +99,7 @@ typedef enum { | |||
99 | SCTP_CMD_DEL_NON_PRIMARY, /* Removes non-primary peer transports. */ | 99 | SCTP_CMD_DEL_NON_PRIMARY, /* Removes non-primary peer transports. */ |
100 | SCTP_CMD_T3_RTX_TIMERS_STOP, /* Stops T3-rtx pending timers */ | 100 | SCTP_CMD_T3_RTX_TIMERS_STOP, /* Stops T3-rtx pending timers */ |
101 | SCTP_CMD_FORCE_PRIM_RETRAN, /* Forces retrans. over primary path. */ | 101 | SCTP_CMD_FORCE_PRIM_RETRAN, /* Forces retrans. over primary path. */ |
102 | SCTP_CMD_SET_SK_ERR, /* Set sk_err */ | ||
102 | SCTP_CMD_LAST | 103 | SCTP_CMD_LAST |
103 | } sctp_verb_t; | 104 | } sctp_verb_t; |
104 | 105 | ||
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index e673b2c984..aa6033ca7c 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -461,12 +461,12 @@ static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu) | |||
461 | * there is room for a param header too. | 461 | * there is room for a param header too. |
462 | */ | 462 | */ |
463 | #define sctp_walk_params(pos, chunk, member)\ | 463 | #define sctp_walk_params(pos, chunk, member)\ |
464 | _sctp_walk_params((pos), (chunk), WORD_ROUND(ntohs((chunk)->chunk_hdr.length)), member) | 464 | _sctp_walk_params((pos), (chunk), ntohs((chunk)->chunk_hdr.length), member) |
465 | 465 | ||
466 | #define _sctp_walk_params(pos, chunk, end, member)\ | 466 | #define _sctp_walk_params(pos, chunk, end, member)\ |
467 | for (pos.v = chunk->member;\ | 467 | for (pos.v = chunk->member;\ |
468 | pos.v <= (void *)chunk + end - sizeof(sctp_paramhdr_t) &&\ | 468 | pos.v <= (void *)chunk + end - sizeof(sctp_paramhdr_t) &&\ |
469 | pos.v <= (void *)chunk + end - WORD_ROUND(ntohs(pos.p->length)) &&\ | 469 | pos.v <= (void *)chunk + end - ntohs(pos.p->length) &&\ |
470 | ntohs(pos.p->length) >= sizeof(sctp_paramhdr_t);\ | 470 | ntohs(pos.p->length) >= sizeof(sctp_paramhdr_t);\ |
471 | pos.v += WORD_ROUND(ntohs(pos.p->length))) | 471 | pos.v += WORD_ROUND(ntohs(pos.p->length))) |
472 | 472 | ||
@@ -477,7 +477,7 @@ _sctp_walk_errors((err), (chunk_hdr), ntohs((chunk_hdr)->length)) | |||
477 | for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ | 477 | for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ |
478 | sizeof(sctp_chunkhdr_t));\ | 478 | sizeof(sctp_chunkhdr_t));\ |
479 | (void *)err <= (void *)chunk_hdr + end - sizeof(sctp_errhdr_t) &&\ | 479 | (void *)err <= (void *)chunk_hdr + end - sizeof(sctp_errhdr_t) &&\ |
480 | (void *)err <= (void *)chunk_hdr + end - WORD_ROUND(ntohs(err->length)) &&\ | 480 | (void *)err <= (void *)chunk_hdr + end - ntohs(err->length) &&\ |
481 | ntohs(err->length) >= sizeof(sctp_errhdr_t); \ | 481 | ntohs(err->length) >= sizeof(sctp_errhdr_t); \ |
482 | err = (sctp_errhdr_t *)((void *)err + WORD_ROUND(ntohs(err->length)))) | 482 | err = (sctp_errhdr_t *)((void *)err + WORD_ROUND(ntohs(err->length)))) |
483 | 483 | ||
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index eba99f3755..7f4fea173f 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -712,6 +712,7 @@ struct sctp_chunk { | |||
712 | __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ | 712 | __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ |
713 | __s8 fast_retransmit; /* Is this chunk fast retransmitted? */ | 713 | __s8 fast_retransmit; /* Is this chunk fast retransmitted? */ |
714 | __u8 tsn_missing_report; /* Data chunk missing counter. */ | 714 | __u8 tsn_missing_report; /* Data chunk missing counter. */ |
715 | __u8 data_accepted; /* At least 1 chunk in this packet accepted */ | ||
715 | }; | 716 | }; |
716 | 717 | ||
717 | void sctp_chunk_hold(struct sctp_chunk *); | 718 | void sctp_chunk_hold(struct sctp_chunk *); |
diff --git a/include/net/sock.h b/include/net/sock.h index af2b054458..c9fad6fb62 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -279,7 +279,7 @@ static inline int sk_unhashed(const struct sock *sk) | |||
279 | 279 | ||
280 | static inline int sk_hashed(const struct sock *sk) | 280 | static inline int sk_hashed(const struct sock *sk) |
281 | { | 281 | { |
282 | return sk->sk_node.pprev != NULL; | 282 | return !sk_unhashed(sk); |
283 | } | 283 | } |
284 | 284 | ||
285 | static __inline__ void sk_node_init(struct hlist_node *node) | 285 | static __inline__ void sk_node_init(struct hlist_node *node) |
@@ -454,6 +454,7 @@ static inline void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk) | |||
454 | 454 | ||
455 | static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb) | 455 | static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb) |
456 | { | 456 | { |
457 | skb_truesize_check(skb); | ||
457 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); | 458 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); |
458 | sk->sk_wmem_queued -= skb->truesize; | 459 | sk->sk_wmem_queued -= skb->truesize; |
459 | sk->sk_forward_alloc += skb->truesize; | 460 | sk->sk_forward_alloc += skb->truesize; |
diff --git a/include/net/x25device.h b/include/net/x25device.h index 1a318374fa..1d10c879f7 100644 --- a/include/net/x25device.h +++ b/include/net/x25device.h | |||
@@ -8,6 +8,7 @@ | |||
8 | static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) | 8 | static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) |
9 | { | 9 | { |
10 | skb->mac.raw = skb->data; | 10 | skb->mac.raw = skb->data; |
11 | skb->dev = dev; | ||
11 | skb->pkt_type = PACKET_HOST; | 12 | skb->pkt_type = PACKET_HOST; |
12 | 13 | ||
13 | return htons(ETH_P_X25); | 14 | return htons(ETH_P_X25); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e100291e43..afa508d92c 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -143,6 +143,11 @@ struct xfrm_state | |||
143 | /* Replay detection state at the time we sent the last notification */ | 143 | /* Replay detection state at the time we sent the last notification */ |
144 | struct xfrm_replay_state preplay; | 144 | struct xfrm_replay_state preplay; |
145 | 145 | ||
146 | /* internal flag that only holds state for delayed aevent at the | ||
147 | * moment | ||
148 | */ | ||
149 | u32 xflags; | ||
150 | |||
146 | /* Replay detection notification settings */ | 151 | /* Replay detection notification settings */ |
147 | u32 replay_maxage; | 152 | u32 replay_maxage; |
148 | u32 replay_maxdiff; | 153 | u32 replay_maxdiff; |
@@ -168,6 +173,9 @@ struct xfrm_state | |||
168 | void *data; | 173 | void *data; |
169 | }; | 174 | }; |
170 | 175 | ||
176 | /* xflags - make enum if more show up */ | ||
177 | #define XFRM_TIME_DEFER 1 | ||
178 | |||
171 | enum { | 179 | enum { |
172 | XFRM_STATE_VOID, | 180 | XFRM_STATE_VOID, |
173 | XFRM_STATE_ACQ, | 181 | XFRM_STATE_ACQ, |
@@ -242,7 +250,6 @@ extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); | |||
242 | 250 | ||
243 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); | 251 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); |
244 | 252 | ||
245 | struct xfrm_decap_state; | ||
246 | struct xfrm_type | 253 | struct xfrm_type |
247 | { | 254 | { |
248 | char *description; | 255 | char *description; |
@@ -251,7 +258,7 @@ struct xfrm_type | |||
251 | 258 | ||
252 | int (*init_state)(struct xfrm_state *x); | 259 | int (*init_state)(struct xfrm_state *x); |
253 | void (*destructor)(struct xfrm_state *); | 260 | void (*destructor)(struct xfrm_state *); |
254 | int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); | 261 | int (*input)(struct xfrm_state *, struct sk_buff *skb); |
255 | int (*output)(struct xfrm_state *, struct sk_buff *pskb); | 262 | int (*output)(struct xfrm_state *, struct sk_buff *pskb); |
256 | /* Estimate maximal size of result of transformation of a dgram */ | 263 | /* Estimate maximal size of result of transformation of a dgram */ |
257 | u32 (*get_max_size)(struct xfrm_state *, int size); | 264 | u32 (*get_max_size)(struct xfrm_state *, int size); |
@@ -606,25 +613,11 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | |||
606 | 613 | ||
607 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); | 614 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); |
608 | 615 | ||
609 | /* Decapsulation state, used by the input to store data during | ||
610 | * decapsulation procedure, to be used later (during the policy | ||
611 | * check | ||
612 | */ | ||
613 | struct xfrm_decap_state { | ||
614 | char decap_data[20]; | ||
615 | __u16 decap_type; | ||
616 | }; | ||
617 | |||
618 | struct sec_decap_state { | ||
619 | struct xfrm_state *xvec; | ||
620 | struct xfrm_decap_state decap; | ||
621 | }; | ||
622 | |||
623 | struct sec_path | 616 | struct sec_path |
624 | { | 617 | { |
625 | atomic_t refcnt; | 618 | atomic_t refcnt; |
626 | int len; | 619 | int len; |
627 | struct sec_decap_state x[XFRM_MAX_DEPTH]; | 620 | struct xfrm_state *xvec[XFRM_MAX_DEPTH]; |
628 | }; | 621 | }; |
629 | 622 | ||
630 | static inline struct sec_path * | 623 | static inline struct sec_path * |
diff --git a/include/pcmcia/bulkmem.h b/include/pcmcia/bulkmem.h index b53b78d497..6bc7472293 100644 --- a/include/pcmcia/bulkmem.h +++ b/include/pcmcia/bulkmem.h | |||
@@ -35,7 +35,7 @@ typedef struct region_info_t { | |||
35 | #define REGION_BAR_MASK 0xe000 | 35 | #define REGION_BAR_MASK 0xe000 |
36 | #define REGION_BAR_SHIFT 13 | 36 | #define REGION_BAR_SHIFT 13 |
37 | 37 | ||
38 | int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn); | 38 | int pcmcia_get_first_region(struct pcmcia_device *handle, region_info_t *rgn); |
39 | int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn); | 39 | int pcmcia_get_next_region(struct pcmcia_device *handle, region_info_t *rgn); |
40 | 40 | ||
41 | #endif /* _LINUX_BULKMEM_H */ | 41 | #endif /* _LINUX_BULKMEM_H */ |
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index da19c297dd..c1da855833 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * ciscode.h -- Definitions for bulk memory services | 2 | * ciscode.h |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
@@ -122,4 +122,7 @@ | |||
122 | 122 | ||
123 | #define MANFID_XIRCOM 0x0105 | 123 | #define MANFID_XIRCOM 0x0105 |
124 | 124 | ||
125 | #define MANFID_POSSIO 0x030c | ||
126 | #define PRODID_POSSIO_GCC 0x0003 | ||
127 | |||
125 | #endif /* _LINUX_CISCODE_H */ | 128 | #endif /* _LINUX_CISCODE_H */ |
diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h index c6a069554f..d3bbb19caf 100644 --- a/include/pcmcia/cistpl.h +++ b/include/pcmcia/cistpl.h | |||
@@ -586,12 +586,7 @@ typedef struct cisdump_t { | |||
586 | cisdata_t Data[CISTPL_MAX_CIS_SIZE]; | 586 | cisdata_t Data[CISTPL_MAX_CIS_SIZE]; |
587 | } cisdump_t; | 587 | } cisdump_t; |
588 | 588 | ||
589 | int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple); | ||
590 | int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple); | ||
591 | int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple); | ||
592 | int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse); | ||
593 | 589 | ||
594 | int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info); | ||
595 | int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis); | 590 | int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis); |
596 | 591 | ||
597 | /* don't use outside of PCMCIA core yet */ | 592 | /* don't use outside of PCMCIA core yet */ |
@@ -602,4 +597,20 @@ int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse); | |||
602 | 597 | ||
603 | int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info); | 598 | int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info); |
604 | 599 | ||
600 | /* ... but use these wrappers instead */ | ||
601 | #define pcmcia_get_first_tuple(p_dev, tuple) \ | ||
602 | pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple) | ||
603 | |||
604 | #define pcmcia_get_next_tuple(p_dev, tuple) \ | ||
605 | pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple) | ||
606 | |||
607 | #define pcmcia_get_tuple_data(p_dev, tuple) \ | ||
608 | pccard_get_tuple_data(p_dev->socket, tuple) | ||
609 | |||
610 | #define pcmcia_parse_tuple(p_dev, tuple, parse) \ | ||
611 | pccard_parse_tuple(tuple, parse) | ||
612 | |||
613 | #define pcmcia_validate_cis(p_dev, info) \ | ||
614 | pccard_validate_cis(p_dev->socket, p_dev->func, info) | ||
615 | |||
605 | #endif /* LINUX_CISTPL_H */ | 616 | #endif /* LINUX_CISTPL_H */ |
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 52660f3266..d5838c30d2 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h | |||
@@ -109,17 +109,6 @@ typedef struct client_req_t { | |||
109 | 109 | ||
110 | #define CLIENT_THIS_SOCKET 0x01 | 110 | #define CLIENT_THIS_SOCKET 0x01 |
111 | 111 | ||
112 | /* For RegisterClient */ | ||
113 | typedef struct client_reg_t { | ||
114 | dev_info_t *dev_info; | ||
115 | u_int Attributes; /* UNUSED */ | ||
116 | u_int EventMask; | ||
117 | int (*event_handler)(event_t event, int priority, | ||
118 | event_callback_args_t *); | ||
119 | event_callback_args_t event_callback_args; | ||
120 | u_int Version; | ||
121 | } client_reg_t; | ||
122 | |||
123 | /* ModifyConfiguration */ | 112 | /* ModifyConfiguration */ |
124 | typedef struct modconf_t { | 113 | typedef struct modconf_t { |
125 | u_int Attributes; | 114 | u_int Attributes; |
@@ -127,15 +116,16 @@ typedef struct modconf_t { | |||
127 | } modconf_t; | 116 | } modconf_t; |
128 | 117 | ||
129 | /* Attributes for ModifyConfiguration */ | 118 | /* Attributes for ModifyConfiguration */ |
130 | #define CONF_IRQ_CHANGE_VALID 0x100 | 119 | #define CONF_IRQ_CHANGE_VALID 0x0100 |
131 | #define CONF_VCC_CHANGE_VALID 0x200 | 120 | #define CONF_VCC_CHANGE_VALID 0x0200 |
132 | #define CONF_VPP1_CHANGE_VALID 0x400 | 121 | #define CONF_VPP1_CHANGE_VALID 0x0400 |
133 | #define CONF_VPP2_CHANGE_VALID 0x800 | 122 | #define CONF_VPP2_CHANGE_VALID 0x0800 |
123 | #define CONF_IO_CHANGE_WIDTH 0x1000 | ||
134 | 124 | ||
135 | /* For RequestConfiguration */ | 125 | /* For RequestConfiguration */ |
136 | typedef struct config_req_t { | 126 | typedef struct config_req_t { |
137 | u_int Attributes; | 127 | u_int Attributes; |
138 | u_int Vcc, Vpp1, Vpp2; | 128 | u_int Vpp; /* both Vpp1 and Vpp2 */ |
139 | u_int IntType; | 129 | u_int IntType; |
140 | u_int ConfigBase; | 130 | u_int ConfigBase; |
141 | u_char Status, Pin, Copy, ExtStatus; | 131 | u_char Status, Pin, Copy, ExtStatus; |
@@ -389,23 +379,27 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status); | |||
389 | int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); | 379 | int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); |
390 | int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); | 380 | int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); |
391 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); | 381 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); |
392 | int pcmcia_release_configuration(struct pcmcia_device *p_dev); | ||
393 | int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req); | ||
394 | int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req); | ||
395 | int pcmcia_release_window(window_handle_t win); | 382 | int pcmcia_release_window(window_handle_t win); |
396 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); | 383 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); |
397 | int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); | 384 | int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); |
398 | int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); | 385 | int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); |
399 | int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh); | 386 | int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh); |
400 | int pcmcia_reset_card(struct pcmcia_device *p_dev, client_req_t *req); | ||
401 | int pcmcia_suspend_card(struct pcmcia_socket *skt); | 387 | int pcmcia_suspend_card(struct pcmcia_socket *skt); |
402 | int pcmcia_resume_card(struct pcmcia_socket *skt); | 388 | int pcmcia_resume_card(struct pcmcia_socket *skt); |
403 | int pcmcia_eject_card(struct pcmcia_socket *skt); | 389 | int pcmcia_eject_card(struct pcmcia_socket *skt); |
404 | int pcmcia_insert_card(struct pcmcia_socket *skt); | 390 | int pcmcia_insert_card(struct pcmcia_socket *skt); |
391 | int pccard_reset_card(struct pcmcia_socket *skt); | ||
392 | |||
393 | struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *p_dev); | ||
394 | void pcmcia_disable_device(struct pcmcia_device *p_dev); | ||
405 | 395 | ||
406 | struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); | 396 | struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); |
407 | void pcmcia_put_socket(struct pcmcia_socket *skt); | 397 | void pcmcia_put_socket(struct pcmcia_socket *skt); |
408 | 398 | ||
399 | /* compatibility functions */ | ||
400 | #define pcmcia_reset_card(p_dev, req) \ | ||
401 | pccard_reset_card(p_dev->socket) | ||
402 | |||
409 | #endif /* __KERNEL__ */ | 403 | #endif /* __KERNEL__ */ |
410 | 404 | ||
411 | #endif /* _LINUX_CS_H */ | 405 | #endif /* _LINUX_CS_H */ |
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 8e2a963964..8c339f5678 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -39,7 +39,7 @@ typedef struct win_info_t { | |||
39 | typedef struct bind_info_t { | 39 | typedef struct bind_info_t { |
40 | dev_info_t dev_info; | 40 | dev_info_t dev_info; |
41 | u_char function; | 41 | u_char function; |
42 | struct dev_link_t *instance; | 42 | struct pcmcia_device *instance; |
43 | char name[DEV_NAME_LEN]; | 43 | char name[DEV_NAME_LEN]; |
44 | u_short major, minor; | 44 | u_short major, minor; |
45 | void *next; | 45 | void *next; |
@@ -96,6 +96,7 @@ typedef union ds_ioctl_arg_t { | |||
96 | 96 | ||
97 | #ifdef __KERNEL__ | 97 | #ifdef __KERNEL__ |
98 | #include <linux/device.h> | 98 | #include <linux/device.h> |
99 | #include <pcmcia/ss.h> | ||
99 | 100 | ||
100 | typedef struct dev_node_t { | 101 | typedef struct dev_node_t { |
101 | char dev_name[DEV_NAME_LEN]; | 102 | char dev_name[DEV_NAME_LEN]; |
@@ -103,34 +104,9 @@ typedef struct dev_node_t { | |||
103 | struct dev_node_t *next; | 104 | struct dev_node_t *next; |
104 | } dev_node_t; | 105 | } dev_node_t; |
105 | 106 | ||
106 | typedef struct dev_link_t { | ||
107 | dev_node_t *dev; | ||
108 | u_int state, open; | ||
109 | wait_queue_head_t pending; | ||
110 | client_handle_t handle; | ||
111 | io_req_t io; | ||
112 | irq_req_t irq; | ||
113 | config_req_t conf; | ||
114 | window_handle_t win; | ||
115 | void *priv; | ||
116 | struct dev_link_t *next; | ||
117 | } dev_link_t; | ||
118 | |||
119 | /* Flags for device state */ | ||
120 | #define DEV_PRESENT 0x01 | ||
121 | #define DEV_CONFIG 0x02 | ||
122 | #define DEV_STALE_CONFIG 0x04 /* release on close */ | ||
123 | #define DEV_STALE_LINK 0x08 /* detach on release */ | ||
124 | #define DEV_CONFIG_PENDING 0x10 | ||
125 | #define DEV_RELEASE_PENDING 0x20 | ||
126 | #define DEV_SUSPEND 0x40 | ||
127 | #define DEV_BUSY 0x80 | ||
128 | |||
129 | #define DEV_OK(l) \ | ||
130 | ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT))) | ||
131 | |||
132 | 107 | ||
133 | struct pcmcia_socket; | 108 | struct pcmcia_socket; |
109 | struct config_t; | ||
134 | 110 | ||
135 | struct pcmcia_driver { | 111 | struct pcmcia_driver { |
136 | int (*probe) (struct pcmcia_device *dev); | 112 | int (*probe) (struct pcmcia_device *dev); |
@@ -148,6 +124,7 @@ struct pcmcia_driver { | |||
148 | int pcmcia_register_driver(struct pcmcia_driver *driver); | 124 | int pcmcia_register_driver(struct pcmcia_driver *driver); |
149 | void pcmcia_unregister_driver(struct pcmcia_driver *driver); | 125 | void pcmcia_unregister_driver(struct pcmcia_driver *driver); |
150 | 126 | ||
127 | |||
151 | struct pcmcia_device { | 128 | struct pcmcia_device { |
152 | /* the socket and the device_no [for multifunction devices] | 129 | /* the socket and the device_no [for multifunction devices] |
153 | uniquely define a pcmcia_device */ | 130 | uniquely define a pcmcia_device */ |
@@ -160,21 +137,40 @@ struct pcmcia_device { | |||
160 | /* the hardware "function" device; certain subdevices can | 137 | /* the hardware "function" device; certain subdevices can |
161 | * share one hardware "function" device. */ | 138 | * share one hardware "function" device. */ |
162 | u8 func; | 139 | u8 func; |
140 | struct config_t* function_config; | ||
163 | 141 | ||
164 | struct list_head socket_device_list; | 142 | struct list_head socket_device_list; |
165 | 143 | ||
166 | /* deprecated, a cleaned up version will be moved into this | 144 | /* deprecated, will be cleaned up soon */ |
167 | struct soon */ | 145 | dev_node_t *dev_node; |
168 | dev_link_t *instance; | 146 | u_int open; |
169 | u_int state; | 147 | io_req_t io; |
148 | irq_req_t irq; | ||
149 | config_req_t conf; | ||
150 | window_handle_t win; | ||
151 | |||
152 | /* Is the device suspended, or in the process of | ||
153 | * being removed? */ | ||
154 | u16 suspended:1; | ||
155 | u16 _removed:1; | ||
156 | |||
157 | /* Flags whether io, irq, win configurations were | ||
158 | * requested, and whether the configuration is "locked" */ | ||
159 | u16 _irq:1; | ||
160 | u16 _io:1; | ||
161 | u16 _win:4; | ||
162 | u16 _locked:1; | ||
163 | |||
164 | /* Flag whether a "fuzzy" func_id based match is | ||
165 | * allowed. */ | ||
166 | u16 allow_func_id_match:1; | ||
170 | 167 | ||
171 | /* information about this device */ | 168 | /* information about this device */ |
172 | u8 has_manf_id:1; | 169 | u16 has_manf_id:1; |
173 | u8 has_card_id:1; | 170 | u16 has_card_id:1; |
174 | u8 has_func_id:1; | 171 | u16 has_func_id:1; |
175 | 172 | ||
176 | u8 allow_func_id_match:1; | 173 | u16 reserved:3; |
177 | u8 reserved:4; | ||
178 | 174 | ||
179 | u8 func_id; | 175 | u8 func_id; |
180 | u16 manf_id; | 176 | u16 manf_id; |
@@ -182,22 +178,24 @@ struct pcmcia_device { | |||
182 | 178 | ||
183 | char * prod_id[4]; | 179 | char * prod_id[4]; |
184 | 180 | ||
181 | struct device dev; | ||
182 | |||
183 | #ifdef CONFIG_PCMCIA_IOCTL | ||
185 | /* device driver wanted by cardmgr */ | 184 | /* device driver wanted by cardmgr */ |
186 | struct pcmcia_driver * cardmgr; | 185 | struct pcmcia_driver * cardmgr; |
186 | #endif | ||
187 | 187 | ||
188 | struct device dev; | 188 | /* data private to drivers */ |
189 | void *priv; | ||
189 | }; | 190 | }; |
190 | 191 | ||
191 | #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) | 192 | #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) |
192 | #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) | 193 | #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) |
193 | 194 | ||
194 | #define handle_to_pdev(handle) (handle) | ||
195 | #define handle_to_dev(handle) (handle->dev) | 195 | #define handle_to_dev(handle) (handle->dev) |
196 | 196 | ||
197 | #define dev_to_instance(dev) (dev->instance) | ||
198 | |||
199 | /* error reporting */ | 197 | /* error reporting */ |
200 | void cs_error(client_handle_t handle, int func, int ret); | 198 | void cs_error(struct pcmcia_device *handle, int func, int ret); |
201 | 199 | ||
202 | #endif /* __KERNEL__ */ | 200 | #endif /* __KERNEL__ */ |
203 | #endif /* _LINUX_DS_H */ | 201 | #endif /* _LINUX_DS_H */ |
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 2889a69a7a..5e0a01ab22 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/config.h> | 18 | #include <linux/config.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/sched.h> /* task_struct, completion */ | 20 | #include <linux/sched.h> /* task_struct, completion */ |
21 | #include <linux/mutex.h> | ||
21 | 22 | ||
22 | #include <pcmcia/cs_types.h> | 23 | #include <pcmcia/cs_types.h> |
23 | #include <pcmcia/cs.h> | 24 | #include <pcmcia/cs.h> |
@@ -146,14 +147,15 @@ extern struct pccard_resource_ops pccard_static_ops; | |||
146 | /* !SS_CAP_STATIC_MAP */ | 147 | /* !SS_CAP_STATIC_MAP */ |
147 | extern struct pccard_resource_ops pccard_nonstatic_ops; | 148 | extern struct pccard_resource_ops pccard_nonstatic_ops; |
148 | 149 | ||
150 | /* static mem, dynamic IO sockets */ | ||
151 | extern struct pccard_resource_ops pccard_iodyn_ops; | ||
152 | |||
149 | /* | 153 | /* |
150 | * Calls to set up low-level "Socket Services" drivers | 154 | * Calls to set up low-level "Socket Services" drivers |
151 | */ | 155 | */ |
152 | struct pcmcia_socket; | 156 | struct pcmcia_socket; |
153 | 157 | ||
154 | typedef struct io_window_t { | 158 | typedef struct io_window_t { |
155 | u_int Attributes; | ||
156 | kio_addr_t BasePort, NumPorts; | ||
157 | kio_addr_t InUse, Config; | 159 | kio_addr_t InUse, Config; |
158 | struct resource *res; | 160 | struct resource *res; |
159 | } io_window_t; | 161 | } io_window_t; |
@@ -162,7 +164,7 @@ typedef struct io_window_t { | |||
162 | typedef struct window_t { | 164 | typedef struct window_t { |
163 | u_short magic; | 165 | u_short magic; |
164 | u_short index; | 166 | u_short index; |
165 | client_handle_t handle; | 167 | struct pcmcia_device *handle; |
166 | struct pcmcia_socket *sock; | 168 | struct pcmcia_socket *sock; |
167 | pccard_mem_map ctl; | 169 | pccard_mem_map ctl; |
168 | } window_t; | 170 | } window_t; |
@@ -186,7 +188,6 @@ struct pcmcia_socket { | |||
186 | u_short lock_count; | 188 | u_short lock_count; |
187 | pccard_mem_map cis_mem; | 189 | pccard_mem_map cis_mem; |
188 | void __iomem *cis_virt; | 190 | void __iomem *cis_virt; |
189 | struct config_t *config; | ||
190 | struct { | 191 | struct { |
191 | u_int AssignedIRQ; | 192 | u_int AssignedIRQ; |
192 | u_int Config; | 193 | u_int Config; |
@@ -241,7 +242,7 @@ struct pcmcia_socket { | |||
241 | #endif | 242 | #endif |
242 | 243 | ||
243 | /* state thread */ | 244 | /* state thread */ |
244 | struct semaphore skt_sem; /* protects socket h/w state */ | 245 | struct mutex skt_mutex; /* protects socket h/w state */ |
245 | 246 | ||
246 | struct task_struct *thread; | 247 | struct task_struct *thread; |
247 | struct completion thread_done; | 248 | struct completion thread_done; |
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h index f404fe21cc..ad63c215ef 100644 --- a/include/rdma/ib_sa.h +++ b/include/rdma/ib_sa.h | |||
@@ -91,34 +91,6 @@ enum ib_sa_selector { | |||
91 | IB_SA_BEST = 3 | 91 | IB_SA_BEST = 3 |
92 | }; | 92 | }; |
93 | 93 | ||
94 | enum ib_sa_rate { | ||
95 | IB_SA_RATE_2_5_GBPS = 2, | ||
96 | IB_SA_RATE_5_GBPS = 5, | ||
97 | IB_SA_RATE_10_GBPS = 3, | ||
98 | IB_SA_RATE_20_GBPS = 6, | ||
99 | IB_SA_RATE_30_GBPS = 4, | ||
100 | IB_SA_RATE_40_GBPS = 7, | ||
101 | IB_SA_RATE_60_GBPS = 8, | ||
102 | IB_SA_RATE_80_GBPS = 9, | ||
103 | IB_SA_RATE_120_GBPS = 10 | ||
104 | }; | ||
105 | |||
106 | static inline int ib_sa_rate_enum_to_int(enum ib_sa_rate rate) | ||
107 | { | ||
108 | switch (rate) { | ||
109 | case IB_SA_RATE_2_5_GBPS: return 1; | ||
110 | case IB_SA_RATE_5_GBPS: return 2; | ||
111 | case IB_SA_RATE_10_GBPS: return 4; | ||
112 | case IB_SA_RATE_20_GBPS: return 8; | ||
113 | case IB_SA_RATE_30_GBPS: return 12; | ||
114 | case IB_SA_RATE_40_GBPS: return 16; | ||
115 | case IB_SA_RATE_60_GBPS: return 24; | ||
116 | case IB_SA_RATE_80_GBPS: return 32; | ||
117 | case IB_SA_RATE_120_GBPS: return 48; | ||
118 | default: return -1; | ||
119 | } | ||
120 | } | ||
121 | |||
122 | /* | 94 | /* |
123 | * Structures for SA records are named "struct ib_sa_xxx_rec." No | 95 | * Structures for SA records are named "struct ib_sa_xxx_rec." No |
124 | * attempt is made to pack structures to match the physical layout of | 96 | * attempt is made to pack structures to match the physical layout of |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index c1ad6273ac..6bbf1b3644 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -314,6 +314,34 @@ enum ib_ah_flags { | |||
314 | IB_AH_GRH = 1 | 314 | IB_AH_GRH = 1 |
315 | }; | 315 | }; |
316 | 316 | ||
317 | enum ib_rate { | ||
318 | IB_RATE_PORT_CURRENT = 0, | ||
319 | IB_RATE_2_5_GBPS = 2, | ||
320 | IB_RATE_5_GBPS = 5, | ||
321 | IB_RATE_10_GBPS = 3, | ||
322 | IB_RATE_20_GBPS = 6, | ||
323 | IB_RATE_30_GBPS = 4, | ||
324 | IB_RATE_40_GBPS = 7, | ||
325 | IB_RATE_60_GBPS = 8, | ||
326 | IB_RATE_80_GBPS = 9, | ||
327 | IB_RATE_120_GBPS = 10 | ||
328 | }; | ||
329 | |||
330 | /** | ||
331 | * ib_rate_to_mult - Convert the IB rate enum to a multiple of the | ||
332 | * base rate of 2.5 Gbit/sec. For example, IB_RATE_5_GBPS will be | ||
333 | * converted to 2, since 5 Gbit/sec is 2 * 2.5 Gbit/sec. | ||
334 | * @rate: rate to convert. | ||
335 | */ | ||
336 | int ib_rate_to_mult(enum ib_rate rate) __attribute_const__; | ||
337 | |||
338 | /** | ||
339 | * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate | ||
340 | * enum. | ||
341 | * @mult: multiple to convert. | ||
342 | */ | ||
343 | enum ib_rate mult_to_ib_rate(int mult) __attribute_const__; | ||
344 | |||
317 | struct ib_ah_attr { | 345 | struct ib_ah_attr { |
318 | struct ib_global_route grh; | 346 | struct ib_global_route grh; |
319 | u16 dlid; | 347 | u16 dlid; |
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h index 174101b206..d31b16d25a 100644 --- a/include/scsi/scsi_devinfo.h +++ b/include/scsi/scsi_devinfo.h | |||
@@ -28,4 +28,5 @@ | |||
28 | #define BLIST_NO_ULD_ATTACH 0x100000 /* device is actually for RAID config */ | 28 | #define BLIST_NO_ULD_ATTACH 0x100000 /* device is actually for RAID config */ |
29 | #define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */ | 29 | #define BLIST_SELECT_NO_ATN 0x200000 /* select without ATN */ |
30 | #define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ | 30 | #define BLIST_RETRY_HWERROR 0x400000 /* retry HARDWARE_ERROR */ |
31 | #define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ | ||
31 | #endif | 32 | #endif |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index dc6862d09e..de6ce541a0 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -140,7 +140,6 @@ struct scsi_host_template { | |||
140 | * | 140 | * |
141 | * Status: REQUIRED (at least one of them) | 141 | * Status: REQUIRED (at least one of them) |
142 | */ | 142 | */ |
143 | int (* eh_strategy_handler)(struct Scsi_Host *); | ||
144 | int (* eh_abort_handler)(struct scsi_cmnd *); | 143 | int (* eh_abort_handler)(struct scsi_cmnd *); |
145 | int (* eh_device_reset_handler)(struct scsi_cmnd *); | 144 | int (* eh_device_reset_handler)(struct scsi_cmnd *); |
146 | int (* eh_bus_reset_handler)(struct scsi_cmnd *); | 145 | int (* eh_bus_reset_handler)(struct scsi_cmnd *); |
diff --git a/include/scsi/scsi_ioctl.h b/include/scsi/scsi_ioctl.h index d4be4d92d5..edb9525386 100644 --- a/include/scsi/scsi_ioctl.h +++ b/include/scsi/scsi_ioctl.h | |||
@@ -41,8 +41,6 @@ typedef struct scsi_fctargaddress { | |||
41 | } Scsi_FCTargAddress; | 41 | } Scsi_FCTargAddress; |
42 | 42 | ||
43 | extern int scsi_ioctl(struct scsi_device *, int, void __user *); | 43 | extern int scsi_ioctl(struct scsi_device *, int, void __user *); |
44 | extern int scsi_ioctl_send_command(struct scsi_device *, | ||
45 | struct scsi_ioctl_command __user *); | ||
46 | extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, | 44 | extern int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, |
47 | void __user *arg, struct file *filp); | 45 | void __user *arg, struct file *filp); |
48 | 46 | ||
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h index b3657f1119..cca1d4926d 100644 --- a/include/scsi/scsi_transport.h +++ b/include/scsi/scsi_transport.h | |||
@@ -50,6 +50,11 @@ struct scsi_transport_template { | |||
50 | unsigned int create_work_queue : 1; | 50 | unsigned int create_work_queue : 1; |
51 | 51 | ||
52 | /* | 52 | /* |
53 | * Allows a transport to override the default error handler. | ||
54 | */ | ||
55 | void (* eh_strategy_handler)(struct Scsi_Host *); | ||
56 | |||
57 | /* | ||
53 | * This is an optional routine that allows the transport to become | 58 | * This is an optional routine that allows the transport to become |
54 | * involved when a scsi io timer fires. The return value tells the | 59 | * involved when a scsi io timer fires. The return value tells the |
55 | * timer routine how to finish the io timeout handling: | 60 | * timer routine how to finish the io timeout handling: |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index cf3fec8be1..5626225bd3 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -202,12 +202,19 @@ struct fc_rport { /* aka fc_starget_attrs */ | |||
202 | /* internal data */ | 202 | /* internal data */ |
203 | unsigned int channel; | 203 | unsigned int channel; |
204 | u32 number; | 204 | u32 number; |
205 | u8 flags; | ||
205 | struct list_head peers; | 206 | struct list_head peers; |
206 | struct device dev; | 207 | struct device dev; |
207 | struct work_struct dev_loss_work; | 208 | struct work_struct dev_loss_work; |
208 | struct work_struct scan_work; | 209 | struct work_struct scan_work; |
210 | struct work_struct stgt_delete_work; | ||
211 | struct work_struct rport_delete_work; | ||
209 | } __attribute__((aligned(sizeof(unsigned long)))); | 212 | } __attribute__((aligned(sizeof(unsigned long)))); |
210 | 213 | ||
214 | /* bit field values for struct fc_rport "flags" field: */ | ||
215 | #define FC_RPORT_DEVLOSS_PENDING 0x01 | ||
216 | #define FC_RPORT_SCAN_PENDING 0x02 | ||
217 | |||
211 | #define dev_to_rport(d) \ | 218 | #define dev_to_rport(d) \ |
212 | container_of(d, struct fc_rport, dev) | 219 | container_of(d, struct fc_rport, dev) |
213 | #define transport_class_to_rport(classdev) \ | 220 | #define transport_class_to_rport(classdev) \ |
@@ -327,13 +334,16 @@ struct fc_host_attrs { | |||
327 | struct list_head rport_bindings; | 334 | struct list_head rport_bindings; |
328 | u32 next_rport_number; | 335 | u32 next_rport_number; |
329 | u32 next_target_id; | 336 | u32 next_target_id; |
330 | u8 flags; | ||
331 | struct work_struct rport_del_work; | ||
332 | }; | ||
333 | 337 | ||
334 | /* values for struct fc_host_attrs "flags" field: */ | 338 | /* work queues for rport state manipulation */ |
335 | #define FC_SHOST_RPORT_DEL_SCHEDULED 0x01 | 339 | char work_q_name[KOBJ_NAME_LEN]; |
340 | struct workqueue_struct *work_q; | ||
341 | char devloss_work_q_name[KOBJ_NAME_LEN]; | ||
342 | struct workqueue_struct *devloss_work_q; | ||
343 | }; | ||
336 | 344 | ||
345 | #define shost_to_fc_host(x) \ | ||
346 | ((struct fc_host_attrs *)(x)->shost_data) | ||
337 | 347 | ||
338 | #define fc_host_node_name(x) \ | 348 | #define fc_host_node_name(x) \ |
339 | (((struct fc_host_attrs *)(x)->shost_data)->node_name) | 349 | (((struct fc_host_attrs *)(x)->shost_data)->node_name) |
@@ -375,10 +385,14 @@ struct fc_host_attrs { | |||
375 | (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) | 385 | (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) |
376 | #define fc_host_next_target_id(x) \ | 386 | #define fc_host_next_target_id(x) \ |
377 | (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) | 387 | (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) |
378 | #define fc_host_flags(x) \ | 388 | #define fc_host_work_q_name(x) \ |
379 | (((struct fc_host_attrs *)(x)->shost_data)->flags) | 389 | (((struct fc_host_attrs *)(x)->shost_data)->work_q_name) |
380 | #define fc_host_rport_del_work(x) \ | 390 | #define fc_host_work_q(x) \ |
381 | (((struct fc_host_attrs *)(x)->shost_data)->rport_del_work) | 391 | (((struct fc_host_attrs *)(x)->shost_data)->work_q) |
392 | #define fc_host_devloss_work_q_name(x) \ | ||
393 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name) | ||
394 | #define fc_host_devloss_work_q(x) \ | ||
395 | (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q) | ||
382 | 396 | ||
383 | 397 | ||
384 | /* The functions by which the transport class and the driver communicate */ | 398 | /* The functions by which the transport class and the driver communicate */ |
@@ -461,10 +475,15 @@ fc_remote_port_chkready(struct fc_rport *rport) | |||
461 | 475 | ||
462 | switch (rport->port_state) { | 476 | switch (rport->port_state) { |
463 | case FC_PORTSTATE_ONLINE: | 477 | case FC_PORTSTATE_ONLINE: |
464 | result = 0; | 478 | if (rport->roles & FC_RPORT_ROLE_FCP_TARGET) |
479 | result = 0; | ||
480 | else if (rport->flags & FC_RPORT_DEVLOSS_PENDING) | ||
481 | result = DID_IMM_RETRY << 16; | ||
482 | else | ||
483 | result = DID_NO_CONNECT << 16; | ||
465 | break; | 484 | break; |
466 | case FC_PORTSTATE_BLOCKED: | 485 | case FC_PORTSTATE_BLOCKED: |
467 | result = DID_BUS_BUSY << 16; | 486 | result = DID_IMM_RETRY << 16; |
468 | break; | 487 | break; |
469 | default: | 488 | default: |
470 | result = DID_NO_CONNECT << 16; | 489 | result = DID_NO_CONNECT << 16; |
diff --git a/include/scsi/srp.h b/include/scsi/srp.h index 6c2681dc5b..637f77eccf 100644 --- a/include/scsi/srp.h +++ b/include/scsi/srp.h | |||
@@ -95,14 +95,15 @@ struct srp_direct_buf { | |||
95 | 95 | ||
96 | /* | 96 | /* |
97 | * We need the packed attribute because the SRP spec puts the list of | 97 | * We need the packed attribute because the SRP spec puts the list of |
98 | * descriptors at an offset of 20, which is not aligned to the size | 98 | * descriptors at an offset of 20, which is not aligned to the size of |
99 | * of struct srp_direct_buf. | 99 | * struct srp_direct_buf. The whole structure must be packed to avoid |
100 | * having the 20-byte structure padded to 24 bytes on 64-bit architectures. | ||
100 | */ | 101 | */ |
101 | struct srp_indirect_buf { | 102 | struct srp_indirect_buf { |
102 | struct srp_direct_buf table_desc; | 103 | struct srp_direct_buf table_desc; |
103 | __be32 len; | 104 | __be32 len; |
104 | struct srp_direct_buf desc_list[0] __attribute__((packed)); | 105 | struct srp_direct_buf desc_list[0]; |
105 | }; | 106 | } __attribute__((packed)); |
106 | 107 | ||
107 | enum { | 108 | enum { |
108 | SRP_MULTICHAN_SINGLE = 0, | 109 | SRP_MULTICHAN_SINGLE = 0, |
@@ -122,6 +123,11 @@ struct srp_login_req { | |||
122 | u8 target_port_id[16]; | 123 | u8 target_port_id[16]; |
123 | }; | 124 | }; |
124 | 125 | ||
126 | /* | ||
127 | * The SRP spec defines the size of the LOGIN_RSP structure to be 52 | ||
128 | * bytes, so it needs to be packed to avoid having it padded to 56 | ||
129 | * bytes on 64-bit architectures. | ||
130 | */ | ||
125 | struct srp_login_rsp { | 131 | struct srp_login_rsp { |
126 | u8 opcode; | 132 | u8 opcode; |
127 | u8 reserved1[3]; | 133 | u8 reserved1[3]; |
@@ -132,7 +138,7 @@ struct srp_login_rsp { | |||
132 | __be16 buf_fmt; | 138 | __be16 buf_fmt; |
133 | u8 rsp_flags; | 139 | u8 rsp_flags; |
134 | u8 reserved2[25]; | 140 | u8 reserved2[25]; |
135 | }; | 141 | } __attribute__((packed)); |
136 | 142 | ||
137 | struct srp_login_rej { | 143 | struct srp_login_rej { |
138 | u8 opcode; | 144 | u8 opcode; |
@@ -207,6 +213,11 @@ enum { | |||
207 | SRP_RSP_FLAG_DIUNDER = 1 << 5 | 213 | SRP_RSP_FLAG_DIUNDER = 1 << 5 |
208 | }; | 214 | }; |
209 | 215 | ||
216 | /* | ||
217 | * The SRP spec defines the size of the RSP structure to be 36 bytes, | ||
218 | * so it needs to be packed to avoid having it padded to 40 bytes on | ||
219 | * 64-bit architectures. | ||
220 | */ | ||
210 | struct srp_rsp { | 221 | struct srp_rsp { |
211 | u8 opcode; | 222 | u8 opcode; |
212 | u8 sol_not; | 223 | u8 sol_not; |
@@ -221,6 +232,6 @@ struct srp_rsp { | |||
221 | __be32 sense_data_len; | 232 | __be32 sense_data_len; |
222 | __be32 resp_data_len; | 233 | __be32 resp_data_len; |
223 | u8 data[0]; | 234 | u8 data[0]; |
224 | }; | 235 | } __attribute__((packed)); |
225 | 236 | ||
226 | #endif /* SCSI_SRP_H */ | 237 | #endif /* SCSI_SRP_H */ |
diff --git a/include/sound/core.h b/include/sound/core.h index 7f32c12b4a..5135147f20 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -170,13 +170,13 @@ static inline void snd_power_change_state(struct snd_card *card, unsigned int st | |||
170 | } | 170 | } |
171 | 171 | ||
172 | /* init.c */ | 172 | /* init.c */ |
173 | int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file); | 173 | int snd_power_wait(struct snd_card *card, unsigned int power_state); |
174 | 174 | ||
175 | #else /* ! CONFIG_PM */ | 175 | #else /* ! CONFIG_PM */ |
176 | 176 | ||
177 | #define snd_power_lock(card) do { (void)(card); } while (0) | 177 | #define snd_power_lock(card) do { (void)(card); } while (0) |
178 | #define snd_power_unlock(card) do { (void)(card); } while (0) | 178 | #define snd_power_unlock(card) do { (void)(card); } while (0) |
179 | static inline int snd_power_wait(struct snd_card *card, unsigned int state, struct file *file) { return 0; } | 179 | static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; } |
180 | #define snd_power_get_state(card) SNDRV_CTL_POWER_D0 | 180 | #define snd_power_get_state(card) SNDRV_CTL_POWER_D0 |
181 | #define snd_power_change_state(card, state) do { (void)(card); } while (0) | 181 | #define snd_power_change_state(card, state) do { (void)(card); } while (0) |
182 | 182 | ||
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 15b885660b..373425895f 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -367,27 +367,27 @@ struct snd_pcm_substream { | |||
367 | struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */ | 367 | struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */ |
368 | struct snd_pcm_group *group; /* pointer to current group */ | 368 | struct snd_pcm_group *group; /* pointer to current group */ |
369 | /* -- assigned files -- */ | 369 | /* -- assigned files -- */ |
370 | struct snd_pcm_file *file; | 370 | void *file; |
371 | struct file *ffile; | 371 | struct file *ffile; |
372 | void (*pcm_release)(struct snd_pcm_substream *); | ||
372 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 373 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
373 | /* -- OSS things -- */ | 374 | /* -- OSS things -- */ |
374 | struct snd_pcm_oss_substream oss; | 375 | struct snd_pcm_oss_substream oss; |
375 | #endif | 376 | #endif |
377 | #ifdef CONFIG_SND_VERBOSE_PROCFS | ||
376 | struct snd_info_entry *proc_root; | 378 | struct snd_info_entry *proc_root; |
377 | struct snd_info_entry *proc_info_entry; | 379 | struct snd_info_entry *proc_info_entry; |
378 | struct snd_info_entry *proc_hw_params_entry; | 380 | struct snd_info_entry *proc_hw_params_entry; |
379 | struct snd_info_entry *proc_sw_params_entry; | 381 | struct snd_info_entry *proc_sw_params_entry; |
380 | struct snd_info_entry *proc_status_entry; | 382 | struct snd_info_entry *proc_status_entry; |
381 | struct snd_info_entry *proc_prealloc_entry; | 383 | struct snd_info_entry *proc_prealloc_entry; |
384 | #endif | ||
382 | /* misc flags */ | 385 | /* misc flags */ |
383 | unsigned int no_mmap_ctrl: 1; | 386 | unsigned int no_mmap_ctrl: 1; |
387 | unsigned int hw_opened: 1; | ||
384 | }; | 388 | }; |
385 | 389 | ||
386 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | ||
387 | #define SUBSTREAM_BUSY(substream) ((substream)->file != NULL || ((substream)->oss.file != NULL)) | ||
388 | #else | ||
389 | #define SUBSTREAM_BUSY(substream) ((substream)->file != NULL) | 390 | #define SUBSTREAM_BUSY(substream) ((substream)->file != NULL) |
390 | #endif | ||
391 | 391 | ||
392 | 392 | ||
393 | struct snd_pcm_str { | 393 | struct snd_pcm_str { |
@@ -402,12 +402,14 @@ struct snd_pcm_str { | |||
402 | struct snd_pcm_oss_stream oss; | 402 | struct snd_pcm_oss_stream oss; |
403 | #endif | 403 | #endif |
404 | struct snd_pcm_file *files; | 404 | struct snd_pcm_file *files; |
405 | #ifdef CONFIG_SND_VERBOSE_PROCFS | ||
405 | struct snd_info_entry *proc_root; | 406 | struct snd_info_entry *proc_root; |
406 | struct snd_info_entry *proc_info_entry; | 407 | struct snd_info_entry *proc_info_entry; |
407 | #ifdef CONFIG_SND_DEBUG | 408 | #ifdef CONFIG_SND_PCM_XRUN_DEBUG |
408 | unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ | 409 | unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ |
409 | struct snd_info_entry *proc_xrun_debug_entry; | 410 | struct snd_info_entry *proc_xrun_debug_entry; |
410 | #endif | 411 | #endif |
412 | #endif | ||
411 | }; | 413 | }; |
412 | 414 | ||
413 | struct snd_pcm { | 415 | struct snd_pcm { |
@@ -460,7 +462,6 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream, | |||
460 | struct snd_pcm_info __user *info); | 462 | struct snd_pcm_info __user *info); |
461 | int snd_pcm_status(struct snd_pcm_substream *substream, | 463 | int snd_pcm_status(struct snd_pcm_substream *substream, |
462 | struct snd_pcm_status *status); | 464 | struct snd_pcm_status *status); |
463 | int snd_pcm_prepare(struct snd_pcm_substream *substream); | ||
464 | int snd_pcm_start(struct snd_pcm_substream *substream); | 465 | int snd_pcm_start(struct snd_pcm_substream *substream); |
465 | int snd_pcm_stop(struct snd_pcm_substream *substream, int status); | 466 | int snd_pcm_stop(struct snd_pcm_substream *substream, int status); |
466 | int snd_pcm_drain_done(struct snd_pcm_substream *substream); | 467 | int snd_pcm_drain_done(struct snd_pcm_substream *substream); |
@@ -468,11 +469,13 @@ int snd_pcm_drain_done(struct snd_pcm_substream *substream); | |||
468 | int snd_pcm_suspend(struct snd_pcm_substream *substream); | 469 | int snd_pcm_suspend(struct snd_pcm_substream *substream); |
469 | int snd_pcm_suspend_all(struct snd_pcm *pcm); | 470 | int snd_pcm_suspend_all(struct snd_pcm *pcm); |
470 | #endif | 471 | #endif |
471 | int snd_pcm_kernel_playback_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); | ||
472 | int snd_pcm_kernel_capture_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); | ||
473 | int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); | 472 | int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg); |
474 | int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct snd_pcm_substream **rsubstream); | 473 | int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct file *file, |
474 | struct snd_pcm_substream **rsubstream); | ||
475 | void snd_pcm_release_substream(struct snd_pcm_substream *substream); | 475 | void snd_pcm_release_substream(struct snd_pcm_substream *substream); |
476 | int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, struct file *file, | ||
477 | struct snd_pcm_substream **rsubstream); | ||
478 | void snd_pcm_detach_substream(struct snd_pcm_substream *substream); | ||
476 | void snd_pcm_vma_notify_data(void *client, void *data); | 479 | void snd_pcm_vma_notify_data(void *client, void *data); |
477 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); | 480 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); |
478 | 481 | ||
@@ -899,7 +902,6 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); | |||
899 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); | 902 | const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); |
900 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); | 903 | int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); |
901 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); | 904 | snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); |
902 | const char *snd_pcm_format_name(snd_pcm_format_t format); | ||
903 | 905 | ||
904 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); | 906 | void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); |
905 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); | 907 | void snd_pcm_set_sync(struct snd_pcm_substream *substream); |
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h index bff0778e19..c854647b6f 100644 --- a/include/sound/pcm_oss.h +++ b/include/sound/pcm_oss.h | |||
@@ -69,14 +69,15 @@ struct snd_pcm_oss_file { | |||
69 | 69 | ||
70 | struct snd_pcm_oss_substream { | 70 | struct snd_pcm_oss_substream { |
71 | unsigned oss: 1; /* oss mode */ | 71 | unsigned oss: 1; /* oss mode */ |
72 | struct snd_pcm_oss_setup *setup; /* active setup */ | 72 | struct snd_pcm_oss_setup setup; /* active setup */ |
73 | struct snd_pcm_oss_file *file; | ||
74 | }; | 73 | }; |
75 | 74 | ||
76 | struct snd_pcm_oss_stream { | 75 | struct snd_pcm_oss_stream { |
77 | struct snd_pcm_oss_setup *setup_list; /* setup list */ | 76 | struct snd_pcm_oss_setup *setup_list; /* setup list */ |
78 | struct mutex setup_mutex; | 77 | struct mutex setup_mutex; |
78 | #ifdef CONFIG_SND_VERBOSE_PROCFS | ||
79 | struct snd_info_entry *proc_entry; | 79 | struct snd_info_entry *proc_entry; |
80 | #endif | ||
80 | }; | 81 | }; |
81 | 82 | ||
82 | struct snd_pcm_oss { | 83 | struct snd_pcm_oss { |